@elevasis/sdk 1.8.2 → 1.9.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 (62) hide show
  1. package/dist/cli.cjs +289 -105
  2. package/dist/index.d.ts +90 -39
  3. package/dist/types/worker/adapters/lead.d.ts +1 -1
  4. package/dist/worker/index.js +2 -0
  5. package/package.json +2 -2
  6. package/reference/_navigation.md +7 -1
  7. package/reference/_reference-manifest.json +14 -0
  8. package/reference/claude-config/logs/scaffold-registry-reminder.log +3 -0
  9. package/reference/claude-config/rules/agent-start-here.md +254 -254
  10. package/reference/claude-config/rules/frontend.md +43 -43
  11. package/reference/claude-config/rules/operations.md +64 -64
  12. package/reference/claude-config/rules/organization-model.md +42 -43
  13. package/reference/claude-config/rules/organization-os.md +107 -107
  14. package/reference/claude-config/rules/shared-types.md +2 -2
  15. package/reference/claude-config/rules/task-tracking.md +1 -1
  16. package/reference/claude-config/rules/ui.md +202 -202
  17. package/reference/claude-config/rules/vibe.md +202 -202
  18. package/reference/claude-config/skills/configure/SKILL.md +98 -98
  19. package/reference/claude-config/skills/configure/operations/codify-level-a.md +100 -100
  20. package/reference/claude-config/skills/configure/operations/codify-level-b.md +158 -158
  21. package/reference/claude-config/skills/configure/operations/customers.md +150 -150
  22. package/reference/claude-config/skills/configure/operations/features.md +162 -162
  23. package/reference/claude-config/skills/configure/operations/goals.md +147 -147
  24. package/reference/claude-config/skills/configure/operations/identity.md +133 -133
  25. package/reference/claude-config/skills/configure/operations/labels.md +128 -128
  26. package/reference/claude-config/skills/configure/operations/offerings.md +159 -159
  27. package/reference/claude-config/skills/configure/operations/roles.md +153 -153
  28. package/reference/claude-config/skills/configure/operations/techStack.md +139 -139
  29. package/reference/claude-config/skills/explore/SKILL.md +78 -78
  30. package/reference/claude-config/skills/git-sync/SKILL.md +126 -0
  31. package/reference/claude-config/skills/save/SKILL.md +183 -183
  32. package/reference/claude-config/skills/setup/SKILL.md +275 -275
  33. package/reference/claude-config/skills/sync/SKILL.md +10 -44
  34. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -0
  35. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -0
  36. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +86 -0
  37. package/reference/claude-config/sync-notes/README.md +43 -0
  38. package/reference/deployment/index.mdx +42 -7
  39. package/reference/examples/organization-model.ts +689 -0
  40. package/reference/index.mdx +6 -5
  41. package/reference/packages/core/src/README.md +39 -36
  42. package/reference/packages/core/src/business/README.md +52 -52
  43. package/reference/packages/core/src/organization-model/README.md +97 -97
  44. package/reference/packages/core/src/test-utils/README.md +42 -0
  45. package/reference/scaffold/core/organization-graph.mdx +272 -272
  46. package/reference/scaffold/core/organization-model.mdx +320 -320
  47. package/reference/scaffold/index.mdx +64 -64
  48. package/reference/scaffold/operations/propagation-pipeline.md +125 -104
  49. package/reference/scaffold/operations/scaffold-maintenance.md +122 -122
  50. package/reference/scaffold/operations/workflow-recipes.md +436 -436
  51. package/reference/scaffold/recipes/add-a-feature.md +158 -158
  52. package/reference/scaffold/recipes/add-a-resource.md +158 -158
  53. package/reference/scaffold/recipes/customize-organization-model.md +400 -400
  54. package/reference/scaffold/recipes/extend-a-base-entity.md +140 -140
  55. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +158 -158
  56. package/reference/scaffold/recipes/index.md +32 -32
  57. package/reference/scaffold/reference/contracts.md +608 -607
  58. package/reference/scaffold/reference/feature-registry.md +2 -0
  59. package/reference/scaffold/reference/glossary.md +105 -105
  60. package/reference/scaffold/ui/composition-extensibility.mdx +1 -1
  61. package/reference/scaffold/ui/feature-flags-and-gating.md +1 -1
  62. package/reference/claude-config/commands/submit-request.md +0 -11
