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

psadk

v1.1.35

Published

ps adk adapter

Readme

PSADK

ps adk adapter

  • samples : sample agents using PSADK

Installation

$ npm install psadk

Documentation

The classes are documented here Documentation

Developing with PSADK

A2A Server

hello agent - simple chat agent

clone of https://github.com/a2aproject/a2a-samples/blob/main/samples/js/src/agents/coder/index.ts

import { getServiceToken, PSAgent, PSAgentLogger } from 'psadk';
import dotenv from 'dotenv';

dotenv.config();

async function main() {
  const token = await getServiceToken({});
  const HelloAgent = new PSAgent({
    name: 'HelloAgent',
    description: 'A simple hello world agent',
    instruction: 'You are a friendly assistant that greets users.',
    token,
    port: 41241,
    log: new PSAgentLogger({ prefix: 'HelloAgent' }),
  });
  const { app } = HelloAgent.getA2AServer();
  app.listen(41241, () => {
    console.log('HelloAgent is running on http://localhost:41241');
  });
}

main().catch((error) => {
  console.error(error);
  process.exit(1);
});

create a .env file with the appropriate keys

PS_API_URL=https://dev.lionis.ai
PS_APP_KEY=sk_0abb4....

PS_CLIENT_ID=b5cc89b7-....
PS_PROJECT_ID=15a2e....
PS_WORKSPACE_ID=4ffba209-xxx-xxx-xxx-....

PS_SVC_CLIENT_ID=0483....
PS_SVC_CLIENT_SECRET=gfjt678...
PS_SVC_APP_KEY=sk_5f2967....
DEBUG=*

movie info agent - example with custom tools

clone of https://github.com/a2aproject/a2a-samples/blob/main/samples/js/src/agents/movie-agent/index.ts

import { PSAI, PSAgent, PSAgentLogger } from 'psadk';
import dotenv from 'dotenv';
import { movie_search_tool, movie_searchpeople_tool } from './tmdb_tools.js';
import { prompt } from './movie_agent_prompts.js';
dotenv.config();

async function main() {
  // const token = await PSAI.getServiceToken({});
  const token = (await PSAI.getAuthToken()).accessToken;
  const instruction = prompt.replace('{{now}}', new Date().toLocaleString());
  const MovieAgent = new PSAgent({
    name: 'MovieAgent',
    description: 'An agent that can answer questions about movies using TMDB.',
    instruction,
    model: 'gpt-4.1-mini',
    token,
    port: 41241,
    log: new PSAgentLogger({ prefix: 'MovieAgent' }),
    tools: [movie_search_tool, movie_searchpeople_tool],
  });
  const { app, port } = MovieAgent.getA2AServer();
  app.listen(port, () => {
    console.log(`MovieAgent is running on http://localhost:${port}`);
  });
}

main().catch((error) => {
  console.error(error);
  process.exit(1);
});

Use can use a2a inspector ui just enter the agent card url http://localhost:41241/.well-known/agent-card.json to interact with the agent

Custom tool

import { PSAgentTool } from 'psadk';
import { z } from 'zod/v4';

export const movie_search_tool = new PSAgentTool({
  name: 'search_movies',
  description: 'search TMDB for movies by title',
  type: 'API',
  local_execution: true,
  hitl: true,
  inputschema: {
    title: `search_movies_inputs.`,
    description: 'Inputs for search_movies tool.',
    url: 'http://localhost/search_movies',
    method: 'POST',
    requestBody: z.toJSONSchema(
      z
        .object({
          query: z.string().meta({
            title: 'query',
            description: 'The search query string for movies.',
          }),
        })
        .meta({
          title: 'search_movies_request_body',
          description:
            'The request body parameters for the search_movies tool.',
        }),
      { io: 'input' },
    ),
  },
  runCallback: async ({ query }) => {
    console.log('[tmdb:searchMovies]', JSON.stringify(query));
    try {
      const data = await callTmdbApi('movie', query);

      // Only modify image paths to be full URLs
      const results = data.results.map((movie: any) => {
        if (movie.poster_path) {
          movie.poster_path = `https://image.tmdb.org/t/p/w500${movie.poster_path}`;
        }
        if (movie.backdrop_path) {
          movie.backdrop_path = `https://image.tmdb.org/t/p/w500${movie.backdrop_path}`;
        }
        return movie;
      });

      return {
        status: 'success',
        output: {
          ...data,
          results,
        },
      };
    } catch (error) {
      console.error('Error searching movies:', error);
      // Re-throwing allows the caller to handle it appropriately
      throw error;
    }
  },
});

Client: Sending a Message

The A2AClient makes it easy to communicate with any A2A-compliant agent.

// client.ts
import { A2AClient, SendMessageSuccessResponse } from '@a2a-js/sdk/client';
import { Message, MessageSendParams } from '@a2a-js/sdk';
import { v4 as uuidv4 } from 'uuid';

async function run() {
  // Create a client pointing to the agent's Agent Card URL.
  const client = await A2AClient.fromCardUrl(
    'http://localhost:41241/.well-known/agent-card.json',
  );

  const sendParams: MessageSendParams = {
    message: {
      messageId: uuidv4(),
      role: 'user',
      parts: [{ kind: 'text', text: 'Hi there!' }],
      kind: 'message',
    },
  };

  const response = await client.sendMessage(sendParams);

  if ('error' in response) {
    console.error('Error:', response.error.message);
  } else {
    const result = (response as SendMessageSuccessResponse).result as Message;
    console.log('Agent response:', result.parts[0].text); // "Hello, world!"
  }
}

await run();