
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
It is CLI and library to work with Autonomous Agents on Obyte
You can create a new project using CLI
npm i -g aagent-cli
aagent init folder
Or add to an existing project
yarn add aagent.js
require('headless-obyte');
const eventBus = require('ocore/event_bus');
const { AA, AAs } = require('aagent.js');
Example:
require('headless-obyte');
const eventBus = require('ocore/event_bus');
const { AA } = require('aagent.js');
eventBus.on('headless_wallet_ready', () => {
const aa = new AA('address');
aa.events.on('new_request', (request) => {
console.error('new request', request);
});
aa.events.on('new_response', (err, response, vars) => {
console.error('new response', response, vars);
});
aa.events.on('new_aa_definition', (definition) => {
console.error('new aa definition', definition);
});
aa.events.on('new_aa_definition_saved', (definition) => {
console.error('new aa definition saved', definition);
});
aa.newResponseFilter((err, params, vars) => {
return true;
}, (err, params, vars) => {
console.error(err, params, vars);
});
});
All events are applied to the specified address in the constructor.
const aa = new AA('address')
one argument - aa_address(string)
static method getAAVars:
AA.getAAVars('address');
will return variables from AA.
The handler triggers an event, passes it to the first function, and if it returns true, calls the second function. You can use them to process specific data(like a router).
More about arguments in events.
aa.addRequestEventHandler((request, body) => {
return true;
}, (request, body) => {
console.error(request, body);
});
aa.addResponseEventHandler((err, params, vars, body) => {
return true;
}, (err, params, vars, body) => {
console.error(err, params, vars, body);
});
aa.addDefinitionEventHandler((definition, body) => {
return true;
}, (definition, body) => {
console.error(definition, body);
});
aa.addDefinitionSavedEventHandler((definition, body) => {
return true;
}, (definition, body) => {
console.error(definition, body);
});
aa.events.on('new_request', (request, body) => {
console.error('new request', request, body);
});
Arguments:
aa.events.on('new_response', (err, params, vars, body) => {
console.error('new response', err, params, vars, body);
});
Arguments:
aa.events.on('new_aa_definition', (definition, body) => {
console.error('new aa definition', definition, body);
});
Arguments:
aa.events.on('new_aa_definition_saved', (definition, body) => {
console.error('new aa definition saved', definition, body);
});
This event can be triggered twice with the same data (architectural features), please consider this.
Arguments:
All events applies to the specified addresses in the constructor.
const aas = new AAs(['address', 'address2'])
one argument - aa_addresses - array[string]
aas.addAddress('address');
Adds a new address and subscribes to it
static method getAAVars:
AAs.getAAVars('address');
will return variables from AA.
This class supports only:
Methods: addRequestEventHandler, addResponseEventHandler
Events: new_request, new_response
Arguments are identical to AA class
FAQs
It is library to work with Autonomous Agents on Obyte
The npm package aagent.js receives a total of 3 weekly downloads. As such, aagent.js popularity was classified as not popular.
We found that aagent.js demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.