@elevasis/sdk 1.5.2 → 1.5.4

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 (63) hide show
  1. package/dist/cli.cjs +899 -57
  2. package/dist/index.d.ts +94 -110
  3. package/package.json +3 -3
  4. package/reference/_navigation.md +11 -1
  5. package/reference/_reference-manifest.json +70 -0
  6. package/reference/claude-config/commands/submit-issue.md +12 -0
  7. package/reference/claude-config/hooks/post-edit-validate.mjs +109 -0
  8. package/reference/claude-config/hooks/tool-failure-recovery.mjs +73 -0
  9. package/reference/claude-config/rules/deployment.md +57 -0
  10. package/reference/claude-config/rules/docs.md +26 -0
  11. package/reference/claude-config/rules/error-handling.md +56 -0
  12. package/reference/claude-config/rules/execution.md +40 -0
  13. package/reference/claude-config/rules/frontend.md +43 -0
  14. package/reference/claude-config/rules/observability.md +31 -0
  15. package/reference/claude-config/rules/organization-os.md +62 -0
  16. package/reference/claude-config/rules/platform.md +41 -0
  17. package/reference/claude-config/rules/shared-types.md +46 -0
  18. package/reference/claude-config/rules/task-tracking.md +47 -0
  19. package/reference/claude-config/scripts/statusline-command.js +18 -0
  20. package/reference/claude-config/settings.json +30 -0
  21. package/reference/claude-config/skills/deploy/SKILL.md +166 -0
  22. package/reference/claude-config/skills/dsp/SKILL.md +66 -0
  23. package/reference/claude-config/skills/elevasis/SKILL.md +239 -0
  24. package/reference/claude-config/skills/explore/SKILL.md +78 -0
  25. package/reference/claude-config/skills/project/SKILL.md +918 -0
  26. package/reference/claude-config/skills/save/SKILL.md +197 -0
  27. package/reference/claude-config/skills/setup/SKILL.md +210 -0
  28. package/reference/claude-config/skills/status/SKILL.md +60 -0
  29. package/reference/claude-config/skills/submit-issue/SKILL.md +179 -0
  30. package/reference/claude-config/skills/sync/SKILL.md +81 -0
  31. package/reference/cli.mdx +35 -20
  32. package/reference/deployment/index.mdx +6 -5
  33. package/reference/deployment/provided-features.mdx +62 -40
  34. package/reference/deployment/ui-execution.mdx +1 -2
  35. package/reference/framework/agent.mdx +50 -50
  36. package/reference/framework/index.mdx +13 -10
  37. package/reference/framework/project-structure.mdx +76 -70
  38. package/reference/packages/core/src/README.md +24 -17
  39. package/reference/packages/core/src/business/README.md +52 -0
  40. package/reference/packages/core/src/organization-model/README.md +25 -26
  41. package/reference/packages/ui/src/app/README.md +24 -0
  42. package/reference/packages/ui/src/provider/README.md +8 -7
  43. package/reference/platform-tools/type-safety.mdx +0 -10
  44. package/reference/roadmap.mdx +6 -4
  45. package/reference/scaffold/core/organization-graph.mdx +37 -28
  46. package/reference/scaffold/core/organization-model.mdx +34 -36
  47. package/reference/scaffold/index.mdx +14 -9
  48. package/reference/scaffold/operations/propagation-pipeline.md +133 -0
  49. package/reference/scaffold/operations/scaffold-maintenance.md +125 -0
  50. package/reference/scaffold/operations/workflow-recipes.md +18 -1
  51. package/reference/scaffold/recipes/add-a-feature.md +37 -21
  52. package/reference/scaffold/recipes/add-a-resource.md +16 -12
  53. package/reference/scaffold/recipes/customize-organization-model.md +400 -0
  54. package/reference/scaffold/recipes/extend-a-base-entity.md +140 -0
  55. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +18 -12
  56. package/reference/scaffold/recipes/index.md +3 -3
  57. package/reference/scaffold/reference/contracts.md +11 -32
  58. package/reference/scaffold/reference/feature-registry.md +10 -9
  59. package/reference/scaffold/reference/glossary.md +14 -18
  60. package/reference/scaffold/ui/customization.md +2 -2
  61. package/reference/scaffold/ui/feature-flags-and-gating.md +40 -54
  62. package/reference/scaffold/ui/feature-shell.mdx +23 -24
  63. package/reference/scaffold/ui/recipes.md +118 -3
@@ -12,35 +12,30 @@ The current full-stack scaffold uses a workspace layout with `ui/`, `operations/
12
12
 
13
13
  ## Source Files
14
14
 
15
- ### `src/index.ts`
15
+ ### `operations/src/index.ts`
16
16
 
17
17
  The registry entry point for your workspace. This file aggregates resources from domain barrel files and re-exports them as a `DeploymentSpec` default export. It does not contain workflow logic itself -- its sole job is aggregation:
18
18
 
19
19
  ```ts
20
20
  import type { DeploymentSpec } from '@elevasis/sdk'
21
- import * as operations from './operations/index.js'
22
21
  import * as example from './example/index.js'
22
+ import * as emailNotification from './email-notification/exports.js'
23
23
 
24
24
  const org: DeploymentSpec = {
25
- workflows: [
26
- ...operations.workflows,
27
- ...example.workflows,
28
- ],
29
- agents: [
30
- ...operations.agents,
31
- ...example.agents,
32
- ],
25
+ version: '0.1.0',
26
+ workflows: [...example.workflows, ...emailNotification.workflows],
27
+ agents: [...example.agents, ...emailNotification.agents]
33
28
  }
34
29
  export default org
35
30
  ```
36
31
 
37
- Each domain directory exports `workflows` and `agents` arrays via an `index.ts` barrel. When you add a new domain, import it here and spread its arrays. The `/resource workflow` command updates the appropriate domain barrel automatically.
32
+ Each domain directory exports `workflows` and `agents` arrays via an `index.ts` barrel. When you add a new domain, import it here and spread its arrays.
38
33
 
39
- ### `src/operations/platform-status.ts`
34
+ ### `operations/src/email-notification/index.ts`
40
35
 
41
- A multi-step workflow demonstrating real platform API usage. Calls `platform.call({ tool: 'status', method: 'overview' })` to gather platform status data, then passes it to `platform.call({ tool: 'llm', method: 'generate' })` for a natural language summary. Shows the pattern for workflows that interact with platform tools and chain steps with `StepType.LINEAR`.
36
+ A multi-step workflow demonstrating real platform API usage. Sends an email notification using the `notifications` adapter and chains steps with `StepType.LINEAR`. Shows the pattern for workflows that use platform tool adapters and pass data between steps.
42
37
 
43
- ### `src/example/echo.ts`
38
+ ### `operations/src/example/echo.ts`
44
39
 
45
40
  The starter workflow, scaffolded to demonstrate the per-file pattern: one workflow per file with its own Zod input/output schemas, config object, contract, and step handler. Replace this domain with your own when you're ready.
46
41
 
@@ -48,9 +43,9 @@ The starter workflow, scaffolded to demonstrate the per-file pattern: one workfl
48
43
 
49
44
  Cross-runtime types, schemas, constants, and organization-model configuration shared between the UI and operations packages. Put contracts here when both runtimes need the same validation or labels without depending on app-specific code.
50
45
 
51
- ### `elevasis.config.ts`
46
+ ### `operations/elevasis.config.ts`
52
47
 
53
- Project-level configuration. The scaffolded file includes commented-out options (`defaultStatus`, `dev.port`) so you can discover available settings without looking them up:
48
+ Project-level configuration. The scaffolded file includes commented-out options (`defaultStatus`, `dev.port`) and sets `docsDir` to point at the workspace-level `docs/` directory:
54
49
 
55
50
  ```ts
56
51
  import type { ElevasConfig } from '@elevasis/sdk'
@@ -58,10 +53,12 @@ import type { ElevasConfig } from '@elevasis/sdk'
58
53
  export default {
59
54
  // defaultStatus: 'dev', // Default status for new resources ('dev' | 'prod')
60
55
  // dev: { port: 5170 }, // Local API port (internal development only)
56
+
57
+ docsDir: '../docs' // Scan the template's top-level docs/ directory
61
58
  } satisfies ElevasConfig
62
59
  ```
63
60
 
64
- Leave this file minimal -- the platform provides sensible defaults.
61
+ The `docsDir` option (relative to CWD) overrides where the CLI scans for documentation files. Use `false` to disable documentation scanning entirely.
65
62
 
66
63
  ---
67
64
 
@@ -97,7 +94,7 @@ This file is NOT scaffolded by default. The agent creates it the first time you
97
94
 
98
95
  ### `docs/in-progress/`
99
96
 
100
- Work-in-progress task documents managed by `/work`. Each file represents an active work item with objective, plan, progress markers, and resume context. When all steps are complete, the agent suggests finalizing the task, which moves finished items to their permanent location in `docs/`.
97
+ Work-in-progress task documents managed by `/work`. Each file represents an active work item with objective, plan, progress markers, and resume context. This is separate from the Projects data model exposed through `elevasis-sdk project:*`. When all steps are complete, the agent suggests finalizing the task, which moves finished items to their permanent location in `docs/`.
101
98
 
102
99
  This directory is NOT deployed -- it is filtered out during the doc scan in `elevasis-sdk deploy`.
103
100
 
@@ -105,26 +102,26 @@ This directory is NOT deployed -- it is filtered out during the doc scan in `ele
105
102
 
106
103
  ## Progressive Disclosure Directories
107
104
 
108
- Only `src/` and `docs/` are scaffolded by `elevasis-sdk init`. The following directories are NOT created by default -- they appear when a specific need arises:
109
-
110
- | Directory | Created by | When |
111
- | ---------------------- | -------------------------------- | ------------------------------------------------------------------ |
112
- | `src/operations/` | `elevasis-sdk init` (default) | Always -- platform-status workflow lives here |
113
- | `src/example/` | `elevasis-sdk init` (default) | Always -- echo starter workflow lives here (replace with your own) |
114
- | `foundations/` | `elevasis-sdk init` (default) | Always -- cross-runtime contracts, schemas, and organization model |
115
- | `docs/` | `elevasis-sdk init` (default) | Always |
116
- | `docs/in-progress/` | Agent (on first `/work`) | When you create a task doc for in-progress work |
117
- | `docs/project-map.mdx` | `elevasis-sdk deploy` | Auto-generated on every deploy |
118
- | `docs/priorities.mdx` | Agent (on first goal discussion) | When you discuss project goals or priorities |
119
- | `data/` | Agent (on demand) | When you connect a database |
120
- | `scripts/` | Agent (on demand) | When you need local scripts not deployed to the platform |
121
- | `src/lib/` | Agent (on demand) | When shared code exists between two or more workflows |
105
+ The following directories are included in the scaffold:
106
+
107
+ | Directory | Created by | When |
108
+ | ------------------------------------ | --------------- | ------------------------------------------------------------------ |
109
+ | `operations/src/example/` | Scaffold | Always -- echo starter workflow lives here (replace with your own) |
110
+ | `operations/src/email-notification/` | Scaffold | Always -- multi-step notification workflow example |
111
+ | `foundations/` | Scaffold | Always -- cross-runtime contracts, schemas, and organization model |
112
+ | `ui/` | Scaffold | Always -- React frontend application |
113
+ | `docs/` | Scaffold | Always |
114
+ | `docs/in-progress/` | Agent | When you create a task doc for in-progress work |
115
+ | `docs/resources.md` | `/deploy` skill | Auto-generated on every deploy |
116
+ | `data/` | Agent | When you connect a database |
117
+ | `scripts/` | Agent | When you need local scripts not deployed to the platform |
118
+ | `operations/src/lib/` | Agent | When shared code exists between two or more workflows |
122
119
 
123
120
  This structure keeps the initial workspace minimal and adds directories only when they earn their place.
124
121
 
125
- ### `src/lib/`
122
+ ### `operations/src/lib/`
126
123
 
127
- Legacy shared code directory. In the current workspace scaffold, prefer the top-level `foundations/` package for cross-runtime contracts. The agent may still create `src/lib/` in older projects that predate the workspace-based layout. Included in the esbuild bundle alongside workflow code.
124
+ Shared code directory for utilities used by multiple workflows within the operations package. In the current workspace scaffold, prefer the top-level `foundations/` package for cross-runtime contracts. Included in the esbuild bundle alongside workflow code.
128
125
 
129
126
  ### `data/`
130
127
 
@@ -140,14 +137,15 @@ Local utility scripts for tasks that do not run on the platform: database seeds,
140
137
 
141
138
  `elevasis-sdk deploy` touches only two directories:
142
139
 
143
- | Directory | Action | Deployed? |
144
- | ------------------- | ------------------------------------------------------------------------- | --------- |
145
- | `src/` | Bundle into `dist/bundle.js` via esbuild (includes `src/lib/` if present) | Yes |
146
- | `docs/` | Scan `.mdx` files, upload as documentation | Yes |
147
- | `docs/in-progress/` | Ignored -- work-in-progress, not deployed | No |
148
- | `data/` | Ignored -- local documentation for the agent | No |
149
- | `scripts/` | Ignored -- local scripts, not deployed | No |
150
- | `.claude/` | Ignored -- local development only | No |
140
+ | Directory | Action | Deployed? |
141
+ | ------------------- | ------------------------------------------------------------------------------------ | --------- |
142
+ | `operations/src/` | Bundle into `dist/bundle.js` via esbuild (includes `operations/src/lib/` if present) | Yes |
143
+ | `docs/` | Scan `.md` and `.mdx` files, upload as documentation | Yes |
144
+ | `docs/in-progress/` | Ignored -- work-in-progress, not deployed | No |
145
+ | `data/` | Ignored -- local documentation for the agent | No |
146
+ | `scripts/` | Ignored -- local scripts, not deployed | No |
147
+ | `.claude/` | Ignored -- local development only | No |
148
+ | `ui/` | Ignored -- frontend application, deployed separately | No |
151
149
 
152
150
  ---
153
151
 
@@ -196,7 +194,7 @@ Do not remove or heavily edit `CLAUDE.md`. It is the primary context source that
196
194
 
197
195
  ### `.claude/settings.json`
198
196
 
199
- Configures Claude Code for the workspace: disables auto-compaction (prevents losing earlier context in long sessions) and registers three hooks -- a PreToolUse boundary hook, a PostToolUse formatting/type-check hook, and a PostToolUseFailure error recovery hook.
197
+ Configures Claude Code for the workspace: registers a PostToolUse formatting/type-check hook (runs after Write, Edit, and MultiEdit) and a PostToolUseFailure error recovery hook (runs after Bash failures).
200
198
 
201
199
  ### `.claude/memory/`
202
200
 
@@ -221,12 +219,25 @@ This directory is gitignored -- it is personal to you and not shared with collab
221
219
 
222
220
  ## Slash Commands
223
221
 
224
- The `.claude/commands/` directory contains four commands covering the core development loop:
222
+ The `.claude/skills/` directory contains skills covering the core development loop:
225
223
 
226
- - **`/meta`** -- Project lifecycle: init, status, fix, deploy, health
227
- - **`/docs`** -- Browse, create, and verify permanent documentation
224
+ - **`/setup`** -- First-time project setup: placeholder replacement, deps, verification
225
+ - **`/deploy`** -- Full deploy pipeline: test, build, commit, push
226
+ - **`/elevasis`** -- SDK operations: check, deploy, exec
228
227
  - **`/work`** -- Task tracking across sessions: auto-detects intent (create, save, resume); suggests complete
229
- - **`/tutorial`** -- Progressive learning path adapted to your skill profile
228
+ - **`/status`** -- Quick project health check
229
+ - **`/save`** -- Auto-manage docs from conversation context
230
+ - **`/explore`** -- Codebase exploration anchored to docs
231
+ - **`/continue`** -- Resume in-progress work from docs
232
+ - **`/project`** -- Routes project management to the canonical `elevasis-sdk project:*` commands
233
+ - **`/dsp`** -- Parallel agent dispatch for implementation tasks
234
+ - **`/sync`** -- Pull latest, wipe caches, fresh reinstall
235
+
236
+ Boundary summary:
237
+
238
+ - `/project` updates shared project records
239
+ - `/work` manages docs-backed work tracking
240
+ - `/adev` handles implementation and execution work
230
241
 
231
242
  For detailed command documentation, see [Agent System](agent).
232
243
 
@@ -238,41 +249,36 @@ Not all scaffolded files participate in template updates. Files fall into two ca
238
249
 
239
250
  **SCAFFOLD_FILES total: 32**
240
251
 
241
- **INIT_ONLY** (14 files) -- Written once during `elevasis-sdk init`, never updated by `elevasis-sdk update`:
252
+ **INIT_ONLY** -- Written once during initial scaffold, never overwritten by updates:
242
253
 
243
254
  - `package.json`, `pnpm-workspace.yaml`, `tsconfig.json`
244
255
  - `.env`, `.npmrc`
245
- - `src/index.ts`, `src/operations/platform-status.ts`, `src/operations/index.ts`, `src/example/echo.ts`, `src/example/index.ts`, `foundations/types/index.ts`
256
+ - `operations/src/index.ts`, `operations/src/email-notification/index.ts`, `operations/src/email-notification/exports.ts`, `operations/src/example/echo.ts`, `operations/src/example/index.ts`, `foundations/`
246
257
  - `docs/index.md`, `docs/in-progress/.gitkeep`
247
- - `.claude/rules/workspace-patterns.md`
248
258
 
249
- **MANAGED** (18 files) -- Written during `elevasis-sdk init` and checked/updatable by `elevasis-sdk update`:
259
+ **MANAGED** -- Written during initial scaffold and updated when the template evolves:
250
260
 
251
- - `elevasis.config.ts`, `.gitignore`, `CLAUDE.md`, `.claude/settings.json`
252
- - Three hooks: `.claude/hooks/enforce-sdk-boundary.mjs`, `.claude/hooks/post-edit-validate.mjs`, `.claude/hooks/tool-failure-recovery.mjs`
253
- - Three command files: `.claude/commands/meta.md`, `.claude/commands/docs.md`, `.claude/commands/tutorial.md`
254
- - Two skills: `.claude/skills/work/SKILL.md`, `.claude/skills/creds/SKILL.md`
255
- - Five rule files: `.claude/rules/sdk-patterns.md`, `.claude/rules/docs-authoring.md`, `.claude/rules/memory-conventions.md`, `.claude/rules/project-map.md`, `.claude/rules/task-tracking.md`
261
+ - `operations/elevasis.config.ts`, `.gitignore`, `CLAUDE.md`, `.claude/settings.json`
262
+ - Two hooks: `.claude/hooks/post-edit-validate.mjs`, `.claude/hooks/tool-failure-recovery.mjs`
263
+ - Skills: `.claude/skills/work/SKILL.md`, `.claude/skills/elevasis/SKILL.md`, `.claude/skills/deploy/skill.md`, `.claude/skills/setup/SKILL.md`
264
+ - Rule files: `.claude/rules/task-tracking.md`, `.claude/rules/platform.md`, `.claude/rules/error-handling.md`, `.claude/rules/docs.md`, `.claude/rules/execution.md`, `.claude/rules/observability.md`
256
265
  - One script: `.claude/scripts/statusline-command.js`
257
266
 
258
- Run `elevasis-sdk update` after installing a new SDK version to bring managed files up to date. The command adds missing files directly and flags files that differ from the new template for agent-assisted review via `/meta fix`.
259
-
260
267
  ---
261
268
 
262
269
  ## File Reference
263
270
 
264
- | File | When You Edit It |
265
- | ----------------------- | ------------------------------------------------------------------------------ |
266
- | `src/index.ts` | Adding or removing resources (the `/resource` command does this automatically) |
267
- | `src/<domain>/*.ts` | Writing and modifying workflow logic (organized by business domain) |
268
- | `docs/index.md` | Updating project documentation |
269
- | `docs/project-map.mdx` | Never -- auto-generated by `elevasis-sdk deploy` |
270
- | `docs/priorities.mdx` | When goals or priorities change |
271
- | `elevasis.config.ts` | Changing project-level settings |
272
- | `.env` | Adding environment variables |
273
- | `CLAUDE.md` | Rarely -- only to add project-specific context |
274
- | `.claude/commands/*.md` | Rarely -- commands work well as scaffolded |
271
+ | File | When You Edit It |
272
+ | ------------------------------- | ------------------------------------------------------------------- |
273
+ | `operations/src/index.ts` | Adding or removing resources |
274
+ | `operations/src/<domain>/*.ts` | Writing and modifying workflow logic (organized by business domain) |
275
+ | `docs/index.md` | Updating project documentation |
276
+ | `docs/resources.md` | Never -- auto-generated by `/deploy` and `/elevasis deploy` |
277
+ | `operations/elevasis.config.ts` | Changing project-level settings |
278
+ | `.env` | Adding environment variables |
279
+ | `CLAUDE.md` | Rarely -- only to add project-specific context |
280
+ | `.claude/skills/*/SKILL.md` | Rarely -- skills work well as scaffolded |
275
281
 
276
282
  ---
277
283
 
278
- **Last Updated:** 2026-03-03
284
+ **Last Updated:** 2026-04-17
@@ -6,26 +6,33 @@ This package is the source of truth for shared types, schemas, and contract help
6
6
 
7
7
  ## Import Rules
8
8
 
9
- - Use `@elevasis/core` for browser-safe shared types and schemas.
10
- - Use `@elevasis/core/server` only for Node.js-only helpers and services.
11
- - Use `@elevasis/core/test-utils` for test fixtures and mocks.
12
- - Prefer the narrowest published subpath that matches the work you are doing.
9
+ - Use `@elevasis/core` (root export) for browser-safe shared types and schemas.
10
+ - Use `@elevasis/core/organization-model` for the semantic contract layer.
11
+ - These are the only two subpaths available to external consumers of the published npm package.
12
+ - Paths like `@elevasis/core/server`, `@elevasis/core/test-utils`, `@elevasis/core/platform`, etc. are internal monorepo paths (`@repo/core/...`) and are NOT available to external consumers.
13
13
 
14
14
  ## Published Surface Groups
15
15
 
16
- - `platform` - shared constants, utilities, registry, SSE, and API types.
17
- - `auth` - multi-tenancy types for organizations, users, memberships, invitations, and credentials.
18
- - `execution` - workflow, agent, scheduler, calibration, and execution-interface contracts.
19
- - `commands` - command queue types and schemas.
20
- - `deployments` - deployment response types.
21
- - `operations` - sessions, notifications, observability, activities, triggers, and debug logs.
22
- - `business` - acquisition and SEO contracts, plus the PDF surface under its own subpaths.
23
- - `organization-model` - the semantic contract layer for CRM, lead gen, delivery, features, branding, and navigation.
24
- - `supabase` - generated database types and helpers.
25
- - `forms` - shared form schemas and form-facing types.
26
- - `integrations` - OAuth and credential contracts.
27
- - `projects` - project management request and response schemas.
28
- - `content` - published content metadata types.
16
+ The published `@elevasis/core` npm package exposes exactly two subpaths:
17
+
18
+ - `.` (`@elevasis/core`) - browser-safe shared types, schemas, and constants.
19
+ - `./organization-model` (`@elevasis/core/organization-model`) - the semantic contract layer for CRM, lead gen, delivery, features, branding, and navigation.
20
+
21
+ Within the monorepo, the internal `@repo/core` package exposes additional subpaths for use by `apps/` and other packages:
22
+
23
+ - `@repo/core/server` - Node.js-only helpers and services.
24
+ - `@repo/core/platform` - shared constants, utilities, registry, SSE, and API types.
25
+ - `@repo/core/auth` - multi-tenancy types for organizations, users, memberships, invitations, and credentials.
26
+ - `@repo/core/execution` - workflow, agent, scheduler, and execution-interface contracts.
27
+ - `@repo/core/commands` - command queue types and schemas.
28
+ - `@repo/core/operations` - sessions, notifications, observability, activities, triggers, and debug logs.
29
+ - `@repo/core/supabase` - generated database types and helpers.
30
+ - `@repo/core/integrations/...` - OAuth and credential contracts.
31
+ - `@repo/core/projects/api-schemas` - project management request and response schemas.
32
+ - `@repo/core/content` - published content metadata types.
33
+ - `@repo/core/test-utils` - test fixtures and mocks (internal use only).
34
+
35
+ These `@repo/core/*` subpaths are NOT available in the published `@elevasis/core` package.
29
36
 
30
37
  ## When To Read Deeper
31
38
 
@@ -0,0 +1,52 @@
1
+ # Entities
2
+
3
+ Published base entity contracts for the Elevasis platform. Each entity ships as a TypeScript interface, a matching Zod schema, and an inferred `Input` type, generic over a `<TMeta>` extension slot.
4
+
5
+ External projects extend these in `foundations/types/entities.ts` to attach project-specific metadata while keeping the canonical shape stable.
6
+
7
+ ## Published Exports
8
+
9
+ The published entry point exposes six entity contracts:
10
+
11
+ - `BaseProject<TMeta>`, `BaseProjectSchema`, `BaseProjectInput`
12
+ - `BaseMilestone<TMeta>`, `BaseMilestoneSchema`, `BaseMilestoneInput`
13
+ - `BaseTask<TMeta>`, `BaseTaskSchema`, `BaseTaskInput`
14
+ - `BaseDeal<TMeta>`, `BaseDealSchema`, `BaseDealInput`
15
+ - `BaseCompany<TMeta>`, `BaseCompanySchema`, `BaseCompanyInput`
16
+ - `BaseContact<TMeta>`, `BaseContactSchema`, `BaseContactInput`
17
+
18
+ Import them from the published subpath:
19
+
20
+ ```ts
21
+ import { BaseDealSchema, type BaseDeal } from '@elevasis/core/entities'
22
+ ```
23
+
24
+ ## Extension Pattern
25
+
26
+ Each base interface accepts a generic metadata type. Extend the schema with `.extend({ metadata: ... })` and infer the type with `BaseProject<z.infer<typeof MetaSchema>>`.
27
+
28
+ ```ts
29
+ import { z } from 'zod'
30
+ import { BaseProjectSchema, type BaseProject } from '@elevasis/core/entities'
31
+
32
+ const ProjectMetaSchema = z.object({
33
+ budget: z.number().int().nonnegative(),
34
+ clientPriority: z.enum(['low', 'medium', 'high'])
35
+ })
36
+
37
+ export const ProjectSchema = BaseProjectSchema.extend({ metadata: ProjectMetaSchema })
38
+ export type Project = BaseProject<z.infer<typeof ProjectMetaSchema>>
39
+ ```
40
+
41
+ Use the base shape as-is when no extension is needed:
42
+
43
+ ```ts
44
+ export const DealSchema = BaseDealSchema
45
+ export type Deal = BaseDeal
46
+ ```
47
+
48
+ ## Recipe
49
+
50
+ The full pattern is documented in the SDK scaffold bundle: `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-a-base-entity.md`.
51
+
52
+ The canonical template demo lives at `external/_template/foundations/types/entities.ts`.
@@ -12,6 +12,9 @@ The public entry point exposes:
12
12
  - `DEFAULT_ORGANIZATION_MODEL`
13
13
  - `defineOrganizationModel`
14
14
  - `resolveOrganizationModel`
15
+ - `PROJECTS_FEATURE_ID`
16
+ - `PROJECTS_INDEX_SURFACE_ID`
17
+ - `DELIVERY_PROJECTS_VIEW_CAPABILITY_ID`
15
18
  - `OrganizationModel` and the supporting domain types
16
19
 
17
20
  Import it from the published subpath:
