@elevasis/ui 2.60.0 → 2.61.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.
Files changed (49) hide show
  1. package/dist/api/index.js +3 -3
  2. package/dist/app/index.d.ts +6 -5
  3. package/dist/app/index.js +3 -3
  4. package/dist/auth/index.js +3 -3
  5. package/dist/charts/index.js +3 -3
  6. package/dist/{chunk-XOPLS4S6.js → chunk-774JOHIM.js} +60 -20
  7. package/dist/{chunk-7Q5THR43.js → chunk-DRQA53N4.js} +1 -1
  8. package/dist/{chunk-4N5GYO6R.js → chunk-WFX6ERBL.js} +231 -166
  9. package/dist/{chunk-4UA62IDF.js → chunk-YM6LMYOE.js} +1 -1
  10. package/dist/components/index.d.ts +128 -17
  11. package/dist/components/index.js +3 -3
  12. package/dist/components/navigation/index.js +3 -3
  13. package/dist/features/auth/index.js +4 -4
  14. package/dist/features/clients/index.js +3 -3
  15. package/dist/features/crm/index.js +3 -3
  16. package/dist/features/dashboard/index.d.ts +6 -5
  17. package/dist/features/dashboard/index.js +3 -3
  18. package/dist/features/delivery/index.js +3 -3
  19. package/dist/features/knowledge/index.js +3 -3
  20. package/dist/features/lead-gen/index.d.ts +189 -18
  21. package/dist/features/lead-gen/index.js +3 -3
  22. package/dist/features/monitoring/index.js +3 -3
  23. package/dist/features/monitoring/requests/index.js +4 -4
  24. package/dist/features/operations/index.d.ts +6 -5
  25. package/dist/features/operations/index.js +3 -3
  26. package/dist/features/public-agent-chat/index.js +29 -8
  27. package/dist/features/settings/index.js +3 -3
  28. package/dist/hooks/access/index.js +3 -3
  29. package/dist/hooks/delivery/index.js +3 -3
  30. package/dist/hooks/index.d.ts +13 -15
  31. package/dist/hooks/index.js +3 -3
  32. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +6 -5
  33. package/dist/hooks/published.d.ts +13 -15
  34. package/dist/hooks/published.js +3 -3
  35. package/dist/index.d.ts +188 -28
  36. package/dist/index.js +4 -4
  37. package/dist/knowledge/index.d.ts +6 -5
  38. package/dist/knowledge/index.js +4 -4
  39. package/dist/layout/index.js +3 -3
  40. package/dist/organization/index.js +3 -3
  41. package/dist/provider/index.d.ts +59 -6
  42. package/dist/provider/index.js +3 -3
  43. package/dist/provider/published.d.ts +6 -5
  44. package/dist/provider/published.js +3 -3
  45. package/dist/test-utils/index.js +3 -3
  46. package/dist/types/index.d.ts +6 -5
  47. package/dist/utils/index.d.ts +6 -5
  48. package/dist/utils/index.js +1 -1
  49. package/package.json +4 -4
package/dist/api/index.js CHANGED
@@ -1,7 +1,7 @@
1
- export { createElevasisQueryClient } from '../chunk-4UA62IDF.js';
2
- export { ApiClientProvider, useApiClient, useApiClientContext } from '../chunk-7Q5THR43.js';
1
+ export { createElevasisQueryClient } from '../chunk-YM6LMYOE.js';
2
+ export { ApiClientProvider, useApiClient, useApiClientContext } from '../chunk-DRQA53N4.js';
3
3
  import '../chunk-DD3CCMCZ.js';
4
- import '../chunk-XOPLS4S6.js';
4
+ import '../chunk-774JOHIM.js';
5
5
  import '../chunk-FVOMKZ7S.js';
6
6
  import '../chunk-KRWALB24.js';
7
7
  import '../chunk-TVTSASST.js';
@@ -3503,12 +3503,13 @@ declare const SystemApiInterfaceSchema: z$1.ZodObject<{
3503
3503
  archived: "archived";
3504
3504
  disabled: "disabled";
3505
3505
  }>>;
3506
- readinessProfile: z$1.ZodOptional<z$1.ZodEnum<{
3507
- "sales.lead-gen.api": "sales.lead-gen.api";
3508
- "sales.crm.api": "sales.crm.api";
3509
- "sales.lead-gen.crm-handoff": "sales.lead-gen.crm-handoff";
3510
- }>>;
3506
+ readinessProfile: z$1.ZodOptional<z$1.ZodString>;
3511
3507
  resourceIds: z$1.ZodOptional<z$1.ZodDefault<z$1.ZodArray<z$1.ZodString>>>;
3508
+ readinessContract: z$1.ZodOptional<z$1.ZodObject<{
3509
+ requiredObjects: z$1.ZodDefault<z$1.ZodArray<z$1.ZodString>>;
3510
+ requiredCatalogs: z$1.ZodDefault<z$1.ZodArray<z$1.ZodString>>;
3511
+ requiredKinds: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
3512
+ }, z$1.core.$strict>>;
3512
3513
  }, z$1.core.$strict>;
3513
3514
  type JsonPrimitive = string | number | boolean | null;
3514
3515
  type JsonValue = JsonPrimitive | JsonValue[] | {
package/dist/app/index.js CHANGED
@@ -1,11 +1,11 @@
1
- import { useSessionCheck, AppErrorBoundary, SidebarProvider, ElevasisSystemsProvider, useElevasisSystems, AppShellContainer, Sidebar, AppShellRightSideContainer, AppShellRightSideOuterContainer, SystemShell, ElevasisUIProvider } from '../chunk-4N5GYO6R.js';
1
+ import { useSessionCheck, AppErrorBoundary, SidebarProvider, ElevasisSystemsProvider, useElevasisSystems, AppShellContainer, Sidebar, AppShellRightSideContainer, AppShellRightSideOuterContainer, SystemShell, ElevasisUIProvider } from '../chunk-WFX6ERBL.js';
2
2
  import '../chunk-NZ2F5RQ4.js';
3
3
  import '../chunk-OJJK27GC.js';
4
4
  import '../chunk-ZTWA5H77.js';
5
5
  import '../chunk-AUDNF2Q7.js';
6
6
  import '../chunk-6M6OLGQY.js';
7
7
  import '../chunk-MKH2KOAO.js';
8
- import '../chunk-7Q5THR43.js';
8
+ import '../chunk-DRQA53N4.js';
9
9
  import '../chunk-T4LA4RY2.js';
10
10
  import '../chunk-GMXGDO3I.js';
11
11
  import '../chunk-S3XR4II4.js';
@@ -19,7 +19,7 @@ import '../chunk-HENXLGVD.js';
19
19
  import '../chunk-I3CFGE3N.js';
20
20
  import '../chunk-RNP5R5I3.js';
21
21
  import '../chunk-EIXSQONC.js';
22
- import { listAllSystems } from '../chunk-XOPLS4S6.js';
22
+ import { listAllSystems } from '../chunk-774JOHIM.js';
23
23
  import '../chunk-FVOMKZ7S.js';
24
24
  import '../chunk-KRWALB24.js';
25
25
  import '../chunk-BI5VDO2K.js';
@@ -1,11 +1,11 @@
1
- export { AccessGuard, AccessKeys, ProtectedRoute, useSessionCheck as useRefocusSessionCheck, useSessionCheck, useStableAccessToken } from '../chunk-4N5GYO6R.js';
1
+ export { AccessGuard, AccessKeys, ProtectedRoute, useSessionCheck as useRefocusSessionCheck, useSessionCheck, useStableAccessToken } from '../chunk-WFX6ERBL.js';
2
2
  import '../chunk-NZ2F5RQ4.js';
3
3
  import '../chunk-OJJK27GC.js';
4
4
  import '../chunk-ZTWA5H77.js';
5
5
  import '../chunk-AUDNF2Q7.js';
6
6
  import '../chunk-6M6OLGQY.js';
7
7
  import '../chunk-MKH2KOAO.js';
8
- import '../chunk-7Q5THR43.js';
8
+ import '../chunk-DRQA53N4.js';
9
9
  import '../chunk-T4LA4RY2.js';
10
10
  import '../chunk-GMXGDO3I.js';
11
11
  import '../chunk-S3XR4II4.js';
@@ -19,7 +19,7 @@ import '../chunk-HENXLGVD.js';
19
19
  import '../chunk-I3CFGE3N.js';
20
20
  import '../chunk-RNP5R5I3.js';
21
21
  import '../chunk-EIXSQONC.js';
22
- import '../chunk-XOPLS4S6.js';
22
+ import '../chunk-774JOHIM.js';
23
23
  import '../chunk-FVOMKZ7S.js';
24
24
  import '../chunk-KRWALB24.js';
25
25
  import '../chunk-BI5VDO2K.js';
@@ -1,11 +1,11 @@
1
- export { ActivityTrendChart, ChartFrame, CombinedTrendChart, CostTrendChart, CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, HeroStatsRow, getSeriesColor, useCyberColors } from '../chunk-4N5GYO6R.js';
1
+ export { ActivityTrendChart, ChartFrame, CombinedTrendChart, CostTrendChart, CyberAreaChart, CyberDonut, CyberDonutTooltip, CyberLegendItem, HeroStatsRow, getSeriesColor, useCyberColors } from '../chunk-WFX6ERBL.js';
2
2
  import '../chunk-NZ2F5RQ4.js';
3
3
  import '../chunk-OJJK27GC.js';
4
4
  import '../chunk-ZTWA5H77.js';
5
5
  import '../chunk-AUDNF2Q7.js';
6
6
  import '../chunk-6M6OLGQY.js';
7
7
  import '../chunk-MKH2KOAO.js';
8
- import '../chunk-7Q5THR43.js';
8
+ import '../chunk-DRQA53N4.js';
9
9
  import '../chunk-T4LA4RY2.js';
10
10
  import '../chunk-GMXGDO3I.js';
11
11
  import '../chunk-S3XR4II4.js';
@@ -19,7 +19,7 @@ import '../chunk-HENXLGVD.js';
19
19
  import '../chunk-I3CFGE3N.js';
20
20
  import '../chunk-RNP5R5I3.js';
21
21
  import '../chunk-EIXSQONC.js';
22
- import '../chunk-XOPLS4S6.js';
22
+ import '../chunk-774JOHIM.js';
23
23
  import '../chunk-FVOMKZ7S.js';
24
24
  import '../chunk-KRWALB24.js';
25
25
  import '../chunk-BI5VDO2K.js';
@@ -880,17 +880,48 @@ var SYSTEM_INTERFACE_PROFILES = [
880
880
  var SYSTEM_INTERFACE_READINESS_PROFILES = SYSTEM_INTERFACE_PROFILES.map(
881
881
  (profile) => profile.readinessProfile
882
882
  );
883
- var SystemInterfaceReadinessProfileSchema = z.enum(SYSTEM_INTERFACE_READINESS_PROFILES);
883
+ var SystemInterfaceReadinessProfileSchema = z.string().trim().min(1);
884
884
  var SystemInterfaceResourceScopeSchema = z.array(ModelIdSchema).default([]);
885
+ var SystemApiInterfaceReadinessContractSchema = z.object({
886
+ /** Ontology IDs of object types the interface depends on. */
887
+ requiredObjects: z.array(z.string().trim().min(1)).default([]),
888
+ /** Ontology IDs of catalog types the interface requires (must be non-empty). */
889
+ requiredCatalogs: z.array(z.string().trim().min(1)).default([]),
890
+ /** Optional ontology kind filters (reserved for future profile extensions). */
891
+ requiredKinds: z.array(z.string().trim().min(1)).optional()
892
+ }).strict();
885
893
  var SystemApiInterfaceSchema = z.object({
886
894
  lifecycle: SystemInterfaceLifecycleSchema.default("active"),
895
+ /**
896
+ * Open-string profile id. Built-in platform presets are looked up through
897
+ * the profile registry; custom ids are validated structurally via
898
+ * `readinessContract`. Optional — `profileForInterface` provides a default.
899
+ */
887
900
  readinessProfile: SystemInterfaceReadinessProfileSchema.optional(),
888
901
  /**
889
902
  * Resource ids that participate in this API interface. This scopes readiness
890
903
  * derivation without duplicating authored required/provided contract refs.
891
904
  */
892
- resourceIds: SystemInterfaceResourceScopeSchema.optional()
905
+ resourceIds: SystemInterfaceResourceScopeSchema.optional(),
906
+ /**
907
+ * Tenant-authorable readiness declaration. Required for custom
908
+ * (non-built-in) profile ids so structural validation can proceed. Built-in
909
+ * profiles ignore this field (requirements are derived from platform code).
910
+ */
911
+ readinessContract: SystemApiInterfaceReadinessContractSchema.optional()
893
912
  }).strict();
913
+ var _profileRegistry = new Map(
914
+ SYSTEM_INTERFACE_READINESS_PROFILES.map((profileId) => [
915
+ profileId,
916
+ { profileId, kind: "built-in" }
917
+ ])
918
+ );
919
+ function profileForInterface(systemPath, interfaceKey, readinessProfile) {
920
+ return readinessProfile ?? `${systemPath}.${interfaceKey}`;
921
+ }
922
+ function isBuiltInReadinessProfile(profileId) {
923
+ return _profileRegistry.get(profileId)?.kind === "built-in";
924
+ }
894
925
  var SystemInterfaceRefSchema = z.object({
895
926
  systemPath: SystemPathSchema,
896
927
  interfaceKey: SystemInterfaceKeySchema
@@ -1205,14 +1236,11 @@ function addReadinessIssue(issues, family, code, message, details = {}) {
1205
1236
  function formatInterfaceIdentity(systemPath, interfaceKey) {
1206
1237
  return `${systemPath}/${interfaceKey}`;
1207
1238
  }
1208
- function profileForInterface(systemPath, interfaceKey, readinessProfile) {
1209
- return readinessProfile ?? `${systemPath}.${interfaceKey}`;
1210
- }
1211
1239
  function readinessMarkerPath(context) {
1212
1240
  return context.interfaceKey === "api" ? `systems.${context.systemPath}.apiInterface` : `systems.${context.systemPath}.derivedCrmHandoffReadiness`;
1213
1241
  }
1214
1242
  function formatSupportedReadinessProfiles() {
1215
- return SYSTEM_INTERFACE_READINESS_PROFILES.map((profile) => `"${profile}"`).join(", ");
1243
+ return SYSTEM_INTERFACE_PROFILES.map((p) => `"${p.readinessProfile}"`).join(", ");
1216
1244
  }
1217
1245
  function getActiveScopedResources(model, resourceIds, issues, context) {
1218
1246
  const resources = [];
@@ -1404,9 +1432,6 @@ function getLeadGenCrmHandoffResourceIds(model) {
1404
1432
  function getSystemInterfaceReadinessMarker(model, request) {
1405
1433
  const system = getSystem(model, request.systemPath);
1406
1434
  if (system === void 0) return void 0;
1407
- if (request.interfaceKey === LEAD_GEN_API_INTERFACE.interfaceKey) {
1408
- return system.apiInterface;
1409
- }
1410
1435
  if (request.systemPath === LEAD_GEN_CRM_HANDOFF_INTERFACE.systemPath && request.interfaceKey === LEAD_GEN_CRM_HANDOFF_INTERFACE.interfaceKey) {
1411
1436
  return {
1412
1437
  lifecycle: "active",
@@ -1414,6 +1439,9 @@ function getSystemInterfaceReadinessMarker(model, request) {
1414
1439
  resourceIds: getLeadGenCrmHandoffResourceIds(model)
1415
1440
  };
1416
1441
  }
1442
+ if (request.interfaceKey === "api" && system.apiInterface !== void 0) {
1443
+ return system.apiInterface;
1444
+ }
1417
1445
  return void 0;
1418
1446
  }
1419
1447
  function mergeLeadGenDerivedCatalogs(model) {
@@ -1458,6 +1486,18 @@ function tryCompileBusinessOntology(model, readinessProfile, issues) {
1458
1486
  return void 0;
1459
1487
  }
1460
1488
  }
1489
+ function requireContractReadiness(issues, index, resources, contract, context) {
1490
+ const reads = resourceBindingIds(resources, "reads");
1491
+ const catalogs = resourceBindingIds(resources, "usesCatalogs");
1492
+ for (const objectId of contract.requiredObjects) {
1493
+ requireObjectReadiness(issues, index, objectId, context);
1494
+ requireScopedBinding(issues, reads, "reads", objectId, context);
1495
+ }
1496
+ for (const catalogId of contract.requiredCatalogs) {
1497
+ requireCatalogReadiness(issues, index, catalogId, context);
1498
+ requireScopedBinding(issues, catalogs, "usesCatalogs", catalogId, context);
1499
+ }
1500
+ }
1461
1501
  function computeInterfaceReadiness(model, request) {
1462
1502
  const issues = [];
1463
1503
  const system = getSystem(model, request.systemPath);
@@ -1505,20 +1545,22 @@ function computeInterfaceReadiness(model, request) {
1505
1545
  { path: `${readinessMarkerPath(request)}.lifecycle` }
1506
1546
  );
1507
1547
  }
1508
- const supportedProfile = readinessProfile !== void 0 && SYSTEM_INTERFACE_PROFILES.some((profile) => profile.readinessProfile === readinessProfile);
1509
- if (!supportedProfile) {
1548
+ const checkedReadinessProfile = readinessProfile ?? profileForInterface(request.systemPath, request.interfaceKey);
1549
+ const isBuiltIn = isBuiltInReadinessProfile(checkedReadinessProfile);
1550
+ const readinessContract = systemInterface.readinessContract;
1551
+ if (!isBuiltIn && readinessContract === void 0) {
1510
1552
  addReadinessIssue(
1511
1553
  issues,
1512
1554
  "SYSTEM_INTERFACE_INVALID",
1513
- "unknown-readiness-profile",
1514
- `System Interface "${formatInterfaceIdentity(request.systemPath, request.interfaceKey)}" references unknown readiness profile "${readinessProfile}". Supported profiles: ${formatSupportedReadinessProfiles()}. Custom Systems should not declare apiInterface; route custom behavior through workflows/operations plus ontology, resources, and topology.`,
1515
- { path: `${readinessMarkerPath(request)}.readinessProfile`, ref: readinessProfile }
1555
+ "missing-readiness-contract",
1556
+ `System Interface "${formatInterfaceIdentity(request.systemPath, request.interfaceKey)}" uses custom readiness profile "${checkedReadinessProfile}" but declares no readinessContract. Built-in profiles: ${formatSupportedReadinessProfiles()}.`,
1557
+ { path: `${readinessMarkerPath(request)}.readinessContract`, ref: checkedReadinessProfile }
1516
1558
  );
1517
1559
  return {
1518
1560
  ready: false,
1519
1561
  systemPath: request.systemPath,
1520
1562
  interfaceKey: request.interfaceKey,
1521
- readinessProfile,
1563
+ readinessProfile: checkedReadinessProfile,
1522
1564
  scopedResourceIds,
1523
1565
  issues
1524
1566
  };
@@ -1532,10 +1574,6 @@ function computeInterfaceReadiness(model, request) {
1532
1574
  { path: `${readinessMarkerPath(request)}.resourceIds` }
1533
1575
  );
1534
1576
  }
1535
- const checkedReadinessProfile = readinessProfile;
1536
- if (checkedReadinessProfile === void 0) {
1537
- throw new Error("Supported readiness profile unexpectedly resolved to undefined");
1538
- }
1539
1577
  const resources = getActiveScopedResources(model, scopedResourceIds, issues, request);
1540
1578
  const index = tryCompileBusinessOntology(model, checkedReadinessProfile, issues);
1541
1579
  if (index !== void 0) {
@@ -1547,13 +1585,15 @@ function computeInterfaceReadiness(model, request) {
1547
1585
  requireLeadGenInterfaceReadiness(issues, index, resources, request);
1548
1586
  requireCrmInterfaceReadiness(issues, index, resources, { ...request, allowForeignOwner: true });
1549
1587
  requireHandoffBridgeReadiness(issues, model, request);
1588
+ } else if (readinessContract !== void 0) {
1589
+ requireContractReadiness(issues, index, resources, readinessContract, request);
1550
1590
  }
1551
1591
  }
1552
1592
  return {
1553
1593
  ready: issues.length === 0,
1554
1594
  systemPath: request.systemPath,
1555
1595
  interfaceKey: request.interfaceKey,
1556
- readinessProfile,
1596
+ readinessProfile: checkedReadinessProfile,
1557
1597
  scopedResourceIds,
1558
1598
  issues
1559
1599
  };
@@ -1,5 +1,5 @@
1
1
  import { OrganizationContext } from './chunk-DD3CCMCZ.js';
2
- import { APIClientError } from './chunk-XOPLS4S6.js';
2
+ import { APIClientError } from './chunk-774JOHIM.js';
3
3
  import { createContext, useContext, useMemo, useCallback } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
5
5