@elevasis/ui 2.33.2 → 2.34.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 (73) hide show
  1. package/dist/api/index.d.ts +9 -2
  2. package/dist/api/index.js +1 -1
  3. package/dist/app/index.css +452 -0
  4. package/dist/app/index.d.ts +1250 -3
  5. package/dist/app/index.js +144 -8
  6. package/dist/charts/index.js +2 -3
  7. package/dist/{chunk-VGU4ZFYZ.js → chunk-3AJVNMY5.js} +45 -28
  8. package/dist/chunk-3QXJK5IY.js +25 -0
  9. package/dist/chunk-4O4MII5S.js +4716 -0
  10. package/dist/{chunk-KW7ZNQD7.js → chunk-5EYJ2GIN.js} +4 -8
  11. package/dist/{chunk-OIBHQH5Q.js → chunk-BPQVTIUP.js} +12 -3
  12. package/dist/{chunk-52K5RFDH.js → chunk-DTFKWZ7A.js} +1098 -2280
  13. package/dist/{chunk-EPTHX4VZ.js → chunk-HRWLKKWM.js} +11 -2
  14. package/dist/{chunk-ZMK5Z6KE.js → chunk-IGDYWFNE.js} +2 -2
  15. package/dist/{chunk-44I4LOH6.js → chunk-IVGI4GDL.js} +3 -3
  16. package/dist/{chunk-4DYOXEH6.js → chunk-LAWLB6CT.js} +1 -1
  17. package/dist/{chunk-TGVAIWIL.js → chunk-LRWTWOGP.js} +3 -3
  18. package/dist/{chunk-O56ESZCQ.js → chunk-MP3GPBPX.js} +3 -3
  19. package/dist/{chunk-T3J6U77J.js → chunk-NLBQTDOW.js} +12 -17
  20. package/dist/{chunk-IBWMR4TI.js → chunk-O6JXQ6UQ.js} +1 -2
  21. package/dist/{chunk-TBVLQRXT.js → chunk-OBBQ2JCM.js} +3 -3
  22. package/dist/{chunk-GWGQI6V4.js → chunk-PLP3NYPL.js} +80 -171
  23. package/dist/{chunk-Z2K2EAPL.js → chunk-RIAXZ6AH.js} +5 -6
  24. package/dist/chunk-SDXSB3HN.js +425 -0
  25. package/dist/{chunk-JA5ECJJB.js → chunk-VTXTZXAU.js} +156 -4
  26. package/dist/{chunk-32I2RCGC.js → chunk-W73ZABT6.js} +1 -1
  27. package/dist/{chunk-2ZZ72TAB.js → chunk-WU4FNWCW.js} +3 -3
  28. package/dist/{chunk-A4VDJJCV.js → chunk-YNWZIWJL.js} +4 -5
  29. package/dist/components/index.d.ts +0 -23
  30. package/dist/components/index.js +27 -448
  31. package/dist/components/navigation/index.js +4 -6
  32. package/dist/features/clients/index.js +7 -12
  33. package/dist/features/crm/index.js +9 -14
  34. package/dist/features/dashboard/index.d.ts +0 -23
  35. package/dist/features/dashboard/index.js +9 -14
  36. package/dist/features/delivery/index.js +8 -13
  37. package/dist/features/knowledge/index.js +5 -7
  38. package/dist/features/lead-gen/index.js +9 -14
  39. package/dist/features/monitoring/index.js +10 -15
  40. package/dist/features/monitoring/requests/index.js +7 -12
  41. package/dist/features/operations/index.d.ts +44 -35
  42. package/dist/features/operations/index.js +12 -17
  43. package/dist/features/settings/index.js +8 -13
  44. package/dist/hooks/index.d.ts +20 -27
  45. package/dist/hooks/index.js +7 -12
  46. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +20 -27
  47. package/dist/hooks/published.d.ts +20 -27
  48. package/dist/hooks/published.js +7 -12
  49. package/dist/index.d.ts +53 -38
  50. package/dist/index.js +8 -13
  51. package/dist/knowledge/index.d.ts +30 -38
  52. package/dist/knowledge/index.js +36 -200
  53. package/dist/{knowledge-search-index-VMAW7FLR.js → knowledge-search-index-ORIJCEZX.js} +3 -3
  54. package/dist/organization/index.js +1 -2
  55. package/dist/provider/index.d.ts +24 -31
  56. package/dist/provider/index.js +6 -11
  57. package/dist/provider/published.d.ts +24 -31
  58. package/dist/provider/published.js +5 -9
  59. package/dist/test-utils/index.d.ts +2 -0
  60. package/dist/test-utils/index.js +14 -2
  61. package/dist/test-utils/setup.js +38 -0
  62. package/dist/types/index.d.ts +20 -27
  63. package/dist/utils/index.d.ts +0 -23
  64. package/dist/zustand/index.d.ts +15 -2
  65. package/dist/zustand/index.js +35 -1
  66. package/package.json +4 -4
  67. package/dist/chunk-HUJCU55S.js +0 -159
  68. package/dist/chunk-IOXOPMYS.js +0 -145
  69. package/dist/chunk-J2UD7BOH.js +0 -347
  70. package/dist/chunk-QDFJSUG3.js +0 -13
  71. package/dist/chunk-SZHARWKU.js +0 -15
  72. package/dist/chunk-WKW6B5ID.js +0 -29
  73. package/dist/chunk-XCYKC6OZ.js +0 -1
@@ -3423,24 +3423,6 @@ type OntologyScope = z$1.infer<typeof OntologyScopeSchema>;
3423
3423
  */
3424
3424
  type TimeRange = '1h' | '24h' | '7d' | '30d';
3425
3425
 
3426
- /**
3427
- * Placeholder discriminated union for ContentNode (Wave 1A).
3428
- * Wave 2A wires concrete (kind, type) pairs via the registry.
3429
- *
3430
- * Per D2: unregistered (kind, type) pairs are allowed and pass through validation.
3431
- * Per L14: every node carries BOTH `kind` and `type`.
3432
- */
3433
- declare const ContentNodeSchema: z$1.ZodObject<{
3434
- label: z$1.ZodString;
3435
- description: z$1.ZodOptional<z$1.ZodString>;
3436
- order: z$1.ZodOptional<z$1.ZodNumber>;
3437
- parentContentId: z$1.ZodOptional<z$1.ZodString>;
3438
- kind: z$1.ZodString;
3439
- type: z$1.ZodString;
3440
- data: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodUnknown>>;
3441
- }, z$1.core.$strip>;
3442
- type ContentNode = z$1.infer<typeof ContentNodeSchema>;
3443
-
3444
3426
  type JsonPrimitive = string | number | boolean | null;
3445
3427
  type JsonValue = JsonPrimitive | JsonValue[] | {
3446
3428
  [key: string]: JsonValue;
@@ -3482,11 +3464,6 @@ interface SystemEntry {
3482
3464
  config?: Record<string, JsonValue>;
3483
3465
  ontology?: OntologyScope;
3484
3466
  systems?: Record<string, SystemEntry>;
3485
- /**
3486
- * @deprecated Compatibility-only bridge for old tenant data and migration readers.
3487
- * Author new semantic catalogs in `ontology` and local settings in `config`.
3488
- */
3489
- content?: Record<string, ContentNode>;
3490
3467
  subsystems?: Record<string, SystemEntry>;
3491
3468
  }
3492
3469
  declare const SystemEntrySchema: ZodType<SystemEntry>;
@@ -3941,14 +3918,18 @@ declare const OrganizationModelSchema: z$1.ZodObject<{
3941
3918
  writes: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
3942
3919
  usesCatalogs: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
3943
3920
  emits: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
3921
+ contract: z$1.ZodOptional<z$1.ZodObject<{
3922
+ input: z$1.ZodOptional<z$1.ZodString>;
3923
+ output: z$1.ZodOptional<z$1.ZodString>;
3924
+ }, z$1.core.$strip>>;
3944
3925
  }, z$1.core.$strip>>;
3945
3926
  codeRefs: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{
3946
3927
  path: z$1.ZodString;
3947
3928
  role: z$1.ZodEnum<{
3948
- schema: "schema";
3949
3929
  config: "config";
3950
3930
  entrypoint: "entrypoint";
3951
3931
  handler: "handler";
3932
+ schema: "schema";
3952
3933
  test: "test";
3953
3934
  docs: "docs";
3954
3935
  }>;
@@ -3987,14 +3968,18 @@ declare const OrganizationModelSchema: z$1.ZodObject<{
3987
3968
  writes: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
3988
3969
  usesCatalogs: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
3989
3970
  emits: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
3971
+ contract: z$1.ZodOptional<z$1.ZodObject<{
3972
+ input: z$1.ZodOptional<z$1.ZodString>;
3973
+ output: z$1.ZodOptional<z$1.ZodString>;
3974
+ }, z$1.core.$strip>>;
3990
3975
  }, z$1.core.$strip>>;
3991
3976
  codeRefs: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{
3992
3977
  path: z$1.ZodString;
3993
3978
  role: z$1.ZodEnum<{
3994
- schema: "schema";
3995
3979
  config: "config";
3996
3980
  entrypoint: "entrypoint";
3997
3981
  handler: "handler";
3982
+ schema: "schema";
3998
3983
  test: "test";
3999
3984
  docs: "docs";
4000
3985
  }>;
@@ -4064,14 +4049,18 @@ declare const OrganizationModelSchema: z$1.ZodObject<{
4064
4049
  writes: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
4065
4050
  usesCatalogs: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
4066
4051
  emits: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
4052
+ contract: z$1.ZodOptional<z$1.ZodObject<{
4053
+ input: z$1.ZodOptional<z$1.ZodString>;
4054
+ output: z$1.ZodOptional<z$1.ZodString>;
4055
+ }, z$1.core.$strip>>;
4067
4056
  }, z$1.core.$strip>>;
4068
4057
  codeRefs: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{
4069
4058
  path: z$1.ZodString;
4070
4059
  role: z$1.ZodEnum<{
4071
- schema: "schema";
4072
4060
  config: "config";
4073
4061
  entrypoint: "entrypoint";
4074
4062
  handler: "handler";
4063
+ schema: "schema";
4075
4064
  test: "test";
4076
4065
  docs: "docs";
4077
4066
  }>;
@@ -4099,14 +4088,18 @@ declare const OrganizationModelSchema: z$1.ZodObject<{
4099
4088
  writes: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
4100
4089
  usesCatalogs: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
4101
4090
  emits: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
4091
+ contract: z$1.ZodOptional<z$1.ZodObject<{
4092
+ input: z$1.ZodOptional<z$1.ZodString>;
4093
+ output: z$1.ZodOptional<z$1.ZodString>;
4094
+ }, z$1.core.$strip>>;
4102
4095
  }, z$1.core.$strip>>;
4103
4096
  codeRefs: z$1.ZodDefault<z$1.ZodArray<z$1.ZodObject<{
4104
4097
  path: z$1.ZodString;
4105
4098
  role: z$1.ZodEnum<{
4106
- schema: "schema";
4107
4099
  config: "config";
4108
4100
  entrypoint: "entrypoint";
4109
4101
  handler: "handler";
4102
+ schema: "schema";
4110
4103
  test: "test";
4111
4104
  docs: "docs";
4112
4105
  }>;
@@ -4331,6 +4324,7 @@ declare const OrganizationModelSchema: z$1.ZodObject<{
4331
4324
  crm: "crm";
4332
4325
  "lead-gen": "lead-gen";
4333
4326
  projects: "projects";
4327
+ clients: "clients";
4334
4328
  operations: "operations";
4335
4329
  monitoring: "monitoring";
4336
4330
  knowledge: "knowledge";
@@ -4392,11 +4386,10 @@ declare const OrganizationModelSchema: z$1.ZodObject<{
4392
4386
  ontology: "ontology";
4393
4387
  role: "role";
4394
4388
  goal: "goal";
4395
- stage: "stage";
4396
4389
  resource: "resource";
4390
+ stage: "stage";
4397
4391
  "customer-segment": "customer-segment";
4398
4392
  offering: "offering";
4399
- "content-node": "content-node";
4400
4393
  }>;
4401
4394
  id: z$1.ZodString;
4402
4395
  }, z$1.core.$strip>;
@@ -4404,7 +4397,7 @@ declare const OrganizationModelSchema: z$1.ZodObject<{
4404
4397
  nodeId: z$1.ZodUnion<readonly [z$1.ZodString, z$1.ZodTemplateLiteral<`ontology:${string}`>]>;
4405
4398
  }, z$1.core.$strip>]>, z$1.ZodTransform<{
4406
4399
  target: {
4407
- kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "stage" | "resource" | "customer-segment" | "offering" | "content-node";
4400
+ kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "resource" | "stage" | "customer-segment" | "offering";
4408
4401
  id: string;
4409
4402
  };
4410
4403
  nodeId: string;
@@ -4412,7 +4405,7 @@ declare const OrganizationModelSchema: z$1.ZodObject<{
4412
4405
  nodeId: string;
4413
4406
  } | {
4414
4407
  target: {
4415
- kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "stage" | "resource" | "customer-segment" | "offering" | "content-node";
4408
+ kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "resource" | "stage" | "customer-segment" | "offering";
4416
4409
  id: string;
4417
4410
  };
4418
4411
  }>>>>;
@@ -1,18 +1,14 @@
1
- export { SystemShell } from '../chunk-WKW6B5ID.js';
2
- import '../chunk-EPTHX4VZ.js';
1
+ export { ElevasisCoreProvider, NotificationProvider, SystemShell, useNotificationAdapter } from '../chunk-PLP3NYPL.js';
2
+ import '../chunk-HRWLKKWM.js';
3
3
  import '../chunk-3KMDHCAR.js';
4
- export { ElevasisCoreProvider, NotificationProvider, useNotificationAdapter } from '../chunk-GWGQI6V4.js';
5
- import '../chunk-SZHARWKU.js';
6
- export { ElevasisSystemsProvider, useElevasisSystems, useOptionalElevasisSystems } from '../chunk-IBWMR4TI.js';
4
+ export { ElevasisSystemsProvider, useElevasisSystems, useOptionalElevasisSystems } from '../chunk-O6JXQ6UQ.js';
7
5
  import '../chunk-TKAYX2SP.js';
8
6
  import '../chunk-NYBEU5TE.js';
9
- import '../chunk-IOXOPMYS.js';
10
- import '../chunk-52K5RFDH.js';
7
+ import '../chunk-DTFKWZ7A.js';
11
8
  import '../chunk-ND5TDV2J.js';
12
9
  import '../chunk-2IFYDILW.js';
13
10
  import '../chunk-Q7DJKLEN.js';
14
- import '../chunk-JA5ECJJB.js';
15
- import '../chunk-HUJCU55S.js';
11
+ import '../chunk-VTXTZXAU.js';
16
12
  export { AppearanceProvider, useAppearance } from '../chunk-E565XMTQ.js';
17
13
  import '../chunk-JBWJ6WHZ.js';
18
14
  import '../chunk-DT3QYZVU.js';
@@ -141,6 +141,8 @@ interface OrgOsRouteContractSystem {
141
141
  id: string;
142
142
  lifecycle?: string | null;
143
143
  path?: string | null;
144
+ systems?: Record<string, OrgOsRouteContractSystem> | null;
145
+ subsystems?: Record<string, OrgOsRouteContractSystem> | null;
144
146
  ui?: {
145
147
  path?: string | null;
146
148
  } | null;
@@ -2,7 +2,7 @@ import { server, handlers } from '../chunk-7XKCG5CT.js';
2
2
  export { handlers, server } from '../chunk-7XKCG5CT.js';
3
3
  import { mockWorkOSUser, mockUseAuth, mockUnauthenticatedUser, mockAuthenticatedUser, mockAuthLoading, createMockUseAuth } from '../chunk-DRQPEMJI.js';
4
4
  export { createMockUseAuth, mockAuthLoading, mockAuthenticatedUser, mockUnauthenticatedUser, mockUseAuth, mockWorkOSUser } from '../chunk-DRQPEMJI.js';
5
- import '../chunk-XCYKC6OZ.js';
5
+ import '../chunk-3QXJK5IY.js';
6
6
  import { ApiClientProvider } from '../chunk-ND5TDV2J.js';
7
7
  import '../chunk-2RJMVWFJ.js';
8
8
  import '../chunk-KRWALB24.js';
@@ -188,7 +188,19 @@ function ownsOrgOsSystem(ownerSystemId, systemId) {
188
188
  }
189
189
  function getOrgOsRouteContractSystems(organizationModel) {
190
190
  const { systems } = organizationModel;
191
- return "systems" in systems && Array.isArray(systems.systems) ? systems.systems : Object.values(systems);
191
+ const arraySystems = systems.systems;
192
+ if (Array.isArray(arraySystems)) return arraySystems;
193
+ const result = [];
194
+ const visit = (entries, prefix = "") => {
195
+ for (const [key, system] of Object.entries(entries)) {
196
+ const id = prefix ? `${prefix}.${key}` : system.id || key;
197
+ result.push({ ...system, id });
198
+ if (system.systems) visit(system.systems, id);
199
+ if (system.subsystems) visit(system.subsystems, id);
200
+ }
201
+ };
202
+ visit(systems);
203
+ return result;
192
204
  }
193
205
  function collectOrgOsUiRouteContractIssues(options) {
194
206
  const { target, organizationModel, mode = "production" } = options;
@@ -22,6 +22,44 @@ vi.mock("@elevasis/ui/router/context", () => ({
22
22
  }),
23
23
  RouterProvider: ({ children }) => children
24
24
  }));
25
+ vi.doMock("@elevasis/ui/organization", () => ({
26
+ useOrganization: () => ({
27
+ currentWorkOSOrganizationId: "test-org-id",
28
+ currentSupabaseOrganizationId: "test-supabase-org-id",
29
+ currentMembership: { id: "test-membership-id", organizationId: "test-org-id" },
30
+ memberships: [],
31
+ switchOrganization: vi.fn()
32
+ }),
33
+ OrganizationProvider: ({ children }) => children,
34
+ OrganizationSwitcher: () => null
35
+ }));
36
+ var mockApiUrl = "https://api.elevasis.io";
37
+ async function mockApiRequest(endpoint, options = {}) {
38
+ const response = await fetch(`${mockApiUrl}/api${endpoint}`, {
39
+ headers: {
40
+ ...options.body ? { "Content-Type": "application/json" } : {},
41
+ ...options.headers
42
+ },
43
+ ...options
44
+ });
45
+ if (!response.ok) {
46
+ throw new Error(`HTTP ${response.status}`);
47
+ }
48
+ if (response.status === 204) {
49
+ return void 0;
50
+ }
51
+ return response.json();
52
+ }
53
+ vi.doMock("@elevasis/ui/api", () => ({
54
+ useApiClient: () => ({
55
+ apiRequest: mockApiRequest,
56
+ deferredApiRequest: mockApiRequest,
57
+ isOrganizationReady: true,
58
+ isInitializing: false
59
+ }),
60
+ ApiClientProvider: ({ children }) => children,
61
+ useApiClientContext: vi.fn()
62
+ }));
25
63
  var isIntegrationTest = () => {
26
64
  try {
27
65
  return expect.getState().testPath?.includes("integration.test") ?? false;
@@ -435,14 +435,18 @@ declare const ResourceEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
435
435
  writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
436
436
  usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
437
437
  emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
438
+ contract: z.ZodOptional<z.ZodObject<{
439
+ input: z.ZodOptional<z.ZodString>;
440
+ output: z.ZodOptional<z.ZodString>;
441
+ }, z.core.$strip>>;
438
442
  }, z.core.$strip>>;
439
443
  codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
440
444
  path: z.ZodString;
441
445
  role: z.ZodEnum<{
442
- schema: "schema";
443
446
  config: "config";
444
447
  entrypoint: "entrypoint";
445
448
  handler: "handler";
449
+ schema: "schema";
446
450
  test: "test";
447
451
  docs: "docs";
448
452
  }>;
@@ -481,14 +485,18 @@ declare const ResourceEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
481
485
  writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
482
486
  usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
483
487
  emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
488
+ contract: z.ZodOptional<z.ZodObject<{
489
+ input: z.ZodOptional<z.ZodString>;
490
+ output: z.ZodOptional<z.ZodString>;
491
+ }, z.core.$strip>>;
484
492
  }, z.core.$strip>>;
485
493
  codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
486
494
  path: z.ZodString;
487
495
  role: z.ZodEnum<{
488
- schema: "schema";
489
496
  config: "config";
490
497
  entrypoint: "entrypoint";
491
498
  handler: "handler";
499
+ schema: "schema";
492
500
  test: "test";
493
501
  docs: "docs";
494
502
  }>;
@@ -558,14 +566,18 @@ declare const ResourceEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
558
566
  writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
559
567
  usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
560
568
  emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
569
+ contract: z.ZodOptional<z.ZodObject<{
570
+ input: z.ZodOptional<z.ZodString>;
571
+ output: z.ZodOptional<z.ZodString>;
572
+ }, z.core.$strip>>;
561
573
  }, z.core.$strip>>;
562
574
  codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
563
575
  path: z.ZodString;
564
576
  role: z.ZodEnum<{
565
- schema: "schema";
566
577
  config: "config";
567
578
  entrypoint: "entrypoint";
568
579
  handler: "handler";
580
+ schema: "schema";
569
581
  test: "test";
570
582
  docs: "docs";
571
583
  }>;
@@ -593,14 +605,18 @@ declare const ResourceEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
593
605
  writes: z.ZodOptional<z.ZodArray<z.ZodString>>;
594
606
  usesCatalogs: z.ZodOptional<z.ZodArray<z.ZodString>>;
595
607
  emits: z.ZodOptional<z.ZodArray<z.ZodString>>;
608
+ contract: z.ZodOptional<z.ZodObject<{
609
+ input: z.ZodOptional<z.ZodString>;
610
+ output: z.ZodOptional<z.ZodString>;
611
+ }, z.core.$strip>>;
596
612
  }, z.core.$strip>>;
597
613
  codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
598
614
  path: z.ZodString;
599
615
  role: z.ZodEnum<{
600
- schema: "schema";
601
616
  config: "config";
602
617
  entrypoint: "entrypoint";
603
618
  handler: "handler";
619
+ schema: "schema";
604
620
  test: "test";
605
621
  docs: "docs";
606
622
  }>;
@@ -4873,24 +4889,6 @@ type AIResourceDefinition = SerializedWorkflowDefinition | SerializedAgentDefini
4873
4889
  */
4874
4890
  type IntegrationType = 'gmail' | 'google-sheets' | 'slack' | 'github' | 'linear' | 'attio' | 'airtable' | 'salesforce' | 'hubspot' | 'stripe' | 'twilio' | 'sendgrid' | 'mailgun' | 'zapier' | 'webhook' | 'apify' | 'instantly' | 'resend' | 'signature-api' | 'dropbox' | 'anymailfinder' | 'tomba' | 'millionverifier';
4875
4891
 
4876
- /**
4877
- * Placeholder discriminated union for ContentNode (Wave 1A).
4878
- * Wave 2A wires concrete (kind, type) pairs via the registry.
4879
- *
4880
- * Per D2: unregistered (kind, type) pairs are allowed and pass through validation.
4881
- * Per L14: every node carries BOTH `kind` and `type`.
4882
- */
4883
- declare const ContentNodeSchema: z.ZodObject<{
4884
- label: z.ZodString;
4885
- description: z.ZodOptional<z.ZodString>;
4886
- order: z.ZodOptional<z.ZodNumber>;
4887
- parentContentId: z.ZodOptional<z.ZodString>;
4888
- kind: z.ZodString;
4889
- type: z.ZodString;
4890
- data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
4891
- }, z.core.$strip>;
4892
- type ContentNode = z.infer<typeof ContentNodeSchema>;
4893
-
4894
4892
  type JsonPrimitive = string | number | boolean | null;
4895
4893
  type JsonValue = JsonPrimitive | JsonValue[] | {
4896
4894
  [key: string]: JsonValue;
@@ -4932,11 +4930,6 @@ interface SystemEntry {
4932
4930
  config?: Record<string, JsonValue>;
4933
4931
  ontology?: OntologyScope;
4934
4932
  systems?: Record<string, SystemEntry>;
4935
- /**
4936
- * @deprecated Compatibility-only bridge for old tenant data and migration readers.
4937
- * Author new semantic catalogs in `ontology` and local settings in `config`.
4938
- */
4939
- content?: Record<string, ContentNode>;
4940
4933
  subsystems?: Record<string, SystemEntry>;
4941
4934
  }
4942
4935
 
@@ -202,24 +202,6 @@ declare const ResourceStatusColors: {
202
202
  readonly prod: "var(--color-success)";
203
203
  };
204
204
 
205
- /**
206
- * Placeholder discriminated union for ContentNode (Wave 1A).
207
- * Wave 2A wires concrete (kind, type) pairs via the registry.
208
- *
209
- * Per D2: unregistered (kind, type) pairs are allowed and pass through validation.
210
- * Per L14: every node carries BOTH `kind` and `type`.
211
- */
212
- declare const ContentNodeSchema: z.ZodObject<{
213
- label: z.ZodString;
214
- description: z.ZodOptional<z.ZodString>;
215
- order: z.ZodOptional<z.ZodNumber>;
216
- parentContentId: z.ZodOptional<z.ZodString>;
217
- kind: z.ZodString;
218
- type: z.ZodString;
219
- data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
220
- }, z.core.$strip>;
221
- type ContentNode = z.infer<typeof ContentNodeSchema>;
222
-
223
205
  type JsonPrimitive = string | number | boolean | null;
224
206
  type JsonValue = JsonPrimitive | JsonValue[] | {
225
207
  [key: string]: JsonValue;
@@ -261,11 +243,6 @@ interface SystemEntry {
261
243
  config?: Record<string, JsonValue>;
262
244
  ontology?: OntologyScope;
263
245
  systems?: Record<string, SystemEntry>;
264
- /**
265
- * @deprecated Compatibility-only bridge for old tenant data and migration readers.
266
- * Author new semantic catalogs in `ontology` and local settings in `config`.
267
- */
268
- content?: Record<string, ContentNode>;
269
246
  subsystems?: Record<string, SystemEntry>;
270
247
  }
271
248
 
@@ -1,4 +1,5 @@
1
1
  import { Draft } from 'immer';
2
+ import { UseBoundStore, StoreApi } from 'zustand';
2
3
 
3
4
  interface SSESliceState {
4
5
  sse: {
@@ -68,5 +69,17 @@ declare function resetTimeRangeState(state: Draft<{
68
69
  }>): void;
69
70
  declare function createTimeRangeSlice(set: ImmerSet): TimeRangeSliceState;
70
71
 
71
- export { createSSESlice, createThemeSlice, createTimeRangeSlice, resetSSEState, resetThemeState, resetTimeRangeState };
72
- export type { SSESliceState, ThemeColorScheme, ThemePresetName, ThemeSliceOptions, ThemeSliceState, TimeRangeSliceState };
72
+ interface ElevasisAppState extends SSESliceState, ThemeSliceState, TimeRangeSliceState {
73
+ resetStore: () => void;
74
+ }
75
+ interface CreateElevasisAppStoreOptions {
76
+ defaultPreset?: ThemePresetName;
77
+ defaultColorScheme?: ThemeColorScheme;
78
+ devtoolsName?: string;
79
+ devtoolsEnabled?: boolean;
80
+ }
81
+ type ElevasisAppStore = UseBoundStore<StoreApi<ElevasisAppState>>;
82
+ declare function createElevasisAppStore(options?: CreateElevasisAppStoreOptions): ElevasisAppStore;
83
+
84
+ export { createElevasisAppStore, createSSESlice, createThemeSlice, createTimeRangeSlice, resetSSEState, resetThemeState, resetTimeRangeState };
85
+ export type { CreateElevasisAppStoreOptions, ElevasisAppState, ElevasisAppStore, SSESliceState, ThemeColorScheme, ThemePresetName, ThemeSliceOptions, ThemeSliceState, TimeRangeSliceState };
@@ -1,4 +1,7 @@
1
1
  import '../chunk-I2KLQ2HA.js';
2
+ import { create } from 'zustand';
3
+ import { devtools } from 'zustand/middleware';
4
+ import { immer } from 'zustand/middleware/immer';
2
5
 
3
6
  // src/zustand/slices/sse.ts
4
7
  function resetSSEState(state) {
@@ -94,4 +97,35 @@ function createTimeRangeSlice(set) {
94
97
  };
95
98
  }
96
99
 
97
- export { createSSESlice, createThemeSlice, createTimeRangeSlice, resetSSEState, resetThemeState, resetTimeRangeState };
100
+ // src/zustand/appStore.ts
101
+ function createElevasisAppStore(options = {}) {
102
+ const defaultPreset = options.defaultPreset ?? "tactical";
103
+ const defaultColorScheme = options.defaultColorScheme ?? "dark";
104
+ return create()(
105
+ devtools(
106
+ immer((set) => ({
107
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
108
+ ...createSSESlice(set),
109
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
110
+ ...createThemeSlice(set, { defaultPreset, defaultColorScheme }),
111
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
112
+ ...createTimeRangeSlice(set),
113
+ resetStore: () => set(
114
+ (state) => {
115
+ resetSSEState(state);
116
+ resetThemeState(state, { defaultPreset, defaultColorScheme });
117
+ resetTimeRangeState(state);
118
+ },
119
+ void 0,
120
+ "app/resetStore"
121
+ )
122
+ })),
123
+ {
124
+ name: options.devtoolsName ?? "ElevasisAppStore",
125
+ enabled: options.devtoolsEnabled ?? import.meta.env?.DEV ?? false
126
+ }
127
+ )
128
+ );
129
+ }
130
+
131
+ export { createElevasisAppStore, createSSESlice, createThemeSlice, createTimeRangeSlice, resetSSEState, resetThemeState, resetTimeRangeState };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/ui",
3
- "version": "2.33.2",
3
+ "version": "2.34.0",
4
4
  "description": "UI components and platform-aware hooks for building custom frontends on the Elevasis platform",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -253,11 +253,11 @@
253
253
  "typescript": "5.9.2",
254
254
  "vite": "^7.0.0",
255
255
  "vitest": "^3.2.4",
256
- "@elevasis/sdk": "1.22.1",
256
+ "@elevasis/sdk": "1.23.0",
257
257
  "@repo/elevasis-core": "1.0.0",
258
258
  "@repo/eslint-config": "0.0.0",
259
- "@repo/typescript-config": "0.0.0",
260
- "@repo/core": "0.24.1"
259
+ "@repo/core": "0.26.0",
260
+ "@repo/typescript-config": "0.0.0"
261
261
  },
262
262
  "dependencies": {
263
263
  "@dagrejs/dagre": "^1.1.4",
@@ -1,159 +0,0 @@
1
- import { OrganizationContext } from './chunk-DD3CCMCZ.js';
2
- import { useProfile } from './chunk-2Q2JQSQO.js';
3
- import { useAuthContext } from './chunk-BRJ3QZ4E.js';
4
- import { useState, useRef, useEffect, useCallback, createElement } from 'react';
5
- import { useQueryClient } from '@tanstack/react-query';
6
-
7
- function OrganizationProvider({ apiRequest, children }) {
8
- const { user, organizationId: workosOrgId } = useAuthContext();
9
- const { profile, error: profileError } = useProfile();
10
- const queryClient = useQueryClient();
11
- const [memberships, setMemberships] = useState([]);
12
- const [currentWorkOSOrganizationId, setCurrentWorkOSOrganizationId] = useState(null);
13
- const [currentSupabaseOrganizationId, setCurrentSupabaseOrganizationId] = useState(null);
14
- const [currentMembership, setCurrentMembership] = useState(null);
15
- const [isInitializing, setIsInitializing] = useState(true);
16
- const [isOrgRefreshing, setIsOrgRefreshing] = useState(false);
17
- const [error, setError] = useState(null);
18
- const hasInitializedRef = useRef(false);
19
- const [profileLoaded, setProfileLoaded] = useState(false);
20
- useEffect(() => {
21
- if (profile !== void 0 && profile !== null) {
22
- setProfileLoaded(true);
23
- }
24
- }, [profile]);
25
- useEffect(() => {
26
- if (profileError && isInitializing && !hasInitializedRef.current) {
27
- setIsInitializing(false);
28
- }
29
- }, [profileError, isInitializing]);
30
- useEffect(() => {
31
- if (!user) {
32
- setMemberships([]);
33
- setCurrentWorkOSOrganizationId(null);
34
- setCurrentSupabaseOrganizationId(null);
35
- setCurrentMembership(null);
36
- setIsInitializing(false);
37
- setIsOrgRefreshing(false);
38
- setError(null);
39
- hasInitializedRef.current = false;
40
- setProfileLoaded(false);
41
- }
42
- }, [user]);
43
- const applyMembership = useCallback((membership) => {
44
- setCurrentMembership(membership);
45
- setCurrentSupabaseOrganizationId(membership?.organization?.id ?? null);
46
- setCurrentWorkOSOrganizationId(membership?.organization?.workos_org_id ?? null);
47
- }, []);
48
- const selectOrganization = useCallback(
49
- (data) => {
50
- let selected = null;
51
- if (profile?.last_visited_org) {
52
- selected = data.find((m) => m.organizationId === profile.last_visited_org) ?? null;
53
- }
54
- if (!selected && workosOrgId) {
55
- selected = data.find((m) => m.organization?.workos_org_id === workosOrgId) ?? null;
56
- }
57
- if (!selected && data.length > 0) {
58
- selected = data[0];
59
- }
60
- if (selected) {
61
- applyMembership(selected);
62
- }
63
- },
64
- [profile?.last_visited_org, workosOrgId, applyMembership]
65
- );
66
- const fetchAndInitialize = useCallback(async () => {
67
- if (!user?.id || !profileLoaded) return;
68
- setError(null);
69
- if (memberships.length === 0) {
70
- setIsInitializing(true);
71
- } else {
72
- setIsOrgRefreshing(true);
73
- }
74
- try {
75
- const data = await apiRequest("/memberships/my-memberships");
76
- if (!Array.isArray(data)) {
77
- throw new Error("Invalid memberships response");
78
- }
79
- setMemberships(data);
80
- if (data.length === 0) {
81
- hasInitializedRef.current = true;
82
- return;
83
- }
84
- if (!currentWorkOSOrganizationId) {
85
- selectOrganization(data);
86
- } else {
87
- const stillPresent = data.find((m) => m.organization?.workos_org_id === currentWorkOSOrganizationId);
88
- if (!stillPresent) {
89
- applyMembership(data[0] ?? null);
90
- } else if (stillPresent.id !== currentMembership?.id) {
91
- applyMembership(stillPresent);
92
- }
93
- }
94
- hasInitializedRef.current = true;
95
- } catch (err) {
96
- setError(err instanceof Error ? err.message : "Failed to load organizations");
97
- } finally {
98
- setIsInitializing(false);
99
- setIsOrgRefreshing(false);
100
- }
101
- }, [
102
- user?.id,
103
- profileLoaded,
104
- memberships.length,
105
- apiRequest,
106
- currentWorkOSOrganizationId,
107
- currentMembership?.id,
108
- selectOrganization,
109
- applyMembership
110
- ]);
111
- useEffect(() => {
112
- if (!user?.id || !profileLoaded || hasInitializedRef.current) return;
113
- fetchAndInitialize();
114
- }, [user?.id, profileLoaded, fetchAndInitialize]);
115
- useEffect(() => {
116
- if (!hasInitializedRef.current) return;
117
- if (!workosOrgId) return;
118
- if (workosOrgId === currentWorkOSOrganizationId) return;
119
- const target = memberships.find((m) => m.organization?.workos_org_id === workosOrgId);
120
- if (!target) return;
121
- applyMembership(target);
122
- void queryClient.invalidateQueries();
123
- }, [workosOrgId, currentWorkOSOrganizationId, memberships, applyMembership, queryClient]);
124
- const switchOrganization = useCallback(
125
- (workosOrgId2) => {
126
- const target = memberships.find((m) => m.organization?.workos_org_id === workosOrgId2);
127
- if (!target) return;
128
- applyMembership(target);
129
- void queryClient.invalidateQueries();
130
- void apiRequest("/users/me", {
131
- method: "PATCH",
132
- headers: { "Content-Type": "application/json" },
133
- body: JSON.stringify({ last_visited_org: target.organizationId })
134
- }).catch((err) => {
135
- console.warn("Failed to persist last_visited_org preference:", err);
136
- });
137
- },
138
- [memberships, applyMembership, queryClient, apiRequest]
139
- );
140
- const retry = useCallback(async () => {
141
- hasInitializedRef.current = false;
142
- setError(null);
143
- await fetchAndInitialize();
144
- }, [fetchAndInitialize]);
145
- const value = {
146
- currentWorkOSOrganizationId,
147
- currentSupabaseOrganizationId,
148
- currentMembership,
149
- memberships,
150
- isInitializing,
151
- isOrgRefreshing,
152
- error,
153
- switchOrganization,
154
- retry
155
- };
156
- return createElement(OrganizationContext.Provider, { value }, children);
157
- }
158
-
159
- export { OrganizationProvider };