@iqai/adk 0.0.5 → 0.0.7
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/CHANGELOG.md +2 -2
- package/README.md +177 -0
- package/dist/index.d.mts +76 -144
- package/dist/index.d.ts +76 -144
- package/dist/index.js +706 -552
- package/dist/index.mjs +516 -362
- package/package.json +3 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
2
|
-
import { Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
2
|
+
import { CreateMessageRequestSchema, CreateMessageResultSchema, Tool } from '@modelcontextprotocol/sdk/types.js';
|
|
3
|
+
import { z } from 'zod';
|
|
3
4
|
import { AxiosInstance } from 'axios';
|
|
4
5
|
import OpenAI from 'openai';
|
|
5
6
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
6
7
|
import { NodePgDatabase } from 'drizzle-orm/node-postgres';
|
|
7
8
|
import { PGlite } from '@electric-sql/pglite';
|
|
9
|
+
import Database from 'better-sqlite3';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* Function call result from LLM
|
|
@@ -439,6 +441,7 @@ declare class AnthropicLLM extends BaseLLM {
|
|
|
439
441
|
* Default parameters for requests
|
|
440
442
|
*/
|
|
441
443
|
private defaultParams;
|
|
444
|
+
private logger;
|
|
442
445
|
/**
|
|
443
446
|
* Constructor for AnthropicLLM
|
|
444
447
|
*/
|
|
@@ -515,6 +518,7 @@ declare class AnthropicLLMConnection extends BaseLLMConnection {
|
|
|
515
518
|
private responseCallback?;
|
|
516
519
|
private errorCallback?;
|
|
517
520
|
private endCallback?;
|
|
521
|
+
private logger;
|
|
518
522
|
/**
|
|
519
523
|
* Constructor
|
|
520
524
|
*/
|
|
@@ -711,6 +715,7 @@ declare class OpenAILLM extends BaseLLM {
|
|
|
711
715
|
* Default parameters for requests
|
|
712
716
|
*/
|
|
713
717
|
private defaultParams;
|
|
718
|
+
private logger;
|
|
714
719
|
/**
|
|
715
720
|
* Constructor for OpenAILLM
|
|
716
721
|
*/
|
|
@@ -1994,6 +1999,7 @@ declare class Agent extends BaseAgent {
|
|
|
1994
1999
|
* The minimum relevance score for memory augmentation (0-1)
|
|
1995
2000
|
*/
|
|
1996
2001
|
private memoryRelevanceThreshold;
|
|
2002
|
+
private logger;
|
|
1997
2003
|
/**
|
|
1998
2004
|
* Constructor for Agent
|
|
1999
2005
|
*/
|
|
@@ -2068,6 +2074,7 @@ interface EnhancedLLMResponse extends LLMResponse {
|
|
|
2068
2074
|
* Each sub-agent's output becomes input to the next agent
|
|
2069
2075
|
*/
|
|
2070
2076
|
declare class SequentialAgent extends BaseAgent {
|
|
2077
|
+
private logger;
|
|
2071
2078
|
/**
|
|
2072
2079
|
* Constructor for SequentialAgent
|
|
2073
2080
|
*/
|
|
@@ -2112,6 +2119,7 @@ interface ParallelAgentConfig {
|
|
|
2112
2119
|
* All sub-agents execute independently with the same input
|
|
2113
2120
|
*/
|
|
2114
2121
|
declare class ParallelAgent extends BaseAgent {
|
|
2122
|
+
private logger;
|
|
2115
2123
|
/**
|
|
2116
2124
|
* Constructor for ParallelAgent
|
|
2117
2125
|
*/
|
|
@@ -2180,6 +2188,7 @@ declare class LoopAgent extends BaseAgent {
|
|
|
2180
2188
|
* Custom condition check function
|
|
2181
2189
|
*/
|
|
2182
2190
|
private conditionCheck?;
|
|
2191
|
+
private logger;
|
|
2183
2192
|
/**
|
|
2184
2193
|
* Constructor for LoopAgent
|
|
2185
2194
|
*/
|
|
@@ -2277,6 +2286,7 @@ declare class LangGraphAgent extends BaseAgent {
|
|
|
2277
2286
|
* Results from node executions
|
|
2278
2287
|
*/
|
|
2279
2288
|
private results;
|
|
2289
|
+
private logger;
|
|
2280
2290
|
/**
|
|
2281
2291
|
* Constructor for LangGraphAgent
|
|
2282
2292
|
*/
|
|
@@ -2438,6 +2448,7 @@ declare function createFunctionTool(func: (...args: any[]) => any, options?: {
|
|
|
2438
2448
|
* Simple GoogleSearch tool implementation
|
|
2439
2449
|
*/
|
|
2440
2450
|
declare class GoogleSearch extends BaseTool {
|
|
2451
|
+
private logger;
|
|
2441
2452
|
/**
|
|
2442
2453
|
* Constructor for GoogleSearch
|
|
2443
2454
|
*/
|
|
@@ -2590,6 +2601,7 @@ declare module "./tool-context" {
|
|
|
2590
2601
|
* Tool that allows an agent to exit the current execution loop
|
|
2591
2602
|
*/
|
|
2592
2603
|
declare class ExitLoopTool extends BaseTool {
|
|
2604
|
+
private logger;
|
|
2593
2605
|
/**
|
|
2594
2606
|
* Constructor for ExitLoopTool
|
|
2595
2607
|
*/
|
|
@@ -2608,6 +2620,7 @@ declare class ExitLoopTool extends BaseTool {
|
|
|
2608
2620
|
* Tool that allows an agent to get a choice from the user
|
|
2609
2621
|
*/
|
|
2610
2622
|
declare class GetUserChoiceTool extends BaseTool {
|
|
2623
|
+
private logger;
|
|
2611
2624
|
/**
|
|
2612
2625
|
* Constructor for GetUserChoiceTool
|
|
2613
2626
|
*/
|
|
@@ -2631,6 +2644,7 @@ declare class GetUserChoiceTool extends BaseTool {
|
|
|
2631
2644
|
* Tool that allows an agent to transfer control to another agent
|
|
2632
2645
|
*/
|
|
2633
2646
|
declare class TransferToAgentTool extends BaseTool {
|
|
2647
|
+
private logger;
|
|
2634
2648
|
/**
|
|
2635
2649
|
* Constructor for TransferToAgentTool
|
|
2636
2650
|
*/
|
|
@@ -2651,6 +2665,7 @@ declare class TransferToAgentTool extends BaseTool {
|
|
|
2651
2665
|
* Tool that allows an agent to load memories relevant to a query
|
|
2652
2666
|
*/
|
|
2653
2667
|
declare class LoadMemoryTool extends BaseTool {
|
|
2668
|
+
private logger;
|
|
2654
2669
|
/**
|
|
2655
2670
|
* Constructor for LoadMemoryTool
|
|
2656
2671
|
*/
|
|
@@ -2684,6 +2699,7 @@ type McpConfig = {
|
|
|
2684
2699
|
maxSize?: number;
|
|
2685
2700
|
};
|
|
2686
2701
|
debug?: boolean;
|
|
2702
|
+
samplingHandler?: SamplingHandler;
|
|
2687
2703
|
};
|
|
2688
2704
|
type McpTransportType = {
|
|
2689
2705
|
mode: "stdio";
|
|
@@ -2703,7 +2719,9 @@ declare enum McpErrorType {
|
|
|
2703
2719
|
TOOL_EXECUTION_ERROR = "tool_execution_error",
|
|
2704
2720
|
RESOURCE_CLOSED_ERROR = "resource_closed_error",
|
|
2705
2721
|
TIMEOUT_ERROR = "timeout_error",
|
|
2706
|
-
INVALID_SCHEMA_ERROR = "invalid_schema_error"
|
|
2722
|
+
INVALID_SCHEMA_ERROR = "invalid_schema_error",
|
|
2723
|
+
SAMPLING_ERROR = "SAMPLING_ERROR",
|
|
2724
|
+
INVALID_REQUEST_ERROR = "INVALID_REQUEST_ERROR"
|
|
2707
2725
|
}
|
|
2708
2726
|
/**
|
|
2709
2727
|
* Custom error class for MCP-related errors
|
|
@@ -2713,12 +2731,17 @@ declare class McpError extends Error {
|
|
|
2713
2731
|
originalError?: Error;
|
|
2714
2732
|
constructor(message: string, type: McpErrorType, originalError?: Error);
|
|
2715
2733
|
}
|
|
2734
|
+
type SamplingRequest = z.infer<typeof CreateMessageRequestSchema>;
|
|
2735
|
+
type SamplingResponse = z.infer<typeof CreateMessageResultSchema>;
|
|
2736
|
+
type SamplingHandler = (request: SamplingRequest) => Promise<SamplingResponse>;
|
|
2716
2737
|
|
|
2717
2738
|
declare class McpClientService {
|
|
2718
2739
|
private config;
|
|
2719
2740
|
private client;
|
|
2720
2741
|
private transport;
|
|
2721
2742
|
private isClosing;
|
|
2743
|
+
private samplingHandler;
|
|
2744
|
+
private logger;
|
|
2722
2745
|
constructor(config: McpConfig);
|
|
2723
2746
|
/**
|
|
2724
2747
|
* Initializes and returns an MCP client based on configuration.
|
|
@@ -2753,6 +2776,9 @@ declare class McpClientService {
|
|
|
2753
2776
|
* Checks if the client is currently connected
|
|
2754
2777
|
*/
|
|
2755
2778
|
isConnected(): boolean;
|
|
2779
|
+
private setupSamplingHandler;
|
|
2780
|
+
setSamplingHandler(handler: SamplingHandler): void;
|
|
2781
|
+
removeSamplingHandler(): void;
|
|
2756
2782
|
}
|
|
2757
2783
|
|
|
2758
2784
|
/**
|
|
@@ -2860,6 +2886,9 @@ declare const index$2_McpErrorType: typeof McpErrorType;
|
|
|
2860
2886
|
type index$2_McpToolset = McpToolset;
|
|
2861
2887
|
declare const index$2_McpToolset: typeof McpToolset;
|
|
2862
2888
|
type index$2_McpTransportType = McpTransportType;
|
|
2889
|
+
type index$2_SamplingHandler = SamplingHandler;
|
|
2890
|
+
type index$2_SamplingRequest = SamplingRequest;
|
|
2891
|
+
type index$2_SamplingResponse = SamplingResponse;
|
|
2863
2892
|
type index$2_ToolConfig = ToolConfig;
|
|
2864
2893
|
type index$2_ToolContext = ToolContext;
|
|
2865
2894
|
declare const index$2_ToolContext: typeof ToolContext;
|
|
@@ -2875,7 +2904,7 @@ declare const index$2_jsonSchemaToDeclaration: typeof jsonSchemaToDeclaration;
|
|
|
2875
2904
|
declare const index$2_mcpSchemaToParameters: typeof mcpSchemaToParameters;
|
|
2876
2905
|
declare const index$2_normalizeJsonSchema: typeof normalizeJsonSchema;
|
|
2877
2906
|
declare namespace index$2 {
|
|
2878
|
-
export { index$2_BaseTool as BaseTool, type index$2_BuildFunctionDeclarationOptions as BuildFunctionDeclarationOptions, index$2_ExitLoopTool as ExitLoopTool, index$2_FileOperationsTool as FileOperationsTool, index$2_FunctionTool as FunctionTool, index$2_GetUserChoiceTool as GetUserChoiceTool, index$2_GoogleSearch as GoogleSearch, index$2_HttpRequestTool as HttpRequestTool, type index$2_IToolContext as IToolContext, index$2_LoadMemoryTool as LoadMemoryTool, type index$2_McpConfig as McpConfig, index$2_McpError as McpError, index$2_McpErrorType as McpErrorType, index$2_McpToolset as McpToolset, type index$2_McpTransportType as McpTransportType, type index$2_ToolConfig as ToolConfig, index$2_ToolContext as ToolContext, index$2_TransferToAgentTool as TransferToAgentTool, index$2_UserInteractionTool as UserInteractionTool, index$2_adkToMcpToolType as adkToMcpToolType, index$2_buildFunctionDeclaration as buildFunctionDeclaration, index$2_createFunctionTool as createFunctionTool, index$2_getMcpTools as getMcpTools, index$2_jsonSchemaToDeclaration as jsonSchemaToDeclaration, index$2_mcpSchemaToParameters as mcpSchemaToParameters, index$2_normalizeJsonSchema as normalizeJsonSchema };
|
|
2907
|
+
export { index$2_BaseTool as BaseTool, type index$2_BuildFunctionDeclarationOptions as BuildFunctionDeclarationOptions, index$2_ExitLoopTool as ExitLoopTool, index$2_FileOperationsTool as FileOperationsTool, index$2_FunctionTool as FunctionTool, index$2_GetUserChoiceTool as GetUserChoiceTool, index$2_GoogleSearch as GoogleSearch, index$2_HttpRequestTool as HttpRequestTool, type index$2_IToolContext as IToolContext, index$2_LoadMemoryTool as LoadMemoryTool, type index$2_McpConfig as McpConfig, index$2_McpError as McpError, index$2_McpErrorType as McpErrorType, index$2_McpToolset as McpToolset, type index$2_McpTransportType as McpTransportType, type index$2_SamplingHandler as SamplingHandler, type index$2_SamplingRequest as SamplingRequest, type index$2_SamplingResponse as SamplingResponse, type index$2_ToolConfig as ToolConfig, index$2_ToolContext as ToolContext, index$2_TransferToAgentTool as TransferToAgentTool, index$2_UserInteractionTool as UserInteractionTool, index$2_adkToMcpToolType as adkToMcpToolType, index$2_buildFunctionDeclaration as buildFunctionDeclaration, index$2_createFunctionTool as createFunctionTool, index$2_getMcpTools as getMcpTools, index$2_jsonSchemaToDeclaration as jsonSchemaToDeclaration, index$2_mcpSchemaToParameters as mcpSchemaToParameters, index$2_normalizeJsonSchema as normalizeJsonSchema };
|
|
2879
2908
|
}
|
|
2880
2909
|
|
|
2881
2910
|
/**
|
|
@@ -2954,6 +2983,7 @@ declare class PersistentMemoryService implements BaseMemoryService {
|
|
|
2954
2983
|
* File prefix for memory files
|
|
2955
2984
|
*/
|
|
2956
2985
|
private filePrefix;
|
|
2986
|
+
private logger;
|
|
2957
2987
|
/**
|
|
2958
2988
|
* Constructor for PersistentMemoryService
|
|
2959
2989
|
*/
|
|
@@ -3079,7 +3109,7 @@ declare class InMemorySessionService implements SessionService {
|
|
|
3079
3109
|
appendEvent(session: Session, event: Event): Promise<Event>;
|
|
3080
3110
|
}
|
|
3081
3111
|
|
|
3082
|
-
declare const sessionsSchema
|
|
3112
|
+
declare const sessionsSchema: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
3083
3113
|
name: "sessions";
|
|
3084
3114
|
schema: undefined;
|
|
3085
3115
|
columns: {
|
|
@@ -3215,7 +3245,7 @@ declare const sessionsSchema$1: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3215
3245
|
};
|
|
3216
3246
|
dialect: "pg";
|
|
3217
3247
|
}>;
|
|
3218
|
-
type SessionsTable = typeof sessionsSchema
|
|
3248
|
+
type SessionsTable = typeof sessionsSchema;
|
|
3219
3249
|
/**
|
|
3220
3250
|
* Configuration for DatabaseSessionService with Drizzle
|
|
3221
3251
|
*/
|
|
@@ -3251,142 +3281,6 @@ declare class PostgresSessionService implements SessionService {
|
|
|
3251
3281
|
appendEvent(session: Session, event: Event): Promise<Event>;
|
|
3252
3282
|
}
|
|
3253
3283
|
|
|
3254
|
-
declare const sessionsSchema: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
3255
|
-
name: "sessions";
|
|
3256
|
-
schema: undefined;
|
|
3257
|
-
columns: {
|
|
3258
|
-
id: drizzle_orm_pg_core.PgColumn<{
|
|
3259
|
-
name: "id";
|
|
3260
|
-
tableName: "sessions";
|
|
3261
|
-
dataType: "string";
|
|
3262
|
-
columnType: "PgVarchar";
|
|
3263
|
-
data: string;
|
|
3264
|
-
driverParam: string;
|
|
3265
|
-
notNull: true;
|
|
3266
|
-
hasDefault: false;
|
|
3267
|
-
isPrimaryKey: true;
|
|
3268
|
-
isAutoincrement: false;
|
|
3269
|
-
hasRuntimeDefault: false;
|
|
3270
|
-
enumValues: [string, ...string[]];
|
|
3271
|
-
baseColumn: never;
|
|
3272
|
-
identity: undefined;
|
|
3273
|
-
generated: undefined;
|
|
3274
|
-
}, {}, {
|
|
3275
|
-
length: 255;
|
|
3276
|
-
}>;
|
|
3277
|
-
userId: drizzle_orm_pg_core.PgColumn<{
|
|
3278
|
-
name: "user_id";
|
|
3279
|
-
tableName: "sessions";
|
|
3280
|
-
dataType: "string";
|
|
3281
|
-
columnType: "PgVarchar";
|
|
3282
|
-
data: string;
|
|
3283
|
-
driverParam: string;
|
|
3284
|
-
notNull: true;
|
|
3285
|
-
hasDefault: false;
|
|
3286
|
-
isPrimaryKey: false;
|
|
3287
|
-
isAutoincrement: false;
|
|
3288
|
-
hasRuntimeDefault: false;
|
|
3289
|
-
enumValues: [string, ...string[]];
|
|
3290
|
-
baseColumn: never;
|
|
3291
|
-
identity: undefined;
|
|
3292
|
-
generated: undefined;
|
|
3293
|
-
}, {}, {
|
|
3294
|
-
length: 255;
|
|
3295
|
-
}>;
|
|
3296
|
-
messages: drizzle_orm_pg_core.PgColumn<{
|
|
3297
|
-
name: "messages";
|
|
3298
|
-
tableName: "sessions";
|
|
3299
|
-
dataType: "json";
|
|
3300
|
-
columnType: "PgJsonb";
|
|
3301
|
-
data: Message[];
|
|
3302
|
-
driverParam: unknown;
|
|
3303
|
-
notNull: false;
|
|
3304
|
-
hasDefault: true;
|
|
3305
|
-
isPrimaryKey: false;
|
|
3306
|
-
isAutoincrement: false;
|
|
3307
|
-
hasRuntimeDefault: false;
|
|
3308
|
-
enumValues: undefined;
|
|
3309
|
-
baseColumn: never;
|
|
3310
|
-
identity: undefined;
|
|
3311
|
-
generated: undefined;
|
|
3312
|
-
}, {}, {
|
|
3313
|
-
$type: Message[];
|
|
3314
|
-
}>;
|
|
3315
|
-
metadata: drizzle_orm_pg_core.PgColumn<{
|
|
3316
|
-
name: "metadata";
|
|
3317
|
-
tableName: "sessions";
|
|
3318
|
-
dataType: "json";
|
|
3319
|
-
columnType: "PgJsonb";
|
|
3320
|
-
data: Record<string, any>;
|
|
3321
|
-
driverParam: unknown;
|
|
3322
|
-
notNull: false;
|
|
3323
|
-
hasDefault: true;
|
|
3324
|
-
isPrimaryKey: false;
|
|
3325
|
-
isAutoincrement: false;
|
|
3326
|
-
hasRuntimeDefault: false;
|
|
3327
|
-
enumValues: undefined;
|
|
3328
|
-
baseColumn: never;
|
|
3329
|
-
identity: undefined;
|
|
3330
|
-
generated: undefined;
|
|
3331
|
-
}, {}, {
|
|
3332
|
-
$type: Record<string, any>;
|
|
3333
|
-
}>;
|
|
3334
|
-
createdAt: drizzle_orm_pg_core.PgColumn<{
|
|
3335
|
-
name: "created_at";
|
|
3336
|
-
tableName: "sessions";
|
|
3337
|
-
dataType: "date";
|
|
3338
|
-
columnType: "PgTimestamp";
|
|
3339
|
-
data: Date;
|
|
3340
|
-
driverParam: string;
|
|
3341
|
-
notNull: true;
|
|
3342
|
-
hasDefault: true;
|
|
3343
|
-
isPrimaryKey: false;
|
|
3344
|
-
isAutoincrement: false;
|
|
3345
|
-
hasRuntimeDefault: false;
|
|
3346
|
-
enumValues: undefined;
|
|
3347
|
-
baseColumn: never;
|
|
3348
|
-
identity: undefined;
|
|
3349
|
-
generated: undefined;
|
|
3350
|
-
}, {}, {}>;
|
|
3351
|
-
updatedAt: drizzle_orm_pg_core.PgColumn<{
|
|
3352
|
-
name: "updated_at";
|
|
3353
|
-
tableName: "sessions";
|
|
3354
|
-
dataType: "date";
|
|
3355
|
-
columnType: "PgTimestamp";
|
|
3356
|
-
data: Date;
|
|
3357
|
-
driverParam: string;
|
|
3358
|
-
notNull: true;
|
|
3359
|
-
hasDefault: true;
|
|
3360
|
-
isPrimaryKey: false;
|
|
3361
|
-
isAutoincrement: false;
|
|
3362
|
-
hasRuntimeDefault: false;
|
|
3363
|
-
enumValues: undefined;
|
|
3364
|
-
baseColumn: never;
|
|
3365
|
-
identity: undefined;
|
|
3366
|
-
generated: undefined;
|
|
3367
|
-
}, {}, {}>;
|
|
3368
|
-
state: drizzle_orm_pg_core.PgColumn<{
|
|
3369
|
-
name: "state";
|
|
3370
|
-
tableName: "sessions";
|
|
3371
|
-
dataType: "json";
|
|
3372
|
-
columnType: "PgJsonb";
|
|
3373
|
-
data: Record<string, any>;
|
|
3374
|
-
driverParam: unknown;
|
|
3375
|
-
notNull: false;
|
|
3376
|
-
hasDefault: true;
|
|
3377
|
-
isPrimaryKey: false;
|
|
3378
|
-
isAutoincrement: false;
|
|
3379
|
-
hasRuntimeDefault: false;
|
|
3380
|
-
enumValues: undefined;
|
|
3381
|
-
baseColumn: never;
|
|
3382
|
-
identity: undefined;
|
|
3383
|
-
generated: undefined;
|
|
3384
|
-
}, {}, {
|
|
3385
|
-
$type: Record<string, any>;
|
|
3386
|
-
}>;
|
|
3387
|
-
};
|
|
3388
|
-
dialect: "pg";
|
|
3389
|
-
}>;
|
|
3390
3284
|
/**
|
|
3391
3285
|
* Configuration for PgLiteSessionService
|
|
3392
3286
|
*/
|
|
@@ -3423,6 +3317,43 @@ declare class PgLiteSessionService implements SessionService {
|
|
|
3423
3317
|
appendEvent(session: Session, event: Event): Promise<Event>;
|
|
3424
3318
|
}
|
|
3425
3319
|
|
|
3320
|
+
/**
|
|
3321
|
+
* Configuration for SqliteSessionService
|
|
3322
|
+
*/
|
|
3323
|
+
interface SqliteSessionServiceConfig {
|
|
3324
|
+
/**
|
|
3325
|
+
* An initialized better-sqlite3 Database instance.
|
|
3326
|
+
* The service will handle all Drizzle ORM setup internally.
|
|
3327
|
+
*/
|
|
3328
|
+
sqlite: Database.Database;
|
|
3329
|
+
/**
|
|
3330
|
+
* Optional: Skip automatic table creation if you handle migrations externally
|
|
3331
|
+
*/
|
|
3332
|
+
skipTableCreation?: boolean;
|
|
3333
|
+
}
|
|
3334
|
+
declare class SqliteSessionService implements SessionService {
|
|
3335
|
+
private db;
|
|
3336
|
+
private sessionsTable;
|
|
3337
|
+
private initialized;
|
|
3338
|
+
private sqliteInstance;
|
|
3339
|
+
constructor(config: SqliteSessionServiceConfig);
|
|
3340
|
+
/**
|
|
3341
|
+
* Initialize the database by creating required tables if they don't exist
|
|
3342
|
+
*/
|
|
3343
|
+
private initializeDatabase;
|
|
3344
|
+
/**
|
|
3345
|
+
* Ensure database is initialized before any operation
|
|
3346
|
+
*/
|
|
3347
|
+
private ensureInitialized;
|
|
3348
|
+
private generateSessionId;
|
|
3349
|
+
createSession(userId: string, metadata?: Record<string, any>): Promise<Session>;
|
|
3350
|
+
getSession(sessionId: string): Promise<Session | undefined>;
|
|
3351
|
+
updateSession(session: Session): Promise<void>;
|
|
3352
|
+
listSessions(userId: string, options?: ListSessionOptions): Promise<Session[]>;
|
|
3353
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
3354
|
+
appendEvent(session: Session, event: Event): Promise<Event>;
|
|
3355
|
+
}
|
|
3356
|
+
|
|
3426
3357
|
/**
|
|
3427
3358
|
* Utility functions for working with sessions
|
|
3428
3359
|
*/
|
|
@@ -3460,12 +3391,13 @@ type index_Session = Session;
|
|
|
3460
3391
|
type index_SessionService = SessionService;
|
|
3461
3392
|
type index_SessionState = SessionState;
|
|
3462
3393
|
declare const index_SessionState: typeof SessionState;
|
|
3394
|
+
type index_SqliteSessionService = SqliteSessionService;
|
|
3395
|
+
declare const index_SqliteSessionService: typeof SqliteSessionService;
|
|
3463
3396
|
declare const index_cloneSession: typeof cloneSession;
|
|
3464
3397
|
declare const index_generateSessionId: typeof generateSessionId;
|
|
3465
|
-
declare const index_sessionsSchema: typeof sessionsSchema;
|
|
3466
3398
|
declare const index_validateSession: typeof validateSession;
|
|
3467
3399
|
declare namespace index {
|
|
3468
|
-
export { index_InMemorySessionService as InMemorySessionService, type index_ListSessionOptions as ListSessionOptions, index_PgLiteSessionService as PgLiteSessionService, index_PostgresSessionService as PostgresSessionService, type index_Session as Session, type index_SessionService as SessionService, index_SessionState as SessionState,
|
|
3400
|
+
export { index_InMemorySessionService as InMemorySessionService, type index_ListSessionOptions as ListSessionOptions, index_PgLiteSessionService as PgLiteSessionService, index_PostgresSessionService as PostgresSessionService, type index_Session as Session, type index_SessionService as SessionService, index_SessionState as SessionState, index_SqliteSessionService as SqliteSessionService, index_cloneSession as cloneSession, index_generateSessionId as generateSessionId, index_validateSession as validateSession };
|
|
3469
3401
|
}
|
|
3470
3402
|
|
|
3471
3403
|
/**
|
|
@@ -3531,4 +3463,4 @@ declare class InMemoryRunner extends Runner {
|
|
|
3531
3463
|
|
|
3532
3464
|
declare const VERSION = "0.1.0";
|
|
3533
3465
|
|
|
3534
|
-
export { Agent, type AgentConfig, index$3 as Agents, AnthropicLLM, type AnthropicLLMConfig, AnthropicLLMConnection, ApiKeyCredential, ApiKeyScheme, type AudioTranscriptionConfig, AuthConfig, AuthCredential, AuthCredentialType, AuthHandler, AuthScheme, AuthSchemeType, BaseAgent, BaseLLM, BaseLLMConnection, type BaseMemoryService, BaseTool, BasicAuthCredential, BearerTokenCredential, type BuildFunctionDeclarationOptions, ExitLoopTool, FileOperationsTool, type FunctionCall, type FunctionDeclaration, FunctionTool, GetUserChoiceTool, GoogleLLM, type GoogleLLMConfig, GoogleSearch, HttpRequestTool, HttpScheme, type IToolContext, type ImageContent, InMemoryMemoryService, InMemoryRunner, InMemorySessionService, InvocationContext, type JSONSchema, LLMRegistry, LLMRequest, type LLMRequestConfig, LLMResponse, LangGraphAgent, type LangGraphAgentConfig, type LangGraphNode, type ListSessionOptions, LoadMemoryTool, LoopAgent, type LoopAgentConfig, type McpConfig, McpError, McpErrorType, McpToolset, type McpTransportType, index$1 as Memory, type MemoryResult, type Message, type MessageContent, type MessageRole, index$4 as Models, OAuth2Credential, OAuth2Scheme, type OAuthFlow, type OAuthFlows, OpenAILLM, type OpenAILLMConfig, OpenAILLMConnection, OpenIdConnectScheme, ParallelAgent, type ParallelAgentConfig, PersistentMemoryService, PgLiteSessionService, PostgresSessionService, RunConfig, Runner, type SearchMemoryOptions, type SearchMemoryResponse, SequentialAgent, type SequentialAgentConfig, type Session, type SessionService, SessionState, index as Sessions, type SpeechConfig, StreamingMode, type TextContent, type ToolCall, type ToolConfig, ToolContext, index$2 as Tools, TransferToAgentTool, UserInteractionTool, VERSION, adkToMcpToolType, buildFunctionDeclaration, cloneSession, createFunctionTool, generateSessionId, getMcpTools, jsonSchemaToDeclaration, mcpSchemaToParameters, normalizeJsonSchema, registerProviders,
|
|
3466
|
+
export { Agent, type AgentConfig, index$3 as Agents, AnthropicLLM, type AnthropicLLMConfig, AnthropicLLMConnection, ApiKeyCredential, ApiKeyScheme, type AudioTranscriptionConfig, AuthConfig, AuthCredential, AuthCredentialType, AuthHandler, AuthScheme, AuthSchemeType, BaseAgent, BaseLLM, BaseLLMConnection, type BaseMemoryService, BaseTool, BasicAuthCredential, BearerTokenCredential, type BuildFunctionDeclarationOptions, ExitLoopTool, FileOperationsTool, type FunctionCall, type FunctionDeclaration, FunctionTool, GetUserChoiceTool, GoogleLLM, type GoogleLLMConfig, GoogleSearch, HttpRequestTool, HttpScheme, type IToolContext, type ImageContent, InMemoryMemoryService, InMemoryRunner, InMemorySessionService, InvocationContext, type JSONSchema, LLMRegistry, LLMRequest, type LLMRequestConfig, LLMResponse, LangGraphAgent, type LangGraphAgentConfig, type LangGraphNode, type ListSessionOptions, LoadMemoryTool, LoopAgent, type LoopAgentConfig, type McpConfig, McpError, McpErrorType, McpToolset, type McpTransportType, index$1 as Memory, type MemoryResult, type Message, type MessageContent, type MessageRole, index$4 as Models, OAuth2Credential, OAuth2Scheme, type OAuthFlow, type OAuthFlows, OpenAILLM, type OpenAILLMConfig, OpenAILLMConnection, OpenIdConnectScheme, ParallelAgent, type ParallelAgentConfig, PersistentMemoryService, PgLiteSessionService, PostgresSessionService, RunConfig, Runner, type SamplingHandler, type SamplingRequest, type SamplingResponse, type SearchMemoryOptions, type SearchMemoryResponse, SequentialAgent, type SequentialAgentConfig, type Session, type SessionService, SessionState, index as Sessions, type SpeechConfig, SqliteSessionService, StreamingMode, type TextContent, type ToolCall, type ToolConfig, ToolContext, index$2 as Tools, TransferToAgentTool, UserInteractionTool, VERSION, adkToMcpToolType, buildFunctionDeclaration, cloneSession, createFunctionTool, generateSessionId, getMcpTools, jsonSchemaToDeclaration, mcpSchemaToParameters, normalizeJsonSchema, registerProviders, validateSession };
|