@dudousxd/nestjs-agent-store-drizzle 0.10.8 → 0.11.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/README.md +3 -0
- package/dist/index.cjs +40 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +111 -1
- package/dist/index.d.ts +111 -1
- package/dist/index.js +40 -0
- 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, ToolKind, ToolCallStatus, UsagePurpose, AgentStore, ThreadTurnReader, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, UpdateThreadInput, RecordRunStartInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, 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, ToolKind, ToolCallStatus, UsagePurpose, AgentStore, ThreadTurnReader, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, UpdateThreadInput, RecordRunStartInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, 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';
|
|
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';
|
|
@@ -426,6 +426,61 @@ declare const agentMessage: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
426
426
|
}, {}, {
|
|
427
427
|
length: number | undefined;
|
|
428
428
|
}>;
|
|
429
|
+
reasoning: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
430
|
+
name: "reasoning";
|
|
431
|
+
tableName: "agent_message";
|
|
432
|
+
dataType: "string";
|
|
433
|
+
columnType: "SQLiteText";
|
|
434
|
+
data: string;
|
|
435
|
+
driverParam: string;
|
|
436
|
+
notNull: false;
|
|
437
|
+
hasDefault: false;
|
|
438
|
+
isPrimaryKey: false;
|
|
439
|
+
isAutoincrement: false;
|
|
440
|
+
hasRuntimeDefault: false;
|
|
441
|
+
enumValues: [string, ...string[]];
|
|
442
|
+
baseColumn: never;
|
|
443
|
+
identity: undefined;
|
|
444
|
+
generated: undefined;
|
|
445
|
+
}, {}, {
|
|
446
|
+
length: number | undefined;
|
|
447
|
+
}>;
|
|
448
|
+
reasoningMs: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
449
|
+
name: "reasoning_ms";
|
|
450
|
+
tableName: "agent_message";
|
|
451
|
+
dataType: "number";
|
|
452
|
+
columnType: "SQLiteInteger";
|
|
453
|
+
data: number;
|
|
454
|
+
driverParam: number;
|
|
455
|
+
notNull: false;
|
|
456
|
+
hasDefault: false;
|
|
457
|
+
isPrimaryKey: false;
|
|
458
|
+
isAutoincrement: false;
|
|
459
|
+
hasRuntimeDefault: false;
|
|
460
|
+
enumValues: undefined;
|
|
461
|
+
baseColumn: never;
|
|
462
|
+
identity: undefined;
|
|
463
|
+
generated: undefined;
|
|
464
|
+
}, {}, {}>;
|
|
465
|
+
ui: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
466
|
+
name: "ui";
|
|
467
|
+
tableName: "agent_message";
|
|
468
|
+
dataType: "json";
|
|
469
|
+
columnType: "SQLiteTextJson";
|
|
470
|
+
data: AgentUiComponent[];
|
|
471
|
+
driverParam: string;
|
|
472
|
+
notNull: false;
|
|
473
|
+
hasDefault: false;
|
|
474
|
+
isPrimaryKey: false;
|
|
475
|
+
isAutoincrement: false;
|
|
476
|
+
hasRuntimeDefault: false;
|
|
477
|
+
enumValues: undefined;
|
|
478
|
+
baseColumn: never;
|
|
479
|
+
identity: undefined;
|
|
480
|
+
generated: undefined;
|
|
481
|
+
}, {}, {
|
|
482
|
+
$type: AgentUiComponent[];
|
|
483
|
+
}>;
|
|
429
484
|
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
430
485
|
name: "created_at";
|
|
431
486
|
tableName: "agent_message";
|
|
@@ -2231,6 +2286,61 @@ declare const agentSchema: {
|
|
|
2231
2286
|
}, {}, {
|
|
2232
2287
|
length: number | undefined;
|
|
2233
2288
|
}>;
|
|
2289
|
+
reasoning: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2290
|
+
name: "reasoning";
|
|
2291
|
+
tableName: "agent_message";
|
|
2292
|
+
dataType: "string";
|
|
2293
|
+
columnType: "SQLiteText";
|
|
2294
|
+
data: string;
|
|
2295
|
+
driverParam: string;
|
|
2296
|
+
notNull: false;
|
|
2297
|
+
hasDefault: false;
|
|
2298
|
+
isPrimaryKey: false;
|
|
2299
|
+
isAutoincrement: false;
|
|
2300
|
+
hasRuntimeDefault: false;
|
|
2301
|
+
enumValues: [string, ...string[]];
|
|
2302
|
+
baseColumn: never;
|
|
2303
|
+
identity: undefined;
|
|
2304
|
+
generated: undefined;
|
|
2305
|
+
}, {}, {
|
|
2306
|
+
length: number | undefined;
|
|
2307
|
+
}>;
|
|
2308
|
+
reasoningMs: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2309
|
+
name: "reasoning_ms";
|
|
2310
|
+
tableName: "agent_message";
|
|
2311
|
+
dataType: "number";
|
|
2312
|
+
columnType: "SQLiteInteger";
|
|
2313
|
+
data: number;
|
|
2314
|
+
driverParam: number;
|
|
2315
|
+
notNull: false;
|
|
2316
|
+
hasDefault: false;
|
|
2317
|
+
isPrimaryKey: false;
|
|
2318
|
+
isAutoincrement: false;
|
|
2319
|
+
hasRuntimeDefault: false;
|
|
2320
|
+
enumValues: undefined;
|
|
2321
|
+
baseColumn: never;
|
|
2322
|
+
identity: undefined;
|
|
2323
|
+
generated: undefined;
|
|
2324
|
+
}, {}, {}>;
|
|
2325
|
+
ui: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2326
|
+
name: "ui";
|
|
2327
|
+
tableName: "agent_message";
|
|
2328
|
+
dataType: "json";
|
|
2329
|
+
columnType: "SQLiteTextJson";
|
|
2330
|
+
data: AgentUiComponent[];
|
|
2331
|
+
driverParam: string;
|
|
2332
|
+
notNull: false;
|
|
2333
|
+
hasDefault: false;
|
|
2334
|
+
isPrimaryKey: false;
|
|
2335
|
+
isAutoincrement: false;
|
|
2336
|
+
hasRuntimeDefault: false;
|
|
2337
|
+
enumValues: undefined;
|
|
2338
|
+
baseColumn: never;
|
|
2339
|
+
identity: undefined;
|
|
2340
|
+
generated: undefined;
|
|
2341
|
+
}, {}, {
|
|
2342
|
+
$type: AgentUiComponent[];
|
|
2343
|
+
}>;
|
|
2234
2344
|
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2235
2345
|
name: "created_at";
|
|
2236
2346
|
tableName: "agent_message";
|
package/dist/index.d.ts
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, ToolKind, ToolCallStatus, UsagePurpose, AgentStore, ThreadTurnReader, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, UpdateThreadInput, RecordRunStartInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, 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, ToolKind, ToolCallStatus, UsagePurpose, AgentStore, ThreadTurnReader, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, UpdateThreadInput, RecordRunStartInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, 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';
|
|
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';
|
|
@@ -426,6 +426,61 @@ declare const agentMessage: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
426
426
|
}, {}, {
|
|
427
427
|
length: number | undefined;
|
|
428
428
|
}>;
|
|
429
|
+
reasoning: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
430
|
+
name: "reasoning";
|
|
431
|
+
tableName: "agent_message";
|
|
432
|
+
dataType: "string";
|
|
433
|
+
columnType: "SQLiteText";
|
|
434
|
+
data: string;
|
|
435
|
+
driverParam: string;
|
|
436
|
+
notNull: false;
|
|
437
|
+
hasDefault: false;
|
|
438
|
+
isPrimaryKey: false;
|
|
439
|
+
isAutoincrement: false;
|
|
440
|
+
hasRuntimeDefault: false;
|
|
441
|
+
enumValues: [string, ...string[]];
|
|
442
|
+
baseColumn: never;
|
|
443
|
+
identity: undefined;
|
|
444
|
+
generated: undefined;
|
|
445
|
+
}, {}, {
|
|
446
|
+
length: number | undefined;
|
|
447
|
+
}>;
|
|
448
|
+
reasoningMs: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
449
|
+
name: "reasoning_ms";
|
|
450
|
+
tableName: "agent_message";
|
|
451
|
+
dataType: "number";
|
|
452
|
+
columnType: "SQLiteInteger";
|
|
453
|
+
data: number;
|
|
454
|
+
driverParam: number;
|
|
455
|
+
notNull: false;
|
|
456
|
+
hasDefault: false;
|
|
457
|
+
isPrimaryKey: false;
|
|
458
|
+
isAutoincrement: false;
|
|
459
|
+
hasRuntimeDefault: false;
|
|
460
|
+
enumValues: undefined;
|
|
461
|
+
baseColumn: never;
|
|
462
|
+
identity: undefined;
|
|
463
|
+
generated: undefined;
|
|
464
|
+
}, {}, {}>;
|
|
465
|
+
ui: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
466
|
+
name: "ui";
|
|
467
|
+
tableName: "agent_message";
|
|
468
|
+
dataType: "json";
|
|
469
|
+
columnType: "SQLiteTextJson";
|
|
470
|
+
data: AgentUiComponent[];
|
|
471
|
+
driverParam: string;
|
|
472
|
+
notNull: false;
|
|
473
|
+
hasDefault: false;
|
|
474
|
+
isPrimaryKey: false;
|
|
475
|
+
isAutoincrement: false;
|
|
476
|
+
hasRuntimeDefault: false;
|
|
477
|
+
enumValues: undefined;
|
|
478
|
+
baseColumn: never;
|
|
479
|
+
identity: undefined;
|
|
480
|
+
generated: undefined;
|
|
481
|
+
}, {}, {
|
|
482
|
+
$type: AgentUiComponent[];
|
|
483
|
+
}>;
|
|
429
484
|
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
430
485
|
name: "created_at";
|
|
431
486
|
tableName: "agent_message";
|
|
@@ -2231,6 +2286,61 @@ declare const agentSchema: {
|
|
|
2231
2286
|
}, {}, {
|
|
2232
2287
|
length: number | undefined;
|
|
2233
2288
|
}>;
|
|
2289
|
+
reasoning: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2290
|
+
name: "reasoning";
|
|
2291
|
+
tableName: "agent_message";
|
|
2292
|
+
dataType: "string";
|
|
2293
|
+
columnType: "SQLiteText";
|
|
2294
|
+
data: string;
|
|
2295
|
+
driverParam: string;
|
|
2296
|
+
notNull: false;
|
|
2297
|
+
hasDefault: false;
|
|
2298
|
+
isPrimaryKey: false;
|
|
2299
|
+
isAutoincrement: false;
|
|
2300
|
+
hasRuntimeDefault: false;
|
|
2301
|
+
enumValues: [string, ...string[]];
|
|
2302
|
+
baseColumn: never;
|
|
2303
|
+
identity: undefined;
|
|
2304
|
+
generated: undefined;
|
|
2305
|
+
}, {}, {
|
|
2306
|
+
length: number | undefined;
|
|
2307
|
+
}>;
|
|
2308
|
+
reasoningMs: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2309
|
+
name: "reasoning_ms";
|
|
2310
|
+
tableName: "agent_message";
|
|
2311
|
+
dataType: "number";
|
|
2312
|
+
columnType: "SQLiteInteger";
|
|
2313
|
+
data: number;
|
|
2314
|
+
driverParam: number;
|
|
2315
|
+
notNull: false;
|
|
2316
|
+
hasDefault: false;
|
|
2317
|
+
isPrimaryKey: false;
|
|
2318
|
+
isAutoincrement: false;
|
|
2319
|
+
hasRuntimeDefault: false;
|
|
2320
|
+
enumValues: undefined;
|
|
2321
|
+
baseColumn: never;
|
|
2322
|
+
identity: undefined;
|
|
2323
|
+
generated: undefined;
|
|
2324
|
+
}, {}, {}>;
|
|
2325
|
+
ui: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2326
|
+
name: "ui";
|
|
2327
|
+
tableName: "agent_message";
|
|
2328
|
+
dataType: "json";
|
|
2329
|
+
columnType: "SQLiteTextJson";
|
|
2330
|
+
data: AgentUiComponent[];
|
|
2331
|
+
driverParam: string;
|
|
2332
|
+
notNull: false;
|
|
2333
|
+
hasDefault: false;
|
|
2334
|
+
isPrimaryKey: false;
|
|
2335
|
+
isAutoincrement: false;
|
|
2336
|
+
hasRuntimeDefault: false;
|
|
2337
|
+
enumValues: undefined;
|
|
2338
|
+
baseColumn: never;
|
|
2339
|
+
identity: undefined;
|
|
2340
|
+
generated: undefined;
|
|
2341
|
+
}, {}, {
|
|
2342
|
+
$type: AgentUiComponent[];
|
|
2343
|
+
}>;
|
|
2234
2344
|
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2235
2345
|
name: "created_at";
|
|
2236
2346
|
tableName: "agent_message";
|
package/dist/index.js
CHANGED
|
@@ -50,6 +50,13 @@ var agentMessage = sqliteTable("agent_message", {
|
|
|
50
50
|
}).$type(),
|
|
51
51
|
agentName: text("agent_name"),
|
|
52
52
|
runId: text("run_id"),
|
|
53
|
+
/** The step's streamed thinking; `null` when the model produced none. */
|
|
54
|
+
reasoning: text("reasoning"),
|
|
55
|
+
reasoningMs: integer("reasoning_ms"),
|
|
56
|
+
/** Components pushed during the step (`ui` stream frames), replayed on reload. */
|
|
57
|
+
ui: text("ui", {
|
|
58
|
+
mode: "json"
|
|
59
|
+
}).$type(),
|
|
53
60
|
createdAt: integer("created_at", {
|
|
54
61
|
mode: "timestamp_ms"
|
|
55
62
|
}).notNull()
|
|
@@ -246,6 +253,9 @@ var statements = [
|
|
|
246
253
|
usage TEXT,
|
|
247
254
|
agent_name TEXT,
|
|
248
255
|
run_id TEXT,
|
|
256
|
+
reasoning TEXT,
|
|
257
|
+
reasoning_ms INTEGER,
|
|
258
|
+
ui TEXT,
|
|
249
259
|
created_at INTEGER NOT NULL
|
|
250
260
|
)`,
|
|
251
261
|
`CREATE INDEX IF NOT EXISTS agent_message_thread_created_idx
|
|
@@ -365,6 +375,21 @@ var additiveColumns = [
|
|
|
365
375
|
table: "agent_run",
|
|
366
376
|
column: "parent_run_id",
|
|
367
377
|
ddl: "ALTER TABLE agent_run ADD COLUMN parent_run_id TEXT"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
table: "agent_message",
|
|
381
|
+
column: "reasoning",
|
|
382
|
+
ddl: "ALTER TABLE agent_message ADD COLUMN reasoning TEXT"
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
table: "agent_message",
|
|
386
|
+
column: "reasoning_ms",
|
|
387
|
+
ddl: "ALTER TABLE agent_message ADD COLUMN reasoning_ms INTEGER"
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
table: "agent_message",
|
|
391
|
+
column: "ui",
|
|
392
|
+
ddl: "ALTER TABLE agent_message ADD COLUMN ui TEXT"
|
|
368
393
|
}
|
|
369
394
|
];
|
|
370
395
|
async function ensureAgentSchema(db) {
|
|
@@ -528,6 +553,9 @@ var DrizzleAgentStore = class {
|
|
|
528
553
|
// turn produced this text gets the truthful answer; the run's own thread is still the
|
|
529
554
|
// original, so a run-scoped read never picks the fork's rows up.
|
|
530
555
|
runId: message.runId,
|
|
556
|
+
reasoning: message.reasoning,
|
|
557
|
+
reasoningMs: message.reasoningMs,
|
|
558
|
+
ui: message.ui,
|
|
531
559
|
createdAt: message.createdAt
|
|
532
560
|
})));
|
|
533
561
|
}
|
|
@@ -671,6 +699,9 @@ var DrizzleAgentStore = class {
|
|
|
671
699
|
usage: input.usage ?? null,
|
|
672
700
|
agentName: input.agentName ?? null,
|
|
673
701
|
runId: input.runId ?? null,
|
|
702
|
+
reasoning: input.reasoning ?? null,
|
|
703
|
+
reasoningMs: input.reasoningMs ?? null,
|
|
704
|
+
ui: input.ui ?? null,
|
|
674
705
|
createdAt: now
|
|
675
706
|
};
|
|
676
707
|
await this.db.insert(agentMessage).values(message);
|
|
@@ -831,6 +862,15 @@ var DrizzleAgentStore = class {
|
|
|
831
862
|
} : {},
|
|
832
863
|
...message.runId != null ? {
|
|
833
864
|
runId: message.runId
|
|
865
|
+
} : {},
|
|
866
|
+
...message.reasoning != null ? {
|
|
867
|
+
reasoning: message.reasoning
|
|
868
|
+
} : {},
|
|
869
|
+
...message.reasoningMs != null ? {
|
|
870
|
+
reasoningMs: message.reasoningMs
|
|
871
|
+
} : {},
|
|
872
|
+
...message.ui != null ? {
|
|
873
|
+
ui: message.ui
|
|
834
874
|
} : {}
|
|
835
875
|
};
|
|
836
876
|
}
|