Sign In

@absolutejs/agent-inbox

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@absolutejs/agent-inbox - npm Package Compare versions

Comparing version
0.2.0
to
0.3.0
+14
-3
dist/index.js

@@ -257,3 +257,3 @@ // @bun

setSubscriptionEnabled: (input) => store.setSubscriptionEnabled(input),
schedule: (value) => {
schedule: async (value) => {
validateTarget(value.target);

@@ -263,3 +263,10 @@ validateDelivery(value);

throw new Error("Schedule interval must be at least one second");
return store.saveSchedule(value);
const { payload, ...schedule } = value;
return store.saveSchedule({
...schedule,
encodedPayload: await codec.encode(payload, {
tenantId: value.target.tenantId,
messageId: `schedule:${value.id}`
})
});
},

@@ -339,2 +346,6 @@ listSchedules: (tenantId, limit = 100) => store.listSchedules({ tenantId, limit }),

const messageId = id();
const payload = await codec.decode(schedule.encodedPayload, {
tenantId: schedule.target.tenantId,
messageId: `schedule:${schedule.id}`
});
const message = await store.enqueue({

@@ -347,3 +358,3 @@ id: messageId,

kind: schedule.kind,
encodedPayload: await codec.encode(schedule.payload, {
encodedPayload: await codec.encode(payload, {
tenantId: schedule.target.tenantId,

@@ -350,0 +361,0 @@ messageId

+2
-2

@@ -1,2 +0,2 @@

import type { AgentInboxCodec, AgentInboxMessage, AgentInboxStore, AgentInboxSubscription, AgentInboxVerifier, AgentSchedule } from "./types";
import type { AgentInboxCodec, AgentInboxMessage, AgentInboxStore, AgentInboxSubscription, AgentInboxVerifier, AgentSchedule, AgentScheduleInput } from "./types";
export declare class AgentInboxVerificationError extends Error {

@@ -20,3 +20,3 @@ constructor(message: string);

}) => Promise<boolean>;
schedule: (value: AgentSchedule) => Promise<void>;
schedule: (value: AgentScheduleInput) => Promise<void>;
listSchedules: (tenantId?: string, limit?: number) => Promise<AgentSchedule[]>;

@@ -23,0 +23,0 @@ setScheduleEnabled: (input: {

@@ -61,3 +61,3 @@ export type AgentIdentityPin = {

kind: string;
payload: unknown;
encodedPayload: unknown;
intervalMs: number;

@@ -70,2 +70,5 @@ nextAt: string;

};
export type AgentScheduleInput = Omit<AgentSchedule, "encodedPayload"> & {
payload: unknown;
};
export type AgentInboxStore = {

@@ -72,0 +75,0 @@ saveSubscription(value: AgentInboxSubscription): Promise<void>;

{
"name": "@absolutejs/agent-inbox",
"version": "0.2.0",
"version": "0.3.0",
"description": "Durable verified webhooks, event subscriptions, schedules, leases, retries, and dead letters for AI agent triggers.",

@@ -5,0 +5,0 @@ "type": "module",