Skip to content

Commit

Permalink
fix: add readmes to packages
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis committed Sep 27, 2023
1 parent b9eeb11 commit d401d59
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Agent Explorer

This monorepo contains the `agent-explore` UI including some core plugins and interface definitions for UI plugins.

## Installation

```bash
Expand All @@ -18,3 +20,9 @@ You can specify a default agent configuration
agent-explore serve --port 8080 --schemaUrl https://example.ngrok.io/open-api.json --apiKey test123 --name Agent
```

## Plugins

Plugins extend the interface defined by `@veramo-community/agent-explorer-plugin` to declare their properties like
name and description, methods used, menu items, content pages, etc.

The agent-explore UI includes a set of core plugins that are enabled by default and also way to load external plugins.
22 changes: 22 additions & 0 deletions packages/agent-explore/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Agent Explore

This package can be used to start a web server that allows you to explore an agent's API.
It includes the basic agent explorer web interface that can load the UI plugins and a CLI command to launch it.

## Installation

```bash
npm -g i agent-explore
```

## Usage

```bash
agent-explore serve --port 8080
```

You can specify a default agent configuration

```bash
agent-explore serve --port 8080 --schemaUrl https://example.ngrok.io/open-api.json --apiKey test123 --name Agent
```
2 changes: 1 addition & 1 deletion packages/agent-explore/src/plugins/contacts/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ const Plugin: IPlugin = {
}
};

export default Plugin;
export default Plugin;
49 changes: 49 additions & 0 deletions packages/plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# @veramo-community/agent-explorer-plugin

This package defines the common interface for an agent explorer plugin.

## Usage

Plugins have an init function that returns a configuration object.
The configuration object defines locations in the `agent-explore` UI that will get modified by the plugin as well as
some of the methods it will use from the associated Veramo agent.

### Example

A plugin that adds a new menu item and a new page to the UI to manage some contacts.

```tsx
import { IPlugin } from '@veramo-community/agent-explorer-plugin';

const Plugin: IPlugin = {
init: () => {
return {
config: {
enabled: true,
url: 'core://contacts',
},
name: 'Contacts',
description: 'Explore contacts',
requiredMethods: ['dataStoreORMGetIdentifiers'],
routes: [
{
path: '/Contacts',
element: <Contacts/>,
},
{
path: '/contacts/:id',
element: <Identifier/>,
},
],
menuItems: [
{
name: 'Contacts',
path: '/contacts',
icon: <ContactsOutlined/>,
},
],
}
}
};

```

0 comments on commit d401d59

Please sign in to comment.