Repository navigation
@tanstack/ai@0.71.0
·
37 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
Minor Changes
-
#1837
824ee98- Add computer use that runs the same code on OpenAI and on Anthropic. A driver controls the machine. The Playwright and sandbox drivers give each thread its own machine.New packages:
@tanstack/ai-computer-useaddscreateComputerUse(). It returnstools, a middleware, a safety-check interrupt, andclose. EachthreadIdgets its own machine, action queue, and approvals. A thread that stays idle foridleTimeout(10 minutes by default) closes.@tanstack/ai-computer-playwrightaddsplaywrightComputer(), which opens one browser page for each thread.createPlaywrightComputerDriver()controls one page that you give it. Both add anavigatetool that openshttp:andhttps:URLs.@tanstack/ai-computer-sandboxaddssandboxComputer(), which creates one Linux desktop sandbox for each thread from any@tanstack/ai-sandboxprovider, likee2bSandbox({ template: 'desktop' }).createSandboxComputerDriver()controls one sandbox that you give it.@tanstack/ai-computer-localaddslocalComputer(), which lets the model use the mouse, keyboard, and main screen of the machine that runschat(). It works on Windows, macOS, and Linux with@jitsi/robotjs.
Changes in existing packages:
@tanstack/aiaddsthreadIdtoToolExecutionContext. It also adds the computer tool metadata reader in@tanstack/ai/adapter-internals.@tanstack/ai-anthropicand@tanstack/openai-basesend the generic computer tool to the model as the native computer tool of the provider.@tanstack/ai-openaimarks the models that support thecomputertool.
const computerUse = createComputerUse({ driver: playwrightComputer({ startUrl: 'https://tanstack.com' }), }) chat({ adapter, messages, threadId, tools: computerUse.tools, middleware: [computerUse.middleware], interrupts: [computerUse.interrupt], }) await computerUse.close(threadId) // one thread await computerUse.close() // every thread, and the browser
The
ai-coreagent skill routes computer use to@tanstack/ai-computer-useand its three drivers.