@economic/agents 0.0.1-alpha.23 → 0.0.1-alpha.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.mts +1 -69
- package/dist/index.mjs +80 -21390
- package/package.json +2 -23
- package/dist/chunk-CBBoxR_p.mjs +0 -26
- package/dist/mimetext.node.es-Br_jR3NU.mjs +0 -8391
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Base class and utilities for building LLM chat agents on Cloudflare's Agents SDK with lazy skill loading, optional message compaction, and built-in audit logging.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
|
-
npm install @economic/agents ai @cloudflare/ai-chat
|
|
6
|
+
npm install @economic/agents ai @cloudflare/ai-chat agents
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
---
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AIChatAgent as AIChatAgent$1, OnChatMessageOptions } from "@cloudflare/ai-chat";
|
|
2
2
|
import { LanguageModel, ToolSet, UIMessage, generateText, streamText } from "ai";
|
|
3
|
-
import {
|
|
4
|
-
import { DurableObject } from "cloudflare:workers";
|
|
3
|
+
import { Connection, ConnectionContext } from "agents";
|
|
5
4
|
|
|
6
5
|
//#region src/features/skills/index.d.ts
|
|
7
6
|
/**
|
|
@@ -67,73 +66,6 @@ type BuildLLMParamsConfig = Omit<LLMParams, "messages" | "experimental_context"
|
|
|
67
66
|
*/
|
|
68
67
|
declare function buildLLMParams(config: BuildLLMParamsConfig): Promise<LLMParams>;
|
|
69
68
|
//#endregion
|
|
70
|
-
//#region ../../node_modules/partyserver/dist/index.d.ts
|
|
71
|
-
//#region src/types.d.ts
|
|
72
|
-
type ImmutablePrimitive = undefined | null | boolean | string | number;
|
|
73
|
-
type Immutable<T> = T extends ImmutablePrimitive ? T : T extends Array<infer U> ? ImmutableArray<U> : T extends Map<infer K, infer V> ? ImmutableMap<K, V> : T extends Set<infer M> ? ImmutableSet<M> : ImmutableObject<T>;
|
|
74
|
-
type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
|
|
75
|
-
type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
|
|
76
|
-
type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
|
|
77
|
-
type ImmutableObject<T> = { readonly [K in keyof T]: Immutable<T[K]> };
|
|
78
|
-
type ConnectionState<T> = ImmutableObject<T> | null;
|
|
79
|
-
type ConnectionSetStateFn<T> = (prevState: ConnectionState<T>) => T;
|
|
80
|
-
type ConnectionContext = {
|
|
81
|
-
request: Request;
|
|
82
|
-
};
|
|
83
|
-
/** A WebSocket connected to the Server */
|
|
84
|
-
type Connection<TState = unknown> = WebSocket & {
|
|
85
|
-
/** Connection identifier */id: string;
|
|
86
|
-
/**
|
|
87
|
-
* Arbitrary state associated with this connection.
|
|
88
|
-
* Read-only — use {@link Connection.setState} to update.
|
|
89
|
-
*
|
|
90
|
-
* This property is configurable, meaning it can be redefined via
|
|
91
|
-
* `Object.defineProperty` by downstream consumers (e.g. the Cloudflare
|
|
92
|
-
* Agents SDK) to namespace or wrap internal state storage.
|
|
93
|
-
*/
|
|
94
|
-
state: ConnectionState<TState>;
|
|
95
|
-
/**
|
|
96
|
-
* Update the state associated with this connection.
|
|
97
|
-
*
|
|
98
|
-
* Accepts either a new state value or an updater function that receives
|
|
99
|
-
* the previous state and returns the next state.
|
|
100
|
-
*
|
|
101
|
-
* This property is configurable, meaning it can be redefined via
|
|
102
|
-
* `Object.defineProperty` by downstream consumers. If you redefine
|
|
103
|
-
* `state` and `setState`, you are responsible for calling
|
|
104
|
-
* `serializeAttachment` / `deserializeAttachment` yourself if you need
|
|
105
|
-
* the state to survive hibernation.
|
|
106
|
-
*/
|
|
107
|
-
setState(state: TState | ConnectionSetStateFn<TState> | null): ConnectionState<TState>;
|
|
108
|
-
/**
|
|
109
|
-
* @deprecated use {@link Connection.setState} instead.
|
|
110
|
-
*
|
|
111
|
-
* Low-level method to persist data in the connection's attachment storage.
|
|
112
|
-
* This property is configurable and can be redefined by downstream
|
|
113
|
-
* consumers that need to wrap or namespace the underlying storage.
|
|
114
|
-
*/
|
|
115
|
-
serializeAttachment<T = unknown>(attachment: T): void;
|
|
116
|
-
/**
|
|
117
|
-
* @deprecated use {@link Connection.state} instead.
|
|
118
|
-
*
|
|
119
|
-
* Low-level method to read data from the connection's attachment storage.
|
|
120
|
-
* This property is configurable and can be redefined by downstream
|
|
121
|
-
* consumers that need to wrap or namespace the underlying storage.
|
|
122
|
-
*/
|
|
123
|
-
deserializeAttachment<T = unknown>(): T | null;
|
|
124
|
-
/**
|
|
125
|
-
* Tags assigned to this connection via {@link Server.getConnectionTags}.
|
|
126
|
-
* Always includes the connection id as the first tag.
|
|
127
|
-
*/
|
|
128
|
-
tags: readonly string[];
|
|
129
|
-
/**
|
|
130
|
-
* @deprecated Use `this.name` on the Server instead.
|
|
131
|
-
* The server name. Populated from `Server.name` after initialization.
|
|
132
|
-
*/
|
|
133
|
-
server: string;
|
|
134
|
-
}; //#endregion
|
|
135
|
-
//#region src/index.d.ts
|
|
136
|
-
//#endregion
|
|
137
69
|
//#region src/agents/AIChatAgent.d.ts
|
|
138
70
|
/**
|
|
139
71
|
* Base class for Cloudflare Agents SDK chat agents with lazy skill loading
|