@elevasis/core 0.30.0 → 0.32.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 (30) hide show
  1. package/dist/auth/index.d.ts +58 -5
  2. package/dist/index.d.ts +16 -5
  3. package/dist/index.js +73 -109
  4. package/dist/knowledge/index.d.ts +10 -2
  5. package/dist/organization-model/index.d.ts +16 -5
  6. package/dist/organization-model/index.js +73 -109
  7. package/dist/test-utils/index.d.ts +55 -2
  8. package/dist/test-utils/index.js +72 -108
  9. package/package.json +1 -1
  10. package/src/_gen/__tests__/__snapshots__/contracts.md.snap +376 -446
  11. package/src/business/acquisition/api-schemas.test.ts +69 -5
  12. package/src/business/acquisition/crm-state-actions.test.ts +24 -6
  13. package/src/business/pdf/sections/__tests__/proposal-document.test.ts +146 -0
  14. package/src/business/pdf/sections/acceptance.ts +114 -112
  15. package/src/business/pdf/sections/proposal-document.ts +206 -200
  16. package/src/execution/engine/index.ts +440 -439
  17. package/src/execution/engine/tools/integration/types/clickup.ts +57 -0
  18. package/src/execution/engine/tools/integration/types/index.ts +20 -19
  19. package/src/execution/engine/tools/tool-maps.ts +16 -0
  20. package/src/organization-model/__tests__/domains/entities.test.ts +35 -56
  21. package/src/organization-model/__tests__/domains/passthrough-extensibility.test.ts +199 -0
  22. package/src/organization-model/domains/branding.ts +58 -16
  23. package/src/organization-model/domains/entities.ts +0 -103
  24. package/src/organization-model/domains/identity.ts +122 -94
  25. package/src/organization-model/domains/sales.test.ts +35 -28
  26. package/src/organization-model/domains/sales.ts +0 -85
  27. package/src/organization-model/published.ts +0 -1
  28. package/src/organization-model/schema.ts +2 -2
  29. package/src/reference/_generated/contracts.md +0 -94
  30. package/src/supabase/database.types.ts +45 -0
@@ -494,15 +494,55 @@ DisplayMetadataSchema.extend({
494
494
 
495
495
  // src/organization-model/domains/branding.ts
496
496
  var OrganizationModelBrandingSchema = z.object({
497
+ /**
498
+ * @deprecated Prefer `identity.organizationName`; branding retains it for back-compat.
499
+ * Legacy tenants that have not set `identity.organizationName` fall back to this field.
500
+ */
497
501
  organizationName: LabelSchema,
502
+ /**
503
+ * @deprecated Prefer `identity.productName`; branding retains it for back-compat.
504
+ * Legacy tenants that have not set `identity.productName` fall back to this field.
505
+ */
498
506
  productName: LabelSchema,
507
+ /**
508
+ * @deprecated Prefer `identity.shortName`; branding retains it for back-compat.
509
+ * Legacy tenants that have not set `identity.shortName` fall back to this field.
510
+ */
499
511
  shortName: z.string().trim().min(1).max(40),
512
+ /**
513
+ * @deprecated Prefer `identity.description`; branding retains it for back-compat.
514
+ * Legacy tenants that have not set `identity.description` fall back to this field.
515
+ */
500
516
  description: DescriptionSchema.optional(),
501
517
  logos: z.object({
502
518
  light: z.string().trim().min(1).max(2048).optional(),
503
519
  dark: z.string().trim().min(1).max(2048).optional()
504
- }).default({})
505
- });
520
+ }).default({}),
521
+ /**
522
+ * Brand voice — how the organization communicates. Plain-language description
523
+ * of tone, register, and personality (e.g. "Direct and human — no jargon").
524
+ * Max 280 characters.
525
+ */
526
+ voice: z.string().trim().max(280).optional(),
527
+ /**
528
+ * Brand tagline or positioning statement — the memorable one-liner that
529
+ * captures the brand's promise or differentiator. Max 200 characters.
530
+ */
531
+ tagline: z.string().trim().max(200).optional(),
532
+ /**
533
+ * Core brand values — an ordered list of principles the organization stands
534
+ * for (e.g. ["Transparency", "Craftsmanship", "Velocity"]). Each entry must
535
+ * be a non-empty trimmed string.
536
+ */
537
+ values: z.array(z.string().trim().min(1)).optional(),
538
+ /**
539
+ * ID of the active UI theme preset from the UI theme-presets registry.
540
+ * The UI layer resolves this to colors and typography via `usePresetsContext()`.
541
+ * Free-form string — validation and fallback state are handled at the UI layer.
542
+ * Min 1, max 64 characters.
543
+ */
544
+ themePresetId: z.string().trim().min(1).max(64).optional()
545
+ }).passthrough();
506
546
  var DEFAULT_ORGANIZATION_MODEL_BRANDING = {
507
547
  organizationName: "Default Organization",
508
548
  productName: "Organization OS",
@@ -633,8 +673,33 @@ var IdentityDomainSchema = z.object({
633
673
  * background. Populated by /setup; surfaced to agents as organizational context.
634
674
  * Optional — many projects have no external client.
635
675
  */
636
- clientBrief: z.string().trim().default("")
637
- });
676
+ clientBrief: z.string().trim().default(""),
677
+ /**
678
+ * Display name of the organization as shown to end users.
679
+ * Recommended placement for display naming — prefer this over the deprecated
680
+ * `branding.organizationName`. Falls back to `branding.organizationName` for
681
+ * legacy tenants that have not yet migrated.
682
+ */
683
+ organizationName: LabelSchema.optional(),
684
+ /**
685
+ * Display name of the primary product or platform.
686
+ * Recommended placement for display naming — prefer this over the deprecated
687
+ * `branding.productName`. Falls back to `branding.productName` for legacy tenants.
688
+ */
689
+ productName: LabelSchema.optional(),
690
+ /**
691
+ * Short abbreviated name used in space-constrained UI surfaces (max 40 chars).
692
+ * Recommended placement for display naming — prefer this over the deprecated
693
+ * `branding.shortName`. Falls back to `branding.shortName` for legacy tenants.
694
+ */
695
+ shortName: z.string().trim().min(1).max(40).optional(),
696
+ /**
697
+ * Plain-language description of the organization for display and discovery.
698
+ * Recommended placement for display naming — prefer this over the deprecated
699
+ * `branding.description`. Falls back to `branding.description` for legacy tenants.
700
+ */
701
+ description: DescriptionSchema.optional()
702
+ }).passthrough();
638
703
  var DEFAULT_ORGANIZATION_MODEL_IDENTITY = {
639
704
  mission: "",
640
705
  vision: "",
@@ -831,107 +896,6 @@ var EntitySchema = z.object({
831
896
  var EntitiesDomainSchema = z.record(z.string(), EntitySchema).refine((record) => Object.entries(record).every(([key, entry]) => entry.id === key), {
832
897
  message: "Each entity entry id must match its map key"
833
898
  }).default({});
834
- var ENTITY_ENTRY_INPUTS = [
835
- {
836
- id: "crm.deal",
837
- order: 10,
838
- label: "Deal",
839
- description: "A CRM opportunity or sales pipeline record.",
840
- ownedBySystemId: "sales.crm",
841
- table: "crm_deals",
842
- stateCatalogId: "crm.pipeline",
843
- links: [{ toEntity: "crm.contact", kind: "has-many", via: "deal_contacts", label: "contacts" }]
844
- },
845
- {
846
- id: "crm.contact",
847
- order: 20,
848
- label: "CRM Contact",
849
- description: "A person associated with a CRM relationship or deal.",
850
- ownedBySystemId: "sales.crm",
851
- table: "crm_contacts"
852
- },
853
- {
854
- id: "leadgen.list",
855
- order: 30,
856
- label: "Lead List",
857
- description: "A prospecting list that groups companies and contacts for acquisition workflows.",
858
- ownedBySystemId: "sales.lead-gen",
859
- table: "acq_lists",
860
- links: [
861
- { toEntity: "leadgen.company", kind: "has-many", via: "acq_list_companies", label: "companies" },
862
- { toEntity: "leadgen.contact", kind: "has-many", via: "acq_list_members", label: "contacts" }
863
- ]
864
- },
865
- {
866
- id: "leadgen.company",
867
- order: 40,
868
- label: "Lead Company",
869
- description: "A company record sourced, enriched, and qualified during prospecting.",
870
- ownedBySystemId: "sales.lead-gen",
871
- table: "acq_list_companies",
872
- stateCatalogId: "lead-gen.company",
873
- links: [
874
- { toEntity: "leadgen.list", kind: "belongs-to", via: "list_id", label: "list" },
875
- { toEntity: "leadgen.contact", kind: "has-many", via: "company_id", label: "contacts" }
876
- ]
877
- },
878
- {
879
- id: "leadgen.contact",
880
- order: 50,
881
- label: "Lead Contact",
882
- description: "A prospect contact discovered or enriched during lead generation.",
883
- ownedBySystemId: "sales.lead-gen",
884
- table: "acq_list_members",
885
- stateCatalogId: "lead-gen.contact",
886
- links: [
887
- { toEntity: "leadgen.list", kind: "belongs-to", via: "list_id", label: "list" },
888
- { toEntity: "leadgen.company", kind: "belongs-to", via: "company_id", label: "company" }
889
- ]
890
- },
891
- {
892
- id: "delivery.project",
893
- order: 60,
894
- label: "Project",
895
- description: "A client delivery project.",
896
- ownedBySystemId: "projects",
897
- table: "projects",
898
- links: [
899
- { toEntity: "delivery.milestone", kind: "has-many", via: "project_id", label: "milestones" },
900
- { toEntity: "delivery.task", kind: "has-many", via: "project_id", label: "tasks" }
901
- ]
902
- },
903
- {
904
- id: "delivery.milestone",
905
- order: 70,
906
- label: "Milestone",
907
- description: "A delivery checkpoint within a project.",
908
- ownedBySystemId: "projects",
909
- table: "project_milestones",
910
- links: [
911
- { toEntity: "delivery.project", kind: "belongs-to", via: "project_id", label: "project" },
912
- { toEntity: "delivery.task", kind: "has-many", via: "milestone_id", label: "tasks" }
913
- ]
914
- },
915
- {
916
- id: "delivery.task",
917
- order: 80,
918
- label: "Task",
919
- description: "A delivery task that can move through the task status catalog.",
920
- ownedBySystemId: "projects",
921
- table: "project_tasks",
922
- stateCatalogId: "delivery.task",
923
- links: [
924
- { toEntity: "delivery.project", kind: "belongs-to", via: "project_id", label: "project" },
925
- { toEntity: "delivery.milestone", kind: "belongs-to", via: "milestone_id", label: "milestone" }
926
- ]
927
- }
928
- ];
929
- var DEFAULT_ORGANIZATION_MODEL_ENTITIES = Object.fromEntries(
930
- ENTITY_ENTRY_INPUTS.map((entity) => {
931
- const parsed = EntitySchema.parse(entity);
932
- return [parsed.id, parsed];
933
- })
934
- );
935
899
  function defineEntity(entry) {
936
900
  return EntitySchema.parse(entry);
937
901
  }
@@ -2428,7 +2392,7 @@ var OrganizationModelSchemaBase = z.object({
2428
2392
  resources: ResourcesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_RESOURCES),
2429
2393
  topology: OmTopologyDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_TOPOLOGY),
2430
2394
  actions: ActionsDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_ACTIONS),
2431
- entities: EntitiesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_ENTITIES),
2395
+ entities: EntitiesDomainSchema.default({}),
2432
2396
  policies: PoliciesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_POLICIES),
