agentxjs 2.6.1 → 2.8.0
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 +44 -1
- package/dist/chunk-JUZULVWQ.js +388 -0
- package/dist/chunk-JUZULVWQ.js.map +1 -0
- package/dist/index.d.ts +59 -289
- package/dist/index.js +124 -304
- package/dist/index.js.map +1 -1
- package/dist/server-MVOHQ5ZM.js +184 -0
- package/dist/server-MVOHQ5ZM.js.map +1 -0
- package/package.json +3 -3
- package/src/AgentHandle.ts +16 -14
- package/src/CommandHandler.ts +89 -204
- package/src/LocalClient.ts +21 -51
- package/src/RemoteClient.ts +20 -45
- package/src/index.ts +12 -26
- package/src/namespaces/agents.ts +34 -28
- package/src/namespaces/images.ts +21 -29
- package/src/namespaces/llm.ts +16 -10
- package/src/namespaces/presentations.ts +7 -7
- package/src/namespaces/sessions.ts +16 -14
- package/src/presentation/Presentation.ts +11 -11
- package/src/types.ts +64 -206
- package/dist/chunk-JTHR3AK6.js +0 -652
- package/dist/chunk-JTHR3AK6.js.map +0 -1
- package/dist/server-UCQISBKH.js +0 -7
- package/dist/server-UCQISBKH.js.map +0 -1
- package/src/namespaces/containers.ts +0 -68
- package/src/namespaces/prototypes.ts +0 -136
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { CreateDriver } from '@agentxjs/core/driver';
|
|
2
|
-
import {
|
|
2
|
+
import { AgentXPlatform } from '@agentxjs/core/runtime';
|
|
3
3
|
import { Message } from '@agentxjs/core/agent';
|
|
4
4
|
import { AgentXError } from '@agentxjs/core/error';
|
|
5
5
|
export { AgentXError, AgentXErrorCategory, AgentXErrorCode, AgentXErrorContext } from '@agentxjs/core/error';
|
|
6
6
|
import { Unsubscribe, BusEvent, EventBus, BusEventHandler } from '@agentxjs/core/event';
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import { RpcMethod } from '@agentxjs/core/network';
|
|
7
|
+
import { LLMProtocol, LLMProviderRecord } from '@agentxjs/core/persistence';
|
|
8
|
+
export { Capability, Context, ContextProvider } from '@agentxjs/core/context';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* Presentation Types
|
|
@@ -134,12 +133,12 @@ interface PresentationOptions {
|
|
|
134
133
|
*/
|
|
135
134
|
declare class Presentation {
|
|
136
135
|
private agentx;
|
|
137
|
-
private
|
|
136
|
+
private instanceId;
|
|
138
137
|
private state;
|
|
139
138
|
private updateHandlers;
|
|
140
139
|
private errorHandlers;
|
|
141
140
|
private eventUnsubscribe;
|
|
142
|
-
constructor(agentx: AgentX,
|
|
141
|
+
constructor(agentx: AgentX, instanceId: string, options?: PresentationOptions, initialConversations?: Conversation[]);
|
|
143
142
|
/**
|
|
144
143
|
* Get current state
|
|
145
144
|
*/
|
|
@@ -222,23 +221,35 @@ type MaybeAsync<T> = T | (() => T) | (() => Promise<T>);
|
|
|
222
221
|
/**
|
|
223
222
|
* Agent info returned from server
|
|
224
223
|
*/
|
|
225
|
-
interface
|
|
226
|
-
|
|
224
|
+
interface InstanceInfo {
|
|
225
|
+
instanceId: string;
|
|
227
226
|
imageId: string;
|
|
228
227
|
containerId: string;
|
|
229
228
|
sessionId: string;
|
|
230
229
|
lifecycle?: string;
|
|
231
230
|
}
|
|
232
231
|
/**
|
|
233
|
-
*
|
|
232
|
+
* AgentConfig — flat runtime configuration for creating an agent.
|
|
233
|
+
* AgentConfig IS the body — no wrapper needed.
|
|
234
234
|
*/
|
|
235
|
-
interface
|
|
235
|
+
interface AgentConfig {
|
|
236
|
+
/** LLM model identifier */
|
|
236
237
|
model?: string;
|
|
238
|
+
/** System prompt for the agent */
|
|
237
239
|
systemPrompt?: string;
|
|
240
|
+
/** MCP server configurations for tool access */
|
|
238
241
|
mcpServers?: Record<string, unknown>;
|
|
242
|
+
/** Context provider ID (e.g. RoleX individual) */
|
|
243
|
+
contextId?: string;
|
|
244
|
+
/** Display name */
|
|
245
|
+
name?: string;
|
|
246
|
+
/** Description */
|
|
247
|
+
description?: string;
|
|
248
|
+
/** Arbitrary custom data */
|
|
249
|
+
customData?: Record<string, unknown>;
|
|
239
250
|
}
|
|
240
251
|
/**
|
|
241
|
-
* Image record from server
|
|
252
|
+
* Image record from server (internal persistence)
|
|
242
253
|
*/
|
|
243
254
|
interface ImageRecord {
|
|
244
255
|
imageId: string;
|
|
@@ -247,21 +258,13 @@ interface ImageRecord {
|
|
|
247
258
|
name?: string;
|
|
248
259
|
description?: string;
|
|
249
260
|
contextId?: string;
|
|
250
|
-
|
|
251
|
-
/** @deprecated Use `embody.systemPrompt` instead. */
|
|
261
|
+
model?: string;
|
|
252
262
|
systemPrompt?: string;
|
|
253
|
-
/** @deprecated Use `embody.mcpServers` instead. */
|
|
254
263
|
mcpServers?: Record<string, unknown>;
|
|
255
264
|
customData?: Record<string, unknown>;
|
|
256
265
|
createdAt: number;
|
|
257
266
|
updatedAt: number;
|
|
258
267
|
}
|
|
259
|
-
/**
|
|
260
|
-
* Container info
|
|
261
|
-
*/
|
|
262
|
-
interface ContainerInfo {
|
|
263
|
-
containerId: string;
|
|
264
|
-
}
|
|
265
268
|
/**
|
|
266
269
|
* Base response with requestId
|
|
267
270
|
*/
|
|
@@ -272,8 +275,8 @@ interface BaseResponse {
|
|
|
272
275
|
/**
|
|
273
276
|
* Agent create response
|
|
274
277
|
*/
|
|
275
|
-
interface
|
|
276
|
-
|
|
278
|
+
interface InstanceCreateResponse extends BaseResponse {
|
|
279
|
+
instanceId: string;
|
|
277
280
|
imageId: string;
|
|
278
281
|
containerId: string;
|
|
279
282
|
sessionId: string;
|
|
@@ -281,15 +284,15 @@ interface AgentCreateResponse extends BaseResponse {
|
|
|
281
284
|
/**
|
|
282
285
|
* Agent get response
|
|
283
286
|
*/
|
|
284
|
-
interface
|
|
285
|
-
agent:
|
|
287
|
+
interface InstanceGetResponse extends BaseResponse {
|
|
288
|
+
agent: InstanceInfo | null;
|
|
286
289
|
exists: boolean;
|
|
287
290
|
}
|
|
288
291
|
/**
|
|
289
292
|
* Agent list response
|
|
290
293
|
*/
|
|
291
|
-
interface
|
|
292
|
-
agents:
|
|
294
|
+
interface InstanceListResponse extends BaseResponse {
|
|
295
|
+
agents: InstanceInfo[];
|
|
293
296
|
}
|
|
294
297
|
/**
|
|
295
298
|
* Image create response
|
|
@@ -318,30 +321,11 @@ interface ImageListResponse extends BaseResponse {
|
|
|
318
321
|
interface ImageUpdateResponse extends BaseResponse {
|
|
319
322
|
record: ImageRecord;
|
|
320
323
|
}
|
|
321
|
-
/**
|
|
322
|
-
* Container create response
|
|
323
|
-
*/
|
|
324
|
-
interface ContainerCreateResponse extends BaseResponse {
|
|
325
|
-
containerId: string;
|
|
326
|
-
}
|
|
327
|
-
/**
|
|
328
|
-
* Container get response
|
|
329
|
-
*/
|
|
330
|
-
interface ContainerGetResponse extends BaseResponse {
|
|
331
|
-
containerId: string;
|
|
332
|
-
exists: boolean;
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* Container list response
|
|
336
|
-
*/
|
|
337
|
-
interface ContainerListResponse extends BaseResponse {
|
|
338
|
-
containerIds: string[];
|
|
339
|
-
}
|
|
340
324
|
/**
|
|
341
325
|
* Message send response
|
|
342
326
|
*/
|
|
343
327
|
interface MessageSendResponse extends BaseResponse {
|
|
344
|
-
|
|
328
|
+
instanceId: string;
|
|
345
329
|
}
|
|
346
330
|
/**
|
|
347
331
|
* LLM provider create response
|
|
@@ -373,47 +357,6 @@ interface LLMProviderUpdateResponse extends BaseResponse {
|
|
|
373
357
|
interface LLMProviderDefaultResponse extends BaseResponse {
|
|
374
358
|
record: LLMProviderRecord | null;
|
|
375
359
|
}
|
|
376
|
-
/**
|
|
377
|
-
* Prototype create response
|
|
378
|
-
*/
|
|
379
|
-
interface PrototypeCreateResponse extends BaseResponse {
|
|
380
|
-
record: PrototypeRecord;
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Prototype get response
|
|
384
|
-
*/
|
|
385
|
-
interface PrototypeGetResponse extends BaseResponse {
|
|
386
|
-
record: PrototypeRecord | null;
|
|
387
|
-
}
|
|
388
|
-
/**
|
|
389
|
-
* Prototype list response
|
|
390
|
-
*/
|
|
391
|
-
interface PrototypeListResponse extends BaseResponse {
|
|
392
|
-
records: PrototypeRecord[];
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* Prototype update response
|
|
396
|
-
*/
|
|
397
|
-
interface PrototypeUpdateResponse extends BaseResponse {
|
|
398
|
-
record: PrototypeRecord;
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* Container operations namespace
|
|
402
|
-
*/
|
|
403
|
-
interface ContainerNamespace {
|
|
404
|
-
/**
|
|
405
|
-
* Create or get container
|
|
406
|
-
*/
|
|
407
|
-
create(containerId: string): Promise<ContainerCreateResponse>;
|
|
408
|
-
/**
|
|
409
|
-
* Get container
|
|
410
|
-
*/
|
|
411
|
-
get(containerId: string): Promise<ContainerGetResponse>;
|
|
412
|
-
/**
|
|
413
|
-
* List containers
|
|
414
|
-
*/
|
|
415
|
-
list(): Promise<ContainerListResponse>;
|
|
416
|
-
}
|
|
417
360
|
/**
|
|
418
361
|
* Image operations namespace
|
|
419
362
|
*/
|
|
@@ -421,14 +364,7 @@ interface ImageNamespace {
|
|
|
421
364
|
/**
|
|
422
365
|
* Create a new image from an Agent blueprint
|
|
423
366
|
*/
|
|
424
|
-
create(params:
|
|
425
|
-
containerId: string;
|
|
426
|
-
name?: string;
|
|
427
|
-
description?: string;
|
|
428
|
-
contextId?: string;
|
|
429
|
-
embody?: Embodiment;
|
|
430
|
-
customData?: Record<string, unknown>;
|
|
431
|
-
}): Promise<ImageCreateResponse>;
|
|
367
|
+
create(params: AgentConfig): Promise<ImageCreateResponse>;
|
|
432
368
|
/**
|
|
433
369
|
* Get image by ID
|
|
434
370
|
*/
|
|
@@ -436,16 +372,11 @@ interface ImageNamespace {
|
|
|
436
372
|
/**
|
|
437
373
|
* List images
|
|
438
374
|
*/
|
|
439
|
-
list(
|
|
375
|
+
list(): Promise<ImageListResponse>;
|
|
440
376
|
/**
|
|
441
377
|
* Update image
|
|
442
378
|
*/
|
|
443
|
-
update(imageId: string, updates:
|
|
444
|
-
name?: string;
|
|
445
|
-
description?: string;
|
|
446
|
-
embody?: Embodiment;
|
|
447
|
-
customData?: Record<string, unknown>;
|
|
448
|
-
}): Promise<ImageUpdateResponse>;
|
|
379
|
+
update(imageId: string, updates: Partial<Pick<AgentConfig, "name" | "description" | "model" | "systemPrompt" | "mcpServers" | "customData">>): Promise<ImageUpdateResponse>;
|
|
449
380
|
/**
|
|
450
381
|
* Delete image
|
|
451
382
|
*/
|
|
@@ -458,26 +389,26 @@ interface ImageNamespace {
|
|
|
458
389
|
/**
|
|
459
390
|
* Agent operations namespace
|
|
460
391
|
*/
|
|
461
|
-
interface
|
|
392
|
+
interface InstanceNamespace {
|
|
462
393
|
/**
|
|
463
394
|
* Create a new agent
|
|
464
395
|
*/
|
|
465
396
|
create(params: {
|
|
466
397
|
imageId: string;
|
|
467
|
-
|
|
468
|
-
}): Promise<
|
|
398
|
+
instanceId?: string;
|
|
399
|
+
}): Promise<InstanceCreateResponse>;
|
|
469
400
|
/**
|
|
470
401
|
* Get agent by ID
|
|
471
402
|
*/
|
|
472
|
-
get(
|
|
403
|
+
get(instanceId: string): Promise<InstanceGetResponse>;
|
|
473
404
|
/**
|
|
474
405
|
* List agents
|
|
475
406
|
*/
|
|
476
|
-
list(
|
|
407
|
+
list(): Promise<InstanceListResponse>;
|
|
477
408
|
/**
|
|
478
409
|
* Destroy an agent
|
|
479
410
|
*/
|
|
480
|
-
destroy(
|
|
411
|
+
destroy(instanceId: string): Promise<BaseResponse>;
|
|
481
412
|
}
|
|
482
413
|
/**
|
|
483
414
|
* Session operations namespace (messaging)
|
|
@@ -486,15 +417,15 @@ interface SessionNamespace {
|
|
|
486
417
|
/**
|
|
487
418
|
* Send message to agent
|
|
488
419
|
*/
|
|
489
|
-
send(
|
|
420
|
+
send(instanceId: string, content: string | unknown[]): Promise<MessageSendResponse>;
|
|
490
421
|
/**
|
|
491
422
|
* Interrupt agent
|
|
492
423
|
*/
|
|
493
|
-
interrupt(
|
|
424
|
+
interrupt(instanceId: string): Promise<BaseResponse>;
|
|
494
425
|
/**
|
|
495
426
|
* Get message history for an agent's session
|
|
496
427
|
*/
|
|
497
|
-
getMessages(
|
|
428
|
+
getMessages(instanceId: string): Promise<Message[]>;
|
|
498
429
|
}
|
|
499
430
|
/**
|
|
500
431
|
* LLM provider operations namespace
|
|
@@ -504,7 +435,6 @@ interface LLMNamespace {
|
|
|
504
435
|
* Create a new LLM provider configuration
|
|
505
436
|
*/
|
|
506
437
|
create(params: {
|
|
507
|
-
containerId: string;
|
|
508
438
|
name: string;
|
|
509
439
|
vendor: string;
|
|
510
440
|
protocol: LLMProtocol;
|
|
@@ -517,9 +447,9 @@ interface LLMNamespace {
|
|
|
517
447
|
*/
|
|
518
448
|
get(id: string): Promise<LLMProviderGetResponse>;
|
|
519
449
|
/**
|
|
520
|
-
* List LLM providers
|
|
450
|
+
* List LLM providers
|
|
521
451
|
*/
|
|
522
|
-
list(
|
|
452
|
+
list(): Promise<LLMProviderListResponse>;
|
|
523
453
|
/**
|
|
524
454
|
* Update LLM provider
|
|
525
455
|
*/
|
|
@@ -536,51 +466,13 @@ interface LLMNamespace {
|
|
|
536
466
|
*/
|
|
537
467
|
delete(id: string): Promise<BaseResponse>;
|
|
538
468
|
/**
|
|
539
|
-
* Set default LLM provider
|
|
469
|
+
* Set default LLM provider
|
|
540
470
|
*/
|
|
541
471
|
setDefault(id: string): Promise<BaseResponse>;
|
|
542
472
|
/**
|
|
543
|
-
* Get default LLM provider
|
|
473
|
+
* Get default LLM provider
|
|
544
474
|
*/
|
|
545
|
-
getDefault(
|
|
546
|
-
}
|
|
547
|
-
/**
|
|
548
|
-
* Prototype operations namespace — manage reusable agent templates
|
|
549
|
-
*/
|
|
550
|
-
interface PrototypeNamespace {
|
|
551
|
-
/**
|
|
552
|
-
* Register a new prototype
|
|
553
|
-
*/
|
|
554
|
-
create(params: {
|
|
555
|
-
containerId: string;
|
|
556
|
-
name: string;
|
|
557
|
-
description?: string;
|
|
558
|
-
contextId?: string;
|
|
559
|
-
embody?: Embodiment;
|
|
560
|
-
customData?: Record<string, unknown>;
|
|
561
|
-
}): Promise<PrototypeCreateResponse>;
|
|
562
|
-
/**
|
|
563
|
-
* Get prototype by ID
|
|
564
|
-
*/
|
|
565
|
-
get(prototypeId: string): Promise<PrototypeGetResponse>;
|
|
566
|
-
/**
|
|
567
|
-
* List prototypes
|
|
568
|
-
*/
|
|
569
|
-
list(containerId?: string): Promise<PrototypeListResponse>;
|
|
570
|
-
/**
|
|
571
|
-
* Update prototype
|
|
572
|
-
*/
|
|
573
|
-
update(prototypeId: string, updates: {
|
|
574
|
-
name?: string;
|
|
575
|
-
description?: string;
|
|
576
|
-
contextId?: string;
|
|
577
|
-
embody?: Embodiment;
|
|
578
|
-
customData?: Record<string, unknown>;
|
|
579
|
-
}): Promise<PrototypeUpdateResponse>;
|
|
580
|
-
/**
|
|
581
|
-
* Delete prototype
|
|
582
|
-
*/
|
|
583
|
-
delete(prototypeId: string): Promise<BaseResponse>;
|
|
475
|
+
getDefault(): Promise<LLMProviderDefaultResponse>;
|
|
584
476
|
}
|
|
585
477
|
/**
|
|
586
478
|
* Presentation operations namespace
|
|
@@ -591,7 +483,7 @@ interface PresentationNamespace {
|
|
|
591
483
|
*
|
|
592
484
|
* @example
|
|
593
485
|
* ```typescript
|
|
594
|
-
* const pres = ax.present(
|
|
486
|
+
* const pres = ax.present(instanceId, {
|
|
595
487
|
* onUpdate: (state) => renderUI(state),
|
|
596
488
|
* onError: (error) => console.error(error),
|
|
597
489
|
* });
|
|
@@ -600,23 +492,21 @@ interface PresentationNamespace {
|
|
|
600
492
|
* pres.dispose();
|
|
601
493
|
* ```
|
|
602
494
|
*/
|
|
603
|
-
create(
|
|
495
|
+
create(instanceId: string, options?: PresentationOptions): Promise<Presentation>;
|
|
604
496
|
}
|
|
605
497
|
/**
|
|
606
498
|
* Instance — low-level access to internal subsystems.
|
|
607
499
|
*
|
|
608
500
|
* Most users should use the top-level Agent API (ax.create, ax.send, etc.).
|
|
609
|
-
* Instance exposes the underlying image, agent, session,
|
|
501
|
+
* Instance exposes the underlying image, agent, session, llm,
|
|
610
502
|
* and presentation subsystems for advanced use cases.
|
|
611
503
|
*/
|
|
612
504
|
interface RuntimeNamespace {
|
|
613
|
-
readonly container: ContainerNamespace;
|
|
614
505
|
readonly image: ImageNamespace;
|
|
615
|
-
readonly
|
|
506
|
+
readonly instance: InstanceNamespace;
|
|
616
507
|
readonly session: SessionNamespace;
|
|
617
508
|
readonly present: PresentationNamespace;
|
|
618
509
|
readonly llm: LLMNamespace;
|
|
619
|
-
readonly prototype: PrototypeNamespace;
|
|
620
510
|
}
|
|
621
511
|
/**
|
|
622
512
|
* AgentHandle — a live reference to a created agent.
|
|
@@ -626,13 +516,13 @@ interface RuntimeNamespace {
|
|
|
626
516
|
*
|
|
627
517
|
* @example
|
|
628
518
|
* ```typescript
|
|
629
|
-
* const agent = await ax.chat.create({ name: "Aristotle",
|
|
519
|
+
* const agent = await ax.chat.create({ name: "Aristotle", model: "claude-sonnet-4-6" });
|
|
630
520
|
* await agent.send("Hello!");
|
|
631
521
|
* const messages = await agent.history();
|
|
632
522
|
* ```
|
|
633
523
|
*/
|
|
634
524
|
interface AgentHandle {
|
|
635
|
-
readonly
|
|
525
|
+
readonly instanceId: string;
|
|
636
526
|
readonly imageId: string;
|
|
637
527
|
readonly containerId: string;
|
|
638
528
|
readonly sessionId: string;
|
|
@@ -655,12 +545,7 @@ interface AgentHandle {
|
|
|
655
545
|
/**
|
|
656
546
|
* Update this agent's metadata
|
|
657
547
|
*/
|
|
658
|
-
update(updates:
|
|
659
|
-
name?: string;
|
|
660
|
-
description?: string;
|
|
661
|
-
embody?: Embodiment;
|
|
662
|
-
customData?: Record<string, unknown>;
|
|
663
|
-
}): Promise<void>;
|
|
548
|
+
update(updates: Partial<Pick<AgentConfig, "name" | "description" | "model" | "systemPrompt" | "mcpServers" | "customData">>): Promise<void>;
|
|
664
549
|
/**
|
|
665
550
|
* Delete this agent
|
|
666
551
|
*/
|
|
@@ -675,18 +560,8 @@ interface AgentHandle {
|
|
|
675
560
|
interface ChatNamespace {
|
|
676
561
|
/**
|
|
677
562
|
* Create a new conversation
|
|
678
|
-
*
|
|
679
|
-
* When `prototypeId` is provided, the conversation inherits the prototype's
|
|
680
|
-
* configuration (contextId, embody, etc.). Inline params override prototype values.
|
|
681
563
|
*/
|
|
682
|
-
create(params:
|
|
683
|
-
prototypeId?: string;
|
|
684
|
-
name?: string;
|
|
685
|
-
description?: string;
|
|
686
|
-
contextId?: string;
|
|
687
|
-
embody?: Embodiment;
|
|
688
|
-
customData?: Record<string, unknown>;
|
|
689
|
-
}): Promise<AgentHandle>;
|
|
564
|
+
create(params: AgentConfig): Promise<AgentHandle>;
|
|
690
565
|
/**
|
|
691
566
|
* List all conversations
|
|
692
567
|
*/
|
|
@@ -702,7 +577,7 @@ interface ChatNamespace {
|
|
|
702
577
|
* @example
|
|
703
578
|
* ```typescript
|
|
704
579
|
* const ax = createAgentX(config);
|
|
705
|
-
* const agent = await ax.chat.create({ name: "Aristotle",
|
|
580
|
+
* const agent = await ax.chat.create({ name: "Aristotle", model: "claude-sonnet-4-6" });
|
|
706
581
|
* await agent.send("Hello!");
|
|
707
582
|
* ```
|
|
708
583
|
*
|
|
@@ -722,11 +597,7 @@ interface AgentX {
|
|
|
722
597
|
*/
|
|
723
598
|
readonly chat: ChatNamespace;
|
|
724
599
|
/**
|
|
725
|
-
*
|
|
726
|
-
*/
|
|
727
|
-
readonly prototype: PrototypeNamespace;
|
|
728
|
-
/**
|
|
729
|
-
* Low-level access to internal subsystems (image, agent, session, container, llm).
|
|
600
|
+
* Low-level access to internal subsystems (image, agent, session, llm).
|
|
730
601
|
*/
|
|
731
602
|
readonly runtime: RuntimeNamespace;
|
|
732
603
|
/**
|
|
@@ -813,107 +684,6 @@ interface AgentXBuilder extends AgentX {
|
|
|
813
684
|
serve(config?: ServeConfig): Promise<AgentXServer>;
|
|
814
685
|
}
|
|
815
686
|
|
|
816
|
-
/**
|
|
817
|
-
* CommandHandler - Handles JSON-RPC requests directly
|
|
818
|
-
*
|
|
819
|
-
* No longer uses EventBus for request/response. Instead:
|
|
820
|
-
* - Receives RPC requests directly
|
|
821
|
-
* - Returns RPC responses directly
|
|
822
|
-
* - EventBus is only used for stream events (notifications)
|
|
823
|
-
*/
|
|
824
|
-
|
|
825
|
-
/**
|
|
826
|
-
* RPC Result type
|
|
827
|
-
*/
|
|
828
|
-
interface RpcResult<T = unknown> {
|
|
829
|
-
success: true;
|
|
830
|
-
data: T;
|
|
831
|
-
}
|
|
832
|
-
interface RpcError {
|
|
833
|
-
success: false;
|
|
834
|
-
code: number;
|
|
835
|
-
message: string;
|
|
836
|
-
}
|
|
837
|
-
type RpcResponse<T = unknown> = RpcResult<T> | RpcError;
|
|
838
|
-
/**
|
|
839
|
-
* CommandHandler - Processes RPC requests directly
|
|
840
|
-
*/
|
|
841
|
-
declare class CommandHandler {
|
|
842
|
-
private readonly runtime;
|
|
843
|
-
constructor(runtime: AgentXRuntime);
|
|
844
|
-
/**
|
|
845
|
-
* Handle an RPC request and return response
|
|
846
|
-
*/
|
|
847
|
-
handle(method: RpcMethod, params: unknown): Promise<RpcResponse>;
|
|
848
|
-
private handleContainerCreate;
|
|
849
|
-
private handleContainerGet;
|
|
850
|
-
private handleContainerList;
|
|
851
|
-
private handleImageCreate;
|
|
852
|
-
private handleImageGet;
|
|
853
|
-
private handleImageList;
|
|
854
|
-
private handleImageDelete;
|
|
855
|
-
private handleImageRun;
|
|
856
|
-
private handleImageStop;
|
|
857
|
-
private handleImageUpdate;
|
|
858
|
-
private handleImageMessages;
|
|
859
|
-
private handleAgentGet;
|
|
860
|
-
private handleAgentList;
|
|
861
|
-
private handleAgentDestroy;
|
|
862
|
-
private handleAgentDestroyAll;
|
|
863
|
-
private handleAgentInterrupt;
|
|
864
|
-
private handleMessageSend;
|
|
865
|
-
private handlePrototypeCreate;
|
|
866
|
-
private handlePrototypeGet;
|
|
867
|
-
private handlePrototypeList;
|
|
868
|
-
private handlePrototypeUpdate;
|
|
869
|
-
private handlePrototypeDelete;
|
|
870
|
-
private handleLLMCreate;
|
|
871
|
-
private handleLLMGet;
|
|
872
|
-
private handleLLMList;
|
|
873
|
-
private handleLLMUpdate;
|
|
874
|
-
private handleLLMDelete;
|
|
875
|
-
private handleLLMDefault;
|
|
876
|
-
dispose(): void;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
/**
|
|
880
|
-
* Server configuration (supports both immediate and deferred platforms)
|
|
881
|
-
*/
|
|
882
|
-
interface ServerConfig {
|
|
883
|
-
/**
|
|
884
|
-
* AgentX Platform — must provide `channelServer` for accepting WebSocket connections.
|
|
885
|
-
*/
|
|
886
|
-
platform: AgentXPlatform;
|
|
887
|
-
/**
|
|
888
|
-
* LLM Driver factory function - creates Driver per Agent
|
|
889
|
-
*/
|
|
890
|
-
createDriver: CreateDriver;
|
|
891
|
-
/**
|
|
892
|
-
* Port to listen on (standalone mode)
|
|
893
|
-
*/
|
|
894
|
-
port?: number;
|
|
895
|
-
/**
|
|
896
|
-
* Host to bind to (default: "0.0.0.0")
|
|
897
|
-
*/
|
|
898
|
-
host?: string;
|
|
899
|
-
/**
|
|
900
|
-
* Existing HTTP server to attach to (attached mode)
|
|
901
|
-
*/
|
|
902
|
-
server?: _agentxjs_core_network.MinimalHTTPServer;
|
|
903
|
-
/**
|
|
904
|
-
* WebSocket path when attached (default: "/ws")
|
|
905
|
-
*/
|
|
906
|
-
wsPath?: string;
|
|
907
|
-
/**
|
|
908
|
-
* Enable debug logging
|
|
909
|
-
*/
|
|
910
|
-
debug?: boolean;
|
|
911
|
-
}
|
|
912
|
-
/**
|
|
913
|
-
* Create an AgentX server
|
|
914
|
-
*/
|
|
915
|
-
declare function createServer(config: ServerConfig): Promise<AgentXServer>;
|
|
916
|
-
|
|
917
687
|
/**
|
|
918
688
|
* agentxjs - AgentX Client SDK
|
|
919
689
|
*
|
|
@@ -925,7 +695,7 @@ declare function createServer(config: ServerConfig): Promise<AgentXServer>;
|
|
|
925
695
|
* import { nodePlatform } from "@agentxjs/node-platform";
|
|
926
696
|
*
|
|
927
697
|
* const ax = createAgentX(nodePlatform({ createDriver }));
|
|
928
|
-
* const agent = await ax.chat.create({ name: "Aristotle",
|
|
698
|
+
* const agent = await ax.chat.create({ name: "Aristotle", model: "claude-sonnet-4-6" });
|
|
929
699
|
* await agent.send("Hello!");
|
|
930
700
|
* ```
|
|
931
701
|
*
|
|
@@ -957,4 +727,4 @@ interface PlatformConfig {
|
|
|
957
727
|
*/
|
|
958
728
|
declare function createAgentX(config?: PlatformConfig): AgentXBuilder;
|
|
959
729
|
|
|
960
|
-
export { type
|
|
730
|
+
export { type AgentConfig, type AgentHandle, type AgentX, type AgentXBuilder, type AgentXServer, type AssistantConversation, type BaseResponse, type Block, type ChatNamespace, type ConnectOptions, type Conversation, type ErrorConversation, type ImageBlock, type ImageCreateResponse, type ImageGetResponse, type ImageListResponse, type ImageNamespace, type ImageRecord, type ImageUpdateResponse, type InstanceCreateResponse, type InstanceGetResponse, type InstanceInfo, type InstanceListResponse, type InstanceNamespace, type LLMNamespace, type LLMProviderCreateResponse, type LLMProviderDefaultResponse, type LLMProviderGetResponse, type LLMProviderListResponse, type LLMProviderUpdateResponse, type MaybeAsync, type MessageSendResponse, type PlatformConfig, Presentation, type PresentationErrorHandler, type PresentationNamespace, type PresentationOptions, type PresentationState, type PresentationUpdateHandler, type RuntimeNamespace, type ServeConfig, type SessionNamespace, type TextBlock, type ToolBlock, type UserConversation, addUserConversation, createAgentX, createInitialState, initialPresentationState, messagesToConversations, presentationReducer };
|