@axiom-lattice/pg-stores 1.0.36 → 1.0.38

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @axiom-lattice/pg-stores@1.0.36 build /home/runner/work/agentic/agentic/packages/pg-stores
2
+ > @axiom-lattice/pg-stores@1.0.38 build /home/runner/work/agentic/agentic/packages/pg-stores
3
3
  > tsup src/index.ts --format cjs,esm --dts --sourcemap
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -8,13 +8,13 @@
8
8
  CLI Target: es2020
9
9
  CJS Build start
10
10
  ESM Build start
11
- CJS dist/index.js 133.26 KB
12
- CJS dist/index.js.map 247.65 KB
13
- CJS ⚡️ Build success in 375ms
14
- ESM dist/index.mjs 129.31 KB
15
- ESM dist/index.mjs.map 247.58 KB
16
- ESM ⚡️ Build success in 394ms
11
+ CJS dist/index.js 149.14 KB
12
+ CJS dist/index.js.map 276.37 KB
13
+ CJS ⚡️ Build success in 380ms
14
+ ESM dist/index.mjs 144.79 KB
15
+ ESM dist/index.mjs.map 276.31 KB
16
+ ESM ⚡️ Build success in 387ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 11567ms
19
- DTS dist/index.d.ts 34.53 KB
20
- DTS dist/index.d.mts 34.53 KB
18
+ DTS ⚡️ Build success in 10122ms
19
+ DTS dist/index.d.ts 38.33 KB
20
+ DTS dist/index.d.mts 38.33 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @axiom-lattice/pg-stores
2
2
 
3
+ ## 1.0.38
4
+
5
+ ### Patch Changes
6
+
7
+ - 5444ad4: update
8
+ - Updated dependencies [5444ad4]
9
+ - @axiom-lattice/core@2.1.48
10
+ - @axiom-lattice/protocols@2.1.26
11
+
12
+ ## 1.0.37
13
+
14
+ ### Patch Changes
15
+
16
+ - 1515f02: publish claw
17
+ - Updated dependencies [1515f02]
18
+ - @axiom-lattice/core@2.1.47
19
+ - @axiom-lattice/protocols@2.1.25
20
+
3
21
  ## 1.0.36
4
22
 
5
23
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { PoolConfig, PoolClient, Pool } from 'pg';
2
2
  export { Pool, PoolConfig } from 'pg';
3
- import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, SkillStore, Skill, CreateSkillRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest } from '@axiom-lattice/protocols';
4
- export { Assistant, AssistantStore, CreateAssistantRequest, CreateDatabaseConfigRequest, CreateMcpServerConfigRequest, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, McpServerConfigEntry, McpServerConfigStore, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
3
+ import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, SkillStore, Skill, CreateSkillRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallationStore, ChannelInstallation, CreateChannelInstallationRequest, UpdateChannelInstallationRequest } from '@axiom-lattice/protocols';
4
+ export { Assistant, AssistantStore, ChannelInstallation, ChannelInstallationStore, CreateAssistantRequest, CreateChannelInstallationRequest, CreateDatabaseConfigRequest, CreateMcpServerConfigRequest, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, LarkChannelInstallationConfig, McpServerConfigEntry, McpServerConfigStore, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateChannelInstallationRequest, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
5
5
  import { IMessageQueueStore, AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
6
6
  export { AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
7
7
 
@@ -1086,6 +1086,10 @@ declare const createTenantsTable: Migration;
1086
1086
  */
1087
1087
  declare const createThreadMessageQueueTable: Migration;
1088
1088
 
1089
+ declare const createChannelIdentityMappingTables: Migration;
1090
+
1091
+ declare const createChannelInstallationsTable: Migration;
1092
+
1089
1093
  /**
1090
1094
  * Thread Message Queue Store
1091
1095
  *
@@ -1159,4 +1163,100 @@ declare class ThreadMessageQueueStore implements IMessageQueueStore {
1159
1163
  }
1160
1164
  declare const getThreadMessageQueueStore: () => ThreadMessageQueueStore;
1161
1165
 
1162
- export { type Migration, MigrationManager, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addScheduleTenantId, addSkillTenantId, addThreadTenantId, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createAssistantsTable, createDatabaseConfigsTable, createMcpServerConfigsTable, createMetricsConfigsTable, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkspacesTable, getThreadMessageQueueStore };
1166
+ interface ChannelIdentityMappingStoreOptions {
1167
+ poolConfig: string | PoolConfig;
1168
+ autoMigrate?: boolean;
1169
+ }
1170
+ interface CreateChannelIdentityMappingInput {
1171
+ channel: string;
1172
+ channelAppId: string;
1173
+ tenantId: string;
1174
+ assistantId: string;
1175
+ mappingMode: "user" | "group" | "hybrid";
1176
+ externalSubjectType: "user" | "chat";
1177
+ externalSubjectKey: string;
1178
+ larkOpenId?: string;
1179
+ larkChatId: string;
1180
+ larkMessageId?: string;
1181
+ threadId: string;
1182
+ }
1183
+ interface ChannelIdentityMapping {
1184
+ id: string;
1185
+ channel: string;
1186
+ channelAppId: string;
1187
+ tenantId: string;
1188
+ assistantId: string;
1189
+ mappingMode: "user" | "group" | "hybrid";
1190
+ externalSubjectType: "user" | "chat";
1191
+ externalSubjectKey: string;
1192
+ larkOpenId?: string;
1193
+ larkChatId: string;
1194
+ larkMessageId?: string;
1195
+ threadId: string;
1196
+ createdAt: Date;
1197
+ updatedAt: Date;
1198
+ lastActivityAt: Date;
1199
+ }
1200
+ declare class ChannelIdentityMappingStore {
1201
+ private pool;
1202
+ private migrationManager;
1203
+ private initialized;
1204
+ private initPromise;
1205
+ constructor(options: ChannelIdentityMappingStoreOptions);
1206
+ initialize(): Promise<void>;
1207
+ createMapping(input: CreateChannelIdentityMappingInput): Promise<ChannelIdentityMapping>;
1208
+ getMappingBySubject(input: {
1209
+ channel: string;
1210
+ channelAppId: string;
1211
+ tenantId: string;
1212
+ assistantId: string;
1213
+ externalSubjectKey: string;
1214
+ }): Promise<ChannelIdentityMapping | null>;
1215
+ claimInboundReceipt(input: {
1216
+ channel: string;
1217
+ channelAppId: string;
1218
+ externalMessageId: string;
1219
+ tenantId: string;
1220
+ }): Promise<{
1221
+ accepted: boolean;
1222
+ status: "processing" | "completed";
1223
+ }>;
1224
+ markInboundReceiptCompleted(input: {
1225
+ channel: string;
1226
+ channelAppId: string;
1227
+ externalMessageId: string;
1228
+ tenantId: string;
1229
+ threadId: string;
1230
+ }): Promise<void>;
1231
+ markInboundReceiptFailed(input: {
1232
+ channel: string;
1233
+ channelAppId: string;
1234
+ externalMessageId: string;
1235
+ tenantId: string;
1236
+ }): Promise<void>;
1237
+ private ensureInitialized;
1238
+ }
1239
+
1240
+ interface PostgreSQLChannelInstallationStoreOptions {
1241
+ poolConfig: string | PoolConfig;
1242
+ autoMigrate?: boolean;
1243
+ }
1244
+ declare class PostgreSQLChannelInstallationStore implements ChannelInstallationStore {
1245
+ private pool;
1246
+ private migrationManager;
1247
+ private initialized;
1248
+ private initPromise;
1249
+ constructor(options: PostgreSQLChannelInstallationStoreOptions);
1250
+ initialize(): Promise<void>;
1251
+ getInstallationById(installationId: string): Promise<ChannelInstallation | null>;
1252
+ getInstallationsByTenant(tenantId: string, channel?: "lark"): Promise<ChannelInstallation[]>;
1253
+ createInstallation(tenantId: string, installationId: string, data: CreateChannelInstallationRequest): Promise<ChannelInstallation>;
1254
+ updateInstallation(tenantId: string, installationId: string, updates: UpdateChannelInstallationRequest): Promise<ChannelInstallation | null>;
1255
+ deleteInstallation(tenantId: string, installationId: string): Promise<boolean>;
1256
+ private ensureInitialized;
1257
+ private mapRowToInstallation;
1258
+ private encryptSecrets;
1259
+ private decryptSecrets;
1260
+ }
1261
+
1262
+ export { type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, type Migration, MigrationManager, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addScheduleTenantId, addSkillTenantId, addThreadTenantId, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createAssistantsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createDatabaseConfigsTable, createMcpServerConfigsTable, createMetricsConfigsTable, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkspacesTable, getThreadMessageQueueStore };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { PoolConfig, PoolClient, Pool } from 'pg';
2
2
  export { Pool, PoolConfig } from 'pg';
3
- import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, SkillStore, Skill, CreateSkillRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest } from '@axiom-lattice/protocols';
4
- export { Assistant, AssistantStore, CreateAssistantRequest, CreateDatabaseConfigRequest, CreateMcpServerConfigRequest, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, McpServerConfigEntry, McpServerConfigStore, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
3
+ import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, SkillStore, Skill, CreateSkillRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, Project, CreateProjectRequest, UpdateProjectRequest, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, ChannelInstallationStore, ChannelInstallation, CreateChannelInstallationRequest, UpdateChannelInstallationRequest } from '@axiom-lattice/protocols';
4
+ export { Assistant, AssistantStore, ChannelInstallation, ChannelInstallationStore, CreateAssistantRequest, CreateChannelInstallationRequest, CreateDatabaseConfigRequest, CreateMcpServerConfigRequest, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, LarkChannelInstallationConfig, McpServerConfigEntry, McpServerConfigStore, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateChannelInstallationRequest, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
5
5
  import { IMessageQueueStore, AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
6
6
  export { AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
7
7
 
@@ -1086,6 +1086,10 @@ declare const createTenantsTable: Migration;
1086
1086
  */
1087
1087
  declare const createThreadMessageQueueTable: Migration;
1088
1088
 
1089
+ declare const createChannelIdentityMappingTables: Migration;
1090
+
1091
+ declare const createChannelInstallationsTable: Migration;
1092
+
1089
1093
  /**
1090
1094
  * Thread Message Queue Store
1091
1095
  *
@@ -1159,4 +1163,100 @@ declare class ThreadMessageQueueStore implements IMessageQueueStore {
1159
1163
  }
1160
1164
  declare const getThreadMessageQueueStore: () => ThreadMessageQueueStore;
1161
1165
 
1162
- export { type Migration, MigrationManager, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addScheduleTenantId, addSkillTenantId, addThreadTenantId, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createAssistantsTable, createDatabaseConfigsTable, createMcpServerConfigsTable, createMetricsConfigsTable, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkspacesTable, getThreadMessageQueueStore };
1166
+ interface ChannelIdentityMappingStoreOptions {
1167
+ poolConfig: string | PoolConfig;
1168
+ autoMigrate?: boolean;
1169
+ }
1170
+ interface CreateChannelIdentityMappingInput {
1171
+ channel: string;
1172
+ channelAppId: string;
1173
+ tenantId: string;
1174
+ assistantId: string;
1175
+ mappingMode: "user" | "group" | "hybrid";
1176
+ externalSubjectType: "user" | "chat";
1177
+ externalSubjectKey: string;
1178
+ larkOpenId?: string;
1179
+ larkChatId: string;
1180
+ larkMessageId?: string;
1181
+ threadId: string;
1182
+ }
1183
+ interface ChannelIdentityMapping {
1184
+ id: string;
1185
+ channel: string;
1186
+ channelAppId: string;
1187
+ tenantId: string;
1188
+ assistantId: string;
1189
+ mappingMode: "user" | "group" | "hybrid";
1190
+ externalSubjectType: "user" | "chat";
1191
+ externalSubjectKey: string;
1192
+ larkOpenId?: string;
1193
+ larkChatId: string;
1194
+ larkMessageId?: string;
1195
+ threadId: string;
1196
+ createdAt: Date;
1197
+ updatedAt: Date;
1198
+ lastActivityAt: Date;
1199
+ }
1200
+ declare class ChannelIdentityMappingStore {
1201
+ private pool;
1202
+ private migrationManager;
1203
+ private initialized;
1204
+ private initPromise;
1205
+ constructor(options: ChannelIdentityMappingStoreOptions);
1206
+ initialize(): Promise<void>;
1207
+ createMapping(input: CreateChannelIdentityMappingInput): Promise<ChannelIdentityMapping>;
1208
+ getMappingBySubject(input: {
1209
+ channel: string;
1210
+ channelAppId: string;
1211
+ tenantId: string;
1212
+ assistantId: string;
1213
+ externalSubjectKey: string;
1214
+ }): Promise<ChannelIdentityMapping | null>;
1215
+ claimInboundReceipt(input: {
1216
+ channel: string;
1217
+ channelAppId: string;
1218
+ externalMessageId: string;
1219
+ tenantId: string;
1220
+ }): Promise<{
1221
+ accepted: boolean;
1222
+ status: "processing" | "completed";
1223
+ }>;
1224
+ markInboundReceiptCompleted(input: {
1225
+ channel: string;
1226
+ channelAppId: string;
1227
+ externalMessageId: string;
1228
+ tenantId: string;
1229
+ threadId: string;
1230
+ }): Promise<void>;
1231
+ markInboundReceiptFailed(input: {
1232
+ channel: string;
1233
+ channelAppId: string;
1234
+ externalMessageId: string;
1235
+ tenantId: string;
1236
+ }): Promise<void>;
1237
+ private ensureInitialized;
1238
+ }
1239
+
1240
+ interface PostgreSQLChannelInstallationStoreOptions {
1241
+ poolConfig: string | PoolConfig;
1242
+ autoMigrate?: boolean;
1243
+ }
1244
+ declare class PostgreSQLChannelInstallationStore implements ChannelInstallationStore {
1245
+ private pool;
1246
+ private migrationManager;
1247
+ private initialized;
1248
+ private initPromise;
1249
+ constructor(options: PostgreSQLChannelInstallationStoreOptions);
1250
+ initialize(): Promise<void>;
1251
+ getInstallationById(installationId: string): Promise<ChannelInstallation | null>;
1252
+ getInstallationsByTenant(tenantId: string, channel?: "lark"): Promise<ChannelInstallation[]>;
1253
+ createInstallation(tenantId: string, installationId: string, data: CreateChannelInstallationRequest): Promise<ChannelInstallation>;
1254
+ updateInstallation(tenantId: string, installationId: string, updates: UpdateChannelInstallationRequest): Promise<ChannelInstallation | null>;
1255
+ deleteInstallation(tenantId: string, installationId: string): Promise<boolean>;
1256
+ private ensureInitialized;
1257
+ private mapRowToInstallation;
1258
+ private encryptSecrets;
1259
+ private decryptSecrets;
1260
+ }
1261
+
1262
+ export { type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, type Migration, MigrationManager, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, ThreadMessageQueueStore, addAssistantTenantId, addScheduleTenantId, addSkillTenantId, addThreadTenantId, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createAssistantsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createDatabaseConfigsTable, createMcpServerConfigsTable, createMetricsConfigsTable, createProjectsTable, createScheduledTasksTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkspacesTable, getThreadMessageQueueStore };