Catalog / Cloudflare Developer Platform
Agents, Workers - Think agents now use a @cloudflare/computer workspace
Think and Agent Skills now use the workspace from @cloudflare/computer ↗︎ as well as the filesystem tools. A JavaScript execution environment can be configured by adding the JavaScriptWorkerBackend.
@cloudflare/shell is deprecated, and so is Think's createExecuteTool. These will no longer be developed nor supported from today onwards.
import { Think } from "@cloudflare/think";
import { Workspace } from "@cloudflare/computer";
import { WorkerJavaScriptBackend } from "@cloudflare/computer/backends/worker-javascript";
export class MyAgent extends Think {
workspace = new Workspace({
storage: this.ctx.storage,
backends: [
new WorkerJavaScriptBackend({ id: "js", loader: this.env.LOADER }),
],
});
}import { Think } from "@cloudflare/think";
import { Workspace } from "@cloudflare/computer";
import { WorkerJavaScriptBackend } from "@cloudflare/computer/backends/worker-javascript";
export class MyAgent extends Think<Env> {
override workspace = new Workspace({
storage: this.ctx.storage,
backends: [
new WorkerJavaScriptBackend({ id: "js", loader: this.env.LOADER }),
],
});
}
Migrate your workspace data
This is a breaking change. @cloudflare/computer stores files in different tables from @cloudflare/shell, and there is no automatic data migration between workspace formats. To keep an existing workspace, copy its files with the script in Migrating from @cloudflare/shell to @cloudflare/computer ↗︎. Otherwise your agent will start with an empty workspace, though the original data will still be present in the existing tables.
For more information, refer to Think tools.