@dudousxd/nestjs-agent-store-drizzle 0.20.2 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +178 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +356 -3
- package/dist/index.d.ts +356 -3
- package/dist/index.js +165 -12
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
2
2
|
import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
|
|
3
|
-
import { MessageRole, ToolCallRequest, ToolResult, MessageAttachment, MessageUsage, AgentUiComponent, MessageFeedback, Actor, PageContext, QueuePause, ToolKind, ToolCallStatus, UsagePurpose, AgentStore, ThreadTurnReader, ChatQueueStore, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, ToolCallApprovalState, EnqueueMessageInput, QueuedMessage, QueuedMessagePatch, UpdateThreadInput, RecordRunStartInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, ToolCallOutcome, RecordUsageInput, AgentGovernanceQueries, AgentPricingStore, GovernanceRange, ModelSpendRow, ActorSpendRow, ThreadSpendRow, UsageTrendPoint, ToolCallActivityRow, ThreadActivityRow, RunMetrics, RunAgentBreakdownRow, RunErrorBreakdownRow, RunTrendPoint, RecentRunRow, PendingApprovalRow, ToolStatRow, GovernancePageQuery, ToolCallWhere, GovernancePage, ThreadWhere, RunWhere, ApprovalWhere, GovernanceRunDetail, GovernanceThreadDetailQuery, GovernanceThreadDetail, MemoryProvider, ListMemoriesInput, MemoryRecord, ForgetMemoryInput, StoreMemoryInput, ModelPriceInput, CurrentModelPrice } from '@dudousxd/nestjs-agent-core';
|
|
3
|
+
import { MessageRole, ToolCallRequest, ToolResult, MessageAttachment, MessageUsage, AgentUiComponent, MessageFeedback, Actor, PageContext, QueuePause, ToolKind, ToolCallStatus, UsagePurpose, AgentStore, ThreadTurnReader, ChatQueueStore, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, ToolCallApprovalState, EnqueueMessageInput, QueuedMessage, QueuedMessagePatch, UpdateThreadInput, RecordRunStartInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, ToolCallOutcome, RecordUsageInput, AgentGovernanceQueries, AgentPricingStore, GovernanceRange, ModelSpendRow, ActorSpendRow, ThreadSpendRow, UsageTrendPoint, ToolCallActivityRow, ThreadActivityRow, RunMetrics, RunAgentBreakdownRow, RunErrorBreakdownRow, RunTrendPoint, RecentRunRow, PendingApprovalRow, ToolStatRow, GovernancePageQuery, ToolCallWhere, GovernancePage, ThreadWhere, RunWhere, ApprovalWhere, GovernanceRunDetail, GovernanceThreadDetailQuery, GovernanceThreadDetail, MemoryProvider, ListMemoriesInput, MemoryRecord, ForgetMemoryInput, StoreMemoryInput, ModelPriceInput, CurrentModelPrice, StreamFrameTable, StreamFrameRow, SqlTokenStreamSink, SqlTokenStreamSinkOptions, ConfirmTokenStore, ConfirmTokenClaim } from '@dudousxd/nestjs-agent-core';
|
|
4
4
|
export { ThreadTurnPage, ThreadTurnQuery } from '@dudousxd/nestjs-agent-core';
|
|
5
5
|
import { TablesRelationalConfig, SQL } from 'drizzle-orm';
|
|
6
6
|
import { OnModuleInit, OnModuleDestroy, Type, DynamicModule } from '@nestjs/common';
|
|
@@ -2243,6 +2243,213 @@ declare const ragIngestionLog: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
2243
2243
|
};
|
|
2244
2244
|
dialect: "sqlite";
|
|
2245
2245
|
}>;
|
|
2246
|
+
/**
|
|
2247
|
+
* Spent confirm tokens (`defineConfirmedTool`), one row per token, keyed by its SHA-256 — the
|
|
2248
|
+
* primary key is the lock that makes a confirmation single use across replicas. Only the hash, the
|
|
2249
|
+
* actor and the tool are kept, never an argument. `expires_at` is epoch-ms; past it the row is dead
|
|
2250
|
+
* weight for `DrizzleConfirmTokenStore.purgeExpired`.
|
|
2251
|
+
*/
|
|
2252
|
+
declare const agentConfirmToken: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
2253
|
+
name: "agent_confirm_token";
|
|
2254
|
+
schema: undefined;
|
|
2255
|
+
columns: {
|
|
2256
|
+
hash: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2257
|
+
name: "hash";
|
|
2258
|
+
tableName: "agent_confirm_token";
|
|
2259
|
+
dataType: "string";
|
|
2260
|
+
columnType: "SQLiteText";
|
|
2261
|
+
data: string;
|
|
2262
|
+
driverParam: string;
|
|
2263
|
+
notNull: true;
|
|
2264
|
+
hasDefault: false;
|
|
2265
|
+
isPrimaryKey: true;
|
|
2266
|
+
isAutoincrement: false;
|
|
2267
|
+
hasRuntimeDefault: false;
|
|
2268
|
+
enumValues: [string, ...string[]];
|
|
2269
|
+
baseColumn: never;
|
|
2270
|
+
identity: undefined;
|
|
2271
|
+
generated: undefined;
|
|
2272
|
+
}, {}, {
|
|
2273
|
+
length: number | undefined;
|
|
2274
|
+
}>;
|
|
2275
|
+
actorRef: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2276
|
+
name: "actor_ref";
|
|
2277
|
+
tableName: "agent_confirm_token";
|
|
2278
|
+
dataType: "string";
|
|
2279
|
+
columnType: "SQLiteText";
|
|
2280
|
+
data: string;
|
|
2281
|
+
driverParam: string;
|
|
2282
|
+
notNull: true;
|
|
2283
|
+
hasDefault: false;
|
|
2284
|
+
isPrimaryKey: false;
|
|
2285
|
+
isAutoincrement: false;
|
|
2286
|
+
hasRuntimeDefault: false;
|
|
2287
|
+
enumValues: [string, ...string[]];
|
|
2288
|
+
baseColumn: never;
|
|
2289
|
+
identity: undefined;
|
|
2290
|
+
generated: undefined;
|
|
2291
|
+
}, {}, {
|
|
2292
|
+
length: number | undefined;
|
|
2293
|
+
}>;
|
|
2294
|
+
tool: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2295
|
+
name: "tool";
|
|
2296
|
+
tableName: "agent_confirm_token";
|
|
2297
|
+
dataType: "string";
|
|
2298
|
+
columnType: "SQLiteText";
|
|
2299
|
+
data: string;
|
|
2300
|
+
driverParam: string;
|
|
2301
|
+
notNull: true;
|
|
2302
|
+
hasDefault: false;
|
|
2303
|
+
isPrimaryKey: false;
|
|
2304
|
+
isAutoincrement: false;
|
|
2305
|
+
hasRuntimeDefault: false;
|
|
2306
|
+
enumValues: [string, ...string[]];
|
|
2307
|
+
baseColumn: never;
|
|
2308
|
+
identity: undefined;
|
|
2309
|
+
generated: undefined;
|
|
2310
|
+
}, {}, {
|
|
2311
|
+
length: number | undefined;
|
|
2312
|
+
}>;
|
|
2313
|
+
expiresAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2314
|
+
name: "expires_at";
|
|
2315
|
+
tableName: "agent_confirm_token";
|
|
2316
|
+
dataType: "number";
|
|
2317
|
+
columnType: "SQLiteInteger";
|
|
2318
|
+
data: number;
|
|
2319
|
+
driverParam: number;
|
|
2320
|
+
notNull: true;
|
|
2321
|
+
hasDefault: false;
|
|
2322
|
+
isPrimaryKey: false;
|
|
2323
|
+
isAutoincrement: false;
|
|
2324
|
+
hasRuntimeDefault: false;
|
|
2325
|
+
enumValues: undefined;
|
|
2326
|
+
baseColumn: never;
|
|
2327
|
+
identity: undefined;
|
|
2328
|
+
generated: undefined;
|
|
2329
|
+
}, {}, {}>;
|
|
2330
|
+
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2331
|
+
name: "created_at";
|
|
2332
|
+
tableName: "agent_confirm_token";
|
|
2333
|
+
dataType: "number";
|
|
2334
|
+
columnType: "SQLiteInteger";
|
|
2335
|
+
data: number;
|
|
2336
|
+
driverParam: number;
|
|
2337
|
+
notNull: true;
|
|
2338
|
+
hasDefault: false;
|
|
2339
|
+
isPrimaryKey: false;
|
|
2340
|
+
isAutoincrement: false;
|
|
2341
|
+
hasRuntimeDefault: false;
|
|
2342
|
+
enumValues: undefined;
|
|
2343
|
+
baseColumn: never;
|
|
2344
|
+
identity: undefined;
|
|
2345
|
+
generated: undefined;
|
|
2346
|
+
}, {}, {}>;
|
|
2347
|
+
};
|
|
2348
|
+
dialect: "sqlite";
|
|
2349
|
+
}>;
|
|
2350
|
+
/**
|
|
2351
|
+
* One row per frame of a run's live stream (`DrizzleTokenStreamSink`), numbered per run from 1 with
|
|
2352
|
+
* no gaps. `frame` is one NDJSON line; `null` marks the end, with `error` set when the run failed.
|
|
2353
|
+
* `created_at` (epoch-ms) is what the TTL counts from — a run's LAST row.
|
|
2354
|
+
*/
|
|
2355
|
+
declare const agentStreamFrame: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
2356
|
+
name: "agent_stream_frame";
|
|
2357
|
+
schema: undefined;
|
|
2358
|
+
columns: {
|
|
2359
|
+
runId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2360
|
+
name: "run_id";
|
|
2361
|
+
tableName: "agent_stream_frame";
|
|
2362
|
+
dataType: "string";
|
|
2363
|
+
columnType: "SQLiteText";
|
|
2364
|
+
data: string;
|
|
2365
|
+
driverParam: string;
|
|
2366
|
+
notNull: true;
|
|
2367
|
+
hasDefault: false;
|
|
2368
|
+
isPrimaryKey: false;
|
|
2369
|
+
isAutoincrement: false;
|
|
2370
|
+
hasRuntimeDefault: false;
|
|
2371
|
+
enumValues: [string, ...string[]];
|
|
2372
|
+
baseColumn: never;
|
|
2373
|
+
identity: undefined;
|
|
2374
|
+
generated: undefined;
|
|
2375
|
+
}, {}, {
|
|
2376
|
+
length: number | undefined;
|
|
2377
|
+
}>;
|
|
2378
|
+
seq: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2379
|
+
name: "seq";
|
|
2380
|
+
tableName: "agent_stream_frame";
|
|
2381
|
+
dataType: "number";
|
|
2382
|
+
columnType: "SQLiteInteger";
|
|
2383
|
+
data: number;
|
|
2384
|
+
driverParam: number;
|
|
2385
|
+
notNull: true;
|
|
2386
|
+
hasDefault: false;
|
|
2387
|
+
isPrimaryKey: false;
|
|
2388
|
+
isAutoincrement: false;
|
|
2389
|
+
hasRuntimeDefault: false;
|
|
2390
|
+
enumValues: undefined;
|
|
2391
|
+
baseColumn: never;
|
|
2392
|
+
identity: undefined;
|
|
2393
|
+
generated: undefined;
|
|
2394
|
+
}, {}, {}>;
|
|
2395
|
+
frame: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2396
|
+
name: "frame";
|
|
2397
|
+
tableName: "agent_stream_frame";
|
|
2398
|
+
dataType: "string";
|
|
2399
|
+
columnType: "SQLiteText";
|
|
2400
|
+
data: string;
|
|
2401
|
+
driverParam: string;
|
|
2402
|
+
notNull: false;
|
|
2403
|
+
hasDefault: false;
|
|
2404
|
+
isPrimaryKey: false;
|
|
2405
|
+
isAutoincrement: false;
|
|
2406
|
+
hasRuntimeDefault: false;
|
|
2407
|
+
enumValues: [string, ...string[]];
|
|
2408
|
+
baseColumn: never;
|
|
2409
|
+
identity: undefined;
|
|
2410
|
+
generated: undefined;
|
|
2411
|
+
}, {}, {
|
|
2412
|
+
length: number | undefined;
|
|
2413
|
+
}>;
|
|
2414
|
+
error: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2415
|
+
name: "error";
|
|
2416
|
+
tableName: "agent_stream_frame";
|
|
2417
|
+
dataType: "string";
|
|
2418
|
+
columnType: "SQLiteText";
|
|
2419
|
+
data: string;
|
|
2420
|
+
driverParam: string;
|
|
2421
|
+
notNull: false;
|
|
2422
|
+
hasDefault: false;
|
|
2423
|
+
isPrimaryKey: false;
|
|
2424
|
+
isAutoincrement: false;
|
|
2425
|
+
hasRuntimeDefault: false;
|
|
2426
|
+
enumValues: [string, ...string[]];
|
|
2427
|
+
baseColumn: never;
|
|
2428
|
+
identity: undefined;
|
|
2429
|
+
generated: undefined;
|
|
2430
|
+
}, {}, {
|
|
2431
|
+
length: number | undefined;
|
|
2432
|
+
}>;
|
|
2433
|
+
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2434
|
+
name: "created_at";
|
|
2435
|
+
tableName: "agent_stream_frame";
|
|
2436
|
+
dataType: "number";
|
|
2437
|
+
columnType: "SQLiteInteger";
|
|
2438
|
+
data: number;
|
|
2439
|
+
driverParam: number;
|
|
2440
|
+
notNull: true;
|
|
2441
|
+
hasDefault: false;
|
|
2442
|
+
isPrimaryKey: false;
|
|
2443
|
+
isAutoincrement: false;
|
|
2444
|
+
hasRuntimeDefault: false;
|
|
2445
|
+
enumValues: undefined;
|
|
2446
|
+
baseColumn: never;
|
|
2447
|
+
identity: undefined;
|
|
2448
|
+
generated: undefined;
|
|
2449
|
+
}, {}, {}>;
|
|
2450
|
+
};
|
|
2451
|
+
dialect: "sqlite";
|
|
2452
|
+
}>;
|
|
2246
2453
|
/** The tables this store owns, as one schema object, ready for `drizzle(client, { schema })`. */
|
|
2247
2454
|
declare const agentSchema: {
|
|
2248
2455
|
agentThread: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
@@ -4401,6 +4608,104 @@ declare const agentSchema: {
|
|
|
4401
4608
|
};
|
|
4402
4609
|
dialect: "sqlite";
|
|
4403
4610
|
}>;
|
|
4611
|
+
agentConfirmToken: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
4612
|
+
name: "agent_confirm_token";
|
|
4613
|
+
schema: undefined;
|
|
4614
|
+
columns: {
|
|
4615
|
+
hash: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
4616
|
+
name: "hash";
|
|
4617
|
+
tableName: "agent_confirm_token";
|
|
4618
|
+
dataType: "string";
|
|
4619
|
+
columnType: "SQLiteText";
|
|
4620
|
+
data: string;
|
|
4621
|
+
driverParam: string;
|
|
4622
|
+
notNull: true;
|
|
4623
|
+
hasDefault: false;
|
|
4624
|
+
isPrimaryKey: true;
|
|
4625
|
+
isAutoincrement: false;
|
|
4626
|
+
hasRuntimeDefault: false;
|
|
4627
|
+
enumValues: [string, ...string[]];
|
|
4628
|
+
baseColumn: never;
|
|
4629
|
+
identity: undefined;
|
|
4630
|
+
generated: undefined;
|
|
4631
|
+
}, {}, {
|
|
4632
|
+
length: number | undefined;
|
|
4633
|
+
}>;
|
|
4634
|
+
actorRef: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
4635
|
+
name: "actor_ref";
|
|
4636
|
+
tableName: "agent_confirm_token";
|
|
4637
|
+
dataType: "string";
|
|
4638
|
+
columnType: "SQLiteText";
|
|
4639
|
+
data: string;
|
|
4640
|
+
driverParam: string;
|
|
4641
|
+
notNull: true;
|
|
4642
|
+
hasDefault: false;
|
|
4643
|
+
isPrimaryKey: false;
|
|
4644
|
+
isAutoincrement: false;
|
|
4645
|
+
hasRuntimeDefault: false;
|
|
4646
|
+
enumValues: [string, ...string[]];
|
|
4647
|
+
baseColumn: never;
|
|
4648
|
+
identity: undefined;
|
|
4649
|
+
generated: undefined;
|
|
4650
|
+
}, {}, {
|
|
4651
|
+
length: number | undefined;
|
|
4652
|
+
}>;
|
|
4653
|
+
tool: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
4654
|
+
name: "tool";
|
|
4655
|
+
tableName: "agent_confirm_token";
|
|
4656
|
+
dataType: "string";
|
|
4657
|
+
columnType: "SQLiteText";
|
|
4658
|
+
data: string;
|
|
4659
|
+
driverParam: string;
|
|
4660
|
+
notNull: true;
|
|
4661
|
+
hasDefault: false;
|
|
4662
|
+
isPrimaryKey: false;
|
|
4663
|
+
isAutoincrement: false;
|
|
4664
|
+
hasRuntimeDefault: false;
|
|
4665
|
+
enumValues: [string, ...string[]];
|
|
4666
|
+
baseColumn: never;
|
|
4667
|
+
identity: undefined;
|
|
4668
|
+
generated: undefined;
|
|
4669
|
+
}, {}, {
|
|
4670
|
+
length: number | undefined;
|
|
4671
|
+
}>;
|
|
4672
|
+
expiresAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
4673
|
+
name: "expires_at";
|
|
4674
|
+
tableName: "agent_confirm_token";
|
|
4675
|
+
dataType: "number";
|
|
4676
|
+
columnType: "SQLiteInteger";
|
|
4677
|
+
data: number;
|
|
4678
|
+
driverParam: number;
|
|
4679
|
+
notNull: true;
|
|
4680
|
+
hasDefault: false;
|
|
4681
|
+
isPrimaryKey: false;
|
|
4682
|
+
isAutoincrement: false;
|
|
4683
|
+
hasRuntimeDefault: false;
|
|
4684
|
+
enumValues: undefined;
|
|
4685
|
+
baseColumn: never;
|
|
4686
|
+
identity: undefined;
|
|
4687
|
+
generated: undefined;
|
|
4688
|
+
}, {}, {}>;
|
|
4689
|
+
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
4690
|
+
name: "created_at";
|
|
4691
|
+
tableName: "agent_confirm_token";
|
|
4692
|
+
dataType: "number";
|
|
4693
|
+
columnType: "SQLiteInteger";
|
|
4694
|
+
data: number;
|
|
4695
|
+
driverParam: number;
|
|
4696
|
+
notNull: true;
|
|
4697
|
+
hasDefault: false;
|
|
4698
|
+
isPrimaryKey: false;
|
|
4699
|
+
isAutoincrement: false;
|
|
4700
|
+
hasRuntimeDefault: false;
|
|
4701
|
+
enumValues: undefined;
|
|
4702
|
+
baseColumn: never;
|
|
4703
|
+
identity: undefined;
|
|
4704
|
+
generated: undefined;
|
|
4705
|
+
}, {}, {}>;
|
|
4706
|
+
};
|
|
4707
|
+
dialect: "sqlite";
|
|
4708
|
+
}>;
|
|
4404
4709
|
};
|
|
4405
4710
|
/**
|
|
4406
4711
|
* The dialect-portable Drizzle SQLite database handle the store operates on. Accepts any SQLite
|
|
@@ -4745,6 +5050,53 @@ declare class DrizzlePricingStore implements AgentPricingStore {
|
|
|
4745
5050
|
listCurrentPrices(): Promise<CurrentModelPrice[]>;
|
|
4746
5051
|
}
|
|
4747
5052
|
|
|
5053
|
+
/** {@link StreamFrameTable} over `agent_stream_frame`, through a Drizzle SQLite handle. */
|
|
5054
|
+
declare class DrizzleStreamFrameTable implements StreamFrameTable {
|
|
5055
|
+
private readonly db;
|
|
5056
|
+
constructor(db: AgentDrizzleDb);
|
|
5057
|
+
append(runId: string, row: {
|
|
5058
|
+
frame: string | null;
|
|
5059
|
+
error: string | null;
|
|
5060
|
+
createdAt: number;
|
|
5061
|
+
}): Promise<void>;
|
|
5062
|
+
read(runId: string, after: number, limit: number): Promise<StreamFrameRow[]>;
|
|
5063
|
+
has(runId: string): Promise<boolean>;
|
|
5064
|
+
remove(runIds: readonly string[]): Promise<void>;
|
|
5065
|
+
lapsedRuns(cutoff: number): Promise<string[]>;
|
|
5066
|
+
isUniqueViolation(error: unknown): boolean;
|
|
5067
|
+
}
|
|
5068
|
+
/**
|
|
5069
|
+
* A multi-replica `TokenStreamSink` over the app's Drizzle database — several replicas, no Redis.
|
|
5070
|
+
* Polled, with streamed text coalesced into one row per `flushMs`; see `SqlTokenStreamSink` for the
|
|
5071
|
+
* trade-offs. The `agent_stream_frame` table comes from `ensureAgentSchema` (or your migration).
|
|
5072
|
+
*
|
|
5073
|
+
* ```ts
|
|
5074
|
+
* AgentModule.forRoot({ model, sink: new DrizzleTokenStreamSink(db) });
|
|
5075
|
+
* ```
|
|
5076
|
+
*/
|
|
5077
|
+
declare class DrizzleTokenStreamSink extends SqlTokenStreamSink {
|
|
5078
|
+
constructor(db: AgentDrizzleDb, options?: SqlTokenStreamSinkOptions);
|
|
5079
|
+
}
|
|
5080
|
+
|
|
5081
|
+
/**
|
|
5082
|
+
* A production `ConfirmTokenStore` (`defineConfirmedTool`) over the `agent_confirm_token` table —
|
|
5083
|
+
* what makes a confirmed write single use across replicas.
|
|
5084
|
+
*
|
|
5085
|
+
* `claim` is one `INSERT … ON CONFLICT DO NOTHING RETURNING`, so the primary key is the lock: of two
|
|
5086
|
+
* concurrent confirmations one inserts and the other touches no row. A statement that does not FAIL
|
|
5087
|
+
* on the duplicate, rather than an insert whose violation is caught, so it never aborts a
|
|
5088
|
+
* surrounding transaction. Only the token's SHA-256, the actor and the tool name are stored; call
|
|
5089
|
+
* {@link purgeExpired} from a scheduled job to drop the dead rows. The table comes from
|
|
5090
|
+
* `ensureAgentSchema` (or your own migration).
|
|
5091
|
+
*/
|
|
5092
|
+
declare class DrizzleConfirmTokenStore implements ConfirmTokenStore {
|
|
5093
|
+
private readonly db;
|
|
5094
|
+
constructor(db: AgentDrizzleDb);
|
|
5095
|
+
claim(input: ConfirmTokenClaim): Promise<boolean>;
|
|
5096
|
+
release(hash: string): Promise<void>;
|
|
5097
|
+
purgeExpired(now?: number): Promise<number>;
|
|
5098
|
+
}
|
|
5099
|
+
|
|
4748
5100
|
/**
|
|
4749
5101
|
* The paging order: newest first, tiebroken on the primary key.
|
|
4750
5102
|
*
|
|
@@ -4956,7 +5308,8 @@ interface DrizzleAgentStoreModuleOptions {
|
|
|
4956
5308
|
* Binds {@link DrizzleAgentStore} to the {@link AGENT_STORE} token consumed by
|
|
4957
5309
|
* `@dudousxd/nestjs-agent`, plus {@link DrizzleGovernanceQueries} to
|
|
4958
5310
|
* {@link AGENT_GOVERNANCE_QUERIES} (the read-model the dashboard/telescope surfaces consume) and
|
|
4959
|
-
* {@link DrizzlePricingStore} to {@link AGENT_PRICING_STORE} (the write side of that pricing table)
|
|
5311
|
+
* {@link DrizzlePricingStore} to {@link AGENT_PRICING_STORE} (the write side of that pricing table),
|
|
5312
|
+
* and {@link DrizzleConfirmTokenStore} to {@link AGENT_CONFIRM_TOKEN_STORE} (confirmed writes).
|
|
4960
5313
|
* The host app supplies an already-opened Drizzle db — this module never opens a connection itself.
|
|
4961
5314
|
*
|
|
4962
5315
|
* The returned module is global, so {@link AGENT_STORE}, {@link AGENT_GOVERNANCE_QUERIES} and
|
|
@@ -4973,4 +5326,4 @@ declare class DrizzleAgentStoreModule {
|
|
|
4973
5326
|
static forRoot(options: DrizzleAgentStoreModuleOptions): DynamicModule;
|
|
4974
5327
|
}
|
|
4975
5328
|
|
|
4976
|
-
export { type AgentDrizzleDb, type AgentMemoryRow, type AgentMessageRow, type AgentQueuedMessageRow, type AgentRunRow, type AgentRunStatus, type AgentThreadRow, DrizzleAgentStore, DrizzleAgentStoreModule, type DrizzleAgentStoreModuleOptions, DrizzleGovernanceQueries, DrizzleMemoryProvider, DrizzlePricingStore, DrizzleRagIngestionLog, RAG_INGESTION_LOG_PAGE_ORDER, type RagIngestionLogCursor, type RagIngestionLogIterateOptions, type RagIngestionLogQuery, type RagIngestionLogRow, type RagIngestionLogWhere, type RagIngestionStatus, agentMemory, agentMessage, agentModelPricing, agentQueuedMessage, agentRun, agentSchema, agentThread, agentTokenUsage, agentToolCall, ensureAgentSchema, ragIngestionLog };
|
|
5329
|
+
export { type AgentDrizzleDb, type AgentMemoryRow, type AgentMessageRow, type AgentQueuedMessageRow, type AgentRunRow, type AgentRunStatus, type AgentThreadRow, DrizzleAgentStore, DrizzleAgentStoreModule, type DrizzleAgentStoreModuleOptions, DrizzleConfirmTokenStore, DrizzleGovernanceQueries, DrizzleMemoryProvider, DrizzlePricingStore, DrizzleRagIngestionLog, DrizzleStreamFrameTable, DrizzleTokenStreamSink, RAG_INGESTION_LOG_PAGE_ORDER, type RagIngestionLogCursor, type RagIngestionLogIterateOptions, type RagIngestionLogQuery, type RagIngestionLogRow, type RagIngestionLogWhere, type RagIngestionStatus, agentConfirmToken, agentMemory, agentMessage, agentModelPricing, agentQueuedMessage, agentRun, agentSchema, agentStreamFrame, agentThread, agentTokenUsage, agentToolCall, ensureAgentSchema, ragIngestionLog };
|