@elevasis/sdk 1.10.0 → 1.12.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 (40) hide show
  1. package/dist/cli.cjs +52 -149
  2. package/dist/index.d.ts +468 -198
  3. package/dist/index.js +225 -147
  4. package/dist/test-utils/index.d.ts +272 -99
  5. package/dist/test-utils/index.js +4756 -125
  6. package/dist/types/worker/adapters/llm.d.ts +1 -1
  7. package/dist/worker/index.js +14 -6
  8. package/package.json +2 -2
  9. package/reference/claude-config/rules/agent-start-here.md +14 -14
  10. package/reference/claude-config/skills/configure/SKILL.md +3 -3
  11. package/reference/claude-config/skills/setup/SKILL.md +6 -6
  12. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +55 -0
  13. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +101 -0
  14. package/reference/cli.mdx +57 -0
  15. package/reference/deployment/provided-features.mdx +40 -267
  16. package/reference/examples/organization-model.ts +99 -564
  17. package/reference/packages/core/src/organization-model/README.md +102 -97
  18. package/reference/resources/types.mdx +72 -163
  19. package/reference/scaffold/core/organization-graph.mdx +92 -272
  20. package/reference/scaffold/core/organization-model.mdx +155 -320
  21. package/reference/scaffold/index.mdx +3 -0
  22. package/reference/scaffold/operations/propagation-pipeline.md +4 -1
  23. package/reference/scaffold/operations/scaffold-maintenance.md +3 -0
  24. package/reference/scaffold/operations/workflow-recipes.md +13 -10
  25. package/reference/scaffold/recipes/add-a-feature.md +105 -158
  26. package/reference/scaffold/recipes/add-a-resource.md +88 -158
  27. package/reference/scaffold/recipes/customize-organization-model.md +144 -400
  28. package/reference/scaffold/recipes/extend-a-base-entity.md +11 -8
  29. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +117 -158
  30. package/reference/scaffold/recipes/index.md +3 -0
  31. package/reference/scaffold/reference/contracts.md +107 -435
  32. package/reference/scaffold/reference/feature-registry.md +11 -8
  33. package/reference/scaffold/reference/glossary.md +74 -105
  34. package/reference/scaffold/ui/composition-extensibility.mdx +3 -0
  35. package/reference/scaffold/ui/customization.md +3 -0
  36. package/reference/scaffold/ui/feature-flags-and-gating.md +29 -231
  37. package/reference/scaffold/ui/feature-shell.mdx +53 -219
  38. package/reference/scaffold/ui/recipes.md +65 -397
  39. package/reference/claude-config/logs/pre-edit-vibe-gate.log +0 -40
  40. package/reference/claude-config/logs/scaffold-registry-reminder.log +0 -38
@@ -1,64 +1,36 @@
1
1
  ---
2
2
  title: Provided Features
