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

@linkworld_ai/sdk

v0.1.1

Published

Build apps for the Linkworld Open App Platform

Readme

@linkworld_ai/sdk

Build apps for the Linkworld Open App Platform in TypeScript.

Phase 2 alpha. The 0.x line may iterate on shape until first partner ships in production. Same handler / manifest contract as linkworld-sdk for Python.

Install

npm install @linkworld_ai/sdk

Requires Node >= 20 (uses native fetch and node:test).

Quickstart

linkworld.app.yaml:

apiVersion: linkworld.ai/v2
app_id: hello-world-ts
version: 0.1.0
name: Hello World
runtime:
  image: ghcr.io/you/hello-world-ts:0.1.0
required_scopes: [mail.send]
tools:
  - name: classify_text
    description: Categorize text
    scopes_required: []
lifecycle:
  on_inbound: true

app.ts:

import { App } from '@linkworld_ai/sdk'

const app = App.fromManifest('./linkworld.app.yaml')

app.tool('classify_text', async (_ctx, args) => {
  const text = String(args.text ?? '').toLowerCase()
  return { category: text.includes('tax') ? 'tax' : 'other' }
})

app.onInbound(async (ctx, env) => {
  await ctx.tools.call('email_send', {
    to: env.from,
    subject: 'Re: ' + (env.subject ?? ''),
    body: 'Thanks for your message.',
  })
})

await app.run()

Local development:

LINKWORLD_LOCAL=1 tsx app.ts
# Then curl your handlers:
curl -XPOST localhost:8080/__mock/tool   -d '{"name":"email_send","result":{"sent":true}}'
curl -XPOST localhost:8080/tool/classify_text -d '{"text":"Q4 invoices"}'

Production: the platform injects LINKWORLD_MCP_URL / LINKWORLD_MCP_TOKEN into your container at provision time and routes events to POST /tool/<name> or POST /event/<type>. Just await app.run() with no flags.

Public API

import {
  App,
  Context,
  InboundEnvelope,
  MockTools,
  MockSecrets,
  ToolCallError,
  loadManifest,
  loadManifestFromString,
} from '@linkworld_ai/sdk'

App

| Method | Purpose | | ------------------------------- | -------------------------------------------------- | | App.fromManifest(path) | Load + validate a YAML manifest | | app.tool(name, opts?, fn) | Register a tool the tenant agent can invoke | | app.onInstall(fn) | Run once when a tenant activates the app | | app.onUninstall(fn) | Run when a tenant deactivates the app | | app.onInbound(fn) | Handle inbound messages (email/whatsapp/...) | | app.onUserAdded(fn) | New-user-in-tenant events | | app.onSchedule(name, fn) | Cron-fired handler matching manifest.lifecycle.schedules[].name | | app.run({local?, host?, port?}) | Start the runtime; blocks until SIGTERM |

Context

interface Context {
  readonly tenantId: string
  readonly appId: string
  readonly appVersion: string
  readonly tools: ToolsApi    // .call(toolName, args) → result
  readonly secrets: SecretsApi // .get(key) → string | null
}

ToolCallError

Thrown by ctx.tools.call(...) on platform-side denial / failure:

try {
  await ctx.tools.call('email_send', { to, body })
} catch (err) {
  if (err instanceof ToolCallError) {
    console.log(err.decision)       // 'scope_denied' | 'network_error' | …
    console.log(err.neededScopes)   // string[]
  }
}

Local mock

MockTools and MockSecrets let you exercise your handlers without the platform. The /__mock/tool and /__mock/secret HTTP endpoints in local mode are sugar over the same classes.

const tools = new MockTools()
tools.register('email_send', async () => ({ sent: true }))

const secrets = new MockSecrets({ OPENAI_KEY: 'sk-test' })

Compared to the Python SDK

Same manifest schema, same handler contract, same Context surface. Differences:

| Python | TypeScript | | ------------------------------- | ----------------------------------------- | | @app.tool('name', ...) decorator | app.tool('name', ...) builder method | | @app.on_inbound | app.onInbound(fn) | | @app.on_schedule('daily') | app.onSchedule('daily', fn) | | ctx.tools.call('email_send', to=...) | ctx.tools.call('email_send', { to }) |

License

MIT