@@ -19,7 +22,10 @@ Import it from the published subpath:
19
22
  ```ts
20
23
  import {
21
24
  DEFAULT_ORGANIZATION_MODEL,
25
+ DELIVERY_PROJECTS_VIEW_CAPABILITY_ID,
22
26
  defineOrganizationModel,
27
+ PROJECTS_FEATURE_ID,
28
+ PROJECTS_INDEX_SURFACE_ID,
23
29
  resolveOrganizationModel,
24
30
  type OrganizationModel
25
31
  } from '@elevasis/core/organization-model'
@@ -31,43 +37,36 @@ The model is versioned and currently validates against `version: 1`.
31
37
 
32
38
  Top-level fields:
33
39
 
34
- - `domains` - semantic domain entries that bind entity IDs, surface IDs, resource IDs, and capability IDs.
40
+ - `version` - schema version for the resolved contract.
35
41
  - `branding` - organization branding defaults and overrides.
36
- - `features` - grouped shell-level feature flags and labels.
42
+ - `features` - unified feature entries that combine enablement, labels, and semantic references.
37
43
  - `navigation` - navigation model for the product shell.
38
44
  - `crm` - CRM-specific contract data.
39
45
  - `leadGen` - lead generation contract data.
40
46
  - `delivery` - delivery and project contract data.
41
47
  - `resourceMappings` - cross-surface resource mappings.
42
48
 
43
- ## Default Domain Set
49
+ ## Default Feature Set
44
50
 
45
- The default model includes four semantic domains:
51
+ The default model includes seven feature IDs:
46
52
 
47
53
  - `crm` - deal pipeline and relationship management.
48
54
  - `lead-gen` - lists, companies, and contacts.
49
- - `delivery` - projects, milestones, and tasks.
55
+ - `projects` - projects, milestones, and tasks.
50
56
  - `operations` - organization graph and command-view surfaces.
57
+ - `monitoring` - monitoring surfaces.
58
+ - `settings` - organization settings.
59
+ - `seo` - SEO surfaces (disabled by default).
51
60
 
52
- ## Feature Keys
61
+ ## Project Bridge Constants
53
62
 
54
- The current canonical feature keys are grouped shell features:
63
+ The organization-model surface now exports a narrow set of canonical IDs for the shared Projects bridge:
55
64
 
56
- - `acquisition`
57
- - `delivery`
58
- - `operations`
59
- - `monitoring`
60
- - `settings`
61
- - `calibration`
62
- - `seo`
65
+ - `PROJECTS_FEATURE_ID` -> `projects`
66
+ - `PROJECTS_INDEX_SURFACE_ID` -> `projects.index`
67
+ - `DELIVERY_PROJECTS_VIEW_CAPABILITY_ID` -> `delivery.projects.view`
63
68
 
64
- Each feature can carry an enabled flag and an optional label override.
65
-
66
- This is intentionally different from the domain and surface vocabulary:
67
-
68
- - domains and surface IDs still use IDs such as `crm`, `lead-gen`, and `projects.index`
69
- - navigation surfaces point those routes at grouped `featureKey` values such as `acquisition` and `delivery`
70
- - downstream apps may still carry compatibility aliases for legacy route-level keys, but the published organization-model contract does not
69
+ Use these when wiring shared UI manifests, template adapters, or other consumers that need to agree on the same Projects contract without repeating raw literals.
71
70
 
72
71
  ## Resolution Semantics
73
72
 
@@ -82,13 +81,13 @@ This is intentionally different from the domain and surface vocabulary:
82
81
 
83
82
  - `navigation.defaultSurfaceId` must point at a declared navigation surface.
84
83
  - Every navigation group `surfaceId` must resolve to a declared surface.
85
- - Domain, surface, and resource-mapping IDs must resolve to declared counterparts; dangling references fail validation.
86
- - Domain-to-surface and domain/surface-to-resource links are validated in both directions so one-sided declarations fail during resolution.
87
- - Feature-bearing surfaces validate `featureKey` against the canonical grouped feature set.
84
+ - Feature, surface, and resource-mapping IDs must resolve to declared counterparts; dangling references fail validation.
85
+ - Feature-to-surface and feature/surface-to-resource links are validated in both directions so one-sided declarations fail during resolution.
86
+ - Feature-bearing surfaces validate `featureId` against the canonical feature set.
88
87
 
89
88
  ## Practical Guidance
90
89
 
91
90
  - Use `resolveOrganizationModel()` when you need a runtime-safe model for rendering or policy checks.
92
91
  - Use `defineOrganizationModel()` when authoring a static partial model in source.
93
- - Treat `features.enabled` and `features.labels` as the shell-level contract; do not use `crm`, `lead-gen`, or `projects` as canonical feature keys in new organization-model authoring.
94
- - Keep domain IDs, surface IDs, and capability IDs stable because downstream UI and policy code depend on them.
92
+ - Treat feature IDs such as `crm`, `lead-gen`, and `projects` as the canonical shell-level contract in new organization-model authoring.
93
+ - Keep feature IDs, surface IDs, and capability IDs stable because downstream UI and policy code depend on them.
@@ -0,0 +1,24 @@
1
+ # App
2
+
3
+ Published app factory for downstream applications.
4
+
5
+ ## Exports
6
+
7
+ - `createElevasisApp(config)` -- factory that composes providers, router, auth, and theme into a mountable React app
8
+ - `ElevasisAppConfig` -- configuration interface (router, query client, theme, store hooks, error handling)
9
+ - `ElevasisAppStoreConfig` -- store integration hooks for theme state
10
+
11
+ ## Usage
12
+
13
+ ```ts
14
+ import { createElevasisApp } from '@elevasis/ui/app'
15
+
16
+ const { App } = createElevasisApp({
17
+ router,
18
+ queryClient,
19
+ store: { useThemePreset, useThemeColorScheme, useSetTheme },
20
+ themeConfig: { presets, defaultPreset },
21
+ })
22
+ ```
23
+
24
+ Consumers must import CSS separately in their entry point.
@@ -4,6 +4,8 @@ The provider surface composes the shared Elevasis service, feature, appearance,
4
4
 
5
5
  ## Exports
6
6
 
7
+ The following are exported from `published.ts`, which is the external consumer surface for `@elevasis/ui/provider`:
8
+
7
9
  - `ElevasisCoreProvider`
8
10
  - `ElevasisFeaturesProvider`
9
11
  - `useElevasisFeatures`
@@ -15,17 +17,16 @@ The provider surface composes the shared Elevasis service, feature, appearance,
15
17
  - `useElevasisServices`
16
18
  - `NotificationProvider`
17
19
  - `useNotificationAdapter`
18
- - `ElevasisUIProvider`
19
20
  - Related provider and service types
20
21
 
22
+ Note: `ElevasisUIProvider` (the Mantine-facing visual layer) is available internally via `@repo/ui` but is NOT exported from the published `@elevasis/ui/provider` subpath. It is only available via the internal `./provider/ui` monorepo subpath.
23
+
21
24
  ## Related Published Subpaths
22
25
 
23
- - `./provider`
24
- - `./provider/ui`
25
- - `./provider/ElevasisServiceContext`
26
+ - `./provider` - headless providers (points to `published.ts`; no Mantine dependency)
27
+ - `./provider/ui` - full provider including Mantine-dependent `ElevasisUIProvider` (internal monorepo use; also published for consumers that opt in)
26
28
 
27
29
  ## Notes
28
30
 
29
- - `published.ts` is the external consumer surface.
30
- - `ElevasisUIProvider` is the Mantine-facing visual layer; `ElevasisCoreProvider` and `ElevasisFeaturesProvider` handle the platform shell.
31
-
31
+ - `published.ts` is the external consumer surface for `@elevasis/ui/provider`.
32
+ - `ElevasisUIProvider` is Mantine-dependent and available only via `@repo/ui` internally or `@elevasis/ui/provider/ui`; it is not included in the headless `./provider` published export.
@@ -79,14 +79,4 @@ Some adapters were audited and deliberately left with flexible types. Do not tig
79
79
 
80
80
  ---
81
81
 
82
- ## Known Exceptions
83
-
84
- ### `website-extract-calibration.ts`
85
-
86
- `external/elevasis/src/client-acquisition/lead-gen-pipeline/02-extract/website-extract-calibration.ts` intentionally omits `provider` and `model` on its `llm.generate()` call. This is a calibration variant that injects model config via `definitionOverrides.modelConfig` at deploy time.
87
-
88
- This file requires `@ts-expect-error` above the `llm.generate()` call after each SDK publish, since the type change would otherwise cause a compile error on a legitimate use case.
89
-
90
- ---
91
-
92
82
  **Source:** `packages/sdk/src/worker/adapters/llm.ts`, `packages/core/src/execution/engine/tools/tool-maps.ts`
@@ -44,7 +44,7 @@ Retries are platform-side only -- workers are ephemeral and never retry internal
44
44
 
45
45
  ## Workflow Step Failure
46
46
 
47
- **Status: Planned.** The current runtime uses fail-fast behavior with `WorkflowStepError`. The `onError` callback, `completedSteps`, and `partialOutput` features described below are not yet implemented.
47
+ **Status: Planned.** The current runtime uses fail-fast behavior: when a step handler throws, the worker logs a `step-failed` context entry and re-throws the original error unchanged. The `onError` callback, `completedSteps`, and `partialOutput` features described below are not yet implemented.
48
48
 
49
49
  Default behavior is fail-fast: when a step throws, the workflow fails immediately.
50
50
 
@@ -71,11 +71,13 @@ Default behavior is fail-fast: when a step throws, the workflow fails immediatel
71
71
 
72
72
  ## Agent Failure Modes
73
73
 
74
- **Status: Implemented** (SDK 0.4.2). Agent execution runs in ephemeral worker threads with full tool calling support via `PostMessageLLMAdapter`.
74
+ **Status: Planned.** Agent execution runs in ephemeral worker threads with full tool calling support via `PostMessageLLMAdapter`. The current runtime uses fail-fast behavior for all agent error paths; the richer failure handling described below is not yet implemented.
75
75
 
76
- Agents have multiple failure paths due to the LLM loop:
76
+ **Current behavior:** Any unhandled error from the agent (including `AgentMaxIterationsError` thrown by `@repo/core` when the iteration limit is reached) propagates out of the worker and is reported as a failed execution. The worker sends: `{ type: 'result', status: 'failed', error: 'ErrorName: message', logs, metrics: { durationMs } }`. There is no graceful termination, partial output, or retry logic in the worker itself.
77
77
 
78
- - **Max iterations reached:** The agent returns the best output produced so far, plus a warning flag (`maxIterationsReached: true`). This is a graceful termination, not an error.
78
+ **Planned improvements:**
79
+
80
+ - **Max iterations reached:** Instead of throwing, the agent returns the best output produced so far, plus a warning flag (`maxIterationsReached: true`). This becomes a graceful termination rather than a failure.
79
81
  - **Tool crash:** Tool errors are caught by the SDK runtime, formatted as a tool result, and sent back to the LLM. The LLM decides whether to retry, try a different approach, or give up.
80
82
  - **Model refusal:** If the model refuses the prompt, the SDK retries once with an adjusted system prompt. If the retry also refuses, the agent fails with `code: 'MODEL_REFUSAL'`.
81
83
  - **Model API error:** Network errors, rate limits, or server errors from the model provider. The SDK retries with exponential backoff (3 attempts, 1s/2s/4s), then fails with `code: 'MODEL_ERROR'`.