Sign In

agentsjson

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agentsjson

Agents.json TypeScript Implementation with Core and Integrations

latest
npmnpm
Version
0.0.8
Version published
Maintainers
1
Created
Source

@wildcard/agents-json

TypeScript implementation of the Agents.json specification with core functionality and integrations.

Installation

npm install @wildcard/agents-json

Features

  • Core executor for running Agents.json flows
  • REST API handler with support for various authentication methods
  • Type-safe implementation using TypeScript and Zod
  • Built-in integrations for popular services (coming soon)
    • Twitter
    • Giphy
    • Google Sheets
    • And more...

Usage

Basic Example

import { execute, Bundle, Flow, AuthConfig, AuthType } from '@wildcard/agents-json';

// Define your bundle
const bundle: Bundle = {
  id: 'example-bundle',
  name: 'Example Bundle',
  flows: [
    {
      id: 'example-flow',
      actions: [
        {
          id: 'action1',
          sourceId: 'twitter',
          operationId: 'postTweet',
        },
      ],
    },
  ],
};

// Define your authentication
const auth: AuthConfig = {
  type: AuthType.OAUTH2,
  client_id: 'your-client-id',
  client_secret: 'your-client-secret',
  access_token: 'your-access-token',
};

// Execute the flow
const result = await execute(
  bundle,
  bundle.flows[0],
  auth,
  { text: 'Hello, World!' },
  {}
);

Using the REST API Handler

import { RestApiHandler } from '@wildcard/agents-json';

const api = new RestApiHandler({
  baseURL: 'https://api.example.com',
});

api.setAuth({
  type: AuthType.BEARER,
  token: 'your-token',
});

const response = await api.get('/endpoint', { param: 'value' });

Development

# Install dependencies
npm install

# Build the package
npm run build

# Run tests
npm test

# Run type checking
npm run typecheck

# Run linting
npm run lint

# Format code
npm run format

Keywords

agents

FAQs

Package last updated on 13 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts