@axiom-lattice/protocols 7.1.0 → 7.3.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 +179 -0
- package/dist/index.d.mts +740 -8
- package/dist/index.d.ts +740 -8
- package/dist/index.js +184 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +161 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/AuthProviderProtocol.ts +80 -0
- package/src/InviteLinkStoreProtocol.ts +59 -0
- package/src/McpLatticeProtocol.ts +2 -2
- package/src/McpServerConfigStoreProtocol.ts +118 -0
- package/src/ModelProviderProtocol.ts +20 -4
- package/src/OidcIdentityClaimStoreProtocol.ts +117 -0
- package/src/OidcProviderConfigStoreProtocol.ts +84 -0
- package/src/PlatformAuditProtocol.ts +80 -0
- package/src/PlatformInvitationStoreProtocol.ts +60 -0
- package/src/PlatformMemberStoreProtocol.ts +23 -0
- package/src/PlatformOpsProtocol.ts +73 -0
- package/src/PlatformSettingsProtocol.ts +161 -0
- package/src/SandboxPluginProtocol.ts +1 -1
- package/src/UserExternalIdentityStoreProtocol.ts +53 -0
- package/src/__tests__/AuthProviderProtocol.test.ts +20 -0
- package/src/index.ts +10 -0
package/dist/index.mjs
CHANGED
|
@@ -138,10 +138,39 @@ function assertGenericProjectConfig(config) {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
+
// src/McpServerConfigStoreProtocol.ts
|
|
142
|
+
function isPersonalMcpServerConfigStore(store) {
|
|
143
|
+
const candidate = store;
|
|
144
|
+
return typeof candidate.getAllConfigsForAssistant === "function" && typeof candidate.getAllPersonalConfigsWithoutTenant === "function" && typeof candidate.getConfigByIdForAssistant === "function" && typeof candidate.getConfigByKeyForAssistant === "function" && typeof candidate.createConfigForAssistant === "function" && typeof candidate.updateConfigForAssistant === "function" && typeof candidate.deleteConfigForAssistant === "function" && typeof candidate.deleteConfigsForAssistant === "function" && typeof candidate.hasConfigForAssistant === "function";
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// src/PlatformOpsProtocol.ts
|
|
148
|
+
var PLATFORM_TENANT_ID = "__platform__";
|
|
149
|
+
var PLATFORM_OPS_AGENT_ID = "platform-ops";
|
|
150
|
+
var PLATFORM_TENANT_PROTECTED_ERROR = "PLATFORM_TENANT_PROTECTED";
|
|
151
|
+
function isPlatformTenantId(tenantId) {
|
|
152
|
+
return tenantId === PLATFORM_TENANT_ID;
|
|
153
|
+
}
|
|
154
|
+
var PlatformTenantProtectedError = class extends Error {
|
|
155
|
+
constructor(message = "The hidden platform tenant is protected") {
|
|
156
|
+
super(message);
|
|
157
|
+
this.code = PLATFORM_TENANT_PROTECTED_ERROR;
|
|
158
|
+
this.name = "PlatformTenantProtectedError";
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
function assertNotPlatformTenant(tenantId) {
|
|
162
|
+
if (isPlatformTenantId(tenantId)) {
|
|
163
|
+
throw new PlatformTenantProtectedError();
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
var PLATFORM_OPS_WORKSPACE_ID = "platform-ops";
|
|
167
|
+
var PLATFORM_OPS_PROJECT_ID = "platform-ops";
|
|
168
|
+
|
|
141
169
|
// src/ModelProviderProtocol.ts
|
|
142
170
|
var DEFAULT_MODEL_KEY = "default";
|
|
143
171
|
var EMBEDDING_DEFAULT_KEY = "default:embedding";
|
|
144
172
|
var ASR_DEFAULT_KEY = "default:asr";
|
|
173
|
+
var PLATFORM_MODEL_TENANT_ID = PLATFORM_TENANT_ID;
|
|
145
174
|
function toModelKey(providerId, modelId) {
|
|
146
175
|
return `${providerId}/${modelId}`;
|
|
147
176
|
}
|
|
@@ -156,6 +185,40 @@ function parseModelKey(modelKey) {
|
|
|
156
185
|
};
|
|
157
186
|
}
|
|
158
187
|
|
|
188
|
+
// src/AuthProviderProtocol.ts
|
|
189
|
+
var AuthError = class extends Error {
|
|
190
|
+
constructor(code, status, message) {
|
|
191
|
+
super(message);
|
|
192
|
+
this.code = code;
|
|
193
|
+
this.status = status;
|
|
194
|
+
this.name = "AuthError";
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
// src/UserExternalIdentityStoreProtocol.ts
|
|
199
|
+
var ExternalIdentityConflictError = class extends Error {
|
|
200
|
+
constructor(providerId, issuer, subject) {
|
|
201
|
+
super(
|
|
202
|
+
`External identity ${providerId}/${issuer}/${subject} is already linked to another user`
|
|
203
|
+
);
|
|
204
|
+
this.providerId = providerId;
|
|
205
|
+
this.issuer = issuer;
|
|
206
|
+
this.subject = subject;
|
|
207
|
+
this.code = "EXTERNAL_IDENTITY_CONFLICT";
|
|
208
|
+
this.name = "ExternalIdentityConflictError";
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
var ExternalIdentityPersistError = class extends Error {
|
|
212
|
+
constructor(providerId, issuer, subject) {
|
|
213
|
+
super(`Failed to persist external identity ${providerId}/${issuer}/${subject}`);
|
|
214
|
+
this.providerId = providerId;
|
|
215
|
+
this.issuer = issuer;
|
|
216
|
+
this.subject = subject;
|
|
217
|
+
this.code = "EXTERNAL_IDENTITY_PERSIST_FAILED";
|
|
218
|
+
this.name = "ExternalIdentityPersistError";
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
|
|
159
222
|
// src/BindingProtocol.ts
|
|
160
223
|
var DuplicateChannelBindingSubjectError = class extends Error {
|
|
161
224
|
constructor() {
|
|
@@ -574,6 +637,43 @@ function isRecord2(value) {
|
|
|
574
637
|
var PROJECT_ROOM_TASK_DELEGATED_LABEL = "Task delegated";
|
|
575
638
|
var PROJECT_ROOM_TASK_DELEGATED_SEPARATOR = " \xB7 ";
|
|
576
639
|
|
|
640
|
+
// src/OidcProviderConfigStoreProtocol.ts
|
|
641
|
+
function normalizeAllowedPrivateHosts(values) {
|
|
642
|
+
return [...new Set(values.map((value) => value.trim().toLowerCase()))];
|
|
643
|
+
}
|
|
644
|
+
var OidcProviderConfigConflictError = class extends Error {
|
|
645
|
+
constructor(id) {
|
|
646
|
+
super(`OIDC provider config "${id}" already exists`);
|
|
647
|
+
this.id = id;
|
|
648
|
+
this.code = "OIDC_PROVIDER_CONFIG_CONFLICT";
|
|
649
|
+
this.name = "OidcProviderConfigConflictError";
|
|
650
|
+
}
|
|
651
|
+
};
|
|
652
|
+
|
|
653
|
+
// src/PlatformInvitationStoreProtocol.ts
|
|
654
|
+
function normalizePlatformInvitationEmail(email) {
|
|
655
|
+
return email.trim().toLowerCase();
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
// src/OidcIdentityClaimStoreProtocol.ts
|
|
659
|
+
var OidcIdentityClaimConflictError = class extends Error {
|
|
660
|
+
constructor(providerId, issuer, subject) {
|
|
661
|
+
super("A pending SSO identity claim already exists for this subject");
|
|
662
|
+
this.providerId = providerId;
|
|
663
|
+
this.issuer = issuer;
|
|
664
|
+
this.subject = subject;
|
|
665
|
+
this.name = "OidcIdentityClaimConflictError";
|
|
666
|
+
}
|
|
667
|
+
};
|
|
668
|
+
function normalizeOidcIdentityEmail(email) {
|
|
669
|
+
return email.trim().toLowerCase();
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
// src/InviteLinkStoreProtocol.ts
|
|
673
|
+
function normalizeInviteLinkEmail(email) {
|
|
674
|
+
return email.trim().toLowerCase();
|
|
675
|
+
}
|
|
676
|
+
|
|
577
677
|
// src/StoreProtocol.ts
|
|
578
678
|
var STORE_IDENTITY_SEPARATOR = "";
|
|
579
679
|
var StoreValidationError = class extends Error {
|
|
@@ -1143,22 +1243,64 @@ function observabilityDashboardElementKey(provider) {
|
|
|
1143
1243
|
return `${OBSERVABILITY_DASHBOARD_ELEMENT_KEY_PREFIX}${provider}`;
|
|
1144
1244
|
}
|
|
1145
1245
|
var LANGFUSE_OBSERVABILITY_DASHBOARD_VERSION = 3;
|
|
1246
|
+
|
|
1247
|
+
// src/PlatformSettingsProtocol.ts
|
|
1248
|
+
var PlatformSettingsVersionConflictError = class extends Error {
|
|
1249
|
+
constructor(expectedVersion, actualVersion) {
|
|
1250
|
+
super(`Platform settings version conflict at ${expectedVersion}`);
|
|
1251
|
+
this.expectedVersion = expectedVersion;
|
|
1252
|
+
this.actualVersion = actualVersion;
|
|
1253
|
+
this.code = "PLATFORM_SETTINGS_VERSION_CONFLICT";
|
|
1254
|
+
this.name = "PlatformSettingsVersionConflictError";
|
|
1255
|
+
}
|
|
1256
|
+
};
|
|
1257
|
+
var PLATFORM_SETTINGS_DEFAULTS = {
|
|
1258
|
+
auth: { emailCompletionEnabled: false },
|
|
1259
|
+
invite: { defaultExpiresInHours: 168, defaultMaxUses: 1 },
|
|
1260
|
+
rateLimits: {
|
|
1261
|
+
openApiPerMinute: 6e4,
|
|
1262
|
+
openAgentPerMinute: 2e3,
|
|
1263
|
+
a2aJsonRpcPerMinute: 600,
|
|
1264
|
+
a2aJsonRpcIpPerMinute: 300,
|
|
1265
|
+
maxActiveRunTasksPerTenant: null
|
|
1266
|
+
}
|
|
1267
|
+
};
|
|
1268
|
+
var DEFAULT_PLATFORM_BRANDING = {
|
|
1269
|
+
brandName: "AlphaFina"
|
|
1270
|
+
};
|
|
1271
|
+
function normalizeBrandingHost(raw) {
|
|
1272
|
+
let host = raw.trim().toLowerCase();
|
|
1273
|
+
if (host.startsWith("[")) {
|
|
1274
|
+
const end = host.indexOf("]");
|
|
1275
|
+
if (end !== -1) host = host.slice(1, end);
|
|
1276
|
+
} else {
|
|
1277
|
+
const firstColon = host.indexOf(":");
|
|
1278
|
+
if (firstColon !== -1 && host.indexOf(":", firstColon + 1) === -1) {
|
|
1279
|
+
host = host.slice(0, firstColon);
|
|
1280
|
+
}
|
|
1281
|
+
}
|
|
1282
|
+
return host.replace(/\.+$/, "");
|
|
1283
|
+
}
|
|
1146
1284
|
export {
|
|
1147
1285
|
AFFINITY_ECHO_HEADER,
|
|
1148
1286
|
AFFINITY_MISS_CODE,
|
|
1149
1287
|
AGENT_AFFINITY_HEADER,
|
|
1150
1288
|
ASR_DEFAULT_KEY,
|
|
1151
1289
|
AgentType,
|
|
1290
|
+
AuthError,
|
|
1152
1291
|
CHANNEL_REPLY_JOB_LIST_LIMIT_DEFAULT,
|
|
1153
1292
|
CHANNEL_REPLY_JOB_LIST_LIMIT_MAX,
|
|
1154
1293
|
CHANNEL_REPLY_JOB_LIST_LIMIT_MIN,
|
|
1155
1294
|
ChannelBindingMigrationConflictError,
|
|
1156
1295
|
DEFAULT_MODEL_KEY,
|
|
1296
|
+
DEFAULT_PLATFORM_BRANDING,
|
|
1157
1297
|
DuplicateChannelBindingSubjectError,
|
|
1158
1298
|
EMBEDDING_DEFAULT_KEY,
|
|
1159
1299
|
EXECUTION_RESULT_EVENT_KEY_PATTERN,
|
|
1160
1300
|
EXECUTION_RESULT_EVENT_KEY_PATTERN_SOURCE,
|
|
1161
1301
|
EXECUTION_RESULT_EVENT_KEY_PREFIX,
|
|
1302
|
+
ExternalIdentityConflictError,
|
|
1303
|
+
ExternalIdentityPersistError,
|
|
1162
1304
|
InvalidProjectCapabilityBundleConfigError,
|
|
1163
1305
|
LANGFUSE_OBSERVABILITY_DASHBOARD_VERSION,
|
|
1164
1306
|
LoggerType,
|
|
@@ -1167,10 +1309,21 @@ export {
|
|
|
1167
1309
|
MemoryType,
|
|
1168
1310
|
MessageChunkTypes,
|
|
1169
1311
|
OBSERVABILITY_DASHBOARD_ELEMENT_KEY_PREFIX,
|
|
1312
|
+
OidcIdentityClaimConflictError,
|
|
1313
|
+
OidcProviderConfigConflictError,
|
|
1314
|
+
PLATFORM_MODEL_TENANT_ID,
|
|
1315
|
+
PLATFORM_OPS_AGENT_ID,
|
|
1316
|
+
PLATFORM_OPS_PROJECT_ID,
|
|
1317
|
+
PLATFORM_OPS_WORKSPACE_ID,
|
|
1318
|
+
PLATFORM_SETTINGS_DEFAULTS,
|
|
1319
|
+
PLATFORM_TENANT_ID,
|
|
1320
|
+
PLATFORM_TENANT_PROTECTED_ERROR,
|
|
1170
1321
|
PROJECT_ROOM_TASK_DELEGATED_LABEL,
|
|
1171
1322
|
PROJECT_ROOM_TASK_DELEGATED_SEPARATOR,
|
|
1172
1323
|
PROJECT_ROOM_USER_CHANNEL_PROJECT,
|
|
1173
1324
|
PROJECT_TASK_LIFECYCLE_ACTIONS,
|
|
1325
|
+
PlatformSettingsVersionConflictError,
|
|
1326
|
+
PlatformTenantProtectedError,
|
|
1174
1327
|
ProjectRoomBrokerCapacityError,
|
|
1175
1328
|
ProjectRoomCursorError,
|
|
1176
1329
|
ProjectTaskStoreUnsupportedError,
|
|
@@ -1186,6 +1339,7 @@ export {
|
|
|
1186
1339
|
a2aEventCursorSchema,
|
|
1187
1340
|
affinityEchoHeaders,
|
|
1188
1341
|
assertGenericProjectConfig,
|
|
1342
|
+
assertNotPlatformTenant,
|
|
1189
1343
|
assertStoreIdentity,
|
|
1190
1344
|
assertStoreNamespacePrefix,
|
|
1191
1345
|
assertValidCreateChannelReplyJobInput,
|
|
@@ -1202,10 +1356,17 @@ export {
|
|
|
1202
1356
|
isDeepAgentConfig,
|
|
1203
1357
|
isExecutionResultEventKey,
|
|
1204
1358
|
isMcpUiRef,
|
|
1359
|
+
isPersonalMcpServerConfigStore,
|
|
1360
|
+
isPlatformTenantId,
|
|
1205
1361
|
isProjectRoomEventId,
|
|
1206
1362
|
isWorkflowAgentConfig,
|
|
1207
1363
|
isWorkspacePublicRoomProjectId,
|
|
1364
|
+
normalizeAllowedPrivateHosts,
|
|
1365
|
+
normalizeBrandingHost,
|
|
1208
1366
|
normalizeChannelReplyJobListLimit,
|
|
1367
|
+
normalizeInviteLinkEmail,
|
|
1368
|
+
normalizeOidcIdentityEmail,
|
|
1369
|
+
normalizePlatformInvitationEmail,
|
|
1209
1370
|
normalizeTaskMetadataScalar,
|
|
1210
1371
|
observabilityDashboardElementKey,
|
|
1211
1372
|
parseAgentWebAppGenUIBlock,
|