e2b-dev / E2B

Secure open source cloud runtime for AI apps & AI agents
https://e2b.dev/docs
Apache License 2.0
7.02k stars 458 forks source link

Improve language runtime detection for SDK #314

Closed mlejva closed 3 months ago

mlejva commented 9 months ago

Currently, we're a bit naive when detecting a language runtime. We only detect if it's a browser or Node.

The platform library we're using isn't able to detect well other runtimes besides Node

Relevant code: https://github.com/e2b-dev/E2B/blob/bd3b5b9f9b6ce847ebfeb8bf8b60a3268be17c84/packages/js-sdk/src/api/metadata.ts#L10 https://github.com/e2b-dev/E2B/blob/bd3b5b9f9b6ce847ebfeb8bf8b60a3268be17c84/packages/js-sdk/src/api/metadata.ts#L13

Describe the solution you'd like We should be able to detect at least Node, Deno, and Bun.

ValentaTomas commented 3 months ago

Fixed on beta branch during ensuring compatibility with Deno and Bun.