2433
2397
  // D3: flat Record<id, OrgKnowledgeNode> — no wrapper object
2434
2398
  knowledge: KnowledgeDomainSchema.default({})
@@ -2534,7 +2498,7 @@ var SETTINGS_ROLES_SURFACE_ID = "settings.roles";
2534
2498
 
2535
2499
  // src/organization-model/defaults.ts
2536
2500
  var DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE = {};
2537
- var DEFAULT_ORGANIZATION_MODEL_ENTITIES2 = {};
2501
+ var DEFAULT_ORGANIZATION_MODEL_ENTITIES = {};
2538
2502
  var DEFAULT_ORGANIZATION_MODEL_NAVIGATION2 = {
2539
2503
  sidebar: {
2540
2504
  primary: {},
@@ -2562,7 +2526,7 @@ var DEFAULT_ORGANIZATION_MODEL = {
2562
2526
  // Generic empty actions map. Elevasis-specific action entries have been relocated to
2563
2527
  // `@repo/elevasis-core/src/organization-model/actions.ts`.
2564
2528
  actions: {},
2565
- entities: DEFAULT_ORGANIZATION_MODEL_ENTITIES2,
2529
+ entities: DEFAULT_ORGANIZATION_MODEL_ENTITIES,
2566
2530
  policies: DEFAULT_ORGANIZATION_MODEL_POLICIES,
2567
2531
  knowledge: DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE
2568
2532
  };
@@ -3442,4 +3406,4 @@ function scaffoldOrganizationModel(model, spec) {
3442
3406
  return scaffoldKnowledgeNode(model, spec);
3443
3407
  }
3444
3408
 
3445
- export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, CodeReferenceRoleSchema, CodeReferenceSchema, ContractRefSchema, CustomerSegmentSchema, CustomersDomainSchema, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA, DEFAULT_ORGANIZATION_MODEL_ENTITIES, DEFAULT_ORGANIZATION_MODEL_GOALS, DEFAULT_ORGANIZATION_MODEL_NAVIGATION, DEFAULT_ORGANIZATION_MODEL_OFFERINGS, DEFAULT_ORGANIZATION_MODEL_POLICIES, DEFAULT_ORGANIZATION_MODEL_RESOURCES, DEFAULT_ORGANIZATION_MODEL_ROLES, DEFAULT_ORGANIZATION_MODEL_STATUSES, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DEFAULT_ORGANIZATION_MODEL_TOPOLOGY, EntitiesDomainSchema, EntityIdSchema, EntityLinkKindSchema, EntityLinkSchema, EntitySchema, EventDescriptorSchema, EventEmissionDescriptorSchema, EventIdSchema, FirmographicsSchema, GoalsDomainSchema, HumanRoleHolderSchema, IconNameSchema, IntegrationResourceEntrySchema, KNOWLEDGE_FEATURE_ID, KNOWLEDGE_SYSTEM_ID, KeyResultSchema, KnowledgeDomainSchema, KnowledgeLinkSchema, KnowledgeTargetKindSchema, KnowledgeTargetRefSchema, LinkSchema, MONITORING_FEATURE_ID, MONITORING_SYSTEM_ID, McpToolInvocationSchema, NavigationGroupSchema, NodeIdPathSchema, NodeIdStringSchema, OPERATIONS_COMMAND_VIEW_SURFACE_ID, OPERATIONS_FEATURE_ID, OPERATIONS_SYSTEM_ID, ORGANIZATION_MODEL_ICON_TOKENS, ObjectiveSchema, OfferingsDomainSchema, OmTopologyDomainSchema, OmTopologyMetadataSchema, OmTopologyNodeKindSchema, OmTopologyNodeRefSchema, OmTopologyRelationshipKindSchema, OmTopologyRelationshipSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema, OntologySurfaceTypeSchema, OntologyValueTypeSchema, OrgKnowledgeKindSchema, OrgKnowledgeNodeSchema, OrganizationModelBuiltinIconTokenSchema, OrganizationModelDomainKeySchema, OrganizationModelDomainMetadataByDomainSchema, OrganizationModelDomainMetadataSchema, OrganizationModelIconTokenSchema, OrganizationModelNavigationSchema, OrganizationModelSchema, PROJECTS_FEATURE_ID, PROJECTS_INDEX_SURFACE_ID, PROJECTS_SYSTEM_ID, PROJECTS_VIEW_ACTION_ID, PROSPECTING_FEATURE_ID, PROSPECTING_LISTS_SURFACE_ID, PROSPECTING_SYSTEM_ID, PoliciesDomainSchema, PolicyApplicabilitySchema, PolicyEffectSchema, PolicyIdSchema, PolicyPredicateSchema, PolicySchema, PolicyTriggerSchema, PricingModelSchema, ProductSchema, ResourceEntrySchema, ResourceGovernanceStatusSchema, ResourceIdSchema, ResourceKindSchema, ResourceOntologyBindingSchema, ResourcesDomainSchema, RoleHolderSchema, RoleHoldersSchema, RoleIdSchema, RoleSchema, RolesDomainSchema, SALES_FEATURE_ID, SALES_PIPELINE_SURFACE_ID, SALES_SYSTEM_ID, SEO_FEATURE_ID, SEO_SYSTEM_ID, SETTINGS_FEATURE_ID, SETTINGS_ROLES_SURFACE_ID, SETTINGS_SYSTEM_ID, ScriptExecutionInvocationSchema, ScriptResourceEntrySchema, ScriptResourceLanguageSchema, ScriptResourceSourceSchema, SidebarNavigationSchema, SidebarNodeSchema, SidebarSectionSchema, SidebarSurfaceTargetsSchema, SlashCommandInvocationSchema, StatusEntrySchema, StatusSemanticClassSchema, StatusesDomainSchema, SurfaceDefinitionSchema, SurfaceTypeSchema, SystemEntrySchema, SystemIdSchema, SystemKindSchema, SystemLifecycleSchema, SystemPathSchema, SystemStatusSchema, SystemUiSchema, SystemsDomainSchema, TeamRoleHolderSchema, TechStackEntrySchema, UiPositionSchema, WorkflowResourceEntrySchema, compileOrganizationOntology, compileTopologyNodeRef, createFoundationOrganizationModel, defineAction, defineActions, defineCustomer, defineCustomers, defineDomainRecord, defineEntities, defineEntity, defineGoal, defineGoals, defineKnowledgeNode, defineKnowledgeNodes, defineOffering, defineOfferings, defineOrganizationModel, definePolicies, definePolicy, defineResource, defineResourceOntology, defineResources, defineRole, defineRoles, defineStatus, defineStatuses, defineSystem, defineSystems, defineTopology, defineTopologyRelationship, findOrganizationActionById, formatOntologyId, getOntologyDiagnostics, getSortedSidebarEntries, isOntologyGraphNodeId, isOntologyTopologyRef, listAllSystems, listResolvedOntologyRecords, ontologyGraphNodeId, ontologyIdFromGraphNodeId, parseContractRef, parseOntologyId, parseTopologyNodeRef, projectOrganizationSurfaces, resolveOrganizationModel, resolveOrganizationModelWithResources, scaffoldOrganizationModel, topologyRef, topologyRelationship, validateOrganizationSurfaceProjection };
3409
+ export { ActionIdSchema, ActionInvocationKindSchema, ActionInvocationSchema, ActionRefSchema, ActionSchema, ActionScopeSchema, ActionsDomainSchema, AgentKindSchema, AgentResourceEntrySchema, AgentRoleHolderSchema, ApiEndpointInvocationSchema, CodeReferenceRoleSchema, CodeReferenceSchema, ContractRefSchema, CustomerSegmentSchema, CustomersDomainSchema, DEFAULT_ONTOLOGY_SCOPE, DEFAULT_ORGANIZATION_MODEL, DEFAULT_ORGANIZATION_MODEL_ACTIONS, DEFAULT_ORGANIZATION_MODEL_CUSTOMERS, DEFAULT_ORGANIZATION_MODEL_DOMAIN_METADATA, DEFAULT_ORGANIZATION_MODEL_GOALS, DEFAULT_ORGANIZATION_MODEL_NAVIGATION, DEFAULT_ORGANIZATION_MODEL_OFFERINGS, DEFAULT_ORGANIZATION_MODEL_POLICIES, DEFAULT_ORGANIZATION_MODEL_RESOURCES, DEFAULT_ORGANIZATION_MODEL_ROLES, DEFAULT_ORGANIZATION_MODEL_STATUSES, DEFAULT_ORGANIZATION_MODEL_SYSTEMS, DEFAULT_ORGANIZATION_MODEL_TOPOLOGY, EntitiesDomainSchema, EntityIdSchema, EntityLinkKindSchema, EntityLinkSchema, EntitySchema, EventDescriptorSchema, EventEmissionDescriptorSchema, EventIdSchema, FirmographicsSchema, GoalsDomainSchema, HumanRoleHolderSchema, IconNameSchema, IntegrationResourceEntrySchema, KNOWLEDGE_FEATURE_ID, KNOWLEDGE_SYSTEM_ID, KeyResultSchema, KnowledgeDomainSchema, KnowledgeLinkSchema, KnowledgeTargetKindSchema, KnowledgeTargetRefSchema, LinkSchema, MONITORING_FEATURE_ID, MONITORING_SYSTEM_ID, McpToolInvocationSchema, NavigationGroupSchema, NodeIdPathSchema, NodeIdStringSchema, OPERATIONS_COMMAND_VIEW_SURFACE_ID, OPERATIONS_FEATURE_ID, OPERATIONS_SYSTEM_ID, ORGANIZATION_MODEL_ICON_TOKENS, ObjectiveSchema, OfferingsDomainSchema, OmTopologyDomainSchema, OmTopologyMetadataSchema, OmTopologyNodeKindSchema, OmTopologyNodeRefSchema, OmTopologyRelationshipKindSchema, OmTopologyRelationshipSchema, OntologyActionTypeSchema, OntologyCatalogTypeSchema, OntologyEventTypeSchema, OntologyGroupSchema, OntologyIdSchema, OntologyInterfaceTypeSchema, OntologyKindSchema, OntologyLinkTypeSchema, OntologyObjectTypeSchema, OntologyScopeSchema, OntologySharedPropertySchema, OntologySurfaceTypeSchema, OntologyValueTypeSchema, OrgKnowledgeKindSchema, OrgKnowledgeNodeSchema, OrganizationModelBuiltinIconTokenSchema, OrganizationModelDomainKeySchema, OrganizationModelDomainMetadataByDomainSchema, OrganizationModelDomainMetadataSchema, OrganizationModelIconTokenSchema, OrganizationModelNavigationSchema, OrganizationModelSchema, PROJECTS_FEATURE_ID, PROJECTS_INDEX_SURFACE_ID, PROJECTS_SYSTEM_ID, PROJECTS_VIEW_ACTION_ID, PROSPECTING_FEATURE_ID, PROSPECTING_LISTS_SURFACE_ID, PROSPECTING_SYSTEM_ID, PoliciesDomainSchema, PolicyApplicabilitySchema, PolicyEffectSchema, PolicyIdSchema, PolicyPredicateSchema, PolicySchema, PolicyTriggerSchema, PricingModelSchema, ProductSchema, ResourceEntrySchema, ResourceGovernanceStatusSchema, ResourceIdSchema, ResourceKindSchema, ResourceOntologyBindingSchema, ResourcesDomainSchema, RoleHolderSchema, RoleHoldersSchema, RoleIdSchema, RoleSchema, RolesDomainSchema, SALES_FEATURE_ID, SALES_PIPELINE_SURFACE_ID, SALES_SYSTEM_ID, SEO_FEATURE_ID, SEO_SYSTEM_ID, SETTINGS_FEATURE_ID, SETTINGS_ROLES_SURFACE_ID, SETTINGS_SYSTEM_ID, ScriptExecutionInvocationSchema, ScriptResourceEntrySchema, ScriptResourceLanguageSchema, ScriptResourceSourceSchema, SidebarNavigationSchema, SidebarNodeSchema, SidebarSectionSchema, SidebarSurfaceTargetsSchema, SlashCommandInvocationSchema, StatusEntrySchema, StatusSemanticClassSchema, StatusesDomainSchema, SurfaceDefinitionSchema, SurfaceTypeSchema, SystemEntrySchema, SystemIdSchema, SystemKindSchema, SystemLifecycleSchema, SystemPathSchema, SystemStatusSchema, SystemUiSchema, SystemsDomainSchema, TeamRoleHolderSchema, TechStackEntrySchema, UiPositionSchema, WorkflowResourceEntrySchema, compileOrganizationOntology, compileTopologyNodeRef, createFoundationOrganizationModel, defineAction, defineActions, defineCustomer, defineCustomers, defineDomainRecord, defineEntities, defineEntity, defineGoal, defineGoals, defineKnowledgeNode, defineKnowledgeNodes, defineOffering, defineOfferings, defineOrganizationModel, definePolicies, definePolicy, defineResource, defineResourceOntology, defineResources, defineRole, defineRoles, defineStatus, defineStatuses, defineSystem, defineSystems, defineTopology, defineTopologyRelationship, findOrganizationActionById, formatOntologyId, getOntologyDiagnostics, getSortedSidebarEntries, isOntologyGraphNodeId, isOntologyTopologyRef, listAllSystems, listResolvedOntologyRecords, ontologyGraphNodeId, ontologyIdFromGraphNodeId, parseContractRef, parseOntologyId, parseTopologyNodeRef, projectOrganizationSurfaces, resolveOrganizationModel, resolveOrganizationModelWithResources, scaffoldOrganizationModel, topologyRef, topologyRelationship, validateOrganizationSurfaceProjection };
@@ -1464,6 +1464,51 @@ type Database = {
1464
1464
  }
1465
1465
  ];
