-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
P0Broken core functionality, security issues, critical missing featureBroken core functionality, security issues, critical missing featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on
Description
Describe the bug
When using typescript-sdk on restricted javascript execution environments we get the following error:

This is because restricted javascript environments, like cloudflare workers or deno deploy do not accept eval, or new Function constructions. Since ajv.compile requires these dinamic evaluations, this error is logged to the console.
To Reproduce
Steps to reproduce the behavior:
- Run the server on restricted JS envs like cloudflare workers (wrangler to test it locally)
- Add tools and try to connect to the server. You'll see this error popup
Expected behavior
No error log to be logged to the console if these primitives are not available.
Additional context
Places that should be, somehow, guarded
typescript-sdk/src/server/index.ts
Line 358 in bf81793
| const validate = ajv.compile(params.requestedSchema); |
typescript-sdk/src/client/index.ts
Line 487 in bf81793
| const validator = this._ajv.compile(tool.outputSchema); |
vibegui
Metadata
Metadata
Assignees
Labels
P0Broken core functionality, security issues, critical missing featureBroken core functionality, security issues, critical missing featurebugSomething isn't workingSomething isn't workingready for workEnough information for someone to start working onEnough information for someone to start working on