@elevasis/core 0.10.0 → 0.11.1

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 (58) hide show
  1. package/dist/index.d.ts +69 -159
  2. package/dist/index.js +324 -613
  3. package/dist/organization-model/index.d.ts +69 -159
  4. package/dist/organization-model/index.js +324 -613
  5. package/dist/test-utils/index.d.ts +192 -45
  6. package/dist/test-utils/index.js +260 -600
  7. package/package.json +1 -1
  8. package/src/__tests__/template-core-compatibility.test.ts +73 -91
  9. package/src/_gen/__tests__/__snapshots__/contracts.md.snap +94 -182
  10. package/src/auth/multi-tenancy/index.ts +20 -17
  11. package/src/auth/multi-tenancy/memberships/api-schemas.ts +142 -126
  12. package/src/auth/multi-tenancy/memberships/index.ts +26 -22
  13. package/src/auth/multi-tenancy/permissions.test.ts +42 -0
  14. package/src/auth/multi-tenancy/permissions.ts +104 -0
  15. package/src/organization-model/README.md +102 -97
  16. package/src/organization-model/__tests__/defaults.test.ts +19 -6
  17. package/src/organization-model/__tests__/domains/resource-mappings.test.ts +24 -93
  18. package/src/organization-model/__tests__/graph.test.ts +82 -894
  19. package/src/organization-model/__tests__/resolve.test.ts +59 -690
  20. package/src/organization-model/__tests__/schema.test.ts +83 -407
  21. package/src/organization-model/contracts.ts +4 -3
  22. package/src/organization-model/defaults.ts +277 -141
  23. package/src/organization-model/domains/features.ts +31 -22
  24. package/src/organization-model/domains/navigation.ts +27 -20
  25. package/src/organization-model/foundation.ts +42 -54
  26. package/src/organization-model/graph/build.ts +42 -217
  27. package/src/organization-model/graph/index.ts +4 -4
  28. package/src/organization-model/graph/link.ts +10 -0
  29. package/src/organization-model/graph/schema.ts +21 -16
  30. package/src/organization-model/graph/types.ts +10 -10
  31. package/src/organization-model/helpers.ts +74 -0
  32. package/src/organization-model/index.ts +7 -7
  33. package/src/organization-model/organization-graph.mdx +89 -272
  34. package/src/organization-model/organization-model.mdx +152 -320
  35. package/src/organization-model/published.ts +20 -19
  36. package/src/organization-model/resolve.ts +8 -33
  37. package/src/organization-model/schema.ts +63 -205
  38. package/src/organization-model/types.ts +12 -11
  39. package/src/platform/constants/versions.ts +3 -3
  40. package/src/platform/registry/__tests__/command-view.test.ts +6 -5
  41. package/src/platform/registry/__tests__/resource-link.test.ts +30 -0
  42. package/src/platform/registry/__tests__/resource-registry.integration.test.ts +15 -15
  43. package/src/platform/registry/command-view.ts +10 -12
  44. package/src/platform/registry/index.ts +93 -93
  45. package/src/platform/registry/resource-link.ts +32 -0
  46. package/src/platform/registry/resource-registry.ts +917 -876
  47. package/src/platform/registry/serialization.ts +56 -73
  48. package/src/platform/registry/serialized-types.ts +17 -12
  49. package/src/platform/registry/types.ts +14 -43
  50. package/src/reference/_generated/contracts.md +94 -182
  51. package/src/reference/glossary.md +71 -105
  52. package/src/scaffold-registry/__tests__/index.test.ts +125 -1
  53. package/src/scaffold-registry/__tests__/schema.test.ts +48 -20
  54. package/src/scaffold-registry/index.ts +236 -188
  55. package/src/scaffold-registry/schema.ts +47 -22
  56. package/src/supabase/database.types.ts +2880 -2719
  57. package/src/test-utils/fixtures/memberships.ts +82 -80
  58. package/src/platform/registry/domains.ts +0 -165
@@ -45,22 +45,28 @@ export type OrganizationModelProjects = z.infer<typeof OrganizationModelProjects
45
45
  export type OrganizationModelFeature = z.infer<typeof FeatureSchema>
46
46
  ```
47
47
 
48
- ### `OrganizationModelNavigation`
48
+ ### `NodeIdPath`
49
49
 
50
50
  ```typescript
51
- export type OrganizationModelNavigation = z.infer<typeof OrganizationModelNavigationSchema>
51
+ export type NodeIdPath = z.infer<typeof NodeIdPathSchema>
52
52
  ```
53
53
 
54
- ### `OrganizationModelSurface`
54
+ ### `NodeIdString`
55
55
 
56
56
  ```typescript
57
- export type OrganizationModelSurface = z.infer<typeof SurfaceDefinitionSchema>
57
+ export type NodeIdString = z.infer<typeof NodeIdStringSchema>
58
58
  ```
59
59
 
60
- ### `OrganizationModelResourceMapping`
60
+ ### `OrganizationModelNavigation`
61
61
 
62
62
  ```typescript
63
- export type OrganizationModelResourceMapping = z.infer<typeof ResourceMappingSchema>
63
+ export type OrganizationModelNavigation = z.infer<typeof OrganizationModelNavigationSchema>
64
+ ```
65
+
66
+ ### `OrganizationModelSurface`
67
+
68
+ ```typescript
69
+ export type OrganizationModelSurface = z.infer<typeof SurfaceDefinitionSchema>
64
70
  ```
65
71
 
66
72
  ### `OrganizationModelTechStackEntry`
@@ -179,64 +185,42 @@ export type DeepPartial<T> = T extends Array<infer U> ? Array<DeepPartial<U>> :
179
185
 
180
186
  ## Feature System
181
187
 
182
- ### `FeatureNavLink`
188
+ ### `FeatureSidebarComponent`
183
189
 
184
190
  ```typescript
185
- export interface FeatureNavLink {
186
- label: string
187
- link: string
188
- featureKey?: string
189
- onClick?: () => void
190
- links?: FeatureNavLink[]
191
- }
191
+ export type FeatureSidebarComponent = ComponentType
192
+ export type FeatureIconComponent = ComponentType<{ size?: number;
192
193
  ```
193
194
 
194
- ### `FeatureNavEntry`
195
+ ### `FeatureIconComponent`
195
196
 
196
197
  ```typescript
197
- export interface FeatureNavEntry {
198
- label: string
199
- icon: ComponentType
200
- link?: string
201
- featureKey?: string
202
- requiresAdmin?: boolean
203
- dataOnboardingTourId?: string
204
- links?: FeatureNavLink[]
205
- }
198
+ export type FeatureIconComponent = ComponentType<{ size?: number;
206
199
  ```
207
200
 
208
- ### `FeatureSidebarComponent`
201
+ ### `FeatureSidebarWidthResolver`
209
202
 
210
203
  ```typescript
211
- export type FeatureSidebarComponent = ComponentType
204
+ export type FeatureSidebarWidthResolver = number | ((context: { currentPath: string }) => number)
212
205
  ```
213
206
 
214
207
  ### `FeatureModule`
215
208
 
216
209
  ```typescript
217
210
  export interface FeatureModule {
218
- /** Unique stable identifier for this feature (e.g. `'crm'`, `'projects'`). */
211
+ /** Unique stable identifier for this feature module. */
219
212
  key: string
220
- /** Feature ID used for access-flag gating — must match the `id` of a feature in the organization model. */
213
+ /** Organization Model feature id this module presents. */
221
214
  featureId: string
222
- /**
223
- * Capability identifiers contributed by this feature.
224
- * Merged into `ResolvedFeatureSemantics.capabilityIds` at resolution time.
225
- * Not queried at runtime — kept for semantic graph completeness so that
226
- * capability membership is fully represented in the resolved model even when
227
- * a surface does not declare it directly.
228
- */
215
+ /** Capability identifiers contributed by this feature module. */
229
216
  capabilityIds?: string[]
230
- /** Top-level navigation entry rendered in the app shell when this feature is enabled. */
231
- navEntry?: FeatureNavEntry
232
- /** Sidebar component rendered when a matching subshell route is active. */
217
+ /** Icon used when this feature node appears in shell navigation. */
218
+ icon?: FeatureIconComponent
219
+ /** Sidebar component rendered when this feature's subtree route is active. */
233
220
  sidebar?: FeatureSidebarComponent
234
- /** Route path prefixes that activate this feature's sidebar and subshell context. */
235
- subshellRoutes?: string[]
236
- /**
237
- * Operations-only bridge surface connecting this feature to the organization graph.
238
- * Ignored by all other features. Only one manifest in the registry should set this.
239
- */
221
+ /** Optional shell sidebar width override. Defaults to 250px. */
222
+ sidebarWidth?: FeatureSidebarWidthResolver
223
+ /** Operations-only bridge connecting this feature to the organization graph node. */
240
224
  organizationGraph?: OrganizationGraphFeatureBridge
241
225
  }
242
226
  ```
@@ -255,8 +239,6 @@ export interface ResolvedFeatureAccess {
255
239
  ```typescript
256
240
  export interface ResolvedFeatureSemantics {
257
241
  capabilityIds: string[]
258
- surfaceIds: string[]
259
- surfaces: OrganizationModelSurface[]
260
242
  }
261
243
  ```
262
244
 
@@ -269,25 +251,11 @@ export interface ResolvedFeatureModule extends FeatureModule {
269
251
  }
270
252
  ```
271
253
 
272
- ### `ShellNavPlacement`
273
-
274
- ```typescript
275
- export type ShellNavPlacement = 'primary' | 'bottom'
276
- ```
277
-
278
- ### `ShellNavSource`
279
-
280
- ```typescript
281
- export type ShellNavSource = 'app' | 'feature'
282
- ```
283
-
284
- ### `ResolvedShellNavItem`
254
+ ### `ResolvedShellFeature`
285
255
 
286
256
  ```typescript
287
- export interface ResolvedShellNavItem extends FeatureNavEntry {
288
- placement: ShellNavPlacement
289
- source: ShellNavSource
290
- featureId?: string
257
+ export interface ResolvedShellFeature extends OrganizationModelFeature {
258
+ iconComponent?: FeatureIconComponent
291
259
  }
292
260
  ```
293
261
 
@@ -295,16 +263,16 @@ export interface ResolvedShellNavItem extends FeatureNavEntry {
295
263
 
296
264
  ```typescript
297
265
  export interface ResolvedShellModel {
298
- navItems: ResolvedShellNavItem[]
299
- }
300
- ```
301
-
302
- ### `AppShellOverrides`
303
-
304
- ```typescript
305
- export interface AppShellOverrides {
306
- primaryNavItems?: FeatureNavEntry[]
307
- bottomNavItems?: FeatureNavEntry[]
266
+ features: readonly ResolvedShellFeature[]
267
+ findByPath: (path: string) => ResolvedShellFeature | undefined
268
+ findById: (id: string) => ResolvedShellFeature | undefined
269
+ childrenOf: (id: string) => ResolvedShellFeature[]
270
+ ancestorsOf: (id: string) => ResolvedShellFeature[]
271
+ parentOf: (id: string) => ResolvedShellFeature | undefined
272
+ topLevel: () => ResolvedShellFeature[]
273
+ uiPositionFor: (id: string) => OrganizationModelFeature['uiPosition'] | undefined
274
+ requiresAdminFor: (id: string) => boolean
275
+ devOnlyFor: (id: string) => boolean
308
276
  }
309
277
  ```
310
278
 
@@ -321,8 +289,7 @@ export interface ResolvedShellRouteMatch {
321
289
  status: ShellRouteMatchStatus
322
290
  path: string
323
291
  feature?: ResolvedFeatureModule
324
- navItem?: ResolvedShellNavItem
325
- navLink?: FeatureNavLink
292
+ node?: ResolvedShellFeature
326
293
  }
327
294
  ```
328
295
 
@@ -338,7 +305,7 @@ export interface ShellRuntime {
338
305
 
339
306
  ```typescript
340
307
  export interface OrganizationGraphFeatureBridge {
341
- surfaceId: string
308
+ featureId: string
342
309
  }
343
310
  ```
344
311
 
@@ -347,10 +314,8 @@ export interface OrganizationGraphFeatureBridge {
347
314
  ```typescript
348
315
  export interface OrganizationGraphContextValue {
349
316
  available: boolean
350
- surfaceId?: string
351
- surfacePath?: string
352
- surfaceType?: OrganizationModelSurface['surfaceType']
353
317
  featureId?: string
318
+ featurePath?: string
354
319
  }
355
320
  ```
356
321
 
@@ -360,7 +325,6 @@ export interface OrganizationGraphContextValue {
360
325
  export interface ElevasisFeaturesProviderProps {
361
326
  features: FeatureModule[]
362
327
  organizationModel?: OrganizationModel
363
- appShellOverrides?: AppShellOverrides
364
328
  timeRange?: TimeRange
365
329
  operationsApiUrl?: string
366
330
  operationsSSEManager?: SSEConnectionManagerLike
@@ -401,8 +365,8 @@ export interface ElevasisFeaturesContextValue {
401
365
  * Resource Registry type definitions
402
366
  */
403
367
 
404
- import type { IntegrationType } from '../../execution/engine/tools/integration'
405
- import type { ResourceDomain } from './domains'
368
+ import type { IntegrationType } from '../../execution/engine/tools/integration'
369
+ import type { ResourceCategory, ResourceLink } from './resource-link'
406
370
 
407
371
  // ============================================================================
408
372
  // Core Resource Type Definitions
@@ -479,8 +443,11 @@ export interface ResourceDefinition {
479
443
  /** Environment/deployment status */
480
444
  status: ResourceStatus
481
445
 
482
- /** Domain tags for filtering and organization */
483
- domains?: ResourceDomain[]
446
+ /** Graph links to Organization Model nodes */
447
+ links?: ResourceLink[]
448
+
449
+ /** Infrastructure category for filtering */
450
+ category?: ResourceCategory
484
451
 
485
452
  /** Whether the agent supports multi-turn sessions (agents only) */
486
453
  sessionCapable?: boolean
@@ -493,7 +460,7 @@ export interface ResourceDefinition {
493
460
  }
494
461
  ```
495
462
 
496
- ### `DomainDefinition`
463
+ ### `ResourceList`
497
464
 
498
465
  ```typescript
499
466
  /** Unique resource identifier */
@@ -514,8 +481,11 @@ export interface ResourceDefinition {
514
481
  /** Environment/deployment status */
515
482
  status: ResourceStatus
516
483
 
517
- /** Domain tags for filtering and organization */
518
- domains?: ResourceDomain[]
484
+ /** Graph links to Organization Model nodes */
485
+ links?: ResourceLink[]
486
+
487
+ /** Infrastructure category for filtering */
488
+ category?: ResourceCategory
519
489
 
520
490
  /** Whether the agent supports multi-turn sessions (agents only) */
521
491
  sessionCapable?: boolean
@@ -527,57 +497,9 @@ export interface ResourceDefinition {
527
497
  archived?: boolean
528
498
  }
529
499
 
530
- // ============================================================================
531
- // Domain Definition Types
532
- // ============================================================================
533
-
534
- /**
535
- * Domain definition for Command View filtering
536
- *
537
- * Domains are organizational metadata for UI filtering/grouping.
538
- * No execution impact - purely for visualization.
539
- *
540
- * @example
541
- * {
542
- * id: 'support',
543
- * name: 'Customer Support',
544
- * description: 'Ticket triage, knowledge base, escalations',
545
- * color: 'green',
546
- * icon: 'IconHeadset'
547
- * }
548
- */
549
- export interface DomainDefinition {
550
- /** Unique identifier (e.g., 'support') */
551
- id: string
552
- /** Display name (e.g., 'Customer Support') */
553
- name: string
554
- /** Purpose description */
555
- description: string
556
- /** Optional Mantine color for UI (e.g., 'blue', 'green', 'orange') */
557
- color?: string
558
- /** Optional Tabler icon name (e.g., 'IconHeadset') */
559
- icon?: string
560
- }
561
- ```
562
-
563
- ### `ResourceList`
564
-
565
- ```typescript
566
- /** Unique identifier (e.g., 'support') */
567
- id: string
568
- /** Display name (e.g., 'Customer Support') */
569
- name: string
570
- /** Purpose description */
571
- description: string
572
- /** Optional Mantine color for UI (e.g., 'blue', 'green', 'orange') */
573
- color?: string
574
- /** Optional Tabler icon name (e.g., 'IconHeadset') */
575
- icon?: string
576
- }
577
-
578
- /**
579
- * Resource list for organization
580
- * Returns ResourceDefinition metadata (not full definitions)
500
+ /**
501
+ * Resource list for organization
502
+ * Returns ResourceDefinition metadata (not full definitions)
581
503
  */
582
504
  export interface ResourceList {
583
505
  workflows: ResourceDefinition[]
@@ -676,7 +598,7 @@ export type TriggerConfig = WebhookTriggerConfig | ScheduleTriggerConfig | Event
676
598
  * scheduled cron jobs, platform events, or manual user actions.
677
599
  *
678
600
  * BREAKING CHANGES (2025-11-30):
679
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
601
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
680
602
  * - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
681
603
  * - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
682
604
  * - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
@@ -712,7 +634,7 @@ export type TriggerConfig = WebhookTriggerConfig | ScheduleTriggerConfig | Event
712
634
  * scheduled cron jobs, platform events, or manual user actions.
713
635
  *
714
636
  * BREAKING CHANGES (2025-11-30):
715
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
637
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
716
638
  * - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
717
639
  * - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
718
640
  * - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
@@ -790,7 +712,7 @@ export interface TriggerDefinition extends ResourceDefinition {
790
712
  * stored here (queried at runtime from credentials table).
791
713
  *
792
714
  * BREAKING CHANGES (2025-11-30):
793
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
715
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
794
716
  * - Field renames: `id` -> `resourceId` (inherited)
795
717
  * - New required field: `status` (inherited) - organizations must add status to all integrations
796
718
  * - New required field: `version` (inherited) - organizations must add version to all integrations
@@ -919,7 +841,7 @@ export type ExternalPlatform = 'n8n' | 'make' | 'zapier' | 'other'
919
841
  * no API integration with external platforms, no status syncing.
920
842
  *
921
843
  * BREAKING CHANGES (2025-11-30):
922
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
844
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
923
845
  * - Field renames: `id` -> `resourceId` (inherited)
924
846
  * - New required field: `version` (inherited) - organizations must add version to all external resources
925
847
  * - New required field: `type: 'external'` (inherited) - resource type discriminator
@@ -954,7 +876,7 @@ export type ExternalPlatform = 'n8n' | 'make' | 'zapier' | 'other'
954
876
  * no API integration with external platforms, no status syncing.
955
877
  *
956
878
  * BREAKING CHANGES (2025-11-30):
957
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
879
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
958
880
  * - Field renames: `id` -> `resourceId` (inherited)
959
881
  * - New required field: `version` (inherited) - organizations must add version to all external resources
960
882
  * - New required field: `type: 'external'` (inherited) - resource type discriminator
@@ -1048,7 +970,7 @@ export interface ExternalResourceDefinition extends ResourceDefinition {
1048
970
  * Tasks with matching command_queue_group are routed to this checkpoint.
1049
971
  *
1050
972
  * BREAKING CHANGES (2025-11-30):
1051
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
973
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
1052
974
  * - Field renames: `id` -> `resourceId` (inherited)
1053
975
  * - description is now REQUIRED (was optional) - organizations must add description to all human checkpoints
1054
976
  * - New required field: `version` (inherited) - organizations must add version to all human checkpoints
@@ -1093,44 +1015,34 @@ export interface HumanCheckpointDefinition extends ResourceDefinition {
1093
1015
  ### `DeploymentSpec`
1094
1016
 
1095
1017
  ```typescript
1096
- /** Supabase Storage path: "{orgId}/{deploymentId}/bundle.js" */
1097
- storagePath: string
1098
- /** Deployment record ID */
1099
- deploymentId: string
1100
- /** OS temp path to bundle -- set after first download, used by worker threads */
1101
- cachedTempPath?: string
1102
- /** Platform tool name -> credential name mapping */
1103
- toolCredentials?: Record<string, string>
1104
- /** SDK version used to deploy this bundle */
1105
- sdkVersion?: string
1106
- /** Deployment version (semver) of the deployed bundle */
1107
- deploymentVersion?: string
1108
- }
1109
-
1110
- /**
1111
- * Organization-specific resource collection
1112
- *
1113
- * Complete manifest of all automation resources for an organization.
1114
- * Used by ResourceRegistry for discovery and Command View for visualization.
1018
+ /** Always undefined for system resources; present for API compatibility with RemoteOrgConfig consumers */
1019
+ sdkVersion?: never
1020
+ }
1021
+
1022
+ /**
1023
+ * Organization-specific resource collection
1024
+ *
1025
+ * Complete manifest of all automation resources for an organization.
1026
+ * Used by ResourceRegistry for discovery and Command View for visualization.
1115
1027
  */
1116
- export interface DeploymentSpec {
1117
- /** Deployment version (semver) */
1118
- version: string
1119
- /** Workflow definitions */
1120
- workflows?: WorkflowDefinition[]
1121
- /** Agent definitions */
1122
- agents?: AgentDefinition[]
1123
-
1124
- // Resource Manifest fields (optional for backwards compatibility)
1125
- /** Trigger definitions - entry points that initiate executions */
1126
- triggers?: TriggerDefinition[]
1127
- /** Integration definitions - external service connections */
1128
- integrations?: IntegrationDefinition[]
1129
- /** Explicit relationship declarations between resources */
1130
- relationships?: ResourceRelationships
1131
- /** External automation resources (n8n, Make, Zapier, etc.) */
1132
- externalResources?: ExternalResourceDefinition[]
1133
- /** Human checkpoint definitions - human decision points in automation */
1134
- humanCheckpoints?: HumanCheckpointDefinition[]
1028
+ export interface DeploymentSpec {
1029
+ /** Deployment version (semver) */
1030
+ version: string
1031
+ /** Workflow definitions */
1032
+ workflows?: WorkflowDefinition[]
1033
+ /** Agent definitions */
1034
+ agents?: AgentDefinition[]
1035
+
1036
+ // Resource Manifest fields (optional for backwards compatibility)
1037
+ /** Trigger definitions - entry points that initiate executions */
1038
+ triggers?: TriggerDefinition[]
1039
+ /** Integration definitions - external service connections */
1040
+ integrations?: IntegrationDefinition[]
1041
+ /** Explicit relationship declarations between resources */
1042
+ relationships?: ResourceRelationships
1043
+ /** External automation resources (n8n, Make, Zapier, etc.) */
1044
+ externalResources?: ExternalResourceDefinition[]
1045
+ /** Human checkpoint definitions - human decision points in automation */
1046
+ humanCheckpoints?: HumanCheckpointDefinition[]
1135
1047
  }
1136
1048
  ```
@@ -1,105 +1,71 @@
1
- ---
2
- title: Glossary
3
- description: Terminology disambiguation for Organization OS concepts used in the template scaffold, foundations, and published packages.
4
- ---
5
-
6
- # Glossary
7
-
8
- For canonical (internal) definitions, see the Organization OS glossary in the monorepo architecture docs.
9
-
10
- This condensed version covers every ambiguity-prone term a template consumer or agent is likely to encounter. Alphabetical within each section.
11
-
12
- ---
13
-
14
- ## Terms
15
-
16
- **featureId** (on FeatureModule) -- the `id` string a `FeatureModule` declares so the provider knows which entry in `OrganizationModel.features` to check for access gating. Required field on every `FeatureModule`. Must match the `id` of an entry in the features array (e.g. `'crm'`, `'projects'`). Distinct from the nav-item `featureKey` (see below). No aliasing layer -- IDs are direct matches.
17
-
18
- **AdminGuard** -- route-level admin wrapper from `@elevasis/ui/features/auth`. Wraps routes restricted to admin members. Must nest inside `ProtectedRoute`. Does not replace `requiresAdmin` on nav entries -- use both when both route access and nav visibility need admin enforcement.
19
-
20
- **`/configure`** -- the recurring organization model editor for external projects. A slash skill (not a command) at `.claude/skills/configure/SKILL.md`. Runs a layered QA flow across `identity`, `customers`, `offerings`, `roles`, `goals`, `techStack`, `features`, and `labels`. Can be invoked without an argument (full layered flow) or with a domain argument (`/configure identity`, `/configure customers`, etc.) for targeted edits. Every write is gated through `resolveOrganizationModel()` + `OrganizationModelSchema.parse()` with a TypeScript type-check fallback. The ambient vibe layer delegates Codify and Toggle intents to `/configure` rather than writing directly. Distinct from `/setup` (first-time bootstrap) and `/org-os manage` (monorepo-only feature gating). `/configure` is available in external projects only.
21
-
22
- **Contract** -- the publishable I/O boundary: Zod schemas in `foundations/types/index.ts` for workflow inputs/outputs, or the `FeatureModule` TypeScript shape for shell features. Distinct from "manifest": a contract is the structural definition; a manifest is a specific feature instance conforming to that shape.
23
-
24
- **DeploymentSpec** -- the complete resource collection for one organization (`workflows`, `agents`, `triggers`, `integrations`, `relationships`, `externalResources`, `humanCheckpoints`). Defined in `@repo/core`. The `operations/src/index.ts` file in each external project exports one `DeploymentSpec`.
25
-
26
- **Domain** -- removed concept. What was previously a `SemanticDomain` entry in `OrganizationModel.domains` is now expressed directly as a **Feature** in the `features` array. The `domains` field no longer exists on `OrganizationModel`. Semantic grouping (entity IDs, surface IDs, resource IDs, capability IDs) now lives on each `OrganizationModelFeature` object.
27
-
28
- **Domain rename wave (2026-04-20)** -- three legacy top-level domain field names on `OrganizationModel` were renamed to align with user-visible labels: `crm` → `sales`, `leadGen` → `prospecting`, `delivery` → `projects`. Feature ID constants (`CRM_FEATURE_ID`, `LEAD_GEN_FEATURE_ID`) and consumer-facing feature IDs (`'crm'`, `'lead-gen'`) are unchanged. Only the Zod schema field names, domain files, surface IDs, and imports were updated.
29
-
30
- **Feature** -- the unified concept replacing the former three-layer system (feature keys, semantic domains, feature modules). Always qualify which layer is in scope:
31
-
32
- - **Platform capability** -- a product area (Execution Engine, Workflows, Agents, etc.). Not one-to-one with shell features.
33
- - **Organization-model feature** (`OrganizationModelFeature`) -- a single entry in `OrganizationModel.features`. Combines access gating (`enabled`), semantic grouping (`entityIds`, `surfaceIds`, `resourceIds`, `capabilityIds`), and display metadata (`label`, `description`, `color`, `icon`). Seven defaults: `crm`, `lead-gen`, `projects`, `operations`, `monitoring`, `settings`, `seo`.
34
- - **Shell FeatureModule** -- a manifest-backed UI feature registered with `ElevasisFeaturesProvider`. Declares `featureId` matching an org-model feature ID. Seven manifest-backed: `lead-gen`, `crm`, `projects`, `operations`, `monitoring`, `settings`, `seo`. Two utility (no manifest): `auth`, `dashboard`.
35
-
36
- **featureKey** (nav-item) -- optional field on `FeatureNavEntry` and `FeatureNavLink` that gates a specific nav item's visibility independently of the module's `featureId`. Must match a feature ID in the org model. May be more specific than the module's `featureId` when a nested link needs a narrower gate.
37
-
38
- **FeatureGuard** -- route-level feature gate from `@elevasis/ui/features/auth`. Blocks access to a route when the resolved org model has the relevant feature key disabled. Must nest inside `ProtectedRoute`. Distinct from `AdminGuard` (admin membership) and `ProtectedRoute` (authentication).
39
-
40
- **FeatureModule** -- the manifest contract each shell feature provides to `ElevasisFeaturesProvider`. Defined in `@repo/ui`, NOT `@repo/core`. Fields: `key`, `featureId` (required -- replaces the former `accessFeatureKey`), `capabilityIds`, `navEntry`, `sidebar`, `subshellRoutes`, `organizationGraph` (Operations-only). Template consumers build a local manifest array and pass it to `ElevasisFeaturesProvider` in `__root.tsx`.
41
-
42
- **Foundations** -- the adapter layer in `foundations/` (two modules: `config/organization-model.ts` and `types/index.ts`). Source package with no build step. Depends only on `@elevasis/core` (npm) and `zod`. Never import `@repo/core` from foundations -- that would break standalone deployment.
43
-
44
- **Identity domain** -- legal identity, distinct from `branding` (display identity). Lives at `OrganizationModel.identity`. Fields: `mission`, `vision`, `legalName`, `entityType`, `jurisdiction`, `industryCategory`, `geographicFocus`, `timeZone`, `businessHours`. Agents use identity fields for compliance, localization, and context. Edit via `/configure identity`.
45
-
46
- **Customers domain** -- customer segments with jobs-to-be-done, pains, gains, firmographics, and value propositions. Lives at `OrganizationModel.customers`. Each `CustomerSegment` has `id`, `name`, `description`, `jobsToBeDone`, `pains`, `gains`, `valueProp`, and optional `firmographics`. Agents use segments for outreach targeting and sales automation. Edit via `/configure customers`.
47
-
48
- **Goals domain** -- organizational goals with period bounds and measurable outcomes. Lives at `OrganizationModel.goals`. User-facing text uses "goals" and "measurable outcomes"; the schema field name `keyResults` is retained for OKR tooling compatibility but is never surfaced to users as "OKR" or "key results". Edit via `/configure goals`.
49
-
50
- **Manifest** -- a `FeatureModule` instance that declares what one shell feature contributes at runtime (nav, sidebar, subshell routes, access key, semantic references). The provider registers an array of manifests at startup and validates them against the resolved org model.
51
-
52
- **MembershipFeatureConfig** -- per-member-per-org feature overrides stored in `org_memberships.config`. The `features` field is now `Record<string, boolean>` -- any feature ID can be overridden per member. Previously hardcoded to five keys (`operations`, `monitoring`, `acquisition`, `delivery`, `seo`); now open to any feature ID in the org model.
53
-
54
- **Offerings domain** -- products and services with pricing model, price, currency, target segment references, and optional delivery-feature references. Lives at `OrganizationModel.offerings`. Each `Product` has `id`, `name`, `description`, `pricingModel` (`one-time | subscription | usage-based | custom`), optional `price` and `currency`, `targetSegmentIds` (cross-ref validated against `customers.segments`), and optional `deliveryFeatureId` (cross-ref validated against `features`). Edit via `/configure offerings`.
55
-
56
- **Operations domain** -- catalog of stateful runtime entities. Lives at `OrganizationModel.operations`. Each `OperationEntry` has `id`, `label`, `semanticClass` (one of `queue | executions | sessions | notifications | schedules`), optional `featureId`, and optional `supportedStatusSemanticClass` array. Used by the ambient vibe layer to narrate runtime entity state. Default entries cover HITL queue, executions, sessions, notifications, and schedules.
57
-
58
- **OrganizationModel** -- the top-level semantic contract for an organization. Published from `@elevasis/core/organization-model`. In the template, authored in `foundations/config/organization-model.ts` and exported as `canonicalOrganizationModel` (passed to `ElevasisFeaturesProvider`) and `organizationModel` (enriched shape for app-local use). As of the 2026-04-20 expansion, the model contains 14 top-level domains: `features`, `branding`, `navigation`, `sales` (formerly `crm`), `prospecting` (formerly `leadGen`), `projects` (formerly `delivery`), `identity`, `customers`, `offerings`, `roles`, `goals`, `statuses`, `operations`, and `resourceMappings` (with optional `techStack` per entry). Use `/configure` as the entry point for editing reality domains in external projects.
59
-
60
- **OrganizationModelFeature** -- the TypeScript type (`z.infer<typeof FeatureSchema>`) for a single entry in `OrganizationModel.features`. Replaces the former `OrganizationModelFeatureKey` (closed enum) and `OrganizationModelSemanticDomain`. Each feature has `id`, `label`, `enabled`, and semantic grouping arrays (`entityIds`, `surfaceIds`, `resourceIds`, `capabilityIds`). Exported from `@elevasis/core/organization-model`. Default feature IDs: `crm`, `lead-gen`, `projects`, `operations`, `monitoring`, `settings`, `submitted-requests`, `seo`. Note: feature IDs `crm` and `lead-gen` are unchanged by the domain rename wave; only the domain field names on `OrganizationModel` were renamed (`crm` → `sales`, `leadGen` → `prospecting`).
61
-
62
- **Provider / ElevasisFeaturesProvider** -- the runtime that registers manifests, resolves feature access against the org model, dispatches subshell routing via `FeatureShell`, and exposes resolved state through `useElevasisFeatures()`. Mounted in `__root.tsx`. Accepts `features`, optional `organizationModel`, and optional `appShellOverrides`.
63
-
64
- **Resolved types (ResolvedFeatureModule, ResolvedShellNavItem)** -- provider output. `ResolvedFeatureModule` extends `FeatureModule` with `access` (enabled state and `featureId`) and `semantics` (merged capability and surface IDs). `ResolvedShellNavItem` extends `FeatureNavEntry` with `placement`, `source`, and `featureId`. Both from `@elevasis/ui`.
65
-
66
- **Resource** -- an entry in `OrganizationModel.resourceMappings` linking a deployable automation resource into the semantic model. At the registry layer, resources are `WorkflowDefinition` or `AgentDefinition` instances in a `DeploymentSpec`. Each resource mapping may carry an optional `techStack` extension with `platform`, `purpose`, `credentialStatus`, and `isSystemOfRecord` fields.
67
-
68
- **Roles domain** -- role chart with responsibilities, reporting lines, and role holders. Lives at `OrganizationModel.roles`. Each `Role` has `id`, `title`, `responsibilities` (string array), optional `reportsToId` (cross-ref validated within the same collection), and optional `heldBy` (name or email). All field names are plain-language; no EOS jargon (`seats`, `accountabilities`) is used. Edit via `/configure roles`.
69
-
70
- **Statuses domain** -- flat registry of all status entries across delivery, queue, execution, schedule, and request semantic classes. Lives at `OrganizationModel.statuses`. Each `StatusEntry` has `id`, `label`, `semanticClass` (closed enum), and optional `category`. Labels are the canonical plain-language strings the ambient vibe layer reads when narrating status -- never hardcoded strings. `QueueTaskStatus` in the queue domain routes through this registry.
71
-
72
- **Settings asymmetry** -- `settings` is a valid feature ID (org-level, present in `OrganizationModel.features` with `enabled: true` by default). `MembershipFeatureConfig.features` is now `Record<string, boolean>`, so `settings` can technically be overridden per member, but the convention is still to gate settings visibility via `requiresAdmin` on the nav entry and `AdminGuard` on routes rather than per-member feature overrides.
73
-
74
- **Subshell / Sidebar** -- the feature-scoped UI region rendered when the current route matches a manifest's `subshellRoutes`. Each `FeatureModule.sidebar` is a `ComponentType`. Consumers customize by composing the feature's published sidebar primitives (`CrmSidebar`, `CrmSidebarMiddle`, etc.) and assigning their component to `manifest.sidebar`.
75
-
76
- **Surface** -- a navigable view in `OrganizationModel.navigation.surfaces`. Identified by a dotted `id` (e.g., `sales.pipeline`). Has `path`, `surfaceType`, optional `featureId` gate (replaces the former `featureKey` field), and cross-reference arrays (`featureIds`, `entityIds`, `resourceIds`, `capabilityIds`). Distinct from "page": a surface is the org-model declaration; a page is the React component rendered at the route.
77
-
78
- **Topology** -- resource relationships (`triggers`, `uses`, `approval`) declared in `DeploymentSpec.relationships` and `HumanCheckpointDefinition.routesTo`. Used for Command View graph edges.
79
-
80
- ---
81
-
82
- ## Package-Boundary Cheat Sheet
83
-
84
- **`@elevasis/core`** (published npm)
85
-
86
- - `OrganizationModel`, `OrganizationModelFeature`, `OrganizationModelSurface`, `OrganizationModelResourceMapping`
87
- - `OrganizationModelIdentity`, `OrganizationModelCustomers`, `OrganizationModelOfferings`, `OrganizationModelRoles`, `OrganizationModelGoals`
88
- - `OrganizationModelStatuses`, `OrganizationModelOperations`
89
- - `TechStackEntrySchema`, `OrganizationModelTechStackEntry`
90
- - `resolveOrganizationModel`, `defineOrganizationModel`, `DEFAULT_ORGANIZATION_MODEL`
91
- - `MembershipFeatureConfig`
92
-
93
- **`@elevasis/ui`** (published npm)
94
-
95
- - `FeatureModule`, `FeatureNavEntry`, `FeatureNavLink`
96
- - `ResolvedFeatureModule`, `ResolvedShellNavItem`
97
- - `FeatureGuard`, `AdminGuard`, `ProtectedRoute`
98
- - `ElevasisFeaturesProvider`, `ElevasisCoreProvider`, `useElevasisFeatures`
99
- - `createFeatureAccessHook`
100
-
101
- **`foundations/`** (local source package -- not published)
102
-
103
- - `canonicalOrganizationModel` -- passed to `ElevasisFeaturesProvider`
104
- - `organizationModel` -- enriched shape for app-local code
105
- - Workflow I/O schemas (`types/index.ts`)
1
+ ---
2
+ title: Glossary
3
+ description: Terminology disambiguation for Organization OS concepts used in the template scaffold, core package, and published packages.
4
+ ---
5
+
6
+ # Glossary
7
+
8
+ ## Terms
9
+
10
+ **AdminGuard** -- route-level admin wrapper from `@elevasis/ui/features/auth`. Must nest inside `ProtectedRoute`.
11
+
12
+ **Contract** -- the publishable boundary a consumer depends on: Zod schemas, TypeScript types, provider props, resource definitions, or workflow I/O schemas.
13
+
14
+ **DeploymentSpec** -- resource collection for one organization: workflows, agents, triggers, integrations, relationships, external resources, and human checkpoints.
15
+
16
+ **Feature** -- either a platform capability, a shell `FeatureModule`, or an Organization Model feature node. In the current shell contract, Organization Model feature nodes drive sidebar hierarchy and access state.
17
+
18
+ **FeatureGuard** -- route-level feature gate from `@elevasis/ui/features/auth`.
19
+
20
+ **FeatureModule** -- manifest contract a shell feature provides to `ElevasisFeaturesProvider`. Key fields are `key`, `featureId`, optional `capabilityIds`, optional `icon`, optional `sidebar`, and optional graph bridge metadata.
21
+
22
+ **featureId** -- the `FeatureModule` field that must match an `OrganizationModel.features[].id`.
23
+
24
+ **Foundations** -- local adapter layer in external projects that exports `canonicalOrganizationModel`, `organizationModel`, and workflow I/O schemas.
25
+
26
+ **Graph node ID** -- kind-prefixed cross-collection identifier such as `feature:sales.crm`, `integration:instantly`, or `resource:lead-import`.
27
+
28
+ **Manifest** -- a runtime declaration for a feature or resource collection.
29
+
30
+ **MembershipFeatureConfig** -- per-member feature override config: `{ features?: Record<string, boolean> }`.
31
+
32
+ **OrganizationModel** -- top-level semantic contract for an organization. Current primary fields include `features`, `branding`, `navigation`, `sales`, `prospecting`, `projects`, `identity`, `customers`, `offerings`, `roles`, `goals`, `statuses`, and `operations`.
33
+
34
+ **OrganizationModelFeature** -- feature node in `OrganizationModel.features`. Fields include `id`, `label`, `description`, `enabled`, `path`, `icon`, `color`, `uiPosition`, `requiresAdmin`, and `devOnly`.
35
+
36
+ **Provider / ElevasisFeaturesProvider** -- runtime that registers manifests, resolves feature access against the org model, and exposes shell helpers through `useElevasisFeatures()`.
37
+
38
+ **Resource** -- deployable workflow, agent, trigger, integration, external resource, or human checkpoint in a `DeploymentSpec`. Resources bind to the Organization Model graph through metadata `links` and are grouped for operations with `category`.
39
+
40
+ **ResourceCategory** -- resource metadata category: `production`, `diagnostic`, `internal`, or `testing`.
41
+
42
+ **ResourceLink** -- graph binding on resource metadata: `{ nodeId, kind }`.
43
+
44
+ **Settings asymmetry** -- settings is a feature node, but individual access is normally governed by admin checks rather than user-facing feature toggles.
45
+
46
+ **Shell model** -- provider output used by sidebars and breadcrumbs. Includes `features`, `childrenOf`, `ancestorsOf`, `parentOf`, `topLevel`, `findByPath`, `uiPositionFor`, `requiresAdminFor`, and `devOnlyFor`.
47
+
48
+ **Subshell / Sidebar** -- feature-scoped UI region rendered when the current route matches a feature whose manifest supplies a sidebar.
49
+
50
+ **Topology** -- runtime resource relationships declared in `DeploymentSpec.relationships`.
51
+
52
+ ## Package Boundary
53
+
54
+ **`@elevasis/core`**
55
+
56
+ - `OrganizationModel`, `OrganizationModelFeature`
57
+ - `resolveOrganizationModel`, `defineOrganizationModel`, `DEFAULT_ORGANIZATION_MODEL`
58
+ - `MembershipFeatureConfig`
59
+ - `DeploymentSpec`, `ResourceLink`, `ResourceCategory`
60
+
61
+ **`@elevasis/ui`**
62
+
63
+ - `FeatureModule`
64
+ - `FeatureGuard`, `AdminGuard`, `ProtectedRoute`
65
+ - `ElevasisFeaturesProvider`, `ElevasisCoreProvider`, `useElevasisFeatures`
66
+
67
+ **External project source**
68
+
69
+ - `canonicalOrganizationModel`
70
+ - `organizationModel`
71
+ - workflow I/O schemas