Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

neuronagent

yourusername120MIT1.0.1

AI agent for Internet Computer governance and neuron management

internet-computer, governance, ai, dfinity, icp, voting, neuron

readme

NeuronAgent

AI agent for Internet Computer governance and neuron management.

Installation

You can use this package with Deno:

# 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:

neuronagent

As a Module

You can also import the package in your Deno project:

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

# 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