New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

agents-sdk

Package Overview
Dependencies
Maintainers
0
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agents-sdk - npm Package Compare versions

Comparing version 0.0.0-dae7e07 to 0.0.0-e1aa5b7

dist/chunk-X3UUTPNL.js

2

dist/ai-chat-agent.js
import {
Agent
} from "./chunk-X57WSUMB.js";
} from "./chunk-X3UUTPNL.js";

@@ -5,0 +5,0 @@ // src/ai-chat-agent.ts

@@ -43,4 +43,4 @@ import { Server, Connection, PartyServerOptions } from "partyserver";

when: Date | string | number,
callback: string,
payload: T
callback: keyof this,
payload?: T
): Promise<Schedule<T>>;

@@ -47,0 +47,0 @@ getSchedule<T = string>(id: string): Promise<Schedule<T> | undefined>;

@@ -7,3 +7,3 @@ import {

routeAgentRequest
} from "./chunk-X57WSUMB.js";
} from "./chunk-X3UUTPNL.js";
export {

@@ -10,0 +10,0 @@ Agent,

{
"name": "agents-sdk",
"version": "0.0.0-dae7e07",
"version": "0.0.0-e1aa5b7",
"main": "src/index.ts",

@@ -42,4 +42,12 @@ "type": "module",

"keywords": [],
"author": "",
"license": "ISC",
"repository": {
"type": "git",
"url": "https://github.com/cloudflare/agents.git",
"directory": "packages/agents"
},
"bugs": {
"url": "https://github.com/cloudflare/agents/issues"
},
"author": "Cloudflare Inc.",
"license": "MIT",
"description": "A home for your AI agents",

@@ -46,0 +54,0 @@ "dependencies": {

@@ -176,16 +176,6 @@ import {

#warnedToImplementOnStateUpdate = false;
onStateUpdate(state: State | undefined, source: Connection | "server") {
if (!this.#warnedToImplementOnStateUpdate) {
console.log(
"state updated, implement onStateUpdate in your agent to handle this change"
);
this.#warnedToImplementOnStateUpdate = true;
}
// override this to handle state updates
}
// onMessage(connection: Connection, message: WSMessage) {}
// onConnect(connection: Connection, ctx: ConnectionContext) {}
onEmail(email: ForwardableEmailMessage) {

@@ -200,7 +190,15 @@ throw new Error("Not implemented");

when: Date | string | number,
callback: string,
payload: T
callback: keyof this,
payload?: T
): Promise<Schedule<T>> {
const id = nanoid(9);
if (typeof callback !== "string") {
throw new Error("Callback must be a string");
}
if (typeof this[callback] !== "function") {
throw new Error(`this.${callback} is not a function`);
}
if (when instanceof Date) {

@@ -219,4 +217,4 @@ const timestamp = Math.floor(when.getTime() / 1000);

id,
callback,
payload,
callback: callback,
payload: payload as T,
time: timestamp,

@@ -240,4 +238,4 @@ type: "scheduled",

id,
callback,
payload,
callback: callback,
payload: payload as T,
delayInSeconds: when,

@@ -262,4 +260,4 @@ time: timestamp,

id,
callback,
payload,
callback: callback,
payload: payload as T,
cron: when,

@@ -266,0 +264,0 @@ time: timestamp,

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