neuronagent
Version:
AI agent for Internet Computer governance and neuron management
82 lines (54 loc) • 2.06 kB
Markdown
# NeuronAgent
AI agent for Internet Computer governance and neuron management.
## Installation
You can use this package with Deno:
```bash
# Run directly from npm
deno run --allow-net --allow-read --allow-write --allow-env npm:neuronagent
# Or install globally and run
deno install --allow-net --allow-read --allow-write --allow-env npm:neuronagent
neuronagent
```
## Usage
### As a Command Line Tool
Once installed, you can run the package directly:
```bash
neuronagent
```
### As a Module
You can also import the package in your Deno project:
```typescript
import { start, analyzeProposal, getConfigValue } from "npm:neuronagent";
// Start the service
await start();
// Or use specific functions
const value = await getConfigValue("VOTE_SCHEDULE_DELAY");
const analysis = await analyzeProposal(proposalId);
```
## Configuration
The following configuration options can be set:
- `IC_AUTHENTICATION_KEY`: Authentication key for Internet Computer identity
- `USER_PROMPT`: Custom prompt for AI analysis preferences
- `VOTE_SCHEDULE_DELAY`: Delay in seconds before executing scheduled votes
## API
### Main Functions
- `start()`: Initializes the proposal analysis system and starts the web server
- `analyzeProposal(proposalId)`: Analyzes a proposal and returns the analysis results
- `runProposalAnalysis()`: Starts the background proposal analysis process
### Database Functions
- `getConfigValue(key)`: Gets a configuration value from the database
- `setConfigValue(key, value)`: Sets a configuration value in the database
- `scheduleVote(proposalId, voteType, timestamp)`: Schedules a vote for a proposal
- `getAgentVote(proposalId)`: Gets the agent's vote for a specific proposal
## Development
```bash
# Clone the repository
git clone https://github.com/yourusername/neuronagent.git
cd neuronagent
# Start the development server
deno run --allow-net --allow-read --allow-write --allow-env mod.ts
# Build the project
deno compile --allow-net --allow-read --allow-write --allow-env --output oscillum mod.ts
```
## License
MIT