@agentxjs/core 1.9.8-dev → 1.9.9-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/dist/agent/index.js
CHANGED
|
@@ -5,17 +5,7 @@ import {
|
|
|
5
5
|
createAgent,
|
|
6
6
|
createInitialAgentEngineState,
|
|
7
7
|
createMealyMachine
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import {
|
|
10
|
-
MemoryStore,
|
|
11
|
-
chainProcessors,
|
|
12
|
-
combineInitialStates,
|
|
13
|
-
combineProcessors,
|
|
14
|
-
filterProcessor,
|
|
15
|
-
identityProcessor,
|
|
16
|
-
mapOutput,
|
|
17
|
-
withLogging
|
|
18
|
-
} from "../chunk-EKHT54KN.js";
|
|
8
|
+
} from "../chunk-TBU7FFZT.js";
|
|
19
9
|
import {
|
|
20
10
|
createInitialMessageAssemblerState,
|
|
21
11
|
createInitialStateEventProcessorContext,
|
|
@@ -27,12 +17,22 @@ import {
|
|
|
27
17
|
turnTrackerProcessor,
|
|
28
18
|
turnTrackerProcessorDef
|
|
29
19
|
} from "../chunk-I7GYR3MN.js";
|
|
20
|
+
import {
|
|
21
|
+
MemoryStore,
|
|
22
|
+
chainProcessors,
|
|
23
|
+
combineInitialStates,
|
|
24
|
+
combineProcessors,
|
|
25
|
+
filterProcessor,
|
|
26
|
+
identityProcessor,
|
|
27
|
+
mapOutput,
|
|
28
|
+
withLogging
|
|
29
|
+
} from "../chunk-EKHT54KN.js";
|
|
30
|
+
import "../chunk-7ZDX3O6I.js";
|
|
30
31
|
import {
|
|
31
32
|
isMessageEvent,
|
|
32
33
|
isStateEvent,
|
|
33
34
|
isTurnEvent
|
|
34
35
|
} from "../chunk-K6WXQ2RW.js";
|
|
35
|
-
import "../chunk-7ZDX3O6I.js";
|
|
36
36
|
import "../chunk-E5FPOAPO.js";
|
|
37
37
|
import "../chunk-7D4SUZUM.js";
|
|
38
38
|
export {
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
MemoryStore,
|
|
3
|
-
combineInitialStates,
|
|
4
|
-
combineProcessors
|
|
5
|
-
} from "./chunk-EKHT54KN.js";
|
|
6
1
|
import {
|
|
7
2
|
createInitialMessageAssemblerState,
|
|
8
3
|
createInitialStateEventProcessorContext,
|
|
@@ -11,6 +6,11 @@ import {
|
|
|
11
6
|
stateEventProcessor,
|
|
12
7
|
turnTrackerProcessor
|
|
13
8
|
} from "./chunk-I7GYR3MN.js";
|
|
9
|
+
import {
|
|
10
|
+
MemoryStore,
|
|
11
|
+
combineInitialStates,
|
|
12
|
+
combineProcessors
|
|
13
|
+
} from "./chunk-EKHT54KN.js";
|
|
14
14
|
import {
|
|
15
15
|
isStateEvent
|
|
16
16
|
} from "./chunk-K6WXQ2RW.js";
|
|
@@ -540,4 +540,4 @@ export {
|
|
|
540
540
|
AgentStateMachine,
|
|
541
541
|
createAgent
|
|
542
542
|
};
|
|
543
|
-
//# sourceMappingURL=chunk-
|
|
543
|
+
//# sourceMappingURL=chunk-TBU7FFZT.js.map
|
package/dist/driver/index.d.ts
CHANGED
|
@@ -122,8 +122,29 @@ type DriverStreamEventType = DriverStreamEvent["type"];
|
|
|
122
122
|
*
|
|
123
123
|
* This is our capability boundary - we define what we support.
|
|
124
124
|
* Specific implementations (Claude, OpenAI) must work within this.
|
|
125
|
+
*
|
|
126
|
+
* @typeParam TOptions - Driver-specific options type. Each driver implementation
|
|
127
|
+
* can define its own options interface and pass it as a type parameter.
|
|
128
|
+
*
|
|
129
|
+
* @example
|
|
130
|
+
* ```typescript
|
|
131
|
+
* // Define driver-specific options
|
|
132
|
+
* interface ClaudeDriverOptions {
|
|
133
|
+
* claudeCodePath?: string;
|
|
134
|
+
* maxTurns?: number;
|
|
135
|
+
* }
|
|
136
|
+
*
|
|
137
|
+
* // Use with type parameter
|
|
138
|
+
* const config: DriverConfig<ClaudeDriverOptions> = {
|
|
139
|
+
* apiKey: "...",
|
|
140
|
+
* agentId: "my-agent",
|
|
141
|
+
* options: {
|
|
142
|
+
* claudeCodePath: "/usr/local/bin/claude"
|
|
143
|
+
* }
|
|
144
|
+
* };
|
|
145
|
+
* ```
|
|
125
146
|
*/
|
|
126
|
-
interface DriverConfig {
|
|
147
|
+
interface DriverConfig<TOptions = Record<string, unknown>> {
|
|
127
148
|
/**
|
|
128
149
|
* API key for authentication
|
|
129
150
|
*/
|
|
@@ -170,6 +191,27 @@ interface DriverConfig {
|
|
|
170
191
|
* Save this ID to enable session resume later.
|
|
171
192
|
*/
|
|
172
193
|
onSessionIdCaptured?: (sessionId: string) => void;
|
|
194
|
+
/**
|
|
195
|
+
* Driver-specific options
|
|
196
|
+
*
|
|
197
|
+
* Each driver implementation can define its own options type.
|
|
198
|
+
* This allows drivers to have custom configuration without
|
|
199
|
+
* polluting the base DriverConfig interface.
|
|
200
|
+
*
|
|
201
|
+
* @example
|
|
202
|
+
* ```typescript
|
|
203
|
+
* // ClaudeDriver options
|
|
204
|
+
* interface ClaudeDriverOptions {
|
|
205
|
+
* claudeCodePath?: string;
|
|
206
|
+
* }
|
|
207
|
+
*
|
|
208
|
+
* const config: DriverConfig<ClaudeDriverOptions> = {
|
|
209
|
+
* apiKey: "...",
|
|
210
|
+
* options: { claudeCodePath: "/usr/bin/claude" }
|
|
211
|
+
* };
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
options?: TOptions;
|
|
173
215
|
}
|
|
174
216
|
/**
|
|
175
217
|
* DriverState - Current state of the Driver
|
|
@@ -253,14 +295,16 @@ interface Driver {
|
|
|
253
295
|
*
|
|
254
296
|
* Each implementation package exports a function of this type.
|
|
255
297
|
*
|
|
298
|
+
* @typeParam TOptions - Driver-specific options type
|
|
299
|
+
*
|
|
256
300
|
* @example
|
|
257
301
|
* ```typescript
|
|
258
302
|
* // @agentxjs/claude-driver
|
|
259
|
-
* export const
|
|
260
|
-
* return new
|
|
303
|
+
* export const createClaudeDriver: CreateDriver<ClaudeDriverOptions> = (config) => {
|
|
304
|
+
* return new ClaudeDriver(config);
|
|
261
305
|
* };
|
|
262
306
|
* ```
|
|
263
307
|
*/
|
|
264
|
-
type CreateDriver = (config: DriverConfig) => Driver;
|
|
308
|
+
type CreateDriver<TOptions = Record<string, unknown>> = (config: DriverConfig<TOptions>) => Driver;
|
|
265
309
|
|
|
266
310
|
export type { CreateDriver, Driver, DriverConfig, DriverState, DriverStreamEvent, DriverStreamEventType, ErrorEvent, InputJsonDeltaEvent, InterruptedEvent, McpServerConfig, MessageStartEvent, MessageStopEvent, StopReason, StreamEvent, TextDeltaEvent, ToolResultEvent, ToolUseStartEvent, ToolUseStopEvent };
|
package/dist/index.js
CHANGED
|
@@ -5,17 +5,7 @@ import {
|
|
|
5
5
|
createAgent,
|
|
6
6
|
createInitialAgentEngineState,
|
|
7
7
|
createMealyMachine
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
MemoryStore,
|
|
11
|
-
chainProcessors,
|
|
12
|
-
combineInitialStates,
|
|
13
|
-
combineProcessors,
|
|
14
|
-
filterProcessor,
|
|
15
|
-
identityProcessor,
|
|
16
|
-
mapOutput,
|
|
17
|
-
withLogging
|
|
18
|
-
} from "./chunk-EKHT54KN.js";
|
|
8
|
+
} from "./chunk-TBU7FFZT.js";
|
|
19
9
|
import {
|
|
20
10
|
createInitialMessageAssemblerState,
|
|
21
11
|
createInitialStateEventProcessorContext,
|
|
@@ -27,14 +17,24 @@ import {
|
|
|
27
17
|
turnTrackerProcessor,
|
|
28
18
|
turnTrackerProcessorDef
|
|
29
19
|
} from "./chunk-I7GYR3MN.js";
|
|
30
|
-
import
|
|
20
|
+
import {
|
|
21
|
+
MemoryStore,
|
|
22
|
+
chainProcessors,
|
|
23
|
+
combineInitialStates,
|
|
24
|
+
combineProcessors,
|
|
25
|
+
filterProcessor,
|
|
26
|
+
identityProcessor,
|
|
27
|
+
mapOutput,
|
|
28
|
+
withLogging
|
|
29
|
+
} from "./chunk-EKHT54KN.js";
|
|
30
|
+
import "./chunk-7ZDX3O6I.js";
|
|
31
31
|
import {
|
|
32
32
|
isMessageEvent,
|
|
33
33
|
isStateEvent,
|
|
34
34
|
isTurnEvent
|
|
35
35
|
} from "./chunk-K6WXQ2RW.js";
|
|
36
|
-
import "./chunk-7ZDX3O6I.js";
|
|
37
36
|
import "./chunk-E5FPOAPO.js";
|
|
37
|
+
import "./chunk-RL3JRNXM.js";
|
|
38
38
|
import "./chunk-7D4SUZUM.js";
|
|
39
39
|
export {
|
|
40
40
|
AgentStateMachine,
|
package/package.json
CHANGED
package/src/driver/types.ts
CHANGED
|
@@ -185,8 +185,29 @@ export type DriverStreamEventType = DriverStreamEvent["type"];
|
|
|
185
185
|
*
|
|
186
186
|
* This is our capability boundary - we define what we support.
|
|
187
187
|
* Specific implementations (Claude, OpenAI) must work within this.
|
|
188
|
+
*
|
|
189
|
+
* @typeParam TOptions - Driver-specific options type. Each driver implementation
|
|
190
|
+
* can define its own options interface and pass it as a type parameter.
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```typescript
|
|
194
|
+
* // Define driver-specific options
|
|
195
|
+
* interface ClaudeDriverOptions {
|
|
196
|
+
* claudeCodePath?: string;
|
|
197
|
+
* maxTurns?: number;
|
|
198
|
+
* }
|
|
199
|
+
*
|
|
200
|
+
* // Use with type parameter
|
|
201
|
+
* const config: DriverConfig<ClaudeDriverOptions> = {
|
|
202
|
+
* apiKey: "...",
|
|
203
|
+
* agentId: "my-agent",
|
|
204
|
+
* options: {
|
|
205
|
+
* claudeCodePath: "/usr/local/bin/claude"
|
|
206
|
+
* }
|
|
207
|
+
* };
|
|
208
|
+
* ```
|
|
188
209
|
*/
|
|
189
|
-
export interface DriverConfig {
|
|
210
|
+
export interface DriverConfig<TOptions = Record<string, unknown>> {
|
|
190
211
|
// === Provider Configuration ===
|
|
191
212
|
|
|
192
213
|
/**
|
|
@@ -248,6 +269,30 @@ export interface DriverConfig {
|
|
|
248
269
|
* Save this ID to enable session resume later.
|
|
249
270
|
*/
|
|
250
271
|
onSessionIdCaptured?: (sessionId: string) => void;
|
|
272
|
+
|
|
273
|
+
// === Driver-Specific Options ===
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Driver-specific options
|
|
277
|
+
*
|
|
278
|
+
* Each driver implementation can define its own options type.
|
|
279
|
+
* This allows drivers to have custom configuration without
|
|
280
|
+
* polluting the base DriverConfig interface.
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* ```typescript
|
|
284
|
+
* // ClaudeDriver options
|
|
285
|
+
* interface ClaudeDriverOptions {
|
|
286
|
+
* claudeCodePath?: string;
|
|
287
|
+
* }
|
|
288
|
+
*
|
|
289
|
+
* const config: DriverConfig<ClaudeDriverOptions> = {
|
|
290
|
+
* apiKey: "...",
|
|
291
|
+
* options: { claudeCodePath: "/usr/bin/claude" }
|
|
292
|
+
* };
|
|
293
|
+
* ```
|
|
294
|
+
*/
|
|
295
|
+
options?: TOptions;
|
|
251
296
|
}
|
|
252
297
|
|
|
253
298
|
// ============================================================================
|
|
@@ -352,12 +397,16 @@ export interface Driver {
|
|
|
352
397
|
*
|
|
353
398
|
* Each implementation package exports a function of this type.
|
|
354
399
|
*
|
|
400
|
+
* @typeParam TOptions - Driver-specific options type
|
|
401
|
+
*
|
|
355
402
|
* @example
|
|
356
403
|
* ```typescript
|
|
357
404
|
* // @agentxjs/claude-driver
|
|
358
|
-
* export const
|
|
359
|
-
* return new
|
|
405
|
+
* export const createClaudeDriver: CreateDriver<ClaudeDriverOptions> = (config) => {
|
|
406
|
+
* return new ClaudeDriver(config);
|
|
360
407
|
* };
|
|
361
408
|
* ```
|
|
362
409
|
*/
|
|
363
|
-
export type CreateDriver =
|
|
410
|
+
export type CreateDriver<TOptions = Record<string, unknown>> = (
|
|
411
|
+
config: DriverConfig<TOptions>
|
|
412
|
+
) => Driver;
|
|
File without changes
|