Skip to content

HarperFast/agent-tools

@harperfast/agent-tools

Shares the basic schema for agent tools used by Harper.

This repository contains the definitions and Zod schemas for various tools used by Harper agents. These tools are categorized into application management, file manipulation, and database interaction.

Installation

npm install @harperfast/agent-tools

Usage

The package exports serverTools, which contains schemas for all available tools.

import { serverTools } from '@harperfast/agent-tools';

// Access a specific tool schema
const feedbackTool = serverTools.collectFeedback;

console.log(feedbackTool.name); // 'collectFeedback'
console.log(feedbackTool.description);

Available Tools

Application Management

  • readHarperSkill: Read the content of a Harper skill.
  • createApp: Create a new application.
  • readLogs: Read application logs.
  • getAnalytics: Get application analytics.
  • restartHTTPService: Restart the HTTP service.
  • collectFeedback: Collect user feedback via GitHub Discussions.

File Manipulation

  • getComponentFile: Get the content of a component file.
  • getComponents: List all components.
  • setComponentFile: Create or update a component file.
  • dropComponentFile: Delete a component file.

Database Interaction

  • getDescribeAll: Describe all tables in the database.
  • getDescribeTable: Describe a specific table.
  • insertTableRecords: Insert records into a table.
  • readTableRecords: Read records from a table.
  • updateTableRecords: Update records in a table.
  • deleteTableRecords: Delete records from a table.

Tool Structure

Each tool in serverTools follows the ServerSideTool interface:

import { ServerSideTool } from '@harperfast/agent-tools/types/serverSideTool.js';

Exported Types

The package also exports several utility types used across Harper agent services.

Chat Messages

Used for representing messages in a chat conversation.

import { ChatMessage, NewChatMessage } from '@harperfast/agent-tools/types/chatMessage';

Usage Tracking

Used for monitoring token usage and costs associated with LLM calls.

import { Usage } from '@harperfast/agent-tools/types/usage';
import { NewUsage } from '@harperfast/agent-tools/types/newUsage';

Tool Names

A union type of all available tool names in serverTools.

import { ToolNames } from '@harperfast/agent-tools/types/toolNames';

Development

Build

npm run build

Linting and Formatting

npm run lint:check
npm run format:check

Testing

npm test

License

Apache-2.0

About

No description, website, or topics provided.

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors