@iqai/adk 0.0.5 → 0.0.6
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 +6 -0
- package/dist/index.d.mts +44 -141
- package/dist/index.d.ts +44 -141
- package/dist/index.js +510 -432
- package/dist/index.mjs +415 -337
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -5,6 +5,7 @@ import OpenAI from 'openai';
|
|
|
5
5
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
6
6
|
import { NodePgDatabase } from 'drizzle-orm/node-postgres';
|
|
7
7
|
import { PGlite } from '@electric-sql/pglite';
|
|
8
|
+
import Database from 'better-sqlite3';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Function call result from LLM
|
|
@@ -3079,7 +3080,7 @@ declare class InMemorySessionService implements SessionService {
|
|
|
3079
3080
|
appendEvent(session: Session, event: Event): Promise<Event>;
|
|
3080
3081
|
}
|
|
3081
3082
|
|
|
3082
|
-
declare const sessionsSchema
|
|
3083
|
+
declare const sessionsSchema: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
3083
3084
|
name: "sessions";
|
|
3084
3085
|
schema: undefined;
|
|
3085
3086
|
columns: {
|
|
@@ -3215,7 +3216,7 @@ declare const sessionsSchema$1: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3215
3216
|
};
|
|
3216
3217
|
dialect: "pg";
|
|
3217
3218
|
}>;
|
|
3218
|
-
type SessionsTable = typeof sessionsSchema
|
|
3219
|
+
type SessionsTable = typeof sessionsSchema;
|
|
3219
3220
|
/**
|
|
3220
3221
|
* Configuration for DatabaseSessionService with Drizzle
|
|
3221
3222
|
*/
|
|
@@ -3251,142 +3252,6 @@ declare class PostgresSessionService implements SessionService {
|
|
|
3251
3252
|
appendEvent(session: Session, event: Event): Promise<Event>;
|
|
3252
3253
|
}
|
|
3253
3254
|
|
|
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
3255
|
/**
|
|
3391
3256
|
* Configuration for PgLiteSessionService
|
|
3392
3257
|
*/
|
|
@@ -3423,6 +3288,43 @@ declare class PgLiteSessionService implements SessionService {
|
|
|
3423
3288
|
appendEvent(session: Session, event: Event): Promise<Event>;
|
|
3424
3289
|
}
|
|
3425
3290
|
|
|
3291
|
+
/**
|
|
3292
|
+
* Configuration for SqliteSessionService
|
|
3293
|
+
*/
|
|
3294
|
+
interface SqliteSessionServiceConfig {
|
|
3295
|
+
/**
|
|
3296
|
+
* An initialized better-sqlite3 Database instance.
|
|
3297
|
+
* The service will handle all Drizzle ORM setup internally.
|
|
3298
|
+
*/
|
|
3299
|
+
sqlite: Database.Database;
|
|
3300
|
+
/**
|
|
3301
|
+
* Optional: Skip automatic table creation if you handle migrations externally
|
|
3302
|
+
*/
|
|
3303
|
+
skipTableCreation?: boolean;
|
|
3304
|
+
}
|
|
3305
|
+
declare class SqliteSessionService implements SessionService {
|
|
3306
|
+
private db;
|
|
3307
|
+
private sessionsTable;
|
|
3308
|
+
private initialized;
|
|
3309
|
+
private sqliteInstance;
|
|
3310
|
+
constructor(config: SqliteSessionServiceConfig);
|
|
3311
|
+
/**
|
|
3312
|
+
* Initialize the database by creating required tables if they don't exist
|
|
3313
|
+
*/
|
|
3314
|
+
private initializeDatabase;
|
|
3315
|
+
/**
|
|
3316
|
+
* Ensure database is initialized before any operation
|
|
3317
|
+
*/
|
|
3318
|
+
private ensureInitialized;
|
|
3319
|
+
private generateSessionId;
|
|
3320
|
+
createSession(userId: string, metadata?: Record<string, any>): Promise<Session>;
|
|
3321
|
+
getSession(sessionId: string): Promise<Session | undefined>;
|
|
3322
|
+
updateSession(session: Session): Promise<void>;
|
|
3323
|
+
listSessions(userId: string, options?: ListSessionOptions): Promise<Session[]>;
|
|
3324
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
3325
|
+
appendEvent(session: Session, event: Event): Promise<Event>;
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3426
3328
|
/**
|
|
3427
3329
|
* Utility functions for working with sessions
|
|
3428
3330
|
*/
|
|
@@ -3460,12 +3362,13 @@ type index_Session = Session;
|
|
|
3460
3362
|
type index_SessionService = SessionService;
|
|
3461
3363
|
type index_SessionState = SessionState;
|
|
3462
3364
|
declare const index_SessionState: typeof SessionState;
|
|
3365
|
+
type index_SqliteSessionService = SqliteSessionService;
|
|
3366
|
+
declare const index_SqliteSessionService: typeof SqliteSessionService;
|
|
3463
3367
|
declare const index_cloneSession: typeof cloneSession;
|
|
3464
3368
|
declare const index_generateSessionId: typeof generateSessionId;
|
|
3465
|
-
declare const index_sessionsSchema: typeof sessionsSchema;
|
|
3466
3369
|
declare const index_validateSession: typeof validateSession;
|
|
3467
3370
|
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,
|
|
3371
|
+
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
3372
|
}
|
|
3470
3373
|
|
|
3471
3374
|
/**
|
|
@@ -3531,4 +3434,4 @@ declare class InMemoryRunner extends Runner {
|
|
|
3531
3434
|
|
|
3532
3435
|
declare const VERSION = "0.1.0";
|
|
3533
3436
|
|
|
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,
|
|
3437
|
+
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, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import OpenAI from 'openai';
|
|
|
5
5
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
6
6
|
import { NodePgDatabase } from 'drizzle-orm/node-postgres';
|
|
7
7
|
import { PGlite } from '@electric-sql/pglite';
|
|
8
|
+
import Database from 'better-sqlite3';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Function call result from LLM
|
|
@@ -3079,7 +3080,7 @@ declare class InMemorySessionService implements SessionService {
|
|
|
3079
3080
|
appendEvent(session: Session, event: Event): Promise<Event>;
|
|
3080
3081
|
}
|
|
3081
3082
|
|
|
3082
|
-
declare const sessionsSchema
|
|
3083
|
+
declare const sessionsSchema: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
3083
3084
|
name: "sessions";
|
|
3084
3085
|
schema: undefined;
|
|
3085
3086
|
columns: {
|
|
@@ -3215,7 +3216,7 @@ declare const sessionsSchema$1: drizzle_orm_pg_core.PgTableWithColumns<{
|
|
|
3215
3216
|
};
|
|
3216
3217
|
dialect: "pg";
|
|
3217
3218
|
}>;
|
|
3218
|
-
type SessionsTable = typeof sessionsSchema
|
|
3219
|
+
type SessionsTable = typeof sessionsSchema;
|
|
3219
3220
|
/**
|
|
3220
3221
|
* Configuration for DatabaseSessionService with Drizzle
|
|
3221
3222
|
*/
|
|
@@ -3251,142 +3252,6 @@ declare class PostgresSessionService implements SessionService {
|
|
|
3251
3252
|
appendEvent(session: Session, event: Event): Promise<Event>;
|
|
3252
3253
|
}
|
|
3253
3254
|
|
|
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
3255
|
/**
|
|
3391
3256
|
* Configuration for PgLiteSessionService
|
|
3392
3257
|
*/
|
|
@@ -3423,6 +3288,43 @@ declare class PgLiteSessionService implements SessionService {
|
|
|
3423
3288
|
appendEvent(session: Session, event: Event): Promise<Event>;
|
|
3424
3289
|
}
|
|
3425
3290
|
|
|
3291
|
+
/**
|
|
3292
|
+
* Configuration for SqliteSessionService
|
|
3293
|
+
*/
|
|
3294
|
+
interface SqliteSessionServiceConfig {
|
|
3295
|
+
/**
|
|
3296
|
+
* An initialized better-sqlite3 Database instance.
|
|
3297
|
+
* The service will handle all Drizzle ORM setup internally.
|
|
3298
|
+
*/
|
|
3299
|
+
sqlite: Database.Database;
|
|
3300
|
+
/**
|
|
3301
|
+
* Optional: Skip automatic table creation if you handle migrations externally
|
|
3302
|
+
*/
|
|
3303
|
+
skipTableCreation?: boolean;
|
|
3304
|
+
}
|
|
3305
|
+
declare class SqliteSessionService implements SessionService {
|
|
3306
|
+
private db;
|
|
3307
|
+
private sessionsTable;
|
|
3308
|
+
private initialized;
|
|
3309
|
+
private sqliteInstance;
|
|
3310
|
+
constructor(config: SqliteSessionServiceConfig);
|
|
3311
|
+
/**
|
|
3312
|
+
* Initialize the database by creating required tables if they don't exist
|
|
3313
|
+
*/
|
|
3314
|
+
private initializeDatabase;
|
|
3315
|
+
/**
|
|
3316
|
+
* Ensure database is initialized before any operation
|
|
3317
|
+
*/
|
|
3318
|
+
private ensureInitialized;
|
|
3319
|
+
private generateSessionId;
|
|
3320
|
+
createSession(userId: string, metadata?: Record<string, any>): Promise<Session>;
|
|
3321
|
+
getSession(sessionId: string): Promise<Session | undefined>;
|
|
3322
|
+
updateSession(session: Session): Promise<void>;
|
|
3323
|
+
listSessions(userId: string, options?: ListSessionOptions): Promise<Session[]>;
|
|
3324
|
+
deleteSession(sessionId: string): Promise<void>;
|
|
3325
|
+
appendEvent(session: Session, event: Event): Promise<Event>;
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3426
3328
|
/**
|
|
3427
3329
|
* Utility functions for working with sessions
|
|
3428
3330
|
*/
|
|
@@ -3460,12 +3362,13 @@ type index_Session = Session;
|
|
|
3460
3362
|
type index_SessionService = SessionService;
|
|
3461
3363
|
type index_SessionState = SessionState;
|
|
3462
3364
|
declare const index_SessionState: typeof SessionState;
|
|
3365
|
+
type index_SqliteSessionService = SqliteSessionService;
|
|
3366
|
+
declare const index_SqliteSessionService: typeof SqliteSessionService;
|
|
3463
3367
|
declare const index_cloneSession: typeof cloneSession;
|
|
3464
3368
|
declare const index_generateSessionId: typeof generateSessionId;
|
|
3465
|
-
declare const index_sessionsSchema: typeof sessionsSchema;
|
|
3466
3369
|
declare const index_validateSession: typeof validateSession;
|
|
3467
3370
|
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,
|
|
3371
|
+
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
3372
|
}
|
|
3470
3373
|
|
|
3471
3374
|
/**
|
|
@@ -3531,4 +3434,4 @@ declare class InMemoryRunner extends Runner {
|
|
|
3531
3434
|
|
|
3532
3435
|
declare const VERSION = "0.1.0";
|
|
3533
3436
|
|
|
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,
|
|
3437
|
+
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, 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 };
|