npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@limrun/ai-sdk

v0.3.0

Published

Vercel AI SDK tools that let agents create and drive Limrun iOS simulators, Android emulators, and macOS virtual machines.

Readme

@limrun/ai-sdk

Vercel AI SDK tools that drive Limrun iOS simulators, Android emulators, and macOS virtual machines. Pick one of two ways to use them:

  • Your code owns the device: iosTools(client), androidTools(client), and macosTools(client) bind every tool to one device your code created. The model never sees an instance ID or your API key, so it can act only on that device. Use it for test runners and backend jobs.
  • The agent owns the devices: limrunTools() lets the model create, list, drive, and delete devices across your organization. Use it for agents that decide which devices they need, such as software factories.

Install

npm install @limrun/ai-sdk @limrun/api ai zod

Set LIM_API_KEY to an API key from the Limrun console (Settings, API Keys).

Drive a device your code creates

import { generateText, isStepCount } from 'ai';
import Limrun, { Ios } from '@limrun/api';
import { iosTools } from '@limrun/ai-sdk';

const lim = new Limrun();
const instance = await lim.iosInstances.create({ wait: true });
const client = await Ios.createInstanceClient({
  apiUrl: instance.status.apiUrl!,
  token: instance.status.token!,
});

try {
  const { text } = await generateText({
    model: 'anthropic/claude-sonnet-5.5',
    tools: iosTools(client),
    stopWhen: isStepCount(20),
    prompt: 'Open https://lim.run in Safari and tell me what the page heading says.',
  });
  console.log(text);
} finally {
  client.disconnect();
  await lim.iosInstances.delete(instance.metadata.id);
}

For Android, create the instance with lim.androidInstances.create, connect with createInstanceClient from @limrun/api, and pass the client to androidTools. For macOS, create it with lim.macosInstances.create, connect with lim.macosInstances.createClient, and pass the client to macosTools.

Tools

The tool names and inputs follow the methods of the @limrun/api instance clients. Each factory returns a plain object, so you can pass a subset of the tools. The tools use the client you pass and do not disconnect it.

The installApp tools take an https URL of the app archive, or the name of an app uploaded to Limrun. A name works here only when the instance's role allows reading that app; limrunTools signs names with your API key instead.

| iosTools(client) | What it does | | ----------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | | screenshot | Screenshot (sent to the model as an image) and accessibility tree. | | performActions | Runs a batch of actions in the shape of client.performActions: taps, element actions, typing, keys, scrolling, waits, and buttons. | | openUrl | Opens a URL in Safari or a deeplink in its app. | | installApp | Installs an app from an https URL or an uploaded app name. | | listApps, launchApp, terminateApp | Lists, launches, or stops apps by bundle ID. | | softReset | Resets an app's data, or reinstalls it, and relaunches it. | | setPermission | Grants or denies a privacy permission, such as camera or photos. | | appLogTail | Reads an app's last log lines. | | deviceInfo | Reads the simulator model, screen size, and orientation. | | discoverStoreKitConfig, clearStoreKitConfig | Makes an app's in-app purchases work without a sandbox account, or undoes it. | | simctl | Runs xcrun simctl, for appearance, location, the status bar, and more. | | startRecording, stopRecording | Records the screen and saves the video to Limrun. |

| androidTools(client) | What it does | | --------------------------------------- | ------------------------------------------------------------------ | | screenshot | Screenshot (sent to the model as an image) and UIAutomator XML. | | tap, setText, pressKey | Taps or types at an element selector or a point, or presses a key. | | scrollScreen, scrollElement | Scrolls the screen or a container. | | findElement | Finds the elements that match a selector. | | openUrl | Opens a URL or deeplink. | | installApp | Installs an APK from an https URL or an uploaded app name. | | listApps, launchApp, terminateApp | Lists, launches, or stops apps by package name. | | logcat | Reads the last device log lines, for every app or a running one. | | adbShell | Runs an adb shell command line. | | startRecording, stopRecording | Records the screen and saves the video to Limrun. |

| macosTools(client) | What it does | | --------------------------------------- | ---------------------------------------------------------------- | | screenshot | Screenshot, sent to the model as an image. | | performActions | Runs a batch of clicks, typing, keys, scrolls, drags, and waits. | | openUrl | Opens a URL in the default browser, or a deeplink in its app. | | run | Runs a shell command line as the guest's user. | | installApp | Installs an app from an https URL or an uploaded app name. | | listApps, launchApp, terminateApp | Lists, launches, or stops apps. | | appLogTail | Reads an app's last log lines. | | startRecording, stopRecording | Records the screen and saves the video to Limrun. |

Recordings are listed by lim.iosInstances.listRecordings(instanceId), and its Android and macOS equivalents, with download URLs.

Let the agent manage devices

import { generateText, isStepCount } from 'ai';
import { limrunTools } from '@limrun/ai-sdk';

const limrun = limrunTools();
try {
  const { text } = await generateText({
    model: 'anthropic/claude-sonnet-5.5',
    tools: limrun.tools,
    stopWhen: isStepCount(40),
    prompt:
      'Install my-app.tar.gz on an iOS simulator and my-app.apk on an Android emulator, sign up on each, and tell me where they differ.',
  });
  console.log(text);
} finally {
  await limrun.close();
}

limrunTools() reads LIM_API_KEY, or takes a Limrun client. The model acts with that key on every instance it can reach.

Call close() in a finally block. The model can delete devices itself, but a run can end first: the step limit is reached, a call fails, the run is cancelled, or the model forgets. close() deletes the devices this limrunTools() created that are still running, leaves other devices alone, and closes the connections so your process can exit. Without it, leftover devices keep billing until their inactivity timeout.

| limrunTools().tools | What it does | | -------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | | createIosSimulator, createAndroidEmulator, createMacosInstance | Creates a device, installs any apps given, waits until it is ready, and returns its ID. Also takes an inactivity timeout and a private tunnel name. | | getInstance | Reads a device's state, and why it failed if it did. | | listInstances | Lists the devices that are starting or ready, up to 50 per platform. | | deleteInstance | Deletes a device. | | listUploadedApps | Lists the apps uploaded to Limrun that can be installed by name. | | ios*, android*, macos* | The tools above with an instanceId input, such as iosScreenshot. |

macOS is enabled per organization; elsewhere createMacosInstance fails with a message.

Agents that already use MCP tools can connect to the Limrun remote MCP server instead.