@okrlinkhub/agent-factory 2.0.3 → 3.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.
Files changed (38) hide show
  1. package/README.md +102 -0
  2. package/dist/client/index.d.ts +53 -21
  3. package/dist/client/index.d.ts.map +1 -1
  4. package/dist/client/index.js +74 -3
  5. package/dist/client/index.js.map +1 -1
  6. package/dist/component/_generated/api.d.ts +2 -0
  7. package/dist/component/_generated/api.d.ts.map +1 -1
  8. package/dist/component/_generated/api.js.map +1 -1
  9. package/dist/component/_generated/component.d.ts +119 -2
  10. package/dist/component/_generated/component.d.ts.map +1 -1
  11. package/dist/component/identity.d.ts +6 -6
  12. package/dist/component/lib.d.ts +2 -1
  13. package/dist/component/lib.d.ts.map +1 -1
  14. package/dist/component/lib.js +2 -1
  15. package/dist/component/lib.js.map +1 -1
  16. package/dist/component/messageTemplates.d.ts +37 -0
  17. package/dist/component/messageTemplates.d.ts.map +1 -0
  18. package/dist/component/messageTemplates.js +177 -0
  19. package/dist/component/messageTemplates.js.map +1 -0
  20. package/dist/component/pushing.d.ts +37 -37
  21. package/dist/component/queue.d.ts +113 -90
  22. package/dist/component/queue.d.ts.map +1 -1
  23. package/dist/component/queue.js +122 -47
  24. package/dist/component/queue.js.map +1 -1
  25. package/dist/component/scheduler.d.ts +23 -23
  26. package/dist/component/schema.d.ts +86 -44
  27. package/dist/component/schema.d.ts.map +1 -1
  28. package/dist/component/schema.js +19 -1
  29. package/dist/component/schema.js.map +1 -1
  30. package/package.json +1 -1
  31. package/src/client/index.ts +76 -3
  32. package/src/component/_generated/api.ts +2 -0
  33. package/src/component/_generated/component.ts +159 -2
  34. package/src/component/lib.test.ts +125 -0
  35. package/src/component/lib.ts +8 -0
  36. package/src/component/messageTemplates.ts +205 -0
  37. package/src/component/queue.ts +165 -49
  38. package/src/component/schema.ts +22 -1
