Open-source, secure environment with real-world tools for enterprise-grade agents.
Python agentaiai-agentai-agentscode-interpretercopilotdevelopmentdevtoolsgptgpt-4javascriptllmnextjsopenaipythonreactsoftwaretypescript
make js-sdk methods more prominent
0div32e4d6cf9373
diff --git a/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v1.0.5/errors/page.mdx b/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v1.0.5/errors/page.mdxindex 0eae57a6b..5be34eb95 100644--- a/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v1.0.5/errors/page.mdx+++ b/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v1.0.5/errors/page.mdx@@ -1,12 +1,10 @@-## Classes-### AuthenticationErrorThrown when authentication fails.#### Constructors-##### new AuthenticationError()+### new AuthenticationError()```tsnew AuthenticationError(message: any): AuthenticationError@@ -22,10 +20,6 @@ new AuthenticationError(message: any): AuthenticationError`AuthenticationError`-###### Defined in--errors.ts:72-***### InvalidArgumentError@@ -34,7 +28,7 @@ Thrown when an invalid argument is provided.#### Constructors-##### new InvalidArgumentError()+### new InvalidArgumentError()```tsnew InvalidArgumentError(message: string): InvalidArgumentError@@ -50,10 +44,6 @@ new InvalidArgumentError(message: string): InvalidArgumentError`InvalidArgumentError`-###### Defined in--errors.ts:42-***### NotEnoughSpaceError@@ -62,7 +52,7 @@ Thrown when there is not enough disk space.#### Constructors-##### new NotEnoughSpaceError()+### new NotEnoughSpaceError()```tsnew NotEnoughSpaceError(message: string): NotEnoughSpaceError@@ -78,10 +68,6 @@ new NotEnoughSpaceError(message: string): NotEnoughSpaceError`NotEnoughSpaceError`-###### Defined in--errors.ts:52-***### NotFoundError@@ -90,7 +76,7 @@ Thrown when a resource is not found.#### Constructors-##### new NotFoundError()+### new NotFoundError()```tsnew NotFoundError(message: string): NotFoundError@@ -106,10 +92,6 @@ new NotFoundError(message: string): NotFoundError`NotFoundError`-###### Defined in--errors.ts:62-***### RateLimitError@@ -118,7 +100,7 @@ Thrown when the API rate limit is exceeded.#### Constructors-##### new RateLimitError()+### new RateLimitError()```tsnew RateLimitError(message: any): RateLimitError@@ -134,10 +116,6 @@ new RateLimitError(message: any): RateLimitError`RateLimitError`-###### Defined in--errors.ts:92-***### SandboxError@@ -158,7 +136,7 @@ Thrown when general sandbox errors occur.#### Constructors-##### new SandboxError()+### new SandboxError()```tsnew SandboxError(message: any): SandboxError@@ -174,10 +152,6 @@ new SandboxError(message: any): SandboxError`SandboxError`-###### Defined in--errors.ts:14-***### TemplateError@@ -186,7 +160,7 @@ Thrown when the template uses old envd version. It isn't compatible with the new#### Constructors-##### new TemplateError()+### new TemplateError()```tsnew TemplateError(message: string): TemplateError@@ -202,10 +176,6 @@ new TemplateError(message: string): TemplateError`TemplateError`-###### Defined in--errors.ts:82-***### TimeoutError@@ -222,7 +192,7 @@ The [unknown] error type is sometimes caused by the sandbox timeout when the req#### Constructors-##### new TimeoutError()+### new TimeoutError()```tsnew TimeoutError(message: string): TimeoutError@@ -238,10 +208,6 @@ new TimeoutError(message: string): TimeoutError`TimeoutError`-###### Defined in--errors.ts:32-## Functions### formatSandboxTimeoutError()@@ -259,7 +225,3 @@ function formatSandboxTimeoutError(message: string): TimeoutError#### Returns`TimeoutError`--#### Defined in--errors.ts:2diff --git a/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v1.0.5/filesystem/page.mdx b/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v1.0.5/filesystem/page.mdxindex e2a0bbd7a..a45da2558 100644--- a/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v1.0.5/filesystem/page.mdx+++ b/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v1.0.5/filesystem/page.mdx@@ -1,15 +1,13 @@-## Enumerations-### FileTypeSandbox filesystem object type.#### Enumeration Members-| Enumeration Member | Value | Description | Defined in |-| ------ | ------ | ------ | ------ |-| `DIR` | `"dir"` | Filesystem object is a directory. | sandbox/filesystem/index.ts:54 |-| `FILE` | `"file"` | Filesystem object is a file. | sandbox/filesystem/index.ts:50 |+| Enumeration Member | Value | Description |+| ------ | ------ | ------ |+| `DIR` | `"dir"` | Filesystem object is a directory. |+| `FILE` | `"file"` | Filesystem object is a file. |## Classes@@ -19,7 +17,7 @@ Module for interacting with the sandbox filesystem.#### Constructors-##### new Filesystem()+### new Filesystem()```tsnew Filesystem(@@ -40,13 +38,9 @@ new Filesystem(`Filesystem`-###### Defined in--sandbox/filesystem/index.ts:103-#### Methods-##### exists()+### exists()```tsexists(path: string, opts?: FilesystemRequestOpts): Promise<boolean>@@ -67,11 +61,7 @@ Check if a file or a directory exists.`true` if the file or directory exists, `false` otherwise-###### Defined in--sandbox/filesystem/index.ts:401--##### list()+### list()```tslist(path: string, opts?: FilesystemRequestOpts): Promise<EntryInfo[]>@@ -92,11 +82,7 @@ List entries in a directory.list of entries in the sandbox filesystem directory.-###### Defined in--sandbox/filesystem/index.ts:272--##### makeDir()+### makeDir()```tsmakeDir(path: string, opts?: FilesystemRequestOpts): Promise<boolean>@@ -117,11 +103,7 @@ Create a new directory and all directories along the way if needed on the specif`true` if the directory was created, `false` if it already exists.-###### Defined in--sandbox/filesystem/index.ts:310--##### read()+### read()###### read(path, opts)@@ -146,10 +128,6 @@ You can pass `text`, `bytes`, `blob`, or `stream` to `opts.format` to change thefile content as string-###### Defined in--sandbox/filesystem/index.ts:122-###### read(path, opts)```ts@@ -173,10 +151,6 @@ You can pass `text`, `bytes`, `blob`, or `stream` to `opts.format` to change thefile content as `Uint8Array`-###### Defined in--sandbox/filesystem/index.ts:137-###### read(path, opts)```ts@@ -200,10 +174,6 @@ You can pass `text`, `bytes`, `blob`, or `stream` to `opts.format` to change thefile content as `Blob`-###### Defined in--sandbox/filesystem/index.ts:152-###### read(path, opts)```ts@@ -227,11 +197,7 @@ You can pass `text`, `bytes`, `blob`, or `stream` to `opts.format` to change thefile content as `ReadableStream`-###### Defined in--sandbox/filesystem/index.ts:167--##### remove()+### remove()```tsremove(path: string, opts?: FilesystemRequestOpts): Promise<void>@@ -250,11 +216,7 @@ Remove a file or directory.`Promise`\<`void`\>-###### Defined in--sandbox/filesystem/index.ts:379--##### rename()+### rename()```tsrename(@@ -279,11 +241,7 @@ Rename a file or directory.information about renamed file or directory.-###### Defined in--sandbox/filesystem/index.ts:341--##### watchDir()+### watchDir()```tswatchDir(@@ -308,11 +266,7 @@ Start watching a directory for filesystem events.`WatchHandle` object for stopping watching directory.-###### Defined in--sandbox/filesystem/index.ts:432--##### write()+### write()```tswrite(@@ -343,10 +297,6 @@ Writing to a file at path that doesn't exist creates the necessary directories.information about the written file-###### Defined in--sandbox/filesystem/index.ts:223-## Interfaces### EntryInfo@@ -355,7 +305,7 @@ Sandbox filesystem object information.#### Properties-##### name+### name```tsname: string;@@ -363,11 +313,7 @@ name: string;Name of the filesystem object.-###### Defined in--sandbox/filesystem/index.ts:32--##### path+### path```tspath: string;@@ -375,11 +321,7 @@ path: string;Path to the filesystem object.-###### Defined in--sandbox/filesystem/index.ts:40--##### type?+### type?```tsoptional type: FileType;@@ -387,10 +329,6 @@ optional type: FileType;Type of the filesystem object.-###### Defined in--sandbox/filesystem/index.ts:36-***### FilesystemRequestOpts@@ -403,7 +341,7 @@ Options for the sandbox filesystem operations.#### Properties-##### requestTimeoutMs?+### requestTimeoutMs?```tsoptional requestTimeoutMs: number;@@ -417,11 +355,7 @@ Timeout for requests to the API in **milliseconds**.30_000 // 30 seconds```-###### Defined in--connectionConfig.ts:42--##### user?+### user?```tsoptional user: Username;@@ -430,10 +364,6 @@ optional user: Username;User to use for the operation in the sandbox.This affects the resolution of relative paths and ownership of the created filesystem objects.-###### Defined in--sandbox/filesystem/index.ts:75-***### WatchOpts@@ -442,7 +372,7 @@ Options for watching a directory.#### Properties-##### onExit()?+### onExit()?```tsoptional onExit: (err?: Error) => void | Promise<void>;@@ -460,11 +390,7 @@ Callback to call when the watch operation stops.`void` \| `Promise`\<`void`\>-###### Defined in--sandbox/filesystem/index.ts:92--##### requestTimeoutMs?+### requestTimeoutMs?```tsoptional requestTimeoutMs: number;@@ -478,11 +404,7 @@ Timeout for requests to the API in **milliseconds**.30_000 // 30 seconds```-###### Defined in--connectionConfig.ts:42--##### timeoutMs?+### timeoutMs?```tsoptional timeoutMs: number;@@ -497,11 +419,7 @@ You can pass `0` to disable the timeout.60_000 // 60 seconds```-###### Defined in--sandbox/filesystem/index.ts:88--##### user?+### user?```tsoptional user: Username;@@ -509,7 +427,3 @@ optional user: Username;User to use for the operation in the sandbox.This affects the resolution of relative paths and ownership of the created filesystem objects.--###### Defined in--sandbox/filesystem/index.ts:75diff --git a/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v1.0.5/sandbox/page.mdx b/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v1.0.5/sandbox/page.mdxindex 6154f942b..60c5d97f2 100644--- a/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v1.0.5/sandbox/page.mdx+++ b/apps/web/src/app/(docs)/docs/api-reference/js-sdk/v1.0.5/sandbox/page.mdx@@ -1,5 +1,3 @@-## Classes-### SandboxE2B cloud sandbox is a secure and isolated cloud environment.@@ -25,16 +23,16 @@ const sandbox = await Sandbox.create()#### Properties-| Property | Modifier | Type | Description | Defined in |-| ------ | ------ | ------ | ------ | ------ |-| `commands` | `readonly` | `Commands` | Module for running commands in the sandbox | sandbox/index.ts:74 |-| `files` | `readonly` | `Filesystem` | Module for interacting with the sandbox filesystem | sandbox/index.ts:70 |-| `pty` | `readonly` | `Pty` | Module for interacting with the sandbox pseudo-terminals | sandbox/index.ts:78 |-| `sandboxId` | `readonly` | `string` | Unique identifier of the sandbox. | sandbox/index.ts:83 |+| Property | Modifier | Type | Description |+| ------ | ------ | ------ | ------ |+| `commands` | `readonly` | `Commands` | Module for running commands in the sandbox |+| `files` | `readonly` | `Filesystem` | Module for interacting with the sandbox filesystem |+| `pty` | `readonly` | `Pty` | Module for interacting with the sandbox pseudo-terminals |+| `sandboxId` | `readonly` | `string` | Unique identifier of the sandbox. |#### Methods-##### downloadUrl()+### downloadUrl()```tsdownloadUrl(path: string): string@@ -54,11 +52,7 @@ Get the URL to download a file from the sandbox.URL for downloading file.-###### Defined in--sandbox/index.ts:339--##### getHost()+### getHost()```tsgetHost(port: number): string@@ -89,11 +83,7 @@ await sandbox.commands.exec('python3 -m http.server 3000')const serverURL = sandbox.getHost(3000)``-###### Defined in--sandbox/index.ts:237--##### isRunning()+### isRunning()```tsisRunning(opts?: Pick<ConnectionOpts, "requestTimeoutMs">): Promise<boolean>@@ -123,11 +113,7 @@ await sandbox.kill()await sandbox.isRunning() // Returns false```-###### Defined in--sandbox/index.ts:259--##### kill()+### kill()```tskill(opts?: Pick<SandboxOpts, "requestTimeoutMs">): Promise<void>@@ -145,11 +131,7 @@ Kill the sandbox.`Promise`\<`void`\>-###### Defined in--sandbox/index.ts:310--##### setTimeout()+### setTimeout()```tssetTimeout(timeoutMs: number, opts?: Pick<SandboxOpts, "requestTimeoutMs">): Promise<void>@@ -172,11 +154,7 @@ Maximum time a sandbox can be kept alive is 24 hours (86_400_000 milliseconds) f`Promise`\<`void`\>-###### Defined in--sandbox/index.ts:290--##### uploadUrl()+### uploadUrl()```tsuploadUrl(path?: string): string@@ -198,11 +176,7 @@ You have to send a POST request to this URL with the file as multipart/form-dataURL for uploading file.-###### Defined in--sandbox/index.ts:328--##### connect()+### connect()```tsstatic connect<S>(@@ -244,11 +218,7 @@ const sandboxId = sandbox.sandboxIdconst sameSandbox = await Sandbox.connect(sandboxId)```-###### Defined in--sandbox/index.ts:209--##### create()+### create()###### create(this, opts)@@ -287,10 +257,6 @@ const sandbox = await Sandbox.create()Sandbox-###### Defined in--sandbox/index.ts:143-###### create(this, template, opts)```ts@@ -332,11 +298,7 @@ const sandbox = await Sandbox.create('<template-name-or-id>')Sandbox-###### Defined in--sandbox/index.ts:162--##### kill()+### kill()```tsstatic kill(sandboxId: string, opts?: SandboxApiOpts): Promise<boolean>@@ -357,11 +319,7 @@ Kill the sandbox specified by sandbox ID.`true` if the sandbox was found and killed, `false` otherwise.-###### Defined in--sandbox/sandboxApi.ts:55--##### list()+### list()```tsstatic list(opts?: SandboxApiOpts): Promise<SandboxInfo[]>@@ -381,11 +339,7 @@ List all running sandboxes.list of running sandboxes.-###### Defined in--sandbox/sandboxApi.ts:90--##### setTimeout()+### setTimeout()```tsstatic setTimeout(@@ -413,10 +367,6 @@ Maximum time a sandbox can be kept alive is 24 hours (86_400_000 milliseconds) f`Promise`\<`void`\>-###### Defined in--sandbox/sandboxApi.ts:129-## Interfaces### SandboxOpts@@ -425,7 +375,7 @@ Options for creating a new Sandbox.#### Properties-##### accessToken?+### accessToken?```tsoptional accessToken: string;@@ -439,11 +389,7 @@ E2B access token to use for authentication.E2B_ACCESS_TOKEN // environment variable```-###### Defined in--connectionConfig.ts:24--##### apiKey?+### apiKey?```tsoptional apiKey: string;@@ -457,11 +403,7 @@ E2B API key to use for authentication.E2B_API_KEY // environment variable```-###### Defined in--connectionConfig.ts:18--##### debug?+### debug?```tsoptional debug: boolean;@@ -475,11 +417,7 @@ If true the SDK starts in the debug mode and connects to the local envd API servE2B_DEBUG // environment variable or `false`-###### Defined in--connectionConfig.ts:36--##### domain?+### domain?```tsoptional domain: string;@@ -491,11 +429,7 @@ Domain to use for the API.E2B_DOMAIN // environment variable or `e2b.dev`-###### Defined in--connectionConfig.ts:30--##### envs?+### envs?```tsoptional envs: Record<string, string>;@@ -512,11 +446,7 @@ Can be overridden with the `envs` argument when executing commands or code.{}```-###### Defined in--sandbox/index.ts:32--##### logger?+### logger?```tsoptional logger: Logger;@@ -524,11 +454,7 @@ optional logger: Logger;Logger to use for logging messages. It can accept any object that implements `Logger` interface—for example, console.-###### Defined in--connectionConfig.ts:46--##### metadata?+### metadata?```tsoptional metadata: Record<string, string>;@@ -542,11 +468,7 @@ Custom metadata for the sandbox.{}```-###### Defined in--sandbox/index.ts:23--##### requestTimeoutMs?+### requestTimeoutMs?```tsoptional requestTimeoutMs: number;@@ -560,11 +482,7 @@ Timeout for requests to the API in **milliseconds**.30_000 // 30 seconds```-###### Defined in--connectionConfig.ts:42--##### timeoutMs?+### timeoutMs?```tsoptional timeoutMs: number;@@ -578,7 +496,3 @@ Maximum time a sandbox can be kept alive is 24 hours (86_400_000 milliseconds) f```ts300_000 // 5 minutes```--###### Defined in--sandbox/index.ts:39diff --git a/packages/js-sdk/scripts/CustomMarkdownTheme.js b/packages/js-sdk/scripts/CustomMarkdownTheme.jsindex 263bec658..ad1eb4db2 100644--- a/packages/js-sdk/scripts/CustomMarkdownTheme.js+++ b/packages/js-sdk/scripts/CustomMarkdownTheme.js@@ -1,45 +1,57 @@-const { MarkdownTheme, MarkdownPageEvent } = require('typedoc-plugin-markdown');+const { MarkdownTheme, MarkdownPageEvent } = require('typedoc-plugin-markdown')function load(app) {- // Listen to the render event- app.renderer.on(MarkdownPageEvent.END, (page) => {- // Remove Markdown links from the document contents- page.contents = removeMarkdownLinks(removeFirstNLines(removeLinesWithConditions(page.contents), 6));- });+ // Listen to the render event+ app.renderer.on(MarkdownPageEvent.END, (page) => {+ // Remove Markdown links from the document contents+ page.contents = removeMarkdownLinks(+ removeFirstNLines(+ convertH5toH3(removeLinesWithConditions(page.contents)),+ 6+ )+ )+ })+}++// this is a hacky way to make methods in the js-sdk api reference look more prominent+function convertH5toH3(text) {+ return text.replace(/^##### (.*)$/gm, '### $1')}// Function to remove Markdown-style linksfunction removeMarkdownLinks(text) {- // Regular expression to match Markdown links [text](url)- return text.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '$1'); // Replace with just the link text+ // Regular expression to match Markdown links [text](url)+ return text.replace(/\[([^\]]+)\]\(([^)]+)\)/g, '$1') // Replace with just the link text}function removeFirstNLines(text, n, condition) {- // Split the text into lines, then join back excluding the first four lines- return text.split('\n').slice(n).join('\n');+ // Split the text into lines, then join back excluding the first four lines+ return text.split('\n').slice(n).join('\n')}// Function to remove lines based on conditionsfunction removeLinesWithConditions(text) {- const lines = text.split('\n');- const filteredLines = [];-- for (let i = 0; i < lines.length; i++) {- // Check if the current line starts with "#### Extends" or "###### Overrides"- if (lines[i].startsWith("#### Extends") ||- lines[i].startsWith("###### Overrides") ||- lines[i].startsWith("###### Inherited from")) {- // If it does, skip this line and the next three lines- i += 3; // Skip this line and the next three- continue;- }- // If not removed, add the line to filteredLines- filteredLines.push(lines[i]);+ const lines = text.split('\n')+ const filteredLines = []++ for (let i = 0; i < lines.length; i++) {+ // Check if the current line starts with "#### Extends" or "###### Overrides"+ if (+ lines[i].startsWith('#### Extends') ||+ lines[i].startsWith('###### Overrides') ||+ lines[i].startsWith('###### Inherited from')+ ) {+ // If it does, skip this line and the next three lines+ i += 3 // Skip this line and the next three+ continue}+ // If not removed, add the line to filteredLines+ filteredLines.push(lines[i])+ }- // Join the filtered lines back into a single string- return filteredLines.join('\n');+ // Join the filtered lines back into a single string+ return filteredLines.join('\n')}// Export the load function-module.exports = { load };+module.exports = { load }