@axiom-lattice/pg-stores 3.1.20 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +10 -10
- package/CHANGELOG.md +71 -0
- package/dist/index.d.mts +125 -2
- package/dist/index.d.ts +125 -2
- package/dist/index.js +630 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +629 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/scripts/check-migration-versions.mjs +6 -1
- package/src/createPgStoreConfig.ts +12 -0
- package/src/index.ts +2 -0
- package/src/migrations/model_provider_migrations.ts +157 -0
- package/src/stores/PostgreSQLModelProviderStore.ts +731 -0
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @axiom-lattice/pg-stores@3.
|
|
2
|
+
> @axiom-lattice/pg-stores@3.2.0 build /home/runner/work/agentic/agentic/packages/pg-stores
|
|
3
3
|
> tsup src/index.ts --format cjs,esm --dts --sourcemap
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
[34mCLI[39m Target: es2020
|
|
9
9
|
[34mCJS[39m Build start
|
|
10
10
|
[34mESM[39m Build start
|
|
11
|
-
[
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
16
|
-
[
|
|
11
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m412.72 KB[39m
|
|
12
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m767.62 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 507ms
|
|
14
|
+
[32mCJS[39m [1mdist/index.js [22m[32m421.08 KB[39m
|
|
15
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m767.96 KB[39m
|
|
16
|
+
[32mCJS[39m ⚡️ Build success in 529ms
|
|
17
17
|
[34mDTS[39m Build start
|
|
18
|
-
[32mDTS[39m ⚡️ Build success in
|
|
19
|
-
[32mDTS[39m [1mdist/index.d.ts [22m[
|
|
20
|
-
[32mDTS[39m [1mdist/index.d.mts [22m[
|
|
18
|
+
[32mDTS[39m ⚡️ Build success in 8689ms
|
|
19
|
+
[32mDTS[39m [1mdist/index.d.ts [22m[32m86.96 KB[39m
|
|
20
|
+
[32mDTS[39m [1mdist/index.d.mts [22m[32m86.96 KB[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,76 @@
|
|
|
1
1
|
# @axiom-lattice/pg-stores
|
|
2
2
|
|
|
3
|
+
## 3.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6e07f01: Add a tenant-scoped model provider catalog.
|
|
8
|
+
|
|
9
|
+
Model lists were a process-wide in-memory registry: every model lived under
|
|
10
|
+
`models:default:{key}`, nothing was persisted, and `GET /api/models` returned
|
|
11
|
+
each model's `apiKey` in plaintext to any caller.
|
|
12
|
+
|
|
13
|
+
A tenant owner/admin can now register an upstream provider (base URL + API key),
|
|
14
|
+
run discovery against `{baseURL}/v1/models`, and see a tenant-isolated model
|
|
15
|
+
catalog. See ADR-138 for the full decision record.
|
|
16
|
+
|
|
17
|
+
Key points:
|
|
18
|
+
|
|
19
|
+
- **`modelKey` is `${providerId}/${modelId}`.** The same upstream model id
|
|
20
|
+
offered by two providers is two independent models — the real case being a
|
|
21
|
+
tenant running OpenAI direct and Azure OpenAI side by side. The provider id is
|
|
22
|
+
immutable, so renaming a provider never invalidates a key already stored in
|
|
23
|
+
agent or eval configuration.
|
|
24
|
+
- **Credentials never leave the server.** The API key is stored AES-256-GCM
|
|
25
|
+
encrypted and responses carry only `hasApiKey` / `apiKeyHint`. An omitted or
|
|
26
|
+
empty `apiKey` on update keeps the stored value.
|
|
27
|
+
- **Tenant scope comes from the authenticated session only**, never from the
|
|
28
|
+
request body, and writes require a tenant owner/admin role. A provider
|
|
29
|
+
belonging to another tenant is indistinguishable from a missing one (404).
|
|
30
|
+
- **Upstream URLs are validated** before any outbound request: http(s) only, no
|
|
31
|
+
embedded credentials, and private/loopback/link-local/CGNAT addresses are
|
|
32
|
+
rejected. Discovery does not follow redirects, times out after 8s, and never
|
|
33
|
+
echoes the upstream body in an error.
|
|
34
|
+
- **Discovery is explicit.** `POST /api/model-providers/:id/discover` refreshes a
|
|
35
|
+
persisted snapshot; the catalog endpoints never make outbound calls, so an
|
|
36
|
+
upstream outage leaves the list intact.
|
|
37
|
+
|
|
38
|
+
Phase 1 registers discovered models for execution only for the `default` tenant,
|
|
39
|
+
whose registry keys are byte-identical to the previous key-only API. Other
|
|
40
|
+
tenants get the catalog but their models report `executable: false`. Registering
|
|
41
|
+
them would let one tenant's model silently overwrite another's, sending the
|
|
42
|
+
second tenant's agents to the first tenant's upstream with the first tenant's
|
|
43
|
+
credentials.
|
|
44
|
+
|
|
45
|
+
**Contract changes on the legacy endpoints** (breaking for any consumer of
|
|
46
|
+
`GET /api/models`):
|
|
47
|
+
|
|
48
|
+
- `GET /api/models` no longer returns `apiKey`; it returns `hasApiKey` instead,
|
|
49
|
+
and is now scoped to the `default` tenant rather than enumerating all of them.
|
|
50
|
+
- `PUT /api/models` treats an empty `apiKey` as "keep the existing key". Without
|
|
51
|
+
this, the first save after the change above would clear every stored key.
|
|
52
|
+
|
|
53
|
+
The console UI ships the matching change, so a react-sdk built from this version
|
|
54
|
+
must be deployed together with this gateway.
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- Updated dependencies [6e07f01]
|
|
59
|
+
- @axiom-lattice/protocols@4.6.0
|
|
60
|
+
- @axiom-lattice/core@6.1.0
|
|
61
|
+
|
|
62
|
+
## 3.1.21
|
|
63
|
+
|
|
64
|
+
### Patch Changes
|
|
65
|
+
|
|
66
|
+
- Updated dependencies [55a8d3d]
|
|
67
|
+
- Updated dependencies [132c78e]
|
|
68
|
+
- Updated dependencies [132c78e]
|
|
69
|
+
- Updated dependencies [132c78e]
|
|
70
|
+
- Updated dependencies [5f1d575]
|
|
71
|
+
- @axiom-lattice/core@6.0.0
|
|
72
|
+
- @axiom-lattice/protocols@4.5.0
|
|
73
|
+
|
|
3
74
|
## 3.1.20
|
|
4
75
|
|
|
5
76
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Pool, PoolConfig, PoolClient } from 'pg';
|
|
2
2
|
export { Pool, PoolConfig } from 'pg';
|
|
3
|
-
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, ProjectFilter, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, QueryWorkflowRunsOptions, QueryWorkflowRunsResult, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, BindingMutablePatch, BindingListParams, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationInput, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, UpdateA2AApiKeyInput, A2AApiKeyEntry, OpenAuditStore, OpenAuditQuery, OpenAuditRecord, OpenAuditAppendInput, AgentWebAppStore, AgentWebApp, CreateAgentWebAppInput, AgentWebAppStorePatch, AgentWebAppUpdateOptions, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, TaskDependentListQuery, UpdateTaskRequest, TaskMutationSnapshot, TaskWorkItemStore, CreateWorkItemRequest, TaskWorkItem, CreateWorkItemIfAbsentRequest, TaskWorkItemListFilter, ProjectLifecycleEventQuery, MenuRegistry, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, SharedResourceStore, ShareRecord, CollectionStore, Collection, CreateCollectionRequest, UpdateCollectionRequest, VectorStoreProvider, VectorStoreCreateParams, CapabilityBundleStore, CapabilityBundle, InternalCreateCapabilityBundleInput, InternalUpdateCapabilityBundleInput, CapabilityBundleDeleteResult, ProjectRoomStore, ProjectRoom, ProjectMembershipStore, ProjectMembership, ProjectHumanRole, ProjectMembershipMutationResult, ProjectBotMembershipStore, ProjectBotMembership, ProjectRoomMessageStore, ProjectRoomMessage, ProjectRoomReadStateStore, ProjectRoomReadState, UserPushSubscriptionStore, UserPushSubscription, SkillStore, Skill, CreateSkillRequest } from '@axiom-lattice/protocols';
|
|
3
|
+
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, ProjectFilter, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, QueryWorkflowRunsOptions, QueryWorkflowRunsResult, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, BindingMutablePatch, BindingListParams, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationInput, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, UpdateA2AApiKeyInput, A2AApiKeyEntry, OpenAuditStore, OpenAuditQuery, OpenAuditRecord, OpenAuditAppendInput, AgentWebAppStore, AgentWebApp, CreateAgentWebAppInput, AgentWebAppStorePatch, AgentWebAppUpdateOptions, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, TaskDependentListQuery, UpdateTaskRequest, TaskMutationSnapshot, TaskWorkItemStore, CreateWorkItemRequest, TaskWorkItem, CreateWorkItemIfAbsentRequest, TaskWorkItemListFilter, ProjectLifecycleEventQuery, MenuRegistry, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, SharedResourceStore, ShareRecord, CollectionStore, Collection, CreateCollectionRequest, UpdateCollectionRequest, VectorStoreProvider, VectorStoreCreateParams, CapabilityBundleStore, CapabilityBundle, InternalCreateCapabilityBundleInput, InternalUpdateCapabilityBundleInput, CapabilityBundleDeleteResult, ProjectRoomStore, ProjectRoom, ProjectMembershipStore, ProjectMembership, ProjectHumanRole, ProjectMembershipMutationResult, ProjectBotMembershipStore, ProjectBotMembership, ProjectRoomMessageStore, ProjectRoomMessage, ProjectRoomReadStateStore, ProjectRoomReadState, UserPushSubscriptionStore, UserPushSubscription, ModelProviderStore, ModelProviderEntry, CreateModelProviderRequest, UpdateModelProviderRequest, ModelProviderStatus, ModelProviderModelEntry, ProviderModelInput, SkillStore, Skill, CreateSkillRequest } from '@axiom-lattice/protocols';
|
|
4
4
|
export { AgentWebApp, AgentWebAppAppearance, AgentWebAppFeatures, AgentWebAppScope, AgentWebAppStatus, AgentWebAppStore, Assistant, AssistantStore, Binding, BindingRegistry, CapabilityBundle, CapabilityBundleStore, ChannelInstallation, ChannelInstallationStore, ConnectionEntry, ConnectionStore, CreateAgentWebAppInput, CreateAssistantRequest, CreateBindingInput, CreateCapabilityBundleInput, CreateChannelInstallationInput, CreateChannelInstallationRequest, CreateDatabaseConfigRequest, CreateEvalCaseRequest, CreateEvalProjectRequest, CreateEvalRunRequest, CreateEvalSuiteRequest, CreateMcpServerConfigRequest, CreateMenuItemInput, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateRunStepRequest, CreateShareRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkflowRunRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, EvalCase, EvalProject, EvalProjectReport, EvalRun, EvalRunResult, EvalStore, EvalSuite, LarkChannelInstallationConfig, McpServerConfigEntry, McpServerConfigStore, MenuItem, MenuRegistry, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, ResourceAddress, RunStep, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ShareRecord, ShareResult, ShareVisibility, SharedResourceStore, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateAgentWebAppInput, UpdateCapabilityBundleInput, UpdateChannelInstallationRequest, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateRunStepRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkflowRunRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, WorkflowRun, WorkflowTrackingStore, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
|
|
5
5
|
import { IMessageQueueStore, AddMessageParams, PendingMessage, QueueScope, ThreadInfo } from '@axiom-lattice/core';
|
|
6
6
|
export { AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
|
|
@@ -1689,6 +1689,128 @@ declare class PostgreSQLUserPushSubscriptionStore implements UserPushSubscriptio
|
|
|
1689
1689
|
delete(tenantId: string, userId: string, endpoint: string): Promise<boolean>;
|
|
1690
1690
|
}
|
|
1691
1691
|
|
|
1692
|
+
/**
|
|
1693
|
+
* PostgreSQL implementation of ModelProviderStore
|
|
1694
|
+
*/
|
|
1695
|
+
|
|
1696
|
+
/**
|
|
1697
|
+
* PostgreSQL ModelProviderStore options
|
|
1698
|
+
*/
|
|
1699
|
+
interface PostgreSQLModelProviderStoreOptions {
|
|
1700
|
+
/**
|
|
1701
|
+
* External pool instance. When provided, poolConfig is not required and the
|
|
1702
|
+
* caller is responsible for pool lifecycle and migrations.
|
|
1703
|
+
*/
|
|
1704
|
+
pool?: Pool;
|
|
1705
|
+
/**
|
|
1706
|
+
* PostgreSQL connection pool configuration
|
|
1707
|
+
* Can be a connection string or PoolConfig object
|
|
1708
|
+
*/
|
|
1709
|
+
poolConfig?: string | PoolConfig;
|
|
1710
|
+
/**
|
|
1711
|
+
* Whether to run migrations automatically on initialization
|
|
1712
|
+
* @default true
|
|
1713
|
+
*/
|
|
1714
|
+
autoMigrate?: boolean;
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* PostgreSQL implementation of ModelProviderStore
|
|
1718
|
+
*
|
|
1719
|
+
* Features:
|
|
1720
|
+
* - Multi-tenant isolation via tenant_id
|
|
1721
|
+
* - Automatic API key encryption/decryption
|
|
1722
|
+
* - Unique constraint on (tenant_id, name) and (tenant_id, model_id)
|
|
1723
|
+
*/
|
|
1724
|
+
declare class PostgreSQLModelProviderStore implements ModelProviderStore {
|
|
1725
|
+
private pool;
|
|
1726
|
+
private migrationManager;
|
|
1727
|
+
private initialized;
|
|
1728
|
+
private ownsPool;
|
|
1729
|
+
private initPromise;
|
|
1730
|
+
constructor(options: PostgreSQLModelProviderStoreOptions);
|
|
1731
|
+
/**
|
|
1732
|
+
* Initialize the store and run migrations
|
|
1733
|
+
* Uses a promise-based lock to prevent concurrent initialization
|
|
1734
|
+
*/
|
|
1735
|
+
initialize(): Promise<void>;
|
|
1736
|
+
/**
|
|
1737
|
+
* Get all provider configurations for a tenant
|
|
1738
|
+
*/
|
|
1739
|
+
listProviders(tenantId: string): Promise<ModelProviderEntry[]>;
|
|
1740
|
+
/**
|
|
1741
|
+
* Get a provider configuration by ID
|
|
1742
|
+
*/
|
|
1743
|
+
getProviderById(tenantId: string, id: string): Promise<ModelProviderEntry | null>;
|
|
1744
|
+
/**
|
|
1745
|
+
* Get a provider configuration by business name
|
|
1746
|
+
*/
|
|
1747
|
+
getProviderByName(tenantId: string, name: string): Promise<ModelProviderEntry | null>;
|
|
1748
|
+
/**
|
|
1749
|
+
* Create a new provider configuration
|
|
1750
|
+
*/
|
|
1751
|
+
createProvider(tenantId: string, id: string, data: CreateModelProviderRequest): Promise<ModelProviderEntry>;
|
|
1752
|
+
/**
|
|
1753
|
+
* Update an existing provider configuration.
|
|
1754
|
+
* An omitted or empty `apiKey` leaves the stored key untouched.
|
|
1755
|
+
*/
|
|
1756
|
+
updateProvider(tenantId: string, id: string, updates: Partial<UpdateModelProviderRequest>): Promise<ModelProviderEntry | null>;
|
|
1757
|
+
/**
|
|
1758
|
+
* Delete a provider configuration and its model snapshot
|
|
1759
|
+
*/
|
|
1760
|
+
deleteProvider(tenantId: string, id: string): Promise<boolean>;
|
|
1761
|
+
/**
|
|
1762
|
+
* Record the outcome of a discovery attempt
|
|
1763
|
+
*/
|
|
1764
|
+
markProviderStatus(tenantId: string, id: string, status: ModelProviderStatus, lastError?: string, discoveredAt?: Date): Promise<void>;
|
|
1765
|
+
/**
|
|
1766
|
+
* List snapshot models for a tenant
|
|
1767
|
+
*/
|
|
1768
|
+
listModels(tenantId: string, providerId?: string): Promise<ModelProviderModelEntry[]>;
|
|
1769
|
+
/**
|
|
1770
|
+
* Get a single snapshot model.
|
|
1771
|
+
* Keyed by provider as well as model id, since two providers in the same
|
|
1772
|
+
* tenant may expose the same upstream model id.
|
|
1773
|
+
*/
|
|
1774
|
+
getModel(tenantId: string, providerId: string, modelId: string): Promise<ModelProviderModelEntry | null>;
|
|
1775
|
+
/**
|
|
1776
|
+
* Replace a provider's model snapshot with the result of one discovery.
|
|
1777
|
+
*
|
|
1778
|
+
* Runs in a single transaction. Model ids are scoped per provider, so the
|
|
1779
|
+
* same upstream id may appear under several providers in one tenant — each
|
|
1780
|
+
* is an independent model.
|
|
1781
|
+
*
|
|
1782
|
+
* Models the upstream no longer offers are deleted; models that survive are
|
|
1783
|
+
* upserted *without* touching `enabled`, so the tenant's enable/disable
|
|
1784
|
+
* choice survives a re-discovery. New rows take the column default (enabled).
|
|
1785
|
+
*/
|
|
1786
|
+
replaceProviderModels(tenantId: string, providerId: string, models: ProviderModelInput[]): Promise<string[]>;
|
|
1787
|
+
/**
|
|
1788
|
+
* Enable or disable a single snapshot model
|
|
1789
|
+
*/
|
|
1790
|
+
setModelEnabled(tenantId: string, providerId: string, modelId: string, enabled: boolean): Promise<ModelProviderModelEntry | null>;
|
|
1791
|
+
/**
|
|
1792
|
+
* Delete every snapshot model belonging to a provider
|
|
1793
|
+
*/
|
|
1794
|
+
deleteModelsByProvider(tenantId: string, providerId: string): Promise<number>;
|
|
1795
|
+
/**
|
|
1796
|
+
* Dispose resources and close the connection pool
|
|
1797
|
+
*/
|
|
1798
|
+
dispose(): Promise<void>;
|
|
1799
|
+
/**
|
|
1800
|
+
* Ensure store is initialized
|
|
1801
|
+
*/
|
|
1802
|
+
private ensureInitialized;
|
|
1803
|
+
/**
|
|
1804
|
+
* Map provider row to ModelProviderEntry
|
|
1805
|
+
* Automatically decrypts the API key if present
|
|
1806
|
+
*/
|
|
1807
|
+
private mapRowToEntry;
|
|
1808
|
+
/**
|
|
1809
|
+
* Map model row to ModelProviderModelEntry
|
|
1810
|
+
*/
|
|
1811
|
+
private mapRowToModel;
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1692
1814
|
declare function createPgStoreConfig(connectionString: string): Promise<{
|
|
1693
1815
|
workspace: PostgreSQLWorkspaceStore;
|
|
1694
1816
|
project: PostgreSQLProjectStore;
|
|
@@ -1703,6 +1825,7 @@ declare function createPgStoreConfig(connectionString: string): Promise<{
|
|
|
1703
1825
|
connection: PostgreSQLConnectionStore;
|
|
1704
1826
|
metrics: PostgreSQLMetricsServerConfigStore;
|
|
1705
1827
|
mcp: PostgreSQLMcpServerConfigStore;
|
|
1828
|
+
modelProvider: PostgreSQLModelProviderStore;
|
|
1706
1829
|
assistant: PostgreSQLAssistantStore;
|
|
1707
1830
|
workflowTracking: PostgreSQLWorkflowTrackingStore;
|
|
1708
1831
|
threadMessageQueue: ThreadMessageQueueStore;
|
|
@@ -2214,4 +2337,4 @@ declare const createProjectRoomTables: Migration;
|
|
|
2214
2337
|
/** Adds per-user, per-room read markers for unread counts. */
|
|
2215
2338
|
declare const createProjectRoomReadStates: Migration;
|
|
2216
2339
|
|
|
2217
|
-
export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PGVectorStoreProvider, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAgentWebAppStore, type PostgreSQLAgentWebAppStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLCapabilityBundleStore, type PostgreSQLCapabilityBundleStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLCollectionStore, type PostgreSQLCollectionStoreOptions, PostgreSQLConnectionStore, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLOpenAuditStore, type PostgreSQLOpenAuditStoreOptions, PostgreSQLProjectBotMembershipStore, PostgreSQLProjectMembershipStore, PostgreSQLProjectRoomMessageStore, PostgreSQLProjectRoomReadStateStore, PostgreSQLProjectRoomStore, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTaskWorkItemStore, type PostgreSQLTaskWorkItemStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, type PostgreSQLThreadMessageQueueStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, PostgresSharedResourceStore, type PostgresSharedResourceStoreOptions, ProjectBotMembershipIdConflictError, ProjectMembershipIdConflictError, ProjectRoomMessageIdConflictError, ThreadMessageQueueStore, addAssistantTenantId, addEnvToEvalRuns, addFileContentType, addHoldoutToEvalRuns, addInterruptColumnsToEval, addInterruptPolicyToEvalCases, addMcpAppContentType, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addTaskIdToEvalRuns, addThreadTenantId, addWorkflowRunsTenantStatusUpdatedIndex, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAgentWebAppsTable, createAssistantsTable, createCapabilityBundlesTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createCollectionsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPGVectorStoreProvider, createPgStoreConfig, createProjectRoomReadStates, createProjectRoomTables, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, enforceUniqueEvalProjectName, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
|
|
2340
|
+
export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PGVectorStoreProvider, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAgentWebAppStore, type PostgreSQLAgentWebAppStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLCapabilityBundleStore, type PostgreSQLCapabilityBundleStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLCollectionStore, type PostgreSQLCollectionStoreOptions, PostgreSQLConnectionStore, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLModelProviderStore, type PostgreSQLModelProviderStoreOptions, PostgreSQLOpenAuditStore, type PostgreSQLOpenAuditStoreOptions, PostgreSQLProjectBotMembershipStore, PostgreSQLProjectMembershipStore, PostgreSQLProjectRoomMessageStore, PostgreSQLProjectRoomReadStateStore, PostgreSQLProjectRoomStore, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTaskWorkItemStore, type PostgreSQLTaskWorkItemStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, type PostgreSQLThreadMessageQueueStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, PostgresSharedResourceStore, type PostgresSharedResourceStoreOptions, ProjectBotMembershipIdConflictError, ProjectMembershipIdConflictError, ProjectRoomMessageIdConflictError, ThreadMessageQueueStore, addAssistantTenantId, addEnvToEvalRuns, addFileContentType, addHoldoutToEvalRuns, addInterruptColumnsToEval, addInterruptPolicyToEvalCases, addMcpAppContentType, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addTaskIdToEvalRuns, addThreadTenantId, addWorkflowRunsTenantStatusUpdatedIndex, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAgentWebAppsTable, createAssistantsTable, createCapabilityBundlesTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createCollectionsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPGVectorStoreProvider, createPgStoreConfig, createProjectRoomReadStates, createProjectRoomTables, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, enforceUniqueEvalProjectName, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Pool, PoolConfig, PoolClient } from 'pg';
|
|
2
2
|
export { Pool, PoolConfig } from 'pg';
|
|
3
|
-
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, ProjectFilter, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, QueryWorkflowRunsOptions, QueryWorkflowRunsResult, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, BindingMutablePatch, BindingListParams, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationInput, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, UpdateA2AApiKeyInput, A2AApiKeyEntry, OpenAuditStore, OpenAuditQuery, OpenAuditRecord, OpenAuditAppendInput, AgentWebAppStore, AgentWebApp, CreateAgentWebAppInput, AgentWebAppStorePatch, AgentWebAppUpdateOptions, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, TaskDependentListQuery, UpdateTaskRequest, TaskMutationSnapshot, TaskWorkItemStore, CreateWorkItemRequest, TaskWorkItem, CreateWorkItemIfAbsentRequest, TaskWorkItemListFilter, ProjectLifecycleEventQuery, MenuRegistry, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, SharedResourceStore, ShareRecord, CollectionStore, Collection, CreateCollectionRequest, UpdateCollectionRequest, VectorStoreProvider, VectorStoreCreateParams, CapabilityBundleStore, CapabilityBundle, InternalCreateCapabilityBundleInput, InternalUpdateCapabilityBundleInput, CapabilityBundleDeleteResult, ProjectRoomStore, ProjectRoom, ProjectMembershipStore, ProjectMembership, ProjectHumanRole, ProjectMembershipMutationResult, ProjectBotMembershipStore, ProjectBotMembership, ProjectRoomMessageStore, ProjectRoomMessage, ProjectRoomReadStateStore, ProjectRoomReadState, UserPushSubscriptionStore, UserPushSubscription, SkillStore, Skill, CreateSkillRequest } from '@axiom-lattice/protocols';
|
|
3
|
+
import { ThreadStore, Thread, CreateThreadRequest, AssistantStore, Assistant, CreateAssistantRequest, DatabaseConfigStore, DatabaseConfigEntry, CreateDatabaseConfigRequest, UpdateDatabaseConfigRequest, ConnectionStore, ConnectionEntry, MetricsServerConfigStore, MetricsServerConfigEntry, CreateMetricsServerConfigRequest, UpdateMetricsServerConfigRequest, McpServerConfigStore, McpServerConfigEntry, CreateMcpServerConfigRequest, UpdateMcpServerConfigRequest, WorkspaceStore, Workspace, CreateWorkspaceRequest, UpdateWorkspaceRequest, ProjectStore, ProjectFilter, Project, CreateProjectRequest, UpdateProjectRequest, UpdateProjectCapabilityBundlesResult, UserStore, User, CreateUserRequest, UpdateUserRequest, TenantStore, Tenant, CreateTenantRequest, UpdateTenantRequest, UserTenantLinkStore, UserTenantLink, CreateUserTenantLinkRequest, UpdateUserTenantLinkRequest, WorkflowTrackingStore, CreateWorkflowRunRequest, WorkflowRun, UpdateWorkflowRunRequest, QueryWorkflowRunsOptions, QueryWorkflowRunsResult, CreateRunStepRequest, RunStep, UpdateRunStepRequest, StepType, EvalStore, EvalProject, CreateEvalProjectRequest, EvalSuite, CreateEvalSuiteRequest, EvalCase, CreateEvalCaseRequest, EvalRun, CreateEvalRunRequest, EvalRunResult, EvalProjectReport, BindingRegistry, Binding, CreateBindingInput, BindingMutablePatch, BindingListParams, ChannelInstallationStore, ChannelInstallation, ChannelInstallationType, CreateChannelInstallationInput, UpdateChannelInstallationRequest, A2AApiKeyStore, A2AApiKeyRecord, CreateA2AApiKeyInput, UpdateA2AApiKeyInput, A2AApiKeyEntry, OpenAuditStore, OpenAuditQuery, OpenAuditRecord, OpenAuditAppendInput, AgentWebAppStore, AgentWebApp, CreateAgentWebAppInput, AgentWebAppStorePatch, AgentWebAppUpdateOptions, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ScheduleExecutionType, TaskStore, CreateTaskRequest, TaskItem, TaskListFilter, TaskDependentListQuery, UpdateTaskRequest, TaskMutationSnapshot, TaskWorkItemStore, CreateWorkItemRequest, TaskWorkItem, CreateWorkItemIfAbsentRequest, TaskWorkItemListFilter, ProjectLifecycleEventQuery, MenuRegistry, MenuItem, CreateMenuItemInput, UpdateMenuItemInput, SharedResourceStore, ShareRecord, CollectionStore, Collection, CreateCollectionRequest, UpdateCollectionRequest, VectorStoreProvider, VectorStoreCreateParams, CapabilityBundleStore, CapabilityBundle, InternalCreateCapabilityBundleInput, InternalUpdateCapabilityBundleInput, CapabilityBundleDeleteResult, ProjectRoomStore, ProjectRoom, ProjectMembershipStore, ProjectMembership, ProjectHumanRole, ProjectMembershipMutationResult, ProjectBotMembershipStore, ProjectBotMembership, ProjectRoomMessageStore, ProjectRoomMessage, ProjectRoomReadStateStore, ProjectRoomReadState, UserPushSubscriptionStore, UserPushSubscription, ModelProviderStore, ModelProviderEntry, CreateModelProviderRequest, UpdateModelProviderRequest, ModelProviderStatus, ModelProviderModelEntry, ProviderModelInput, SkillStore, Skill, CreateSkillRequest } from '@axiom-lattice/protocols';
|
|
4
4
|
export { AgentWebApp, AgentWebAppAppearance, AgentWebAppFeatures, AgentWebAppScope, AgentWebAppStatus, AgentWebAppStore, Assistant, AssistantStore, Binding, BindingRegistry, CapabilityBundle, CapabilityBundleStore, ChannelInstallation, ChannelInstallationStore, ConnectionEntry, ConnectionStore, CreateAgentWebAppInput, CreateAssistantRequest, CreateBindingInput, CreateCapabilityBundleInput, CreateChannelInstallationInput, CreateChannelInstallationRequest, CreateDatabaseConfigRequest, CreateEvalCaseRequest, CreateEvalProjectRequest, CreateEvalRunRequest, CreateEvalSuiteRequest, CreateMcpServerConfigRequest, CreateMenuItemInput, CreateMetricsServerConfigRequest, CreateProjectRequest, CreateRunStepRequest, CreateShareRequest, CreateSkillRequest, CreateTenantRequest, CreateThreadRequest, CreateUserRequest, CreateUserTenantLinkRequest, CreateWorkflowRunRequest, CreateWorkspaceRequest, DatabaseConfig, DatabaseConfigEntry, DatabaseConfigStore, DatabaseType, EvalCase, EvalProject, EvalProjectReport, EvalRun, EvalRunResult, EvalStore, EvalSuite, LarkChannelInstallationConfig, McpServerConfigEntry, McpServerConfigStore, MenuItem, MenuRegistry, MetricsServerConfig, MetricsServerConfigEntry, MetricsServerConfigStore, Project, ProjectStore, ResourceAddress, RunStep, ScheduleExecutionType, ScheduleStorage, ScheduledTaskDefinition, ScheduledTaskStatus, ShareRecord, ShareResult, ShareVisibility, SharedResourceStore, Skill, SkillStore, StorageType, Tenant, TenantStatus, TenantStore, Thread, ThreadStore, UpdateAgentWebAppInput, UpdateCapabilityBundleInput, UpdateChannelInstallationRequest, UpdateDatabaseConfigRequest, UpdateMcpServerConfigRequest, UpdateMetricsServerConfigRequest, UpdateProjectRequest, UpdateRunStepRequest, UpdateTenantRequest, UpdateUserRequest, UpdateUserTenantLinkRequest, UpdateWorkflowRunRequest, UpdateWorkspaceRequest, User, UserStore, UserTenantLink, UserTenantLinkStore, UserTenantRole, WorkflowRun, WorkflowTrackingStore, Workspace, WorkspaceStore } from '@axiom-lattice/protocols';
|
|
5
5
|
import { IMessageQueueStore, AddMessageParams, PendingMessage, QueueScope, ThreadInfo } from '@axiom-lattice/core';
|
|
6
6
|
export { AddMessageParams, PendingMessage, ThreadInfo } from '@axiom-lattice/core';
|
|
@@ -1689,6 +1689,128 @@ declare class PostgreSQLUserPushSubscriptionStore implements UserPushSubscriptio
|
|
|
1689
1689
|
delete(tenantId: string, userId: string, endpoint: string): Promise<boolean>;
|
|
1690
1690
|
}
|
|
1691
1691
|
|
|
1692
|
+
/**
|
|
1693
|
+
* PostgreSQL implementation of ModelProviderStore
|
|
1694
|
+
*/
|
|
1695
|
+
|
|
1696
|
+
/**
|
|
1697
|
+
* PostgreSQL ModelProviderStore options
|
|
1698
|
+
*/
|
|
1699
|
+
interface PostgreSQLModelProviderStoreOptions {
|
|
1700
|
+
/**
|
|
1701
|
+
* External pool instance. When provided, poolConfig is not required and the
|
|
1702
|
+
* caller is responsible for pool lifecycle and migrations.
|
|
1703
|
+
*/
|
|
1704
|
+
pool?: Pool;
|
|
1705
|
+
/**
|
|
1706
|
+
* PostgreSQL connection pool configuration
|
|
1707
|
+
* Can be a connection string or PoolConfig object
|
|
1708
|
+
*/
|
|
1709
|
+
poolConfig?: string | PoolConfig;
|
|
1710
|
+
/**
|
|
1711
|
+
* Whether to run migrations automatically on initialization
|
|
1712
|
+
* @default true
|
|
1713
|
+
*/
|
|
1714
|
+
autoMigrate?: boolean;
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* PostgreSQL implementation of ModelProviderStore
|
|
1718
|
+
*
|
|
1719
|
+
* Features:
|
|
1720
|
+
* - Multi-tenant isolation via tenant_id
|
|
1721
|
+
* - Automatic API key encryption/decryption
|
|
1722
|
+
* - Unique constraint on (tenant_id, name) and (tenant_id, model_id)
|
|
1723
|
+
*/
|
|
1724
|
+
declare class PostgreSQLModelProviderStore implements ModelProviderStore {
|
|
1725
|
+
private pool;
|
|
1726
|
+
private migrationManager;
|
|
1727
|
+
private initialized;
|
|
1728
|
+
private ownsPool;
|
|
1729
|
+
private initPromise;
|
|
1730
|
+
constructor(options: PostgreSQLModelProviderStoreOptions);
|
|
1731
|
+
/**
|
|
1732
|
+
* Initialize the store and run migrations
|
|
1733
|
+
* Uses a promise-based lock to prevent concurrent initialization
|
|
1734
|
+
*/
|
|
1735
|
+
initialize(): Promise<void>;
|
|
1736
|
+
/**
|
|
1737
|
+
* Get all provider configurations for a tenant
|
|
1738
|
+
*/
|
|
1739
|
+
listProviders(tenantId: string): Promise<ModelProviderEntry[]>;
|
|
1740
|
+
/**
|
|
1741
|
+
* Get a provider configuration by ID
|
|
1742
|
+
*/
|
|
1743
|
+
getProviderById(tenantId: string, id: string): Promise<ModelProviderEntry | null>;
|
|
1744
|
+
/**
|
|
1745
|
+
* Get a provider configuration by business name
|
|
1746
|
+
*/
|
|
1747
|
+
getProviderByName(tenantId: string, name: string): Promise<ModelProviderEntry | null>;
|
|
1748
|
+
/**
|
|
1749
|
+
* Create a new provider configuration
|
|
1750
|
+
*/
|
|
1751
|
+
createProvider(tenantId: string, id: string, data: CreateModelProviderRequest): Promise<ModelProviderEntry>;
|
|
1752
|
+
/**
|
|
1753
|
+
* Update an existing provider configuration.
|
|
1754
|
+
* An omitted or empty `apiKey` leaves the stored key untouched.
|
|
1755
|
+
*/
|
|
1756
|
+
updateProvider(tenantId: string, id: string, updates: Partial<UpdateModelProviderRequest>): Promise<ModelProviderEntry | null>;
|
|
1757
|
+
/**
|
|
1758
|
+
* Delete a provider configuration and its model snapshot
|
|
1759
|
+
*/
|
|
1760
|
+
deleteProvider(tenantId: string, id: string): Promise<boolean>;
|
|
1761
|
+
/**
|
|
1762
|
+
* Record the outcome of a discovery attempt
|
|
1763
|
+
*/
|
|
1764
|
+
markProviderStatus(tenantId: string, id: string, status: ModelProviderStatus, lastError?: string, discoveredAt?: Date): Promise<void>;
|
|
1765
|
+
/**
|
|
1766
|
+
* List snapshot models for a tenant
|
|
1767
|
+
*/
|
|
1768
|
+
listModels(tenantId: string, providerId?: string): Promise<ModelProviderModelEntry[]>;
|
|
1769
|
+
/**
|
|
1770
|
+
* Get a single snapshot model.
|
|
1771
|
+
* Keyed by provider as well as model id, since two providers in the same
|
|
1772
|
+
* tenant may expose the same upstream model id.
|
|
1773
|
+
*/
|
|
1774
|
+
getModel(tenantId: string, providerId: string, modelId: string): Promise<ModelProviderModelEntry | null>;
|
|
1775
|
+
/**
|
|
1776
|
+
* Replace a provider's model snapshot with the result of one discovery.
|
|
1777
|
+
*
|
|
1778
|
+
* Runs in a single transaction. Model ids are scoped per provider, so the
|
|
1779
|
+
* same upstream id may appear under several providers in one tenant — each
|
|
1780
|
+
* is an independent model.
|
|
1781
|
+
*
|
|
1782
|
+
* Models the upstream no longer offers are deleted; models that survive are
|
|
1783
|
+
* upserted *without* touching `enabled`, so the tenant's enable/disable
|
|
1784
|
+
* choice survives a re-discovery. New rows take the column default (enabled).
|
|
1785
|
+
*/
|
|
1786
|
+
replaceProviderModels(tenantId: string, providerId: string, models: ProviderModelInput[]): Promise<string[]>;
|
|
1787
|
+
/**
|
|
1788
|
+
* Enable or disable a single snapshot model
|
|
1789
|
+
*/
|
|
1790
|
+
setModelEnabled(tenantId: string, providerId: string, modelId: string, enabled: boolean): Promise<ModelProviderModelEntry | null>;
|
|
1791
|
+
/**
|
|
1792
|
+
* Delete every snapshot model belonging to a provider
|
|
1793
|
+
*/
|
|
1794
|
+
deleteModelsByProvider(tenantId: string, providerId: string): Promise<number>;
|
|
1795
|
+
/**
|
|
1796
|
+
* Dispose resources and close the connection pool
|
|
1797
|
+
*/
|
|
1798
|
+
dispose(): Promise<void>;
|
|
1799
|
+
/**
|
|
1800
|
+
* Ensure store is initialized
|
|
1801
|
+
*/
|
|
1802
|
+
private ensureInitialized;
|
|
1803
|
+
/**
|
|
1804
|
+
* Map provider row to ModelProviderEntry
|
|
1805
|
+
* Automatically decrypts the API key if present
|
|
1806
|
+
*/
|
|
1807
|
+
private mapRowToEntry;
|
|
1808
|
+
/**
|
|
1809
|
+
* Map model row to ModelProviderModelEntry
|
|
1810
|
+
*/
|
|
1811
|
+
private mapRowToModel;
|
|
1812
|
+
}
|
|
1813
|
+
|
|
1692
1814
|
declare function createPgStoreConfig(connectionString: string): Promise<{
|
|
1693
1815
|
workspace: PostgreSQLWorkspaceStore;
|
|
1694
1816
|
project: PostgreSQLProjectStore;
|
|
@@ -1703,6 +1825,7 @@ declare function createPgStoreConfig(connectionString: string): Promise<{
|
|
|
1703
1825
|
connection: PostgreSQLConnectionStore;
|
|
1704
1826
|
metrics: PostgreSQLMetricsServerConfigStore;
|
|
1705
1827
|
mcp: PostgreSQLMcpServerConfigStore;
|
|
1828
|
+
modelProvider: PostgreSQLModelProviderStore;
|
|
1706
1829
|
assistant: PostgreSQLAssistantStore;
|
|
1707
1830
|
workflowTracking: PostgreSQLWorkflowTrackingStore;
|
|
1708
1831
|
threadMessageQueue: ThreadMessageQueueStore;
|
|
@@ -2214,4 +2337,4 @@ declare const createProjectRoomTables: Migration;
|
|
|
2214
2337
|
/** Adds per-user, per-room read markers for unread counts. */
|
|
2215
2338
|
declare const createProjectRoomReadStates: Migration;
|
|
2216
2339
|
|
|
2217
|
-
export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PGVectorStoreProvider, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAgentWebAppStore, type PostgreSQLAgentWebAppStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLCapabilityBundleStore, type PostgreSQLCapabilityBundleStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLCollectionStore, type PostgreSQLCollectionStoreOptions, PostgreSQLConnectionStore, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLOpenAuditStore, type PostgreSQLOpenAuditStoreOptions, PostgreSQLProjectBotMembershipStore, PostgreSQLProjectMembershipStore, PostgreSQLProjectRoomMessageStore, PostgreSQLProjectRoomReadStateStore, PostgreSQLProjectRoomStore, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTaskWorkItemStore, type PostgreSQLTaskWorkItemStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, type PostgreSQLThreadMessageQueueStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, PostgresSharedResourceStore, type PostgresSharedResourceStoreOptions, ProjectBotMembershipIdConflictError, ProjectMembershipIdConflictError, ProjectRoomMessageIdConflictError, ThreadMessageQueueStore, addAssistantTenantId, addEnvToEvalRuns, addFileContentType, addHoldoutToEvalRuns, addInterruptColumnsToEval, addInterruptPolicyToEvalCases, addMcpAppContentType, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addTaskIdToEvalRuns, addThreadTenantId, addWorkflowRunsTenantStatusUpdatedIndex, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAgentWebAppsTable, createAssistantsTable, createCapabilityBundlesTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createCollectionsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPGVectorStoreProvider, createPgStoreConfig, createProjectRoomReadStates, createProjectRoomTables, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, enforceUniqueEvalProjectName, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
|
|
2340
|
+
export { ChannelBindingStore, type ChannelBindingStoreOptions, type ChannelIdentityMapping, ChannelIdentityMappingStore, type ChannelIdentityMappingStoreOptions, type CreateChannelIdentityMappingInput, DuplicateProjectMembershipError, DuplicateProjectRoomMessageIdempotencyKeyError, MenuStore, type MenuStoreOptions, type Migration, MigrationManager, PGVectorStoreProvider, PostgreSQLA2AApiKeyStore, type PostgreSQLA2AApiKeyStoreOptions, PostgreSQLAgentWebAppStore, type PostgreSQLAgentWebAppStoreOptions, PostgreSQLAssistantStore, type PostgreSQLAssistantStoreOptions, PostgreSQLCapabilityBundleStore, type PostgreSQLCapabilityBundleStoreOptions, PostgreSQLChannelInstallationStore, type PostgreSQLChannelInstallationStoreOptions, PostgreSQLCollectionStore, type PostgreSQLCollectionStoreOptions, PostgreSQLConnectionStore, PostgreSQLDatabaseConfigStore, type PostgreSQLDatabaseConfigStoreOptions, PostgreSQLEvalStore, type PostgreSQLEvalStoreOptions, PostgreSQLMcpServerConfigStore, type PostgreSQLMcpServerConfigStoreOptions, PostgreSQLMetricsServerConfigStore, type PostgreSQLMetricsServerConfigStoreOptions, PostgreSQLModelProviderStore, type PostgreSQLModelProviderStoreOptions, PostgreSQLOpenAuditStore, type PostgreSQLOpenAuditStoreOptions, PostgreSQLProjectBotMembershipStore, PostgreSQLProjectMembershipStore, PostgreSQLProjectRoomMessageStore, PostgreSQLProjectRoomReadStateStore, PostgreSQLProjectRoomStore, PostgreSQLProjectStore, type PostgreSQLProjectStoreOptions, PostgreSQLScheduleStorage, type PostgreSQLScheduleStorageOptions, PostgreSQLSkillStore, type PostgreSQLSkillStoreOptions, PostgreSQLTaskWorkItemStore, type PostgreSQLTaskWorkItemStoreOptions, PostgreSQLTenantStore, type PostgreSQLTenantStoreOptions, type PostgreSQLThreadMessageQueueStoreOptions, PostgreSQLThreadStore, type PostgreSQLThreadStoreOptions, PostgreSQLUserStore, type PostgreSQLUserStoreOptions, PostgreSQLUserTenantLinkStore, type PostgreSQLUserTenantLinkStoreOptions, PostgreSQLWorkflowTrackingStore, type PostgreSQLWorkflowTrackingStoreOptions, PostgreSQLWorkspaceStore, type PostgreSQLWorkspaceStoreOptions, PostgresSharedResourceStore, type PostgresSharedResourceStoreOptions, ProjectBotMembershipIdConflictError, ProjectMembershipIdConflictError, ProjectRoomMessageIdConflictError, ThreadMessageQueueStore, addAssistantTenantId, addEnvToEvalRuns, addFileContentType, addHoldoutToEvalRuns, addInterruptColumnsToEval, addInterruptPolicyToEvalCases, addMcpAppContentType, addProjectConfigColumn, addScheduleTenantId, addSkillTenantId, addStepThreadId, addTaskIdToEvalRuns, addThreadTenantId, addWorkflowRunsTenantStatusUpdatedIndex, alterChannelInstallationsTable, changeAssistantPrimaryKey, changeSkillPrimaryKey, changeThreadPrimaryKey, createA2AApiKeysTable, createAgentWebAppsTable, createAssistantsTable, createCapabilityBundlesTable, createChannelBindingsTable, createChannelIdentityMappingTables, createChannelInstallationsTable, createCollectionsTable, createDatabaseConfigsTable, createEvalCasesTable, createEvalProjectsTable, createEvalRunResultsTable, createEvalRunsTable, createEvalSuitesTable, createMcpServerConfigsTable, createMenuItemsTable, createMetricsConfigsTable, createPGVectorStoreProvider, createPgStoreConfig, createProjectRoomReadStates, createProjectRoomTables, createProjectsTable, createScheduledTasksTable, createSharedResourcesTable, createSkillsTable, createTenantsTable, createThreadMessageQueueTable, createThreadsTable, createUsersTable, createWorkflowTrackingTables, createWorkspacesTable, enforceUniqueEvalProjectName, evalMigrations, mapRowToRunStep, mapRowToWorkflowRun, safeParse };
|