@@ -8,7 +8,7 @@ loadWhen: "First session or new to the SDK"
8
8
 
9
9
  Workflows are step-based automations with typed inputs and outputs. Agents are autonomous AI resources with access to platform tools. Both are defined in TypeScript, exported from a single entry point, and deployed with `elevasis-sdk deploy`. Resources appear in AI Studio immediately after a successful deploy.
10
10
 
11
- The SDK ships with a full CLI (`elevasis-sdk`) for validation, deployment, execution, inspection, and project-management operations. Platform tools expose 70+ integrations across 12 adapters -- Gmail, Stripe, Google Sheets, Attio, and more -- with credentials managed server-side so API keys never cross the execution boundary.
11
+ The SDK ships with a full CLI (`elevasis-sdk`) for validation, deployment, execution, inspection, and project-management operations. Platform tools expose 70+ tools across integration adapters and platform services -- Gmail, Stripe, Google Sheets, Attio, and more -- with credentials managed server-side so API keys never cross the execution boundary.
12
12
 
13
13
  ## Quick Start
14
14
 
@@ -25,7 +25,7 @@ After `pnpm dlx @elevasis/sdk init`, your project is scaffolded with a working e
25
25
 
26
26
  - **Workflows** -- Step-based automation with typed inputs and outputs. Steps can be linear, conditional, or branching. Each step is a plain async function. See [Resources](resources/index.mdx) for the complete definition API.
27
27
  - **Agents** -- Autonomous AI resources with access to platform tools. Agents run in the worker runtime with full LLM access and platform tool support. Use `--async` when executing agents to avoid HTTP timeout limits on long-running runs.
28
- - **Feature-driven apps** -- The published `@elevasis/ui@2.7.0` surface includes manifest-backed shared features for Lead Gen, CRM, Projects, Operations, Monitoring, Settings, and SEO, plus dashboard-oriented compatibility components for host-owned shells. See [Provided Features](deployment/provided-features.mdx).
28
+ - **Feature-driven apps** -- The published `@elevasis/ui` surface includes manifest-backed shared features for Lead Gen, CRM, Projects, Operations, Monitoring, Settings, and SEO, plus dashboard-oriented compatibility components for host-owned shells. See [Provided Features](deployment/provided-features.mdx).
29
29
 
30
30
  ## Platform Tools
31
31
 
@@ -41,7 +41,7 @@ await scheduler.createSchedule({ ... })
41
41
  const result = await llm.generate({ messages: [...] })
