
Company News
Free Business Plan Upgrades for Open Source Maintainers
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.
@uplink-code/ai
Advanced tools
AI agent plugin for Uplink browser automation. This package provides AI-powered methods (act and extract) for natural language browser automation.
npm install @uplink-code/ai
Note: This package has a peer dependency on @uplink-code/uplink. The zod package is included as a dependency, so you don't need to install it separately.
import uplink from '@uplink-code/uplink'
import ai from '@uplink-code/ai'
// Create an agent with your LLM provider configuration
const agent = ai.createAgent({
provider: 'anthropic',
options: {
apiKey: process.env.ANTHROPIC_API_KEY
}
})
// Connect to uplink with agent support
const client = await uplink.client.connect('ws://localhost:8080', { agent })
const browser = await client.launch()
const page = await browser.newPage()
// Now you can use AI-powered methods
await page.goto('https://example.com')
Execute browser actions using natural language instructions:
// Single action
await page.act('click the sign in button')
// Multiple actions
await page.act('fill in the email field with "user@example.com" and click submit')
// Get typed results from complex workflows
const result = await page.act('search for "TypeScript" and click the first result')
console.log(result.success, result.actions, result.reasoning)
// TypeScript automatically knows the result structure:
// - result.success: boolean
// - result.actions: Array<{ type: string, params: unknown[], result?: unknown, error?: string }>
// - result.reasoning?: string
Extract data from pages with optional schema validation:
import { z } from 'zod'
// Extract without schema - returns unstructured string
const textResult = await page.extract('extract the product name and price')
// textResult.data is typed as { extraction: string } | undefined
if (textResult.success && textResult.data) {
console.log(textResult.data.extraction)
}
// Extract with Zod schema - automatic type inference!
const productSchema = z.object({
name: z.string(),
price: z.number(),
inStock: z.boolean()
})
const productResult = await page.extract('extract product details', productSchema)
// TypeScript automatically infers productResult.data type from the schema!
// productResult.data is typed as { name: string, price: number, inStock: boolean } | undefined
if (productResult.success && productResult.data) {
// No type assertions needed - TypeScript knows the exact shape
console.log(productResult.data.name) // string
console.log(productResult.data.price) // number
console.log(productResult.data.inStock) // boolean
}
// Extract arrays of structured data
const accountSchema = z.array(
z.object({
routing: z.string(),
account: z.string()
})
)
const accountResult = await page.extract('extract all account details', accountSchema)
// accountResult.data is automatically typed as Array<{ routing: string, account: string }> | undefined
if (accountResult.success && accountResult.data) {
accountResult.data.forEach(account => {
console.log(`Routing: ${account.routing}, Account: ${account.account}`)
})
}
import ai from '@uplink-code/ai'
const agent = ai.createAgent({
provider: 'anthropic',
model: 'claude-sonnet-4-5-20250929', // optional, this is the default
maxTokens: 4096, // optional
options: {
apiKey: 'your-api-key',
dangerouslyAllowBrowser: true // optional, defaults to true
}
})
Configuration options:
provider: Must be 'anthropic'model (optional): Model to use. Default: 'claude-sonnet-4-5-20250929'maxTokens (optional): Maximum tokens for responsesoptions: Accepts all Anthropic SDK ClientOptions:
apiKey (optional): Your Anthropic API key. Can also use ANTHROPIC_API_KEY env vardangerouslyAllowBrowser (optional): Allow browser usage. Default: falseimport ai from '@uplink-code/ai'
const agent = ai.createAgent({
provider: 'openai',
model: 'gpt-4', // optional
options: {
apiKey: 'your-api-key'
}
})
The @uplink-code/ai package is separate from the core @uplink-code/uplink package to:
@anthropic-ai/sdk and zod) add ~580KB. Users who don't need AI features don't pay this cost.@uplink-code/uplink package defines the Agent interface, and this package implements it. Clean separation of concerns.This package provides full TypeScript support with automatic type inference for extracted data:
{ extraction: string } for unstructured text extractionProprietary
FAQs
AI agent extensions for Uplink browser automation
The npm package @uplink-code/ai receives a total of 88 weekly downloads. As such, @uplink-code/ai popularity was classified as not popular.
We found that @uplink-code/ai demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Open source maintainers are under more pressure than ever. We're raising our open source program from the Team plan to the Business plan, free.

Security News
The supply chain control that delays freshly published gems now covers lockfile generation and gem vendoring in Ruby projects.

Security News
During a UK cyber test, a Mythos 5 agent used sockpuppets, social engineering, and prompt injection to try to get a maintainer to merge malware.