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

@liy/agent-runner

v0.3.3

Published

Sprite-local Task Agent runner for Mote remote task execution.

Readme

@liy/agent-runner

Sprite-local Task Agent Runner for Mote remote task execution.

agent-runner is a production-mode executable. It expects the same contract used inside a Sprite Scratchpad:

  • a task spec JSON file
  • a reachable Mote Task Control Channel WebSocket
  • a configured harness executable such as Pi or Codex
  • terminal completion written to state/completion.json

The runner uses the rpcUrl from task-spec.json exactly as supplied.

It does not provide a fake control channel or a separate dev mode.

Build

From the repository root:

pnpm --dir ./agent-runner build

This builds dist/ and marks dist/bin/agent-runner.js executable.

To build as part of the full workspace:

pnpm build

Run

From the repository root:

pnpm agent-runner -- --task-spec /absolute/path/to/state/task-spec.json

From this package:

pnpm --dir ./agent-runner start -- --task-spec /absolute/path/to/state/task-spec.json

Directly from the built executable:

./agent-runner/dist/bin/agent-runner.js --task-spec /absolute/path/to/state/task-spec.json

For a globally linked local binary:

pnpm dev:link-agent-runner
agent-runner --task-spec /absolute/path/to/state/task-spec.json

CLI Options

agent-runner --task-spec <path> [--config <path>]
  • --task-spec <path>: path to the host-authored task spec JSON file. Relative paths are resolved from the current working directory.
  • --config <path>: optional local-debug override for the runner config path. The Sprite default is /home/sprite/.config/mote/agent-runner.json.
  • --help, -h: print command help.

Runner Config

The runner fails fast when its config file is missing or invalid. The Sprite baseline setup script writes the default config to:

/home/sprite/.config/mote/agent-runner.json

Default Pi POC config:

{
  "defaultHarness": "pi",
  "harnesses": {
    "pi": {
      "driver": "pi-rpc",
      "command": "pi",
      "provider": "deepseek",
      "defaultModel": "deepseek-v4-flash",
      "thinking": "high",
      "secretEnv": ["DEEPSEEK_API_KEY"]
    }
  }
}

Task Spec

The task spec is written by mote-node in production at:

<workspace>/state/task-spec.json

An editable Pi RPC example lives at:

agent-runner/examples/task-spec.pi-rpc.json

Minimal shape:

{
  "taskId": "aaaaaaaa-aaaa-4aaa-aaaa-aaaaaaaaaaaa",
  "workspaceDir": "/absolute/workspace",
  "rpcUrl": "ws://127.0.0.1:3900/execute-task/tasks/aaaaaaaa-aaaa-4aaa-aaaa-aaaaaaaaaaaa/rpc",
  "userQuery": {
    "queryText": "Why did yield change?"
  },
  "intent": {
    "kind": "diagnosis"
  },
  "task": {
    "title": "Investigate yield drivers",
    "context": "Use approved tools only."
  },
  "toolProvisioning": {
    "tools": []
  },
  "agentRunner": {
    "harness": "pi",
    "model": "deepseek-v4-flash"
  },
  "endpoints": {
    "llmBaseUrl": "https://api.deepseek.com"
  }
}

The runner validates:

  • workspaceDir is absolute
  • rpcUrl is present
  • optional agentRunner.harness and agentRunner.model are strings
  • configured runner endpoints are HTTP(S) URLs
  • secret-like keys do not appear in the spec

Provisioned Fly Sprite Pi baselines install the Pi MCP adapter extension. Task specs may include endpoints.mcpBaseUrl again when MCP integration returns to the host-side task contract.

Harness Options

Harness options live in the runner config. The task spec may only select agentRunner.harness and agentRunner.model; when either value is absent the runner uses defaultHarness and the selected harness defaultModel.

pi-rpc

Pi RPC driver for Pi-backed task execution.

Required fields:

  • driver: "pi-rpc"
  • command: executable name or absolute path, usually "pi"
  • provider: provider passed to Pi, for example "deepseek"
  • defaultModel: model passed to Pi when the task spec does not select one, for example "deepseek-v4-flash"

Optional fields:

  • thinking: "off", "minimal", "low", "medium", "high", or "xhigh". Defaults to "high" inside the Pi RPC driver when absent.
  • args: extra vetted Pi flags appended after driver-owned flags.
  • secretEnv: required provider secret env vars passed through to Pi after the host explicitly forwards them to the runner process.

The Pi RPC driver owns these flags and rejects duplicates in args:

--mode
--provider
--model
--thinking
--no-prompt-templates
--no-themes

It currently spawns Pi like:

pi --mode rpc --provider deepseek --model deepseek-v4-flash --thinking high --no-prompt-templates --no-themes

The driver writes one Pi RPC prompt command to stdin, parses Pi stdout as byte-buffered JSONL, forwards native Pi records as pi.event or pi.extension_ui_request, routes malformed stdout/stderr as harness.stdout/harness.stderr, and cancels with Pi abort, then SIGTERM, then SIGKILL after five seconds.

Direct DeepSeek token example:

export DEEPSEEK_API_KEY=...
agent-runner --task-spec /absolute/path/to/state/task-spec.json --config /absolute/path/to/agent-runner.json

Direct provider-token passthrough is a temporary risk-bearing path. The harness must never print, log, persist, or include that token in task artifacts. Mote still needs a gateway that protects LLM access tokens before this runtime is treated as production-safe.

codex-jsonl

Codex JSONL driver preserving the existing line-oriented Codex behavior.

Required fields:

  • driver: "codex-jsonl"
  • command: executable name or absolute path, usually "codex"

Optional fields:

  • args: command arguments, for example ["exec", "--json", "--ephemeral"]
  • defaultModel: model name exposed to the harness as MOTE_TASK_MODEL unless the task spec overrides it

Example:

{
  "driver": "codex-jsonl",
  "command": "codex",
  "args": ["exec", "--json", "--ephemeral"],
  "defaultModel": "gpt-5"
}

Runtime Contract

The harness must write terminal completion to:

<workspace>/state/completion.json

Completion shape:

{
  "status": "completed",
  "summary": "Short result summary",
  "artifactIds": []
}

status must be one of:

  • completed
  • partial
  • failed
  • cancelled

Artifacts referenced by artifactIds must live under:

<workspace>/artifacts/<artifactId>/artifact.json

Dataset artifacts must also include:

<workspace>/artifacts/<artifactId>/data.csv

state/completion.json is authoritative. Harness stdout/stderr and RPC events are progress telemetry only.

Local Production Smoke Checklist

To run locally without Sprite leasing, you still need production-equivalent inputs:

  1. Start or provide a Mote API server with execute-task RPC routes.
  2. Create a task in the execute-task store.
  3. Create a workspace with state/ and artifacts/.
  4. Write state/task-spec.json with a reachable rpcUrl.
  5. Ensure the harness command is on PATH.
  6. Run agent-runner --task-spec ....

For most local checks, use the test suite:

pnpm --dir ./agent-runner test