@elevasis/core 0.26.0 → 0.28.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/index.d.ts +162 -105
  2. package/dist/index.js +280 -174
  3. package/dist/knowledge/index.d.ts +43 -43
  4. package/dist/organization-model/index.d.ts +162 -105
  5. package/dist/organization-model/index.js +280 -174
  6. package/dist/test-utils/index.d.ts +20 -20
  7. package/dist/test-utils/index.js +184 -126
  8. package/package.json +3 -3
  9. package/src/_gen/__tests__/__snapshots__/contracts.md.snap +976 -1063
  10. package/src/business/acquisition/api-schemas.test.ts +1962 -1841
  11. package/src/business/acquisition/api-schemas.ts +1461 -1464
  12. package/src/business/acquisition/crm-next-action.test.ts +45 -25
  13. package/src/business/acquisition/crm-next-action.ts +227 -220
  14. package/src/business/acquisition/crm-priority.test.ts +41 -8
  15. package/src/business/acquisition/crm-priority.ts +365 -349
  16. package/src/business/acquisition/crm-state-actions.test.ts +208 -153
  17. package/src/business/acquisition/derive-actions.test.ts +90 -13
  18. package/src/business/acquisition/derive-actions.ts +8 -139
  19. package/src/business/acquisition/ontology-validation.ts +72 -158
  20. package/src/business/pdf/sections/investment.ts +1 -1
  21. package/src/business/pdf/sections/summary-investment.ts +1 -1
  22. package/src/execution/engine/tools/tool-maps.ts +872 -831
  23. package/src/organization-model/__tests__/cross-ref.test.ts +167 -0
  24. package/src/organization-model/__tests__/define-domain-record.test.ts +289 -0
  25. package/src/organization-model/__tests__/om-spine-doc-contract.test.ts +56 -0
  26. package/src/organization-model/__tests__/published-zero-leak.test.ts +60 -1
  27. package/src/organization-model/__tests__/resolve.test.ts +1 -1
  28. package/src/organization-model/__tests__/schema-refinements.test.ts +72 -0
  29. package/src/organization-model/cross-ref.ts +175 -0
  30. package/src/organization-model/domains/actions.ts +13 -0
  31. package/src/organization-model/domains/branding.ts +6 -6
  32. package/src/organization-model/domains/customers.ts +95 -78
  33. package/src/organization-model/domains/entities.ts +157 -144
  34. package/src/organization-model/domains/goals.ts +100 -83
  35. package/src/organization-model/domains/knowledge.ts +106 -93
  36. package/src/organization-model/domains/offerings.ts +88 -71
  37. package/src/organization-model/domains/policies.ts +115 -102
  38. package/src/organization-model/domains/roles.ts +109 -96
  39. package/src/organization-model/domains/sales.test.ts +104 -218
  40. package/src/organization-model/domains/sales.ts +212 -375
  41. package/src/organization-model/domains/statuses.ts +351 -339
  42. package/src/organization-model/domains/systems.ts +176 -164
  43. package/src/organization-model/helpers.ts +331 -306
  44. package/src/organization-model/index.ts +43 -0
  45. package/src/organization-model/published.ts +27 -2
  46. package/src/organization-model/schema-refinements.ts +667 -0
  47. package/src/organization-model/schema.ts +8 -715
  48. package/src/platform/constants/versions.ts +1 -1
  49. package/src/reference/_generated/contracts.md +1000 -1087
@@ -138,32 +138,13 @@ interface SystemEntry {
138
138
  subsystems?: Record<string, SystemEntry>;
139
139
  }
140
140
 
141
- /**
142
- * Command View Types
143
- *
144
- * Unified type definitions for the Command View graph visualization.
145
- * These types are used by both backend serialization and frontend rendering.
146
- *
147
- * Command View shows the resource graph: agents, workflows, triggers, integrations,
148
- * external resources, and human checkpoints with their relationships.
149
- */
150
-
151
- /**
152
- * Relationship types between resources
153
- *
154
- * - triggers: Resource initiates/starts another resource (orange)
155
- * - uses: Resource uses an integration (teal)
156
- * - approval: Resource requires human approval (yellow)
157
- */
158
- type RelationshipType = 'triggers' | 'uses' | 'approval';
159
-
160
141
  declare const SurfaceTypeSchema: z.ZodEnum<{
161
142
  dashboard: "dashboard";
162
143
  settings: "settings";
163
144
  graph: "graph";
164
- list: "list";
165
145
  page: "page";
166
146
  detail: "detail";
147
+ list: "list";
167
148
  }>;
168
149
  interface SidebarSurfaceNode {
169
150
  type: 'surface';
@@ -276,12 +257,12 @@ declare const OrgKnowledgeNodeSchema: z.ZodObject<{
276
257
  kind: z.ZodEnum<{
277
258
  knowledge: "knowledge";
278
259
  system: "system";
260
+ resource: "resource";
279
261
  action: "action";
280
262
  ontology: "ontology";
281
263
  role: "role";
282
- goal: "goal";
283
- resource: "resource";
284
264
  stage: "stage";
265
+ goal: "goal";
285
266
  "customer-segment": "customer-segment";
286
267
  offering: "offering";
287
268
  }>;
@@ -291,7 +272,7 @@ declare const OrgKnowledgeNodeSchema: z.ZodObject<{
291
272
  nodeId: z.ZodUnion<readonly [z.ZodString, z.ZodTemplateLiteral<`ontology:${string}`>]>;
292
273
  }, z.core.$strip>]>, z.ZodTransform<{
293
274
  target: {
294
- kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "resource" | "stage" | "customer-segment" | "offering";
275
+ kind: "knowledge" | "system" | "resource" | "action" | "ontology" | "role" | "stage" | "goal" | "customer-segment" | "offering";
295
276
  id: string;
296
277
  };
297
278
  nodeId: string;
@@ -299,7 +280,7 @@ declare const OrgKnowledgeNodeSchema: z.ZodObject<{
299
280
  nodeId: string;
300
281
  } | {
301
282
  target: {
302
- kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "resource" | "stage" | "customer-segment" | "offering";
283
+ kind: "knowledge" | "system" | "resource" | "action" | "ontology" | "role" | "stage" | "goal" | "customer-segment" | "offering";
303
284
  id: string;
304
285
  };
305
286
  }>>>>;
@@ -547,7 +528,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
547
528
  lastModified: string;
548
529
  } | undefined;
549
530
  }>>;
550
- branding: z.ZodObject<{
531
+ branding: z.ZodDefault<z.ZodObject<{
551
532
  organizationName: z.ZodString;
552
533
  productName: z.ZodString;
553
534
  shortName: z.ZodString;
@@ -556,7 +537,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
556
537
  light: z.ZodOptional<z.ZodString>;
557
538
  dark: z.ZodOptional<z.ZodString>;
558
539
  }, z.core.$strip>>;
559
- }, z.core.$strip>;
540
+ }, z.core.$strip>>;
560
541
  navigation: z.ZodDefault<z.ZodObject<{
561
542
  sidebar: z.ZodDefault<z.ZodObject<{
562
543
  primary: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<SidebarNode, unknown, z.core.$ZodTypeInternals<SidebarNode, unknown>>>>;
@@ -777,8 +758,8 @@ declare const OrganizationModelSchema: z.ZodObject<{
777
758
  description: z.ZodOptional<z.ZodString>;
778
759
  ownerRoleId: z.ZodOptional<z.ZodString>;
779
760
  status: z.ZodEnum<{
780
- deprecated: "deprecated";
781
761
  active: "active";
762
+ deprecated: "deprecated";
782
763
  archived: "archived";
783
764
  }>;
784
765
  ontology: z.ZodOptional<z.ZodObject<{
@@ -796,12 +777,12 @@ declare const OrganizationModelSchema: z.ZodObject<{
796
777
  codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
797
778
  path: z.ZodString;
798
779
  role: z.ZodEnum<{
799
- config: "config";
800
780
  entrypoint: "entrypoint";
801
781
  handler: "handler";
802
782
  schema: "schema";
803
783
  test: "test";
804
784
  docs: "docs";
785
+ config: "config";
805
786
  }>;
806
787
  symbol: z.ZodOptional<z.ZodString>;
807
788
  description: z.ZodOptional<z.ZodString>;
@@ -812,10 +793,10 @@ declare const OrganizationModelSchema: z.ZodObject<{
812
793
  label: z.ZodString;
813
794
  payloadSchema: z.ZodOptional<z.ZodString>;
814
795
  lifecycle: z.ZodOptional<z.ZodEnum<{
796
+ active: "active";
815
797
  deprecated: "deprecated";
816
798
  draft: "draft";
817
799
  beta: "beta";
818
- active: "active";
819
800
  archived: "archived";
820
801
  }>>;
821
802
  }, z.core.$strip>>>;
@@ -827,8 +808,8 @@ declare const OrganizationModelSchema: z.ZodObject<{
827
808
  description: z.ZodOptional<z.ZodString>;
828
809
  ownerRoleId: z.ZodOptional<z.ZodString>;
829
810
  status: z.ZodEnum<{
830
- deprecated: "deprecated";
831
811
  active: "active";
812
+ deprecated: "deprecated";
832
813
  archived: "archived";
833
814
  }>;
834
815
  ontology: z.ZodOptional<z.ZodObject<{
@@ -846,12 +827,12 @@ declare const OrganizationModelSchema: z.ZodObject<{
846
827
  codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
847
828
  path: z.ZodString;
848
829
  role: z.ZodEnum<{
849
- config: "config";
850
830
  entrypoint: "entrypoint";
851
831
  handler: "handler";
852
832
  schema: "schema";
853
833
  test: "test";
854
834
  docs: "docs";
835
+ config: "config";
855
836
  }>;
856
837
  symbol: z.ZodOptional<z.ZodString>;
857
838
  description: z.ZodOptional<z.ZodString>;
@@ -893,10 +874,10 @@ declare const OrganizationModelSchema: z.ZodObject<{
893
874
  label: z.ZodString;
894
875
  payloadSchema: z.ZodOptional<z.ZodString>;
895
876
  lifecycle: z.ZodOptional<z.ZodEnum<{
877
+ active: "active";
896
878
  deprecated: "deprecated";
897
879
  draft: "draft";
898
880
  beta: "beta";
899
- active: "active";
900
881
  archived: "archived";
901
882
  }>>;
902
883
  }, z.core.$strip>>>;
@@ -908,8 +889,8 @@ declare const OrganizationModelSchema: z.ZodObject<{
908
889
  description: z.ZodOptional<z.ZodString>;
909
890
  ownerRoleId: z.ZodOptional<z.ZodString>;
910
891
  status: z.ZodEnum<{
911
- deprecated: "deprecated";
912
892
  active: "active";
893
+ deprecated: "deprecated";
913
894
  archived: "archived";
914
895
  }>;
915
896
  ontology: z.ZodOptional<z.ZodObject<{
@@ -927,12 +908,12 @@ declare const OrganizationModelSchema: z.ZodObject<{
927
908
  codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
928
909
  path: z.ZodString;
929
910
  role: z.ZodEnum<{
930
- config: "config";
931
911
  entrypoint: "entrypoint";
932
912
  handler: "handler";
933
913
  schema: "schema";
934
914
  test: "test";
935
915
  docs: "docs";
916
+ config: "config";
936
917
  }>;
937
918
  symbol: z.ZodOptional<z.ZodString>;
938
919
  description: z.ZodOptional<z.ZodString>;
@@ -947,8 +928,8 @@ declare const OrganizationModelSchema: z.ZodObject<{
947
928
  description: z.ZodOptional<z.ZodString>;
948
929
  ownerRoleId: z.ZodOptional<z.ZodString>;
949
930
  status: z.ZodEnum<{
950
- deprecated: "deprecated";
951
931
  active: "active";
932
+ deprecated: "deprecated";
952
933
  archived: "archived";
953
934
  }>;
954
935
  ontology: z.ZodOptional<z.ZodObject<{
@@ -966,12 +947,12 @@ declare const OrganizationModelSchema: z.ZodObject<{
966
947
  codeRefs: z.ZodDefault<z.ZodArray<z.ZodObject<{
967
948
  path: z.ZodString;
968
949
  role: z.ZodEnum<{
969
- config: "config";
970
950
  entrypoint: "entrypoint";
971
951
  handler: "handler";
972
952
  schema: "schema";
973
953
  test: "test";
974
954
  docs: "docs";
955
+ config: "config";
975
956
  }>;
976
957
  symbol: z.ZodOptional<z.ZodString>;
977
958
  description: z.ZodOptional<z.ZodString>;
@@ -1016,9 +997,9 @@ declare const OrganizationModelSchema: z.ZodObject<{
1016
997
  id: z.ZodString;
1017
998
  }, z.core.$strip>], "kind">;
1018
999
  kind: z.ZodEnum<{
1000
+ approval: "approval";
1019
1001
  triggers: "triggers";
1020
1002
  uses: "uses";
1021
- approval: "approval";
1022
1003
  }>;
1023
1004
  to: z.ZodDiscriminatedUnion<[z.ZodObject<{
1024
1005
  kind: z.ZodLiteral<"system">;
@@ -1085,10 +1066,10 @@ declare const OrganizationModelSchema: z.ZodObject<{
1085
1066
  }, z.core.$strip>], "kind">>>;
1086
1067
  knowledge: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
1087
1068
  lifecycle: z.ZodDefault<z.ZodEnum<{
1069
+ active: "active";
1088
1070
  deprecated: "deprecated";
1089
1071
  draft: "draft";
1090
1072
  beta: "beta";
1091
- active: "active";
1092
1073
  archived: "archived";
1093
1074
  }>>;
1094
1075
  }, z.core.$strip>>>>;
@@ -1166,10 +1147,10 @@ declare const OrganizationModelSchema: z.ZodObject<{
1166
1147
  roleIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
1167
1148
  }, z.core.$strip>>;
1168
1149
  lifecycle: z.ZodDefault<z.ZodEnum<{
1150
+ active: "active";
1169
1151
  deprecated: "deprecated";
1170
1152
  draft: "draft";
1171
1153
  beta: "beta";
1172
- active: "active";
1173
1154
  archived: "archived";
1174
1155
  }>>;
1175
1156
  }, z.core.$strip>>>>;
@@ -1252,12 +1233,12 @@ declare const OrganizationModelSchema: z.ZodObject<{
1252
1233
  kind: z.ZodEnum<{
1253
1234
  knowledge: "knowledge";
1254
1235
  system: "system";
1236
+ resource: "resource";
1255
1237
  action: "action";
1256
1238
  ontology: "ontology";
1257
1239
  role: "role";
1258
- goal: "goal";
1259
- resource: "resource";
1260
1240
  stage: "stage";
1241
+ goal: "goal";
1261
1242
  "customer-segment": "customer-segment";
1262
1243
  offering: "offering";
1263
1244
  }>;
@@ -1267,7 +1248,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
1267
1248
  nodeId: z.ZodUnion<readonly [z.ZodString, z.ZodTemplateLiteral<`ontology:${string}`>]>;
1268
1249
  }, z.core.$strip>]>, z.ZodTransform<{
1269
1250
  target: {
1270
- kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "resource" | "stage" | "customer-segment" | "offering";
1251
+ kind: "knowledge" | "system" | "resource" | "action" | "ontology" | "role" | "stage" | "goal" | "customer-segment" | "offering";
1271
1252
  id: string;
1272
1253
  };
1273
1254
  nodeId: string;
@@ -1275,7 +1256,7 @@ declare const OrganizationModelSchema: z.ZodObject<{
1275
1256
  nodeId: string;
1276
1257
  } | {
1277
1258
  target: {
1278
- kind: "knowledge" | "system" | "action" | "ontology" | "role" | "goal" | "resource" | "stage" | "customer-segment" | "offering";
1259
+ kind: "knowledge" | "system" | "resource" | "action" | "ontology" | "role" | "stage" | "goal" | "customer-segment" | "offering";
1279
1260
  id: string;
1280
1261
  };
1281
1262
  }>>>>;
@@ -1286,6 +1267,25 @@ declare const OrganizationModelSchema: z.ZodObject<{
1286
1267
 
1287
1268
  type OrganizationModel = z.infer<typeof OrganizationModelSchema>;
1288
1269
 
1270
+ /**
1271
+ * Command View Types
1272
+ *
1273
+ * Unified type definitions for the Command View graph visualization.
1274
+ * These types are used by both backend serialization and frontend rendering.
1275
+ *
1276
+ * Command View shows the resource graph: agents, workflows, triggers, integrations,
1277
+ * external resources, and human checkpoints with their relationships.
1278
+ */
1279
+
1280
+ /**
1281
+ * Relationship types between resources
1282
+ *
1283
+ * - triggers: Resource initiates/starts another resource (orange)
1284
+ * - uses: Resource uses an integration (teal)
1285
+ * - approval: Resource requires human approval (yellow)
1286
+ */
1287
+ type RelationshipType = 'triggers' | 'uses' | 'approval';
1288
+
1289
1289
  type OrganizationGraphNodeKind = 'organization' | 'system' | 'role' | 'action' | 'entity' | 'event' | 'policy' | 'stage' | 'resource' | 'knowledge' | 'customer-segment' | 'offering' | 'goal' | 'surface' | 'navigation-group' | 'ontology';
1290
1290
  type OrganizationGraphEdgeKind = 'contains' | 'references' | 'maps_to' | 'uses' | 'governs' | 'links' | 'affects' | 'emits' | 'originates_from' | 'triggers' | 'approval' | 'applies_to' | 'effects' | 'actions' | 'reads' | 'writes' | 'uses_catalog';
1291
1291