1466
1466
  };
1467
+ deployment_organization_models: {
1468
+ Row: {
1469
+ created_at: string;
1470
+ deployment_id: string;
1471
+ model_hash: string | null;
1472
+ organization_id: string;
1473
+ organization_model: Json;
1474
+ schema_version: string;
1475
+ updated_at: string;
1476
+ };
1477
+ Insert: {
1478
+ created_at?: string;
1479
+ deployment_id: string;
1480
+ model_hash?: string | null;
1481
+ organization_id: string;
1482
+ organization_model: Json;
1483
+ schema_version?: string;
1484
+ updated_at?: string;
1485
+ };
1486
+ Update: {
1487
+ created_at?: string;
1488
+ deployment_id?: string;
1489
+ model_hash?: string | null;
1490
+ organization_id?: string;
1491
+ organization_model?: Json;
1492
+ schema_version?: string;
1493
+ updated_at?: string;
1494
+ };
1495
+ Relationships: [
1496
+ {
1497
+ foreignKeyName: "deployment_organization_models_deployment_id_fkey";
1498
+ columns: ["deployment_id"];
1499
+ isOneToOne: true;
1500
+ referencedRelation: "deployments";
1501
+ referencedColumns: ["id"];
1502
+ },
1503
+ {
1504
+ foreignKeyName: "deployment_organization_models_organization_id_fkey";
1505
+ columns: ["organization_id"];
1506
+ isOneToOne: false;
1507
+ referencedRelation: "organizations";
1508
+ referencedColumns: ["id"];
1509
+ }
1510
+ ];
1511
+ };
1467
1512
  deployments: {
1468
1513
  Row: {
1469
1514
  created_at: string;
@@ -3961,7 +4006,11 @@ declare const OrganizationModelSchema: z.ZodObject<{
3961
4006
  light: z.ZodOptional<z.ZodString>;
3962
4007
  dark: z.ZodOptional<z.ZodString>;
3963
4008
  }, z.core.$strip>>;
3964
- }, z.core.$strip>>;
4009
+ voice: z.ZodOptional<z.ZodString>;
4010
+ tagline: z.ZodOptional<z.ZodString>;
4011
+ values: z.ZodOptional<z.ZodArray<z.ZodString>>;
4012
+ themePresetId: z.ZodOptional<z.ZodString>;
4013
+ }, z.core.$loose>>;
3965
4014
  navigation: z.ZodDefault<z.ZodObject<{
3966
4015
  sidebar: z.ZodDefault<z.ZodObject<{
3967
4016
  primary: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodType<SidebarNode, unknown, z.core.$ZodTypeInternals<SidebarNode, unknown>>>>;
@@ -4008,7 +4057,11 @@ declare const OrganizationModelSchema: z.ZodObject<{
4008
4057
  }, z.core.$strip>>;
4009
4058
  }, z.core.$strip>>;
4010
4059
  clientBrief: z.ZodDefault<z.ZodString>;
4011
- }, z.core.$strip>>;
4060
+ organizationName: z.ZodOptional<z.ZodString>;
4061
+ productName: z.ZodOptional<z.ZodString>;
4062
+ shortName: z.ZodOptional<z.ZodString>;
4063
+ description: z.ZodOptional<z.ZodString>;
4064
+ }, z.core.$loose>>;
4012
4065
  customers: z.ZodDefault<z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
