@dudousxd/nestjs-agent-store-drizzle 0.31.0 → 0.32.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 +43 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +210 -8
- package/dist/index.d.ts +210 -8
- package/dist/index.js +43 -1
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _dudousxd_nestjs_agent_core from '@dudousxd/nestjs-agent-core';
|
|
2
|
-
import { MessageRole, ToolCallRequest, ToolResult, MessageAttachment, MessageUsage, AgentUiComponent, MessageFeedback, AgentHostContext, Actor, PageContext, QueuePause, ActionProposal, GenuiValidity, GenuiErrorCategory, CostSource, ToolKind, ToolCallStatus, ToolConfirmation, UsagePurpose, AgentStore, ThreadTurnReader, ChatQueueStore, ActionProposalStore, ActionProposalWorkerStore, ActionProposalDiscoveryIndexStore, ActionProposalOutcomeStore, ActionProposalStoreOptions, ActionProposalSupersessionStore, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, ToolCallApprovalState, EnqueueMessageInput, QueuedMessage, QueuedMessagePatch, UpdateThreadInput, RecordRunStartInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, ToolCallOutcome, RecordUsageInput, RecordGenuiCallInput, UsageTotals, CreateActionProposal, CreateActionProposalResult, ActionProposalScope, ActionProposalMutationResult, ListActionProposals, ActionProposalDecisionCommand, ClaimActionProposal, ExtendActionProposalLease, SettleActionProposal, ActionProposalOutcomeLease, 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, GenuiStats, MemoryProvider, ListMemoriesInput, MemoryRecord, ForgetMemoryInput, StoreMemoryInput, ModelPriceInput, CurrentModelPrice, StreamFrameTable, StreamFrameRow, SqlTokenStreamSink, SqlTokenStreamSinkOptions, ConfirmTokenStore, ConfirmTokenClaim, ChannelStore, PoppyStore, PoppyConversationRecord, PoppyConversationPatch, PoppyEventBody, StoredPoppyEvent, PoppyMessageReceipt, PoppyMessageClaim, PoppyConnectionStore, PoppyConnectionRecord, PoppyPendingConnect } from '@dudousxd/nestjs-agent-core';
|
|
2
|
+
import { MessageRole, ToolCallRequest, ToolResult, MessageAttachment, MessageUsage, AgentUiComponent, MessageFeedback, AgentHostContext, Actor, PageContext, QueuePause, ActionProposal, GenuiValidity, GenuiErrorCategory, CostSource, ToolKind, ToolCallStatus, ToolConfirmation, UsagePurpose, AgentStore, ThreadTurnReader, ChatQueueStore, ActionProposalStore, ActionProposalWorkerStore, ActionProposalDiscoveryIndexStore, ActionProposalOutcomeStore, ActionProposalStoreOptions, ActionProposalSupersessionStore, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, ToolCallApprovalState, EnqueueMessageInput, QueuedMessage, QueuedMessagePatch, UpdateThreadInput, RecordRunStartInput, RecordRunEndInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, ToolCallOutcome, RecordUsageInput, RecordGenuiCallInput, UsageTotals, CreateActionProposal, CreateActionProposalResult, ActionProposalScope, ActionProposalMutationResult, ListActionProposals, ActionProposalDecisionCommand, ClaimActionProposal, ExtendActionProposalLease, SettleActionProposal, ActionProposalOutcomeLease, 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, GenuiStats, MemoryProvider, ListMemoriesInput, MemoryRecord, ForgetMemoryInput, StoreMemoryInput, ModelPriceInput, CurrentModelPrice, StreamFrameTable, StreamFrameRow, SqlTokenStreamSink, SqlTokenStreamSinkOptions, ConfirmTokenStore, ConfirmTokenClaim, ChannelStore, PoppyStore, PoppyConversationRecord, PoppyConversationPatch, PoppyEventBody, StoredPoppyEvent, PoppyMessageReceipt, PoppyMessageClaim, PoppyConnectionStore, PoppyConnectionRecord, PoppyPendingConnect } from '@dudousxd/nestjs-agent-core';
|
|
3
3
|
export { ThreadTurnPage, ThreadTurnQuery } from '@dudousxd/nestjs-agent-core';
|
|
4
4
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
5
5
|
import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
|
|
@@ -2290,6 +2290,59 @@ declare const agentRun: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
2290
2290
|
identity: undefined;
|
|
2291
2291
|
generated: undefined;
|
|
2292
2292
|
}, {}, {}>;
|
|
2293
|
+
ttftMs: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2294
|
+
name: "ttft_ms";
|
|
2295
|
+
tableName: "agent_run";
|
|
2296
|
+
dataType: "number";
|
|
2297
|
+
columnType: "SQLiteInteger";
|
|
2298
|
+
data: number;
|
|
2299
|
+
driverParam: number;
|
|
2300
|
+
notNull: false;
|
|
2301
|
+
hasDefault: false;
|
|
2302
|
+
isPrimaryKey: false;
|
|
2303
|
+
isAutoincrement: false;
|
|
2304
|
+
hasRuntimeDefault: false;
|
|
2305
|
+
enumValues: undefined;
|
|
2306
|
+
baseColumn: never;
|
|
2307
|
+
identity: undefined;
|
|
2308
|
+
generated: undefined;
|
|
2309
|
+
}, {}, {}>;
|
|
2310
|
+
costUsd: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2311
|
+
name: "cost_usd";
|
|
2312
|
+
tableName: "agent_run";
|
|
2313
|
+
dataType: "number";
|
|
2314
|
+
columnType: "SQLiteReal";
|
|
2315
|
+
data: number;
|
|
2316
|
+
driverParam: number;
|
|
2317
|
+
notNull: false;
|
|
2318
|
+
hasDefault: false;
|
|
2319
|
+
isPrimaryKey: false;
|
|
2320
|
+
isAutoincrement: false;
|
|
2321
|
+
hasRuntimeDefault: false;
|
|
2322
|
+
enumValues: undefined;
|
|
2323
|
+
baseColumn: never;
|
|
2324
|
+
identity: undefined;
|
|
2325
|
+
generated: undefined;
|
|
2326
|
+
}, {}, {}>;
|
|
2327
|
+
modelId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2328
|
+
name: "model_id";
|
|
2329
|
+
tableName: "agent_run";
|
|
2330
|
+
dataType: "string";
|
|
2331
|
+
columnType: "SQLiteText";
|
|
2332
|
+
data: string;
|
|
2333
|
+
driverParam: string;
|
|
2334
|
+
notNull: false;
|
|
2335
|
+
hasDefault: false;
|
|
2336
|
+
isPrimaryKey: false;
|
|
2337
|
+
isAutoincrement: false;
|
|
2338
|
+
hasRuntimeDefault: false;
|
|
2339
|
+
enumValues: [string, ...string[]];
|
|
2340
|
+
baseColumn: never;
|
|
2341
|
+
identity: undefined;
|
|
2342
|
+
generated: undefined;
|
|
2343
|
+
}, {}, {
|
|
2344
|
+
length: number | undefined;
|
|
2345
|
+
}>;
|
|
2293
2346
|
errorCode: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2294
2347
|
name: "error_code";
|
|
2295
2348
|
tableName: "agent_run";
|
|
@@ -7105,6 +7158,59 @@ declare const agentSchema: {
|
|
|
7105
7158
|
identity: undefined;
|
|
7106
7159
|
generated: undefined;
|
|
7107
7160
|
}, {}, {}>;
|
|
7161
|
+
ttftMs: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
7162
|
+
name: "ttft_ms";
|
|
7163
|
+
tableName: "agent_run";
|
|
7164
|
+
dataType: "number";
|
|
7165
|
+
columnType: "SQLiteInteger";
|
|
7166
|
+
data: number;
|
|
7167
|
+
driverParam: number;
|
|
7168
|
+
notNull: false;
|
|
7169
|
+
hasDefault: false;
|
|
7170
|
+
isPrimaryKey: false;
|
|
7171
|
+
isAutoincrement: false;
|
|
7172
|
+
hasRuntimeDefault: false;
|
|
7173
|
+
enumValues: undefined;
|
|
7174
|
+
baseColumn: never;
|
|
7175
|
+
identity: undefined;
|
|
7176
|
+
generated: undefined;
|
|
7177
|
+
}, {}, {}>;
|
|
7178
|
+
costUsd: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
7179
|
+
name: "cost_usd";
|
|
7180
|
+
tableName: "agent_run";
|
|
7181
|
+
dataType: "number";
|
|
7182
|
+
columnType: "SQLiteReal";
|
|
7183
|
+
data: number;
|
|
7184
|
+
driverParam: number;
|
|
7185
|
+
notNull: false;
|
|
7186
|
+
hasDefault: false;
|
|
7187
|
+
isPrimaryKey: false;
|
|
7188
|
+
isAutoincrement: false;
|
|
7189
|
+
hasRuntimeDefault: false;
|
|
7190
|
+
enumValues: undefined;
|
|
7191
|
+
baseColumn: never;
|
|
7192
|
+
identity: undefined;
|
|
7193
|
+
generated: undefined;
|
|
7194
|
+
}, {}, {}>;
|
|
7195
|
+
modelId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
7196
|
+
name: "model_id";
|
|
7197
|
+
tableName: "agent_run";
|
|
7198
|
+
dataType: "string";
|
|
7199
|
+
columnType: "SQLiteText";
|
|
7200
|
+
data: string;
|
|
7201
|
+
driverParam: string;
|
|
7202
|
+
notNull: false;
|
|
7203
|
+
hasDefault: false;
|
|
7204
|
+
isPrimaryKey: false;
|
|
7205
|
+
isAutoincrement: false;
|
|
7206
|
+
hasRuntimeDefault: false;
|
|
7207
|
+
enumValues: [string, ...string[]];
|
|
7208
|
+
baseColumn: never;
|
|
7209
|
+
identity: undefined;
|
|
7210
|
+
generated: undefined;
|
|
7211
|
+
}, {}, {
|
|
7212
|
+
length: number | undefined;
|
|
7213
|
+
}>;
|
|
7108
7214
|
errorCode: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
7109
7215
|
name: "error_code";
|
|
7110
7216
|
tableName: "agent_run";
|
|
@@ -9207,13 +9313,7 @@ declare class DrizzleAgentStore implements AgentStore, ThreadTurnReader, ChatQue
|
|
|
9207
9313
|
*/
|
|
9208
9314
|
recordRunStart(run: RecordRunStartInput): Promise<void>;
|
|
9209
9315
|
/** Settle a run's outcome. A no-op when the run is unknown (mirrors `setTitle`/`updateThread`). */
|
|
9210
|
-
recordRunEnd(end:
|
|
9211
|
-
runId: string;
|
|
9212
|
-
status: 'completed' | 'failed' | 'cancelled';
|
|
9213
|
-
durationMs?: number;
|
|
9214
|
-
errorCode?: string;
|
|
9215
|
-
errorMessage?: string;
|
|
9216
|
-
}): Promise<void>;
|
|
9316
|
+
recordRunEnd(end: RecordRunEndInput): Promise<void>;
|
|
9217
9317
|
/** Bump the run's llm-step retry counter. Atomic `retries = retries + 1`, no read-modify-write. */
|
|
9218
9318
|
bumpRunRetries(runId: string): Promise<void>;
|
|
9219
9319
|
appendMessage(input: AppendMessageInput): Promise<StoredMessage>;
|
|
@@ -12264,6 +12364,57 @@ declare const pgAgentSchema: {
|
|
|
12264
12364
|
identity: undefined;
|
|
12265
12365
|
generated: undefined;
|
|
12266
12366
|
}, {}, {}>;
|
|
12367
|
+
ttftMs: drizzle_orm_pg_core.PgColumn<{
|
|
12368
|
+
name: "ttft_ms";
|
|
12369
|
+
tableName: "agent_run";
|
|
12370
|
+
dataType: "number";
|
|
12371
|
+
columnType: "PgInteger";
|
|
12372
|
+
data: number;
|
|
12373
|
+
driverParam: string | number;
|
|
12374
|
+
notNull: false;
|
|
12375
|
+
hasDefault: false;
|
|
12376
|
+
isPrimaryKey: false;
|
|
12377
|
+
isAutoincrement: false;
|
|
12378
|
+
hasRuntimeDefault: false;
|
|
12379
|
+
enumValues: undefined;
|
|
12380
|
+
baseColumn: never;
|
|
12381
|
+
identity: undefined;
|
|
12382
|
+
generated: undefined;
|
|
12383
|
+
}, {}, {}>;
|
|
12384
|
+
costUsd: drizzle_orm_pg_core.PgColumn<{
|
|
12385
|
+
name: "cost_usd";
|
|
12386
|
+
tableName: "agent_run";
|
|
12387
|
+
dataType: "number";
|
|
12388
|
+
columnType: "PgDoublePrecision";
|
|
12389
|
+
data: number;
|
|
12390
|
+
driverParam: string | number;
|
|
12391
|
+
notNull: false;
|
|
12392
|
+
hasDefault: false;
|
|
12393
|
+
isPrimaryKey: false;
|
|
12394
|
+
isAutoincrement: false;
|
|
12395
|
+
hasRuntimeDefault: false;
|
|
12396
|
+
enumValues: undefined;
|
|
12397
|
+
baseColumn: never;
|
|
12398
|
+
identity: undefined;
|
|
12399
|
+
generated: undefined;
|
|
12400
|
+
}, {}, {}>;
|
|
12401
|
+
modelId: drizzle_orm_pg_core.PgColumn<{
|
|
12402
|
+
name: "model_id";
|
|
12403
|
+
tableName: "agent_run";
|
|
12404
|
+
dataType: "string";
|
|
12405
|
+
columnType: "PgText";
|
|
12406
|
+
data: string;
|
|
12407
|
+
driverParam: string;
|
|
12408
|
+
notNull: false;
|
|
12409
|
+
hasDefault: false;
|
|
12410
|
+
isPrimaryKey: false;
|
|
12411
|
+
isAutoincrement: false;
|
|
12412
|
+
hasRuntimeDefault: false;
|
|
12413
|
+
enumValues: [string, ...string[]];
|
|
12414
|
+
baseColumn: never;
|
|
12415
|
+
identity: undefined;
|
|
12416
|
+
generated: undefined;
|
|
12417
|
+
}, {}, {}>;
|
|
12267
12418
|
errorCode: drizzle_orm_pg_core.PgColumn<{
|
|
12268
12419
|
name: "error_code";
|
|
12269
12420
|
tableName: "agent_run";
|
|
@@ -16420,6 +16571,57 @@ declare const mysqlAgentSchema: {
|
|
|
16420
16571
|
identity: undefined;
|
|
16421
16572
|
generated: undefined;
|
|
16422
16573
|
}, {}, {}>;
|
|
16574
|
+
ttftMs: drizzle_orm_mysql_core.MySqlColumn<{
|
|
16575
|
+
name: "ttft_ms";
|
|
16576
|
+
tableName: "agent_run";
|
|
16577
|
+
dataType: "number";
|
|
16578
|
+
columnType: "MySqlInt";
|
|
16579
|
+
data: number;
|
|
16580
|
+
driverParam: string | number;
|
|
16581
|
+
notNull: false;
|
|
16582
|
+
hasDefault: false;
|
|
16583
|
+
isPrimaryKey: false;
|
|
16584
|
+
isAutoincrement: false;
|
|
16585
|
+
hasRuntimeDefault: false;
|
|
16586
|
+
enumValues: undefined;
|
|
16587
|
+
baseColumn: never;
|
|
16588
|
+
identity: undefined;
|
|
16589
|
+
generated: undefined;
|
|
16590
|
+
}, {}, {}>;
|
|
16591
|
+
costUsd: drizzle_orm_mysql_core.MySqlColumn<{
|
|
16592
|
+
name: "cost_usd";
|
|
16593
|
+
tableName: "agent_run";
|
|
16594
|
+
dataType: "number";
|
|
16595
|
+
columnType: "MySqlDouble";
|
|
16596
|
+
data: number;
|
|
16597
|
+
driverParam: string | number;
|
|
16598
|
+
notNull: false;
|
|
16599
|
+
hasDefault: false;
|
|
16600
|
+
isPrimaryKey: false;
|
|
16601
|
+
isAutoincrement: false;
|
|
16602
|
+
hasRuntimeDefault: false;
|
|
16603
|
+
enumValues: undefined;
|
|
16604
|
+
baseColumn: never;
|
|
16605
|
+
identity: undefined;
|
|
16606
|
+
generated: undefined;
|
|
16607
|
+
}, {}, {}>;
|
|
16608
|
+
modelId: drizzle_orm_mysql_core.MySqlColumn<{
|
|
16609
|
+
name: string;
|
|
16610
|
+
tableName: "agent_run";
|
|
16611
|
+
dataType: "string";
|
|
16612
|
+
columnType: "MySqlVarChar";
|
|
16613
|
+
data: string;
|
|
16614
|
+
driverParam: string | number;
|
|
16615
|
+
notNull: false;
|
|
16616
|
+
hasDefault: false;
|
|
16617
|
+
isPrimaryKey: false;
|
|
16618
|
+
isAutoincrement: false;
|
|
16619
|
+
hasRuntimeDefault: false;
|
|
16620
|
+
enumValues: [string, ...string[]];
|
|
16621
|
+
baseColumn: never;
|
|
16622
|
+
identity: undefined;
|
|
16623
|
+
generated: undefined;
|
|
16624
|
+
}, {}, {}>;
|
|
16423
16625
|
errorCode: drizzle_orm_mysql_core.MySqlColumn<{
|
|
16424
16626
|
name: string;
|
|
16425
16627
|
tableName: "agent_run";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _dudousxd_nestjs_agent_core from '@dudousxd/nestjs-agent-core';
|
|
2
|
-
import { MessageRole, ToolCallRequest, ToolResult, MessageAttachment, MessageUsage, AgentUiComponent, MessageFeedback, AgentHostContext, Actor, PageContext, QueuePause, ActionProposal, GenuiValidity, GenuiErrorCategory, CostSource, ToolKind, ToolCallStatus, ToolConfirmation, UsagePurpose, AgentStore, ThreadTurnReader, ChatQueueStore, ActionProposalStore, ActionProposalWorkerStore, ActionProposalDiscoveryIndexStore, ActionProposalOutcomeStore, ActionProposalStoreOptions, ActionProposalSupersessionStore, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, ToolCallApprovalState, EnqueueMessageInput, QueuedMessage, QueuedMessagePatch, UpdateThreadInput, RecordRunStartInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, ToolCallOutcome, RecordUsageInput, RecordGenuiCallInput, UsageTotals, CreateActionProposal, CreateActionProposalResult, ActionProposalScope, ActionProposalMutationResult, ListActionProposals, ActionProposalDecisionCommand, ClaimActionProposal, ExtendActionProposalLease, SettleActionProposal, ActionProposalOutcomeLease, 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, GenuiStats, MemoryProvider, ListMemoriesInput, MemoryRecord, ForgetMemoryInput, StoreMemoryInput, ModelPriceInput, CurrentModelPrice, StreamFrameTable, StreamFrameRow, SqlTokenStreamSink, SqlTokenStreamSinkOptions, ConfirmTokenStore, ConfirmTokenClaim, ChannelStore, PoppyStore, PoppyConversationRecord, PoppyConversationPatch, PoppyEventBody, StoredPoppyEvent, PoppyMessageReceipt, PoppyMessageClaim, PoppyConnectionStore, PoppyConnectionRecord, PoppyPendingConnect } from '@dudousxd/nestjs-agent-core';
|
|
2
|
+
import { MessageRole, ToolCallRequest, ToolResult, MessageAttachment, MessageUsage, AgentUiComponent, MessageFeedback, AgentHostContext, Actor, PageContext, QueuePause, ActionProposal, GenuiValidity, GenuiErrorCategory, CostSource, ToolKind, ToolCallStatus, ToolConfirmation, UsagePurpose, AgentStore, ThreadTurnReader, ChatQueueStore, ActionProposalStore, ActionProposalWorkerStore, ActionProposalDiscoveryIndexStore, ActionProposalOutcomeStore, ActionProposalStoreOptions, ActionProposalSupersessionStore, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, ToolCallApprovalState, EnqueueMessageInput, QueuedMessage, QueuedMessagePatch, UpdateThreadInput, RecordRunStartInput, RecordRunEndInput, AppendMessageInput, StoredMessage, RecordToolCallInput, UpdateToolCallInput, ToolCallOutcome, RecordUsageInput, RecordGenuiCallInput, UsageTotals, CreateActionProposal, CreateActionProposalResult, ActionProposalScope, ActionProposalMutationResult, ListActionProposals, ActionProposalDecisionCommand, ClaimActionProposal, ExtendActionProposalLease, SettleActionProposal, ActionProposalOutcomeLease, 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, GenuiStats, MemoryProvider, ListMemoriesInput, MemoryRecord, ForgetMemoryInput, StoreMemoryInput, ModelPriceInput, CurrentModelPrice, StreamFrameTable, StreamFrameRow, SqlTokenStreamSink, SqlTokenStreamSinkOptions, ConfirmTokenStore, ConfirmTokenClaim, ChannelStore, PoppyStore, PoppyConversationRecord, PoppyConversationPatch, PoppyEventBody, StoredPoppyEvent, PoppyMessageReceipt, PoppyMessageClaim, PoppyConnectionStore, PoppyConnectionRecord, PoppyPendingConnect } from '@dudousxd/nestjs-agent-core';
|
|
3
3
|
export { ThreadTurnPage, ThreadTurnQuery } from '@dudousxd/nestjs-agent-core';
|
|
4
4
|
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
5
5
|
import { BaseSQLiteDatabase } from 'drizzle-orm/sqlite-core';
|
|
@@ -2290,6 +2290,59 @@ declare const agentRun: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
2290
2290
|
identity: undefined;
|
|
2291
2291
|
generated: undefined;
|
|
2292
2292
|
}, {}, {}>;
|
|
2293
|
+
ttftMs: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2294
|
+
name: "ttft_ms";
|
|
2295
|
+
tableName: "agent_run";
|
|
2296
|
+
dataType: "number";
|
|
2297
|
+
columnType: "SQLiteInteger";
|
|
2298
|
+
data: number;
|
|
2299
|
+
driverParam: number;
|
|
2300
|
+
notNull: false;
|
|
2301
|
+
hasDefault: false;
|
|
2302
|
+
isPrimaryKey: false;
|
|
2303
|
+
isAutoincrement: false;
|
|
2304
|
+
hasRuntimeDefault: false;
|
|
2305
|
+
enumValues: undefined;
|
|
2306
|
+
baseColumn: never;
|
|
2307
|
+
identity: undefined;
|
|
2308
|
+
generated: undefined;
|
|
2309
|
+
}, {}, {}>;
|
|
2310
|
+
costUsd: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2311
|
+
name: "cost_usd";
|
|
2312
|
+
tableName: "agent_run";
|
|
2313
|
+
dataType: "number";
|
|
2314
|
+
columnType: "SQLiteReal";
|
|
2315
|
+
data: number;
|
|
2316
|
+
driverParam: number;
|
|
2317
|
+
notNull: false;
|
|
2318
|
+
hasDefault: false;
|
|
2319
|
+
isPrimaryKey: false;
|
|
2320
|
+
isAutoincrement: false;
|
|
2321
|
+
hasRuntimeDefault: false;
|
|
2322
|
+
enumValues: undefined;
|
|
2323
|
+
baseColumn: never;
|
|
2324
|
+
identity: undefined;
|
|
2325
|
+
generated: undefined;
|
|
2326
|
+
}, {}, {}>;
|
|
2327
|
+
modelId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2328
|
+
name: "model_id";
|
|
2329
|
+
tableName: "agent_run";
|
|
2330
|
+
dataType: "string";
|
|
2331
|
+
columnType: "SQLiteText";
|
|
2332
|
+
data: string;
|
|
2333
|
+
driverParam: string;
|
|
2334
|
+
notNull: false;
|
|
2335
|
+
hasDefault: false;
|
|
2336
|
+
isPrimaryKey: false;
|
|
2337
|
+
isAutoincrement: false;
|
|
2338
|
+
hasRuntimeDefault: false;
|
|
2339
|
+
enumValues: [string, ...string[]];
|
|
2340
|
+
baseColumn: never;
|
|
2341
|
+
identity: undefined;
|
|
2342
|
+
generated: undefined;
|
|
2343
|
+
}, {}, {
|
|
2344
|
+
length: number | undefined;
|
|
2345
|
+
}>;
|
|
2293
2346
|
errorCode: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2294
2347
|
name: "error_code";
|
|
2295
2348
|
tableName: "agent_run";
|
|
@@ -7105,6 +7158,59 @@ declare const agentSchema: {
|
|
|
7105
7158
|
identity: undefined;
|
|
7106
7159
|
generated: undefined;
|
|
7107
7160
|
}, {}, {}>;
|
|
7161
|
+
ttftMs: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
7162
|
+
name: "ttft_ms";
|
|
7163
|
+
tableName: "agent_run";
|
|
7164
|
+
dataType: "number";
|
|
7165
|
+
columnType: "SQLiteInteger";
|
|
7166
|
+
data: number;
|
|
7167
|
+
driverParam: number;
|
|
7168
|
+
notNull: false;
|
|
7169
|
+
hasDefault: false;
|
|
7170
|
+
isPrimaryKey: false;
|
|
7171
|
+
isAutoincrement: false;
|
|
7172
|
+
hasRuntimeDefault: false;
|
|
7173
|
+
enumValues: undefined;
|
|
7174
|
+
baseColumn: never;
|
|
7175
|
+
identity: undefined;
|
|
7176
|
+
generated: undefined;
|
|
7177
|
+
}, {}, {}>;
|
|
7178
|
+
costUsd: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
7179
|
+
name: "cost_usd";
|
|
7180
|
+
tableName: "agent_run";
|
|
7181
|
+
dataType: "number";
|
|
7182
|
+
columnType: "SQLiteReal";
|
|
7183
|
+
data: number;
|
|
7184
|
+
driverParam: number;
|
|
7185
|
+
notNull: false;
|
|
7186
|
+
hasDefault: false;
|
|
7187
|
+
isPrimaryKey: false;
|
|
7188
|
+
isAutoincrement: false;
|
|
7189
|
+
hasRuntimeDefault: false;
|
|
7190
|
+
enumValues: undefined;
|
|
7191
|
+
baseColumn: never;
|
|
7192
|
+
identity: undefined;
|
|
7193
|
+
generated: undefined;
|
|
7194
|
+
}, {}, {}>;
|
|
7195
|
+
modelId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
7196
|
+
name: "model_id";
|
|
7197
|
+
tableName: "agent_run";
|
|
7198
|
+
dataType: "string";
|
|
7199
|
+
columnType: "SQLiteText";
|
|
7200
|
+
data: string;
|
|
7201
|
+
driverParam: string;
|
|
7202
|
+
notNull: false;
|
|
7203
|
+
hasDefault: false;
|
|
7204
|
+
isPrimaryKey: false;
|
|
7205
|
+
isAutoincrement: false;
|
|
7206
|
+
hasRuntimeDefault: false;
|
|
7207
|
+
enumValues: [string, ...string[]];
|
|
7208
|
+
baseColumn: never;
|
|
7209
|
+
identity: undefined;
|
|
7210
|
+
generated: undefined;
|
|
7211
|
+
}, {}, {
|
|
7212
|
+
length: number | undefined;
|
|
7213
|
+
}>;
|
|
7108
7214
|
errorCode: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
7109
7215
|
name: "error_code";
|
|
7110
7216
|
tableName: "agent_run";
|
|
@@ -9207,13 +9313,7 @@ declare class DrizzleAgentStore implements AgentStore, ThreadTurnReader, ChatQue
|
|
|
9207
9313
|
*/
|
|
9208
9314
|
recordRunStart(run: RecordRunStartInput): Promise<void>;
|
|
9209
9315
|
/** Settle a run's outcome. A no-op when the run is unknown (mirrors `setTitle`/`updateThread`). */
|
|
9210
|
-
recordRunEnd(end:
|
|
9211
|
-
runId: string;
|
|
9212
|
-
status: 'completed' | 'failed' | 'cancelled';
|
|
9213
|
-
durationMs?: number;
|
|
9214
|
-
errorCode?: string;
|
|
9215
|
-
errorMessage?: string;
|
|
9216
|
-
}): Promise<void>;
|
|
9316
|
+
recordRunEnd(end: RecordRunEndInput): Promise<void>;
|
|
9217
9317
|
/** Bump the run's llm-step retry counter. Atomic `retries = retries + 1`, no read-modify-write. */
|
|
9218
9318
|
bumpRunRetries(runId: string): Promise<void>;
|
|
9219
9319
|
appendMessage(input: AppendMessageInput): Promise<StoredMessage>;
|
|
@@ -12264,6 +12364,57 @@ declare const pgAgentSchema: {
|
|
|
12264
12364
|
identity: undefined;
|
|
12265
12365
|
generated: undefined;
|
|
12266
12366
|
}, {}, {}>;
|
|
12367
|
+
ttftMs: drizzle_orm_pg_core.PgColumn<{
|
|
12368
|
+
name: "ttft_ms";
|
|
12369
|
+
tableName: "agent_run";
|
|
12370
|
+
dataType: "number";
|
|
12371
|
+
columnType: "PgInteger";
|
|
12372
|
+
data: number;
|
|
12373
|
+
driverParam: string | number;
|
|
12374
|
+
notNull: false;
|
|
12375
|
+
hasDefault: false;
|
|
12376
|
+
isPrimaryKey: false;
|
|
12377
|
+
isAutoincrement: false;
|
|
12378
|
+
hasRuntimeDefault: false;
|
|
12379
|
+
enumValues: undefined;
|
|
12380
|
+
baseColumn: never;
|
|
12381
|
+
identity: undefined;
|
|
12382
|
+
generated: undefined;
|
|
12383
|
+
}, {}, {}>;
|
|
12384
|
+
costUsd: drizzle_orm_pg_core.PgColumn<{
|
|
12385
|
+
name: "cost_usd";
|
|
12386
|
+
tableName: "agent_run";
|
|
12387
|
+
dataType: "number";
|
|
12388
|
+
columnType: "PgDoublePrecision";
|
|
12389
|
+
data: number;
|
|
12390
|
+
driverParam: string | number;
|
|
12391
|
+
notNull: false;
|
|
12392
|
+
hasDefault: false;
|
|
12393
|
+
isPrimaryKey: false;
|
|
12394
|
+
isAutoincrement: false;
|
|
12395
|
+
hasRuntimeDefault: false;
|
|
12396
|
+
enumValues: undefined;
|
|
12397
|
+
baseColumn: never;
|
|
12398
|
+
identity: undefined;
|
|
12399
|
+
generated: undefined;
|
|
12400
|
+
}, {}, {}>;
|
|
12401
|
+
modelId: drizzle_orm_pg_core.PgColumn<{
|
|
12402
|
+
name: "model_id";
|
|
12403
|
+
tableName: "agent_run";
|
|
12404
|
+
dataType: "string";
|
|
12405
|
+
columnType: "PgText";
|
|
12406
|
+
data: string;
|
|
12407
|
+
driverParam: string;
|
|
12408
|
+
notNull: false;
|
|
12409
|
+
hasDefault: false;
|
|
12410
|
+
isPrimaryKey: false;
|
|
12411
|
+
isAutoincrement: false;
|
|
12412
|
+
hasRuntimeDefault: false;
|
|
12413
|
+
enumValues: [string, ...string[]];
|
|
12414
|
+
baseColumn: never;
|
|
12415
|
+
identity: undefined;
|
|
12416
|
+
generated: undefined;
|
|
12417
|
+
}, {}, {}>;
|
|
12267
12418
|
errorCode: drizzle_orm_pg_core.PgColumn<{
|
|
12268
12419
|
name: "error_code";
|
|
12269
12420
|
tableName: "agent_run";
|
|
@@ -16420,6 +16571,57 @@ declare const mysqlAgentSchema: {
|
|
|
16420
16571
|
identity: undefined;
|
|
16421
16572
|
generated: undefined;
|
|
16422
16573
|
}, {}, {}>;
|
|
16574
|
+
ttftMs: drizzle_orm_mysql_core.MySqlColumn<{
|
|
16575
|
+
name: "ttft_ms";
|
|
16576
|
+
tableName: "agent_run";
|
|
16577
|
+
dataType: "number";
|
|
16578
|
+
columnType: "MySqlInt";
|
|
16579
|
+
data: number;
|
|
16580
|
+
driverParam: string | number;
|
|
16581
|
+
notNull: false;
|
|
16582
|
+
hasDefault: false;
|
|
16583
|
+
isPrimaryKey: false;
|
|
16584
|
+
isAutoincrement: false;
|
|
16585
|
+
hasRuntimeDefault: false;
|
|
16586
|
+
enumValues: undefined;
|
|
16587
|
+
baseColumn: never;
|
|
16588
|
+
identity: undefined;
|
|
16589
|
+
generated: undefined;
|
|
16590
|
+
}, {}, {}>;
|
|
16591
|
+
costUsd: drizzle_orm_mysql_core.MySqlColumn<{
|
|
16592
|
+
name: "cost_usd";
|
|
16593
|
+
tableName: "agent_run";
|
|
16594
|
+
dataType: "number";
|
|
16595
|
+
columnType: "MySqlDouble";
|
|
16596
|
+
data: number;
|
|
16597
|
+
driverParam: string | number;
|
|
16598
|
+
notNull: false;
|
|
16599
|
+
hasDefault: false;
|
|
16600
|
+
isPrimaryKey: false;
|
|
16601
|
+
isAutoincrement: false;
|
|
16602
|
+
hasRuntimeDefault: false;
|
|
16603
|
+
enumValues: undefined;
|
|
16604
|
+
baseColumn: never;
|
|
16605
|
+
identity: undefined;
|
|
16606
|
+
generated: undefined;
|
|
16607
|
+
}, {}, {}>;
|
|
16608
|
+
modelId: drizzle_orm_mysql_core.MySqlColumn<{
|
|
16609
|
+
name: string;
|
|
16610
|
+
tableName: "agent_run";
|
|
16611
|
+
dataType: "string";
|
|
16612
|
+
columnType: "MySqlVarChar";
|
|
16613
|
+
data: string;
|
|
16614
|
+
driverParam: string | number;
|
|
16615
|
+
notNull: false;
|
|
16616
|
+
hasDefault: false;
|
|
16617
|
+
isPrimaryKey: false;
|
|
16618
|
+
isAutoincrement: false;
|
|
16619
|
+
hasRuntimeDefault: false;
|
|
16620
|
+
enumValues: [string, ...string[]];
|
|
16621
|
+
baseColumn: never;
|
|
16622
|
+
identity: undefined;
|
|
16623
|
+
generated: undefined;
|
|
16624
|
+
}, {}, {}>;
|
|
16423
16625
|
errorCode: drizzle_orm_mysql_core.MySqlColumn<{
|
|
16424
16626
|
name: string;
|
|
16425
16627
|
tableName: "agent_run";
|
package/dist/index.js
CHANGED
|
@@ -249,6 +249,12 @@ var agentRun = sqliteTable("agent_run", {
|
|
|
249
249
|
agentName: text("agent_name"),
|
|
250
250
|
status: text("status").$type().notNull(),
|
|
251
251
|
durationMs: integer("duration_ms"),
|
|
252
|
+
/** Turn start to the first `text` frame; null for a run that streamed none or did not complete. */
|
|
253
|
+
ttftMs: integer("ttft_ms"),
|
|
254
|
+
/** The run's known spend (the sum of its model calls with a known cost); null when none had one. */
|
|
255
|
+
costUsd: real("cost_usd"),
|
|
256
|
+
/** The model the run's last model call resolved to. */
|
|
257
|
+
modelId: text("model_id"),
|
|
252
258
|
errorCode: text("error_code"),
|
|
253
259
|
errorMessage: text("error_message"),
|
|
254
260
|
retries: integer("retries").notNull().default(0),
|
|
@@ -681,6 +687,12 @@ var agentRun2 = mysqlTable("agent_run", {
|
|
|
681
687
|
agentName: key("agent_name"),
|
|
682
688
|
status: key("status").$type().notNull(),
|
|
683
689
|
durationMs: int("duration_ms"),
|
|
690
|
+
/** Turn start to the first `text` frame; null for a run that streamed none or did not complete. */
|
|
691
|
+
ttftMs: int("ttft_ms"),
|
|
692
|
+
/** The run's known spend (the sum of its model calls with a known cost); null when none had one. */
|
|
693
|
+
costUsd: double("cost_usd"),
|
|
694
|
+
/** The model the run's last model call resolved to. */
|
|
695
|
+
modelId: key("model_id"),
|
|
684
696
|
errorCode: key("error_code"),
|
|
685
697
|
errorMessage: longtext("error_message"),
|
|
686
698
|
retries: int("retries").notNull().default(0),
|
|
@@ -1127,6 +1139,12 @@ var agentRun3 = pgTable("agent_run", {
|
|
|
1127
1139
|
agentName: text2("agent_name"),
|
|
1128
1140
|
status: text2("status").$type().notNull(),
|
|
1129
1141
|
durationMs: integer2("duration_ms"),
|
|
1142
|
+
/** Turn start to the first `text` frame; null for a run that streamed none or did not complete. */
|
|
1143
|
+
ttftMs: integer2("ttft_ms"),
|
|
1144
|
+
/** The run's known spend (the sum of its model calls with a known cost); null when none had one. */
|
|
1145
|
+
costUsd: doublePrecision("cost_usd"),
|
|
1146
|
+
/** The model the run's last model call resolved to. */
|
|
1147
|
+
modelId: text2("model_id"),
|
|
1130
1148
|
errorCode: text2("error_code"),
|
|
1131
1149
|
errorMessage: text2("error_message"),
|
|
1132
1150
|
retries: integer2("retries").notNull().default(0),
|
|
@@ -2742,6 +2760,9 @@ var DrizzleAgentStore = class {
|
|
|
2742
2760
|
agentName: run.agentName ?? null,
|
|
2743
2761
|
status: "running",
|
|
2744
2762
|
durationMs: null,
|
|
2763
|
+
ttftMs: null,
|
|
2764
|
+
costUsd: null,
|
|
2765
|
+
modelId: null,
|
|
2745
2766
|
errorCode: null,
|
|
2746
2767
|
errorMessage: null,
|
|
2747
2768
|
retries: 0,
|
|
@@ -2761,6 +2782,15 @@ var DrizzleAgentStore = class {
|
|
|
2761
2782
|
if (end.durationMs !== void 0) {
|
|
2762
2783
|
updates.durationMs = end.durationMs;
|
|
2763
2784
|
}
|
|
2785
|
+
if (end.ttftMs !== void 0) {
|
|
2786
|
+
updates.ttftMs = end.ttftMs;
|
|
2787
|
+
}
|
|
2788
|
+
if (end.costUsd !== void 0) {
|
|
2789
|
+
updates.costUsd = end.costUsd;
|
|
2790
|
+
}
|
|
2791
|
+
if (end.modelId !== void 0) {
|
|
2792
|
+
updates.modelId = end.modelId;
|
|
2793
|
+
}
|
|
2764
2794
|
if (end.errorCode !== void 0) {
|
|
2765
2795
|
updates.errorCode = end.errorCode;
|
|
2766
2796
|
}
|
|
@@ -3246,6 +3276,11 @@ function toRecentRunRow(run) {
|
|
|
3246
3276
|
agentName: run.agentName ?? null,
|
|
3247
3277
|
status: run.status,
|
|
3248
3278
|
durationMs: run.durationMs ?? null,
|
|
3279
|
+
ttftMs: run.ttftMs ?? null,
|
|
3280
|
+
// MySQL's DOUBLE and Postgres' double precision come back as numbers; a driver that hands a
|
|
3281
|
+
// decimal back as a string is normalized here so the SPI row is always a number.
|
|
3282
|
+
costUsd: run.costUsd == null ? null : Number(run.costUsd),
|
|
3283
|
+
modelId: run.modelId ?? null,
|
|
3249
3284
|
errorCode: run.errorCode ?? null,
|
|
3250
3285
|
errorMessage: run.errorMessage ?? null,
|
|
3251
3286
|
retries: run.retries,
|
|
@@ -3449,6 +3484,7 @@ var DrizzleGovernanceQueries = class {
|
|
|
3449
3484
|
let failed = 0;
|
|
3450
3485
|
let retries = 0;
|
|
3451
3486
|
const settledDurationsMs = [];
|
|
3487
|
+
const ttftsMs = [];
|
|
3452
3488
|
for (const run of runs) {
|
|
3453
3489
|
if (run.status === "completed") {
|
|
3454
3490
|
completed += 1;
|
|
@@ -3459,8 +3495,12 @@ var DrizzleGovernanceQueries = class {
|
|
|
3459
3495
|
if ((run.status === "completed" || run.status === "failed") && run.durationMs != null) {
|
|
3460
3496
|
settledDurationsMs.push(run.durationMs);
|
|
3461
3497
|
}
|
|
3498
|
+
if (run.status === "completed" && run.parentRunId == null && run.ttftMs != null) {
|
|
3499
|
+
ttftsMs.push(run.ttftMs);
|
|
3500
|
+
}
|
|
3462
3501
|
}
|
|
3463
3502
|
settledDurationsMs.sort((left, right) => left - right);
|
|
3503
|
+
ttftsMs.sort((left, right) => left - right);
|
|
3464
3504
|
return {
|
|
3465
3505
|
runs: runs.length,
|
|
3466
3506
|
completed,
|
|
@@ -3468,7 +3508,9 @@ var DrizzleGovernanceQueries = class {
|
|
|
3468
3508
|
successRate: runs.length === 0 ? 0 : completed / runs.length,
|
|
3469
3509
|
retries,
|
|
3470
3510
|
durationP50Ms: percentileMs(settledDurationsMs, 0.5),
|
|
3471
|
-
durationP95Ms: percentileMs(settledDurationsMs, 0.95)
|
|
3511
|
+
durationP95Ms: percentileMs(settledDurationsMs, 0.95),
|
|
3512
|
+
ttftP50Ms: percentileMs(ttftsMs, 0.5),
|
|
3513
|
+
ttftP95Ms: percentileMs(ttftsMs, 0.95)
|
|
3472
3514
|
};
|
|
3473
3515
|
}
|
|
3474
3516
|
async runsByAgent(range) {
|