@agentxjs/core 2.0.0 → 2.0.1
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/dist/{Processor-DT0N1qI6.d.ts → Processor-CeMyXtsX.d.ts} +1 -1
- package/dist/{RpcClient-BcJ_zAGu.d.ts → RpcClient-CMdhJxjS.d.ts} +2 -2
- package/dist/agent/engine/internal/index.d.ts +4 -5
- package/dist/agent/engine/internal/index.js +1 -1
- package/dist/agent/engine/mealy/index.d.ts +4 -4
- package/dist/agent/engine/mealy/index.js +1 -1
- package/dist/agent/index.d.ts +91 -91
- package/dist/agent/index.js +6 -6
- package/dist/agent/types/index.d.ts +4 -4
- package/dist/agent/types/index.js +1 -1
- package/dist/bash/index.d.ts +4 -4
- package/dist/{chunk-LTVNPHST.js → chunk-22NTRYNO.js} +60 -60
- package/dist/chunk-22NTRYNO.js.map +1 -0
- package/dist/{chunk-7ZDX3O6I.js → chunk-AAFPAF67.js} +2 -2
- package/dist/{chunk-7ZDX3O6I.js.map → chunk-AAFPAF67.js.map} +1 -1
- package/dist/{chunk-EKHT54KN.js → chunk-APCBNCOW.js} +1 -1
- package/dist/{chunk-EKHT54KN.js.map → chunk-APCBNCOW.js.map} +1 -1
- package/dist/{chunk-JTKCV7IS.js → chunk-RWIYC65R.js} +111 -111
- package/dist/{chunk-JTKCV7IS.js.map → chunk-RWIYC65R.js.map} +1 -1
- package/dist/{chunk-DEAR6N3O.js → chunk-TUFZ2YH6.js} +1 -1
- package/dist/chunk-TUFZ2YH6.js.map +1 -0
- package/dist/{chunk-23UUBQXR.js → chunk-YSZG6XIM.js} +1 -1
- package/dist/chunk-YSZG6XIM.js.map +1 -0
- package/dist/{combinators-nEa5dD0T.d.ts → combinators-Dy-7lxKV.d.ts} +50 -50
- package/dist/common/logger/index.js +14 -14
- package/dist/common/logger/index.js.map +1 -1
- package/dist/container/index.d.ts +3 -3
- package/dist/driver/index.d.ts +2 -2
- package/dist/event/index.d.ts +1 -1
- package/dist/event/index.js +2 -2
- package/dist/event/types/index.d.ts +199 -199
- package/dist/event/types/index.js +1 -1
- package/dist/{event-DNWOBSBO.d.ts → event-DNsF9EkO.d.ts} +4 -6
- package/dist/image/index.d.ts +3 -3
- package/dist/image/index.js.map +1 -1
- package/dist/{index-CuS1i5V-.d.ts → index--gxNpY5W.d.ts} +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +6 -6
- package/dist/{message-03TJzvIX.d.ts → message-Dn-I2vr0.d.ts} +1 -1
- package/dist/mq/index.d.ts +25 -25
- package/dist/mq/index.js +1 -1
- package/dist/mq/index.js.map +1 -1
- package/dist/network/index.d.ts +57 -57
- package/dist/network/index.js +27 -27
- package/dist/network/index.js.map +1 -1
- package/dist/persistence/index.d.ts +2 -2
- package/dist/platform/index.d.ts +4 -4
- package/dist/runtime/index.d.ts +5 -5
- package/dist/runtime/index.js +6 -6
- package/dist/runtime/index.js.map +1 -1
- package/dist/session/index.d.ts +3 -3
- package/dist/{types-aE74Eo6G.d.ts → types-Cb8tKM6Y.d.ts} +1 -1
- package/package.json +1 -1
- package/src/agent/AgentStateMachine.ts +2 -2
- package/src/agent/__tests__/AgentStateMachine.test.ts +2 -2
- package/src/agent/__tests__/createAgent.test.ts +4 -4
- package/src/agent/__tests__/engine/internal/messageAssemblerProcessor.test.ts +10 -10
- package/src/agent/__tests__/engine/internal/stateEventProcessor.test.ts +6 -6
- package/src/agent/__tests__/engine/internal/turnTrackerProcessor.test.ts +4 -4
- package/src/agent/__tests__/engine/mealy/Mealy.test.ts +3 -3
- package/src/agent/__tests__/engine/mealy/Store.test.ts +1 -1
- package/src/agent/__tests__/engine/mealy/combinators.test.ts +4 -4
- package/src/agent/createAgent.ts +15 -15
- package/src/agent/engine/AgentProcessor.ts +7 -7
- package/src/agent/engine/MealyMachine.ts +3 -3
- package/src/agent/engine/internal/index.ts +11 -11
- package/src/agent/engine/internal/messageAssemblerProcessor.ts +14 -14
- package/src/agent/engine/internal/stateEventProcessor.ts +13 -15
- package/src/agent/engine/internal/turnTrackerProcessor.ts +4 -4
- package/src/agent/engine/mealy/Mealy.ts +2 -2
- package/src/agent/engine/mealy/combinators.ts +10 -10
- package/src/agent/engine/mealy/index.ts +9 -11
- package/src/agent/index.ts +30 -32
- package/src/agent/types/engine.ts +3 -3
- package/src/agent/types/event.ts +4 -8
- package/src/agent/types/index.ts +85 -85
- package/src/bash/index.ts +1 -1
- package/src/common/logger/ConsoleLogger.ts +1 -1
- package/src/common/logger/LoggerFactoryImpl.ts +14 -14
- package/src/common/logger/index.ts +3 -3
- package/src/container/index.ts +4 -5
- package/src/container/types.ts +1 -1
- package/src/driver/index.ts +15 -17
- package/src/driver/types.ts +89 -79
- package/src/event/EventBus.ts +10 -10
- package/src/event/__tests__/EventBus.test.ts +1 -1
- package/src/event/index.ts +2 -3
- package/src/event/types/agent.ts +186 -180
- package/src/event/types/bus.ts +1 -1
- package/src/event/types/command.ts +292 -265
- package/src/event/types/container.ts +207 -222
- package/src/event/types/driver.ts +153 -155
- package/src/event/types/index.ts +6 -12
- package/src/event/types/session.ts +117 -130
- package/src/image/Image.ts +1 -1
- package/src/image/index.ts +4 -5
- package/src/mq/OffsetGenerator.ts +1 -1
- package/src/mq/__tests__/OffsetGenerator.test.ts +1 -1
- package/src/mq/index.ts +4 -5
- package/src/network/RpcClient.ts +5 -5
- package/src/network/index.ts +40 -43
- package/src/network/jsonrpc.ts +5 -5
- package/src/persistence/index.ts +5 -5
- package/src/platform/types.ts +3 -3
- package/src/runtime/AgentXRuntime.ts +15 -15
- package/src/runtime/__tests__/AgentXRuntime.test.ts +5 -5
- package/src/runtime/index.ts +5 -6
- package/src/runtime/types.ts +1 -1
- package/src/session/index.ts +2 -3
- package/dist/chunk-23UUBQXR.js.map +0 -1
- package/dist/chunk-DEAR6N3O.js.map +0 -1
- package/dist/chunk-LTVNPHST.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { JsonRpc, IParsedObject } from 'jsonrpc-lite';
|
|
2
1
|
import { S as SystemEvent } from './base-m40r3Qgu.js';
|
|
2
|
+
import { JsonRpc, IParsedObject } from 'jsonrpc-lite';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* JSON-RPC 2.0 Protocol for AgentX Network Communication
|
|
@@ -301,4 +301,4 @@ declare class RpcClient {
|
|
|
301
301
|
private handleParsedMessage;
|
|
302
302
|
}
|
|
303
303
|
|
|
304
|
-
export { type ControlAckParams as C, type NotificationMethod as N, type
|
|
304
|
+
export { type ControlAckParams as C, type NotificationMethod as N, type RpcErrorResponse as R, type StreamEventParams as S, type WebSocketFactory as W, type RpcMethod as a, type RpcNotification as b, type RpcRequest as c, type RpcSuccessResponse as d, createAckNotification as e, createErrorResponse as f, createNotification as g, createRequest as h, createStreamEvent as i, createSuccessResponse as j, eventTypeToRpcMethod as k, isControlAck as l, isErrorResponse as m, isInvalid as n, isNotification as o, isRequest as p, isStreamEvent as q, isSuccessResponse as r, parseMessage as s, parseMessageObject as t, RpcErrorCodes as u, rpcMethodToResponseType as v, type RpcClientConfig as w, type RpcClientState as x, RpcClient as y };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import '../../../message-
|
|
1
|
+
import { k as AssistantMessageEvent, a2 as ToolResultMessageEvent, w as ErrorMessageEvent, S as StreamEvent, t as ConversationStartEvent, r as ConversationRespondingEvent, l as ConversationEndEvent, n as ConversationInterruptedEvent, $ as ToolPlannedEvent, X as ToolExecutingEvent, y as ErrorOccurredEvent, a9 as TurnRequestEvent, ab as TurnResponseEvent } from '../../../event-DNsF9EkO.js';
|
|
2
|
+
import { P as Processor, a as ProcessorDefinition } from '../../../Processor-CeMyXtsX.js';
|
|
3
|
+
import '../../../message-Dn-I2vr0.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* messageAssemblerProcessor
|
|
@@ -123,8 +123,7 @@ declare const messageAssemblerProcessorDef: ProcessorDefinition<MessageAssembler
|
|
|
123
123
|
*
|
|
124
124
|
* Currently empty - no context needed as all information comes from events.
|
|
125
125
|
*/
|
|
126
|
-
|
|
127
|
-
}
|
|
126
|
+
type StateEventProcessorContext = {};
|
|
128
127
|
/**
|
|
129
128
|
* Initial context factory for StateEventProcessor
|
|
130
129
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
1
|
+
import { P as Processor } from '../../../Processor-CeMyXtsX.js';
|
|
2
|
+
export { a as ProcessorDefinition, b as ProcessorResult } from '../../../Processor-CeMyXtsX.js';
|
|
3
|
+
import { S as Store, a as Sink, b as SinkDefinition } from '../../../combinators-Dy-7lxKV.js';
|
|
4
|
+
export { M as MemoryStore, c as Source, d as SourceDefinition, e as chainProcessors, f as combineInitialStates, g as combineProcessors, h as filterProcessor, i as identityProcessor, m as mapOutput, w as withLogging } from '../../../combinators-Dy-7lxKV.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Mealy - The Mealy Machine runtime
|
package/dist/agent/index.d.ts
CHANGED
|
@@ -1,43 +1,15 @@
|
|
|
1
|
-
export { A as AssistantMessage, C as ContentPart, E as ErrorMessage, F as FilePart, I as ImagePart, M as Message,
|
|
2
|
-
import {
|
|
3
|
-
export {
|
|
4
|
-
import { CreateAgentOptions, AgentEngine
|
|
1
|
+
export { A as AssistantMessage, C as ContentPart, E as ErrorMessage, F as FilePart, I as ImagePart, M as Message, c as MessageRole, d as MessageSubtype, e as TextPart, f as ThinkingPart, a as TokenUsage, g as ToolCallPart, T as ToolResultMessage, h as ToolResultOutput, i as ToolResultPart, b as UserContentPart, U as UserMessage } from '../message-Dn-I2vr0.js';
|
|
2
|
+
import { A as AgentState, a as AgentOutput, U as Unsubscribe, S as StreamEvent } from '../event-DNsF9EkO.js';
|
|
3
|
+
export { c as AgentError, d as AgentErrorCategory, e as AgentErrorOccurredEvent, f as AgentEvent, g as AgentEventHandler, h as AgentMessageEvent, b as AgentOutputCallback, i as AgentStateEvent, j as AgentTurnEvent, k as AssistantMessageEvent, C as ConversationEndData, l as ConversationEndEvent, m as ConversationInterruptedData, n as ConversationInterruptedEvent, o as ConversationQueuedData, p as ConversationQueuedEvent, q as ConversationRespondingData, r as ConversationRespondingEvent, s as ConversationStartData, t as ConversationStartEvent, u as ConversationThinkingData, v as ConversationThinkingEvent, E as EngineEvent, w as ErrorMessageEvent, x as ErrorOccurredData, y as ErrorOccurredEvent, z as ErrorReceivedData, B as ErrorReceivedEvent, I as InputJsonDeltaData, D as InputJsonDeltaEvent, M as MessageDeltaData, F as MessageDeltaEvent, G as MessageEvent, H as MessageStartData, J as MessageStartEvent, K as MessageStopData, L as MessageStopEvent, N as StateEvent, O as StopReason, P as StreamEventType, T as TextDeltaData, Q as TextDeltaEvent, R as ToolCompletedData, V as ToolCompletedEvent, W as ToolExecutingData, X as ToolExecutingEvent, Y as ToolFailedData, Z as ToolFailedEvent, _ as ToolPlannedData, $ as ToolPlannedEvent, a0 as ToolResultData, a1 as ToolResultEvent, a2 as ToolResultMessageEvent, a3 as ToolUseStartData, a4 as ToolUseStartEvent, a5 as ToolUseStopData, a6 as ToolUseStopEvent, a7 as TurnEvent, a8 as TurnRequestData, a9 as TurnRequestEvent, aa as TurnResponseData, ab as TurnResponseEvent, ac as UserMessageEvent, ad as isMessageEvent, ae as isStateEvent, af as isTurnEvent } from '../event-DNsF9EkO.js';
|
|
4
|
+
import { StateChangeHandler, CreateAgentOptions, AgentEngine } from './types/index.js';
|
|
5
5
|
export { AgentEventBus, AgentInterceptor, AgentInterceptorNext, AgentMiddleware, AgentMiddlewareNext, AgentPresenter, AgentSource, AgentStateMachineInterface, EventHandlerMap, MessageQueue, ReactHandlerMap, StateChange } from './types/index.js';
|
|
6
6
|
import { MessageAssemblerState, StateEventProcessorContext, TurnTrackerState, MessageAssemblerOutput, StateEventProcessorOutput, TurnTrackerOutput } from './engine/internal/index.js';
|
|
7
7
|
export { MessageAssemblerInput, PendingContent, PendingTurn, StateEventProcessorInput, TurnTrackerInput, createInitialMessageAssemblerState, createInitialStateEventProcessorContext, createInitialTurnTrackerState, messageAssemblerProcessor, messageAssemblerProcessorDef, stateEventProcessor, stateEventProcessorDef, turnTrackerProcessor, turnTrackerProcessorDef } from './engine/internal/index.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export {
|
|
8
|
+
import { P as Processor } from '../Processor-CeMyXtsX.js';
|
|
9
|
+
export { a as ProcessorDefinition, b as ProcessorResult } from '../Processor-CeMyXtsX.js';
|
|
10
|
+
export { M as MemoryStore, a as Sink, b as SinkDefinition, c as Source, d as SourceDefinition, S as Store, e as chainProcessors, f as combineInitialStates, g as combineProcessors, h as filterProcessor, i as identityProcessor, m as mapOutput, w as withLogging } from '../combinators-Dy-7lxKV.js';
|
|
11
11
|
import 'commonxjs/logger';
|
|
12
12
|
|
|
13
|
-
/**
|
|
14
|
-
* createAgent - Factory function to create an AgentEngine
|
|
15
|
-
*
|
|
16
|
-
* Creates an AgentEngine connected to EventBus:
|
|
17
|
-
* - receive() emits user_message to EventBus
|
|
18
|
-
* - Source subscribes to StreamEvent from EventBus
|
|
19
|
-
* - Presenter emits AgentOutput to EventBus
|
|
20
|
-
*
|
|
21
|
-
* ```
|
|
22
|
-
* EventBus
|
|
23
|
-
* ↗ ↘
|
|
24
|
-
* emit │ │ emit
|
|
25
|
-
* user_message │ │ AgentOutput
|
|
26
|
-
* ↑ │ │ ↑
|
|
27
|
-
* ┌─────────────────────────────────────────────────────────────┐
|
|
28
|
-
* │ AgentEngine │
|
|
29
|
-
* │ │
|
|
30
|
-
* │ receive() ──► Source ──► MealyMachine ──► Presenter │
|
|
31
|
-
* │ (sub) (pub) │
|
|
32
|
-
* └─────────────────────────────────────────────────────────────┘
|
|
33
|
-
* ```
|
|
34
|
-
*/
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Create an AgentEngine instance connected to EventBus
|
|
38
|
-
*/
|
|
39
|
-
declare function createAgent(options: CreateAgentOptions): AgentEngine;
|
|
40
|
-
|
|
41
13
|
/**
|
|
42
14
|
* AgentStateMachine - State management driven by StateEvents
|
|
43
15
|
*
|
|
@@ -93,6 +65,90 @@ declare class AgentStateMachine {
|
|
|
93
65
|
private notifyHandlers;
|
|
94
66
|
}
|
|
95
67
|
|
|
68
|
+
/**
|
|
69
|
+
* createAgent - Factory function to create an AgentEngine
|
|
70
|
+
*
|
|
71
|
+
* Creates an AgentEngine connected to EventBus:
|
|
72
|
+
* - receive() emits user_message to EventBus
|
|
73
|
+
* - Source subscribes to StreamEvent from EventBus
|
|
74
|
+
* - Presenter emits AgentOutput to EventBus
|
|
75
|
+
*
|
|
76
|
+
* ```
|
|
77
|
+
* EventBus
|
|
78
|
+
* ↗ ↘
|
|
79
|
+
* emit │ │ emit
|
|
80
|
+
* user_message │ │ AgentOutput
|
|
81
|
+
* ↑ │ │ ↑
|
|
82
|
+
* ┌─────────────────────────────────────────────────────────────┐
|
|
83
|
+
* │ AgentEngine │
|
|
84
|
+
* │ │
|
|
85
|
+
* │ receive() ──► Source ──► MealyMachine ──► Presenter │
|
|
86
|
+
* │ (sub) (pub) │
|
|
87
|
+
* └─────────────────────────────────────────────────────────────┘
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Create an AgentEngine instance connected to EventBus
|
|
93
|
+
*/
|
|
94
|
+
declare function createAgent(options: CreateAgentOptions): AgentEngine;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* AgentProcessor
|
|
98
|
+
*
|
|
99
|
+
* Combined Mealy processor for the full AgentX engine.
|
|
100
|
+
* Composes MessageAssembler, StateMachine, and TurnTracker processors.
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Combined state type for the full agent engine
|
|
105
|
+
*/
|
|
106
|
+
type AgentEngineState = {
|
|
107
|
+
messageAssembler: MessageAssemblerState;
|
|
108
|
+
stateEventProcessor: StateEventProcessorContext;
|
|
109
|
+
turnTracker: TurnTrackerState;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Input event type for AgentProcessor
|
|
113
|
+
*
|
|
114
|
+
* Accepts:
|
|
115
|
+
* - StreamEventType: Raw stream events from Driver
|
|
116
|
+
* - MessageEventType: Re-injected message events (for TurnTracker)
|
|
117
|
+
*
|
|
118
|
+
* Note: AgentOutput is used because re-injected events can be any output type
|
|
119
|
+
*/
|
|
120
|
+
type AgentProcessorInput = AgentOutput;
|
|
121
|
+
/**
|
|
122
|
+
* Output event type from AgentProcessor
|
|
123
|
+
*
|
|
124
|
+
* Produces:
|
|
125
|
+
* - MessageAssemblerOutput: Assembled message events
|
|
126
|
+
* - StateEventProcessorOutput: State transition events
|
|
127
|
+
* - TurnTrackerOutput: Turn analytics events
|
|
128
|
+
*
|
|
129
|
+
* Note: StreamEventType is NOT in output - it's passed through by AgentEngine
|
|
130
|
+
*/
|
|
131
|
+
type AgentProcessorOutput = MessageAssemblerOutput | StateEventProcessorOutput | TurnTrackerOutput;
|
|
132
|
+
/**
|
|
133
|
+
* Combined processor for the full agent engine
|
|
134
|
+
*
|
|
135
|
+
* This combines:
|
|
136
|
+
* - MessageAssembler: Stream → Message events
|
|
137
|
+
* - StateEventProcessor: Stream → State events
|
|
138
|
+
* - TurnTracker: Message → Turn events
|
|
139
|
+
*
|
|
140
|
+
* Pattern: (state, input) => [newState, outputs]
|
|
141
|
+
* Key insight: State is means, outputs are the goal (Mealy Machine)
|
|
142
|
+
*
|
|
143
|
+
* Note: Raw StreamEvents are NOT output by this processor.
|
|
144
|
+
* The AgentEngine handles pass-through of original events.
|
|
145
|
+
*/
|
|
146
|
+
declare const agentProcessor: Processor<AgentEngineState, AgentProcessorInput, AgentProcessorOutput>;
|
|
147
|
+
/**
|
|
148
|
+
* Initial state factory for the full agent engine
|
|
149
|
+
*/
|
|
150
|
+
declare const createInitialAgentEngineState: () => AgentEngineState;
|
|
151
|
+
|
|
96
152
|
/**
|
|
97
153
|
* MealyMachine - Pure Mealy Machine Event Processor
|
|
98
154
|
*
|
|
@@ -185,60 +241,4 @@ declare class MealyMachine {
|
|
|
185
241
|
*/
|
|
186
242
|
declare function createMealyMachine(): MealyMachine;
|
|
187
243
|
|
|
188
|
-
/**
|
|
189
|
-
* AgentProcessor
|
|
190
|
-
*
|
|
191
|
-
* Combined Mealy processor for the full AgentX engine.
|
|
192
|
-
* Composes MessageAssembler, StateMachine, and TurnTracker processors.
|
|
193
|
-
*/
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Combined state type for the full agent engine
|
|
197
|
-
*/
|
|
198
|
-
type AgentEngineState = {
|
|
199
|
-
messageAssembler: MessageAssemblerState;
|
|
200
|
-
stateEventProcessor: StateEventProcessorContext;
|
|
201
|
-
turnTracker: TurnTrackerState;
|
|
202
|
-
};
|
|
203
|
-
/**
|
|
204
|
-
* Input event type for AgentProcessor
|
|
205
|
-
*
|
|
206
|
-
* Accepts:
|
|
207
|
-
* - StreamEventType: Raw stream events from Driver
|
|
208
|
-
* - MessageEventType: Re-injected message events (for TurnTracker)
|
|
209
|
-
*
|
|
210
|
-
* Note: AgentOutput is used because re-injected events can be any output type
|
|
211
|
-
*/
|
|
212
|
-
type AgentProcessorInput = AgentOutput;
|
|
213
|
-
/**
|
|
214
|
-
* Output event type from AgentProcessor
|
|
215
|
-
*
|
|
216
|
-
* Produces:
|
|
217
|
-
* - MessageAssemblerOutput: Assembled message events
|
|
218
|
-
* - StateEventProcessorOutput: State transition events
|
|
219
|
-
* - TurnTrackerOutput: Turn analytics events
|
|
220
|
-
*
|
|
221
|
-
* Note: StreamEventType is NOT in output - it's passed through by AgentEngine
|
|
222
|
-
*/
|
|
223
|
-
type AgentProcessorOutput = MessageAssemblerOutput | StateEventProcessorOutput | TurnTrackerOutput;
|
|
224
|
-
/**
|
|
225
|
-
* Combined processor for the full agent engine
|
|
226
|
-
*
|
|
227
|
-
* This combines:
|
|
228
|
-
* - MessageAssembler: Stream → Message events
|
|
229
|
-
* - StateEventProcessor: Stream → State events
|
|
230
|
-
* - TurnTracker: Message → Turn events
|
|
231
|
-
*
|
|
232
|
-
* Pattern: (state, input) => [newState, outputs]
|
|
233
|
-
* Key insight: State is means, outputs are the goal (Mealy Machine)
|
|
234
|
-
*
|
|
235
|
-
* Note: Raw StreamEvents are NOT output by this processor.
|
|
236
|
-
* The AgentEngine handles pass-through of original events.
|
|
237
|
-
*/
|
|
238
|
-
declare const agentProcessor: Processor<AgentEngineState, AgentProcessorInput, AgentProcessorOutput>;
|
|
239
|
-
/**
|
|
240
|
-
* Initial state factory for the full agent engine
|
|
241
|
-
*/
|
|
242
|
-
declare const createInitialAgentEngineState: () => AgentEngineState;
|
|
243
|
-
|
|
244
244
|
export { AgentEngine, type AgentEngineState, AgentOutput, type AgentProcessorInput, type AgentProcessorOutput, AgentState, AgentStateMachine, CreateAgentOptions, MealyMachine, MessageAssemblerOutput, MessageAssemblerState, Processor, StateChangeHandler, StateEventProcessorContext, StateEventProcessorOutput, StreamEvent, TurnTrackerOutput, TurnTrackerState, Unsubscribe, agentProcessor, createAgent, createInitialAgentEngineState, createMealyMachine };
|
package/dist/agent/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
createAgent,
|
|
7
7
|
createInitialAgentEngineState,
|
|
8
8
|
createMealyMachine
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-RWIYC65R.js";
|
|
10
10
|
import {
|
|
11
11
|
createInitialMessageAssemblerState,
|
|
12
12
|
createInitialStateEventProcessorContext,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
stateEventProcessorDef,
|
|
18
18
|
turnTrackerProcessor,
|
|
19
19
|
turnTrackerProcessorDef
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-TUFZ2YH6.js";
|
|
21
21
|
import {
|
|
22
22
|
MemoryStore,
|
|
23
23
|
chainProcessors,
|
|
@@ -27,14 +27,14 @@ import {
|
|
|
27
27
|
identityProcessor,
|
|
28
28
|
mapOutput,
|
|
29
29
|
withLogging
|
|
30
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-APCBNCOW.js";
|
|
31
31
|
import {
|
|
32
32
|
isMessageEvent,
|
|
33
33
|
isStateEvent,
|
|
34
34
|
isTurnEvent
|
|
35
|
-
} from "../chunk-
|
|
36
|
-
import "../chunk-
|
|
37
|
-
import "../chunk-
|
|
35
|
+
} from "../chunk-YSZG6XIM.js";
|
|
36
|
+
import "../chunk-AAFPAF67.js";
|
|
37
|
+
import "../chunk-22NTRYNO.js";
|
|
38
38
|
export {
|
|
39
39
|
AgentStateMachine,
|
|
40
40
|
MealyMachine,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { U as UserMessage } from '../../message-
|
|
2
|
-
export { A as AssistantMessage, C as ContentPart, E as ErrorMessage, F as FilePart, I as ImagePart, M as Message,
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
1
|
+
import { U as UserMessage } from '../../message-Dn-I2vr0.js';
|
|
2
|
+
export { A as AssistantMessage, C as ContentPart, E as ErrorMessage, F as FilePart, I as ImagePart, M as Message, c as MessageRole, d as MessageSubtype, e as TextPart, f as ThinkingPart, a as TokenUsage, g as ToolCallPart, T as ToolResultMessage, h as ToolResultOutput, i as ToolResultPart, b as UserContentPart } from '../../message-Dn-I2vr0.js';
|
|
3
|
+
import { A as AgentState, S as StreamEvent, a as AgentOutput, b as AgentOutputCallback, U as Unsubscribe } from '../../event-DNsF9EkO.js';
|
|
4
|
+
export { c as AgentError, d as AgentErrorCategory, e as AgentErrorOccurredEvent, f as AgentEvent, g as AgentEventHandler, h as AgentMessageEvent, i as AgentStateEvent, j as AgentTurnEvent, k as AssistantMessageEvent, C as ConversationEndData, l as ConversationEndEvent, m as ConversationInterruptedData, n as ConversationInterruptedEvent, o as ConversationQueuedData, p as ConversationQueuedEvent, q as ConversationRespondingData, r as ConversationRespondingEvent, s as ConversationStartData, t as ConversationStartEvent, u as ConversationThinkingData, v as ConversationThinkingEvent, E as EngineEvent, w as ErrorMessageEvent, x as ErrorOccurredData, y as ErrorOccurredEvent, z as ErrorReceivedData, B as ErrorReceivedEvent, I as InputJsonDeltaData, D as InputJsonDeltaEvent, M as MessageDeltaData, F as MessageDeltaEvent, G as MessageEvent, H as MessageStartData, J as MessageStartEvent, K as MessageStopData, L as MessageStopEvent, N as StateEvent, O as StopReason, P as StreamEventType, T as TextDeltaData, Q as TextDeltaEvent, R as ToolCompletedData, V as ToolCompletedEvent, W as ToolExecutingData, X as ToolExecutingEvent, Y as ToolFailedData, Z as ToolFailedEvent, _ as ToolPlannedData, $ as ToolPlannedEvent, a0 as ToolResultData, a1 as ToolResultEvent, a2 as ToolResultMessageEvent, a3 as ToolUseStartData, a4 as ToolUseStartEvent, a5 as ToolUseStopData, a6 as ToolUseStopEvent, a7 as TurnEvent, a8 as TurnRequestData, a9 as TurnRequestEvent, aa as TurnResponseData, ab as TurnResponseEvent, ac as UserMessageEvent, ad as isMessageEvent, ae as isStateEvent, af as isTurnEvent } from '../../event-DNsF9EkO.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Engine Types - AgentEngine, Driver, Presenter, and related infrastructure
|
package/dist/bash/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import '../message-
|
|
1
|
+
import { T as ToolDefinition } from '../index--gxNpY5W.js';
|
|
2
|
+
import { B as BashProvider } from '../types-Cb8tKM6Y.js';
|
|
3
|
+
export { a as BashOptions, b as BashResult } from '../types-Cb8tKM6Y.js';
|
|
4
|
+
import '../message-Dn-I2vr0.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Bash Tool Definition
|
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
// src/event/types/agent.ts
|
|
2
|
+
function isAgentStreamEvent(event) {
|
|
3
|
+
return event.source === "agent" && event.category === "stream";
|
|
4
|
+
}
|
|
5
|
+
function isAgentStateEvent(event) {
|
|
6
|
+
return event.source === "agent" && event.category === "state";
|
|
7
|
+
}
|
|
8
|
+
function isAgentMessageEvent(event) {
|
|
9
|
+
return event.source === "agent" && event.category === "message";
|
|
10
|
+
}
|
|
11
|
+
function isAgentTurnEvent(event) {
|
|
12
|
+
return event.source === "agent" && event.category === "turn";
|
|
13
|
+
}
|
|
14
|
+
function isAgentEvent(event) {
|
|
15
|
+
return event.source === "agent";
|
|
16
|
+
}
|
|
17
|
+
|
|
1
18
|
// src/event/types/base.ts
|
|
2
19
|
function isFromSource(event, source) {
|
|
3
20
|
return event.source === source;
|
|
@@ -15,6 +32,34 @@ function isNotification(event) {
|
|
|
15
32
|
return event.intent === "notification";
|
|
16
33
|
}
|
|
17
34
|
|
|
35
|
+
// src/event/types/command.ts
|
|
36
|
+
function isCommandEvent(event) {
|
|
37
|
+
return event.source === "command";
|
|
38
|
+
}
|
|
39
|
+
function isCommandRequest(event) {
|
|
40
|
+
return event.source === "command" && event.category === "request";
|
|
41
|
+
}
|
|
42
|
+
function isCommandResponse(event) {
|
|
43
|
+
return event.source === "command" && event.category === "response";
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// src/event/types/container.ts
|
|
47
|
+
function isContainerLifecycleEvent(event) {
|
|
48
|
+
return event.source === "container" && event.category === "lifecycle";
|
|
49
|
+
}
|
|
50
|
+
function isWorkdirEvent(event) {
|
|
51
|
+
return event.source === "sandbox" && event.category === "workdir";
|
|
52
|
+
}
|
|
53
|
+
function isMCPEvent(event) {
|
|
54
|
+
return event.source === "sandbox" && event.category === "mcp";
|
|
55
|
+
}
|
|
56
|
+
function isSandboxEvent(event) {
|
|
57
|
+
return event.source === "sandbox";
|
|
58
|
+
}
|
|
59
|
+
function isContainerEvent(event) {
|
|
60
|
+
return event.source === "container" || event.source === "sandbox";
|
|
61
|
+
}
|
|
62
|
+
|
|
18
63
|
// src/event/types/driver.ts
|
|
19
64
|
function isStopReason(value) {
|
|
20
65
|
return [
|
|
@@ -34,23 +79,6 @@ function isConnectionEvent(event) {
|
|
|
34
79
|
return event.source === "driver" && event.category === "connection";
|
|
35
80
|
}
|
|
36
81
|
|
|
37
|
-
// src/event/types/agent.ts
|
|
38
|
-
function isAgentStreamEvent(event) {
|
|
39
|
-
return event.source === "agent" && event.category === "stream";
|
|
40
|
-
}
|
|
41
|
-
function isAgentStateEvent(event) {
|
|
42
|
-
return event.source === "agent" && event.category === "state";
|
|
43
|
-
}
|
|
44
|
-
function isAgentMessageEvent(event) {
|
|
45
|
-
return event.source === "agent" && event.category === "message";
|
|
46
|
-
}
|
|
47
|
-
function isAgentTurnEvent(event) {
|
|
48
|
-
return event.source === "agent" && event.category === "turn";
|
|
49
|
-
}
|
|
50
|
-
function isAgentEvent(event) {
|
|
51
|
-
return event.source === "agent";
|
|
52
|
-
}
|
|
53
|
-
|
|
54
82
|
// src/event/types/session.ts
|
|
55
83
|
function isSessionLifecycleEvent(event) {
|
|
56
84
|
return event.source === "session" && event.category === "lifecycle";
|
|
@@ -65,59 +93,31 @@ function isSessionEvent(event) {
|
|
|
65
93
|
return event.source === "session";
|
|
66
94
|
}
|
|
67
95
|
|
|
68
|
-
// src/event/types/container.ts
|
|
69
|
-
function isContainerLifecycleEvent(event) {
|
|
70
|
-
return event.source === "container" && event.category === "lifecycle";
|
|
71
|
-
}
|
|
72
|
-
function isWorkdirEvent(event) {
|
|
73
|
-
return event.source === "sandbox" && event.category === "workdir";
|
|
74
|
-
}
|
|
75
|
-
function isMCPEvent(event) {
|
|
76
|
-
return event.source === "sandbox" && event.category === "mcp";
|
|
77
|
-
}
|
|
78
|
-
function isSandboxEvent(event) {
|
|
79
|
-
return event.source === "sandbox";
|
|
80
|
-
}
|
|
81
|
-
function isContainerEvent(event) {
|
|
82
|
-
return event.source === "container" || event.source === "sandbox";
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
// src/event/types/command.ts
|
|
86
|
-
function isCommandEvent(event) {
|
|
87
|
-
return event.source === "command";
|
|
88
|
-
}
|
|
89
|
-
function isCommandRequest(event) {
|
|
90
|
-
return event.source === "command" && event.category === "request";
|
|
91
|
-
}
|
|
92
|
-
function isCommandResponse(event) {
|
|
93
|
-
return event.source === "command" && event.category === "response";
|
|
94
|
-
}
|
|
95
|
-
|
|
96
96
|
export {
|
|
97
|
+
isAgentStreamEvent,
|
|
98
|
+
isAgentStateEvent,
|
|
99
|
+
isAgentMessageEvent,
|
|
100
|
+
isAgentTurnEvent,
|
|
101
|
+
isAgentEvent,
|
|
97
102
|
isFromSource,
|
|
98
103
|
hasIntent,
|
|
99
104
|
isRequest,
|
|
100
105
|
isResult,
|
|
101
106
|
isNotification,
|
|
107
|
+
isCommandEvent,
|
|
108
|
+
isCommandRequest,
|
|
109
|
+
isCommandResponse,
|
|
110
|
+
isContainerLifecycleEvent,
|
|
111
|
+
isWorkdirEvent,
|
|
112
|
+
isMCPEvent,
|
|
113
|
+
isSandboxEvent,
|
|
114
|
+
isContainerEvent,
|
|
102
115
|
isStopReason,
|
|
103
116
|
isDriveableEvent,
|
|
104
117
|
isConnectionEvent,
|
|
105
|
-
isAgentStreamEvent,
|
|
106
|
-
isAgentStateEvent,
|
|
107
|
-
isAgentMessageEvent,
|
|
108
|
-
isAgentTurnEvent,
|
|
109
|
-
isAgentEvent,
|
|
110
118
|
isSessionLifecycleEvent,
|
|
111
119
|
isSessionPersistEvent,
|
|
112
120
|
isSessionActionEvent,
|
|
113
|
-
isSessionEvent
|
|
114
|
-
isContainerLifecycleEvent,
|
|
115
|
-
isWorkdirEvent,
|
|
116
|
-
isMCPEvent,
|
|
117
|
-
isSandboxEvent,
|
|
118
|
-
isContainerEvent,
|
|
119
|
-
isCommandEvent,
|
|
120
|
-
isCommandRequest,
|
|
121
|
-
isCommandResponse
|
|
121
|
+
isSessionEvent
|
|
122
122
|
};
|
|
123
|
-
//# sourceMappingURL=chunk-
|
|
123
|
+
//# sourceMappingURL=chunk-22NTRYNO.js.map
|