@elevasis/sdk 1.17.0 → 1.18.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.
@@ -31,7 +31,7 @@ Feature IDs defined in `DEFAULT_ORGANIZATION_MODEL.features` (`packages/core/src
31
31
 
32
32
  ```typescript
33
33
  // FeatureSchema: { id, label, enabled, color?, icon?, entityIds, surfaceIds, resourceIds, capabilityIds }
34
- type DefaultFeatureId = 'dashboard' | 'identity' | 'platform' | 'finance' | 'sales' | 'sales.crm' | 'sales.lead-gen' | 'projects' | 'operations' | 'knowledge.command-view' | 'operations.overview' | 'operations.resources' | 'operations.command-queue' | 'operations.sessions' | 'operations.task-scheduler' | 'monitoring' | 'monitoring.activity-log' | 'monitoring.execution-logs' | 'monitoring.execution-health' | 'monitoring.cost-analytics' | 'monitoring.notifications' | 'monitoring.submitted-requests' | 'settings' | 'settings.account' | 'settings.appearance' | 'settings.roles' | 'settings.organization' | 'settings.credentials' | 'settings.api-keys' | 'settings.webhooks' | 'settings.deployments' | 'admin' | 'admin.system-health' | 'admin.organizations' | 'admin.users' | 'admin.design-showcase' | 'admin.debug' | 'archive' | 'archive.agent-chat' | 'archive.execution-runner' | 'seo' | 'knowledge' | 'knowledge.base'
34
+ type DefaultFeatureId = 'dashboard' | 'identity' | 'platform' | 'finance' | 'sales' | 'sales.crm' | 'sales.lead-gen' | 'projects' | 'operations' | 'knowledge.command-view' | 'operations.overview' | 'operations.resources' | 'operations.command-queue' | 'operations.sessions' | 'operations.task-scheduler' | 'monitoring' | 'monitoring.calendar' | 'monitoring.activity-log' | 'monitoring.execution-logs' | 'monitoring.execution-health' | 'monitoring.cost-analytics' | 'monitoring.notifications' | 'monitoring.submitted-requests' | 'settings' | 'settings.account' | 'settings.appearance' | 'settings.roles' | 'settings.organization' | 'settings.credentials' | 'settings.api-keys' | 'settings.webhooks' | 'settings.deployments' | 'admin' | 'admin.system-health' | 'admin.organizations' | 'admin.users' | 'admin.design-showcase' | 'admin.debug' | 'archive' | 'archive.agent-chat' | 'archive.execution-runner' | 'seo' | 'knowledge' | 'knowledge.base'
35
35
  ```
36
36
 
37
37
  These are the built-in feature IDs. The `featureId` field on a `FeatureModule` manifest must match the `id` of a feature in the organization model to enable access-flag gating.
@@ -0,0 +1,99 @@
1
+ ---
2
+ title: Spine Primer
3
+ description: Tenant-facing primer for using an Organization Model catalog as the shared coordination spine between workflow producers, runtime state, API filters, and UI projections.
4
+ ---
5
+ <!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
6
+ <!-- Regenerate: pnpm scaffold:sync -->
7
+
8
+
9
+ # Spine Primer
10
+
11
+ Use this primer when a tenant domain has a closed set of stages, statuses, or catalog keys that multiple surfaces must share. A spine is the tenant Organization Model vocabulary that coordinates workflows, runtime state, API reads, and UI rendering without forcing those surfaces to import from each other.
12
+
13
+ The lead-generation pattern is the reference shape: `organizationModel.prospecting.stages` defines the stage vocabulary, workflow templates reference those stages, workflow factories validate stage keys before running, entity state stores sparse per-stage progress, and UI views render progress from the same vocabulary.
14
+
15
+ ## What The Spine Owns
16
+
17
+ A spine owns the shared vocabulary for one domain. The vocabulary is not just a list of strings. Each key should carry enough metadata for consumers to derive behavior consistently:
18
+
19
+ - `key` identifies the stage or catalog member.
20
+ - `label` gives a human-readable name.
21
+ - `description` explains the business meaning.
22
+ - `order` gives stable display and workflow ordering.
23
+ - `entity` identifies which tenant entity the stage updates.
24
+
25
+ The same keys then appear in four places:
26
+
27
+ | Role | Tenant-facing shape |
28
+ | --- | --- |
29
+ | Vocabulary | `organizationModel.prospecting.stages` |
30
+ | Process | workflow templates and build steps that reference stage keys |
31
+ | Runtime state | entity state maps such as `{ [stageKey]: { status, updatedAt, data } }` |
32
+ | Consumer projection | API filters, progress summaries, and UI step rendering |
33
+
34
+ ## Layering
35
+
36
+ ```text
37
+ tenant Organization Model
38
+ - prospecting stages
39
+ - workflow templates
40
+ - capability bindings
41
+ |
42
+ +--> workflow factory
43
+ | - validates stage keys
44
+ | - runs producers
45
+ | - dispatches entity-tagged results
46
+ |
47
+ +--> API and query helpers
48
+ | - filter pending entities by stage key
49
+ | - aggregate progress from state maps
50
+ |
51
+ +--> UI projections
52
+ - render labels and order from the catalog
53
+ - distinguish known and unknown state keys
54
+
55
+ entity runtime state
56
+ { [stageKey]: { status, updatedAt, data } }
57
+ ```
58
+
59
+ The important boundary is that producers and consumers coordinate through the Organization Model vocabulary plus runtime state. They do not coordinate through direct imports, duplicated string constants, or workflow-specific side channels.
60
+
61
+ ## Invariants
62
+
63
+ 1. **The vocabulary is closed and validated.** Workflow factories should reject stage keys that are not present in the tenant Organization Model.
64
+
65
+ 2. **The vocabulary carries metadata.** Labels, descriptions, ordering, and entity ownership should come from the catalog rather than being copied into each consumer.
66
+
67
+ 3. **Runtime state is sparse and additive.** New stages appear in entity state when reached. Adding a catalog member should not require backfilling every entity.
68
+
69
+ 4. **Producers return entity-tagged results.** Workflow steps should return which entity changed, its identifier, status, and optional data. The factory owns writing those results to the correct state map.
70
+
71
+ 5. **Capability binding is separate from stage naming.** Workflow templates should point at capability keys, and the tenant environment can bind those capabilities to concrete workflow resources.
72
+
73
+ ## Applying The Pattern
74
+
75
+ Use this checklist when adding or changing a tenant domain spine:
76
+
77
+ 1. Define the domain catalog in the tenant Organization Model.
78
+ 2. Include labels, descriptions, ordering, and entity ownership in each catalog entry.
79
+ 3. Make workflow templates reference catalog keys instead of free-form strings.
80
+ 4. Validate template stage keys when constructing workflow factories.
81
+ 5. Store progress in sparse entity state maps keyed by catalog member.
82
+ 6. Return entity-tagged workflow results and let the factory dispatch state updates.
83
+ 7. Read progress through query helpers that use the same catalog keys.
84
+ 8. Render UI labels, order, and status from the catalog plus state map.
85
+
86
+ Promote a vocabulary to a spine when the same catalog coordinates all three surfaces: at least one process definition, at least one workflow producer, and at least one independent consumer such as an API query or UI view.
87
+
88
+ ## Counter-Patterns
89
+
90
+ Avoid these patterns in spine-governed domains:
91
+
92
+ - Free-form stage strings in workflow inputs.
93
+ - Duplicated UI-only labels or ordering.
94
+ - Per-workflow skip logic that bypasses the shared pending and progress contract.
95
+ - State writes from individual steps instead of the workflow factory.
96
+ - Hidden side channels for progress, such as ad hoc context keys.
97
+ - Direct coupling between producer code and consumer UI code.
98
+
99
+ When in doubt, update the Organization Model vocabulary first, then let workflow templates, factories, queries, and views project from it.