42
42
  ```
43
43
 
44
- The platform exposes 70+ tools across 12 integration adapters -- Gmail, Stripe, Google Sheets, Attio, and more. Credentials are managed server-side; API keys never cross the execution boundary.
44
+ The platform exposes 70+ tools across integration adapters and platform services -- Gmail, Stripe, Google Sheets, Attio, and more. Credentials are managed server-side; API keys never cross the execution boundary.
45
45
 
46
46
  See [Platform Tools](platform-tools/index.mdx) for the full catalog.
47
47
 
@@ -72,7 +72,7 @@ See [Platform Tools](platform-tools/index.mdx) for the full catalog.
72
72
 
73
73
  ### Typed Adapters
74
74
 
75
- - [Integration Adapters](platform-tools/adapters-integration.mdx) - All 12 integration adapters: Attio, Stripe, Google Sheets, Resend, and more
75
+ - [Integration Adapters](platform-tools/adapters-integration.mdx) - Integration adapter catalog for Attio, Stripe, Google Sheets, Resend, and more
76
76
  - [Platform Adapters](platform-tools/adapters-platform.mdx) - All 9 platform service adapters: scheduler, storage, llm, pdf, approval, and more
77
77
 
78
78
  ### Framework
@@ -94,6 +94,7 @@ See [Platform Tools](platform-tools/index.mdx) for the full catalog.
94
94
  - [Command Center](deployment/command-center.mdx) - Resource graph, relationships, node types, and post-deployment UI reference
95
95
  - [Provided Features](deployment/provided-features.mdx) - Manifest-backed shared features, compatibility components, and host shell wiring
96
96
  - [Execution API](deployment/api.mdx) - REST endpoints for executing resources and managing deployments
97
+ - [UI Execution](deployment/ui-execution.mdx) - Custom React execution dialogs, forms, and hooks built with `@elevasis/ui`
97
98
 
98
99
  ### More
99
100
 
@@ -102,4 +103,4 @@ See [Platform Tools](platform-tools/index.mdx) for the full catalog.
102
103
 
103
104
  ---
104
105
 
105
- **Last Updated:** 2026-04-16
106
+ **Last Updated:** 2026-04-23
@@ -1,41 +1,44 @@
1
- # @elevasis/core
2
-
3
- Published browser-safe shared contracts for the Elevasis platform.
4
-
5
- This package is the source of truth for shared types, schemas, and contract helpers that are safe to consume from apps and other packages. In this repo the source package is named `@repo/core`, but these docs describe the published `@elevasis/core` surface.
6
-
7
- ## Import Rules
8
-
1
+ # @elevasis/core
2
+
3
+ Published browser-safe shared contracts for the Elevasis platform.
4
+
5
+ This package is the source of truth for shared types, schemas, and contract helpers that are safe to consume from apps and other packages. In this repo the source package is named `@repo/core`, but these docs describe the published `@elevasis/core` surface.
6
+
7
+ ## Import Rules
8
+
9
9
  - Use `@elevasis/core` (root export) for browser-safe shared types and schemas.
10
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
-
14
- ## Published Surface Groups
15
-
16
- The published `@elevasis/core` npm package exposes exactly two subpaths:
11
+ - Use `@elevasis/core/entities` for the published base entity contracts.
12
+ - Use `@elevasis/core/test-utils` for shared test fixtures, mocks, and test helpers.
13
+ - Paths like `@elevasis/core/server` and `@elevasis/core/platform` are internal monorepo paths (`@repo/core/...`) and are NOT available to external consumers.
14
+
15
+ ## Published Surface Groups
16
+
17
+ The published `@elevasis/core` npm package exposes these subpaths:
17
18
 
18
19
  - `.` (`@elevasis/core`) - browser-safe shared types, schemas, and constants.
19
20
  - `./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.
