-
Notifications
You must be signed in to change notification settings - Fork 556
[tiny-agents] Handle env variables in tiny-agents (JS client) #1501
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,14 @@ export const ServerConfigSchema = z.discriminatedUnion("type", [ | |
| url: z.union([z.string(), z.string().url()]), | ||
| options: z | ||
| .object({ | ||
| /** | ||
| * Customizes HTTP requests to the server. | ||
| */ | ||
| requestInit: z | ||
| .object({ | ||
| headers: z.record(z.string()).optional(), | ||
| }) | ||
| .optional(), | ||
|
Comment on lines
+24
to
+31
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. semi-related comment for @Wauplin, @hanouticelina and @evalstate: i am starting to think we should have gone with a simplified configuration schema (the one from VS Code, probably), rather than be more explicit and use the types from the MCP SDK, given here for instance, we need to nest the headers quite a bit inside of the config. Maybe for a v2 we'll change this! no rush, though
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well making the switch to something more standard right now is probably better (not in this PR but as follow-up). Agree the |
||
| /** | ||
| * Session ID for the connection. This is used to identify the session on the server. | ||
| * When not provided and connecting to a server that supports session IDs, the server will generate a new session ID. | ||
|
|
@@ -34,7 +42,18 @@ export const ServerConfigSchema = z.discriminatedUnion("type", [ | |
| type: z.literal("sse"), | ||
| config: z.object({ | ||
| url: z.union([z.string(), z.string().url()]), | ||
| options: z.object({}).optional(), | ||
| options: z | ||
| .object({ | ||
| /** | ||
| * Customizes HTTP requests to the server. | ||
| */ | ||
| requestInit: z | ||
| .object({ | ||
| headers: z.record(z.string()).optional(), | ||
| }) | ||
| .optional(), | ||
| }) | ||
| .optional(), | ||
| }), | ||
| }), | ||
| ]); | ||
|
|
||
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.
note: Claude 4 generated
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.
👀 well Claude could have done some refactoring efforts instead of duplicating the entire "load from env" logic ^^