@dudousxd/nestjs-agent-store-drizzle 0.18.3 → 0.19.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 +17 -0
- package/dist/index.cjs +207 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +523 -3
- package/dist/index.d.ts +523 -3
- package/dist/index.js +209 -3
- 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, ToolKind, ToolCallStatus, UsagePurpose, AgentStore, ThreadTurnReader, CreateThreadInput, ThreadSummary, ThreadDetail, ThreadTurnQuery, ThreadTurnPage, ToolCallApprovalState, 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, 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, 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';
|
|
@@ -172,6 +172,25 @@ declare const agentThread: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
172
172
|
}, {}, {
|
|
173
173
|
length: number | undefined;
|
|
174
174
|
}>;
|
|
175
|
+
queuePause: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
176
|
+
name: "queue_pause";
|
|
177
|
+
tableName: "agent_thread";
|
|
178
|
+
dataType: "json";
|
|
179
|
+
columnType: "SQLiteTextJson";
|
|
180
|
+
data: QueuePause;
|
|
181
|
+
driverParam: string;
|
|
182
|
+
notNull: false;
|
|
183
|
+
hasDefault: false;
|
|
184
|
+
isPrimaryKey: false;
|
|
185
|
+
isAutoincrement: false;
|
|
186
|
+
hasRuntimeDefault: false;
|
|
187
|
+
enumValues: undefined;
|
|
188
|
+
baseColumn: never;
|
|
189
|
+
identity: undefined;
|
|
190
|
+
generated: undefined;
|
|
191
|
+
}, {}, {
|
|
192
|
+
$type: QueuePause;
|
|
193
|
+
}>;
|
|
175
194
|
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
176
195
|
name: "created_at";
|
|
177
196
|
tableName: "agent_thread";
|
|
@@ -864,6 +883,239 @@ declare const agentToolCall: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
|
864
883
|
};
|
|
865
884
|
dialect: "sqlite";
|
|
866
885
|
}>;
|
|
886
|
+
/**
|
|
887
|
+
* A message sent while a turn was running on its thread, waiting to run after it — see the core
|
|
888
|
+
* `ChatQueueStore`. Not part of the transcript: the turn it starts appends it as its user message,
|
|
889
|
+
* and the row is deleted as it starts. `position` orders a thread's queue (head first); it is
|
|
890
|
+
* rewritten on a move, and only ever compared within one thread. `threadId` cascades on delete.
|
|
891
|
+
*/
|
|
892
|
+
declare const agentQueuedMessage: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
893
|
+
name: "agent_queued_message";
|
|
894
|
+
schema: undefined;
|
|
895
|
+
columns: {
|
|
896
|
+
id: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
897
|
+
name: "id";
|
|
898
|
+
tableName: "agent_queued_message";
|
|
899
|
+
dataType: "string";
|
|
900
|
+
columnType: "SQLiteText";
|
|
901
|
+
data: string;
|
|
902
|
+
driverParam: string;
|
|
903
|
+
notNull: true;
|
|
904
|
+
hasDefault: false;
|
|
905
|
+
isPrimaryKey: true;
|
|
906
|
+
isAutoincrement: false;
|
|
907
|
+
hasRuntimeDefault: false;
|
|
908
|
+
enumValues: [string, ...string[]];
|
|
909
|
+
baseColumn: never;
|
|
910
|
+
identity: undefined;
|
|
911
|
+
generated: undefined;
|
|
912
|
+
}, {}, {
|
|
913
|
+
length: number | undefined;
|
|
914
|
+
}>;
|
|
915
|
+
threadId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
916
|
+
name: "thread_id";
|
|
917
|
+
tableName: "agent_queued_message";
|
|
918
|
+
dataType: "string";
|
|
919
|
+
columnType: "SQLiteText";
|
|
920
|
+
data: string;
|
|
921
|
+
driverParam: string;
|
|
922
|
+
notNull: true;
|
|
923
|
+
hasDefault: false;
|
|
924
|
+
isPrimaryKey: false;
|
|
925
|
+
isAutoincrement: false;
|
|
926
|
+
hasRuntimeDefault: false;
|
|
927
|
+
enumValues: [string, ...string[]];
|
|
928
|
+
baseColumn: never;
|
|
929
|
+
identity: undefined;
|
|
930
|
+
generated: undefined;
|
|
931
|
+
}, {}, {
|
|
932
|
+
length: number | undefined;
|
|
933
|
+
}>;
|
|
934
|
+
actor: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
935
|
+
name: "actor";
|
|
936
|
+
tableName: "agent_queued_message";
|
|
937
|
+
dataType: "json";
|
|
938
|
+
columnType: "SQLiteTextJson";
|
|
939
|
+
data: Actor;
|
|
940
|
+
driverParam: string;
|
|
941
|
+
notNull: true;
|
|
942
|
+
hasDefault: false;
|
|
943
|
+
isPrimaryKey: false;
|
|
944
|
+
isAutoincrement: false;
|
|
945
|
+
hasRuntimeDefault: false;
|
|
946
|
+
enumValues: undefined;
|
|
947
|
+
baseColumn: never;
|
|
948
|
+
identity: undefined;
|
|
949
|
+
generated: undefined;
|
|
950
|
+
}, {}, {
|
|
951
|
+
$type: Actor;
|
|
952
|
+
}>;
|
|
953
|
+
content: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
954
|
+
name: "content";
|
|
955
|
+
tableName: "agent_queued_message";
|
|
956
|
+
dataType: "string";
|
|
957
|
+
columnType: "SQLiteText";
|
|
958
|
+
data: string;
|
|
959
|
+
driverParam: string;
|
|
960
|
+
notNull: true;
|
|
961
|
+
hasDefault: false;
|
|
962
|
+
isPrimaryKey: false;
|
|
963
|
+
isAutoincrement: false;
|
|
964
|
+
hasRuntimeDefault: false;
|
|
965
|
+
enumValues: [string, ...string[]];
|
|
966
|
+
baseColumn: never;
|
|
967
|
+
identity: undefined;
|
|
968
|
+
generated: undefined;
|
|
969
|
+
}, {}, {
|
|
970
|
+
length: number | undefined;
|
|
971
|
+
}>;
|
|
972
|
+
attachments: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
973
|
+
name: "attachments";
|
|
974
|
+
tableName: "agent_queued_message";
|
|
975
|
+
dataType: "json";
|
|
976
|
+
columnType: "SQLiteTextJson";
|
|
977
|
+
data: MessageAttachment[];
|
|
978
|
+
driverParam: string;
|
|
979
|
+
notNull: false;
|
|
980
|
+
hasDefault: false;
|
|
981
|
+
isPrimaryKey: false;
|
|
982
|
+
isAutoincrement: false;
|
|
983
|
+
hasRuntimeDefault: false;
|
|
984
|
+
enumValues: undefined;
|
|
985
|
+
baseColumn: never;
|
|
986
|
+
identity: undefined;
|
|
987
|
+
generated: undefined;
|
|
988
|
+
}, {}, {
|
|
989
|
+
$type: MessageAttachment[];
|
|
990
|
+
}>;
|
|
991
|
+
agentName: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
992
|
+
name: "agent_name";
|
|
993
|
+
tableName: "agent_queued_message";
|
|
994
|
+
dataType: "string";
|
|
995
|
+
columnType: "SQLiteText";
|
|
996
|
+
data: string;
|
|
997
|
+
driverParam: string;
|
|
998
|
+
notNull: false;
|
|
999
|
+
hasDefault: false;
|
|
1000
|
+
isPrimaryKey: false;
|
|
1001
|
+
isAutoincrement: false;
|
|
1002
|
+
hasRuntimeDefault: false;
|
|
1003
|
+
enumValues: [string, ...string[]];
|
|
1004
|
+
baseColumn: never;
|
|
1005
|
+
identity: undefined;
|
|
1006
|
+
generated: undefined;
|
|
1007
|
+
}, {}, {
|
|
1008
|
+
length: number | undefined;
|
|
1009
|
+
}>;
|
|
1010
|
+
model: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1011
|
+
name: "model";
|
|
1012
|
+
tableName: "agent_queued_message";
|
|
1013
|
+
dataType: "string";
|
|
1014
|
+
columnType: "SQLiteText";
|
|
1015
|
+
data: string;
|
|
1016
|
+
driverParam: string;
|
|
1017
|
+
notNull: false;
|
|
1018
|
+
hasDefault: false;
|
|
1019
|
+
isPrimaryKey: false;
|
|
1020
|
+
isAutoincrement: false;
|
|
1021
|
+
hasRuntimeDefault: false;
|
|
1022
|
+
enumValues: [string, ...string[]];
|
|
1023
|
+
baseColumn: never;
|
|
1024
|
+
identity: undefined;
|
|
1025
|
+
generated: undefined;
|
|
1026
|
+
}, {}, {
|
|
1027
|
+
length: number | undefined;
|
|
1028
|
+
}>;
|
|
1029
|
+
pageContext: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1030
|
+
name: "page_context";
|
|
1031
|
+
tableName: "agent_queued_message";
|
|
1032
|
+
dataType: "json";
|
|
1033
|
+
columnType: "SQLiteTextJson";
|
|
1034
|
+
data: PageContext;
|
|
1035
|
+
driverParam: string;
|
|
1036
|
+
notNull: false;
|
|
1037
|
+
hasDefault: false;
|
|
1038
|
+
isPrimaryKey: false;
|
|
1039
|
+
isAutoincrement: false;
|
|
1040
|
+
hasRuntimeDefault: false;
|
|
1041
|
+
enumValues: undefined;
|
|
1042
|
+
baseColumn: never;
|
|
1043
|
+
identity: undefined;
|
|
1044
|
+
generated: undefined;
|
|
1045
|
+
}, {}, {
|
|
1046
|
+
$type: PageContext;
|
|
1047
|
+
}>;
|
|
1048
|
+
interrupt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1049
|
+
name: "interrupt";
|
|
1050
|
+
tableName: "agent_queued_message";
|
|
1051
|
+
dataType: "boolean";
|
|
1052
|
+
columnType: "SQLiteBoolean";
|
|
1053
|
+
data: boolean;
|
|
1054
|
+
driverParam: number;
|
|
1055
|
+
notNull: true;
|
|
1056
|
+
hasDefault: true;
|
|
1057
|
+
isPrimaryKey: false;
|
|
1058
|
+
isAutoincrement: false;
|
|
1059
|
+
hasRuntimeDefault: false;
|
|
1060
|
+
enumValues: undefined;
|
|
1061
|
+
baseColumn: never;
|
|
1062
|
+
identity: undefined;
|
|
1063
|
+
generated: undefined;
|
|
1064
|
+
}, {}, {}>;
|
|
1065
|
+
position: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1066
|
+
name: "position";
|
|
1067
|
+
tableName: "agent_queued_message";
|
|
1068
|
+
dataType: "number";
|
|
1069
|
+
columnType: "SQLiteInteger";
|
|
1070
|
+
data: number;
|
|
1071
|
+
driverParam: number;
|
|
1072
|
+
notNull: true;
|
|
1073
|
+
hasDefault: false;
|
|
1074
|
+
isPrimaryKey: false;
|
|
1075
|
+
isAutoincrement: false;
|
|
1076
|
+
hasRuntimeDefault: false;
|
|
1077
|
+
enumValues: undefined;
|
|
1078
|
+
baseColumn: never;
|
|
1079
|
+
identity: undefined;
|
|
1080
|
+
generated: undefined;
|
|
1081
|
+
}, {}, {}>;
|
|
1082
|
+
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1083
|
+
name: "created_at";
|
|
1084
|
+
tableName: "agent_queued_message";
|
|
1085
|
+
dataType: "date";
|
|
1086
|
+
columnType: "SQLiteTimestamp";
|
|
1087
|
+
data: Date;
|
|
1088
|
+
driverParam: number;
|
|
1089
|
+
notNull: true;
|
|
1090
|
+
hasDefault: false;
|
|
1091
|
+
isPrimaryKey: false;
|
|
1092
|
+
isAutoincrement: false;
|
|
1093
|
+
hasRuntimeDefault: false;
|
|
1094
|
+
enumValues: undefined;
|
|
1095
|
+
baseColumn: never;
|
|
1096
|
+
identity: undefined;
|
|
1097
|
+
generated: undefined;
|
|
1098
|
+
}, {}, {}>;
|
|
1099
|
+
updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
1100
|
+
name: "updated_at";
|
|
1101
|
+
tableName: "agent_queued_message";
|
|
1102
|
+
dataType: "date";
|
|
1103
|
+
columnType: "SQLiteTimestamp";
|
|
1104
|
+
data: Date;
|
|
1105
|
+
driverParam: number;
|
|
1106
|
+
notNull: true;
|
|
1107
|
+
hasDefault: false;
|
|
1108
|
+
isPrimaryKey: false;
|
|
1109
|
+
isAutoincrement: false;
|
|
1110
|
+
hasRuntimeDefault: false;
|
|
1111
|
+
enumValues: undefined;
|
|
1112
|
+
baseColumn: never;
|
|
1113
|
+
identity: undefined;
|
|
1114
|
+
generated: undefined;
|
|
1115
|
+
}, {}, {}>;
|
|
1116
|
+
};
|
|
1117
|
+
dialect: "sqlite";
|
|
1118
|
+
}>;
|
|
867
1119
|
/** A token-usage ledger row, summed per actor per day by `quotaToday`. */
|
|
868
1120
|
declare const agentTokenUsage: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
869
1121
|
name: "agent_token_usage";
|
|
@@ -2147,6 +2399,25 @@ declare const agentSchema: {
|
|
|
2147
2399
|
}, {}, {
|
|
2148
2400
|
length: number | undefined;
|
|
2149
2401
|
}>;
|
|
2402
|
+
queuePause: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2403
|
+
name: "queue_pause";
|
|
2404
|
+
tableName: "agent_thread";
|
|
2405
|
+
dataType: "json";
|
|
2406
|
+
columnType: "SQLiteTextJson";
|
|
2407
|
+
data: QueuePause;
|
|
2408
|
+
driverParam: string;
|
|
2409
|
+
notNull: false;
|
|
2410
|
+
hasDefault: false;
|
|
2411
|
+
isPrimaryKey: false;
|
|
2412
|
+
isAutoincrement: false;
|
|
2413
|
+
hasRuntimeDefault: false;
|
|
2414
|
+
enumValues: undefined;
|
|
2415
|
+
baseColumn: never;
|
|
2416
|
+
identity: undefined;
|
|
2417
|
+
generated: undefined;
|
|
2418
|
+
}, {}, {
|
|
2419
|
+
$type: QueuePause;
|
|
2420
|
+
}>;
|
|
2150
2421
|
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2151
2422
|
name: "created_at";
|
|
2152
2423
|
tableName: "agent_thread";
|
|
@@ -2509,6 +2780,233 @@ declare const agentSchema: {
|
|
|
2509
2780
|
};
|
|
2510
2781
|
dialect: "sqlite";
|
|
2511
2782
|
}>;
|
|
2783
|
+
agentQueuedMessage: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
2784
|
+
name: "agent_queued_message";
|
|
2785
|
+
schema: undefined;
|
|
2786
|
+
columns: {
|
|
2787
|
+
id: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2788
|
+
name: "id";
|
|
2789
|
+
tableName: "agent_queued_message";
|
|
2790
|
+
dataType: "string";
|
|
2791
|
+
columnType: "SQLiteText";
|
|
2792
|
+
data: string;
|
|
2793
|
+
driverParam: string;
|
|
2794
|
+
notNull: true;
|
|
2795
|
+
hasDefault: false;
|
|
2796
|
+
isPrimaryKey: true;
|
|
2797
|
+
isAutoincrement: false;
|
|
2798
|
+
hasRuntimeDefault: false;
|
|
2799
|
+
enumValues: [string, ...string[]];
|
|
2800
|
+
baseColumn: never;
|
|
2801
|
+
identity: undefined;
|
|
2802
|
+
generated: undefined;
|
|
2803
|
+
}, {}, {
|
|
2804
|
+
length: number | undefined;
|
|
2805
|
+
}>;
|
|
2806
|
+
threadId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2807
|
+
name: "thread_id";
|
|
2808
|
+
tableName: "agent_queued_message";
|
|
2809
|
+
dataType: "string";
|
|
2810
|
+
columnType: "SQLiteText";
|
|
2811
|
+
data: string;
|
|
2812
|
+
driverParam: string;
|
|
2813
|
+
notNull: true;
|
|
2814
|
+
hasDefault: false;
|
|
2815
|
+
isPrimaryKey: false;
|
|
2816
|
+
isAutoincrement: false;
|
|
2817
|
+
hasRuntimeDefault: false;
|
|
2818
|
+
enumValues: [string, ...string[]];
|
|
2819
|
+
baseColumn: never;
|
|
2820
|
+
identity: undefined;
|
|
2821
|
+
generated: undefined;
|
|
2822
|
+
}, {}, {
|
|
2823
|
+
length: number | undefined;
|
|
2824
|
+
}>;
|
|
2825
|
+
actor: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2826
|
+
name: "actor";
|
|
2827
|
+
tableName: "agent_queued_message";
|
|
2828
|
+
dataType: "json";
|
|
2829
|
+
columnType: "SQLiteTextJson";
|
|
2830
|
+
data: Actor;
|
|
2831
|
+
driverParam: string;
|
|
2832
|
+
notNull: true;
|
|
2833
|
+
hasDefault: false;
|
|
2834
|
+
isPrimaryKey: false;
|
|
2835
|
+
isAutoincrement: false;
|
|
2836
|
+
hasRuntimeDefault: false;
|
|
2837
|
+
enumValues: undefined;
|
|
2838
|
+
baseColumn: never;
|
|
2839
|
+
identity: undefined;
|
|
2840
|
+
generated: undefined;
|
|
2841
|
+
}, {}, {
|
|
2842
|
+
$type: Actor;
|
|
2843
|
+
}>;
|
|
2844
|
+
content: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2845
|
+
name: "content";
|
|
2846
|
+
tableName: "agent_queued_message";
|
|
2847
|
+
dataType: "string";
|
|
2848
|
+
columnType: "SQLiteText";
|
|
2849
|
+
data: string;
|
|
2850
|
+
driverParam: string;
|
|
2851
|
+
notNull: true;
|
|
2852
|
+
hasDefault: false;
|
|
2853
|
+
isPrimaryKey: false;
|
|
2854
|
+
isAutoincrement: false;
|
|
2855
|
+
hasRuntimeDefault: false;
|
|
2856
|
+
enumValues: [string, ...string[]];
|
|
2857
|
+
baseColumn: never;
|
|
2858
|
+
identity: undefined;
|
|
2859
|
+
generated: undefined;
|
|
2860
|
+
}, {}, {
|
|
2861
|
+
length: number | undefined;
|
|
2862
|
+
}>;
|
|
2863
|
+
attachments: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2864
|
+
name: "attachments";
|
|
2865
|
+
tableName: "agent_queued_message";
|
|
2866
|
+
dataType: "json";
|
|
2867
|
+
columnType: "SQLiteTextJson";
|
|
2868
|
+
data: MessageAttachment[];
|
|
2869
|
+
driverParam: string;
|
|
2870
|
+
notNull: false;
|
|
2871
|
+
hasDefault: false;
|
|
2872
|
+
isPrimaryKey: false;
|
|
2873
|
+
isAutoincrement: false;
|
|
2874
|
+
hasRuntimeDefault: false;
|
|
2875
|
+
enumValues: undefined;
|
|
2876
|
+
baseColumn: never;
|
|
2877
|
+
identity: undefined;
|
|
2878
|
+
generated: undefined;
|
|
2879
|
+
}, {}, {
|
|
2880
|
+
$type: MessageAttachment[];
|
|
2881
|
+
}>;
|
|
2882
|
+
agentName: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2883
|
+
name: "agent_name";
|
|
2884
|
+
tableName: "agent_queued_message";
|
|
2885
|
+
dataType: "string";
|
|
2886
|
+
columnType: "SQLiteText";
|
|
2887
|
+
data: string;
|
|
2888
|
+
driverParam: string;
|
|
2889
|
+
notNull: false;
|
|
2890
|
+
hasDefault: false;
|
|
2891
|
+
isPrimaryKey: false;
|
|
2892
|
+
isAutoincrement: false;
|
|
2893
|
+
hasRuntimeDefault: false;
|
|
2894
|
+
enumValues: [string, ...string[]];
|
|
2895
|
+
baseColumn: never;
|
|
2896
|
+
identity: undefined;
|
|
2897
|
+
generated: undefined;
|
|
2898
|
+
}, {}, {
|
|
2899
|
+
length: number | undefined;
|
|
2900
|
+
}>;
|
|
2901
|
+
model: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2902
|
+
name: "model";
|
|
2903
|
+
tableName: "agent_queued_message";
|
|
2904
|
+
dataType: "string";
|
|
2905
|
+
columnType: "SQLiteText";
|
|
2906
|
+
data: string;
|
|
2907
|
+
driverParam: string;
|
|
2908
|
+
notNull: false;
|
|
2909
|
+
hasDefault: false;
|
|
2910
|
+
isPrimaryKey: false;
|
|
2911
|
+
isAutoincrement: false;
|
|
2912
|
+
hasRuntimeDefault: false;
|
|
2913
|
+
enumValues: [string, ...string[]];
|
|
2914
|
+
baseColumn: never;
|
|
2915
|
+
identity: undefined;
|
|
2916
|
+
generated: undefined;
|
|
2917
|
+
}, {}, {
|
|
2918
|
+
length: number | undefined;
|
|
2919
|
+
}>;
|
|
2920
|
+
pageContext: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2921
|
+
name: "page_context";
|
|
2922
|
+
tableName: "agent_queued_message";
|
|
2923
|
+
dataType: "json";
|
|
2924
|
+
columnType: "SQLiteTextJson";
|
|
2925
|
+
data: PageContext;
|
|
2926
|
+
driverParam: string;
|
|
2927
|
+
notNull: false;
|
|
2928
|
+
hasDefault: false;
|
|
2929
|
+
isPrimaryKey: false;
|
|
2930
|
+
isAutoincrement: false;
|
|
2931
|
+
hasRuntimeDefault: false;
|
|
2932
|
+
enumValues: undefined;
|
|
2933
|
+
baseColumn: never;
|
|
2934
|
+
identity: undefined;
|
|
2935
|
+
generated: undefined;
|
|
2936
|
+
}, {}, {
|
|
2937
|
+
$type: PageContext;
|
|
2938
|
+
}>;
|
|
2939
|
+
interrupt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2940
|
+
name: "interrupt";
|
|
2941
|
+
tableName: "agent_queued_message";
|
|
2942
|
+
dataType: "boolean";
|
|
2943
|
+
columnType: "SQLiteBoolean";
|
|
2944
|
+
data: boolean;
|
|
2945
|
+
driverParam: number;
|
|
2946
|
+
notNull: true;
|
|
2947
|
+
hasDefault: true;
|
|
2948
|
+
isPrimaryKey: false;
|
|
2949
|
+
isAutoincrement: false;
|
|
2950
|
+
hasRuntimeDefault: false;
|
|
2951
|
+
enumValues: undefined;
|
|
2952
|
+
baseColumn: never;
|
|
2953
|
+
identity: undefined;
|
|
2954
|
+
generated: undefined;
|
|
2955
|
+
}, {}, {}>;
|
|
2956
|
+
position: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2957
|
+
name: "position";
|
|
2958
|
+
tableName: "agent_queued_message";
|
|
2959
|
+
dataType: "number";
|
|
2960
|
+
columnType: "SQLiteInteger";
|
|
2961
|
+
data: number;
|
|
2962
|
+
driverParam: number;
|
|
2963
|
+
notNull: true;
|
|
2964
|
+
hasDefault: false;
|
|
2965
|
+
isPrimaryKey: false;
|
|
2966
|
+
isAutoincrement: false;
|
|
2967
|
+
hasRuntimeDefault: false;
|
|
2968
|
+
enumValues: undefined;
|
|
2969
|
+
baseColumn: never;
|
|
2970
|
+
identity: undefined;
|
|
2971
|
+
generated: undefined;
|
|
2972
|
+
}, {}, {}>;
|
|
2973
|
+
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2974
|
+
name: "created_at";
|
|
2975
|
+
tableName: "agent_queued_message";
|
|
2976
|
+
dataType: "date";
|
|
2977
|
+
columnType: "SQLiteTimestamp";
|
|
2978
|
+
data: Date;
|
|
2979
|
+
driverParam: number;
|
|
2980
|
+
notNull: true;
|
|
2981
|
+
hasDefault: false;
|
|
2982
|
+
isPrimaryKey: false;
|
|
2983
|
+
isAutoincrement: false;
|
|
2984
|
+
hasRuntimeDefault: false;
|
|
2985
|
+
enumValues: undefined;
|
|
2986
|
+
baseColumn: never;
|
|
2987
|
+
identity: undefined;
|
|
2988
|
+
generated: undefined;
|
|
2989
|
+
}, {}, {}>;
|
|
2990
|
+
updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
2991
|
+
name: "updated_at";
|
|
2992
|
+
tableName: "agent_queued_message";
|
|
2993
|
+
dataType: "date";
|
|
2994
|
+
columnType: "SQLiteTimestamp";
|
|
2995
|
+
data: Date;
|
|
2996
|
+
driverParam: number;
|
|
2997
|
+
notNull: true;
|
|
2998
|
+
hasDefault: false;
|
|
2999
|
+
isPrimaryKey: false;
|
|
3000
|
+
isAutoincrement: false;
|
|
3001
|
+
hasRuntimeDefault: false;
|
|
3002
|
+
enumValues: undefined;
|
|
3003
|
+
baseColumn: never;
|
|
3004
|
+
identity: undefined;
|
|
3005
|
+
generated: undefined;
|
|
3006
|
+
}, {}, {}>;
|
|
3007
|
+
};
|
|
3008
|
+
dialect: "sqlite";
|
|
3009
|
+
}>;
|
|
2512
3010
|
agentToolCall: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
2513
3011
|
name: "agent_tool_call";
|
|
2514
3012
|
schema: undefined;
|
|
@@ -3914,6 +4412,8 @@ type AgentDrizzleDb = BaseSQLiteDatabase<'sync' | 'async', unknown, Record<strin
|
|
|
3914
4412
|
type AgentThreadRow = typeof agentThread.$inferSelect;
|
|
3915
4413
|
/** A persisted message row as Drizzle selects it. */
|
|
3916
4414
|
type AgentMessageRow = typeof agentMessage.$inferSelect;
|
|
4415
|
+
/** A persisted queued message row as Drizzle selects it. */
|
|
4416
|
+
type AgentQueuedMessageRow = typeof agentQueuedMessage.$inferSelect;
|
|
3917
4417
|
/** A persisted run row as Drizzle selects it. */
|
|
3918
4418
|
type AgentRunRow = typeof agentRun.$inferSelect;
|
|
3919
4419
|
/** A persisted memory row as Drizzle selects it. */
|
|
@@ -3933,7 +4433,7 @@ declare function ensureAgentSchema(db: AgentDrizzleDb): Promise<void>;
|
|
|
3933
4433
|
* owns the connection). Behaviour mirrors {@link import('@dudousxd/nestjs-agent-store-mikro-orm')}
|
|
3934
4434
|
* exactly (fork/truncate/quota/active-stream/soft-delete semantics) so the two are interchangeable.
|
|
3935
4435
|
*/
|
|
3936
|
-
declare class DrizzleAgentStore implements AgentStore, ThreadTurnReader {
|
|
4436
|
+
declare class DrizzleAgentStore implements AgentStore, ThreadTurnReader, ChatQueueStore {
|
|
3937
4437
|
private readonly db;
|
|
3938
4438
|
constructor(db: AgentDrizzleDb);
|
|
3939
4439
|
createThread(input: CreateThreadInput): Promise<ThreadSummary>;
|
|
@@ -3976,6 +4476,26 @@ declare class DrizzleAgentStore implements AgentStore, ThreadTurnReader {
|
|
|
3976
4476
|
ownerOfActiveStream(runId: string): Promise<string | null>;
|
|
3977
4477
|
setTitle(threadId: string, title: string): Promise<void>;
|
|
3978
4478
|
promoteThread(threadId: string): Promise<void>;
|
|
4479
|
+
/** The run streaming the thread, or `null` — a projection of the one column. */
|
|
4480
|
+
activeRunForThread(threadId: string): Promise<string | null>;
|
|
4481
|
+
/**
|
|
4482
|
+
* One conditional UPDATE, so of two racing claims exactly one changes the row: set the holder to
|
|
4483
|
+
* `runId` only when there is none, it is already `runId`, or it is `replacing`.
|
|
4484
|
+
*/
|
|
4485
|
+
claimActiveStream(threadId: string, runId: string, options?: {
|
|
4486
|
+
replacing?: string;
|
|
4487
|
+
}): Promise<boolean>;
|
|
4488
|
+
releaseActiveStream(threadId: string, runId: string): Promise<boolean>;
|
|
4489
|
+
enqueueMessage(input: EnqueueMessageInput): Promise<QueuedMessage>;
|
|
4490
|
+
listQueue(threadId: string): Promise<QueuedMessage[]>;
|
|
4491
|
+
getQueuedMessage(id: string): Promise<QueuedMessage | null>;
|
|
4492
|
+
updateQueuedMessage(id: string, patch: QueuedMessagePatch): Promise<QueuedMessage | null>;
|
|
4493
|
+
/** Rewrites the thread's positions as 0..n-1 in the new order — a queue is a handful of rows. */
|
|
4494
|
+
moveQueuedMessage(id: string, index: number): Promise<boolean>;
|
|
4495
|
+
removeQueuedMessage(id: string): Promise<boolean>;
|
|
4496
|
+
clearQueue(threadId: string): Promise<number>;
|
|
4497
|
+
queuePause(threadId: string): Promise<QueuePause | null>;
|
|
4498
|
+
setQueuePause(threadId: string, pause: QueuePause | null): Promise<void>;
|
|
3979
4499
|
setActiveStream(threadId: string, runId: string | null): Promise<void>;
|
|
3980
4500
|
/**
|
|
3981
4501
|
* Patch a thread's `title` and/or `defaultAgent`. Each field is only touched when PRESENT in
|
|
@@ -4451,4 +4971,4 @@ declare class DrizzleAgentStoreModule {
|
|
|
4451
4971
|
static forRoot(options: DrizzleAgentStoreModuleOptions): DynamicModule;
|
|
4452
4972
|
}
|
|
4453
4973
|
|
|
4454
|
-
export { type AgentDrizzleDb, type AgentMemoryRow, type AgentMessageRow, 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, agentRun, agentSchema, agentThread, agentTokenUsage, agentToolCall, ensureAgentSchema, ragIngestionLog };
|
|
4974
|
+
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 };
|