4013
4066
  id: z.ZodString;
4014
4067
  order: z.ZodNumber;
@@ -19895,15 +19895,55 @@ DisplayMetadataSchema.extend({
19895
19895
 
19896
19896
  // src/organization-model/domains/branding.ts
19897
19897
  var OrganizationModelBrandingSchema = z.object({
19898
+ /**
19899
+ * @deprecated Prefer `identity.organizationName`; branding retains it for back-compat.
19900
+ * Legacy tenants that have not set `identity.organizationName` fall back to this field.
19901
+ */
19898
19902
  organizationName: LabelSchema,
19903
+ /**
19904
+ * @deprecated Prefer `identity.productName`; branding retains it for back-compat.
19905
+ * Legacy tenants that have not set `identity.productName` fall back to this field.
19906
+ */
19899
19907
  productName: LabelSchema,
19908
+ /**
19909
+ * @deprecated Prefer `identity.shortName`; branding retains it for back-compat.
19910
+ * Legacy tenants that have not set `identity.shortName` fall back to this field.
19911
+ */
19900
19912
  shortName: z.string().trim().min(1).max(40),
19913
+ /**
19914
+ * @deprecated Prefer `identity.description`; branding retains it for back-compat.
19915
+ * Legacy tenants that have not set `identity.description` fall back to this field.
19916
+ */
19901
19917
  description: DescriptionSchema.optional(),
19902
19918
  logos: z.object({
19903
19919
  light: z.string().trim().min(1).max(2048).optional(),
19904
19920
  dark: z.string().trim().min(1).max(2048).optional()
19905
- }).default({})
19906
- });
19921
+ }).default({}),
19922
+ /**
19923
+ * Brand voice — how the organization communicates. Plain-language description
19924
+ * of tone, register, and personality (e.g. "Direct and human — no jargon").
19925
+ * Max 280 characters.
19926
+ */
19927
+ voice: z.string().trim().max(280).optional(),
19928
+ /**
19929
+ * Brand tagline or positioning statement — the memorable one-liner that
19930
+ * captures the brand's promise or differentiator. Max 200 characters.
19931
+ */
19932
+ tagline: z.string().trim().max(200).optional(),
19933
+ /**
19934
+ * Core brand values — an ordered list of principles the organization stands
19935
+ * for (e.g. ["Transparency", "Craftsmanship", "Velocity"]). Each entry must
19936
+ * be a non-empty trimmed string.
19937
+ */
19938
+ values: z.array(z.string().trim().min(1)).optional(),
19939
+ /**
19940
+ * ID of the active UI theme preset from the UI theme-presets registry.
19941
+ * The UI layer resolves this to colors and typography via `usePresetsContext()`.
19942
+ * Free-form string — validation and fallback state are handled at the UI layer.
19943
+ * Min 1, max 64 characters.
19944
+ */
19945
+ themePresetId: z.string().trim().min(1).max(64).optional()
19946
+ }).passthrough();
19907
19947
  var DEFAULT_ORGANIZATION_MODEL_BRANDING = {
19908
19948
  organizationName: "Default Organization",
19909
19949
  productName: "Organization OS",
@@ -20022,8 +20062,33 @@ var IdentityDomainSchema = z.object({
20022
20062
  * background. Populated by /setup; surfaced to agents as organizational context.
20023
20063
  * Optional — many projects have no external client.
20024
20064
  */
20025
- clientBrief: z.string().trim().default("")
20026
- });
20065
+ clientBrief: z.string().trim().default(""),
20066
+ /**
20067
+ * Display name of the organization as shown to end users.
20068
+ * Recommended placement for display naming — prefer this over the deprecated
20069
+ * `branding.organizationName`. Falls back to `branding.organizationName` for
20070
+ * legacy tenants that have not yet migrated.
20071
+ */
20072
+ organizationName: LabelSchema.optional(),
20073
+ /**
20074
+ * Display name of the primary product or platform.
20075
+ * Recommended placement for display naming — prefer this over the deprecated
20076
+ * `branding.productName`. Falls back to `branding.productName` for legacy tenants.
20077
+ */
20078
+ productName: LabelSchema.optional(),
20079
+ /**
20080
+ * Short abbreviated name used in space-constrained UI surfaces (max 40 chars).
20081
+ * Recommended placement for display naming — prefer this over the deprecated
20082
+ * `branding.shortName`. Falls back to `branding.shortName` for legacy tenants.
20083
+ */
20084
+ shortName: z.string().trim().min(1).max(40).optional(),
20085
+ /**
20086
+ * Plain-language description of the organization for display and discovery.
20087
+ * Recommended placement for display naming — prefer this over the deprecated
20088
+ * `branding.description`. Falls back to `branding.description` for legacy tenants.
20089
+ */
20090
+ description: DescriptionSchema.optional()
20091
+ }).passthrough();
20027
20092
  var DEFAULT_ORGANIZATION_MODEL_IDENTITY = {
20028
20093
  mission: "",
20029
20094
  vision: "",
@@ -20173,107 +20238,6 @@ var EntitySchema = z.object({
20173
20238
  var EntitiesDomainSchema = z.record(z.string(), EntitySchema).refine((record) => Object.entries(record).every(([key, entry]) => entry.id === key), {
20174
20239
  message: "Each entity entry id must match its map key"
20175
20240
  }).default({});
20176
- var ENTITY_ENTRY_INPUTS = [
20177
- {
20178
- id: "crm.deal",
20179
- order: 10,
20180
- label: "Deal",
20181
- description: "A CRM opportunity or sales pipeline record.",
20182
- ownedBySystemId: "sales.crm",
20183
- table: "crm_deals",
20184
- stateCatalogId: "crm.pipeline",
20185
- links: [{ toEntity: "crm.contact", kind: "has-many", via: "deal_contacts", label: "contacts" }]
20186
- },
20187
- {
20188
- id: "crm.contact",
20189
- order: 20,
20190
- label: "CRM Contact",
20191
- description: "A person associated with a CRM relationship or deal.",
20192
- ownedBySystemId: "sales.crm",
20193
- table: "crm_contacts"
20194
- },
20195
- {
20196
- id: "leadgen.list",
20197
- order: 30,
20198
- label: "Lead List",
20199
- description: "A prospecting list that groups companies and contacts for acquisition workflows.",
20200
- ownedBySystemId: "sales.lead-gen",
20201
- table: "acq_lists",
20202
- links: [
20203
- { toEntity: "leadgen.company", kind: "has-many", via: "acq_list_companies", label: "companies" },
20204
- { toEntity: "leadgen.contact", kind: "has-many", via: "acq_list_members", label: "contacts" }
20205
- ]
20206
- },
20207
- {
20208
- id: "leadgen.company",
20209
- order: 40,
20210
- label: "Lead Company",
20211
- description: "A company record sourced, enriched, and qualified during prospecting.",
20212
- ownedBySystemId: "sales.lead-gen",
20213
- table: "acq_list_companies",
20214
- stateCatalogId: "lead-gen.company",
20215
- links: [
20216
- { toEntity: "leadgen.list", kind: "belongs-to", via: "list_id", label: "list" },
20217
- { toEntity: "leadgen.contact", kind: "has-many", via: "company_id", label: "contacts" }
20218
- ]
20219
- },
20220
- {
20221
- id: "leadgen.contact",
20222
- order: 50,
20223
- label: "Lead Contact",
20224
- description: "A prospect contact discovered or enriched during lead generation.",
20225
- ownedBySystemId: "sales.lead-gen",
20226
- table: "acq_list_members",
20227
- stateCatalogId: "lead-gen.contact",
20228
- links: [
20229
- { toEntity: "leadgen.list", kind: "belongs-to", via: "list_id", label: "list" },
20230
- { toEntity: "leadgen.company", kind: "belongs-to", via: "company_id", label: "company" }
20231
- ]
20232
- },
20233
- {
20234
- id: "delivery.project",
20235
- order: 60,
20236
- label: "Project",
20237
- description: "A client delivery project.",
20238
- ownedBySystemId: "projects",
20239
- table: "projects",
20240
- links: [
20241
- { toEntity: "delivery.milestone", kind: "has-many", via: "project_id", label: "milestones" },
20242
- { toEntity: "delivery.task", kind: "has-many", via: "project_id", label: "tasks" }
20243
- ]
20244
- },
20245
- {
20246
- id: "delivery.milestone",
20247
- order: 70,
20248
- label: "Milestone",
20249
- description: "A delivery checkpoint within a project.",
20250
- ownedBySystemId: "projects",
20251
- table: "project_milestones",
20252
- links: [
20253
- { toEntity: "delivery.project", kind: "belongs-to", via: "project_id", label: "project" },
20254
- { toEntity: "delivery.task", kind: "has-many", via: "milestone_id", label: "tasks" }
20255
- ]
20256
- },
20257
- {
20258
- id: "delivery.task",
20259
- order: 80,
20260
- label: "Task",
20261
- description: "A delivery task that can move through the task status catalog.",
20262
- ownedBySystemId: "projects",
20263
- table: "project_tasks",
20264
- stateCatalogId: "delivery.task",
20265
- links: [
20266
- { toEntity: "delivery.project", kind: "belongs-to", via: "project_id", label: "project" },
20267
- { toEntity: "delivery.milestone", kind: "belongs-to", via: "milestone_id", label: "milestone" }
20268
- ]
20269
- }
20270
- ];
20271
- var DEFAULT_ORGANIZATION_MODEL_ENTITIES = Object.fromEntries(
20272
- ENTITY_ENTRY_INPUTS.map((entity) => {
20273
- const parsed = EntitySchema.parse(entity);
20274
- return [parsed.id, parsed];
20275
- })
20276
- );
20277
20241
 
20278
20242
  // src/organization-model/domains/actions.ts
20279
20243
  var ActionResourceIdSchema = z.string().trim().min(1).max(255).regex(/^[A-Za-z0-9]+(?:[-._][A-Za-z0-9]+)*$/, "Resource IDs must use letters, numbers, -, _, or . separators");
@@ -21579,7 +21543,7 @@ var OrganizationModelSchemaBase = z.object({
21579
21543
  resources: ResourcesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_RESOURCES),
21580
21544
  topology: OmTopologyDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_TOPOLOGY),
21581
21545
  actions: ActionsDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_ACTIONS),
21582
- entities: EntitiesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_ENTITIES),
21546
+ entities: EntitiesDomainSchema.default({}),
21583
21547
  policies: PoliciesDomainSchema.default(DEFAULT_ORGANIZATION_MODEL_POLICIES),
21584
21548
  // D3: flat Record<id, OrgKnowledgeNode> — no wrapper object
21585
21549
  knowledge: KnowledgeDomainSchema.default({})
@@ -21588,7 +21552,7 @@ var OrganizationModelSchema = OrganizationModelSchemaBase.superRefine(refineOrga
21588
21552
 
21589
21553
  // src/organization-model/defaults.ts
21590
21554
  var DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE = {};
21591
- var DEFAULT_ORGANIZATION_MODEL_ENTITIES2 = {};
21555
+ var DEFAULT_ORGANIZATION_MODEL_ENTITIES = {};
21592
21556
  var DEFAULT_ORGANIZATION_MODEL_NAVIGATION = {
21593
21557
  sidebar: {
21594
21558
  primary: {},
@@ -21616,7 +21580,7 @@ var DEFAULT_ORGANIZATION_MODEL = {
21616
21580
  // Generic empty actions map. Elevasis-specific action entries have been relocated to
21617
21581
  // `@repo/elevasis-core/src/organization-model/actions.ts`.
21618
21582
  actions: {},
21619
- entities: DEFAULT_ORGANIZATION_MODEL_ENTITIES2,
21583
+ entities: DEFAULT_ORGANIZATION_MODEL_ENTITIES,
21620
21584
  policies: DEFAULT_ORGANIZATION_MODEL_POLICIES,
21621
21585
  knowledge: DEFAULT_ORGANIZATION_MODEL_KNOWLEDGE
21622
21586
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/core",
3
- "version": "0.30.0",
3
+ "version": "0.32.0",
4
4
  "license": "MIT",
5
5
  "description": "Minimal shared constants across Elevasis monorepo",
6
6
  "sideEffects": false,