3
- description: Shared UI and API surfaces for packaged business systems like Lead Gen, CRM, and Projects via @elevasis/ui/features/* and the SDK CLI
3
+ description: Shared UI and API surfaces for packaged business systems like Lead Gen, CRM, Projects, Operations, Monitoring, and Settings via @elevasis/ui/features/*.
4
4
  loadWhen: "Building against packaged app features, list-oriented lead gen, CRM, or project-management surfaces"
5
5
  ---
6
6
 
7
- The SDK now covers more than raw workflow execution. The published `@elevasis/ui@2.9.0` package includes:
8
-
9
- - manifest-backed shared features under `@elevasis/ui/features/<name>`
10
- - headless shell/provider exports under `@elevasis/ui/provider`
11
- - compatibility re-exports from `@elevasis/ui/components` for existing consumers
12
-
13
- Use this page to understand what the shared shell actually owns, which surfaces are still host-owned, and which API or CLI surface to reach for.
14
-
15
- ---
7
+ The SDK includes more than workflow execution. The published `@elevasis/ui` package provides feature manifests, pages, hooks, and headless provider exports for building shell-aware applications.
16
8
 
17
9
  ## Shared Shell Contract
18
10
 
19
- `ElevasisFeaturesProvider` and `FeatureShell` give you a shared manifest-driven shell layer, not a full application shell. In `2.9.0` they handle:
20
-
21
- - feature registration
22
- - feature-gated nav contribution
23
- - route-to-sidebar subshell dispatch when a manifest includes a shared sidebar
24
- - shared provider context such as `timeRange` and operations runtime inputs
25
-
26
- Your host app still owns:
27
-
28
- - TanStack route registration
29
- - top-level app nav, topbar, branding, and auth wiring
30
- - app-specific assistant/admin behavior
31
- - any dashboard or landing page experience that is not backed by a published manifest
11
+ `ElevasisFeaturesProvider` reads a flat `OrganizationModel.features` list and exposes a shell model with feature-tree helpers. Feature manifests provide implementation hooks such as icons and sidebars; they do not own structural navigation.
32
12
 
33
13
  ```tsx
34
14
  import { Outlet } from '@tanstack/react-router'
35
- import { IconLayoutDashboard } from '@tabler/icons-react'
36
- import {
37
- ElevasisFeaturesProvider,
38
- FeatureShell,
39
- type AppShellOverrides
40
- } from '@elevasis/ui/provider'
15
+ import { ElevasisFeaturesProvider, FeatureShell } from '@elevasis/ui/provider'
41
16
  import { leadGenManifest } from '@elevasis/ui/features/lead-gen'
42
17
  import { crmManifest } from '@elevasis/ui/features/crm'
43
18
  import { deliveryManifest } from '@elevasis/ui/features/delivery'
44
19
  import { monitoringManifest } from '@elevasis/ui/features/monitoring'
45
20
  import { settingsManifest } from '@elevasis/ui/features/settings'
21
+ import { canonicalOrganizationModel } from '@foundation/config/organization-model'
46
22
 
47
23
  const features = [
48
24
  leadGenManifest,
49
25
  crmManifest,
50
26
  deliveryManifest,
51
27
  monitoringManifest,
52
- settingsManifest,
28
+ settingsManifest
53
29
  ]
54
30
 
55
- const appShellOverrides: AppShellOverrides = {
56
- primaryNavItems: [{ label: 'Dashboard', icon: IconLayoutDashboard, link: '/' }],
57
- }
58
-
59
31
  export function AppShell() {
60
32
  return (
61
- <ElevasisFeaturesProvider features={features} appShellOverrides={appShellOverrides}>
33
+ <ElevasisFeaturesProvider features={features} organizationModel={canonicalOrganizationModel}>
62
34
  <FeatureShell>
63
35
  <Outlet />
64
36
  </FeatureShell>
@@ -67,254 +39,55 @@ export function AppShell() {
67
39
  }
68
40
  ```
69
41
 
70
- What this gives you:
71
-
72
- - manifest-backed nav items merged with app-owned nav
73
- - automatic shared sidebar dispatch for manifests that define both routes and a sidebar
74
- - shared pages and hooks without copying the same subshell wiring into each app
75
-
76
- Dashboard is not part of that shared manifest shell by default. `@elevasis/ui/features/dashboard` exports reusable dashboard components, but it does not publish a `dashboardManifest`.
77
-
78
- ---
42
+ Host apps still own TanStack route registration, topbar behavior, branding, auth wiring, and any root dashboard composition.
79
43
 
80
44
  ## Contract Matrix
81
45
 
82
- This is the published contract split in `@elevasis/ui@2.9.0`:
83
-
84
- | Contract type | What is published | Current examples |
85
- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
86
- | Manifest-backed shared subshell features | Feature manifest plus shared sidebar/pages, mounted through `@elevasis/ui/provider` | Lead Gen, CRM, Projects, Operations, SEO |
87
- | Manifest-backed nav/app sections | Feature manifest contributes gated nav and route metadata, but the host still owns the route pages or shell chrome | Monitoring, Settings |
88
- | Exported compatibility components | Reusable components exported without a manifest-backed shell contract | Dashboard components such as `Dashboard`, `OperationsOverview`, `ResourceOverview`, `RecentExecutionsByResource`, `UnresolvedErrorsTeaser` |
89
- | Compatibility barrel | Existing imports remain available from `@elevasis/ui/components`, but new host integrations should prefer feature/provider subpaths | Manifests, sidebars, and page components re-exported for compatibility |
90
-
91
- Projects is currently the only packaged system with a first-class `elevasis-sdk project:*` CLI family. Treat that CLI family as the canonical project-management path. Lead Gen and CRM are still primarily UI + API + workflow/runtime surfaces, and browser-facing interactions remain REST-driven even when runtime tools exist.
46
+ | Contract type | What is published | Current examples |
47
+ | --- | --- | --- |
48
+ | Manifest-backed shared subshell features | Feature manifest plus shared sidebar/pages, mounted through `@elevasis/ui/provider` | Lead Gen, CRM, Projects, Operations |
49
+ | Shared feature pages and hooks | Pages, hooks, and helpers that can be composed inside host routes | Monitoring, Settings, Dashboard widgets |
50
+ | Headless provider contract | Provider, hooks, and shell model helpers | `ElevasisFeaturesProvider`, `useElevasisFeatures`, `FeatureShell` |
51
+ | Compatibility barrel | Existing imports remain available while newer integrations prefer feature/provider subpaths | `@elevasis/ui/components` |
92
52
 
93
53
  ## System Map
94
54
 
95
- | System | Primary route space | Shared UI surface | Main data surface | Best SDK entry point |
96
- | ---------- | ------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
97
- | Lead Gen | `/lead-gen/*` | Lead Gen pages, sidebars, list detail page, run dialogs | Acquisition list APIs + list/acqDb platform tools | `@elevasis/ui/features/lead-gen`, `@elevasis/ui/hooks`, `@elevasis/sdk/worker` |
98
- | CRM | `/crm/*` | CRM sidebar, overview widgets, deal/detail pages, workbench panels | Deal APIs, recent-activity API, acquisition-backed hooks, and the `crm` runtime adapter | `@elevasis/ui/features/crm`, `@elevasis/ui/hooks`, `@elevasis/sdk/worker` |
99
- | Projects | `/projects/*` | Projects list page, milestones/tasks/notes sidebars and pages | Project, milestone, task, note REST endpoints + CLI | `@elevasis/ui/features/delivery`, `@elevasis/ui/hooks/delivery`, `elevasis-sdk project:*` |
100
- | Dashboard | host-owned | Dashboard and overview components only; no shared manifest-backed nav contract | Host-chosen API composition | `@elevasis/ui/features/dashboard` |
101
- | Monitoring | `/monitoring/*` | Monitoring nav metadata plus exported pages/components; no shared `FeatureShell` sidebar today | Monitoring REST APIs | `@elevasis/ui/features/monitoring` |
102
- | Settings | `/settings/*` | Settings nav metadata plus exported settings components; no shared `FeatureShell` sidebar today | Settings/account/org REST APIs | `@elevasis/ui/features/settings` |
103
-
104
- ---
105
-
106
- ## Lead Gen
107
-
108
- Lead Gen is now list-oriented. The operational unit is a list, not a batch. Each list owns its own pipeline config and execution history.
109
-
110
- ### Shared UI Surface
55
+ | System | Primary route space | Shared UI surface | Best SDK entry point |
56
+ | --- | --- | --- | --- |
57
+ | Lead Gen | `/lead-gen/*` | Lead Gen pages, sidebars, list detail page, run dialogs | `@elevasis/ui/features/lead-gen`, `@elevasis/ui/hooks`, `@elevasis/sdk/worker` |
58
+ | CRM | `/crm/*` | CRM sidebar, overview widgets, deal/detail pages, workbench panels | `@elevasis/ui/features/crm`, `@elevasis/ui/hooks`, `@elevasis/sdk/worker` |
59
+ | Projects | `/projects/*` | Projects list page, milestones/tasks/notes sidebars and pages | `@elevasis/ui/features/delivery`, `@elevasis/ui/hooks/delivery`, `elevasis-sdk project:*` |
60
+ | Operations | `/operations/*` | Command View, resources, organization graph, sessions | `@elevasis/ui/features/operations` |
61
+ | Dashboard | `/` host-owned | Dashboard and overview components only | `@elevasis/ui/features/dashboard` |
62
+ | Monitoring | `/monitoring/*` | Monitoring pages/components | `@elevasis/ui/features/monitoring` |
63
+ | Settings | `/settings/*` | Settings/account/org components | `@elevasis/ui/features/settings` |
111
64
 
112
- `@elevasis/ui/features/lead-gen` exports the main Lead Gen building blocks:
65
+ ## Organization Model Alignment
113
66
 
114
- - `LeadGenSidebar`
115
- - `LeadGenOverviewPage`
116
- - `LeadGenListsPage`
117
- - `LeadGenListDetailPage`
118
- - `LeadGenCompaniesPage`
119
- - `LeadGenContactsPage`
120
- - `LIST_TEMPLATE_OPTIONS`
121
- - `buildListConfig`
122
-
123
- The most important page for downstream agents is `LeadGenListDetailPage`. It combines:
124
-
125
- - list config editing
126
- - live progress and funnel views
127
- - execution history
128
- - per-step run actions via `ResourceExecuteDialog`
129
-
130
- ### Shared UI Hooks
131
-
132
- `@elevasis/ui/hooks` exposes list-aware hooks backed by the acquisition API:
133
-
134
- | Hook | HTTP path |
135
- | ----------------------------- | ------------------------------------------- |
136
- | `useLists()` | `GET /acquisition/lists` |
137
- | `useList(listId)` | `GET /acquisition/lists/:listId` |
138
- | `useListsTelemetry()` | `GET /acquisition/lists/telemetry` |
139
- | `useListProgress(listId)` | `GET /acquisition/lists/:listId/progress` |
140
- | `useListExecutions(listId)` | `GET /acquisition/lists/:listId/executions` |
141
- | `useCreateList()` | `POST /acquisition/lists` |
142
- | `useUpdateList(listId)` | `PATCH /acquisition/lists/:listId` |
143
- | `useUpdateListConfig(listId)` | `PATCH /acquisition/lists/:listId/config` |
144
- | `useDeleteList()` | `DELETE /acquisition/lists/:listId` |
145
-
146
- Lead Gen also sits on broader acquisition endpoints for companies and contacts:
147
-
148
- - `GET /acquisition/companies`
149
- - `POST /acquisition/companies`
150
- - `GET /acquisition/contacts`
151
- - `POST /acquisition/contacts`
152
-
153
- ### Workflow Runtime Surface
154
-
155
- Inside workflows and agents, there are two relevant platform adapters:
156
-
157
- - `acqDb` for broad acquisition CRUD
158
- - `list` for focused list execution and stage-tracking operations
67
+ Feature IDs in manifests must match Organization Model feature IDs:
159
68
 
160
69
  ```ts
161
- import { acqDb, list } from '@elevasis/sdk/worker'
162
-
163
- const config = await list.getConfig({ listId })
164
-
165
- await list.recordExecution({
166
- listId,
167
- executionId: context.executionId,
168
- payload: { resourceId: context.resourceId },
169
- })
170
-
171
- await list.updateCompanyStage({
172
- listId,
173
- companyId,
174
- stage: 'qualified',
175
- })
176
- ```
177
-
178
- Use `list` when the workflow is scoped to a list run. Use `acqDb` when you need broader company, contact, or deal CRUD.
179
-
180
- ### CLI Status
181
-
182
- There is no dedicated downstream `elevasis-sdk lead-gen:*` family today.
183
-
184
- - In this monorepo there is platform-side lead-gen operational tooling, but that is not the same thing as a published downstream SDK CLI contract.
185
- - For downstream SDK users, the contract is currently UI + HTTP API + workflow/runtime adapters.
186
-
187
- ---
188
-
189
- ## CRM
190
-
191
- CRM is packaged as a shared feature module rather than a one-off app implementation.
192
-
193
- ### Shared UI Surface
194
-
195
- `@elevasis/ui/features/crm` exports:
196
-
197
- - `CrmSidebar`
198
- - `CrmOverview`
199
- - `DealsListPage`
200
- - `DealDetailPage`
201
- - `PipelineFunnelWidget`
202
- - `TasksDueWidget`
203
- - `ActivityFeedWidget`
204
- - `MetricsStrip`
205
- - `MyTasksPanel`
206
- - `SavedViewsPanel`
207
- - `QuickCreateActions`
208
-
209
- The CRM manifest is `crmManifest`, with the route prefix `/crm` and feature-key alignment to the acquisition feature set.
210
-
211
- ### API Surface
212
-
213
- CRM is not CLI-first today, but it does have real API-backed behavior and a dedicated runtime adapter for agent/workflow use.
214
-
215
- Shared CRM pages and hooks currently rely on:
216
-
217
- - deal list/detail surfaces through the acquisition/deal APIs
218
- - `GET /crm/recent-activity` for the overview activity feed
219
- - the `crm` platform tool for runtime access to deal, task, note, stage, and activity operations
220
-
221
- That means downstream users can build against CRM with shared UI, API, and runtime contracts, but there is not yet a dedicated `elevasis-sdk crm:*` CLI family.
222
-
223
- ### Practical Guidance
224
-
225
- - Use the shared CRM pages first; do not rebuild sidebar and overview chrome locally unless the app truly diverges.
226
- - Treat CRM overview/workbench components as the canonical packaged surface for downstream apps.
227
- - When CRM actions depend on acquisition or delivery state, keep the route shell local and compose the shared packaged widgets inside it.
228
- - Treat CRM as UI + API + runtime tools today, with browser interactivity still driven primarily by REST endpoints rather than the platform adapter.
229
-
230
- ---
231
-
232
- ## Projects
233
-
234
- Projects is the packaged delivery/project-management system. It has both a shared UI surface and a first-class CLI surface in `elevasis-sdk`, plus a dedicated runtime adapter for workflow and agent use.
235
-
236
- Within Organization OS, this packaged system sits on the **delivery** semantic domain but is exposed as the first-class feature ID **`projects`**. In practice that means:
237
-
238
- - the published UI manifest is `deliveryManifest`
239
- - the manifest gates against `featureId: 'projects'`
240
- - the default navigation surface is `projects.index`
241
- - the underlying semantic entities and capabilities still use delivery-scoped IDs such as `delivery.project`, `delivery.milestone`, `delivery.task`, and `delivery.projects.view`
242
-
243
- Treat `elevasis-sdk project:*` as the operational interface to that same contract, not as a separate project system layered beside Organization OS.
244
-
245
- ### Shared UI Surface
246
-
247
- `@elevasis/ui/features/delivery` exports:
248
-
249
- - `ProjectsListPage`
250
- - `ProjectsSidebar`
251
- - `ProjectsSidebarMiddle`
252
- - milestone, task, and note status helpers
253
- - `deliveryManifest`
254
-
255
- ### Shared UI Hooks
256
-
257
- `@elevasis/ui/hooks/delivery` talks to the project-management API:
258
-
259
- | Hook | HTTP path |
260
- | -------------------------------- | ------------------------------------- |
261
- | `useProjects()` | `GET /projects` |
262
- | `useProject(id)` | `GET /projects/:id` |
263
- | `useTasks({ projectId })` | `GET /projects/:projectId/tasks` |
264
- | `useMilestones({ projectId })` | `GET /projects/:projectId/milestones` |
265
- | `useProjectNotes({ projectId })` | `GET /projects/:projectId/notes` |
266
- | `useCreateTask()` | `POST /project-tasks` |
267
- | `useUpdateTask()` | `PATCH /project-tasks/:id` |
268
- | `useCreateNote()` | `POST /project-notes` |
269
-
270
- ### CLI Surface
271
-
272
- The SDK CLI exposes the canonical project-management commands:
273
-
274
- ```bash
275
- elevasis-sdk project:list
276
- elevasis-sdk project:get <id>
277
- elevasis-sdk project:create --name "Website Refresh" --kind client_engagement
278
-
279
- elevasis-sdk project:milestone:list --project <id>
280
- elevasis-sdk project:task:list --project <id>
281
- elevasis-sdk project:note:list --project <id>
282
-
283
- elevasis-sdk project:task:resume <task-id> --pretty
284
- elevasis-sdk project:task:save <task-id> --current-state "Implemented the API slice"
70
+ features: [
71
+ { id: 'dashboard', label: 'Dashboard', enabled: true, path: '/', uiPosition: 'sidebar-primary' },
72
+ { id: 'sales', label: 'Sales', enabled: true, uiPosition: 'sidebar-primary' },
73
+ { id: 'sales.crm', label: 'CRM', enabled: true, path: '/crm' },
74
+ { id: 'operations.resources', label: 'Resources', enabled: true, path: '/operations/resources' }
75
+ ]
285
76
  ```
286
77
 
287
- This matters for downstream user agents because project tasks now have a resumable machine-readable surface. `project:task:resume` returns `resume_context`, and `project:task:save` updates it.
288
-
289
- For semantic context, the CLI maps onto the same Organization OS contract that drives the shared shell:
290
-
291
- - project records correspond to the `projects` feature in the organization model
292
- - the shared UI route space resolves through `projects.index`
293
- - status semantics still come from `organizationModel.delivery`, not from a separate CLI-only schema
294
-
295
- ### Command Boundary
296
-
297
- - `/project` should route here. It is a convenience layer over `elevasis-sdk project:*`, not a separate system.
298
- - `/work` should stay focused on docs-backed task tracking and resume notes.
299
- - `/external` applies only to standalone apps in `external/`.
300
- - `/adev` applies when building, testing, debugging, or executing resources, not when managing project records.
301
-
302
- ---
78
+ Sidebar hierarchy is derived from dotted IDs. Containers omit `path`; leaves provide `path`.
303
79
 
304
80
  ## Choosing The Right Surface
305
81
 
306
- - Need packaged nav contribution or shared subshell routing? Use `ElevasisFeaturesProvider`, `FeatureShell`, and manifests from `@elevasis/ui/features/<name>`.
307
- - Need a dashboard or landing page in the app root? Keep that route host-owned and compose exported components from `@elevasis/ui/features/dashboard` or `@elevasis/ui/components`.
82
+ - Need packaged sidebar/page composition? Use `ElevasisFeaturesProvider`, `FeatureShell`, and manifests from `@elevasis/ui/features/*`.
83
+ - Need a root dashboard? Keep that route host-owned and compose dashboard components.
308
84
  - Need list-scoped lead-gen runtime behavior? Use the `list` adapter, then `acqDb` for broader acquisition CRUD.
309
- - Need a custom React page against an existing system? Start with the shared `@elevasis/ui` pages and hooks before writing app-local fetch logic.
310
- - Need project/task automation from an agent or terminal workflow? Use `elevasis-sdk project:*`.
311
-
312
- ---
85
+ - Need project/task automation? Use `elevasis-sdk project:*`.
313
86
 
314
87
  ## Related
315
88
 
316
- - [Deployment](index.mdx) - Deploy lifecycle and bundle behavior
317
- - [Command Center](command-center.mdx) - Managed platform UI after deploy
318
- - [UI Execution](ui-execution.mdx) - `ResourceExecuteDialog`, execution hooks, and custom run flows
319
- - [Platform Adapters](../platform-tools/adapters-platform.mdx) - `acqDb`, `list`, `execution`, and other platform services
320
- - [CLI Reference](../cli.mdx) - Full command catalog, now including project-management commands
89
+ - [Deployment](index.mdx)
90
+ - [Command Center](command-center.mdx)
91
+ - [UI Execution](ui-execution.mdx)
92
+ - [Platform Adapters](../platform-tools/adapters-platform.mdx)
93
+ - [CLI Reference](../cli.mdx)