-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
80 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,4 +39,4 @@ const Plugin: IPlugin = { | |
} | ||
}; | ||
|
||
export default Plugin; | ||
export default Plugin; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/>, | ||
}, | ||
], | ||
} | ||
} | ||
}; | ||
|
||
``` |