@synap-core/api-types 1.1.5 → 1.2.1
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/generated.d.ts +512 -0
- package/package.json +1 -1
- package/src/generated.d.ts +512 -0
package/dist/generated.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
+
import { Column, SQL } from 'drizzle-orm';
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* Context Types
|
|
5
7
|
*
|
|
@@ -53,6 +55,333 @@ export interface Context {
|
|
|
53
55
|
req?: Request;
|
|
54
56
|
socketIO?: any;
|
|
55
57
|
}
|
|
58
|
+
declare const chatThreads: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
59
|
+
name: "chat_threads";
|
|
60
|
+
schema: undefined;
|
|
61
|
+
columns: {
|
|
62
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
63
|
+
name: "id";
|
|
64
|
+
tableName: "chat_threads";
|
|
65
|
+
dataType: "string";
|
|
66
|
+
columnType: "PgUUID";
|
|
67
|
+
data: string;
|
|
68
|
+
driverParam: string;
|
|
69
|
+
notNull: true;
|
|
70
|
+
hasDefault: true;
|
|
71
|
+
isPrimaryKey: true;
|
|
72
|
+
isAutoincrement: false;
|
|
73
|
+
hasRuntimeDefault: false;
|
|
74
|
+
enumValues: undefined;
|
|
75
|
+
baseColumn: never;
|
|
76
|
+
identity: undefined;
|
|
77
|
+
generated: undefined;
|
|
78
|
+
}, {}, {}>;
|
|
79
|
+
userId: import("drizzle-orm/pg-core").PgColumn<{
|
|
80
|
+
name: "user_id";
|
|
81
|
+
tableName: "chat_threads";
|
|
82
|
+
dataType: "string";
|
|
83
|
+
columnType: "PgText";
|
|
84
|
+
data: string;
|
|
85
|
+
driverParam: string;
|
|
86
|
+
notNull: true;
|
|
87
|
+
hasDefault: false;
|
|
88
|
+
isPrimaryKey: false;
|
|
89
|
+
isAutoincrement: false;
|
|
90
|
+
hasRuntimeDefault: false;
|
|
91
|
+
enumValues: [
|
|
92
|
+
string,
|
|
93
|
+
...string[]
|
|
94
|
+
];
|
|
95
|
+
baseColumn: never;
|
|
96
|
+
identity: undefined;
|
|
97
|
+
generated: undefined;
|
|
98
|
+
}, {}, {}>;
|
|
99
|
+
projectId: import("drizzle-orm/pg-core").PgColumn<{
|
|
100
|
+
name: "project_id";
|
|
101
|
+
tableName: "chat_threads";
|
|
102
|
+
dataType: "string";
|
|
103
|
+
columnType: "PgUUID";
|
|
104
|
+
data: string;
|
|
105
|
+
driverParam: string;
|
|
106
|
+
notNull: false;
|
|
107
|
+
hasDefault: false;
|
|
108
|
+
isPrimaryKey: false;
|
|
109
|
+
isAutoincrement: false;
|
|
110
|
+
hasRuntimeDefault: false;
|
|
111
|
+
enumValues: undefined;
|
|
112
|
+
baseColumn: never;
|
|
113
|
+
identity: undefined;
|
|
114
|
+
generated: undefined;
|
|
115
|
+
}, {}, {}>;
|
|
116
|
+
title: import("drizzle-orm/pg-core").PgColumn<{
|
|
117
|
+
name: "title";
|
|
118
|
+
tableName: "chat_threads";
|
|
119
|
+
dataType: "string";
|
|
120
|
+
columnType: "PgText";
|
|
121
|
+
data: string;
|
|
122
|
+
driverParam: string;
|
|
123
|
+
notNull: false;
|
|
124
|
+
hasDefault: false;
|
|
125
|
+
isPrimaryKey: false;
|
|
126
|
+
isAutoincrement: false;
|
|
127
|
+
hasRuntimeDefault: false;
|
|
128
|
+
enumValues: [
|
|
129
|
+
string,
|
|
130
|
+
...string[]
|
|
131
|
+
];
|
|
132
|
+
baseColumn: never;
|
|
133
|
+
identity: undefined;
|
|
134
|
+
generated: undefined;
|
|
135
|
+
}, {}, {}>;
|
|
136
|
+
threadType: import("drizzle-orm/pg-core").PgColumn<{
|
|
137
|
+
name: "thread_type";
|
|
138
|
+
tableName: "chat_threads";
|
|
139
|
+
dataType: "string";
|
|
140
|
+
columnType: "PgText";
|
|
141
|
+
data: "main" | "branch";
|
|
142
|
+
driverParam: string;
|
|
143
|
+
notNull: true;
|
|
144
|
+
hasDefault: true;
|
|
145
|
+
isPrimaryKey: false;
|
|
146
|
+
isAutoincrement: false;
|
|
147
|
+
hasRuntimeDefault: false;
|
|
148
|
+
enumValues: [
|
|
149
|
+
"main",
|
|
150
|
+
"branch"
|
|
151
|
+
];
|
|
152
|
+
baseColumn: never;
|
|
153
|
+
identity: undefined;
|
|
154
|
+
generated: undefined;
|
|
155
|
+
}, {}, {}>;
|
|
156
|
+
parentThreadId: import("drizzle-orm/pg-core").PgColumn<{
|
|
157
|
+
name: "parent_thread_id";
|
|
158
|
+
tableName: "chat_threads";
|
|
159
|
+
dataType: "string";
|
|
160
|
+
columnType: "PgUUID";
|
|
161
|
+
data: string;
|
|
162
|
+
driverParam: string;
|
|
163
|
+
notNull: false;
|
|
164
|
+
hasDefault: false;
|
|
165
|
+
isPrimaryKey: false;
|
|
166
|
+
isAutoincrement: false;
|
|
167
|
+
hasRuntimeDefault: false;
|
|
168
|
+
enumValues: undefined;
|
|
169
|
+
baseColumn: never;
|
|
170
|
+
identity: undefined;
|
|
171
|
+
generated: undefined;
|
|
172
|
+
}, {}, {}>;
|
|
173
|
+
branchedFromMessageId: import("drizzle-orm/pg-core").PgColumn<{
|
|
174
|
+
name: "branched_from_message_id";
|
|
175
|
+
tableName: "chat_threads";
|
|
176
|
+
dataType: "string";
|
|
177
|
+
columnType: "PgUUID";
|
|
178
|
+
data: string;
|
|
179
|
+
driverParam: string;
|
|
180
|
+
notNull: false;
|
|
181
|
+
hasDefault: false;
|
|
182
|
+
isPrimaryKey: false;
|
|
183
|
+
isAutoincrement: false;
|
|
184
|
+
hasRuntimeDefault: false;
|
|
185
|
+
enumValues: undefined;
|
|
186
|
+
baseColumn: never;
|
|
187
|
+
identity: undefined;
|
|
188
|
+
generated: undefined;
|
|
189
|
+
}, {}, {}>;
|
|
190
|
+
branchPurpose: import("drizzle-orm/pg-core").PgColumn<{
|
|
191
|
+
name: "branch_purpose";
|
|
192
|
+
tableName: "chat_threads";
|
|
193
|
+
dataType: "string";
|
|
194
|
+
columnType: "PgText";
|
|
195
|
+
data: string;
|
|
196
|
+
driverParam: string;
|
|
197
|
+
notNull: false;
|
|
198
|
+
hasDefault: false;
|
|
199
|
+
isPrimaryKey: false;
|
|
200
|
+
isAutoincrement: false;
|
|
201
|
+
hasRuntimeDefault: false;
|
|
202
|
+
enumValues: [
|
|
203
|
+
string,
|
|
204
|
+
...string[]
|
|
205
|
+
];
|
|
206
|
+
baseColumn: never;
|
|
207
|
+
identity: undefined;
|
|
208
|
+
generated: undefined;
|
|
209
|
+
}, {}, {}>;
|
|
210
|
+
agentId: import("drizzle-orm/pg-core").PgColumn<{
|
|
211
|
+
name: "agent_id";
|
|
212
|
+
tableName: "chat_threads";
|
|
213
|
+
dataType: "string";
|
|
214
|
+
columnType: "PgText";
|
|
215
|
+
data: string;
|
|
216
|
+
driverParam: string;
|
|
217
|
+
notNull: true;
|
|
218
|
+
hasDefault: true;
|
|
219
|
+
isPrimaryKey: false;
|
|
220
|
+
isAutoincrement: false;
|
|
221
|
+
hasRuntimeDefault: false;
|
|
222
|
+
enumValues: [
|
|
223
|
+
string,
|
|
224
|
+
...string[]
|
|
225
|
+
];
|
|
226
|
+
baseColumn: never;
|
|
227
|
+
identity: undefined;
|
|
228
|
+
generated: undefined;
|
|
229
|
+
}, {}, {}>;
|
|
230
|
+
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
231
|
+
name: "status";
|
|
232
|
+
tableName: "chat_threads";
|
|
233
|
+
dataType: "string";
|
|
234
|
+
columnType: "PgText";
|
|
235
|
+
data: "active" | "archived" | "merged";
|
|
236
|
+
driverParam: string;
|
|
237
|
+
notNull: true;
|
|
238
|
+
hasDefault: true;
|
|
239
|
+
isPrimaryKey: false;
|
|
240
|
+
isAutoincrement: false;
|
|
241
|
+
hasRuntimeDefault: false;
|
|
242
|
+
enumValues: [
|
|
243
|
+
"active",
|
|
244
|
+
"merged",
|
|
245
|
+
"archived"
|
|
246
|
+
];
|
|
247
|
+
baseColumn: never;
|
|
248
|
+
identity: undefined;
|
|
249
|
+
generated: undefined;
|
|
250
|
+
}, {}, {}>;
|
|
251
|
+
agentType: import("drizzle-orm/pg-core").PgColumn<{
|
|
252
|
+
name: "agent_type";
|
|
253
|
+
tableName: "chat_threads";
|
|
254
|
+
dataType: "string";
|
|
255
|
+
columnType: "PgText";
|
|
256
|
+
data: "default" | "meta" | "prompting" | "knowledge-search" | "code" | "writing" | "action";
|
|
257
|
+
driverParam: string;
|
|
258
|
+
notNull: true;
|
|
259
|
+
hasDefault: true;
|
|
260
|
+
isPrimaryKey: false;
|
|
261
|
+
isAutoincrement: false;
|
|
262
|
+
hasRuntimeDefault: false;
|
|
263
|
+
enumValues: [
|
|
264
|
+
"default",
|
|
265
|
+
"meta",
|
|
266
|
+
"prompting",
|
|
267
|
+
"knowledge-search",
|
|
268
|
+
"code",
|
|
269
|
+
"writing",
|
|
270
|
+
"action"
|
|
271
|
+
];
|
|
272
|
+
baseColumn: never;
|
|
273
|
+
identity: undefined;
|
|
274
|
+
generated: undefined;
|
|
275
|
+
}, {}, {}>;
|
|
276
|
+
agentConfig: import("drizzle-orm/pg-core").PgColumn<{
|
|
277
|
+
name: "agent_config";
|
|
278
|
+
tableName: "chat_threads";
|
|
279
|
+
dataType: "json";
|
|
280
|
+
columnType: "PgJsonb";
|
|
281
|
+
data: unknown;
|
|
282
|
+
driverParam: unknown;
|
|
283
|
+
notNull: false;
|
|
284
|
+
hasDefault: false;
|
|
285
|
+
isPrimaryKey: false;
|
|
286
|
+
isAutoincrement: false;
|
|
287
|
+
hasRuntimeDefault: false;
|
|
288
|
+
enumValues: undefined;
|
|
289
|
+
baseColumn: never;
|
|
290
|
+
identity: undefined;
|
|
291
|
+
generated: undefined;
|
|
292
|
+
}, {}, {}>;
|
|
293
|
+
contextSummary: import("drizzle-orm/pg-core").PgColumn<{
|
|
294
|
+
name: "context_summary";
|
|
295
|
+
tableName: "chat_threads";
|
|
296
|
+
dataType: "string";
|
|
297
|
+
columnType: "PgText";
|
|
298
|
+
data: string;
|
|
299
|
+
driverParam: string;
|
|
300
|
+
notNull: false;
|
|
301
|
+
hasDefault: false;
|
|
302
|
+
isPrimaryKey: false;
|
|
303
|
+
isAutoincrement: false;
|
|
304
|
+
hasRuntimeDefault: false;
|
|
305
|
+
enumValues: [
|
|
306
|
+
string,
|
|
307
|
+
...string[]
|
|
308
|
+
];
|
|
309
|
+
baseColumn: never;
|
|
310
|
+
identity: undefined;
|
|
311
|
+
generated: undefined;
|
|
312
|
+
}, {}, {}>;
|
|
313
|
+
metadata: import("drizzle-orm/pg-core").PgColumn<{
|
|
314
|
+
name: "metadata";
|
|
315
|
+
tableName: "chat_threads";
|
|
316
|
+
dataType: "json";
|
|
317
|
+
columnType: "PgJsonb";
|
|
318
|
+
data: unknown;
|
|
319
|
+
driverParam: unknown;
|
|
320
|
+
notNull: false;
|
|
321
|
+
hasDefault: false;
|
|
322
|
+
isPrimaryKey: false;
|
|
323
|
+
isAutoincrement: false;
|
|
324
|
+
hasRuntimeDefault: false;
|
|
325
|
+
enumValues: undefined;
|
|
326
|
+
baseColumn: never;
|
|
327
|
+
identity: undefined;
|
|
328
|
+
generated: undefined;
|
|
329
|
+
}, {}, {}>;
|
|
330
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
331
|
+
name: "created_at";
|
|
332
|
+
tableName: "chat_threads";
|
|
333
|
+
dataType: "date";
|
|
334
|
+
columnType: "PgTimestamp";
|
|
335
|
+
data: Date;
|
|
336
|
+
driverParam: string;
|
|
337
|
+
notNull: true;
|
|
338
|
+
hasDefault: true;
|
|
339
|
+
isPrimaryKey: false;
|
|
340
|
+
isAutoincrement: false;
|
|
341
|
+
hasRuntimeDefault: false;
|
|
342
|
+
enumValues: undefined;
|
|
343
|
+
baseColumn: never;
|
|
344
|
+
identity: undefined;
|
|
345
|
+
generated: undefined;
|
|
346
|
+
}, {}, {}>;
|
|
347
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
348
|
+
name: "updated_at";
|
|
349
|
+
tableName: "chat_threads";
|
|
350
|
+
dataType: "date";
|
|
351
|
+
columnType: "PgTimestamp";
|
|
352
|
+
data: Date;
|
|
353
|
+
driverParam: string;
|
|
354
|
+
notNull: true;
|
|
355
|
+
hasDefault: true;
|
|
356
|
+
isPrimaryKey: false;
|
|
357
|
+
isAutoincrement: false;
|
|
358
|
+
hasRuntimeDefault: false;
|
|
359
|
+
enumValues: undefined;
|
|
360
|
+
baseColumn: never;
|
|
361
|
+
identity: undefined;
|
|
362
|
+
generated: undefined;
|
|
363
|
+
}, {}, {}>;
|
|
364
|
+
mergedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
365
|
+
name: "merged_at";
|
|
366
|
+
tableName: "chat_threads";
|
|
367
|
+
dataType: "date";
|
|
368
|
+
columnType: "PgTimestamp";
|
|
369
|
+
data: Date;
|
|
370
|
+
driverParam: string;
|
|
371
|
+
notNull: false;
|
|
372
|
+
hasDefault: false;
|
|
373
|
+
isPrimaryKey: false;
|
|
374
|
+
isAutoincrement: false;
|
|
375
|
+
hasRuntimeDefault: false;
|
|
376
|
+
enumValues: undefined;
|
|
377
|
+
baseColumn: never;
|
|
378
|
+
identity: undefined;
|
|
379
|
+
generated: undefined;
|
|
380
|
+
}, {}, {}>;
|
|
381
|
+
};
|
|
382
|
+
dialect: "pg";
|
|
383
|
+
}>;
|
|
384
|
+
export type ChatThread = typeof chatThreads.$inferSelect;
|
|
56
385
|
/**
|
|
57
386
|
* Workspaces Schema - Multi-user workspace support
|
|
58
387
|
*
|
|
@@ -1735,6 +2064,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1735
2064
|
agentId?: string | undefined;
|
|
1736
2065
|
agentType?: "meta" | "default" | "code" | "prompting" | "knowledge-search" | "writing" | "action" | undefined;
|
|
1737
2066
|
agentConfig?: Record<string, any> | undefined;
|
|
2067
|
+
inheritContext?: boolean | undefined;
|
|
1738
2068
|
};
|
|
1739
2069
|
output: {
|
|
1740
2070
|
threadId: `${string}-${string}-${string}-${string}-${string}`;
|
|
@@ -1800,6 +2130,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1800
2130
|
getMessages: import("@trpc/server").TRPCQueryProcedure<{
|
|
1801
2131
|
input: {
|
|
1802
2132
|
threadId: string;
|
|
2133
|
+
cursor?: string | undefined;
|
|
1803
2134
|
limit?: number | undefined;
|
|
1804
2135
|
};
|
|
1805
2136
|
output: {
|
|
@@ -1816,6 +2147,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1816
2147
|
previousHash: string | null;
|
|
1817
2148
|
hash: string;
|
|
1818
2149
|
}[];
|
|
2150
|
+
nextCursor: string | undefined;
|
|
1819
2151
|
hasMore: boolean;
|
|
1820
2152
|
};
|
|
1821
2153
|
meta: object;
|
|
@@ -1885,6 +2217,186 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1885
2217
|
};
|
|
1886
2218
|
meta: object;
|
|
1887
2219
|
}>;
|
|
2220
|
+
getThread: import("@trpc/server").TRPCQueryProcedure<{
|
|
2221
|
+
input: {
|
|
2222
|
+
threadId: string;
|
|
2223
|
+
includeContext?: boolean | undefined;
|
|
2224
|
+
includeBranches?: boolean | undefined;
|
|
2225
|
+
};
|
|
2226
|
+
output: {
|
|
2227
|
+
thread: {
|
|
2228
|
+
userId: string;
|
|
2229
|
+
id: string;
|
|
2230
|
+
status: "archived" | "active" | "merged";
|
|
2231
|
+
createdAt: Date;
|
|
2232
|
+
updatedAt: Date;
|
|
2233
|
+
metadata: unknown;
|
|
2234
|
+
title: string | null;
|
|
2235
|
+
projectId: string | null;
|
|
2236
|
+
threadType: "main" | "branch";
|
|
2237
|
+
parentThreadId: string | null;
|
|
2238
|
+
branchedFromMessageId: string | null;
|
|
2239
|
+
branchPurpose: string | null;
|
|
2240
|
+
agentId: string;
|
|
2241
|
+
agentType: "meta" | "default" | "code" | "prompting" | "knowledge-search" | "writing" | "action";
|
|
2242
|
+
agentConfig: unknown;
|
|
2243
|
+
contextSummary: string | null;
|
|
2244
|
+
mergedAt: Date | null;
|
|
2245
|
+
};
|
|
2246
|
+
entities: {
|
|
2247
|
+
userId: string;
|
|
2248
|
+
id: string;
|
|
2249
|
+
createdAt: Date;
|
|
2250
|
+
workspaceId: string;
|
|
2251
|
+
entityId: string;
|
|
2252
|
+
threadId: string;
|
|
2253
|
+
sourceMessageId: string | null;
|
|
2254
|
+
relationshipType: "used_as_context" | "created" | "updated" | "referenced" | "inherited_from_parent";
|
|
2255
|
+
conflictStatus: "none" | "pending" | "resolved";
|
|
2256
|
+
sourceEventId: string | null;
|
|
2257
|
+
}[] | undefined;
|
|
2258
|
+
documents: {
|
|
2259
|
+
userId: string;
|
|
2260
|
+
id: string;
|
|
2261
|
+
createdAt: Date;
|
|
2262
|
+
workspaceId: string;
|
|
2263
|
+
documentId: string;
|
|
2264
|
+
threadId: string;
|
|
2265
|
+
sourceMessageId: string | null;
|
|
2266
|
+
relationshipType: "used_as_context" | "created" | "updated" | "referenced" | "inherited_from_parent";
|
|
2267
|
+
conflictStatus: "none" | "pending" | "resolved";
|
|
2268
|
+
sourceEventId: string | null;
|
|
2269
|
+
}[] | undefined;
|
|
2270
|
+
branchTree: any;
|
|
2271
|
+
};
|
|
2272
|
+
meta: object;
|
|
2273
|
+
}>;
|
|
2274
|
+
updateThread: import("@trpc/server").TRPCMutationProcedure<{
|
|
2275
|
+
input: {
|
|
2276
|
+
threadId: string;
|
|
2277
|
+
title?: string | undefined;
|
|
2278
|
+
agentId?: string | undefined;
|
|
2279
|
+
agentType?: "meta" | "default" | "code" | "prompting" | "knowledge-search" | "writing" | "action" | undefined;
|
|
2280
|
+
agentConfig?: Record<string, unknown> | undefined;
|
|
2281
|
+
};
|
|
2282
|
+
output: {
|
|
2283
|
+
status: string;
|
|
2284
|
+
threadId: string;
|
|
2285
|
+
};
|
|
2286
|
+
meta: object;
|
|
2287
|
+
}>;
|
|
2288
|
+
archiveThread: import("@trpc/server").TRPCMutationProcedure<{
|
|
2289
|
+
input: {
|
|
2290
|
+
threadId: string;
|
|
2291
|
+
};
|
|
2292
|
+
output: {
|
|
2293
|
+
status: string;
|
|
2294
|
+
threadId: string;
|
|
2295
|
+
};
|
|
2296
|
+
meta: object;
|
|
2297
|
+
}>;
|
|
2298
|
+
getBranchTree: import("@trpc/server").TRPCQueryProcedure<{
|
|
2299
|
+
input: {
|
|
2300
|
+
rootThreadId: string;
|
|
2301
|
+
};
|
|
2302
|
+
output: {
|
|
2303
|
+
tree: {
|
|
2304
|
+
thread: ChatThread;
|
|
2305
|
+
children: any[];
|
|
2306
|
+
} | null;
|
|
2307
|
+
flatBranches: {
|
|
2308
|
+
userId: string;
|
|
2309
|
+
id: string;
|
|
2310
|
+
status: "archived" | "active" | "merged";
|
|
2311
|
+
createdAt: Date;
|
|
2312
|
+
updatedAt: Date;
|
|
2313
|
+
metadata: unknown;
|
|
2314
|
+
title: string | null;
|
|
2315
|
+
projectId: string | null;
|
|
2316
|
+
threadType: "main" | "branch";
|
|
2317
|
+
parentThreadId: string | null;
|
|
2318
|
+
branchedFromMessageId: string | null;
|
|
2319
|
+
branchPurpose: string | null;
|
|
2320
|
+
agentId: string;
|
|
2321
|
+
agentType: "meta" | "default" | "code" | "prompting" | "knowledge-search" | "writing" | "action";
|
|
2322
|
+
agentConfig: unknown;
|
|
2323
|
+
contextSummary: string | null;
|
|
2324
|
+
mergedAt: Date | null;
|
|
2325
|
+
}[];
|
|
2326
|
+
activeBranches: {
|
|
2327
|
+
userId: string;
|
|
2328
|
+
id: string;
|
|
2329
|
+
status: "archived" | "active" | "merged";
|
|
2330
|
+
createdAt: Date;
|
|
2331
|
+
updatedAt: Date;
|
|
2332
|
+
metadata: unknown;
|
|
2333
|
+
title: string | null;
|
|
2334
|
+
projectId: string | null;
|
|
2335
|
+
threadType: "main" | "branch";
|
|
2336
|
+
parentThreadId: string | null;
|
|
2337
|
+
branchedFromMessageId: string | null;
|
|
2338
|
+
branchPurpose: string | null;
|
|
2339
|
+
agentId: string;
|
|
2340
|
+
agentType: "meta" | "default" | "code" | "prompting" | "knowledge-search" | "writing" | "action";
|
|
2341
|
+
agentConfig: unknown;
|
|
2342
|
+
contextSummary: string | null;
|
|
2343
|
+
mergedAt: Date | null;
|
|
2344
|
+
}[];
|
|
2345
|
+
mergedBranches: {
|
|
2346
|
+
userId: string;
|
|
2347
|
+
id: string;
|
|
2348
|
+
status: "archived" | "active" | "merged";
|
|
2349
|
+
createdAt: Date;
|
|
2350
|
+
updatedAt: Date;
|
|
2351
|
+
metadata: unknown;
|
|
2352
|
+
title: string | null;
|
|
2353
|
+
projectId: string | null;
|
|
2354
|
+
threadType: "main" | "branch";
|
|
2355
|
+
parentThreadId: string | null;
|
|
2356
|
+
branchedFromMessageId: string | null;
|
|
2357
|
+
branchPurpose: string | null;
|
|
2358
|
+
agentId: string;
|
|
2359
|
+
agentType: "meta" | "default" | "code" | "prompting" | "knowledge-search" | "writing" | "action";
|
|
2360
|
+
agentConfig: unknown;
|
|
2361
|
+
contextSummary: string | null;
|
|
2362
|
+
mergedAt: Date | null;
|
|
2363
|
+
}[];
|
|
2364
|
+
};
|
|
2365
|
+
meta: object;
|
|
2366
|
+
}>;
|
|
2367
|
+
getThreadContext: import("@trpc/server").TRPCQueryProcedure<{
|
|
2368
|
+
input: {
|
|
2369
|
+
threadId: string;
|
|
2370
|
+
relationshipTypes?: ("used_as_context" | "created" | "updated" | "referenced" | "inherited_from_parent")[] | undefined;
|
|
2371
|
+
};
|
|
2372
|
+
output: {
|
|
2373
|
+
entities: {
|
|
2374
|
+
userId: string;
|
|
2375
|
+
id: string;
|
|
2376
|
+
createdAt: Date;
|
|
2377
|
+
workspaceId: string;
|
|
2378
|
+
entityId: string;
|
|
2379
|
+
threadId: string;
|
|
2380
|
+
sourceMessageId: string | null;
|
|
2381
|
+
relationshipType: "used_as_context" | "created" | "updated" | "referenced" | "inherited_from_parent";
|
|
2382
|
+
conflictStatus: "none" | "pending" | "resolved";
|
|
2383
|
+
sourceEventId: string | null;
|
|
2384
|
+
}[];
|
|
2385
|
+
documents: {
|
|
2386
|
+
userId: string;
|
|
2387
|
+
id: string;
|
|
2388
|
+
createdAt: Date;
|
|
2389
|
+
workspaceId: string;
|
|
2390
|
+
documentId: string;
|
|
2391
|
+
threadId: string;
|
|
2392
|
+
sourceMessageId: string | null;
|
|
2393
|
+
relationshipType: "used_as_context" | "created" | "updated" | "referenced" | "inherited_from_parent";
|
|
2394
|
+
conflictStatus: "none" | "pending" | "resolved";
|
|
2395
|
+
sourceEventId: string | null;
|
|
2396
|
+
}[];
|
|
2397
|
+
};
|
|
2398
|
+
meta: object;
|
|
2399
|
+
}>;
|
|
1888
2400
|
}>>;
|
|
1889
2401
|
proposals: import("@trpc/server").TRPCBuiltRouter<{
|
|
1890
2402
|
ctx: Context;
|
package/package.json
CHANGED
package/src/generated.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
|
+
import { Column, SQL } from 'drizzle-orm';
|
|
4
|
+
|
|
3
5
|
/**
|
|
4
6
|
* Context Types
|
|
5
7
|
*
|
|
@@ -53,6 +55,333 @@ export interface Context {
|
|
|
53
55
|
req?: Request;
|
|
54
56
|
socketIO?: any;
|
|
55
57
|
}
|
|
58
|
+
declare const chatThreads: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
59
|
+
name: "chat_threads";
|
|
60
|
+
schema: undefined;
|
|
61
|
+
columns: {
|
|
62
|
+
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
63
|
+
name: "id";
|
|
64
|
+
tableName: "chat_threads";
|
|
65
|
+
dataType: "string";
|
|
66
|
+
columnType: "PgUUID";
|
|
67
|
+
data: string;
|
|
68
|
+
driverParam: string;
|
|
69
|
+
notNull: true;
|
|
70
|
+
hasDefault: true;
|
|
71
|
+
isPrimaryKey: true;
|
|
72
|
+
isAutoincrement: false;
|
|
73
|
+
hasRuntimeDefault: false;
|
|
74
|
+
enumValues: undefined;
|
|
75
|
+
baseColumn: never;
|
|
76
|
+
identity: undefined;
|
|
77
|
+
generated: undefined;
|
|
78
|
+
}, {}, {}>;
|
|
79
|
+
userId: import("drizzle-orm/pg-core").PgColumn<{
|
|
80
|
+
name: "user_id";
|
|
81
|
+
tableName: "chat_threads";
|
|
82
|
+
dataType: "string";
|
|
83
|
+
columnType: "PgText";
|
|
84
|
+
data: string;
|
|
85
|
+
driverParam: string;
|
|
86
|
+
notNull: true;
|
|
87
|
+
hasDefault: false;
|
|
88
|
+
isPrimaryKey: false;
|
|
89
|
+
isAutoincrement: false;
|
|
90
|
+
hasRuntimeDefault: false;
|
|
91
|
+
enumValues: [
|
|
92
|
+
string,
|
|
93
|
+
...string[]
|
|
94
|
+
];
|
|
95
|
+
baseColumn: never;
|
|
96
|
+
identity: undefined;
|
|
97
|
+
generated: undefined;
|
|
98
|
+
}, {}, {}>;
|
|
99
|
+
projectId: import("drizzle-orm/pg-core").PgColumn<{
|
|
100
|
+
name: "project_id";
|
|
101
|
+
tableName: "chat_threads";
|
|
102
|
+
dataType: "string";
|
|
103
|
+
columnType: "PgUUID";
|
|
104
|
+
data: string;
|
|
105
|
+
driverParam: string;
|
|
106
|
+
notNull: false;
|
|
107
|
+
hasDefault: false;
|
|
108
|
+
isPrimaryKey: false;
|
|
109
|
+
isAutoincrement: false;
|
|
110
|
+
hasRuntimeDefault: false;
|
|
111
|
+
enumValues: undefined;
|
|
112
|
+
baseColumn: never;
|
|
113
|
+
identity: undefined;
|
|
114
|
+
generated: undefined;
|
|
115
|
+
}, {}, {}>;
|
|
116
|
+
title: import("drizzle-orm/pg-core").PgColumn<{
|
|
117
|
+
name: "title";
|
|
118
|
+
tableName: "chat_threads";
|
|
119
|
+
dataType: "string";
|
|
120
|
+
columnType: "PgText";
|
|
121
|
+
data: string;
|
|
122
|
+
driverParam: string;
|
|
123
|
+
notNull: false;
|
|
124
|
+
hasDefault: false;
|
|
125
|
+
isPrimaryKey: false;
|
|
126
|
+
isAutoincrement: false;
|
|
127
|
+
hasRuntimeDefault: false;
|
|
128
|
+
enumValues: [
|
|
129
|
+
string,
|
|
130
|
+
...string[]
|
|
131
|
+
];
|
|
132
|
+
baseColumn: never;
|
|
133
|
+
identity: undefined;
|
|
134
|
+
generated: undefined;
|
|
135
|
+
}, {}, {}>;
|
|
136
|
+
threadType: import("drizzle-orm/pg-core").PgColumn<{
|
|
137
|
+
name: "thread_type";
|
|
138
|
+
tableName: "chat_threads";
|
|
139
|
+
dataType: "string";
|
|
140
|
+
columnType: "PgText";
|
|
141
|
+
data: "main" | "branch";
|
|
142
|
+
driverParam: string;
|
|
143
|
+
notNull: true;
|
|
144
|
+
hasDefault: true;
|
|
145
|
+
isPrimaryKey: false;
|
|
146
|
+
isAutoincrement: false;
|
|
147
|
+
hasRuntimeDefault: false;
|
|
148
|
+
enumValues: [
|
|
149
|
+
"main",
|
|
150
|
+
"branch"
|
|
151
|
+
];
|
|
152
|
+
baseColumn: never;
|
|
153
|
+
identity: undefined;
|
|
154
|
+
generated: undefined;
|
|
155
|
+
}, {}, {}>;
|
|
156
|
+
parentThreadId: import("drizzle-orm/pg-core").PgColumn<{
|
|
157
|
+
name: "parent_thread_id";
|
|
158
|
+
tableName: "chat_threads";
|
|
159
|
+
dataType: "string";
|
|
160
|
+
columnType: "PgUUID";
|
|
161
|
+
data: string;
|
|
162
|
+
driverParam: string;
|
|
163
|
+
notNull: false;
|
|
164
|
+
hasDefault: false;
|
|
165
|
+
isPrimaryKey: false;
|
|
166
|
+
isAutoincrement: false;
|
|
167
|
+
hasRuntimeDefault: false;
|
|
168
|
+
enumValues: undefined;
|
|
169
|
+
baseColumn: never;
|
|
170
|
+
identity: undefined;
|
|
171
|
+
generated: undefined;
|
|
172
|
+
}, {}, {}>;
|
|
173
|
+
branchedFromMessageId: import("drizzle-orm/pg-core").PgColumn<{
|
|
174
|
+
name: "branched_from_message_id";
|
|
175
|
+
tableName: "chat_threads";
|
|
176
|
+
dataType: "string";
|
|
177
|
+
columnType: "PgUUID";
|
|
178
|
+
data: string;
|
|
179
|
+
driverParam: string;
|
|
180
|
+
notNull: false;
|
|
181
|
+
hasDefault: false;
|
|
182
|
+
isPrimaryKey: false;
|
|
183
|
+
isAutoincrement: false;
|
|
184
|
+
hasRuntimeDefault: false;
|
|
185
|
+
enumValues: undefined;
|
|
186
|
+
baseColumn: never;
|
|
187
|
+
identity: undefined;
|
|
188
|
+
generated: undefined;
|
|
189
|
+
}, {}, {}>;
|
|
190
|
+
branchPurpose: import("drizzle-orm/pg-core").PgColumn<{
|
|
191
|
+
name: "branch_purpose";
|
|
192
|
+
tableName: "chat_threads";
|
|
193
|
+
dataType: "string";
|
|
194
|
+
columnType: "PgText";
|
|
195
|
+
data: string;
|
|
196
|
+
driverParam: string;
|
|
197
|
+
notNull: false;
|
|
198
|
+
hasDefault: false;
|
|
199
|
+
isPrimaryKey: false;
|
|
200
|
+
isAutoincrement: false;
|
|
201
|
+
hasRuntimeDefault: false;
|
|
202
|
+
enumValues: [
|
|
203
|
+
string,
|
|
204
|
+
...string[]
|
|
205
|
+
];
|
|
206
|
+
baseColumn: never;
|
|
207
|
+
identity: undefined;
|
|
208
|
+
generated: undefined;
|
|
209
|
+
}, {}, {}>;
|
|
210
|
+
agentId: import("drizzle-orm/pg-core").PgColumn<{
|
|
211
|
+
name: "agent_id";
|
|
212
|
+
tableName: "chat_threads";
|
|
213
|
+
dataType: "string";
|
|
214
|
+
columnType: "PgText";
|
|
215
|
+
data: string;
|
|
216
|
+
driverParam: string;
|
|
217
|
+
notNull: true;
|
|
218
|
+
hasDefault: true;
|
|
219
|
+
isPrimaryKey: false;
|
|
220
|
+
isAutoincrement: false;
|
|
221
|
+
hasRuntimeDefault: false;
|
|
222
|
+
enumValues: [
|
|
223
|
+
string,
|
|
224
|
+
...string[]
|
|
225
|
+
];
|
|
226
|
+
baseColumn: never;
|
|
227
|
+
identity: undefined;
|
|
228
|
+
generated: undefined;
|
|
229
|
+
}, {}, {}>;
|
|
230
|
+
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
231
|
+
name: "status";
|
|
232
|
+
tableName: "chat_threads";
|
|
233
|
+
dataType: "string";
|
|
234
|
+
columnType: "PgText";
|
|
235
|
+
data: "active" | "archived" | "merged";
|
|
236
|
+
driverParam: string;
|
|
237
|
+
notNull: true;
|
|
238
|
+
hasDefault: true;
|
|
239
|
+
isPrimaryKey: false;
|
|
240
|
+
isAutoincrement: false;
|
|
241
|
+
hasRuntimeDefault: false;
|
|
242
|
+
enumValues: [
|
|
243
|
+
"active",
|
|
244
|
+
"merged",
|
|
245
|
+
"archived"
|
|
246
|
+
];
|
|
247
|
+
baseColumn: never;
|
|
248
|
+
identity: undefined;
|
|
249
|
+
generated: undefined;
|
|
250
|
+
}, {}, {}>;
|
|
251
|
+
agentType: import("drizzle-orm/pg-core").PgColumn<{
|
|
252
|
+
name: "agent_type";
|
|
253
|
+
tableName: "chat_threads";
|
|
254
|
+
dataType: "string";
|
|
255
|
+
columnType: "PgText";
|
|
256
|
+
data: "default" | "meta" | "prompting" | "knowledge-search" | "code" | "writing" | "action";
|
|
257
|
+
driverParam: string;
|
|
258
|
+
notNull: true;
|
|
259
|
+
hasDefault: true;
|
|
260
|
+
isPrimaryKey: false;
|
|
261
|
+
isAutoincrement: false;
|
|
262
|
+
hasRuntimeDefault: false;
|
|
263
|
+
enumValues: [
|
|
264
|
+
"default",
|
|
265
|
+
"meta",
|
|
266
|
+
"prompting",
|
|
267
|
+
"knowledge-search",
|
|
268
|
+
"code",
|
|
269
|
+
"writing",
|
|
270
|
+
"action"
|
|
271
|
+
];
|
|
272
|
+
baseColumn: never;
|
|
273
|
+
identity: undefined;
|
|
274
|
+
generated: undefined;
|
|
275
|
+
}, {}, {}>;
|
|
276
|
+
agentConfig: import("drizzle-orm/pg-core").PgColumn<{
|
|
277
|
+
name: "agent_config";
|
|
278
|
+
tableName: "chat_threads";
|
|
279
|
+
dataType: "json";
|
|
280
|
+
columnType: "PgJsonb";
|
|
281
|
+
data: unknown;
|
|
282
|
+
driverParam: unknown;
|
|
283
|
+
notNull: false;
|
|
284
|
+
hasDefault: false;
|
|
285
|
+
isPrimaryKey: false;
|
|
286
|
+
isAutoincrement: false;
|
|
287
|
+
hasRuntimeDefault: false;
|
|
288
|
+
enumValues: undefined;
|
|
289
|
+
baseColumn: never;
|
|
290
|
+
identity: undefined;
|
|
291
|
+
generated: undefined;
|
|
292
|
+
}, {}, {}>;
|
|
293
|
+
contextSummary: import("drizzle-orm/pg-core").PgColumn<{
|
|
294
|
+
name: "context_summary";
|
|
295
|
+
tableName: "chat_threads";
|
|
296
|
+
dataType: "string";
|
|
297
|
+
columnType: "PgText";
|
|
298
|
+
data: string;
|
|
299
|
+
driverParam: string;
|
|
300
|
+
notNull: false;
|
|
301
|
+
hasDefault: false;
|
|
302
|
+
isPrimaryKey: false;
|
|
303
|
+
isAutoincrement: false;
|
|
304
|
+
hasRuntimeDefault: false;
|
|
305
|
+
enumValues: [
|
|
306
|
+
string,
|
|
307
|
+
...string[]
|
|
308
|
+
];
|
|
309
|
+
baseColumn: never;
|
|
310
|
+
identity: undefined;
|
|
311
|
+
generated: undefined;
|
|
312
|
+
}, {}, {}>;
|
|
313
|
+
metadata: import("drizzle-orm/pg-core").PgColumn<{
|
|
314
|
+
name: "metadata";
|
|
315
|
+
tableName: "chat_threads";
|
|
316
|
+
dataType: "json";
|
|
317
|
+
columnType: "PgJsonb";
|
|
318
|
+
data: unknown;
|
|
319
|
+
driverParam: unknown;
|
|
320
|
+
notNull: false;
|
|
321
|
+
hasDefault: false;
|
|
322
|
+
isPrimaryKey: false;
|
|
323
|
+
isAutoincrement: false;
|
|
324
|
+
hasRuntimeDefault: false;
|
|
325
|
+
enumValues: undefined;
|
|
326
|
+
baseColumn: never;
|
|
327
|
+
identity: undefined;
|
|
328
|
+
generated: undefined;
|
|
329
|
+
}, {}, {}>;
|
|
330
|
+
createdAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
331
|
+
name: "created_at";
|
|
332
|
+
tableName: "chat_threads";
|
|
333
|
+
dataType: "date";
|
|
334
|
+
columnType: "PgTimestamp";
|
|
335
|
+
data: Date;
|
|
336
|
+
driverParam: string;
|
|
337
|
+
notNull: true;
|
|
338
|
+
hasDefault: true;
|
|
339
|
+
isPrimaryKey: false;
|
|
340
|
+
isAutoincrement: false;
|
|
341
|
+
hasRuntimeDefault: false;
|
|
342
|
+
enumValues: undefined;
|
|
343
|
+
baseColumn: never;
|
|
344
|
+
identity: undefined;
|
|
345
|
+
generated: undefined;
|
|
346
|
+
}, {}, {}>;
|
|
347
|
+
updatedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
348
|
+
name: "updated_at";
|
|
349
|
+
tableName: "chat_threads";
|
|
350
|
+
dataType: "date";
|
|
351
|
+
columnType: "PgTimestamp";
|
|
352
|
+
data: Date;
|
|
353
|
+
driverParam: string;
|
|
354
|
+
notNull: true;
|
|
355
|
+
hasDefault: true;
|
|
356
|
+
isPrimaryKey: false;
|
|
357
|
+
isAutoincrement: false;
|
|
358
|
+
hasRuntimeDefault: false;
|
|
359
|
+
enumValues: undefined;
|
|
360
|
+
baseColumn: never;
|
|
361
|
+
identity: undefined;
|
|
362
|
+
generated: undefined;
|
|
363
|
+
}, {}, {}>;
|
|
364
|
+
mergedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
365
|
+
name: "merged_at";
|
|
366
|
+
tableName: "chat_threads";
|
|
367
|
+
dataType: "date";
|
|
368
|
+
columnType: "PgTimestamp";
|
|
369
|
+
data: Date;
|
|
370
|
+
driverParam: string;
|
|
371
|
+
notNull: false;
|
|
372
|
+
hasDefault: false;
|
|
373
|
+
isPrimaryKey: false;
|
|
374
|
+
isAutoincrement: false;
|
|
375
|
+
hasRuntimeDefault: false;
|
|
376
|
+
enumValues: undefined;
|
|
377
|
+
baseColumn: never;
|
|
378
|
+
identity: undefined;
|
|
379
|
+
generated: undefined;
|
|
380
|
+
}, {}, {}>;
|
|
381
|
+
};
|
|
382
|
+
dialect: "pg";
|
|
383
|
+
}>;
|
|
384
|
+
export type ChatThread = typeof chatThreads.$inferSelect;
|
|
56
385
|
/**
|
|
57
386
|
* Workspaces Schema - Multi-user workspace support
|
|
58
387
|
*
|
|
@@ -1735,6 +2064,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1735
2064
|
agentId?: string | undefined;
|
|
1736
2065
|
agentType?: "meta" | "default" | "code" | "prompting" | "knowledge-search" | "writing" | "action" | undefined;
|
|
1737
2066
|
agentConfig?: Record<string, any> | undefined;
|
|
2067
|
+
inheritContext?: boolean | undefined;
|
|
1738
2068
|
};
|
|
1739
2069
|
output: {
|
|
1740
2070
|
threadId: `${string}-${string}-${string}-${string}-${string}`;
|
|
@@ -1800,6 +2130,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1800
2130
|
getMessages: import("@trpc/server").TRPCQueryProcedure<{
|
|
1801
2131
|
input: {
|
|
1802
2132
|
threadId: string;
|
|
2133
|
+
cursor?: string | undefined;
|
|
1803
2134
|
limit?: number | undefined;
|
|
1804
2135
|
};
|
|
1805
2136
|
output: {
|
|
@@ -1816,6 +2147,7 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1816
2147
|
previousHash: string | null;
|
|
1817
2148
|
hash: string;
|
|
1818
2149
|
}[];
|
|
2150
|
+
nextCursor: string | undefined;
|
|
1819
2151
|
hasMore: boolean;
|
|
1820
2152
|
};
|
|
1821
2153
|
meta: object;
|
|
@@ -1885,6 +2217,186 @@ export declare const coreRouter: import("@trpc/server").TRPCBuiltRouter<{
|
|
|
1885
2217
|
};
|
|
1886
2218
|
meta: object;
|
|
1887
2219
|
}>;
|
|
2220
|
+
getThread: import("@trpc/server").TRPCQueryProcedure<{
|
|
2221
|
+
input: {
|
|
2222
|
+
threadId: string;
|
|
2223
|
+
includeContext?: boolean | undefined;
|
|
2224
|
+
includeBranches?: boolean | undefined;
|
|
2225
|
+
};
|
|
2226
|
+
output: {
|
|
2227
|
+
thread: {
|
|
2228
|
+
userId: string;
|
|
2229
|
+
id: string;
|
|
2230
|
+
status: "archived" | "active" | "merged";
|
|
2231
|
+
createdAt: Date;
|
|
2232
|
+
updatedAt: Date;
|
|
2233
|
+
metadata: unknown;
|
|
2234
|
+
title: string | null;
|
|
2235
|
+
projectId: string | null;
|
|
2236
|
+
threadType: "main" | "branch";
|
|
2237
|
+
parentThreadId: string | null;
|
|
2238
|
+
branchedFromMessageId: string | null;
|
|
2239
|
+
branchPurpose: string | null;
|
|
2240
|
+
agentId: string;
|
|
2241
|
+
agentType: "meta" | "default" | "code" | "prompting" | "knowledge-search" | "writing" | "action";
|
|
2242
|
+
agentConfig: unknown;
|
|
2243
|
+
contextSummary: string | null;
|
|
2244
|
+
mergedAt: Date | null;
|
|
2245
|
+
};
|
|
2246
|
+
entities: {
|
|
2247
|
+
userId: string;
|
|
2248
|
+
id: string;
|
|
2249
|
+
createdAt: Date;
|
|
2250
|
+
workspaceId: string;
|
|
2251
|
+
entityId: string;
|
|
2252
|
+
threadId: string;
|
|
2253
|
+
sourceMessageId: string | null;
|
|
2254
|
+
relationshipType: "used_as_context" | "created" | "updated" | "referenced" | "inherited_from_parent";
|
|
2255
|
+
conflictStatus: "none" | "pending" | "resolved";
|
|
2256
|
+
sourceEventId: string | null;
|
|
2257
|
+
}[] | undefined;
|
|
2258
|
+
documents: {
|
|
2259
|
+
userId: string;
|
|
2260
|
+
id: string;
|
|
2261
|
+
createdAt: Date;
|
|
2262
|
+
workspaceId: string;
|
|
2263
|
+
documentId: string;
|
|
2264
|
+
threadId: string;
|
|
2265
|
+
sourceMessageId: string | null;
|
|
2266
|
+
relationshipType: "used_as_context" | "created" | "updated" | "referenced" | "inherited_from_parent";
|
|
2267
|
+
conflictStatus: "none" | "pending" | "resolved";
|
|
2268
|
+
sourceEventId: string | null;
|
|
2269
|
+
}[] | undefined;
|
|
2270
|
+
branchTree: any;
|
|
2271
|
+
};
|
|
2272
|
+
meta: object;
|
|
2273
|
+
}>;
|
|
2274
|
+
updateThread: import("@trpc/server").TRPCMutationProcedure<{
|
|
2275
|
+
input: {
|
|
2276
|
+
threadId: string;
|
|
2277
|
+
title?: string | undefined;
|
|
2278
|
+
agentId?: string | undefined;
|
|
2279
|
+
agentType?: "meta" | "default" | "code" | "prompting" | "knowledge-search" | "writing" | "action" | undefined;
|
|
2280
|
+
agentConfig?: Record<string, unknown> | undefined;
|
|
2281
|
+
};
|
|
2282
|
+
output: {
|
|
2283
|
+
status: string;
|
|
2284
|
+
threadId: string;
|
|
2285
|
+
};
|
|
2286
|
+
meta: object;
|
|
2287
|
+
}>;
|
|
2288
|
+
archiveThread: import("@trpc/server").TRPCMutationProcedure<{
|
|
2289
|
+
input: {
|
|
2290
|
+
threadId: string;
|
|
2291
|
+
};
|
|
2292
|
+
output: {
|
|
2293
|
+
status: string;
|
|
2294
|
+
threadId: string;
|
|
2295
|
+
};
|
|
2296
|
+
meta: object;
|
|
2297
|
+
}>;
|
|
2298
|
+
getBranchTree: import("@trpc/server").TRPCQueryProcedure<{
|
|
2299
|
+
input: {
|
|
2300
|
+
rootThreadId: string;
|
|
2301
|
+
};
|
|
2302
|
+
output: {
|
|
2303
|
+
tree: {
|
|
2304
|
+
thread: ChatThread;
|
|
2305
|
+
children: any[];
|
|
2306
|
+
} | null;
|
|
2307
|
+
flatBranches: {
|
|
2308
|
+
userId: string;
|
|
2309
|
+
id: string;
|
|
2310
|
+
status: "archived" | "active" | "merged";
|
|
2311
|
+
createdAt: Date;
|
|
2312
|
+
updatedAt: Date;
|
|
2313
|
+
metadata: unknown;
|
|
2314
|
+
title: string | null;
|
|
2315
|
+
projectId: string | null;
|
|
2316
|
+
threadType: "main" | "branch";
|
|
2317
|
+
parentThreadId: string | null;
|
|
2318
|
+
branchedFromMessageId: string | null;
|
|
2319
|
+
branchPurpose: string | null;
|
|
2320
|
+
agentId: string;
|
|
2321
|
+
agentType: "meta" | "default" | "code" | "prompting" | "knowledge-search" | "writing" | "action";
|
|
2322
|
+
agentConfig: unknown;
|
|
2323
|
+
contextSummary: string | null;
|
|
2324
|
+
mergedAt: Date | null;
|
|
2325
|
+
}[];
|
|
2326
|
+
activeBranches: {
|
|
2327
|
+
userId: string;
|
|
2328
|
+
id: string;
|
|
2329
|
+
status: "archived" | "active" | "merged";
|
|
2330
|
+
createdAt: Date;
|
|
2331
|
+
updatedAt: Date;
|
|
2332
|
+
metadata: unknown;
|
|
2333
|
+
title: string | null;
|
|
2334
|
+
projectId: string | null;
|
|
2335
|
+
threadType: "main" | "branch";
|
|
2336
|
+
parentThreadId: string | null;
|
|
2337
|
+
branchedFromMessageId: string | null;
|
|
2338
|
+
branchPurpose: string | null;
|
|
2339
|
+
agentId: string;
|
|
2340
|
+
agentType: "meta" | "default" | "code" | "prompting" | "knowledge-search" | "writing" | "action";
|
|
2341
|
+
agentConfig: unknown;
|
|
2342
|
+
contextSummary: string | null;
|
|
2343
|
+
mergedAt: Date | null;
|
|
2344
|
+
}[];
|
|
2345
|
+
mergedBranches: {
|
|
2346
|
+
userId: string;
|
|
2347
|
+
id: string;
|
|
2348
|
+
status: "archived" | "active" | "merged";
|
|
2349
|
+
createdAt: Date;
|
|
2350
|
+
updatedAt: Date;
|
|
2351
|
+
metadata: unknown;
|
|
2352
|
+
title: string | null;
|
|
2353
|
+
projectId: string | null;
|
|
2354
|
+
threadType: "main" | "branch";
|
|
2355
|
+
parentThreadId: string | null;
|
|
2356
|
+
branchedFromMessageId: string | null;
|
|
2357
|
+
branchPurpose: string | null;
|
|
2358
|
+
agentId: string;
|
|
2359
|
+
agentType: "meta" | "default" | "code" | "prompting" | "knowledge-search" | "writing" | "action";
|
|
2360
|
+
agentConfig: unknown;
|
|
2361
|
+
contextSummary: string | null;
|
|
2362
|
+
mergedAt: Date | null;
|
|
2363
|
+
}[];
|
|
2364
|
+
};
|
|
2365
|
+
meta: object;
|
|
2366
|
+
}>;
|
|
2367
|
+
getThreadContext: import("@trpc/server").TRPCQueryProcedure<{
|
|
2368
|
+
input: {
|
|
2369
|
+
threadId: string;
|
|
2370
|
+
relationshipTypes?: ("used_as_context" | "created" | "updated" | "referenced" | "inherited_from_parent")[] | undefined;
|
|
2371
|
+
};
|
|
2372
|
+
output: {
|
|
2373
|
+
entities: {
|
|
2374
|
+
userId: string;
|
|
2375
|
+
id: string;
|
|
2376
|
+
createdAt: Date;
|
|
2377
|
+
workspaceId: string;
|
|
2378
|
+
entityId: string;
|
|
2379
|
+
threadId: string;
|
|
2380
|
+
sourceMessageId: string | null;
|
|
2381
|
+
relationshipType: "used_as_context" | "created" | "updated" | "referenced" | "inherited_from_parent";
|
|
2382
|
+
conflictStatus: "none" | "pending" | "resolved";
|
|
2383
|
+
sourceEventId: string | null;
|
|
2384
|
+
}[];
|
|
2385
|
+
documents: {
|
|
2386
|
+
userId: string;
|
|
2387
|
+
id: string;
|
|
2388
|
+
createdAt: Date;
|
|
2389
|
+
workspaceId: string;
|
|
2390
|
+
documentId: string;
|
|
2391
|
+
threadId: string;
|
|
2392
|
+
sourceMessageId: string | null;
|
|
2393
|
+
relationshipType: "used_as_context" | "created" | "updated" | "referenced" | "inherited_from_parent";
|
|
2394
|
+
conflictStatus: "none" | "pending" | "resolved";
|
|
2395
|
+
sourceEventId: string | null;
|
|
2396
|
+
}[];
|
|
2397
|
+
};
|
|
2398
|
+
meta: object;
|
|
2399
|
+
}>;
|
|
1888
2400
|
}>>;
|
|
1889
2401
|
proposals: import("@trpc/server").TRPCBuiltRouter<{
|
|
1890
2402
|
ctx: Context;
|