@@ -1,17 +1,17 @@
1
1
  export declare const reconcileWorkerPool: import("convex/server").RegisteredAction<"public", {
2
+ nowMs?: number | undefined;
3
+ workspaceId?: string | undefined;
4
+ flyApiToken?: string | undefined;
2
5
  providerConfig?: {
3
- kind: "fly" | "runpod" | "ecs";
4
6
  appName: string;
5
- region: string;
7
+ kind: "fly" | "runpod" | "ecs";
6
8
  organizationSlug: string;
7
9
  image: string;
10
+ region: string;
8
11
  volumeName: string;
9
12
  volumePath: string;
10
13
  volumeSizeGb: number;
11
14
  } | undefined;
12
- workspaceId?: string | undefined;
13
- nowMs?: number | undefined;
14
- flyApiToken?: string | undefined;
15
15
  convexUrl?: string | undefined;
16
16
  scalingPolicy?: {
17
17
  maxWorkers: number;
@@ -26,19 +26,19 @@ export declare const reconcileWorkerPool: import("convex/server").RegisteredActi
26
26
  terminated: number;
27
27
  }>>;
28
28
  export declare const reconcileWorkerPoolInternal: import("convex/server").RegisteredAction<"internal", {
29
+ nowMs?: number | undefined;
30
+ workspaceId?: string | undefined;
31
+ flyApiToken?: string | undefined;
29
32
  providerConfig?: {
30
- kind: "fly" | "runpod" | "ecs";
31
33
  appName: string;
32
- region: string;
34
+ kind: "fly" | "runpod" | "ecs";
33
35
  organizationSlug: string;
34
36
  image: string;
37
+ region: string;
35
38
  volumeName: string;
36
39
  volumePath: string;
37
40
  volumeSizeGb: number;
38
41
  } | undefined;
39
- workspaceId?: string | undefined;
40
- nowMs?: number | undefined;
41
- flyApiToken?: string | undefined;
42
42
  convexUrl?: string | undefined;
43
43
  scalingPolicy?: {
44
44
  maxWorkers: number;
@@ -53,19 +53,19 @@ export declare const reconcileWorkerPoolInternal: import("convex/server").Regist
53
53
  terminated: number;
54
54
  }>>;
55
55
  export declare const reconcileWorkerPoolFromEnqueue: import("convex/server").RegisteredAction<"internal", {
56
+ nowMs?: number | undefined;
57
+ workspaceId?: string | undefined;
58
+ flyApiToken?: string | undefined;
56
59
  providerConfig?: {
57
- kind: "fly" | "runpod" | "ecs";
58
60
  appName: string;
59
- region: string;
61
+ kind: "fly" | "runpod" | "ecs";
60
62
  organizationSlug: string;
61
63
  image: string;
64
+ region: string;
62
65
  volumeName: string;
63
66
  volumePath: string;
64
67
  volumeSizeGb: number;
65
68
  } | undefined;
66
- workspaceId?: string | undefined;
67
- nowMs?: number | undefined;
68
- flyApiToken?: string | undefined;
69
69
  convexUrl?: string | undefined;
70
70
  scalingPolicy?: {
71
71
  maxWorkers: number;
@@ -76,18 +76,18 @@ export declare const reconcileWorkerPoolFromEnqueue: import("convex/server").Reg
76
76
  } | undefined;
77
77
  }, Promise<null>>;
78
78
  export declare const enforceIdleShutdowns: import("convex/server").RegisteredAction<"internal", {
79
+ nowMs?: number | undefined;
80
+ flyApiToken?: string | undefined;
79
81
  providerConfig?: {
80
- kind: "fly" | "runpod" | "ecs";
81
82
  appName: string;
82
- region: string;
83
+ kind: "fly" | "runpod" | "ecs";
83
84
  organizationSlug: string;
84
85
  image: string;
86
+ region: string;
85
87
  volumeName: string;
86
88
  volumePath: string;
87
89
  volumeSizeGb: number;
88
90
  } | undefined;
89
- nowMs?: number | undefined;
90
- flyApiToken?: string | undefined;
91
91
  }, Promise<{
92
92
  checked: number;
93
93
  stopped: number;
@@ -95,18 +95,18 @@ export declare const enforceIdleShutdowns: import("convex/server").RegisteredAct
95
95
  nextCheckScheduled: boolean;
96
96
  }>>;
97
97
  export declare const checkIdleShutdowns: import("convex/server").RegisteredAction<"public", {
98
+ nowMs?: number | undefined;
99
+ flyApiToken?: string | undefined;
98
100
  providerConfig?: {
99
- kind: "fly" | "runpod" | "ecs";
100
101
  appName: string;
101
- region: string;
102
+ kind: "fly" | "runpod" | "ecs";
102
103
  organizationSlug: string;
103
104
  image: string;
105
+ region: string;
104
106
  volumeName: string;
105
107
  volumePath: string;
106
108
  volumeSizeGb: number;
107
109
  } | undefined;
108
- nowMs?: number | undefined;
109
- flyApiToken?: string | undefined;
110
110
  }, Promise<{
111
111
  checked: number;
112
112
  stopped: number;
@@ -30,9 +30,9 @@ declare const _default: import("convex/server").SchemaDefinition<{
30
30
  appKey: import("convex/values").VString<string | undefined, "optional">;
31
31
  serviceKeySecretRef: import("convex/values").VString<string | undefined, "optional">;
32
32
  appBaseUrlMapJsonSecretRef: import("convex/values").VString<string | undefined, "optional">;
33
- }, "optional", "enabled" | "baseUrl" | "serviceId" | "appKey" | "serviceKeySecretRef" | "appBaseUrlMapJsonSecretRef">;
33
+ }, "optional", "baseUrl" | "serviceId" | "appKey" | "enabled" | "serviceKeySecretRef" | "appBaseUrlMapJsonSecretRef">;
34
34
  enabled: import("convex/values").VBoolean<boolean, "required">;
35
- }, "required", "agentKey" | "bridgeConfig" | "enabled" | "secretsRef" | "version" | "bridgeConfig.enabled" | "bridgeConfig.baseUrl" | "bridgeConfig.serviceId" | "bridgeConfig.appKey" | "bridgeConfig.serviceKeySecretRef" | "bridgeConfig.appBaseUrlMapJsonSecretRef">, {
35
+ }, "required", "agentKey" | "bridgeConfig" | "enabled" | "secretsRef" | "version" | "bridgeConfig.baseUrl" | "bridgeConfig.serviceId" | "bridgeConfig.appKey" | "bridgeConfig.enabled" | "bridgeConfig.serviceKeySecretRef" | "bridgeConfig.appBaseUrlMapJsonSecretRef">, {
36
36
  by_agentKey: ["agentKey", "_creationTime"];
37
37
  by_enabled: ["enabled", "_creationTime"];
38
38
  }, {}, {}>;
@@ -109,6 +109,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
109
109
  lastError?: string | undefined;
110
110
  nextRetryAt?: number | undefined;
111
111
  deadLetteredAt?: number | undefined;
112
+ status: "failed" | "done" | "queued" | "processing" | "dead_letter";
112
113
  agentKey: string;
113
114
  conversationId: string;
114
115
  maxAttempts: number;
@@ -119,8 +120,8 @@ declare const _default: import("convex/server").SchemaDefinition<{
119
120
  fileName?: string | undefined;
120
121
  mimeType?: string | undefined;
121
122
  downloadUrl?: string | undefined;
122
- storageId: import("convex/values").GenericId<"_storage">;
123
123
  status: "expired" | "ready";
124
+ storageId: import("convex/values").GenericId<"_storage">;
124
125
  kind: "photo" | "video" | "audio" | "voice" | "document";
125
126
  telegramFileId: string;
126
127
  expiresAt: number;
@@ -133,7 +134,6 @@ declare const _default: import("convex/server").SchemaDefinition<{
133
134
  };
134
135
  priority: number;
135
136
  scheduledFor: number;
136
- status: "failed" | "done" | "queued" | "processing" | "dead_letter";
137
137
  attempts: number;
138
138
  }, {
139
139
  conversationId: import("convex/values").VString<string, "required">;
@@ -145,8 +145,8 @@ declare const _default: import("convex/server").SchemaDefinition<{
145
145
  fileName?: string | undefined;
146
146
  mimeType?: string | undefined;
147
147
  downloadUrl?: string | undefined;
148
- storageId: import("convex/values").GenericId<"_storage">;
149
148
  status: "expired" | "ready";
149
+ storageId: import("convex/values").GenericId<"_storage">;
150
150
  kind: "photo" | "video" | "audio" | "voice" | "document";
151
151
  telegramFileId: string;
152
152
  expiresAt: number;
@@ -168,8 +168,8 @@ declare const _default: import("convex/server").SchemaDefinition<{
168
168
  fileName?: string | undefined;
169
169
  mimeType?: string | undefined;
170
170
  downloadUrl?: string | undefined;
171
- storageId: import("convex/values").GenericId<"_storage">;
172
171
  status: "expired" | "ready";
172
+ storageId: import("convex/values").GenericId<"_storage">;
173
173
  kind: "photo" | "video" | "audio" | "voice" | "document";
174
174
  telegramFileId: string;
175
175
  expiresAt: number;
@@ -178,8 +178,8 @@ declare const _default: import("convex/server").SchemaDefinition<{
178
178
  fileName?: string | undefined;
179
179
  mimeType?: string | undefined;
180
180
  downloadUrl?: string | undefined;
181
- storageId: import("convex/values").GenericId<"_storage">;
182
181
  status: "expired" | "ready";
182
+ storageId: import("convex/values").GenericId<"_storage">;
183
183
  kind: "photo" | "video" | "audio" | "voice" | "document";
184
184
  telegramFileId: string;
185
185
  expiresAt: number;
@@ -193,7 +193,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
193
193
  sizeBytes: import("convex/values").VFloat64<number | undefined, "optional">;
194
194
  expiresAt: import("convex/values").VFloat64<number, "required">;
195
195
  downloadUrl: import("convex/values").VString<string | undefined, "optional">;
196
- }, "required", "storageId" | "sizeBytes" | "status" | "kind" | "telegramFileId" | "fileName" | "mimeType" | "expiresAt" | "downloadUrl">, "optional">;
196
+ }, "required", "status" | "storageId" | "sizeBytes" | "kind" | "telegramFileId" | "fileName" | "mimeType" | "expiresAt" | "downloadUrl">, "optional">;
197
197
  }, "required", "metadata" | "attachments" | "provider" | "providerUserId" | "messageText" | "externalMessageId" | "rawUpdateJson" | `metadata.${string}`>;
198
198
  status: import("convex/values").VUnion<"failed" | "done" | "queued" | "processing" | "dead_letter", [import("convex/values").VLiteral<"queued", "required">, import("convex/values").VLiteral<"processing", "required">, import("convex/values").VLiteral<"done", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"dead_letter", "required">], "required", never>;
199
199
  priority: import("convex/values").VFloat64<number, "required">;
@@ -206,7 +206,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
206
206
  lastError: import("convex/values").VString<string | undefined, "optional">;
207
207
  nextRetryAt: import("convex/values").VFloat64<number | undefined, "optional">;
208
208
  deadLetteredAt: import("convex/values").VFloat64<number | undefined, "optional">;
209
- }, "required", "agentKey" | "conversationId" | "leaseId" | "maxAttempts" | "payload" | "priority" | "scheduledFor" | "status" | "leaseExpiresAt" | "claimedBy" | "attempts" | "lastError" | "nextRetryAt" | "deadLetteredAt" | "payload.metadata" | "payload.attachments" | "payload.provider" | "payload.providerUserId" | "payload.messageText" | "payload.externalMessageId" | "payload.rawUpdateJson" | `payload.metadata.${string}`>, {
209
+ }, "required", "status" | "agentKey" | "conversationId" | "leaseId" | "maxAttempts" | "payload" | "priority" | "scheduledFor" | "leaseExpiresAt" | "claimedBy" | "attempts" | "lastError" | "nextRetryAt" | "deadLetteredAt" | "payload.metadata" | "payload.attachments" | "payload.provider" | "payload.providerUserId" | "payload.messageText" | "payload.externalMessageId" | "payload.rawUpdateJson" | `payload.metadata.${string}`>, {
210
210
  by_status_and_scheduledFor: ["status", "scheduledFor", "_creationTime"];
211
211
  by_status_and_priority_and_scheduledFor: ["status", "priority", "scheduledFor", "_creationTime"];
212
212
  by_status_and_leaseExpiresAt: ["status", "leaseExpiresAt", "_creationTime"];
@@ -231,10 +231,10 @@ declare const _default: import("convex/server").SchemaDefinition<{
231
231
  leaseId: string;
232
232
  assignedAt: number;
233
233
  } | undefined;
234
- workerId: string;
235
234
  status: "active" | "draining" | "stopping" | "stopped";
236
- heartbeatAt: number;
235
+ workerId: string;
237
236
  provider: string;
237
+ heartbeatAt: number;
238
238
  load: number;
239
239
  capabilities: string[];
240
240
  }, {
@@ -248,7 +248,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
248
248
  appName: import("convex/values").VString<string, "required">;
249
249
  machineId: import("convex/values").VString<string, "required">;
250
250
  region: import("convex/values").VString<string | undefined, "optional">;
251
- }, "optional", "appName" | "machineId" | "region">;
251
+ }, "optional", "appName" | "region" | "machineId">;
252
252
  status: import("convex/values").VUnion<"active" | "draining" | "stopping" | "stopped", [import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"draining", "required">, import("convex/values").VLiteral<"stopping", "required">, import("convex/values").VLiteral<"stopped", "required">], "required", never>;