36
-
37
- ## When To Read Deeper
38
-
39
- - For the organization model contract, start with [organization-model/README.md](./organization-model/README.md).
40
- - For test utilities, read [test-utils/README.md](./test-utils/README.md).
41
- - For credentials, read [auth/multi-tenancy/credentials/README.md](./auth/multi-tenancy/credentials/README.md) if you are working in source. The runtime helpers are server-only.
21
+ - `./entities` (`@elevasis/core/entities`) - published base entity contracts generic over project metadata extensions.
22
+ - `./test-utils` (`@elevasis/core/test-utils`) - test fixtures, mocks, and helpers for downstream automated tests.
23
+
24
+ Within the monorepo, the internal `@repo/core` package exposes additional subpaths for use by `apps/` and other packages:
25
+
26
+ - `@repo/core/server` - Node.js-only helpers and services.
27
+ - `@repo/core/platform` - shared constants, utilities, registry, SSE, and API types.
28
+ - `@repo/core/auth` - multi-tenancy types for organizations, users, memberships, invitations, and credentials.
29
+ - `@repo/core/execution` - workflow, agent, scheduler, and execution-interface contracts.
30
+ - `@repo/core/commands` - command queue types and schemas.
31
+ - `@repo/core/operations` - sessions, notifications, observability, activities, triggers, and debug logs.
32
+ - `@repo/core/supabase` - generated database types and helpers.
33
+ - `@repo/core/integrations/...` - OAuth and credential contracts.
34
+ - `@repo/core/projects/api-schemas` - project management request and response schemas.
35
+ - `@repo/core/content` - published content metadata types.
36
+ - `@repo/core/test-utils` - source of the published test fixtures and mocks surface.
37
+
38
+ Other `@repo/core/*` subpaths remain monorepo-only unless they are explicitly listed above in the published `@elevasis/core` surface.
39
+
40
+ ## When To Read Deeper
41
+
42
+ - For the organization model contract, start with [organization-model/README.md](./organization-model/README.md).
43
+ - For test utilities, read [test-utils/README.md](./test-utils/README.md).
44
+ - For credentials, read [auth/multi-tenancy/credentials/README.md](./auth/multi-tenancy/credentials/README.md) if you are working in source. The runtime helpers are server-only.
@@ -1,52 +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`.
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`.
@@ -1,97 +1,97 @@
1
- # Organization Model
2
-
3
- The organization model is the published semantic contract that maps a tenant's product shape to domain surfaces, features, and navigation.
4
-
5
- Use this module when you need to resolve or validate an organization's contract before wiring UI shells, routing, or domain-specific capability checks.
6
-
7
- ## Published Exports
8
-
9
- The public entry point exposes:
10
-
11
- - `OrganizationModelSchema`
12
- - `DEFAULT_ORGANIZATION_MODEL`
13
- - `defineOrganizationModel`
14
- - `resolveOrganizationModel`
15
- - `PROJECTS_FEATURE_ID`
16
- - `PROJECTS_INDEX_SURFACE_ID`
17
- - `PROJECTS_VIEW_CAPABILITY_ID`
18
- - `OrganizationModel` and the supporting domain types
19
-
20
- Import it from the published subpath:
21
-
22
- ```ts
23
- import {
24
- DEFAULT_ORGANIZATION_MODEL,
25
- PROJECTS_VIEW_CAPABILITY_ID,
26
- defineOrganizationModel,
27
- PROJECTS_FEATURE_ID,
28
- PROJECTS_INDEX_SURFACE_ID,
29
- resolveOrganizationModel,
30
- type OrganizationModel
31
- } from '@elevasis/core/organization-model'
32
- ```
33
-
34
- ## Contract Shape
35
-
36
- The model is versioned and currently validates against `version: 1`.
37
-
38
- Top-level fields:
39
-
40
- - `version` - schema version for the resolved contract.
41
- - `branding` - organization branding defaults and overrides.
42
- - `features` - unified feature entries that combine enablement, labels, and semantic references.
43
- - `navigation` - navigation model for the product shell.
44
- - `sales` - sales pipeline and relationship management.
45
- - `prospecting` - lists, companies, and contacts.
46
- - `projects` - projects, milestones, and tasks.
47
- - `identity`, `customers`, `offerings`, `roles`, `goals` - reality domains (2026-04 expansion).
48
- - `statuses` - unified status registry across delivery / hitl / execution / request / schedule.
49
- - `operations` - catalog of stateful runtime entities (HITL queue, sessions, executions, notifications, schedules).
50
- - `resourceMappings` - cross-surface resource mappings (includes techStack subsection).
51
-
52
- ## Default Feature Set
53
-
54
- The default model includes eight feature IDs:
55
-
56
- - `sales` - deal pipeline and relationship management.
57
- - `prospecting` - lists, companies, and contacts.
58
- - `projects` - projects, milestones, and tasks.
59
- - `operations` - organization graph and command-view surfaces.
60
- - `monitoring` - monitoring surfaces.
61
- - `settings` - organization settings.
62
- - `seo` - SEO surfaces (disabled by default).
63
- - `configure` - `/configure` skill entry point (external projects).
64
-
65
- ## Project Bridge Constants
66
-
67
- The organization-model surface exports a narrow set of canonical IDs for the shared Projects bridge:
68
-
69
- - `PROJECTS_FEATURE_ID` -> `projects`
70
- - `PROJECTS_INDEX_SURFACE_ID` -> `projects.index`
71
- - `PROJECTS_VIEW_CAPABILITY_ID` -> `delivery.projects.view`
72
-
73
- 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.
74
-
75
- ## Resolution Semantics
76
-
77
- - `defineOrganizationModel()` is a typed helper. It does not validate or merge anything by itself.
78
- - `resolveOrganizationModel()` deep-merges a partial override into the default model, then validates the result with `OrganizationModelSchema`.
79
- - Plain objects merge recursively.
80
- - Arrays replace the default value instead of merging element-by-element.
81
- - If `navigation.surfaces` is replaced without also supplying `navigation.groups`, inherited default groups are dropped when they no longer point at declared surfaces.
82
- - Missing fields fall back to `DEFAULT_ORGANIZATION_MODEL`.
83
-
84
- ## Referential Integrity
85
-
86
- - `navigation.defaultSurfaceId` must point at a declared navigation surface.
87
- - Every navigation group `surfaceId` must resolve to a declared surface.
88
- - Feature, surface, and resource-mapping IDs must resolve to declared counterparts; dangling references fail validation.
89
- - Feature-to-surface and feature/surface-to-resource links are validated in both directions so one-sided declarations fail during resolution.
90
- - Feature-bearing surfaces validate `featureId` against the canonical feature set.
91
-
92
- ## Practical Guidance
93
-
94
- - Use `resolveOrganizationModel()` when you need a runtime-safe model for rendering or policy checks.
95
- - Use `defineOrganizationModel()` when authoring a static partial model in source.
96
- - Treat feature IDs such as `sales`, `prospecting`, and `projects` as the canonical shell-level contract in new organization-model authoring.
97
- - Keep feature IDs, surface IDs, and capability IDs stable because downstream UI and policy code depend on them.
1
+ # Organization Model
2
+
3
+ The organization model is the published semantic contract that maps a tenant's product shape to domain surfaces, features, and navigation.
4
+
5
+ Use this module when you need to resolve or validate an organization's contract before wiring UI shells, routing, or domain-specific capability checks.
6
+
7
+ ## Published Exports
8
+
9
+ The public entry point exposes:
10
+
11
+ - `OrganizationModelSchema`
12
+ - `DEFAULT_ORGANIZATION_MODEL`
13
+ - `defineOrganizationModel`
14
+ - `resolveOrganizationModel`
15
+ - `PROJECTS_FEATURE_ID`
16
+ - `PROJECTS_INDEX_SURFACE_ID`
17
+ - `PROJECTS_VIEW_CAPABILITY_ID`
18
+ - `OrganizationModel` and the supporting domain types
19
+
20
+ Import it from the published subpath:
21
+
22
+ ```ts
23
+ import {
24
+ DEFAULT_ORGANIZATION_MODEL,
25
+ PROJECTS_VIEW_CAPABILITY_ID,
26
+ defineOrganizationModel,
27
+ PROJECTS_FEATURE_ID,
28
+ PROJECTS_INDEX_SURFACE_ID,
29
+ resolveOrganizationModel,
30
+ type OrganizationModel
31
+ } from '@elevasis/core/organization-model'
32
+ ```
33
+
34
+ ## Contract Shape
35
+
36
+ The model is versioned and currently validates against `version: 1`.
37
+
38
+ Top-level fields:
39
+
40
+ - `version` - schema version for the resolved contract.
41
+ - `branding` - organization branding defaults and overrides.
42
+ - `features` - unified feature entries that combine enablement, labels, and semantic references.
43
+ - `navigation` - navigation model for the product shell.
44
+ - `sales` - sales pipeline and relationship management.
45
+ - `prospecting` - lists, companies, and contacts.
46
+ - `projects` - projects, milestones, and tasks.
47
+ - `identity`, `customers`, `offerings`, `roles`, `goals` - reality domains (2026-04 expansion).
48
+ - `statuses` - unified status registry across delivery / hitl / execution / request / schedule.
49
+ - `operations` - catalog of stateful runtime entities (HITL queue, sessions, executions, notifications, schedules).
50
+ - `resourceMappings` - cross-surface resource mappings (includes techStack subsection).
51
+
52
+ ## Default Feature Set
53
+
54
+ The default model includes eight feature IDs:
55
+
56
+ - `sales` - deal pipeline and relationship management.
57
+ - `prospecting` - lists, companies, and contacts.
58
+ - `projects` - projects, milestones, and tasks.
59
+ - `operations` - organization graph and command-view surfaces.
60
+ - `monitoring` - monitoring surfaces.
61
+ - `settings` - organization settings.
62
+ - `seo` - SEO surfaces (disabled by default).
63
+ - `configure` - `/configure` skill entry point (external projects).
64
+
65
+ ## Project Bridge Constants
66
+
67
+ The organization-model surface exports a narrow set of canonical IDs for the shared Projects bridge:
68
+
69
+ - `PROJECTS_FEATURE_ID` -> `projects`
70
+ - `PROJECTS_INDEX_SURFACE_ID` -> `projects.index`
71
+ - `PROJECTS_VIEW_CAPABILITY_ID` -> `delivery.projects.view`
72
+
73
+ 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.
74
+
75
+ ## Resolution Semantics
76
+
77
+ - `defineOrganizationModel()` is a typed helper. It does not validate or merge anything by itself.
78
+ - `resolveOrganizationModel()` deep-merges a partial override into the default model, then validates the result with `OrganizationModelSchema`.
79
+ - Plain objects merge recursively.
80
+ - Arrays replace the default value instead of merging element-by-element.
81
+ - If `navigation.surfaces` is replaced without also supplying `navigation.groups`, inherited default groups are dropped when they no longer point at declared surfaces.
82
+ - Missing fields fall back to `DEFAULT_ORGANIZATION_MODEL`.
83
+
84
+ ## Referential Integrity
85
+
86
+ - `navigation.defaultSurfaceId` must point at a declared navigation surface.
87
+ - Every navigation group `surfaceId` must resolve to a declared surface.
88
+ - Feature, surface, and resource-mapping IDs must resolve to declared counterparts; dangling references fail validation.
89
+ - Feature-to-surface and feature/surface-to-resource links are validated in both directions so one-sided declarations fail during resolution.
90
+ - Feature-bearing surfaces validate `featureId` against the canonical feature set.
91
+
92
+ ## Practical Guidance
93
+
94
+ - Use `resolveOrganizationModel()` when you need a runtime-safe model for rendering or policy checks.
95
+ - Use `defineOrganizationModel()` when authoring a static partial model in source.
96
+ - Treat feature IDs such as `sales`, `prospecting`, and `projects` as the canonical shell-level contract in new organization-model authoring.
97
+ - Keep feature IDs, surface IDs, and capability IDs stable because downstream UI and policy code depend on them.
@@ -0,0 +1,42 @@
1
+ # Test Utilities
2
+
3
+ Published test helpers for downstream consumers of `@elevasis/core`.
4
+
5
+ The public `@elevasis/core/test-utils` subpath is intentionally narrow. It exposes:
6
+
7
+ - `RLSTestContext` for dev-database RLS integration tests
8
+ - `setupMatchMedia`, `setupResizeObserver`, and `setupBrowserMocks` for jsdom/browser test setup
9
+
10
+ Internal monorepo fixtures and Vitest-specific mocks still exist under `packages/core/src/test-utils/`, but they are not part of the published package contract.
11
+
12
+ ## Published Usage
13
+
14
+ ### Browser Mocks
15
+
16
+ ```typescript
17
+ import { setupBrowserMocks } from '@elevasis/core/test-utils'
18
+
19
+ setupBrowserMocks()
20
+ ```
21
+
22
+ ### RLS Integration Tests
23
+
24
+ ```typescript
25
+ import { RLSTestContext } from '@elevasis/core/test-utils'
26
+
27
+ const ctx = new RLSTestContext()
28
+ ```
29
+
30
+ `RLSTestContext` requires a configured Supabase development environment:
31
+
32
+ - `SUPABASE_URL`
33
+ - `SUPABASE_ANON_KEY`
34
+ - `SUPABASE_SERVICE_KEY`
35
+ - `SUPABASE_JWT_SECRET`
36
+
37
+ ## Internal Scope
38
+
39
+ The following folders remain implementation detail for the monorepo and are not published:
40
+
41
+ - `fixtures/`
42
+ - `mocks/`