@axiom-lattice/protocols 7.2.0 → 7.4.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 +182 -0
- package/dist/index.d.mts +262 -14
- package/dist/index.d.ts +262 -14
- package/dist/index.js +258 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +240 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/AuthCssContract.ts +45 -0
- package/src/CollectionStoreProtocol.ts +8 -0
- package/src/McpLatticeProtocol.ts +2 -2
- package/src/McpServerConfigStoreProtocol.ts +118 -0
- package/src/McpUiProtocol.ts +2 -0
- package/src/ModelProviderProtocol.ts +20 -4
- package/src/OpenProtocol.ts +2 -2
- package/src/PlatformAuditProtocol.ts +80 -0
- package/src/PlatformBrandingCss.ts +180 -0
- package/src/PlatformOpsProtocol.ts +73 -0
- package/src/PlatformSettingsProtocol.ts +18 -4
- package/src/PluginProtocol.ts +9 -0
- package/src/SandboxResourceProtocol.ts +1 -1
- package/src/__tests__/PlatformBrandingCss.test.ts +103 -0
- package/src/index.ts +4 -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
|
}
|
|
@@ -205,6 +234,9 @@ var ChannelBindingMigrationConflictError = class extends Error {
|
|
|
205
234
|
}
|
|
206
235
|
};
|
|
207
236
|
|
|
237
|
+
// src/CollectionStoreProtocol.ts
|
|
238
|
+
var COLLECTION_ENTRY_BATCH_MAX = 50;
|
|
239
|
+
|
|
208
240
|
// src/TaskStoreProtocol.ts
|
|
209
241
|
function normalizeTaskMetadataScalar(value) {
|
|
210
242
|
if (typeof value === "string") return value;
|
|
@@ -1237,7 +1269,10 @@ var PLATFORM_SETTINGS_DEFAULTS = {
|
|
|
1237
1269
|
}
|
|
1238
1270
|
};
|
|
1239
1271
|
var DEFAULT_PLATFORM_BRANDING = {
|
|
1240
|
-
brandName: "AlphaFina"
|
|
1272
|
+
brandName: "AlphaFina",
|
|
1273
|
+
logoUrl: "/logo.png",
|
|
1274
|
+
primaryColor: "#5b50c6",
|
|
1275
|
+
backgroundColor: "#ffffff"
|
|
1241
1276
|
};
|
|
1242
1277
|
function normalizeBrandingHost(raw) {
|
|
1243
1278
|
let host = raw.trim().toLowerCase();
|
|
@@ -1252,16 +1287,205 @@ function normalizeBrandingHost(raw) {
|
|
|
1252
1287
|
}
|
|
1253
1288
|
return host.replace(/\.+$/, "");
|
|
1254
1289
|
}
|
|
1290
|
+
|
|
1291
|
+
// src/PlatformBrandingCss.ts
|
|
1292
|
+
var MAX_CUSTOM_CSS_LENGTH = 65536;
|
|
1293
|
+
var IDENTIFIER_CHAR = /[A-Za-z0-9_-]/;
|
|
1294
|
+
function skipQuoted(css, start) {
|
|
1295
|
+
const quote = css[start];
|
|
1296
|
+
let index = start + 1;
|
|
1297
|
+
while (index < css.length) {
|
|
1298
|
+
if (css[index] === "\\") {
|
|
1299
|
+
index += 2;
|
|
1300
|
+
continue;
|
|
1301
|
+
}
|
|
1302
|
+
if (css[index] === quote) return index + 1;
|
|
1303
|
+
index += 1;
|
|
1304
|
+
}
|
|
1305
|
+
return css.length;
|
|
1306
|
+
}
|
|
1307
|
+
function decodeCssEscapeAt(css, index) {
|
|
1308
|
+
let cursor = index + 1;
|
|
1309
|
+
if (cursor >= css.length) return { value: "", next: cursor };
|
|
1310
|
+
const escaped = css[cursor];
|
|
1311
|
+
if (escaped === "\n" || escaped === "\f" || escaped === "\r") {
|
|
1312
|
+
if (escaped === "\r" && css[cursor + 1] === "\n") cursor += 1;
|
|
1313
|
+
return { value: "", next: cursor + 1 };
|
|
1314
|
+
}
|
|
1315
|
+
const hex = /^[0-9a-fA-F]{1,6}/.exec(css.slice(cursor));
|
|
1316
|
+
if (hex) {
|
|
1317
|
+
cursor += hex[0].length;
|
|
1318
|
+
if (cursor < css.length && /\s/.test(css[cursor])) {
|
|
1319
|
+
if (css[cursor] === "\r" && css[cursor + 1] === "\n") cursor += 1;
|
|
1320
|
+
cursor += 1;
|
|
1321
|
+
}
|
|
1322
|
+
const codePoint = Number.parseInt(hex[0], 16);
|
|
1323
|
+
if (codePoint === 0 || codePoint > 1114111 || codePoint >= 55296 && codePoint <= 57343) {
|
|
1324
|
+
return { value: "\uFFFD", next: cursor };
|
|
1325
|
+
}
|
|
1326
|
+
return { value: String.fromCodePoint(codePoint), next: cursor };
|
|
1327
|
+
}
|
|
1328
|
+
return { value: escaped, next: cursor + 1 };
|
|
1329
|
+
}
|
|
1330
|
+
function readDecodedIdentifier(css, start) {
|
|
1331
|
+
let value = "";
|
|
1332
|
+
let index = start;
|
|
1333
|
+
let consumed = false;
|
|
1334
|
+
while (index < css.length) {
|
|
1335
|
+
const current = css[index];
|
|
1336
|
+
if (current === "\\") {
|
|
1337
|
+
const decoded = decodeCssEscapeAt(css, index);
|
|
1338
|
+
value += decoded.value;
|
|
1339
|
+
index = decoded.next;
|
|
1340
|
+
consumed = true;
|
|
1341
|
+
continue;
|
|
1342
|
+
}
|
|
1343
|
+
if (!IDENTIFIER_CHAR.test(current) && current.charCodeAt(0) < 128) break;
|
|
1344
|
+
value += current;
|
|
1345
|
+
index += 1;
|
|
1346
|
+
consumed = true;
|
|
1347
|
+
}
|
|
1348
|
+
return consumed ? { value, next: index } : null;
|
|
1349
|
+
}
|
|
1350
|
+
function matchUrlToken(css, start) {
|
|
1351
|
+
if (start > 0 && IDENTIFIER_CHAR.test(css[start - 1])) return null;
|
|
1352
|
+
const identifier = readDecodedIdentifier(css, start);
|
|
1353
|
+
if (!identifier || identifier.value.toLowerCase() !== "url") return null;
|
|
1354
|
+
let index = identifier.next;
|
|
1355
|
+
while (index < css.length && /\s/.test(css[index])) index += 1;
|
|
1356
|
+
if (css[index] !== "(") return null;
|
|
1357
|
+
return index + 1;
|
|
1358
|
+
}
|
|
1359
|
+
function skipUrlContents(css, start) {
|
|
1360
|
+
let index = start;
|
|
1361
|
+
while (index < css.length && /\s/.test(css[index])) index += 1;
|
|
1362
|
+
if (css[index] === '"' || css[index] === "'") {
|
|
1363
|
+
index = skipQuoted(css, index);
|
|
1364
|
+
while (index < css.length && /\s/.test(css[index])) index += 1;
|
|
1365
|
+
if (css[index] !== ")") return null;
|
|
1366
|
+
return index + 1;
|
|
1367
|
+
}
|
|
1368
|
+
const end = css.indexOf(")", index);
|
|
1369
|
+
return end === -1 ? null : end + 1;
|
|
1370
|
+
}
|
|
1371
|
+
function stripCssForImportScan(css) {
|
|
1372
|
+
let out = "";
|
|
1373
|
+
let index = 0;
|
|
1374
|
+
while (index < css.length) {
|
|
1375
|
+
const current = css[index];
|
|
1376
|
+
const next = css[index + 1];
|
|
1377
|
+
if (current === "/" && next === "*") {
|
|
1378
|
+
const end = css.indexOf("*/", index + 2);
|
|
1379
|
+
index = end === -1 ? css.length : end + 2;
|
|
1380
|
+
out += " ";
|
|
1381
|
+
continue;
|
|
1382
|
+
}
|
|
1383
|
+
if (current === '"' || current === "'") {
|
|
1384
|
+
index = skipQuoted(css, index);
|
|
1385
|
+
continue;
|
|
1386
|
+
}
|
|
1387
|
+
const urlContentStart = matchUrlToken(css, index);
|
|
1388
|
+
if (urlContentStart !== null) {
|
|
1389
|
+
const urlEnd = skipUrlContents(css, urlContentStart);
|
|
1390
|
+
if (urlEnd !== null) {
|
|
1391
|
+
index = urlEnd;
|
|
1392
|
+
out += "url()";
|
|
1393
|
+
continue;
|
|
1394
|
+
}
|
|
1395
|
+
}
|
|
1396
|
+
out += current;
|
|
1397
|
+
index += 1;
|
|
1398
|
+
}
|
|
1399
|
+
return out;
|
|
1400
|
+
}
|
|
1401
|
+
function decodeCssEscapes(css) {
|
|
1402
|
+
let out = "";
|
|
1403
|
+
let index = 0;
|
|
1404
|
+
while (index < css.length) {
|
|
1405
|
+
const current = css[index];
|
|
1406
|
+
if (current !== "\\") {
|
|
1407
|
+
out += current;
|
|
1408
|
+
index += 1;
|
|
1409
|
+
continue;
|
|
1410
|
+
}
|
|
1411
|
+
const decoded = decodeCssEscapeAt(css, index);
|
|
1412
|
+
out += decoded.value;
|
|
1413
|
+
index = decoded.next;
|
|
1414
|
+
}
|
|
1415
|
+
return out;
|
|
1416
|
+
}
|
|
1417
|
+
function hasCssImport(css) {
|
|
1418
|
+
const stripped = stripCssForImportScan(css);
|
|
1419
|
+
return /@import\b/i.test(decodeCssEscapes(stripped));
|
|
1420
|
+
}
|
|
1421
|
+
function hasStyleBreakout(css) {
|
|
1422
|
+
return /<\/style/i.test(css);
|
|
1423
|
+
}
|
|
1424
|
+
function validateCustomCss(value) {
|
|
1425
|
+
if (typeof value !== "string" || value.length > MAX_CUSTOM_CSS_LENGTH) {
|
|
1426
|
+
return { ok: false, reason: "length" };
|
|
1427
|
+
}
|
|
1428
|
+
if (hasCssImport(value)) return { ok: false, reason: "import" };
|
|
1429
|
+
if (hasStyleBreakout(value)) return { ok: false, reason: "breakout" };
|
|
1430
|
+
return { ok: true };
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
// src/AuthCssContract.ts
|
|
1434
|
+
var AUTH_CSS_CONTRACT_PARTS = [
|
|
1435
|
+
"page",
|
|
1436
|
+
"card",
|
|
1437
|
+
"header",
|
|
1438
|
+
"logo",
|
|
1439
|
+
"logo-image",
|
|
1440
|
+
"title",
|
|
1441
|
+
"subtitle",
|
|
1442
|
+
"form",
|
|
1443
|
+
"field",
|
|
1444
|
+
"input",
|
|
1445
|
+
"submit",
|
|
1446
|
+
"sso",
|
|
1447
|
+
"sso-button",
|
|
1448
|
+
"alert",
|
|
1449
|
+
"footer",
|
|
1450
|
+
"link",
|
|
1451
|
+
"cancel",
|
|
1452
|
+
"tenant-list",
|
|
1453
|
+
"tenant-card",
|
|
1454
|
+
"tenant-search",
|
|
1455
|
+
"tenant-footer",
|
|
1456
|
+
"invite-notice"
|
|
1457
|
+
];
|
|
1458
|
+
var AUTH_CSS_CONTRACT_VARIABLES = [
|
|
1459
|
+
"--axiom-auth-primary",
|
|
1460
|
+
"--axiom-auth-primary-hover",
|
|
1461
|
+
"--axiom-auth-primary-active",
|
|
1462
|
+
"--axiom-auth-bg",
|
|
1463
|
+
"--axiom-auth-surface",
|
|
1464
|
+
"--axiom-auth-text",
|
|
1465
|
+
"--axiom-auth-text-secondary",
|
|
1466
|
+
"--axiom-auth-border",
|
|
1467
|
+
"--axiom-auth-radius",
|
|
1468
|
+
"--axiom-auth-page-padding",
|
|
1469
|
+
"--axiom-auth-card-width",
|
|
1470
|
+
"--axiom-auth-card-padding",
|
|
1471
|
+
"--axiom-auth-card-shadow",
|
|
1472
|
+
"--axiom-auth-card-shadow-hover",
|
|
1473
|
+
"--axiom-auth-logo-size",
|
|
1474
|
+
"--axiom-auth-input-height"
|
|
1475
|
+
];
|
|
1255
1476
|
export {
|
|
1256
1477
|
AFFINITY_ECHO_HEADER,
|
|
1257
1478
|
AFFINITY_MISS_CODE,
|
|
1258
1479
|
AGENT_AFFINITY_HEADER,
|
|
1259
1480
|
ASR_DEFAULT_KEY,
|
|
1481
|
+
AUTH_CSS_CONTRACT_PARTS,
|
|
1482
|
+
AUTH_CSS_CONTRACT_VARIABLES,
|
|
1260
1483
|
AgentType,
|
|
1261
1484
|
AuthError,
|
|
1262
1485
|
CHANNEL_REPLY_JOB_LIST_LIMIT_DEFAULT,
|
|
1263
1486
|
CHANNEL_REPLY_JOB_LIST_LIMIT_MAX,
|
|
1264
1487
|
CHANNEL_REPLY_JOB_LIST_LIMIT_MIN,
|
|
1488
|
+
COLLECTION_ENTRY_BATCH_MAX,
|
|
1265
1489
|
ChannelBindingMigrationConflictError,
|
|
1266
1490
|
DEFAULT_MODEL_KEY,
|
|
1267
1491
|
DEFAULT_PLATFORM_BRANDING,
|
|
@@ -1275,6 +1499,7 @@ export {
|
|
|
1275
1499
|
InvalidProjectCapabilityBundleConfigError,
|
|
1276
1500
|
LANGFUSE_OBSERVABILITY_DASHBOARD_VERSION,
|
|
1277
1501
|
LoggerType,
|
|
1502
|
+
MAX_CUSTOM_CSS_LENGTH,
|
|
1278
1503
|
MAX_PENDING_EXECUTION_RESULTS_LIMIT,
|
|
1279
1504
|
McpMessageType,
|
|
1280
1505
|
MemoryType,
|
|
@@ -1282,12 +1507,19 @@ export {
|
|
|
1282
1507
|
OBSERVABILITY_DASHBOARD_ELEMENT_KEY_PREFIX,
|
|
1283
1508
|
OidcIdentityClaimConflictError,
|
|
1284
1509
|
OidcProviderConfigConflictError,
|
|
1510
|
+
PLATFORM_MODEL_TENANT_ID,
|
|
1511
|
+
PLATFORM_OPS_AGENT_ID,
|
|
1512
|
+
PLATFORM_OPS_PROJECT_ID,
|
|
1513
|
+
PLATFORM_OPS_WORKSPACE_ID,
|
|
1285
1514
|
PLATFORM_SETTINGS_DEFAULTS,
|
|
1515
|
+
PLATFORM_TENANT_ID,
|
|
1516
|
+
PLATFORM_TENANT_PROTECTED_ERROR,
|
|
1286
1517
|
PROJECT_ROOM_TASK_DELEGATED_LABEL,
|
|
1287
1518
|
PROJECT_ROOM_TASK_DELEGATED_SEPARATOR,
|
|
1288
1519
|
PROJECT_ROOM_USER_CHANNEL_PROJECT,
|
|
1289
1520
|
PROJECT_TASK_LIFECYCLE_ACTIONS,
|
|
1290
1521
|
PlatformSettingsVersionConflictError,
|
|
1522
|
+
PlatformTenantProtectedError,
|
|
1291
1523
|
ProjectRoomBrokerCapacityError,
|
|
1292
1524
|
ProjectRoomCursorError,
|
|
1293
1525
|
ProjectTaskStoreUnsupportedError,
|
|
@@ -1303,6 +1535,7 @@ export {
|
|
|
1303
1535
|
a2aEventCursorSchema,
|
|
1304
1536
|
affinityEchoHeaders,
|
|
1305
1537
|
assertGenericProjectConfig,
|
|
1538
|
+
assertNotPlatformTenant,
|
|
1306
1539
|
assertStoreIdentity,
|
|
1307
1540
|
assertStoreNamespacePrefix,
|
|
1308
1541
|
assertValidCreateChannelReplyJobInput,
|
|
@@ -1313,12 +1546,16 @@ export {
|
|
|
1313
1546
|
firstNonEmptyString,
|
|
1314
1547
|
getSubAgentsFromConfig,
|
|
1315
1548
|
getToolsFromConfig,
|
|
1549
|
+
hasCssImport,
|
|
1550
|
+
hasStyleBreakout,
|
|
1316
1551
|
hasTools,
|
|
1317
1552
|
interruptAnswerKeySchema,
|
|
1318
1553
|
isA2ARemoteAgentConfig,
|
|
1319
1554
|
isDeepAgentConfig,
|
|
1320
1555
|
isExecutionResultEventKey,
|
|
1321
1556
|
isMcpUiRef,
|
|
1557
|
+
isPersonalMcpServerConfigStore,
|
|
1558
|
+
isPlatformTenantId,
|
|
1322
1559
|
isProjectRoomEventId,
|
|
1323
1560
|
isWorkflowAgentConfig,
|
|
1324
1561
|
isWorkspacePublicRoomProjectId,
|
|
@@ -1355,6 +1592,7 @@ export {
|
|
|
1355
1592
|
toModelKey,
|
|
1356
1593
|
toProjectRoomPublicBotMembership,
|
|
1357
1594
|
toProjectRoomPublicMembership,
|
|
1358
|
-
toProjectRoomPublicMessage
|
|
1595
|
+
toProjectRoomPublicMessage,
|
|
1596
|
+
validateCustomCss
|
|
1359
1597
|
};
|
|
1360
1598
|
//# sourceMappingURL=index.mjs.map
|