https://github.com/ai-engineer-foundation/agent-protocol-sdk-js
https://github.com/ai-engineer-foundation/agent-protocol-sdk-js
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/ai-engineer-foundation/agent-protocol-sdk-js
- Owner: AI-Engineer-Foundation
- Archived: true
- Created: 2023-09-18T21:30:26.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-27T22:10:50.000Z (over 1 year ago)
- Last Synced: 2025-03-25T06:43:59.077Z (about 1 month ago)
- Language: TypeScript
- Size: 47.9 KB
- Stars: 2
- Watchers: 0
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# THIS REPO HAS BEEN MERGED INTO THE MAIN REPO: https://github.com/AI-Engineer-Foundation/agent-protocol/tree/main/packages/sdk/js
# Agent Communication Protocol - JavaScript/TypeScript SDKThis SDK implements the Agent Communication Protocol in JavaScript/TypeScript
and allows you to easily wrap your agent in a webserver compatible with the
protocol - you only need to define an agent task handler.## Installation
```bash
npm install agent-protocol
```Then add the following code to your agent:
### Typescript
```typescript
import Agent, {
type StepHandler,
type StepInput,
type StepResult,
type TaskInput,
} from 'agent-protocol'async function taskHandler(taskInput: TaskInput | null): Promise {
console.log(`task: ${taskInput}`)async function stepHandler(stepInput: StepInput | null): Promise {
console.log(`step: ${stepInput}`)
return {
output: stepInput,
}
}return stepHandler
}Agent.handleTask(taskHandler).start()
```## Docs
You can find more info and examples in the [docs](https://agentprotocol.ai/sdks/js).
## Contributing
```bash
git clone https://github.com/AI-Engineers-Foundation/agent-protocol-sdk-js
cd ./agent-protocol-sdk-js
git submodule update --init
npm install
npm run build
```