agentxjs 1.8.1 → 1.9.1-dev
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/build.ts +26 -0
- package/package.json +8 -26
- package/src/RemoteClient.ts +221 -0
- package/src/index.ts +118 -0
- package/src/presentation/Presentation.ts +189 -0
- package/src/presentation/index.ts +32 -0
- package/src/presentation/reducer.ts +317 -0
- package/src/presentation/types.ts +111 -0
- package/src/types.ts +337 -0
- package/tsconfig.json +11 -0
- package/README.md +0 -393
- package/dist/browser.js +0 -228
- package/dist/browser.js.map +0 -11
- package/dist/index.d.ts +0 -60
- package/dist/index.js +0 -340
- package/dist/index.js.map +0 -12
package/README.md
DELETED
|
@@ -1,393 +0,0 @@
|
|
|
1
|
-
# agentxjs
|
|
2
|
-
|
|
3
|
-
> Unified API for AI Agents - Server and Browser
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
`agentxjs` provides a **unified API** for building AI agents that works seamlessly across server (Node.js) and browser environments.
|
|
8
|
-
|
|
9
|
-
**Key Features:**
|
|
10
|
-
|
|
11
|
-
- **Unified API** - Same `createAgentX()` function for both server and browser
|
|
12
|
-
- **Type-Safe Configuration** - TypeScript discriminates between Source and Mirror modes
|
|
13
|
-
- **Docker-Style Lifecycle** - Container → Agent → Image
|
|
14
|
-
- **Event-Driven** - Real-time streaming events (text_delta, tool_call, etc.)
|
|
15
|
-
|
|
16
|
-
## Installation
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
pnpm add agentxjs
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Quick Start
|
|
25
|
-
|
|
26
|
-
### Server (Source Mode)
|
|
27
|
-
|
|
28
|
-
```typescript
|
|
29
|
-
import { createAgentX } from "agentxjs";
|
|
30
|
-
|
|
31
|
-
// Minimal - reads ANTHROPIC_API_KEY from environment
|
|
32
|
-
const agentx = createAgentX();
|
|
33
|
-
|
|
34
|
-
// Or with explicit configuration
|
|
35
|
-
const agentx = createAgentX({
|
|
36
|
-
apiKey: "sk-ant-...",
|
|
37
|
-
model: "claude-sonnet-4-20250514",
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// Run an agent
|
|
41
|
-
const agent = await agentx.run({ name: "Assistant" });
|
|
42
|
-
|
|
43
|
-
// Subscribe to events
|
|
44
|
-
agent.on("text_delta", (e) => process.stdout.write(e.data.text));
|
|
45
|
-
|
|
46
|
-
// Send message
|
|
47
|
-
await agent.receive("Hello!");
|
|
48
|
-
|
|
49
|
-
// Cleanup
|
|
50
|
-
await agentx.dispose();
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Browser (Mirror Mode)
|
|
54
|
-
|
|
55
|
-
```typescript
|
|
56
|
-
import { createAgentX } from "agentxjs";
|
|
57
|
-
|
|
58
|
-
// Connect to remote server via WebSocket
|
|
59
|
-
const agentx = createAgentX({
|
|
60
|
-
serverUrl: "ws://localhost:5200",
|
|
61
|
-
token: "optional-auth-token",
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// Same API as server!
|
|
65
|
-
const agent = await agentx.run({ name: "Assistant" });
|
|
66
|
-
|
|
67
|
-
agent.on("text_delta", (e) => console.log(e.data.text));
|
|
68
|
-
|
|
69
|
-
await agent.receive("Hello!");
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## API Design
|
|
75
|
-
|
|
76
|
-
### Configuration Types
|
|
77
|
-
|
|
78
|
-
```typescript
|
|
79
|
-
// Server-side configuration (Source mode)
|
|
80
|
-
interface SourceConfig {
|
|
81
|
-
apiKey?: string; // Default: process.env.ANTHROPIC_API_KEY
|
|
82
|
-
model?: string; // Default: "claude-sonnet-4-20250514"
|
|
83
|
-
baseUrl?: string; // Default: "https://api.anthropic.com"
|
|
84
|
-
persistence?: Persistence;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// Browser-side configuration (Mirror mode)
|
|
88
|
-
interface MirrorConfig {
|
|
89
|
-
serverUrl: string; // WebSocket URL, e.g., "ws://localhost:5200"
|
|
90
|
-
token?: string; // Authentication token
|
|
91
|
-
headers?: Record<string, string>;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Type discrimination: presence of `serverUrl` determines mode
|
|
95
|
-
type AgentXConfig = SourceConfig | MirrorConfig;
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### Type Guards
|
|
99
|
-
|
|
100
|
-
```typescript
|
|
101
|
-
import { isMirrorConfig, isSourceConfig } from "agentxjs";
|
|
102
|
-
|
|
103
|
-
const config: AgentXConfig = { serverUrl: "ws://localhost:5200" };
|
|
104
|
-
|
|
105
|
-
if (isMirrorConfig(config)) {
|
|
106
|
-
// TypeScript knows this is MirrorConfig
|
|
107
|
-
console.log(config.serverUrl);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
if (isSourceConfig(config)) {
|
|
111
|
-
// TypeScript knows this is SourceConfig
|
|
112
|
-
console.log(config.apiKey);
|
|
113
|
-
}
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### AgentX Interface
|
|
117
|
-
|
|
118
|
-
```typescript
|
|
119
|
-
interface AgentX {
|
|
120
|
-
// Quick start - run agent in default container
|
|
121
|
-
run(config: AgentRunConfig): Promise<Agent>;
|
|
122
|
-
|
|
123
|
-
// Container management
|
|
124
|
-
readonly containers: ContainersAPI;
|
|
125
|
-
|
|
126
|
-
// Agent management (cross-container)
|
|
127
|
-
readonly agents: AgentsAPI;
|
|
128
|
-
|
|
129
|
-
// Image (snapshot) management
|
|
130
|
-
readonly images: ImagesAPI;
|
|
131
|
-
|
|
132
|
-
// Cleanup
|
|
133
|
-
dispose(): Promise<void>;
|
|
134
|
-
}
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Sub-APIs
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
// Container management
|
|
141
|
-
interface ContainersAPI {
|
|
142
|
-
create(containerId: string): Promise<Container>;
|
|
143
|
-
get(containerId: string): Container | undefined;
|
|
144
|
-
list(): Container[];
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// Agent management
|
|
148
|
-
interface AgentsAPI {
|
|
149
|
-
run(containerId: string, config: AgentRunConfig): Promise<Agent>;
|
|
150
|
-
get(agentId: string): Agent | undefined;
|
|
151
|
-
list(containerId: string): Agent[];
|
|
152
|
-
destroy(agentId: string): Promise<boolean>;
|
|
153
|
-
destroyAll(containerId: string): Promise<void>;
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
// Image management
|
|
157
|
-
interface ImagesAPI {
|
|
158
|
-
snapshot(agent: Agent): Promise<AgentImage>;
|
|
159
|
-
list(): Promise<AgentImage[]>;
|
|
160
|
-
get(imageId: string): Promise<AgentImage | null>;
|
|
161
|
-
delete(imageId: string): Promise<void>;
|
|
162
|
-
}
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### Agent Run Configuration
|
|
166
|
-
|
|
167
|
-
```typescript
|
|
168
|
-
interface AgentRunConfig {
|
|
169
|
-
name: string;
|
|
170
|
-
systemPrompt?: string;
|
|
171
|
-
}
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
---
|
|
175
|
-
|
|
176
|
-
## Architecture
|
|
177
|
-
|
|
178
|
-
```text
|
|
179
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
180
|
-
│ createAgentX(config) │
|
|
181
|
-
├─────────────────────────────────────────────────────────────────┤
|
|
182
|
-
│ │
|
|
183
|
-
│ config has serverUrl? │
|
|
184
|
-
│ │ │
|
|
185
|
-
│ ├── YES ──▶ Mirror Mode (Browser) │
|
|
186
|
-
│ │ - MirrorRuntime │
|
|
187
|
-
│ │ - WebSocket communication │
|
|
188
|
-
│ │ - Local state mirrors server │
|
|
189
|
-
│ │ │
|
|
190
|
-
│ └── NO ───▶ Source Mode (Server) │
|
|
191
|
-
│ - Runtime │
|
|
192
|
-
│ - Direct LLM access │
|
|
193
|
-
│ - Persistence layer │
|
|
194
|
-
│ │
|
|
195
|
-
├─────────────────────────────────────────────────────────────────┤
|
|
196
|
-
│ │
|
|
197
|
-
│ AgentX API │
|
|
198
|
-
│ │
|
|
199
|
-
│ agentx.run(config) Quick start │
|
|
200
|
-
│ agentx.containers.* Container lifecycle │
|
|
201
|
-
│ agentx.agents.* Agent operations │
|
|
202
|
-
│ agentx.images.* Snapshot management │
|
|
203
|
-
│ agentx.dispose() Cleanup │
|
|
204
|
-
│ │
|
|
205
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### Source vs Mirror
|
|
209
|
-
|
|
210
|
-
| Aspect | Source (Server) | Mirror (Browser) |
|
|
211
|
-
| ------------- | -------------------- | ---------------- |
|
|
212
|
-
| Runtime | Runtime | MirrorRuntime |
|
|
213
|
-
| LLM Access | Direct API calls | Via server |
|
|
214
|
-
| Persistence | Local (SQLite, etc.) | Server-side |
|
|
215
|
-
| Communication | N/A | WebSocket events |
|
|
216
|
-
| Use Case | Backend services | Frontend apps |
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## Docker-Style Lifecycle
|
|
221
|
-
|
|
222
|
-
```text
|
|
223
|
-
┌─────────────────────────────────────────────────────────────────┐
|
|
224
|
-
│ Lifecycle Flow │
|
|
225
|
-
├─────────────────────────────────────────────────────────────────┤
|
|
226
|
-
│ │
|
|
227
|
-
│ Container │
|
|
228
|
-
│ │ │
|
|
229
|
-
│ │ run(config) │
|
|
230
|
-
│ ▼ │
|
|
231
|
-
│ Agent (running instance) │
|
|
232
|
-
│ │ │
|
|
233
|
-
│ │ snapshot() │
|
|
234
|
-
│ ▼ │
|
|
235
|
-
│ AgentImage (frozen state) │
|
|
236
|
-
│ │ │
|
|
237
|
-
│ │ resume() │
|
|
238
|
-
│ ▼ │
|
|
239
|
-
│ Agent (restored from image) │
|
|
240
|
-
│ │
|
|
241
|
-
└─────────────────────────────────────────────────────────────────┘
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
### Image Operations
|
|
245
|
-
|
|
246
|
-
```typescript
|
|
247
|
-
// Create snapshot
|
|
248
|
-
const agent = await agentx.run({ name: "Assistant" });
|
|
249
|
-
await agent.receive("Hello!");
|
|
250
|
-
const image = await agentx.images.snapshot(agent);
|
|
251
|
-
|
|
252
|
-
// Resume from snapshot
|
|
253
|
-
const resumedAgent = await image.resume();
|
|
254
|
-
// Agent has previous conversation history
|
|
255
|
-
```
|
|
256
|
-
|
|
257
|
-
---
|
|
258
|
-
|
|
259
|
-
## Event System
|
|
260
|
-
|
|
261
|
-
### Stream Events (Real-time)
|
|
262
|
-
|
|
263
|
-
```typescript
|
|
264
|
-
agent.on("message_start", (e) => {
|
|
265
|
-
/* Response started */
|
|
266
|
-
});
|
|
267
|
-
agent.on("text_delta", (e) => console.log(e.data.text));
|
|
268
|
-
agent.on("tool_call", (e) => {
|
|
269
|
-
/* Tool being called */
|
|
270
|
-
});
|
|
271
|
-
agent.on("tool_result", (e) => {
|
|
272
|
-
/* Tool result received */
|
|
273
|
-
});
|
|
274
|
-
agent.on("message_stop", (e) => {
|
|
275
|
-
/* Response complete */
|
|
276
|
-
});
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### Subscribe to All Events
|
|
280
|
-
|
|
281
|
-
```typescript
|
|
282
|
-
agent.on((event) => {
|
|
283
|
-
console.log(event.type, event.data);
|
|
284
|
-
});
|
|
285
|
-
```
|
|
286
|
-
|
|
287
|
-
---
|
|
288
|
-
|
|
289
|
-
## Advanced Usage
|
|
290
|
-
|
|
291
|
-
### Container Management
|
|
292
|
-
|
|
293
|
-
```typescript
|
|
294
|
-
// Create named container
|
|
295
|
-
const container = await agentx.containers.create("my-container");
|
|
296
|
-
|
|
297
|
-
// Run agent in container
|
|
298
|
-
const agent = await agentx.agents.run("my-container", {
|
|
299
|
-
name: "Assistant",
|
|
300
|
-
systemPrompt: "You are helpful",
|
|
301
|
-
});
|
|
302
|
-
|
|
303
|
-
// List agents in container
|
|
304
|
-
const agents = agentx.agents.list("my-container");
|
|
305
|
-
|
|
306
|
-
// Destroy all agents in container
|
|
307
|
-
await agentx.agents.destroyAll("my-container");
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
### Custom Persistence (Source Mode)
|
|
311
|
-
|
|
312
|
-
```typescript
|
|
313
|
-
import { createAgentX } from "agentxjs";
|
|
314
|
-
import { createPersistence } from "@agentxjs/persistence";
|
|
315
|
-
|
|
316
|
-
const agentx = createAgentX({
|
|
317
|
-
apiKey: "sk-ant-...",
|
|
318
|
-
persistence: createPersistence({
|
|
319
|
-
driver: "sqlite",
|
|
320
|
-
path: "./data.db",
|
|
321
|
-
}),
|
|
322
|
-
});
|
|
323
|
-
```
|
|
324
|
-
|
|
325
|
-
---
|
|
326
|
-
|
|
327
|
-
## Design Decisions
|
|
328
|
-
|
|
329
|
-
### Why Unified `createAgentX`?
|
|
330
|
-
|
|
331
|
-
Instead of separate `createSource()` and `createMirror()` functions, we use a single `createAgentX()` with type discrimination:
|
|
332
|
-
|
|
333
|
-
```typescript
|
|
334
|
-
// Type system determines mode automatically
|
|
335
|
-
createAgentX(); // Source (no serverUrl)
|
|
336
|
-
createAgentX({ apiKey: "..." }); // Source (no serverUrl)
|
|
337
|
-
createAgentX({ serverUrl: "ws://..." }); // Mirror (has serverUrl)
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
**Benefits:**
|
|
341
|
-
|
|
342
|
-
- Single import, single function to learn
|
|
343
|
-
- TypeScript enforces correct configuration
|
|
344
|
-
- Easy refactoring between modes
|
|
345
|
-
|
|
346
|
-
### Why WebSocket for Mirror?
|
|
347
|
-
|
|
348
|
-
Mirror mode uses WebSocket (not HTTP/SSE) for bidirectional communication:
|
|
349
|
-
|
|
350
|
-
1. **Request/Response pattern** - Browser sends commands, server responds
|
|
351
|
-
2. **Real-time events** - Server pushes stream events to browser
|
|
352
|
-
3. **State synchronization** - Browser maintains local mirror of server state
|
|
353
|
-
|
|
354
|
-
### Why No `defineAgent`?
|
|
355
|
-
|
|
356
|
-
Previous versions required:
|
|
357
|
-
|
|
358
|
-
```typescript
|
|
359
|
-
const MyAgent = defineAgent({ name: "Assistant", ... });
|
|
360
|
-
agentx.definitions.register(MyAgent);
|
|
361
|
-
const image = agentx.images.getMetaImage(MyAgent.name);
|
|
362
|
-
const agent = await image.run();
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
New API is simpler:
|
|
366
|
-
|
|
367
|
-
```typescript
|
|
368
|
-
const agent = await agentx.run({ name: "Assistant", ... });
|
|
369
|
-
```
|
|
370
|
-
|
|
371
|
-
The `AgentRunConfig` replaces `AgentDefinition` for most use cases. For advanced scenarios (versioning, derived images), use the Images API directly.
|
|
372
|
-
|
|
373
|
-
---
|
|
374
|
-
|
|
375
|
-
## Package Dependencies
|
|
376
|
-
|
|
377
|
-
```text
|
|
378
|
-
@agentxjs/types Type definitions
|
|
379
|
-
↑
|
|
380
|
-
@agentxjs/common Logger facade
|
|
381
|
-
↑
|
|
382
|
-
@agentxjs/runtime Runtime implementation
|
|
383
|
-
↑
|
|
384
|
-
@agentxjs/mirror MirrorRuntime implementation
|
|
385
|
-
↑
|
|
386
|
-
agentxjs This package (unified API)
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
---
|
|
390
|
-
|
|
391
|
-
## License
|
|
392
|
-
|
|
393
|
-
MIT
|
package/dist/browser.js
DELETED
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
7
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
8
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
9
|
-
for (let key of __getOwnPropNames(mod))
|
|
10
|
-
if (!__hasOwnProp.call(to, key))
|
|
11
|
-
__defProp(to, key, {
|
|
12
|
-
get: () => mod[key],
|
|
13
|
-
enumerable: true
|
|
14
|
-
});
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
18
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
19
|
-
}) : x)(function(x) {
|
|
20
|
-
if (typeof require !== "undefined")
|
|
21
|
-
return require.apply(this, arguments);
|
|
22
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
// src/browser.ts
|
|
26
|
-
import { isLocalConfig, isRemoteConfig as isRemoteConfig2 } from "@agentxjs/types/agentx";
|
|
27
|
-
import {
|
|
28
|
-
isFromSource,
|
|
29
|
-
hasIntent,
|
|
30
|
-
isRequest,
|
|
31
|
-
isResult,
|
|
32
|
-
isNotification
|
|
33
|
-
} from "@agentxjs/types/event";
|
|
34
|
-
import { isCommandEvent, isCommandRequest, isCommandResponse } from "@agentxjs/types/event";
|
|
35
|
-
import {
|
|
36
|
-
isAgentEvent,
|
|
37
|
-
isAgentStreamEvent,
|
|
38
|
-
isAgentStateEvent,
|
|
39
|
-
isAgentMessageEvent,
|
|
40
|
-
isAgentTurnEvent
|
|
41
|
-
} from "@agentxjs/types/event";
|
|
42
|
-
import { isRemoteConfig as isRemoteConfig3 } from "@agentxjs/types/agentx";
|
|
43
|
-
|
|
44
|
-
// src/createAgentX.ts
|
|
45
|
-
import { isRemoteConfig } from "@agentxjs/types/agentx";
|
|
46
|
-
import { createLogger } from "@agentxjs/common";
|
|
47
|
-
var remoteLogger = createLogger("agentx/RemoteClient");
|
|
48
|
-
async function createRemoteAgentX(config) {
|
|
49
|
-
const { createWebSocketClient } = await import("@agentxjs/network");
|
|
50
|
-
const client = await createWebSocketClient({
|
|
51
|
-
serverUrl: config.serverUrl,
|
|
52
|
-
headers: config.headers,
|
|
53
|
-
autoReconnect: true,
|
|
54
|
-
minReconnectionDelay: 1000,
|
|
55
|
-
maxReconnectionDelay: 1e4,
|
|
56
|
-
connectionTimeout: 4000,
|
|
57
|
-
maxRetries: Infinity,
|
|
58
|
-
debug: false
|
|
59
|
-
});
|
|
60
|
-
const handlers = new Map;
|
|
61
|
-
const pendingRequests = new Map;
|
|
62
|
-
client.onMessage((message) => {
|
|
63
|
-
try {
|
|
64
|
-
const event = JSON.parse(message);
|
|
65
|
-
remoteLogger.info("Received event", {
|
|
66
|
-
type: event.type,
|
|
67
|
-
category: event.category,
|
|
68
|
-
requestId: event.data?.requestId
|
|
69
|
-
});
|
|
70
|
-
if (event.type === "system_error") {
|
|
71
|
-
const errorData = event.data;
|
|
72
|
-
remoteLogger.error(errorData.message, {
|
|
73
|
-
severity: errorData.severity,
|
|
74
|
-
requestId: event.data?.requestId,
|
|
75
|
-
details: errorData.details
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
const requestId = event.data?.requestId;
|
|
79
|
-
if (event.category === "response" && requestId && pendingRequests.has(requestId)) {
|
|
80
|
-
remoteLogger.info("Resolving pending request", { requestId, eventType: event.type });
|
|
81
|
-
const pending = pendingRequests.get(requestId);
|
|
82
|
-
clearTimeout(pending.timer);
|
|
83
|
-
pendingRequests.delete(requestId);
|
|
84
|
-
pending.resolve(event);
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
remoteLogger.info("Dispatching to handlers", { type: event.type });
|
|
88
|
-
const typeHandlers = handlers.get(event.type);
|
|
89
|
-
if (typeHandlers) {
|
|
90
|
-
for (const handler of typeHandlers) {
|
|
91
|
-
handler(event);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
const allHandlers = handlers.get("*");
|
|
95
|
-
if (allHandlers) {
|
|
96
|
-
for (const handler of allHandlers) {
|
|
97
|
-
handler(event);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
} catch {}
|
|
101
|
-
});
|
|
102
|
-
client.onClose(() => {
|
|
103
|
-
remoteLogger.warn("WebSocket closed");
|
|
104
|
-
});
|
|
105
|
-
client.onError((error) => {
|
|
106
|
-
remoteLogger.error("WebSocket error", { error: error.message });
|
|
107
|
-
});
|
|
108
|
-
function subscribe(type, handler) {
|
|
109
|
-
if (!handlers.has(type)) {
|
|
110
|
-
handlers.set(type, new Set);
|
|
111
|
-
}
|
|
112
|
-
handlers.get(type).add(handler);
|
|
113
|
-
return () => {
|
|
114
|
-
handlers.get(type)?.delete(handler);
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
return {
|
|
118
|
-
async request(type, data, timeout = 30000) {
|
|
119
|
-
const requestId = `req_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`;
|
|
120
|
-
let mergedData = { ...data, requestId };
|
|
121
|
-
if (config.context) {
|
|
122
|
-
try {
|
|
123
|
-
let resolvedContext;
|
|
124
|
-
if (typeof config.context === "function") {
|
|
125
|
-
resolvedContext = await Promise.resolve(config.context());
|
|
126
|
-
} else {
|
|
127
|
-
resolvedContext = config.context;
|
|
128
|
-
}
|
|
129
|
-
mergedData = {
|
|
130
|
-
...resolvedContext,
|
|
131
|
-
...data,
|
|
132
|
-
requestId
|
|
133
|
-
};
|
|
134
|
-
remoteLogger.info("Merged context into request", {
|
|
135
|
-
type,
|
|
136
|
-
requestId,
|
|
137
|
-
contextKeys: Object.keys(resolvedContext)
|
|
138
|
-
});
|
|
139
|
-
} catch (error) {
|
|
140
|
-
remoteLogger.error("Failed to resolve context", {
|
|
141
|
-
type,
|
|
142
|
-
requestId,
|
|
143
|
-
error: error instanceof Error ? error.message : String(error)
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
return new Promise((resolve, reject) => {
|
|
148
|
-
const timer = setTimeout(() => {
|
|
149
|
-
pendingRequests.delete(requestId);
|
|
150
|
-
reject(new Error(`Request timeout: ${type}`));
|
|
151
|
-
}, timeout);
|
|
152
|
-
pendingRequests.set(requestId, {
|
|
153
|
-
resolve,
|
|
154
|
-
reject,
|
|
155
|
-
timer
|
|
156
|
-
});
|
|
157
|
-
const event = {
|
|
158
|
-
type,
|
|
159
|
-
timestamp: Date.now(),
|
|
160
|
-
data: mergedData,
|
|
161
|
-
source: "command",
|
|
162
|
-
category: "request",
|
|
163
|
-
intent: "request"
|
|
164
|
-
};
|
|
165
|
-
client.send(JSON.stringify(event));
|
|
166
|
-
});
|
|
167
|
-
},
|
|
168
|
-
on(type, handler) {
|
|
169
|
-
return subscribe(type, handler);
|
|
170
|
-
},
|
|
171
|
-
onCommand(type, handler) {
|
|
172
|
-
return subscribe(type, handler);
|
|
173
|
-
},
|
|
174
|
-
emitCommand(type, data) {
|
|
175
|
-
const event = {
|
|
176
|
-
type,
|
|
177
|
-
timestamp: Date.now(),
|
|
178
|
-
data,
|
|
179
|
-
source: "command",
|
|
180
|
-
category: type.toString().endsWith("_response") ? "response" : "request",
|
|
181
|
-
intent: type.toString().endsWith("_response") ? "result" : "request"
|
|
182
|
-
};
|
|
183
|
-
client.send(JSON.stringify(event));
|
|
184
|
-
},
|
|
185
|
-
async listen() {
|
|
186
|
-
throw new Error("Cannot listen in remote mode");
|
|
187
|
-
},
|
|
188
|
-
async close() {},
|
|
189
|
-
async dispose() {
|
|
190
|
-
for (const pending of pendingRequests.values()) {
|
|
191
|
-
clearTimeout(pending.timer);
|
|
192
|
-
pending.reject(new Error("AgentX disposed"));
|
|
193
|
-
}
|
|
194
|
-
pendingRequests.clear();
|
|
195
|
-
handlers.clear();
|
|
196
|
-
client.dispose();
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
// src/browser.ts
|
|
202
|
-
async function createAgentX(config) {
|
|
203
|
-
if (!config || !isRemoteConfig3(config)) {
|
|
204
|
-
throw new Error("Browser environment only supports remote mode. " + 'Please provide { serverUrl: "ws://..." } configuration.');
|
|
205
|
-
}
|
|
206
|
-
return createRemoteAgentX(config);
|
|
207
|
-
}
|
|
208
|
-
export {
|
|
209
|
-
isResult,
|
|
210
|
-
isRequest,
|
|
211
|
-
isRemoteConfig2 as isRemoteConfig,
|
|
212
|
-
isNotification,
|
|
213
|
-
isLocalConfig,
|
|
214
|
-
isFromSource,
|
|
215
|
-
isCommandResponse,
|
|
216
|
-
isCommandRequest,
|
|
217
|
-
isCommandEvent,
|
|
218
|
-
isAgentTurnEvent,
|
|
219
|
-
isAgentStreamEvent,
|
|
220
|
-
isAgentStateEvent,
|
|
221
|
-
isAgentMessageEvent,
|
|
222
|
-
isAgentEvent,
|
|
223
|
-
hasIntent,
|
|
224
|
-
createRemoteAgentX,
|
|
225
|
-
createAgentX
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
//# debugId=8D4B9F8AA8319ED964756E2164756E21
|
package/dist/browser.js.map
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/browser.ts", "../src/createAgentX.ts"],
|
|
4
|
-
"sourcesContent": [
|
|
5
|
-
"/**\n * agentxjs - Browser Entry Point\n *\n * This entry is automatically selected by bundlers (Vite, Webpack, etc.)\n * when building for browser environments.\n *\n * Only includes remote mode (WebSocket client).\n * Does not include Node.js specific code (runtime, fs, sqlite, etc.)\n */\n\n// Re-export everything from index except createAgentX\nexport type {\n AgentX,\n AgentXConfig,\n LocalConfig,\n RemoteConfig,\n LLMConfig,\n StorageConfig,\n StorageDriver,\n Unsubscribe,\n} from \"@agentxjs/types/agentx\";\n\nexport { isLocalConfig, isRemoteConfig } from \"@agentxjs/types/agentx\";\n\n// Event types\nexport type {\n SystemEvent,\n EventSource,\n EventCategory,\n EventIntent,\n EventContext,\n} from \"@agentxjs/types/event\";\n\nexport {\n isFromSource,\n hasIntent,\n isRequest,\n isResult,\n isNotification,\n} from \"@agentxjs/types/event\";\n\n// Command events\nexport type {\n CommandEvent,\n CommandRequest,\n CommandResponse,\n CommandEventType,\n CommandRequestType,\n CommandEventMap,\n ContainerCreateRequest,\n ContainerCreateResponse,\n ContainerGetRequest,\n ContainerGetResponse,\n ContainerListRequest,\n ContainerListResponse,\n AgentGetRequest,\n AgentGetResponse,\n AgentListRequest,\n AgentListResponse,\n AgentDestroyRequest,\n AgentDestroyResponse,\n MessageSendRequest,\n MessageSendResponse,\n AgentInterruptRequest,\n AgentInterruptResponse,\n ImageCreateRequest,\n ImageCreateResponse,\n ImageRunRequest,\n ImageRunResponse,\n ImageStopRequest,\n ImageStopResponse,\n ImageUpdateRequest,\n ImageUpdateResponse,\n ImageListRequest,\n ImageListResponse,\n ImageListItem,\n ImageGetRequest,\n ImageGetResponse,\n ImageDeleteRequest,\n ImageDeleteResponse,\n} from \"@agentxjs/types/event\";\n\nexport { isCommandEvent, isCommandRequest, isCommandResponse } from \"@agentxjs/types/event\";\n\n// Agent events\nexport type {\n AgentEvent,\n AgentEventCategory,\n AgentStreamEvent,\n AgentTextDeltaEvent,\n AgentMessageStartEvent,\n AgentMessageStopEvent,\n AgentToolUseStartEvent,\n AgentToolUseStopEvent,\n AgentToolResultEvent,\n AgentStateEvent,\n ConversationStartEvent,\n ConversationEndEvent,\n ConversationThinkingEvent,\n ConversationRespondingEvent,\n ToolExecutingEvent,\n ToolCompletedEvent,\n ErrorOccurredEvent,\n AgentMessageEvent,\n UserMessageEvent,\n AssistantMessageEvent,\n ToolCallMessageEvent,\n ToolResultMessageEvent,\n AgentTurnEvent,\n TurnRequestEvent,\n TurnResponseEvent,\n TokenUsage,\n} from \"@agentxjs/types/event\";\n\nexport {\n isAgentEvent,\n isAgentStreamEvent,\n isAgentStateEvent,\n isAgentMessageEvent,\n isAgentTurnEvent,\n} from \"@agentxjs/types/event\";\n\n// Data types\nexport type { ImageRecord } from \"@agentxjs/types\";\n\nexport type {\n Message,\n UserMessage,\n AssistantMessage,\n ToolCallMessage,\n ToolResultMessage,\n AgentError,\n ContentPart,\n TextPart,\n ToolCallPart,\n ToolResultPart,\n ToolResultOutput,\n} from \"@agentxjs/types/agent\";\n\n// Browser-only createAgentX (remote mode only)\nimport type { AgentX, AgentXConfig } from \"@agentxjs/types/agentx\";\nimport { isRemoteConfig } from \"@agentxjs/types/agentx\";\nimport { createRemoteAgentX } from \"./createAgentX\";\n\n/**\n * Create AgentX instance (Browser version - remote mode only)\n *\n * @param config - Must be RemoteConfig with server URL\n * @returns AgentX instance\n *\n * @example\n * ```typescript\n * const agentx = await createAgentX({ server: \"ws://localhost:5200\" });\n * ```\n */\nexport async function createAgentX(config: AgentXConfig): Promise<AgentX> {\n if (!config || !isRemoteConfig(config)) {\n throw new Error(\n \"Browser environment only supports remote mode. \" +\n 'Please provide { serverUrl: \"ws://...\" } configuration.'\n );\n }\n return createRemoteAgentX(config);\n}\n\n// Also export createRemoteAgentX for explicit usage\nexport { createRemoteAgentX } from \"./createAgentX\";\n",
|
|
6
|
-
"/**\n * createAgentX - Factory function for creating AgentX instances\n *\n * Supports two modes:\n * - Local mode: Uses Runtime directly (Claude API) - Node.js only\n * - Remote mode: Connects to AgentX server via WebSocket - Browser & Node.js\n *\n * Local mode implementation is dynamically imported to enable tree-shaking\n * in browser builds.\n */\n\nimport type { AgentX, AgentXConfig, RemoteConfig, Unsubscribe } from \"@agentxjs/types/agentx\";\nimport { isRemoteConfig } from \"@agentxjs/types/agentx\";\nimport type {\n CommandEventMap,\n CommandRequestType,\n ResponseEventFor,\n RequestDataFor,\n SystemEvent,\n} from \"@agentxjs/types/event\";\nimport { createLogger } from \"@agentxjs/common\";\n\nconst remoteLogger = createLogger(\"agentx/RemoteClient\");\n\n/**\n * Create AgentX instance\n *\n * @param config - Configuration (LocalConfig or RemoteConfig)\n * @returns AgentX instance\n *\n * @example\n * ```typescript\n * // Remote mode (browser & Node.js)\n * const agentx = await createAgentX({ serverUrl: \"ws://localhost:5200\" });\n *\n * // Local mode (Node.js only)\n * const agentx = await createAgentX({ llm: { apiKey: \"sk-...\" } });\n * ```\n */\nexport async function createAgentX(config?: AgentXConfig): Promise<AgentX> {\n if (config && isRemoteConfig(config)) {\n return createRemoteAgentX(config);\n }\n\n // Dynamic import for tree-shaking in browser builds\n const { createLocalAgentX } = await import(\"./createLocalAgentX\");\n return createLocalAgentX(config ?? {});\n}\n\n// ============================================================================\n// Remote Mode Implementation (Browser & Node.js compatible)\n// ============================================================================\n\n/**\n * Create AgentX instance in remote mode\n *\n * Connects to an AgentX server via WebSocket.\n * Works in both browser and Node.js environments.\n *\n * @param config - Remote configuration (serverUrl, headers, context)\n * @returns AgentX instance\n */\nexport async function createRemoteAgentX(config: RemoteConfig): Promise<AgentX> {\n // Use @agentxjs/network for WebSocket client (handles browser/Node.js differences)\n const { createWebSocketClient } = await import(\"@agentxjs/network\");\n\n const client = await createWebSocketClient({\n serverUrl: config.serverUrl,\n headers: config.headers,\n autoReconnect: true,\n minReconnectionDelay: 1000,\n maxReconnectionDelay: 10000,\n connectionTimeout: 4000,\n maxRetries: Infinity,\n debug: false,\n });\n\n const handlers = new Map<string, Set<(event: SystemEvent) => void>>();\n const pendingRequests = new Map<\n string,\n {\n resolve: (event: SystemEvent) => void;\n reject: (err: Error) => void;\n timer: ReturnType<typeof setTimeout>;\n }\n >();\n\n // Handle incoming messages\n client.onMessage((message: string) => {\n try {\n const event = JSON.parse(message) as SystemEvent;\n\n remoteLogger.info(\"Received event\", {\n type: event.type,\n category: event.category,\n requestId: (event.data as any)?.requestId,\n });\n\n // Handle error events - log as error (but still dispatch to handlers)\n if (event.type === \"system_error\") {\n const errorData = event.data as { message: string; severity?: string; details?: unknown };\n remoteLogger.error(errorData.message, {\n severity: errorData.severity,\n requestId: (event.data as any)?.requestId,\n details: errorData.details,\n });\n // Continue to dispatch to handlers (don't return here)\n }\n\n // Check if it's a response to a pending request\n const requestId = (event.data as { requestId?: string })?.requestId;\n if (event.category === \"response\" && requestId && pendingRequests.has(requestId)) {\n remoteLogger.info(\"Resolving pending request\", { requestId, eventType: event.type });\n const pending = pendingRequests.get(requestId)!;\n clearTimeout(pending.timer);\n pendingRequests.delete(requestId);\n pending.resolve(event);\n return;\n }\n\n remoteLogger.info(\"Dispatching to handlers\", { type: event.type });\n\n // Dispatch to handlers\n const typeHandlers = handlers.get(event.type);\n if (typeHandlers) {\n for (const handler of typeHandlers) {\n handler(event);\n }\n }\n\n // Dispatch to \"*\" handlers\n const allHandlers = handlers.get(\"*\");\n if (allHandlers) {\n for (const handler of allHandlers) {\n handler(event);\n }\n }\n } catch {\n // Ignore parse errors\n }\n });\n\n // Handle connection events\n client.onClose(() => {\n remoteLogger.warn(\"WebSocket closed\");\n });\n\n client.onError((error: Error) => {\n remoteLogger.error(\"WebSocket error\", { error: error.message });\n });\n\n function subscribe(type: string, handler: (event: SystemEvent) => void): Unsubscribe {\n if (!handlers.has(type)) {\n handlers.set(type, new Set());\n }\n handlers.get(type)!.add(handler);\n return () => {\n handlers.get(type)?.delete(handler);\n };\n }\n\n return {\n async request<T extends CommandRequestType>(\n type: T,\n data: RequestDataFor<T>,\n timeout: number = 30000\n ): Promise<ResponseEventFor<T>> {\n const requestId = `req_${Date.now()}_${Math.random().toString(36).substring(2, 8)}`;\n\n // Resolve and merge context if provided\n let mergedData = { ...data, requestId };\n if (config.context) {\n try {\n let resolvedContext: Record<string, unknown>;\n if (typeof config.context === \"function\") {\n resolvedContext = await Promise.resolve(config.context());\n } else {\n resolvedContext = config.context;\n }\n\n // Merge context into data\n // Request-level context (if present in data) takes precedence\n mergedData = {\n ...resolvedContext,\n ...data,\n requestId,\n } as RequestDataFor<T> & { requestId: string };\n\n remoteLogger.info(\"Merged context into request\", {\n type,\n requestId,\n contextKeys: Object.keys(resolvedContext),\n });\n } catch (error) {\n remoteLogger.error(\"Failed to resolve context\", {\n type,\n requestId,\n error: error instanceof Error ? error.message : String(error),\n });\n // Continue without context if resolution fails\n }\n }\n\n return new Promise((resolve, reject) => {\n const timer = setTimeout(() => {\n pendingRequests.delete(requestId);\n reject(new Error(`Request timeout: ${type}`));\n }, timeout);\n\n pendingRequests.set(requestId, {\n resolve: resolve as (event: SystemEvent) => void,\n reject,\n timer,\n });\n\n const event: SystemEvent = {\n type,\n timestamp: Date.now(),\n data: mergedData,\n source: \"command\",\n category: \"request\",\n intent: \"request\",\n };\n\n client.send(JSON.stringify(event));\n });\n },\n\n on<T extends string>(\n type: T,\n handler: (event: SystemEvent & { type: T }) => void\n ): Unsubscribe {\n return subscribe(type, handler as (event: SystemEvent) => void);\n },\n\n onCommand<T extends keyof CommandEventMap>(\n type: T,\n handler: (event: CommandEventMap[T]) => void\n ): Unsubscribe {\n return subscribe(type, handler as (event: SystemEvent) => void);\n },\n\n emitCommand<T extends keyof CommandEventMap>(type: T, data: CommandEventMap[T][\"data\"]): void {\n const event: SystemEvent = {\n type,\n timestamp: Date.now(),\n data,\n source: \"command\",\n category: type.toString().endsWith(\"_response\") ? \"response\" : \"request\",\n intent: type.toString().endsWith(\"_response\") ? \"result\" : \"request\",\n };\n client.send(JSON.stringify(event));\n },\n\n async listen() {\n throw new Error(\"Cannot listen in remote mode\");\n },\n\n async close() {\n // No-op in remote mode\n },\n\n async dispose() {\n for (const pending of pendingRequests.values()) {\n clearTimeout(pending.timer);\n pending.reject(new Error(\"AgentX disposed\"));\n }\n pendingRequests.clear();\n handlers.clear();\n client.dispose();\n },\n };\n}\n"
|
|
7
|
-
],
|
|
8
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,0CAAwB;AAWxB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiDA;AAgCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA2BA,2BAAS;;;ACjIT;AAQA;AAEA,IAAM,eAAe,aAAa,qBAAqB;AAwCvD,eAAsB,kBAAkB,CAAC,QAAuC;AAAA,EAE9E,QAAQ,0BAA0B,MAAa;AAAA,EAE/C,MAAM,SAAS,MAAM,sBAAsB;AAAA,IACzC,W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