253
253
  load: import("convex/values").VFloat64<number, "required">;
254
254
  heartbeatAt: import("convex/values").VFloat64<number, "required">;
@@ -268,7 +268,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
268
268
  assignedAt: import("convex/values").VFloat64<number, "required">;
269
269
  }, "optional", "agentKey" | "conversationId" | "leaseId" | "assignedAt">;
270
270
  capabilities: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
271
- }, "required", "workerId" | "status" | "heartbeatAt" | "provider" | "machineRef" | "load" | "lastClaimAt" | "scheduledShutdownAt" | "stoppedAt" | "lastSnapshotId" | "assignment" | "capabilities" | "machineRef.appName" | "machineRef.machineId" | "machineRef.region" | "assignment.agentKey" | "assignment.conversationId" | "assignment.leaseId" | "assignment.assignedAt">, {
271
+ }, "required", "status" | "workerId" | "provider" | "heartbeatAt" | "machineRef" | "load" | "lastClaimAt" | "scheduledShutdownAt" | "stoppedAt" | "lastSnapshotId" | "assignment" | "capabilities" | "machineRef.appName" | "machineRef.region" | "machineRef.machineId" | "assignment.agentKey" | "assignment.conversationId" | "assignment.leaseId" | "assignment.assignedAt">, {
272
272
  by_workerId: ["workerId", "_creationTime"];
273
273
  by_status: ["status", "_creationTime"];
274
274
  by_heartbeatAt: ["heartbeatAt", "_creationTime"];
@@ -278,9 +278,9 @@ declare const _default: import("convex/server").SchemaDefinition<{
278
278
  providerConfig?: {
279
279
  appName: string;
280
280
  kind: "fly" | "runpod" | "ecs";
281
- region: string;
282
281
  organizationSlug: string;
283
282
  image: string;
283
+ region: string;
284
284
  volumeName: string;
285
285
  volumePath: string;
286
286
  volumeSizeGb: number;
@@ -296,9 +296,9 @@ declare const _default: import("convex/server").SchemaDefinition<{
296
296
  providerConfig: import("convex/values").VObject<{
297
297
  appName: string;
298
298
  kind: "fly" | "runpod" | "ecs";
299
- region: string;
300
299
  organizationSlug: string;
301
300
  image: string;
301
+ region: string;
302
302
  volumeName: string;
303
303
  volumePath: string;
304
304
  volumeSizeGb: number;
@@ -311,7 +311,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
311
311
  volumeName: import("convex/values").VString<string, "required">;
312
312
  volumePath: import("convex/values").VString<string, "required">;
313
313
  volumeSizeGb: import("convex/values").VFloat64<number, "required">;
314
- }, "optional", "appName" | "kind" | "region" | "organizationSlug" | "image" | "volumeName" | "volumePath" | "volumeSizeGb">;
314
+ }, "optional", "appName" | "kind" | "organizationSlug" | "image" | "region" | "volumeName" | "volumePath" | "volumeSizeGb">;
315
315
  messageConfig: import("convex/values").VObject<{
316
316
  systemPrompt?: string | undefined;
317
317
  telegramAttachmentRetentionMs?: number | undefined;
@@ -320,20 +320,20 @@ declare const _default: import("convex/server").SchemaDefinition<{
320
320
  telegramAttachmentRetentionMs: import("convex/values").VFloat64<number | undefined, "optional">;
321
321
  }, "optional", "systemPrompt" | "telegramAttachmentRetentionMs">;
322
322
  updatedAt: import("convex/values").VFloat64<number, "required">;
323
- }, "required", "providerConfig" | "messageConfig" | "key" | "updatedAt" | "providerConfig.appName" | "providerConfig.kind" | "providerConfig.region" | "providerConfig.organizationSlug" | "providerConfig.image" | "providerConfig.volumeName" | "providerConfig.volumePath" | "providerConfig.volumeSizeGb" | "messageConfig.systemPrompt" | "messageConfig.telegramAttachmentRetentionMs">, {
323
+ }, "required", "key" | "providerConfig" | "messageConfig" | "updatedAt" | "providerConfig.appName" | "providerConfig.kind" | "providerConfig.organizationSlug" | "providerConfig.image" | "providerConfig.region" | "providerConfig.volumeName" | "providerConfig.volumePath" | "providerConfig.volumeSizeGb" | "messageConfig.systemPrompt" | "messageConfig.telegramAttachmentRetentionMs">, {
324
324
  by_key: ["key", "_creationTime"];
325
325
  }, {}, {}>;
326
326
  messageAttachments: import("convex/server").TableDefinition<import("convex/values").VObject<{
327
327
  sizeBytes?: number | undefined;
328
328
  fileName?: string | undefined;
329
329
  mimeType?: string | undefined;
330
+ status: "expired" | "ready";
330
331
  agentKey: string;
331
332
  conversationId: string;
332
333
  messageId: import("convex/values").GenericId<"messageQueue">;
333
334
  storageId: import("convex/values").GenericId<"_storage">;
334
- status: "expired" | "ready";
335
- provider: string;
336
335
  kind: "photo" | "video" | "audio" | "voice" | "document";
336
+ provider: string;
337
337
  telegramFileId: string;
338
338
  expiresAt: number;
339
339
  createdAt: number;
@@ -351,7 +351,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
351
351
  sizeBytes: import("convex/values").VFloat64<number | undefined, "optional">;
352
352
  createdAt: import("convex/values").VFloat64<number, "required">;
353
353
  expiresAt: import("convex/values").VFloat64<number, "required">;
354
- }, "required", "agentKey" | "conversationId" | "messageId" | "storageId" | "sizeBytes" | "status" | "provider" | "kind" | "telegramFileId" | "fileName" | "mimeType" | "expiresAt" | "createdAt">, {
354
+ }, "required", "status" | "agentKey" | "conversationId" | "messageId" | "storageId" | "sizeBytes" | "kind" | "provider" | "telegramFileId" | "fileName" | "mimeType" | "expiresAt" | "createdAt">, {
355
355
  by_messageId: ["messageId", "_creationTime"];
356
356
  by_status_and_expiresAt: ["status", "expiresAt", "_creationTime"];
357
357
  by_conversationId_and_createdAt: ["conversationId", "createdAt", "_creationTime"];
@@ -362,11 +362,11 @@ declare const _default: import("convex/server").SchemaDefinition<{
362
362
  sizeBytes?: number | undefined;
363
363
  archiveFileId?: import("convex/values").GenericId<"_storage"> | undefined;
364
364
  completedAt?: number | undefined;
365
+ status: "expired" | "failed" | "ready" | "uploading";
365
366
  agentKey: string;
366
367
  conversationId: string;
367
368
  workspaceId: string;
368
369
  workerId: string;
369
- status: "expired" | "failed" | "ready" | "uploading";
370
370
  reason: "manual" | "drain" | "signal";
371
371
  expiresAt: number;
372
372
  createdAt: number;
@@ -386,7 +386,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
386
386
  createdAt: import("convex/values").VFloat64<number, "required">;
387
387
  completedAt: import("convex/values").VFloat64<number | undefined, "optional">;
388
388
  expiresAt: import("convex/values").VFloat64<number, "required">;
389
- }, "required", "agentKey" | "conversationId" | "workspaceId" | "workerId" | "error" | "sha256" | "sizeBytes" | "status" | "reason" | "expiresAt" | "createdAt" | "formatVersion" | "archiveFileId" | "completedAt">, {
389
+ }, "required", "error" | "status" | "agentKey" | "conversationId" | "workspaceId" | "workerId" | "sha256" | "sizeBytes" | "reason" | "expiresAt" | "createdAt" | "formatVersion" | "archiveFileId" | "completedAt">, {
390
390
  by_workerId_and_createdAt: ["workerId", "createdAt", "_creationTime"];
391
391
  by_workspaceId_and_agentKey_and_createdAt: ["workspaceId", "agentKey", "createdAt", "_creationTime"];
392
392
  by_workspaceId_and_agentKey_and_conversationId_and_createdAt: ["workspaceId", "agentKey", "conversationId", "createdAt", "_creationTime"];
@@ -422,11 +422,11 @@ declare const _default: import("convex/server").SchemaDefinition<{
422
422
  telegramChatId?: string | undefined;
423
423
  telegramUserId?: string | undefined;
424
424
  revokedAt?: number | undefined;
425
+ status: "active" | "revoked";
425
426
  agentKey: string;
426
427
  consumerUserId: string;
427
428
  source: "manual" | "telegram_pairing" | "api";
428
429
  conversationId: string;
429
- status: "active" | "revoked";
430
430
  boundAt: number;
431
431
  }, {
432
432
  consumerUserId: import("convex/values").VString<string, "required">;
@@ -439,7 +439,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
439
439
  metadata: import("convex/values").VRecord<Record<string, string> | undefined, import("convex/values").VString<string, "required">, import("convex/values").VString<string, "required">, "optional", string>;
440
440
  boundAt: import("convex/values").VFloat64<number, "required">;
441
441
  revokedAt: import("convex/values").VFloat64<number | undefined, "optional">;
442
- }, "required", "agentKey" | "consumerUserId" | "metadata" | "source" | "telegramChatId" | "telegramUserId" | "conversationId" | "status" | `metadata.${string}` | "boundAt" | "revokedAt">, {
442
+ }, "required", "status" | "agentKey" | "consumerUserId" | "metadata" | "source" | "telegramChatId" | "telegramUserId" | "conversationId" | `metadata.${string}` | "boundAt" | "revokedAt">, {
443
443
  by_consumerUserId_and_status: ["consumerUserId", "status", "_creationTime"];
444
444
  by_consumerUserId_and_agentKey_and_boundAt: ["consumerUserId", "agentKey", "boundAt", "_creationTime"];
445
445
  by_telegramUserId_and_status: ["telegramUserId", "status", "_creationTime"];
@@ -450,10 +450,10 @@ declare const _default: import("convex/server").SchemaDefinition<{
450
450
  telegramChatId?: string | undefined;
451
451
  telegramUserId?: string | undefined;
452
452
  usedAt?: number | undefined;
453
+ status: "pending" | "used" | "expired";
453
454
  agentKey: string;
454
455
  consumerUserId: string;
455
456
  code: string;
456
- status: "pending" | "used" | "expired";
457
457
  expiresAt: number;
458
458
  createdAt: number;
459
459
  }, {
@@ -466,7 +466,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
466
466
  usedAt: import("convex/values").VFloat64<number | undefined, "optional">;
467
467
  telegramUserId: import("convex/values").VString<string | undefined, "optional">;
468
468
  telegramChatId: import("convex/values").VString<string | undefined, "optional">;
469
- }, "required", "agentKey" | "consumerUserId" | "telegramChatId" | "telegramUserId" | "code" | "status" | "expiresAt" | "createdAt" | "usedAt">, {
469
+ }, "required", "status" | "agentKey" | "consumerUserId" | "telegramChatId" | "telegramUserId" | "code" | "expiresAt" | "createdAt" | "usedAt">, {
470
470
  by_code: ["code", "_creationTime"];
471
471
  by_consumerUserId_and_status: ["consumerUserId", "status", "_creationTime"];
472
472
  by_consumerUserId_and_agentKey_and_createdAt: ["consumerUserId", "agentKey", "createdAt", "_creationTime"];
@@ -474,9 +474,9 @@ declare const _default: import("convex/server").SchemaDefinition<{
474
474
  }, {}, {}>;
475
475
  globalSkills: import("convex/server").TableDefinition<import("convex/values").VObject<{
476
476
  description?: string | undefined;
477
+ status: "active" | "disabled";
477
478
  slug: string;
478
479
  displayName: string;
479
- status: "active" | "disabled";
480
480
  updatedAt: number;
481
481
  createdAt: number;
482
482
  createdBy: string;
@@ -490,15 +490,19 @@ declare const _default: import("convex/server").SchemaDefinition<{
490
490
  updatedBy: import("convex/values").VString<string, "required">;
491
491
  createdAt: import("convex/values").VFloat64<number, "required">;
492
492
  updatedAt: import("convex/values").VFloat64<number, "required">;
493
- }, "required", "slug" | "description" | "displayName" | "status" | "updatedAt" | "createdAt" | "createdBy" | "updatedBy">, {
493
+ }, "required", "status" | "slug" | "description" | "displayName" | "updatedAt" | "createdAt" | "createdBy" | "updatedBy">, {
494
494
  by_slug: ["slug", "_creationTime"];
495
495
  by_status: ["status", "_creationTime"];
496
496
  }, {}, {}>;
497
497
  globalSkillVersions: import("convex/server").TableDefinition<import("convex/values").VObject<{
498
498
  version: string;
499
499
  entryPoint: string;
500
+ files: {
501
+ content: string;
502
+ sha256: string;
503
+ path: string;
504
+ }[];
500
505
  moduleFormat: "esm" | "cjs";
501
- sourceJs: string;
502
506
  sha256: string;
503
507
  createdAt: number;
504
508
  createdBy: string;
@@ -508,11 +512,23 @@ declare const _default: import("convex/server").SchemaDefinition<{
508
512
  version: import("convex/values").VString<string, "required">;
509
513
  moduleFormat: import("convex/values").VUnion<"esm" | "cjs", [import("convex/values").VLiteral<"esm", "required">, import("convex/values").VLiteral<"cjs", "required">], "required", never>;
510
514
  entryPoint: import("convex/values").VString<string, "required">;
511
- sourceJs: import("convex/values").VString<string, "required">;
515
+ files: import("convex/values").VArray<{
516
+ content: string;
517
+ sha256: string;
518
+ path: string;
519
+ }[], import("convex/values").VObject<{
520
+ content: string;
521
+ sha256: string;
522
+ path: string;
523
+ }, {
524
+ path: import("convex/values").VString<string, "required">;
525
+ content: import("convex/values").VString<string, "required">;
526
+ sha256: import("convex/values").VString<string, "required">;
527
+ }, "required", "content" | "sha256" | "path">, "required">;
512
528
  sha256: import("convex/values").VString<string, "required">;
513
529
  createdBy: import("convex/values").VString<string, "required">;
514
530
  createdAt: import("convex/values").VFloat64<number, "required">;
515
- }, "required", "version" | "entryPoint" | "moduleFormat" | "sourceJs" | "sha256" | "createdAt" | "createdBy" | "skillId">, {
531
+ }, "required", "version" | "entryPoint" | "files" | "moduleFormat" | "sha256" | "createdAt" | "createdBy" | "skillId">, {
516
532
  by_skillId_and_version: ["skillId", "version", "_creationTime"];
517
533
  by_skillId_and_createdAt: ["skillId", "createdAt", "_creationTime"];
518
534
  }, {}, {}>;
@@ -572,10 +588,10 @@ declare const _default: import("convex/server").SchemaDefinition<{
572
588
  }, {}, {}>;
573
589
  messagePushTemplates: import("convex/server").TableDefinition<import("convex/values").VObject<{
574
590
  enabled: boolean;
575
- companyId: string;
576
- periodicity: "manual" | "daily" | "weekly" | "monthly";
577
591
  text: string;
578
592
  title: string;
593
+ companyId: string;
594
+ periodicity: "manual" | "daily" | "weekly" | "monthly";
579
595
  suggestedTimes: ({
580
596
  kind: "daily";
581
597
  time: string;
@@ -649,11 +665,37 @@ declare const _default: import("convex/server").SchemaDefinition<{
649
665
  updatedBy: import("convex/values").VString<string, "required">;
650
666
  createdAt: import("convex/values").VFloat64<number, "required">;
651
667
  updatedAt: import("convex/values").VFloat64<number, "required">;
652
- }, "required", "enabled" | "companyId" | "periodicity" | "text" | "title" | "suggestedTimes" | "templateKey" | "updatedAt" | "createdAt" | "createdBy" | "updatedBy">, {
668
+ }, "required", "enabled" | "text" | "title" | "companyId" | "periodicity" | "suggestedTimes" | "templateKey" | "updatedAt" | "createdAt" | "createdBy" | "updatedBy">, {
653
669
  by_companyId: ["companyId", "_creationTime"];
654
670
  by_companyId_and_templateKey: ["companyId", "templateKey", "_creationTime"];
655
671
  by_companyId_and_enabled: ["companyId", "enabled", "_creationTime"];
656
672
  }, {}, {}>;
673
+ messageTemplates: import("convex/server").TableDefinition<import("convex/values").VObject<{
674
+ enabled: boolean;
675
+ tags: string[];
676
+ text: string;
677
+ title: string;
678
+ templateKey: string;
679
+ updatedAt: number;
680
+ createdAt: number;
681
+ createdBy: string;
682
+ updatedBy: string;
683
+ usageCount: number;
684
+ }, {
685
+ templateKey: import("convex/values").VString<string, "required">;
686
+ title: import("convex/values").VString<string, "required">;
687
+ text: import("convex/values").VString<string, "required">;
688
+ tags: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
689
+ usageCount: import("convex/values").VFloat64<number, "required">;
690
+ enabled: import("convex/values").VBoolean<boolean, "required">;
691
+ createdBy: import("convex/values").VString<string, "required">;
692
+ updatedBy: import("convex/values").VString<string, "required">;
693
+ createdAt: import("convex/values").VFloat64<number, "required">;
694
+ updatedAt: import("convex/values").VFloat64<number, "required">;
695
+ }, "required", "enabled" | "tags" | "text" | "title" | "templateKey" | "updatedAt" | "createdAt" | "createdBy" | "updatedBy" | "usageCount">, {
696
+ by_templateKey: ["templateKey", "_creationTime"];
697
+ by_enabled: ["enabled", "_creationTime"];
698
+ }, {}, {}>;
657
699
  messagePushJobs: import("convex/server").TableDefinition<import("convex/values").VObject<{
658
700
  agentKey?: string | undefined;
659
701
  sourceTemplateId?: import("convex/values").GenericId<"messagePushTemplates"> | undefined;
@@ -662,6 +704,8 @@ declare const _default: import("convex/server").SchemaDefinition<{
662
704
  lastRunKey?: string | undefined;
663
705
  consumerUserId: string;
664
706
  enabled: boolean;
707
+ text: string;
708
+ title: string;
665
709
  companyId: string;
666
710
  periodicity: "manual" | "daily" | "weekly" | "monthly";
667
711
  schedule: {
@@ -678,9 +722,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
678
722
  time: string;
679
723
  dayOfMonth: number | "last";
680
724
  };
681
- text: string;
682
725
  timezone: string;
683
- title: string;
684
726
  updatedAt: number;
685
727
  createdAt: number;
686
728
  }, {
@@ -738,7 +780,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
738
780
  lastRunKey: import("convex/values").VString<string | undefined, "optional">;
739
781
  createdAt: import("convex/values").VFloat64<number, "required">;
740
782
  updatedAt: import("convex/values").VFloat64<number, "required">;
741
- }, "required", "agentKey" | "consumerUserId" | "enabled" | "companyId" | "periodicity" | "schedule" | "text" | "timezone" | "title" | "updatedAt" | "createdAt" | "sourceTemplateId" | "nextRunAt" | "lastRunAt" | "lastRunKey" | "schedule.kind" | "schedule.time" | "schedule.weekday" | "schedule.dayOfMonth">, {
783
+ }, "required", "agentKey" | "consumerUserId" | "enabled" | "text" | "title" | "companyId" | "periodicity" | "schedule" | "timezone" | "updatedAt" | "createdAt" | "sourceTemplateId" | "nextRunAt" | "lastRunAt" | "lastRunKey" | "schedule.kind" | "schedule.time" | "schedule.weekday" | "schedule.dayOfMonth">, {
742
784
  by_enabled_and_nextRunAt: ["enabled", "nextRunAt", "_creationTime"];
743
785
  by_consumerUserId: ["consumerUserId", "_creationTime"];
744
786
  by_consumerUserId_and_enabled: ["consumerUserId", "enabled", "_creationTime"];
@@ -749,10 +791,10 @@ declare const _default: import("convex/server").SchemaDefinition<{
749
791
  messagePushDispatches: import("convex/server").TableDefinition<import("convex/values").VObject<{
750
792
  error?: string | undefined;
751
793
  enqueuedMessageId?: import("convex/values").GenericId<"messageQueue"> | undefined;
794
+ status: "failed" | "enqueued" | "skipped";
752
795
  consumerUserId: string;
753
796
  jobId: import("convex/values").GenericId<"messagePushJobs">;
754
797
  scheduledFor: number;
755
- status: "failed" | "enqueued" | "skipped";
756
798
  createdAt: number;
757
799
  runKey: string;
758
800
  }, {
@@ -764,17 +806,17 @@ declare const _default: import("convex/server").SchemaDefinition<{
764
806
  status: import("convex/values").VUnion<"failed" | "enqueued" | "skipped", [import("convex/values").VLiteral<"enqueued", "required">, import("convex/values").VLiteral<"skipped", "required">, import("convex/values").VLiteral<"failed", "required">], "required", never>;
765
807
  error: import("convex/values").VString<string | undefined, "optional">;
766
808
  createdAt: import("convex/values").VFloat64<number, "required">;
767
- }, "required", "consumerUserId" | "jobId" | "scheduledFor" | "error" | "status" | "createdAt" | "runKey" | "enqueuedMessageId">, {
809
+ }, "required", "error" | "status" | "consumerUserId" | "jobId" | "scheduledFor" | "createdAt" | "runKey" | "enqueuedMessageId">, {
768
810
  by_jobId_and_runKey: ["jobId", "runKey", "_creationTime"];
769
811
  by_consumerUserId_and_createdAt: ["consumerUserId", "createdAt", "_creationTime"];
770
812
  }, {}, {}>;
771
813
  messagePushBroadcasts: import("convex/server").TableDefinition<import("convex/values").VObject<{
772
814
  completedAt?: number | undefined;
773
- companyId: string;
815
+ status: "failed" | "running" | "done";
774
816
  text: string;
775
817
  title: string;
818
+ companyId: string;
776
819
  requestedBy: string;
777
- status: "failed" | "running" | "done";
778
820
  target: "all_active_agents";
779
821
  requestedAt: number;
780
822
  totalTargets: number;
@@ -792,16 +834,16 @@ declare const _default: import("convex/server").SchemaDefinition<{
792
834
  enqueuedCount: import("convex/values").VFloat64<number, "required">;
793
835
  failedCount: import("convex/values").VFloat64<number, "required">;
794
836
  completedAt: import("convex/values").VFloat64<number | undefined, "optional">;
795
- }, "required", "companyId" | "text" | "title" | "requestedBy" | "status" | "completedAt" | "target" | "requestedAt" | "totalTargets" | "enqueuedCount" | "failedCount">, {
837
+ }, "required", "status" | "text" | "title" | "companyId" | "requestedBy" | "completedAt" | "target" | "requestedAt" | "totalTargets" | "enqueuedCount" | "failedCount">, {
796
838
  by_companyId_and_requestedAt: ["companyId", "requestedAt", "_creationTime"];
797
839
  by_status: ["status", "_creationTime"];
798
840
  }, {}, {}>;
799
841
  messagePushBroadcastDispatches: import("convex/server").TableDefinition<import("convex/values").VObject<{
800
842
  error?: string | undefined;
801
843
  enqueuedMessageId?: import("convex/values").GenericId<"messageQueue"> | undefined;
844
+ status: "failed" | "enqueued" | "skipped";
802
845
  agentKey: string;
803
846
  consumerUserId: string;
804
- status: "failed" | "enqueued" | "skipped";
805
847
  createdAt: number;
806
848
  runKey: string;
807
849
  broadcastId: import("convex/values").GenericId<"messagePushBroadcasts">;
@@ -814,7 +856,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
814
856
  status: import("convex/values").VUnion<"failed" | "enqueued" | "skipped", [import("convex/values").VLiteral<"enqueued", "required">, import("convex/values").VLiteral<"skipped", "required">, import("convex/values").VLiteral<"failed", "required">], "required", never>;
815
857
  error: import("convex/values").VString<string | undefined, "optional">;
816
858
  createdAt: import("convex/values").VFloat64<number, "required">;
817
- }, "required", "agentKey" | "consumerUserId" | "error" | "status" | "createdAt" | "runKey" | "enqueuedMessageId" | "broadcastId">, {
859
+ }, "required", "error" | "status" | "agentKey" | "consumerUserId" | "createdAt" | "runKey" | "enqueuedMessageId" | "broadcastId">, {
818
860
  by_broadcastId_and_consumerUserId: ["broadcastId", "consumerUserId", "_creationTime"];
819
861
  by_broadcastId_and_createdAt: ["broadcastId", "createdAt", "_creationTime"];
820
862
  }, {}, {}>;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAkfG"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/component/schema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,wBAugBG"}
@@ -246,7 +246,11 @@ export default defineSchema({
246
246
  version: v.string(),
247
247
  moduleFormat: v.union(v.literal("esm"), v.literal("cjs")),
248
248
  entryPoint: v.string(),
249
- sourceJs: v.string(),
249
+ files: v.array(v.object({
250
+ path: v.string(),
251
+ content: v.string(),
252
+ sha256: v.string(),
253
+ })),
250
254
  sha256: v.string(),
251
255
  createdBy: v.string(),
252
256
  createdAt: v.number(),
@@ -313,6 +317,20 @@ export default defineSchema({
313
317
  .index("by_companyId", ["companyId"])
314
318
  .index("by_companyId_and_templateKey", ["companyId", "templateKey"])
315
319
  .index("by_companyId_and_enabled", ["companyId", "enabled"]),
320
+ messageTemplates: defineTable({
321
+ templateKey: v.string(),
322
+ title: v.string(),
323
+ text: v.string(),
324
+ tags: v.array(v.string()),
325
+ usageCount: v.number(),
326
+ enabled: v.boolean(),
327
+ createdBy: v.string(),
328
+ updatedBy: v.string(),
329
+ createdAt: v.number(),
330
+ updatedAt: v.number(),
331
+ })
332
+ .index("by_templateKey", ["templateKey"])
333
+ .index("by_enabled", ["enabled"]),
316
334
  messagePushJobs: defineTable({
317
335
  companyId: v.string(),
318
336
  consumerUserId: v.string(),