-
Notifications
You must be signed in to change notification settings - Fork 3
fix(toolsets): add accountIds option to StackOneToolSetConfig #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
dc9f6e5
feat(toolsets): add accountIds option to StackOneToolSetConfig
ryoppippi 70191de
test(toolsets): add tests for accountIds constructor option
ryoppippi e15da29
refactor(toolsets): use MergeExclusive for mutually exclusive account…
ryoppippi 2ab55cd
test(toolsets): update tests for MergeExclusive account config
ryoppippi cac507c
test(toolsets): add type-level tests for StackOneToolSetConfig
ryoppippi c143b14
refactor(toolset): use simplifyDeep
ryoppippi a5e41b7
feat(toolsets): add runtime validation for mutually exclusive account…
ryoppippi 9b614e2
test(toolsets): add runtime validation test for mutually exclusive ac…
ryoppippi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| import { expectTypeOf } from 'vitest'; | ||
| import type { StackOneToolSetConfig } from './toolsets'; | ||
|
|
||
| // Valid configurations - only accountId | ||
| test('StackOneToolSetConfig accepts only accountId', () => { | ||
| expectTypeOf<{ | ||
| apiKey: string; | ||
| accountId: string; | ||
| }>().toExtend<StackOneToolSetConfig>(); | ||
| }); | ||
|
|
||
| // Valid configurations - only accountIds | ||
| test('StackOneToolSetConfig accepts only accountIds', () => { | ||
| expectTypeOf<{ | ||
| apiKey: string; | ||
| accountIds: string[]; | ||
| }>().toExtend<StackOneToolSetConfig>(); | ||
| }); | ||
|
|
||
| // Valid configurations - neither accountId nor accountIds | ||
| test('StackOneToolSetConfig accepts neither accountId nor accountIds', () => { | ||
| expectTypeOf<{ | ||
| apiKey: string; | ||
| }>().toExtend<StackOneToolSetConfig>(); | ||
| }); | ||
|
|
||
| // Invalid configuration - both accountId and accountIds should NOT extend | ||
| test('StackOneToolSetConfig rejects both accountId and accountIds', () => { | ||
| expectTypeOf<{ | ||
| apiKey: string; | ||
| accountId: string; | ||
| accountIds: string[]; | ||
| }>().not.toExtend<StackOneToolSetConfig>(); | ||
| }); | ||
|
|
||
| // Verify accountId can be string or undefined | ||
| test('accountId is typed as string | undefined', () => { | ||
| expectTypeOf<StackOneToolSetConfig['accountId']>().toEqualTypeOf<string | undefined>(); | ||
| }); | ||
|
|
||
| // Verify accountIds can be string[] or undefined | ||
| test('accountIds is typed as string[] | undefined', () => { | ||
| expectTypeOf<StackOneToolSetConfig['accountIds']>().toEqualTypeOf<string[] | undefined>(); | ||
| }); |
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The JSDoc states "When provided, tools will be fetched for all specified accounts" but this is imprecise. The accountIds are stored during construction, but tools are only fetched when fetchTools() is called later. Consider rephrasing to something like "When provided, these account IDs will be used when fetching tools" or "Array of account IDs to use for filtering tools during fetchTools() calls".