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

@codmir/agent-mobile-sdk

v0.1.0

Published

Device-as-a-tool SDK — let AI agents control mobile apps via Socket.IO

Readme

@codmir/agent-mobile-sdk

Device-as-a-tool — Let AI agents control mobile apps.

The first SDK that lets an AI agent running on your server reach into a user's phone and perform actions: navigate screens, fill forms, press buttons, read content, trigger calls. The inverse of how mobile apps work today.

Install

npm install @codmir/agent-mobile-sdk

Quick Start

Mobile Client (React Native)

import { MobileAgentBridge, ALL_PRESETS } from "@codmir/agent-mobile-sdk/react-native";
import { io } from "socket.io-client";
import { Alert } from "react-native";
import { router } from "expo-router";

const bridge = new MobileAgentBridge({
  serverUrl: "https://your-server.com",
  authToken: "user-jwt-token",
  projectId: "project-123",

  // User sees a prompt before dangerous actions execute
  onApprovalRequired: async (request) => {
    return new Promise((resolve) => {
      Alert.alert(
        "AI wants to act",
        `${request.description}\n\n${JSON.stringify(request.params)}`,
        [
          { text: "Deny", onPress: () => resolve(false) },
          { text: "Allow", onPress: () => resolve(true) },
        ]
      );
    });
  },
});

// Register action handlers
bridge
  .registerAction(ALL_PRESETS[0], async (params) => {
    // NAVIGATE
    router.push(params.route as string);
    return { navigated: true };
  })
  .registerAction(ALL_PRESETS[1], async (params) => {
    // FILL_FIELD — your app state management fills the field
    return { filled: true };
  })
  .registerAction(ALL_PRESETS[3], async () => {
    // READ_SCREEN — return current screen state
    return {
      route: "/project/123/tasks",
      fields: [],
      buttons: [{ id: "create-task", label: "Create Task", enabled: true }],
    };
  });

// Connect to workroom
await bridge.connect(io);

Server Side (NestJS / Node.js)

import {
  createMobileActionTool,
  createReadScreenTool,
} from "@codmir/agent-mobile-sdk/server";

// Register as tools in your agent's tool registry
const tools = [
  createMobileActionTool(),
  createReadScreenTool(),
  // ... your other tools
];

// When the agent calls mobile_action, forward to the connected device
socket.emit("mobile:command", {
  id: crypto.randomUUID(),
  type: "navigate",
  params: { route: "/project/123/tasks" },
  timestamp: Date.now(),
});

// Listen for results
socket.on("mobile:result", (result) => {
  // Feed back to the agent's tool_use response
  console.log(result.success, result.data);
});

Architecture

┌──────────────────┐     Socket.IO      ┌──────────────────┐
│   AI Workroom    │◄──────────────────►│   Mobile App     │
│                  │                     │                  │
│  Agent calls     │  mobile:command     │  Bridge receives │
│  mobile_action   │────────────────────►│  & executes      │
│                  │                     │                  │
│  Agent reads     │  mobile:result      │  Handler returns │
│  tool result     │◄────────────────────│  result          │
│                  │                     │                  │
│                  │  mobile:read_screen │  Screen reader   │
│                  │────────────────────►│  returns state   │
│                  │  mobile:screen_state│                  │
│                  │◄────────────────────│                  │
└──────────────────┘                     └──────────────────┘

Action Types

| Action | Danger | Description | |--------|--------|-------------| | navigate | safe | Navigate to a screen | | fill_field | safe | Fill a text input | | press_button | confirm | Press a button (prompts user) | | read_screen | safe | Read current screen state | | scroll | safe | Scroll the view | | show_notification | safe | Show a local notification | | trigger_call | confirm | Join a voice room | | set_status | safe | Update online status | | custom | varies | App-specific actions |

Danger Levels

  • safe — Executes immediately, no user prompt
  • confirm — Shows approval dialog on device before executing
  • dangerous — Requires explicit user confirmation with action details

Custom Actions

bridge.registerAction(
  {
    type: "custom",
    description: "Create a new task in the current project",
    danger: "confirm",
    params: {
      title: { type: "string", required: true },
      priority: { type: "string", enum: ["low", "medium", "high"] },
    },
  },
  async (params) => {
    const task = await createTask(params.title, params.priority);
    return { taskId: task.id };
  }
);

What Can the AI Do?

The user says to the AI workroom:

"Create a task called 'Fix login bug' with high priority in the mobile app"

The agent:

  1. Calls mobile_read_screen → sees user is on the project dashboard
  2. Calls mobile_action({ action: "navigate", params: { route: "/tasks/new" } })
  3. Calls mobile_action({ action: "fill_field", params: { fieldId: "title", value: "Fix login bug" } })
  4. Calls mobile_action({ action: "select", params: { fieldId: "priority", value: "high" } })
  5. Calls mobile_action({ action: "press_button", params: { buttonId: "create" } }) → user sees approval prompt → approves
  6. Task created.

License

Apache-2.0