@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/dist/index.js CHANGED
@@ -24,11 +24,14 @@ __export(index_exports, {
24
24
  AFFINITY_MISS_CODE: () => AFFINITY_MISS_CODE,
25
25
  AGENT_AFFINITY_HEADER: () => AGENT_AFFINITY_HEADER,
26
26
  ASR_DEFAULT_KEY: () => ASR_DEFAULT_KEY,
27
+ AUTH_CSS_CONTRACT_PARTS: () => AUTH_CSS_CONTRACT_PARTS,
28
+ AUTH_CSS_CONTRACT_VARIABLES: () => AUTH_CSS_CONTRACT_VARIABLES,
27
29
  AgentType: () => AgentType,
28
30
  AuthError: () => AuthError,
29
31
  CHANNEL_REPLY_JOB_LIST_LIMIT_DEFAULT: () => CHANNEL_REPLY_JOB_LIST_LIMIT_DEFAULT,
30
32
  CHANNEL_REPLY_JOB_LIST_LIMIT_MAX: () => CHANNEL_REPLY_JOB_LIST_LIMIT_MAX,
31
33
  CHANNEL_REPLY_JOB_LIST_LIMIT_MIN: () => CHANNEL_REPLY_JOB_LIST_LIMIT_MIN,
34
+ COLLECTION_ENTRY_BATCH_MAX: () => COLLECTION_ENTRY_BATCH_MAX,
32
35
  ChannelBindingMigrationConflictError: () => ChannelBindingMigrationConflictError,
33
36
  DEFAULT_MODEL_KEY: () => DEFAULT_MODEL_KEY,
34
37
  DEFAULT_PLATFORM_BRANDING: () => DEFAULT_PLATFORM_BRANDING,
@@ -42,6 +45,7 @@ __export(index_exports, {
42
45
  InvalidProjectCapabilityBundleConfigError: () => InvalidProjectCapabilityBundleConfigError,
43
46
  LANGFUSE_OBSERVABILITY_DASHBOARD_VERSION: () => LANGFUSE_OBSERVABILITY_DASHBOARD_VERSION,
44
47
  LoggerType: () => LoggerType,
48
+ MAX_CUSTOM_CSS_LENGTH: () => MAX_CUSTOM_CSS_LENGTH,
45
49
  MAX_PENDING_EXECUTION_RESULTS_LIMIT: () => MAX_PENDING_EXECUTION_RESULTS_LIMIT,
46
50
  McpMessageType: () => McpMessageType,
47
51
  MemoryType: () => MemoryType,
@@ -49,12 +53,19 @@ __export(index_exports, {
49
53
  OBSERVABILITY_DASHBOARD_ELEMENT_KEY_PREFIX: () => OBSERVABILITY_DASHBOARD_ELEMENT_KEY_PREFIX,
50
54
  OidcIdentityClaimConflictError: () => OidcIdentityClaimConflictError,
51
55
  OidcProviderConfigConflictError: () => OidcProviderConfigConflictError,
56
+ PLATFORM_MODEL_TENANT_ID: () => PLATFORM_MODEL_TENANT_ID,
57
+ PLATFORM_OPS_AGENT_ID: () => PLATFORM_OPS_AGENT_ID,
58
+ PLATFORM_OPS_PROJECT_ID: () => PLATFORM_OPS_PROJECT_ID,
59
+ PLATFORM_OPS_WORKSPACE_ID: () => PLATFORM_OPS_WORKSPACE_ID,
52
60
  PLATFORM_SETTINGS_DEFAULTS: () => PLATFORM_SETTINGS_DEFAULTS,
61
+ PLATFORM_TENANT_ID: () => PLATFORM_TENANT_ID,
62
+ PLATFORM_TENANT_PROTECTED_ERROR: () => PLATFORM_TENANT_PROTECTED_ERROR,
53
63
  PROJECT_ROOM_TASK_DELEGATED_LABEL: () => PROJECT_ROOM_TASK_DELEGATED_LABEL,
54
64
  PROJECT_ROOM_TASK_DELEGATED_SEPARATOR: () => PROJECT_ROOM_TASK_DELEGATED_SEPARATOR,
55
65
  PROJECT_ROOM_USER_CHANNEL_PROJECT: () => PROJECT_ROOM_USER_CHANNEL_PROJECT,
56
66
  PROJECT_TASK_LIFECYCLE_ACTIONS: () => PROJECT_TASK_LIFECYCLE_ACTIONS,
57
67
  PlatformSettingsVersionConflictError: () => PlatformSettingsVersionConflictError,
68
+ PlatformTenantProtectedError: () => PlatformTenantProtectedError,
58
69
  ProjectRoomBrokerCapacityError: () => ProjectRoomBrokerCapacityError,
59
70
  ProjectRoomCursorError: () => ProjectRoomCursorError,
60
71
  ProjectTaskStoreUnsupportedError: () => ProjectTaskStoreUnsupportedError,
@@ -70,6 +81,7 @@ __export(index_exports, {
70
81
  a2aEventCursorSchema: () => a2aEventCursorSchema,
71
82
  affinityEchoHeaders: () => affinityEchoHeaders,
72
83
  assertGenericProjectConfig: () => assertGenericProjectConfig,
84
+ assertNotPlatformTenant: () => assertNotPlatformTenant,
73
85
  assertStoreIdentity: () => assertStoreIdentity,
74
86
  assertStoreNamespacePrefix: () => assertStoreNamespacePrefix,
75
87
  assertValidCreateChannelReplyJobInput: () => assertValidCreateChannelReplyJobInput,
@@ -80,12 +92,16 @@ __export(index_exports, {
80
92
  firstNonEmptyString: () => firstNonEmptyString,
81
93
  getSubAgentsFromConfig: () => getSubAgentsFromConfig,
82
94
  getToolsFromConfig: () => getToolsFromConfig,
95
+ hasCssImport: () => hasCssImport,
96
+ hasStyleBreakout: () => hasStyleBreakout,
83
97
  hasTools: () => hasTools,
84
98
  interruptAnswerKeySchema: () => interruptAnswerKeySchema,
85
99
  isA2ARemoteAgentConfig: () => isA2ARemoteAgentConfig,
86
100
  isDeepAgentConfig: () => isDeepAgentConfig,
87
101
  isExecutionResultEventKey: () => isExecutionResultEventKey,
88
102
  isMcpUiRef: () => isMcpUiRef,
103
+ isPersonalMcpServerConfigStore: () => isPersonalMcpServerConfigStore,
104
+ isPlatformTenantId: () => isPlatformTenantId,
89
105
  isProjectRoomEventId: () => isProjectRoomEventId,
90
106
  isWorkflowAgentConfig: () => isWorkflowAgentConfig,
91
107
  isWorkspacePublicRoomProjectId: () => isWorkspacePublicRoomProjectId,
@@ -122,7 +138,8 @@ __export(index_exports, {
122
138
  toModelKey: () => toModelKey,
123
139
  toProjectRoomPublicBotMembership: () => toProjectRoomPublicBotMembership,
124
140
  toProjectRoomPublicMembership: () => toProjectRoomPublicMembership,
125
- toProjectRoomPublicMessage: () => toProjectRoomPublicMessage
141
+ toProjectRoomPublicMessage: () => toProjectRoomPublicMessage,
142
+ validateCustomCss: () => validateCustomCss
126
143
  });
127
144
  module.exports = __toCommonJS(index_exports);
128
145
 
@@ -266,10 +283,39 @@ function assertGenericProjectConfig(config) {
266
283
  }
267
284
  }
268
285
 
286
+ // src/McpServerConfigStoreProtocol.ts
287
+ function isPersonalMcpServerConfigStore(store) {
288
+ const candidate = store;
289
+ 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";
290
+ }
291
+
292
+ // src/PlatformOpsProtocol.ts
293
+ var PLATFORM_TENANT_ID = "__platform__";
294
+ var PLATFORM_OPS_AGENT_ID = "platform-ops";
295
+ var PLATFORM_TENANT_PROTECTED_ERROR = "PLATFORM_TENANT_PROTECTED";
296
+ function isPlatformTenantId(tenantId) {
297
+ return tenantId === PLATFORM_TENANT_ID;
298
+ }
299
+ var PlatformTenantProtectedError = class extends Error {
300
+ constructor(message = "The hidden platform tenant is protected") {
301
+ super(message);
302
+ this.code = PLATFORM_TENANT_PROTECTED_ERROR;
303
+ this.name = "PlatformTenantProtectedError";
304
+ }
305
+ };
306
+ function assertNotPlatformTenant(tenantId) {
307
+ if (isPlatformTenantId(tenantId)) {
308
+ throw new PlatformTenantProtectedError();
309
+ }
310
+ }
311
+ var PLATFORM_OPS_WORKSPACE_ID = "platform-ops";
312
+ var PLATFORM_OPS_PROJECT_ID = "platform-ops";
313
+
269
314
  // src/ModelProviderProtocol.ts
270
315
  var DEFAULT_MODEL_KEY = "default";
271
316
  var EMBEDDING_DEFAULT_KEY = "default:embedding";
272
317
  var ASR_DEFAULT_KEY = "default:asr";
318
+ var PLATFORM_MODEL_TENANT_ID = PLATFORM_TENANT_ID;
273
319
  function toModelKey(providerId, modelId) {
274
320
  return `${providerId}/${modelId}`;
275
321
  }
@@ -333,6 +379,9 @@ var ChannelBindingMigrationConflictError = class extends Error {
333
379
  }
334
380
  };
335
381
 
382
+ // src/CollectionStoreProtocol.ts
383
+ var COLLECTION_ENTRY_BATCH_MAX = 50;
384
+
336
385
  // src/TaskStoreProtocol.ts
337
386
  function normalizeTaskMetadataScalar(value) {
338
387
  if (typeof value === "string") return value;
@@ -1365,7 +1414,10 @@ var PLATFORM_SETTINGS_DEFAULTS = {
1365
1414
  }
1366
1415
  };
1367
1416
  var DEFAULT_PLATFORM_BRANDING = {
1368
- brandName: "AlphaFina"
1417
+ brandName: "AlphaFina",
1418
+ logoUrl: "/logo.png",
1419
+ primaryColor: "#5b50c6",
1420
+ backgroundColor: "#ffffff"
1369
1421
  };
1370
1422
  function normalizeBrandingHost(raw) {
1371
1423
  let host = raw.trim().toLowerCase();
@@ -1380,17 +1432,206 @@ function normalizeBrandingHost(raw) {
1380
1432
  }
1381
1433
  return host.replace(/\.+$/, "");
1382
1434
  }
1435
+
1436
+ // src/PlatformBrandingCss.ts
1437
+ var MAX_CUSTOM_CSS_LENGTH = 65536;
1438
+ var IDENTIFIER_CHAR = /[A-Za-z0-9_-]/;
1439
+ function skipQuoted(css, start) {
1440
+ const quote = css[start];
1441
+ let index = start + 1;
1442
+ while (index < css.length) {
1443
+ if (css[index] === "\\") {
1444
+ index += 2;
1445
+ continue;
1446
+ }
1447
+ if (css[index] === quote) return index + 1;
1448
+ index += 1;
1449
+ }
1450
+ return css.length;
1451
+ }
1452
+ function decodeCssEscapeAt(css, index) {
1453
+ let cursor = index + 1;
1454
+ if (cursor >= css.length) return { value: "", next: cursor };
1455
+ const escaped = css[cursor];
1456
+ if (escaped === "\n" || escaped === "\f" || escaped === "\r") {
1457
+ if (escaped === "\r" && css[cursor + 1] === "\n") cursor += 1;
1458
+ return { value: "", next: cursor + 1 };
1459
+ }
1460
+ const hex = /^[0-9a-fA-F]{1,6}/.exec(css.slice(cursor));
1461
+ if (hex) {
1462
+ cursor += hex[0].length;
1463
+ if (cursor < css.length && /\s/.test(css[cursor])) {
1464
+ if (css[cursor] === "\r" && css[cursor + 1] === "\n") cursor += 1;
1465
+ cursor += 1;
1466
+ }
1467
+ const codePoint = Number.parseInt(hex[0], 16);
1468
+ if (codePoint === 0 || codePoint > 1114111 || codePoint >= 55296 && codePoint <= 57343) {
1469
+ return { value: "\uFFFD", next: cursor };
1470
+ }
1471
+ return { value: String.fromCodePoint(codePoint), next: cursor };
1472
+ }
1473
+ return { value: escaped, next: cursor + 1 };
1474
+ }
1475
+ function readDecodedIdentifier(css, start) {
1476
+ let value = "";
1477
+ let index = start;
1478
+ let consumed = false;
1479
+ while (index < css.length) {
1480
+ const current = css[index];
1481
+ if (current === "\\") {
1482
+ const decoded = decodeCssEscapeAt(css, index);
1483
+ value += decoded.value;
1484
+ index = decoded.next;
1485
+ consumed = true;
1486
+ continue;
1487
+ }
1488
+ if (!IDENTIFIER_CHAR.test(current) && current.charCodeAt(0) < 128) break;
1489
+ value += current;
1490
+ index += 1;
1491
+ consumed = true;
1492
+ }
1493
+ return consumed ? { value, next: index } : null;
1494
+ }
1495
+ function matchUrlToken(css, start) {
1496
+ if (start > 0 && IDENTIFIER_CHAR.test(css[start - 1])) return null;
1497
+ const identifier = readDecodedIdentifier(css, start);
1498
+ if (!identifier || identifier.value.toLowerCase() !== "url") return null;
1499
+ let index = identifier.next;
1500
+ while (index < css.length && /\s/.test(css[index])) index += 1;
1501
+ if (css[index] !== "(") return null;
1502
+ return index + 1;
1503
+ }
1504
+ function skipUrlContents(css, start) {
1505
+ let index = start;
1506
+ while (index < css.length && /\s/.test(css[index])) index += 1;
1507
+ if (css[index] === '"' || css[index] === "'") {
1508
+ index = skipQuoted(css, index);
1509
+ while (index < css.length && /\s/.test(css[index])) index += 1;
1510
+ if (css[index] !== ")") return null;
1511
+ return index + 1;
1512
+ }
1513
+ const end = css.indexOf(")", index);
1514
+ return end === -1 ? null : end + 1;
1515
+ }
1516
+ function stripCssForImportScan(css) {
1517
+ let out = "";
1518
+ let index = 0;
1519
+ while (index < css.length) {
1520
+ const current = css[index];
1521
+ const next = css[index + 1];
1522
+ if (current === "/" && next === "*") {
1523
+ const end = css.indexOf("*/", index + 2);
1524
+ index = end === -1 ? css.length : end + 2;
1525
+ out += " ";
1526
+ continue;
1527
+ }
1528
+ if (current === '"' || current === "'") {
1529
+ index = skipQuoted(css, index);
1530
+ continue;
1531
+ }
1532
+ const urlContentStart = matchUrlToken(css, index);
1533
+ if (urlContentStart !== null) {
1534
+ const urlEnd = skipUrlContents(css, urlContentStart);
1535
+ if (urlEnd !== null) {
1536
+ index = urlEnd;
1537
+ out += "url()";
1538
+ continue;
1539
+ }
1540
+ }
1541
+ out += current;
1542
+ index += 1;
1543
+ }
1544
+ return out;
1545
+ }
1546
+ function decodeCssEscapes(css) {
1547
+ let out = "";
1548
+ let index = 0;
1549
+ while (index < css.length) {
1550
+ const current = css[index];
1551
+ if (current !== "\\") {
1552
+ out += current;
1553
+ index += 1;
1554
+ continue;
1555
+ }
1556
+ const decoded = decodeCssEscapeAt(css, index);
1557
+ out += decoded.value;
1558
+ index = decoded.next;
1559
+ }
1560
+ return out;
1561
+ }
1562
+ function hasCssImport(css) {
1563
+ const stripped = stripCssForImportScan(css);
1564
+ return /@import\b/i.test(decodeCssEscapes(stripped));
1565
+ }
1566
+ function hasStyleBreakout(css) {
1567
+ return /<\/style/i.test(css);
1568
+ }
1569
+ function validateCustomCss(value) {
1570
+ if (typeof value !== "string" || value.length > MAX_CUSTOM_CSS_LENGTH) {
1571
+ return { ok: false, reason: "length" };
1572
+ }
1573
+ if (hasCssImport(value)) return { ok: false, reason: "import" };
1574
+ if (hasStyleBreakout(value)) return { ok: false, reason: "breakout" };
1575
+ return { ok: true };
1576
+ }
1577
+
1578
+ // src/AuthCssContract.ts
1579
+ var AUTH_CSS_CONTRACT_PARTS = [
1580
+ "page",
1581
+ "card",
1582
+ "header",
1583
+ "logo",
1584
+ "logo-image",
1585
+ "title",
1586
+ "subtitle",
1587
+ "form",
1588
+ "field",
1589
+ "input",
1590
+ "submit",
1591
+ "sso",
1592
+ "sso-button",
1593
+ "alert",
1594
+ "footer",
1595
+ "link",
1596
+ "cancel",
1597
+ "tenant-list",
1598
+ "tenant-card",
1599
+ "tenant-search",
1600
+ "tenant-footer",
1601
+ "invite-notice"
1602
+ ];
1603
+ var AUTH_CSS_CONTRACT_VARIABLES = [
1604
+ "--axiom-auth-primary",
1605
+ "--axiom-auth-primary-hover",
1606
+ "--axiom-auth-primary-active",
1607
+ "--axiom-auth-bg",
1608
+ "--axiom-auth-surface",
1609
+ "--axiom-auth-text",
1610
+ "--axiom-auth-text-secondary",
1611
+ "--axiom-auth-border",
1612
+ "--axiom-auth-radius",
1613
+ "--axiom-auth-page-padding",
1614
+ "--axiom-auth-card-width",
1615
+ "--axiom-auth-card-padding",
1616
+ "--axiom-auth-card-shadow",
1617
+ "--axiom-auth-card-shadow-hover",
1618
+ "--axiom-auth-logo-size",
1619
+ "--axiom-auth-input-height"
1620
+ ];
1383
1621
  // Annotate the CommonJS export names for ESM import in node:
1384
1622
  0 && (module.exports = {
1385
1623
  AFFINITY_ECHO_HEADER,
1386
1624
  AFFINITY_MISS_CODE,
1387
1625
  AGENT_AFFINITY_HEADER,
1388
1626
  ASR_DEFAULT_KEY,
1627
+ AUTH_CSS_CONTRACT_PARTS,
1628
+ AUTH_CSS_CONTRACT_VARIABLES,
1389
1629
  AgentType,
1390
1630
  AuthError,
1391
1631
  CHANNEL_REPLY_JOB_LIST_LIMIT_DEFAULT,
1392
1632
  CHANNEL_REPLY_JOB_LIST_LIMIT_MAX,
1393
1633
  CHANNEL_REPLY_JOB_LIST_LIMIT_MIN,
1634
+ COLLECTION_ENTRY_BATCH_MAX,
1394
1635
  ChannelBindingMigrationConflictError,
1395
1636
  DEFAULT_MODEL_KEY,
1396
1637
  DEFAULT_PLATFORM_BRANDING,
@@ -1404,6 +1645,7 @@ function normalizeBrandingHost(raw) {
1404
1645
  InvalidProjectCapabilityBundleConfigError,
1405
1646
  LANGFUSE_OBSERVABILITY_DASHBOARD_VERSION,
1406
1647
  LoggerType,
1648
+ MAX_CUSTOM_CSS_LENGTH,
1407
1649
  MAX_PENDING_EXECUTION_RESULTS_LIMIT,
1408
1650
  McpMessageType,
1409
1651
  MemoryType,
@@ -1411,12 +1653,19 @@ function normalizeBrandingHost(raw) {
1411
1653
  OBSERVABILITY_DASHBOARD_ELEMENT_KEY_PREFIX,
1412
1654
  OidcIdentityClaimConflictError,
1413
1655
  OidcProviderConfigConflictError,
1656
+ PLATFORM_MODEL_TENANT_ID,
1657
+ PLATFORM_OPS_AGENT_ID,
1658
+ PLATFORM_OPS_PROJECT_ID,
1659
+ PLATFORM_OPS_WORKSPACE_ID,
1414
1660
  PLATFORM_SETTINGS_DEFAULTS,
1661
+ PLATFORM_TENANT_ID,
1662
+ PLATFORM_TENANT_PROTECTED_ERROR,
1415
1663
  PROJECT_ROOM_TASK_DELEGATED_LABEL,
1416
1664
  PROJECT_ROOM_TASK_DELEGATED_SEPARATOR,
1417
1665
  PROJECT_ROOM_USER_CHANNEL_PROJECT,
1418
1666
  PROJECT_TASK_LIFECYCLE_ACTIONS,
1419
1667
  PlatformSettingsVersionConflictError,
1668
+ PlatformTenantProtectedError,
1420
1669
  ProjectRoomBrokerCapacityError,
1421
1670
  ProjectRoomCursorError,
1422
1671
  ProjectTaskStoreUnsupportedError,
@@ -1432,6 +1681,7 @@ function normalizeBrandingHost(raw) {
1432
1681
  a2aEventCursorSchema,
1433
1682
  affinityEchoHeaders,
1434
1683
  assertGenericProjectConfig,
1684
+ assertNotPlatformTenant,
1435
1685
  assertStoreIdentity,
1436
1686
  assertStoreNamespacePrefix,
1437
1687
  assertValidCreateChannelReplyJobInput,
@@ -1442,12 +1692,16 @@ function normalizeBrandingHost(raw) {
1442
1692
  firstNonEmptyString,
1443
1693
  getSubAgentsFromConfig,
1444
1694
  getToolsFromConfig,
1695
+ hasCssImport,
1696
+ hasStyleBreakout,
1445
1697
  hasTools,
1446
1698
  interruptAnswerKeySchema,
1447
1699
  isA2ARemoteAgentConfig,
1448
1700
  isDeepAgentConfig,
1449
1701
  isExecutionResultEventKey,
1450
1702
  isMcpUiRef,
1703
+ isPersonalMcpServerConfigStore,
1704
+ isPlatformTenantId,
1451
1705
  isProjectRoomEventId,
1452
1706
  isWorkflowAgentConfig,
1453
1707
  isWorkspacePublicRoomProjectId,
@@ -1484,6 +1738,7 @@ function normalizeBrandingHost(raw) {
1484
1738
  toModelKey,
1485
1739
  toProjectRoomPublicBotMembership,
1486
1740
  toProjectRoomPublicMembership,
1487
- toProjectRoomPublicMessage
1741
+ toProjectRoomPublicMessage,
1742
+ validateCustomCss
1488
1743
  });
1489
1744
  //# sourceMappingURL=index.js.map