JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 35734
  • Score
    100M100P100Q146471F
  • License MIT

Shared types and utilities for Rozenite agent packages

Package Exports

  • @rozenite/agent-shared
  • @rozenite/agent-shared/package.json

Readme

rozenite-banner

Shared Agent types and message contracts for Rozenite packages.

mit licence npm downloads Chat PRs Welcome

@rozenite/agent-shared contains the shared type definitions used by Rozenite Agent packages. It defines the Agent tool shape, the message protocol for registering and calling tools, and the shared AGENT_PLUGIN_ID constant used by the bridge packages.

Features

  • Shared Tool Types: Common AgentTool and JSON-schema-like input types
  • Message Contracts: Typed payloads for register, unregister, call, and result messages
  • Single Protocol Constant: Shared AGENT_PLUGIN_ID for the Agent transport
  • Package Reuse: Intended for bridge and runtime packages that implement Agent support

Installation

Install the shared package as a dependency:

npm install @rozenite/agent-shared

Exports

This package exports:

  • AGENT_PLUGIN_ID
  • AgentTool
  • JSONSchema7
  • DevToolsPluginMessage
  • RegisterToolPayload
  • UnregisterToolPayload
  • ToolCallPayload
  • ToolResultPayload
  • RegisterToolMessage
  • UnregisterToolMessage
  • ToolCallMessage
  • ToolResultMessage
  • AgentMessage

Usage

import {
  AGENT_PLUGIN_ID,
  type AgentTool,
  type ToolCallMessage,
} from '@rozenite/agent-shared';

const tool: AgentTool = {
  name: 'example.echo',
  description: 'Echo a value back to the caller.',
  inputSchema: {
    type: 'object',
    properties: {
      value: { type: 'string' },
    },
    required: ['value'],
  },
};

console.log(AGENT_PLUGIN_ID);

Made with ❤️ at Callstack

rozenite is an open source project and will always remain free to use. If you think it's cool, please star it 🌟.

Callstack is a group of React and React Native geeks, contact us at hello@callstack.com if you need any help with these or just want to say hi!

Like the project? ⚛️ Join the team who does amazing stuff for clients and drives React Native Open Source! 🔥