Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

aa-hooks

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

aa-hooks - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

package.json
{
"name": "aa-hooks",
"version": "0.0.1",
"version": "0.0.2",
"description": "Library for working with autonomous agent events",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -26,3 +26,3 @@

- isBounced
- customHook
- customFilter

@@ -43,2 +43,4 @@ ## Examples

console.error("Response unit: ", responseObj.response_unit);
await hooks.addWatchedAddress("..."); // watch new agent
}

@@ -45,0 +47,0 @@

@@ -386,3 +386,3 @@ const dag = require('aabot/dag.js');

customHook(filter, metaKeys = []) {
customFilter(filter, metaKeys = []) {

@@ -389,0 +389,0 @@ this.#addFilter(this.type, async (res) => {

@@ -57,3 +57,3 @@ const { v4: uuidv4 } = require('uuid');

async #findType(res) {
async #findId(res) {
let type;

@@ -108,2 +108,10 @@ const entries = Object.entries(this.filters);

/**
* @param {string} address
*/
async addWatchedAddress(address) {
await dag.loadAA(address);
await this.#watch(address);
}
async #responseHandler(res) {

@@ -113,3 +121,3 @@ const unlock = await mutex.lock('responseHandler');

if (res.timestamp >= this.startTs) {
const eventType = await this.#findType(res);
const eventType = await this.#findId(res);

@@ -116,0 +124,0 @@ if (eventType) {

@@ -111,4 +111,4 @@ export = HookController;

*/
customHook(filter: (response: response, meta: meta) => boolean, metaKeys?: Array<string>): import("./hookController");
customFilter(filter: (response: response, meta: meta) => boolean, metaKeys?: Array<string>): import("./hookController");
#private;
}

@@ -16,4 +16,4 @@ export class Hooks {

* @callback eventCallback
* @param {object} response
* @param {object} trigger
* @param {object} triggerUnit
* @param {object} responseObj
*/

@@ -24,5 +24,9 @@ /**

*/
register(callback: (response: object, trigger: object) => any): HookController;
register(callback: (triggerUnit: object, responseObj: object) => any): HookController;
/**
* @param {string} address
*/
addWatchedAddress(address: string): Promise<void>;
#private;
}
import HookController = require("./hookController");
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc