@okrlinkhub/agent-factory 2.0.0 → 2.0.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/client/index.d.ts +38 -4
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +174 -36
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/component.d.ts +138 -8
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/identity.d.ts +5 -5
- package/dist/component/pushing.d.ts +30 -30
- package/dist/component/queue.d.ts +125 -51
- package/dist/component/queue.d.ts.map +1 -1
- package/dist/component/queue.js +128 -14
- package/dist/component/queue.js.map +1 -1
- package/dist/component/scheduler.d.ts +13 -13
- package/dist/component/scheduler.js +4 -0
- package/dist/component/scheduler.js.map +1 -1
- package/dist/component/schema.d.ts +164 -80
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/schema.js +29 -0
- package/dist/component/schema.js.map +1 -1
- package/package.json +1 -1
- package/src/client/index.ts +302 -42
- package/src/component/_generated/component.ts +164 -14
- package/src/component/lib.test.ts +132 -0
- package/src/component/queue.ts +185 -20
- package/src/component/scheduler.ts +4 -0
- package/src/component/schema.ts +46 -0
|
@@ -32,6 +32,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
32
32
|
agentKey: string;
|
|
33
33
|
boundAt: number;
|
|
34
34
|
consumerUserId: string;
|
|
35
|
+
conversationId: string;
|
|
35
36
|
metadata: null | Record<string, string>;
|
|
36
37
|
revokedAt: null | number;
|
|
37
38
|
source: "manual" | "telegram_pairing" | "api";
|
|
@@ -195,6 +196,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
195
196
|
agentKey: string;
|
|
196
197
|
boundAt: number;
|
|
197
198
|
consumerUserId: string;
|
|
199
|
+
conversationId: string;
|
|
198
200
|
metadata: null | Record<string, string>;
|
|
199
201
|
revokedAt: null | number;
|
|
200
202
|
source: "manual" | "telegram_pairing" | "api";
|
|
@@ -300,6 +302,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
300
302
|
}, {
|
|
301
303
|
agentKey: null | string;
|
|
302
304
|
consumerUserId: null | string;
|
|
305
|
+
conversationId: null | string;
|
|
303
306
|
}, Name>;
|
|
304
307
|
resolveAgentForUser: FunctionReference<"query", "internal", {
|
|
305
308
|
consumerUserId: string;
|
|
@@ -344,6 +347,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
344
347
|
agentKey: string;
|
|
345
348
|
boundAt: number;
|
|
346
349
|
consumerUserId: string;
|
|
350
|
+
conversationId: string;
|
|
347
351
|
metadata: null | Record<string, string>;
|
|
348
352
|
revokedAt: null | number;
|
|
349
353
|
source: "manual" | "telegram_pairing" | "api";
|
|
@@ -381,6 +385,16 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
381
385
|
leaseId: string;
|
|
382
386
|
messageId: string;
|
|
383
387
|
payload: {
|
|
388
|
+
attachments?: Array<{
|
|
389
|
+
expiresAt: number;
|
|
390
|
+
fileName?: string;
|
|
391
|
+
kind: "photo" | "video" | "audio" | "voice" | "document";
|
|
392
|
+
mimeType?: string;
|
|
393
|
+
sizeBytes?: number;
|
|
394
|
+
status: "ready" | "expired";
|
|
395
|
+
storageId: string;
|
|
396
|
+
telegramFileId: string;
|
|
397
|
+
}>;
|
|
384
398
|
externalMessageId?: string;
|
|
385
399
|
messageText: string;
|
|
386
400
|
metadata?: Record<string, string>;
|
|
@@ -639,6 +653,16 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
639
653
|
maxAttempts?: number;
|
|
640
654
|
nowMs?: number;
|
|
641
655
|
payload: {
|
|
656
|
+
attachments?: Array<{
|
|
657
|
+
expiresAt: number;
|
|
658
|
+
fileName?: string;
|
|
659
|
+
kind: "photo" | "video" | "audio" | "voice" | "document";
|
|
660
|
+
mimeType?: string;
|
|
661
|
+
sizeBytes?: number;
|
|
662
|
+
status: "ready" | "expired";
|
|
663
|
+
storageId: string;
|
|
664
|
+
telegramFileId: string;
|
|
665
|
+
}>;
|
|
642
666
|
externalMessageId?: string;
|
|
643
667
|
messageText: string;
|
|
644
668
|
metadata?: Record<string, string>;
|
|
@@ -742,6 +766,16 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
742
766
|
lastError: null | string;
|
|
743
767
|
maxAttempts: number;
|
|
744
768
|
payload: {
|
|
769
|
+
attachments?: Array<{
|
|
770
|
+
expiresAt: number;
|
|
771
|
+
fileName?: string;
|
|
772
|
+
kind: "photo" | "video" | "audio" | "voice" | "document";
|
|
773
|
+
mimeType?: string;
|
|
774
|
+
sizeBytes?: number;
|
|
775
|
+
status: "ready" | "expired";
|
|
776
|
+
storageId: string;
|
|
777
|
+
telegramFileId: string;
|
|
778
|
+
}>;
|
|
745
779
|
externalMessageId?: string;
|
|
746
780
|
messageText: string;
|
|
747
781
|
metadata?: Record<string, string>;
|
|
@@ -782,6 +816,16 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
782
816
|
};
|
|
783
817
|
messageId: string;
|
|
784
818
|
payload: {
|
|
819
|
+
attachments?: Array<{
|
|
820
|
+
expiresAt: number;
|
|
821
|
+
fileName?: string;
|
|
822
|
+
kind: "photo" | "video" | "audio" | "voice" | "document";
|
|
823
|
+
mimeType?: string;
|
|
824
|
+
sizeBytes?: number;
|
|
825
|
+
status: "ready" | "expired";
|
|
826
|
+
storageId: string;
|
|
827
|
+
telegramFileId: string;
|
|
828
|
+
}>;
|
|
785
829
|
externalMessageId?: string;
|
|
786
830
|
messageText: string;
|
|
787
831
|
metadata?: Record<string, string>;
|
|
@@ -796,7 +840,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
796
840
|
consumerUserId: string;
|
|
797
841
|
nowMs?: number;
|
|
798
842
|
}, null | {
|
|
799
|
-
conversationId:
|
|
843
|
+
conversationId: string;
|
|
800
844
|
createdAt: number;
|
|
801
845
|
downloadUrl: null | string;
|
|
802
846
|
sha256: null | string;
|
|
@@ -869,6 +913,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
869
913
|
agentKey: string;
|
|
870
914
|
boundAt: number;
|
|
871
915
|
consumerUserId: string;
|
|
916
|
+
conversationId: string;
|
|
872
917
|
metadata: null | Record<string, string>;
|
|
873
918
|
revokedAt: null | number;
|
|
874
919
|
source: "manual" | "telegram_pairing" | "api";
|
|
@@ -1126,6 +1171,16 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
1126
1171
|
lastError: null | string;
|
|
1127
1172
|
maxAttempts: number;
|
|
1128
1173
|
payload: {
|
|
1174
|
+
attachments?: Array<{
|
|
1175
|
+
expiresAt: number;
|
|
1176
|
+
fileName?: string;
|
|
1177
|
+
kind: "photo" | "video" | "audio" | "voice" | "document";
|
|
1178
|
+
mimeType?: string;
|
|
1179
|
+
sizeBytes?: number;
|
|
1180
|
+
status: "ready" | "expired";
|
|
1181
|
+
storageId: string;
|
|
1182
|
+
telegramFileId: string;
|
|
1183
|
+
}>;
|
|
1129
1184
|
externalMessageId?: string;
|
|
1130
1185
|
messageText: string;
|
|
1131
1186
|
metadata?: Record<string, string>;
|
|
@@ -1151,6 +1206,16 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
1151
1206
|
lastError: null | string;
|
|
1152
1207
|
maxAttempts: number;
|
|
1153
1208
|
payload: {
|
|
1209
|
+
attachments?: Array<{
|
|
1210
|
+
expiresAt: number;
|
|
1211
|
+
fileName?: string;
|
|
1212
|
+
kind: "photo" | "video" | "audio" | "voice" | "document";
|
|
1213
|
+
mimeType?: string;
|
|
1214
|
+
sizeBytes?: number;
|
|
1215
|
+
status: "ready" | "expired";
|
|
1216
|
+
storageId: string;
|
|
1217
|
+
telegramFileId: string;
|
|
1218
|
+
}>;
|
|
1154
1219
|
externalMessageId?: string;
|
|
1155
1220
|
messageText: string;
|
|
1156
1221
|
metadata?: Record<string, string>;
|
|
@@ -1167,7 +1232,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
1167
1232
|
limit?: number;
|
|
1168
1233
|
nowMs?: number;
|
|
1169
1234
|
}, Array<{
|
|
1170
|
-
conversationId:
|
|
1235
|
+
conversationId: string;
|
|
1171
1236
|
createdAt: number;
|
|
1172
1237
|
downloadUrl: null | string;
|
|
1173
1238
|
sha256: null | string;
|
|
@@ -1181,7 +1246,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
1181
1246
|
limit?: number;
|
|
1182
1247
|
nowMs?: number;
|
|
1183
1248
|
}, Array<{
|
|
1184
|
-
conversationId:
|
|
1249
|
+
conversationId: string;
|
|
1185
1250
|
createdAt: number;
|
|
1186
1251
|
downloadUrl: null | string;
|
|
1187
1252
|
sha256: null | string;
|
|
@@ -1210,6 +1275,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
1210
1275
|
}>, Name>;
|
|
1211
1276
|
messageRuntimeConfig: FunctionReference<"query", "internal", {}, null | {
|
|
1212
1277
|
systemPrompt?: string;
|
|
1278
|
+
telegramAttachmentRetentionMs?: number;
|
|
1213
1279
|
}, Name>;
|
|
1214
1280
|
providerRuntimeConfig: FunctionReference<"query", "internal", {}, null | {
|
|
1215
1281
|
appName: string;
|
|
@@ -1268,6 +1334,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
1268
1334
|
}, {
|
|
1269
1335
|
agentKey: null | string;
|
|
1270
1336
|
consumerUserId: null | string;
|
|
1337
|
+
conversationId: null | string;
|
|
1271
1338
|
}, Name>;
|
|
1272
1339
|
resolveAgentForUser: FunctionReference<"query", "internal", {
|
|
1273
1340
|
consumerUserId: string;
|
|
@@ -1330,6 +1397,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
1330
1397
|
setMessageRuntimeConfig: FunctionReference<"mutation", "internal", {
|
|
1331
1398
|
messageConfig: {
|
|
1332
1399
|
systemPrompt?: string;
|
|
1400
|
+
telegramAttachmentRetentionMs?: number;
|
|
1333
1401
|
};
|
|
1334
1402
|
nowMs?: number;
|
|
1335
1403
|
}, null, Name>;
|
|
@@ -1936,6 +2004,16 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
1936
2004
|
leaseId: string;
|
|
1937
2005
|
messageId: string;
|
|
1938
2006
|
payload: {
|
|
2007
|
+
attachments?: Array<{
|
|
2008
|
+
expiresAt: number;
|
|
2009
|
+
fileName?: string;
|
|
2010
|
+
kind: "photo" | "video" | "audio" | "voice" | "document";
|
|
2011
|
+
mimeType?: string;
|
|
2012
|
+
sizeBytes?: number;
|
|
2013
|
+
status: "ready" | "expired";
|
|
2014
|
+
storageId: string;
|
|
2015
|
+
telegramFileId: string;
|
|
2016
|
+
}>;
|
|
1939
2017
|
externalMessageId?: string;
|
|
1940
2018
|
messageText: string;
|
|
1941
2019
|
metadata?: Record<string, string>;
|
|
@@ -1994,6 +2072,16 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
1994
2072
|
maxAttempts?: number;
|
|
1995
2073
|
nowMs?: number;
|
|
1996
2074
|
payload: {
|
|
2075
|
+
attachments?: Array<{
|
|
2076
|
+
expiresAt: number;
|
|
2077
|
+
fileName?: string;
|
|
2078
|
+
kind: "photo" | "video" | "audio" | "voice" | "document";
|
|
2079
|
+
mimeType?: string;
|
|
2080
|
+
sizeBytes?: number;
|
|
2081
|
+
status: "ready" | "expired";
|
|
2082
|
+
storageId: string;
|
|
2083
|
+
telegramFileId: string;
|
|
2084
|
+
}>;
|
|
1997
2085
|
externalMessageId?: string;
|
|
1998
2086
|
messageText: string;
|
|
1999
2087
|
metadata?: Record<string, string>;
|
|
@@ -2081,6 +2169,16 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
2081
2169
|
lastError: null | string;
|
|
2082
2170
|
maxAttempts: number;
|
|
2083
2171
|
payload: {
|
|
2172
|
+
attachments?: Array<{
|
|
2173
|
+
expiresAt: number;
|
|
2174
|
+
fileName?: string;
|
|
2175
|
+
kind: "photo" | "video" | "audio" | "voice" | "document";
|
|
2176
|
+
mimeType?: string;
|
|
2177
|
+
sizeBytes?: number;
|
|
2178
|
+
status: "ready" | "expired";
|
|
2179
|
+
storageId: string;
|
|
2180
|
+
telegramFileId: string;
|
|
2181
|
+
}>;
|
|
2084
2182
|
externalMessageId?: string;
|
|
2085
2183
|
messageText: string;
|
|
2086
2184
|
metadata?: Record<string, string>;
|
|
@@ -2121,6 +2219,16 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
2121
2219
|
};
|
|
2122
2220
|
messageId: string;
|
|
2123
2221
|
payload: {
|
|
2222
|
+
attachments?: Array<{
|
|
2223
|
+
expiresAt: number;
|
|
2224
|
+
fileName?: string;
|
|
2225
|
+
kind: "photo" | "video" | "audio" | "voice" | "document";
|
|
2226
|
+
mimeType?: string;
|
|
2227
|
+
sizeBytes?: number;
|
|
2228
|
+
status: "ready" | "expired";
|
|
2229
|
+
storageId: string;
|
|
2230
|
+
telegramFileId: string;
|
|
2231
|
+
}>;
|
|
2124
2232
|
externalMessageId?: string;
|
|
2125
2233
|
messageText: string;
|
|
2126
2234
|
metadata?: Record<string, string>;
|
|
@@ -2132,7 +2240,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
2132
2240
|
}, Name>;
|
|
2133
2241
|
getLatestDataSnapshotForRestore: FunctionReference<"query", "internal", {
|
|
2134
2242
|
agentKey: string;
|
|
2135
|
-
conversationId
|
|
2243
|
+
conversationId: string;
|
|
2136
2244
|
nowMs?: number;
|
|
2137
2245
|
workspaceId: string;
|
|
2138
2246
|
}, null | {
|
|
@@ -2147,7 +2255,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
2147
2255
|
consumerUserId: string;
|
|
2148
2256
|
nowMs?: number;
|
|
2149
2257
|
}, null | {
|
|
2150
|
-
conversationId:
|
|
2258
|
+
conversationId: string;
|
|
2151
2259
|
createdAt: number;
|
|
2152
2260
|
downloadUrl: null | string;
|
|
2153
2261
|
sha256: null | string;
|
|
@@ -2281,6 +2389,16 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
2281
2389
|
lastError: null | string;
|
|
2282
2390
|
maxAttempts: number;
|
|
2283
2391
|
payload: {
|
|
2392
|
+
attachments?: Array<{
|
|
2393
|
+
expiresAt: number;
|
|
2394
|
+
fileName?: string;
|
|
2395
|
+
kind: "photo" | "video" | "audio" | "voice" | "document";
|
|
2396
|
+
mimeType?: string;
|
|
2397
|
+
sizeBytes?: number;
|
|
2398
|
+
status: "ready" | "expired";
|
|
2399
|
+
storageId: string;
|
|
2400
|
+
telegramFileId: string;
|
|
2401
|
+
}>;
|
|
2284
2402
|
externalMessageId?: string;
|
|
2285
2403
|
messageText: string;
|
|
2286
2404
|
metadata?: Record<string, string>;
|
|
@@ -2306,6 +2424,16 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
2306
2424
|
lastError: null | string;
|
|
2307
2425
|
maxAttempts: number;
|
|
2308
2426
|
payload: {
|
|
2427
|
+
attachments?: Array<{
|
|
2428
|
+
expiresAt: number;
|
|
2429
|
+
fileName?: string;
|
|
2430
|
+
kind: "photo" | "video" | "audio" | "voice" | "document";
|
|
2431
|
+
mimeType?: string;
|
|
2432
|
+
sizeBytes?: number;
|
|
2433
|
+
status: "ready" | "expired";
|
|
2434
|
+
storageId: string;
|
|
2435
|
+
telegramFileId: string;
|
|
2436
|
+
}>;
|
|
2309
2437
|
externalMessageId?: string;
|
|
2310
2438
|
messageText: string;
|
|
2311
2439
|
metadata?: Record<string, string>;
|
|
@@ -2322,7 +2450,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
2322
2450
|
limit?: number;
|
|
2323
2451
|
nowMs?: number;
|
|
2324
2452
|
}, Array<{
|
|
2325
|
-
conversationId:
|
|
2453
|
+
conversationId: string;
|
|
2326
2454
|
createdAt: number;
|
|
2327
2455
|
downloadUrl: null | string;
|
|
2328
2456
|
sha256: null | string;
|
|
@@ -2336,7 +2464,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
2336
2464
|
limit?: number;
|
|
2337
2465
|
nowMs?: number;
|
|
2338
2466
|
}, Array<{
|
|
2339
|
-
conversationId:
|
|
2467
|
+
conversationId: string;
|
|
2340
2468
|
createdAt: number;
|
|
2341
2469
|
downloadUrl: null | string;
|
|
2342
2470
|
sha256: null | string;
|
|
@@ -2346,10 +2474,11 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
2346
2474
|
}>, Name>;
|
|
2347
2475
|
messageRuntimeConfig: FunctionReference<"query", "internal", {}, null | {
|
|
2348
2476
|
systemPrompt?: string;
|
|
2477
|
+
telegramAttachmentRetentionMs?: number;
|
|
2349
2478
|
}, Name>;
|
|
2350
2479
|
prepareDataSnapshotUpload: FunctionReference<"mutation", "internal", {
|
|
2351
2480
|
agentKey: string;
|
|
2352
|
-
conversationId
|
|
2481
|
+
conversationId: string;
|
|
2353
2482
|
nowMs?: number;
|
|
2354
2483
|
reason: "drain" | "signal" | "manual";
|
|
2355
2484
|
workerId: string;
|
|
@@ -2406,6 +2535,7 @@ export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
|
2406
2535
|
setMessageRuntimeConfig: FunctionReference<"mutation", "internal", {
|
|
2407
2536
|
messageConfig: {
|
|
2408
2537
|
systemPrompt?: string;
|
|
2538
|
+
telegramAttachmentRetentionMs?: number;
|
|
2409
2539
|
};
|
|
2410
2540
|
nowMs?: number;
|
|
2411
2541
|
}, null, Name>;
|