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

@limecloud/app-server-client

v1.66.0

Published

App Server JSON-RPC client and sidecar launch helpers for independent apps.

Readme

@limecloud/app-server-client

@limecloud/app-server-client is the TypeScript client surface for independent apps that talk to app-server over JSON-RPC.

Current scope:

  • build initialize / initialized requests;
  • build agentSession/* requests;
  • encode and decode newline-delimited JSON-RPC messages;
  • resolve sidecar binary names, packaged paths, and stdio launch args;
  • read release manifest metadata and select the current platform artifact;
  • build sidecar launch config from manifest + resources path;
  • verify the sidecar binary sha256 before launch;
  • spawn / connect a stdio sidecar with the initialize handshake;
  • supervise sidecar crash, startup failure, and restart with deterministic backoff;
  • route agentSession/event notifications into app-owned renderer state;
  • use AppServerConnection for typed agentSession/* request / response flows.
  • use AgentRuntimeClient as the standard facade for runtime turn, action, thread read, evidence export, and event subscription flows.

Session archive semantics:

  • list archived sessions with agentSession/list and archivedOnly: true;
  • archive or unarchive sessions with agentSession/update and archived: true or archived: false;
  • preserve App Server JSON-RPC errors as AppServerRequestError; callers must fail closed instead of falling back to legacy agent_runtime_* commands or mock responses.

Electron main integration shape:

import {
  AppServerAgentEventRouter,
  startPackagedAppServerSidecar,
} from "@limecloud/app-server-client";

const { connected, lifecycle } = await startPackagedAppServerSidecar(
  {
    clientInfo: { name: "content_studio", version: app.getVersion() },
  },
  {
    resourcesPath: process.resourcesPath,
    restartPolicy: { maxAttempts: 3, initialDelayMs: 500, maxDelayMs: 30_000 },
  },
);

const { connection } = connected;
app.on("before-quit", () => void lifecycle.stop());

const eventRouter = new AppServerAgentEventRouter();
eventRouter.subscribe((event) => {
  mainWindow.webContents.send("agent:event", event);
});

const session = await connection.startSession({
  appId: "host-app",
  workspaceId: workspace.id,
  businessObjectRef: {
    kind: "document",
    id: document.id,
    title: document.title,
  },
});

const turn = await connection.startTurn({
  sessionId: session.result.session.sessionId,
  input: { text: "生成草稿" },
  runtimeOptions: { capabilityId: "draft.write", stream: true },
  queueIfBusy: true,
});

for (const result of [session, turn]) {
  for (const notification of result.notifications) {
    await eventRouter.dispatch(notification);
  }
}

void (async () => {
  while (!mainWindow.isDestroyed()) {
    await eventRouter.dispatch(await connection.nextNotification());
  }
})();

Agent runtime SDK facade:

import { createAgentRuntimeClient } from "@limecloud/app-server-client";

const runtime = createAgentRuntimeClient(connection, {
  request: { timeoutMs: 120_000 },
});

runtime.subscribeEvents((event) => {
  mainWindow.webContents.send("agent:event", event);
});

await runtime.startTurn({
  sessionId: session.result.session.sessionId,
  input: { text: "整理资料并生成草稿" },
  runtimeOptions: { stream: true, eventName: "agentSession/event" },
});

const thread = await runtime.readThread({
  sessionId: session.result.session.sessionId,
});

await runtime.exportEvidence({
  sessionId: thread.result.session.sessionId,
  includeEvents: true,
});

AgentRuntimeClient is a facade over the current App Server JSON-RPC methods. readThread intentionally maps to agentSession/read; this package does not invent a separate task read protocol. Apps that need task projections should derive them from the returned session, turns, and runtime events until App Server exposes a dedicated current method.

This package does not import Lime Rust crates, Tauri commands, Aster DTOs, or renderer UI code. Electron apps should use it from main / preload boundaries and project events into their own renderer state.

Sidecar backendMode: "mock" is test-only. Production hosts must use runtime, external, or fail closed; they must not treat the mock backend as a fallback for Agent Runtime, evidence export, or renderer UI flows.