@axiom-lattice/protocols 2.1.14 → 2.1.16
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 +9 -9
- package/CHANGELOG.md +12 -0
- package/dist/index.d.mts +537 -3
- package/dist/index.d.ts +537 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/AgentLatticeProtocol.ts +9 -2
- package/src/MetricsServerConfigStoreProtocol.ts +401 -0
- package/src/SkillStoreProtocol.ts +15 -0
- package/src/TenantStoreProtocol.ts +54 -0
- package/src/UserStoreProtocol.ts +34 -0
- package/src/UserTenantLinkProtocol.ts +81 -0
- package/src/index.ts +4 -0
package/dist/index.d.ts
CHANGED
|
@@ -176,14 +176,20 @@ interface BrowserMiddlewareConfig {
|
|
|
176
176
|
interface SqlMiddlewareConfig {
|
|
177
177
|
databaseKeys?: string[];
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
interface MetricsMiddlewareConfig {
|
|
180
|
+
/** List of configured metrics server keys */
|
|
181
|
+
serverKeys: string[];
|
|
182
|
+
/** Optional descriptions for each server */
|
|
183
|
+
serverDescriptions?: Record<string, string>;
|
|
184
|
+
}
|
|
185
|
+
type MiddlewareType = "filesystem" | "code_eval" | "browser" | "sql" | "skill" | "http" | "custom" | "metrics";
|
|
180
186
|
interface AgentMiddlewareConfig {
|
|
181
187
|
id: string;
|
|
182
188
|
type: MiddlewareType;
|
|
183
189
|
name: string;
|
|
184
190
|
description: string;
|
|
185
191
|
enabled: boolean;
|
|
186
|
-
config: SandboxMiddlewareConfig | CodeEvalMiddlewareConfig | BrowserMiddlewareConfig | SqlMiddlewareConfig | Record<string, any>;
|
|
192
|
+
config: SandboxMiddlewareConfig | CodeEvalMiddlewareConfig | BrowserMiddlewareConfig | SqlMiddlewareConfig | MetricsMiddlewareConfig | Record<string, any>;
|
|
187
193
|
}
|
|
188
194
|
/**
|
|
189
195
|
* REACT agent configuration
|
|
@@ -1297,6 +1303,19 @@ interface SkillStore {
|
|
|
1297
1303
|
* @returns Array of sub-skills if found, empty array otherwise
|
|
1298
1304
|
*/
|
|
1299
1305
|
getSubSkills(parentSkillName: string): Promise<Skill[]>;
|
|
1306
|
+
/**
|
|
1307
|
+
* List all resources in a skill's resources directory
|
|
1308
|
+
* @param id Skill identifier
|
|
1309
|
+
* @returns Array of resource paths relative to resources/ directory
|
|
1310
|
+
*/
|
|
1311
|
+
listSkillResources?(id: string): Promise<string[]>;
|
|
1312
|
+
/**
|
|
1313
|
+
* Load a specific resource from a skill's resources directory
|
|
1314
|
+
* @param id Skill identifier
|
|
1315
|
+
* @param resourcePath Path to the resource relative to resources/ directory
|
|
1316
|
+
* @returns The resource content as string, or null if not found
|
|
1317
|
+
*/
|
|
1318
|
+
loadSkillResource?(id: string, resourcePath: string): Promise<string | null>;
|
|
1300
1319
|
}
|
|
1301
1320
|
|
|
1302
1321
|
/**
|
|
@@ -1659,6 +1678,56 @@ interface ProjectStore {
|
|
|
1659
1678
|
deleteProject(tenantId: string, id: string): Promise<boolean>;
|
|
1660
1679
|
}
|
|
1661
1680
|
|
|
1681
|
+
/**
|
|
1682
|
+
* TenantStoreProtocol
|
|
1683
|
+
*
|
|
1684
|
+
* Tenant store protocol definitions
|
|
1685
|
+
* for the Axiom Lattice framework
|
|
1686
|
+
*/
|
|
1687
|
+
type TenantStatus = 'active' | 'inactive' | 'suspended';
|
|
1688
|
+
/**
|
|
1689
|
+
* Tenant type definition
|
|
1690
|
+
*/
|
|
1691
|
+
interface Tenant {
|
|
1692
|
+
id: string;
|
|
1693
|
+
name: string;
|
|
1694
|
+
description?: string;
|
|
1695
|
+
status: TenantStatus;
|
|
1696
|
+
metadata?: Record<string, any>;
|
|
1697
|
+
createdAt: Date;
|
|
1698
|
+
updatedAt: Date;
|
|
1699
|
+
}
|
|
1700
|
+
/**
|
|
1701
|
+
* Create tenant request type
|
|
1702
|
+
*/
|
|
1703
|
+
interface CreateTenantRequest {
|
|
1704
|
+
name: string;
|
|
1705
|
+
description?: string;
|
|
1706
|
+
status?: TenantStatus;
|
|
1707
|
+
metadata?: Record<string, any>;
|
|
1708
|
+
}
|
|
1709
|
+
/**
|
|
1710
|
+
* Update tenant request type
|
|
1711
|
+
*/
|
|
1712
|
+
interface UpdateTenantRequest {
|
|
1713
|
+
name?: string;
|
|
1714
|
+
description?: string;
|
|
1715
|
+
status?: TenantStatus;
|
|
1716
|
+
metadata?: Record<string, any>;
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1719
|
+
* TenantStore interface
|
|
1720
|
+
* Provides CRUD operations for tenant data
|
|
1721
|
+
* Note: Tenant is a top-level entity, so no tenantId parameter is needed
|
|
1722
|
+
*/
|
|
1723
|
+
interface TenantStore {
|
|
1724
|
+
getAllTenants(): Promise<Tenant[]>;
|
|
1725
|
+
getTenantById(id: string): Promise<Tenant | null>;
|
|
1726
|
+
createTenant(id: string, data: CreateTenantRequest): Promise<Tenant>;
|
|
1727
|
+
updateTenant(id: string, updates: UpdateTenantRequest): Promise<Tenant | null>;
|
|
1728
|
+
deleteTenant(id: string): Promise<boolean>;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1662
1731
|
/**
|
|
1663
1732
|
* DatabaseConfigStoreProtocol
|
|
1664
1733
|
*
|
|
@@ -1823,6 +1892,471 @@ interface DatabaseConfigStore {
|
|
|
1823
1892
|
hasConfig(tenantId: string, id: string): Promise<boolean>;
|
|
1824
1893
|
}
|
|
1825
1894
|
|
|
1895
|
+
/**
|
|
1896
|
+
* MetricsServerConfigStoreProtocol
|
|
1897
|
+
*
|
|
1898
|
+
* Metrics Server configuration store protocol for the Axiom Lattice framework
|
|
1899
|
+
* Provides standardized interfaces for metrics server connection config management
|
|
1900
|
+
*/
|
|
1901
|
+
/**
|
|
1902
|
+
* Supported metrics server types
|
|
1903
|
+
*/
|
|
1904
|
+
type MetricsServerType = 'prometheus' | 'grafana' | 'custom' | 'semantic';
|
|
1905
|
+
/**
|
|
1906
|
+
* Metrics server connection configuration
|
|
1907
|
+
*/
|
|
1908
|
+
interface MetricsServerConfig {
|
|
1909
|
+
/** Server type */
|
|
1910
|
+
type: MetricsServerType;
|
|
1911
|
+
/** Server base URL (e.g., http://localhost:9090) */
|
|
1912
|
+
serverUrl: string;
|
|
1913
|
+
/** Optional API key for authentication */
|
|
1914
|
+
apiKey?: string;
|
|
1915
|
+
/** Optional username for basic auth */
|
|
1916
|
+
username?: string;
|
|
1917
|
+
/** Optional password for basic auth */
|
|
1918
|
+
password?: string;
|
|
1919
|
+
/** Optional additional headers */
|
|
1920
|
+
headers?: Record<string, string>;
|
|
1921
|
+
/** Optional timeout in milliseconds (default: 30000) */
|
|
1922
|
+
timeout?: number;
|
|
1923
|
+
}
|
|
1924
|
+
/**
|
|
1925
|
+
* Metrics server configuration entry stored in the store
|
|
1926
|
+
*/
|
|
1927
|
+
interface MetricsServerConfigEntry {
|
|
1928
|
+
/**
|
|
1929
|
+
* Unique identifier for the configuration
|
|
1930
|
+
*/
|
|
1931
|
+
id: string;
|
|
1932
|
+
/**
|
|
1933
|
+
* Tenant identifier for multi-tenant isolation
|
|
1934
|
+
*/
|
|
1935
|
+
tenantId: string;
|
|
1936
|
+
/**
|
|
1937
|
+
* Business key for the configuration (unique within tenant)
|
|
1938
|
+
*/
|
|
1939
|
+
key: string;
|
|
1940
|
+
/**
|
|
1941
|
+
* Metrics server connection configuration
|
|
1942
|
+
*/
|
|
1943
|
+
config: MetricsServerConfig;
|
|
1944
|
+
/**
|
|
1945
|
+
* Optional friendly name
|
|
1946
|
+
*/
|
|
1947
|
+
name?: string;
|
|
1948
|
+
/**
|
|
1949
|
+
* Optional description
|
|
1950
|
+
*/
|
|
1951
|
+
description?: string;
|
|
1952
|
+
/**
|
|
1953
|
+
* Creation timestamp
|
|
1954
|
+
*/
|
|
1955
|
+
createdAt: Date;
|
|
1956
|
+
/**
|
|
1957
|
+
* Last update timestamp
|
|
1958
|
+
*/
|
|
1959
|
+
updatedAt: Date;
|
|
1960
|
+
}
|
|
1961
|
+
/**
|
|
1962
|
+
* Request to create a new metrics server configuration
|
|
1963
|
+
*/
|
|
1964
|
+
interface CreateMetricsServerConfigRequest {
|
|
1965
|
+
/**
|
|
1966
|
+
* Business key for the configuration (unique within tenant)
|
|
1967
|
+
*/
|
|
1968
|
+
key: string;
|
|
1969
|
+
/**
|
|
1970
|
+
* Metrics server connection configuration
|
|
1971
|
+
*/
|
|
1972
|
+
config: MetricsServerConfig;
|
|
1973
|
+
/**
|
|
1974
|
+
* Optional friendly name
|
|
1975
|
+
*/
|
|
1976
|
+
name?: string;
|
|
1977
|
+
/**
|
|
1978
|
+
* Optional description
|
|
1979
|
+
*/
|
|
1980
|
+
description?: string;
|
|
1981
|
+
}
|
|
1982
|
+
/**
|
|
1983
|
+
* Request to update an existing metrics server configuration
|
|
1984
|
+
*/
|
|
1985
|
+
interface UpdateMetricsServerConfigRequest {
|
|
1986
|
+
/**
|
|
1987
|
+
* Business key for the configuration
|
|
1988
|
+
*/
|
|
1989
|
+
key?: string;
|
|
1990
|
+
/**
|
|
1991
|
+
* Metrics server connection configuration
|
|
1992
|
+
*/
|
|
1993
|
+
config?: MetricsServerConfig;
|
|
1994
|
+
/**
|
|
1995
|
+
* Optional friendly name
|
|
1996
|
+
*/
|
|
1997
|
+
name?: string;
|
|
1998
|
+
/**
|
|
1999
|
+
* Optional description
|
|
2000
|
+
*/
|
|
2001
|
+
description?: string;
|
|
2002
|
+
}
|
|
2003
|
+
/**
|
|
2004
|
+
* Metric metadata information
|
|
2005
|
+
*/
|
|
2006
|
+
interface MetricMeta {
|
|
2007
|
+
/** Metric name */
|
|
2008
|
+
name: string;
|
|
2009
|
+
/** Metric type (gauge, counter, histogram, summary) */
|
|
2010
|
+
type?: string;
|
|
2011
|
+
/** Metric description/help text */
|
|
2012
|
+
description?: string;
|
|
2013
|
+
/** Available label names */
|
|
2014
|
+
labels?: string[];
|
|
2015
|
+
/** Unit of measurement */
|
|
2016
|
+
unit?: string;
|
|
2017
|
+
}
|
|
2018
|
+
/**
|
|
2019
|
+
* Metric data point
|
|
2020
|
+
*/
|
|
2021
|
+
interface MetricDataPoint {
|
|
2022
|
+
/** Timestamp */
|
|
2023
|
+
timestamp: number;
|
|
2024
|
+
/** Metric value */
|
|
2025
|
+
value: number;
|
|
2026
|
+
/** Label values */
|
|
2027
|
+
labels?: Record<string, string>;
|
|
2028
|
+
}
|
|
2029
|
+
/**
|
|
2030
|
+
* Metric query result
|
|
2031
|
+
*/
|
|
2032
|
+
interface MetricQueryResult {
|
|
2033
|
+
/** Metric name */
|
|
2034
|
+
metricName: string;
|
|
2035
|
+
/** Data points */
|
|
2036
|
+
dataPoints: MetricDataPoint[];
|
|
2037
|
+
/** Query metadata */
|
|
2038
|
+
metadata?: {
|
|
2039
|
+
startTime?: number;
|
|
2040
|
+
endTime?: number;
|
|
2041
|
+
step?: number;
|
|
2042
|
+
};
|
|
2043
|
+
}
|
|
2044
|
+
/**
|
|
2045
|
+
* Data source information for semantic metrics server
|
|
2046
|
+
*/
|
|
2047
|
+
interface DataSource {
|
|
2048
|
+
/** Unique identifier for the data source */
|
|
2049
|
+
id: string | number;
|
|
2050
|
+
/** Display name of the data source */
|
|
2051
|
+
name: string;
|
|
2052
|
+
/** JDBC connection URL or similar */
|
|
2053
|
+
url: string;
|
|
2054
|
+
/** Username for connection */
|
|
2055
|
+
username?: string;
|
|
2056
|
+
/** Schema name in the database */
|
|
2057
|
+
schemaName?: string;
|
|
2058
|
+
/** Description of the data source */
|
|
2059
|
+
description?: string;
|
|
2060
|
+
/** Status code */
|
|
2061
|
+
status: number;
|
|
2062
|
+
/** Status label (e.g., "active", "inactive") */
|
|
2063
|
+
statusLabel?: string;
|
|
2064
|
+
/** Whether the data source is currently connected */
|
|
2065
|
+
connected: boolean;
|
|
2066
|
+
/** Creation timestamp */
|
|
2067
|
+
createdAt?: string;
|
|
2068
|
+
/** Last update timestamp */
|
|
2069
|
+
updatedAt?: string;
|
|
2070
|
+
}
|
|
2071
|
+
/**
|
|
2072
|
+
* Semantic metrics server configuration
|
|
2073
|
+
* Extends base config with semantic-specific properties
|
|
2074
|
+
*/
|
|
2075
|
+
interface SemanticMetricsServerConfig extends MetricsServerConfig {
|
|
2076
|
+
/** Must be 'semantic' */
|
|
2077
|
+
type: 'semantic';
|
|
2078
|
+
/** IDs of selected data sources */
|
|
2079
|
+
selectedDataSources?: string[];
|
|
2080
|
+
}
|
|
2081
|
+
/**
|
|
2082
|
+
* Filter definition for semantic metrics query
|
|
2083
|
+
*/
|
|
2084
|
+
interface SemanticMetricsFilter {
|
|
2085
|
+
/** Dimension/column name to filter on */
|
|
2086
|
+
dimension: string;
|
|
2087
|
+
/** Operator (e.g., "BETWEEN", "=", ">", "<") */
|
|
2088
|
+
operator: string;
|
|
2089
|
+
/** Values for the filter */
|
|
2090
|
+
values: (string | number | boolean)[];
|
|
2091
|
+
}
|
|
2092
|
+
/**
|
|
2093
|
+
* Request body for semantic metrics query
|
|
2094
|
+
*/
|
|
2095
|
+
interface SemanticMetricsQueryRequest {
|
|
2096
|
+
/** Data source ID to query */
|
|
2097
|
+
datasourceId: string | number;
|
|
2098
|
+
/** Array of metric names to query */
|
|
2099
|
+
metrics: string[];
|
|
2100
|
+
/** Optional group by dimensions */
|
|
2101
|
+
groupBy?: string[];
|
|
2102
|
+
/** Optional filters */
|
|
2103
|
+
filters?: SemanticMetricsFilter[];
|
|
2104
|
+
/** Optional result limit */
|
|
2105
|
+
limit?: number;
|
|
2106
|
+
}
|
|
2107
|
+
/**
|
|
2108
|
+
* Single data point in semantic metrics query response
|
|
2109
|
+
*/
|
|
2110
|
+
interface SemanticMetricDataPoint {
|
|
2111
|
+
/** Timestamp in milliseconds */
|
|
2112
|
+
timestamp?: number;
|
|
2113
|
+
/** Metric value */
|
|
2114
|
+
value: number;
|
|
2115
|
+
/** Metric name */
|
|
2116
|
+
metricName?: string;
|
|
2117
|
+
/** Additional dimension values */
|
|
2118
|
+
labels?: Record<string, string>;
|
|
2119
|
+
/** Group by dimension values */
|
|
2120
|
+
groupByValues?: Record<string, string>;
|
|
2121
|
+
}
|
|
2122
|
+
/**
|
|
2123
|
+
* AI Hints for a single metric result
|
|
2124
|
+
*/
|
|
2125
|
+
interface SemanticMetricAiHints {
|
|
2126
|
+
polarity: string;
|
|
2127
|
+
valueInterpretation: string;
|
|
2128
|
+
thresholds?: Array<{
|
|
2129
|
+
metric: string;
|
|
2130
|
+
operator: string;
|
|
2131
|
+
value: number;
|
|
2132
|
+
level: string;
|
|
2133
|
+
}>;
|
|
2134
|
+
suggestedFollowup?: string[];
|
|
2135
|
+
}
|
|
2136
|
+
/**
|
|
2137
|
+
* Single metric result from semantic metrics query
|
|
2138
|
+
*/
|
|
2139
|
+
interface SemanticMetricResult {
|
|
2140
|
+
metricName: string;
|
|
2141
|
+
displayName: string;
|
|
2142
|
+
dataType: string;
|
|
2143
|
+
format: string;
|
|
2144
|
+
polarity: string;
|
|
2145
|
+
columns: string[];
|
|
2146
|
+
rows: Array<Record<string, unknown>>;
|
|
2147
|
+
rowCount: number;
|
|
2148
|
+
executionTimeMs: number;
|
|
2149
|
+
aiHints: SemanticMetricAiHints;
|
|
2150
|
+
}
|
|
2151
|
+
/**
|
|
2152
|
+
* Response from semantic metrics query
|
|
2153
|
+
*/
|
|
2154
|
+
interface SemanticMetricsQueryResponse {
|
|
2155
|
+
/** Data source ID that was queried */
|
|
2156
|
+
datasourceId: string | number;
|
|
2157
|
+
/** Data source name */
|
|
2158
|
+
datasourceName?: string;
|
|
2159
|
+
/** Query results for each metric */
|
|
2160
|
+
results: SemanticMetricResult[];
|
|
2161
|
+
/** Total execution time in ms */
|
|
2162
|
+
totalExecutionTimeMs?: number;
|
|
2163
|
+
}
|
|
2164
|
+
/**
|
|
2165
|
+
* Request body for executing custom SQL query
|
|
2166
|
+
*/
|
|
2167
|
+
interface ExecuteSqlQueryRequest {
|
|
2168
|
+
/** Data source ID to query */
|
|
2169
|
+
datasourceId: string | number;
|
|
2170
|
+
/** Custom SQL query string with named parameters (e.g., :year, :category) */
|
|
2171
|
+
customSql: string;
|
|
2172
|
+
/** Optional parameters for the SQL query */
|
|
2173
|
+
params?: Record<string, string | number | boolean>;
|
|
2174
|
+
/** Optional result limit */
|
|
2175
|
+
limit?: number;
|
|
2176
|
+
}
|
|
2177
|
+
/**
|
|
2178
|
+
* Response from custom SQL query execution
|
|
2179
|
+
*/
|
|
2180
|
+
interface ExecuteSqlQueryResponse {
|
|
2181
|
+
/** Data source ID that was queried */
|
|
2182
|
+
datasourceId: string | number;
|
|
2183
|
+
/** Data source name */
|
|
2184
|
+
datasourceName?: string;
|
|
2185
|
+
/** Column names */
|
|
2186
|
+
columns: string[];
|
|
2187
|
+
/** Query result rows */
|
|
2188
|
+
rows: Array<Record<string, unknown>>;
|
|
2189
|
+
/** Total row count */
|
|
2190
|
+
rowCount: number;
|
|
2191
|
+
/** Execution time in milliseconds */
|
|
2192
|
+
executionTimeMs: number;
|
|
2193
|
+
/** The actual executed SQL (for debugging) */
|
|
2194
|
+
executedSql?: string;
|
|
2195
|
+
}
|
|
2196
|
+
/**
|
|
2197
|
+
* MetricsServerConfigStore interface
|
|
2198
|
+
* Provides CRUD operations for metrics server configuration data
|
|
2199
|
+
*/
|
|
2200
|
+
interface MetricsServerConfigStore {
|
|
2201
|
+
/**
|
|
2202
|
+
* Get all metrics server configurations for a tenant
|
|
2203
|
+
* @param tenantId - Tenant identifier
|
|
2204
|
+
* @returns Array of all metrics server configurations
|
|
2205
|
+
*/
|
|
2206
|
+
getAllConfigs(tenantId: string): Promise<MetricsServerConfigEntry[]>;
|
|
2207
|
+
/**
|
|
2208
|
+
* Get all metrics server configurations across all tenants
|
|
2209
|
+
* @returns Array of all metrics server configurations
|
|
2210
|
+
*/
|
|
2211
|
+
getAllConfigsWithoutTenant(): Promise<MetricsServerConfigEntry[]>;
|
|
2212
|
+
/**
|
|
2213
|
+
* Get metrics server configuration by ID
|
|
2214
|
+
* @param tenantId - Tenant identifier
|
|
2215
|
+
* @param id - Configuration identifier
|
|
2216
|
+
* @returns Configuration if found, null otherwise
|
|
2217
|
+
*/
|
|
2218
|
+
getConfigById(tenantId: string, id: string): Promise<MetricsServerConfigEntry | null>;
|
|
2219
|
+
/**
|
|
2220
|
+
* Get metrics server configuration by business key
|
|
2221
|
+
* @param tenantId - Tenant identifier
|
|
2222
|
+
* @param key - Business key
|
|
2223
|
+
* @returns Configuration if found, null otherwise
|
|
2224
|
+
*/
|
|
2225
|
+
getConfigByKey(tenantId: string, key: string): Promise<MetricsServerConfigEntry | null>;
|
|
2226
|
+
/**
|
|
2227
|
+
* Create a new metrics server configuration
|
|
2228
|
+
* @param tenantId - Tenant identifier
|
|
2229
|
+
* @param id - Configuration identifier
|
|
2230
|
+
* @param data - Configuration creation data
|
|
2231
|
+
* @returns Created configuration
|
|
2232
|
+
*/
|
|
2233
|
+
createConfig(tenantId: string, id: string, data: CreateMetricsServerConfigRequest): Promise<MetricsServerConfigEntry>;
|
|
2234
|
+
/**
|
|
2235
|
+
* Update an existing metrics server configuration
|
|
2236
|
+
* @param tenantId - Tenant identifier
|
|
2237
|
+
* @param id - Configuration identifier
|
|
2238
|
+
* @param updates - Partial configuration data to update
|
|
2239
|
+
* @returns Updated configuration if found, null otherwise
|
|
2240
|
+
*/
|
|
2241
|
+
updateConfig(tenantId: string, id: string, updates: Partial<UpdateMetricsServerConfigRequest>): Promise<MetricsServerConfigEntry | null>;
|
|
2242
|
+
/**
|
|
2243
|
+
* Delete a metrics server configuration by ID
|
|
2244
|
+
* @param tenantId - Tenant identifier
|
|
2245
|
+
* @param id - Configuration identifier
|
|
2246
|
+
* @returns true if deleted, false otherwise
|
|
2247
|
+
*/
|
|
2248
|
+
deleteConfig(tenantId: string, id: string): Promise<boolean>;
|
|
2249
|
+
/**
|
|
2250
|
+
* Check if configuration exists
|
|
2251
|
+
* @param tenantId - Tenant identifier
|
|
2252
|
+
* @param id - Configuration identifier
|
|
2253
|
+
* @returns true if configuration exists, false otherwise
|
|
2254
|
+
*/
|
|
2255
|
+
hasConfig(tenantId: string, id: string): Promise<boolean>;
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
type UserStatus = 'active' | 'pending' | 'suspended';
|
|
2259
|
+
interface User {
|
|
2260
|
+
id: string;
|
|
2261
|
+
email: string;
|
|
2262
|
+
name: string;
|
|
2263
|
+
status: UserStatus;
|
|
2264
|
+
metadata?: Record<string, any>;
|
|
2265
|
+
createdAt: Date;
|
|
2266
|
+
updatedAt: Date;
|
|
2267
|
+
}
|
|
2268
|
+
interface CreateUserRequest {
|
|
2269
|
+
email: string;
|
|
2270
|
+
name: string;
|
|
2271
|
+
status?: UserStatus;
|
|
2272
|
+
metadata?: Record<string, any>;
|
|
2273
|
+
}
|
|
2274
|
+
interface UpdateUserRequest {
|
|
2275
|
+
email?: string;
|
|
2276
|
+
name?: string;
|
|
2277
|
+
status?: UserStatus;
|
|
2278
|
+
metadata?: Record<string, any>;
|
|
2279
|
+
}
|
|
2280
|
+
interface UserStore {
|
|
2281
|
+
getAllUsers(): Promise<User[]>;
|
|
2282
|
+
getUserById(id: string): Promise<User | null>;
|
|
2283
|
+
getUserByEmail(email: string): Promise<User | null>;
|
|
2284
|
+
createUser(id: string, data: CreateUserRequest): Promise<User>;
|
|
2285
|
+
updateUser(id: string, updates: UpdateUserRequest): Promise<User | null>;
|
|
2286
|
+
deleteUser(id: string): Promise<boolean>;
|
|
2287
|
+
}
|
|
2288
|
+
|
|
2289
|
+
/**
|
|
2290
|
+
* UserTenantLinkProtocol
|
|
2291
|
+
*
|
|
2292
|
+
* User-Tenant relationship store protocol
|
|
2293
|
+
* Supports many-to-many relationship between users and tenants
|
|
2294
|
+
*/
|
|
2295
|
+
/**
|
|
2296
|
+
* User role in tenant
|
|
2297
|
+
*/
|
|
2298
|
+
type UserTenantRole = 'owner' | 'admin' | 'member';
|
|
2299
|
+
/**
|
|
2300
|
+
* User-Tenant link type definition
|
|
2301
|
+
*/
|
|
2302
|
+
interface UserTenantLink {
|
|
2303
|
+
userId: string;
|
|
2304
|
+
tenantId: string;
|
|
2305
|
+
role: UserTenantRole;
|
|
2306
|
+
joinedAt: Date;
|
|
2307
|
+
metadata?: Record<string, any>;
|
|
2308
|
+
}
|
|
2309
|
+
/**
|
|
2310
|
+
* Create user-tenant link request
|
|
2311
|
+
*/
|
|
2312
|
+
interface CreateUserTenantLinkRequest {
|
|
2313
|
+
userId: string;
|
|
2314
|
+
tenantId: string;
|
|
2315
|
+
role?: UserTenantRole;
|
|
2316
|
+
metadata?: Record<string, any>;
|
|
2317
|
+
}
|
|
2318
|
+
/**
|
|
2319
|
+
* Update user-tenant link request
|
|
2320
|
+
*/
|
|
2321
|
+
interface UpdateUserTenantLinkRequest {
|
|
2322
|
+
role?: UserTenantRole;
|
|
2323
|
+
metadata?: Record<string, any>;
|
|
2324
|
+
}
|
|
2325
|
+
/**
|
|
2326
|
+
* UserTenantLinkStore interface
|
|
2327
|
+
* Manages many-to-many relationship between users and tenants
|
|
2328
|
+
*/
|
|
2329
|
+
interface UserTenantLinkStore {
|
|
2330
|
+
/**
|
|
2331
|
+
* Get all tenants for a user
|
|
2332
|
+
*/
|
|
2333
|
+
getTenantsByUser(userId: string): Promise<UserTenantLink[]>;
|
|
2334
|
+
/**
|
|
2335
|
+
* Get all users for a tenant
|
|
2336
|
+
*/
|
|
2337
|
+
getUsersByTenant(tenantId: string): Promise<UserTenantLink[]>;
|
|
2338
|
+
/**
|
|
2339
|
+
* Get specific link
|
|
2340
|
+
*/
|
|
2341
|
+
getLink(userId: string, tenantId: string): Promise<UserTenantLink | null>;
|
|
2342
|
+
/**
|
|
2343
|
+
* Create link between user and tenant
|
|
2344
|
+
*/
|
|
2345
|
+
createLink(data: CreateUserTenantLinkRequest): Promise<UserTenantLink>;
|
|
2346
|
+
/**
|
|
2347
|
+
* Update link
|
|
2348
|
+
*/
|
|
2349
|
+
updateLink(userId: string, tenantId: string, updates: UpdateUserTenantLinkRequest): Promise<UserTenantLink | null>;
|
|
2350
|
+
/**
|
|
2351
|
+
* Delete link
|
|
2352
|
+
*/
|
|
2353
|
+
deleteLink(userId: string, tenantId: string): Promise<boolean>;
|
|
2354
|
+
/**
|
|
2355
|
+
* Check if user belongs to tenant
|
|
2356
|
+
*/
|
|
2357
|
+
hasLink(userId: string, tenantId: string): Promise<boolean>;
|
|
2358
|
+
}
|
|
2359
|
+
|
|
1826
2360
|
/**
|
|
1827
2361
|
* 通用类型定义
|
|
1828
2362
|
*
|
|
@@ -1886,4 +2420,4 @@ type Timestamp = number;
|
|
|
1886
2420
|
*/
|
|
1887
2421
|
type Callback<T = any, R = void> = (data: T) => R | Promise<R>;
|
|
1888
2422
|
|
|
1889
|
-
export { type AgentClient, type AgentConfig, type AgentConfigWithTools, type AgentLatticeProtocol, type AgentMiddlewareConfig, type AgentRunConfig, AgentType, type Assistant, type AssistantMessage, type AssistantStore, type AvailableModule, type BaseLatticeProtocol, type BaseMessage, type BrowserMiddlewareConfig, type Callback, type CodeEvalMiddlewareConfig, type CreateAssistantRequest, type CreateDatabaseConfigRequest, type CreateProjectRequest, type CreateSkillRequest, type CreateThreadRequest, type CreateWorkspaceRequest, type DatabaseConfig, type DatabaseConfigEntry, type DatabaseConfigStore, type DatabaseType, type DeepAgentConfig, type DeveloperMessage, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type FilterCondition, type GraphBuildOptions, type ID, type InterruptMessage, type LLMConfig, type LatticeError, type LatticeEventBus, type LatticeMessage, type LoggerClient, type LoggerConfig, type LoggerContext, type LoggerLatticeProtocol, LoggerType, type McpClient, type McpClientOptions, type McpConnectionStatus, type McpLatticeMessage, type McpLatticeProtocol, McpMessageType, type McpServerConfig, type McpStats, type McpTool, type McpToolResult, type McpTransportType, type MemoryClient, type MemoryConfig, type MemoryLatticeProtocol, MemoryType, type Message, type MessageChunk, type MiddlewareType, type ModelLatticeProtocol, type PaginatedResult, type PaginationParams, type PinoFileOptions, type Project, type ProjectStore, type QueryParams, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type ReactAgentConfig, type Result, type SandboxMiddlewareConfig, type ScheduleClient, type ScheduleConfig, type ScheduleCronOptions, ScheduleExecutionType, type ScheduleLatticeProtocol, type ScheduleOnceOptions, type ScheduleStorage, ScheduleType, type ScheduledTaskDefinition, ScheduledTaskStatus, type Skill, type SkillClient, type SkillClientType, type SkillConfig, type SkillLatticeProtocol, type SkillStore, type SqlMiddlewareConfig, type StorageType, type SystemMessage, type TaskHandler, type TeamAgentConfig, type TeamTeammateConfig, type Thread, type ThreadStore, type Timestamp, type ToolCall, type ToolConfig, type ToolExecutor, type ToolLatticeProtocol, type ToolMessage, type UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UpdateDatabaseConfigRequest, type UpdateProjectRequest, type UpdateWorkspaceRequest, type UserMessage, type VectorStoreConfig, type VectorStoreLatticeProtocol, type Workspace, type WorkspaceStore, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isDeepAgentConfig, isTeamAgentConfig };
|
|
2423
|
+
export { type AgentClient, type AgentConfig, type AgentConfigWithTools, type AgentLatticeProtocol, type AgentMiddlewareConfig, type AgentRunConfig, AgentType, type Assistant, type AssistantMessage, type AssistantStore, type AvailableModule, type BaseLatticeProtocol, type BaseMessage, type BrowserMiddlewareConfig, type Callback, type CodeEvalMiddlewareConfig, type CreateAssistantRequest, type CreateDatabaseConfigRequest, type CreateMetricsServerConfigRequest, type CreateProjectRequest, type CreateSkillRequest, type CreateTenantRequest, type CreateThreadRequest, type CreateUserRequest, type CreateUserTenantLinkRequest, type CreateWorkspaceRequest, type DataSource, type DatabaseConfig, type DatabaseConfigEntry, type DatabaseConfigStore, type DatabaseType, type DeepAgentConfig, type DeveloperMessage, type EmbeddingsConfig, type EmbeddingsLatticeProtocol, type ExecuteSqlQueryRequest, type ExecuteSqlQueryResponse, type FilterCondition, type GraphBuildOptions, type ID, type InterruptMessage, type LLMConfig, type LatticeError, type LatticeEventBus, type LatticeMessage, type LoggerClient, type LoggerConfig, type LoggerContext, type LoggerLatticeProtocol, LoggerType, type McpClient, type McpClientOptions, type McpConnectionStatus, type McpLatticeMessage, type McpLatticeProtocol, McpMessageType, type McpServerConfig, type McpStats, type McpTool, type McpToolResult, type McpTransportType, type MemoryClient, type MemoryConfig, type MemoryLatticeProtocol, MemoryType, type Message, type MessageChunk, type MetricDataPoint, type MetricMeta, type MetricQueryResult, type MetricsMiddlewareConfig, type MetricsServerConfig, type MetricsServerConfigEntry, type MetricsServerConfigStore, type MetricsServerType, type MiddlewareType, type ModelLatticeProtocol, type PaginatedResult, type PaginationParams, type PinoFileOptions, type Project, type ProjectStore, type QueryParams, type QueueClient, type QueueConfig, type QueueLatticeProtocol, type QueueResult, QueueType, type ReactAgentConfig, type Result, type SandboxMiddlewareConfig, type ScheduleClient, type ScheduleConfig, type ScheduleCronOptions, ScheduleExecutionType, type ScheduleLatticeProtocol, type ScheduleOnceOptions, type ScheduleStorage, ScheduleType, type ScheduledTaskDefinition, ScheduledTaskStatus, type SemanticMetricAiHints, type SemanticMetricDataPoint, type SemanticMetricResult, type SemanticMetricsFilter, type SemanticMetricsQueryRequest, type SemanticMetricsQueryResponse, type SemanticMetricsServerConfig, type Skill, type SkillClient, type SkillClientType, type SkillConfig, type SkillLatticeProtocol, type SkillStore, type SqlMiddlewareConfig, type StorageType, type SystemMessage, type TaskHandler, type TeamAgentConfig, type TeamTeammateConfig, type Tenant, type TenantStatus, type TenantStore, type Thread, type ThreadStore, type Timestamp, type ToolCall, type ToolConfig, type ToolExecutor, type ToolLatticeProtocol, type ToolMessage, type UIComponent, UIComponentType, type UIConfig, type UILatticeProtocol, type UpdateDatabaseConfigRequest, type UpdateMetricsServerConfigRequest, type UpdateProjectRequest, type UpdateTenantRequest, type UpdateUserRequest, type UpdateUserTenantLinkRequest, type UpdateWorkspaceRequest, type User, type UserMessage, type UserStatus, type UserStore, type UserTenantLink, type UserTenantLinkStore, type UserTenantRole, type VectorStoreConfig, type VectorStoreLatticeProtocol, type Workspace, type WorkspaceStore, getSubAgentsFromConfig, getToolsFromConfig, hasTools, isDeepAgentConfig, isTeamAgentConfig };
|