Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
It is CLI and library to work with Autonomous Agents on Obyte
Init
npm i -g aagent.js
aagent --help
Create project from template (with AA example, tests and library)
aagent init .
Validating AA
aagent validate aa.oscript
Open GUI Wallet to deploy
aagent deploy aa.oscript
If the file is too large it will be uploaded to the server and transferred to the client in the link.
This command supports argument --testnet to deploy script through the testnet or mainnet wallet.
Start tests
yarn test
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.
aa.newRequestFilter((request, body) => {
return true;
}, (request, body) => {
console.error(request, body);
});
A series of this methods is triggered by events and if the first function returns true, it calls the second function.
Other methods from series:
More about arguments in events.
aa.newResponseFilter((err, params, vars, body) => {
return true;
}, (err, params, vars, body) => {
console.error(err, params, vars, body);
});
aa.newDefinitionFilter((definition, body) => {
return true;
}, (definition, body) => {
console.error(definition, body);
});
aa.newDefinitionSavedFilter((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'])
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: newRequestFilter, newResponseFilter
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
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.