@elevasis/sdk 1.18.0 → 1.20.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.
- package/dist/cli.cjs +1915 -70
- package/dist/index.d.ts +825 -16
- package/dist/index.js +714 -63
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +213 -2
- package/dist/test-utils/index.d.ts +479 -14
- package/dist/test-utils/index.js +660 -54
- package/dist/worker/index.js +516 -54
- package/package.json +4 -4
- package/reference/_navigation.md +2 -1
- package/reference/_reference-manifest.json +14 -0
- package/reference/claude-config/registries/graph-skills.json +4 -0
- package/reference/claude-config/rules/agent-start-here.md +5 -5
- package/reference/claude-config/rules/deployment.md +4 -3
- package/reference/claude-config/rules/frontend.md +2 -2
- package/reference/claude-config/rules/operations.md +17 -13
- package/reference/claude-config/rules/organization-model.md +7 -5
- package/reference/claude-config/rules/organization-os.md +13 -11
- package/reference/claude-config/rules/ui.md +3 -3
- package/reference/claude-config/rules/vibe.md +4 -4
- package/reference/claude-config/skills/explore/SKILL.md +4 -4
- package/reference/claude-config/skills/knowledge/SKILL.md +17 -16
- package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +7 -7
- package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +13 -13
- package/reference/claude-config/skills/knowledge/operations/customers.md +1 -1
- package/reference/claude-config/skills/knowledge/operations/goals.md +1 -1
- package/reference/claude-config/skills/knowledge/operations/identity.md +1 -1
- package/reference/claude-config/skills/knowledge/operations/offerings.md +1 -1
- package/reference/claude-config/skills/knowledge/operations/roles.md +1 -1
- package/reference/claude-config/skills/knowledge/operations/techStack.md +19 -91
- package/reference/claude-config/skills/project/SKILL.md +73 -13
- package/reference/claude-config/skills/save/SKILL.md +5 -5
- package/reference/claude-config/skills/tutorial/technical.md +11 -14
- package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +60 -0
- package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -0
- package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -0
- package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -0
- package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -0
- package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -0
- package/reference/examples/organization-model.ts +17 -5
- package/reference/framework/index.mdx +1 -1
- package/reference/framework/project-structure.mdx +10 -8
- package/reference/packages/core/src/business/README.md +2 -2
- package/reference/packages/core/src/organization-model/README.md +10 -3
- package/reference/resources/index.mdx +27 -17
- package/reference/scaffold/core/organization-model.mdx +33 -14
- package/reference/scaffold/operations/workflow-recipes.md +35 -29
- package/reference/scaffold/recipes/add-a-feature.md +18 -3
- package/reference/scaffold/recipes/add-a-resource.md +50 -10
- package/reference/scaffold/recipes/customize-crm-actions.md +12 -6
- package/reference/scaffold/recipes/customize-organization-model.md +18 -3
- package/reference/scaffold/recipes/extend-crm.md +17 -19
- package/reference/scaffold/recipes/extend-lead-gen.md +31 -31
- package/reference/scaffold/recipes/index.md +1 -1
- package/reference/scaffold/reference/contracts.md +512 -307
- package/reference/scaffold/reference/feature-registry.md +1 -1
- package/reference/scaffold/reference/glossary.md +8 -3
- package/reference/scaffold/ui/recipes.md +21 -6
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Clients Domain Release Train
|
|
2
|
+
|
|
3
|
+
## Why this note exists
|
|
4
|
+
|
|
5
|
+
The clients domain release train adds client-management surfaces across the shared platform packages and updates template-facing project guidance. Template-derived projects need the new package baselines and guidance before they rely on the clients CLI, published clients UI feature exports, or project skill client-linkage instructions.
|
|
6
|
+
|
|
7
|
+
## Applies to
|
|
8
|
+
|
|
9
|
+
Template-derived projects that consume `@elevasis/core`, `@elevasis/ui`, or `@elevasis/sdk`, especially projects that expose client management in UI shells or use the SDK CLI for project/client linkage.
|
|
10
|
+
|
|
11
|
+
## Required actions
|
|
12
|
+
|
|
13
|
+
- Pull the updated template dependency baselines for `core/package.json`, `ui/package.json`, and `operations/package.json` after the release stages publish new package versions.
|
|
14
|
+
- Review project-local usage of project/client CLI flags and prefer `--client` / `--clear-client` for client linkage; keep `--client-company-id` only for the legacy company field.
|
|
15
|
+
- If the project maintains local Claude skill guidance, reconcile the project skill client-linkage wording with the updated template baseline.
|
|
16
|
+
- Smoke the clients UI route only after the project has the updated `@elevasis/ui` baseline.
|
|
17
|
+
|
|
18
|
+
## Verification
|
|
19
|
+
|
|
20
|
+
Run the package-specific checks after sync:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pnpm -C core check-types
|
|
24
|
+
pnpm -C operations check-types
|
|
25
|
+
pnpm -C ui check-types
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
For projects adopting the clients UI immediately, also open the clients list and detail routes and verify the route renders with the current organization selected.
|
|
29
|
+
|
|
30
|
+
## Not handled by /git-sync
|
|
31
|
+
|
|
32
|
+
`/git-sync` can propagate template baselines and guidance, but it does not publish packages, deploy the SDK resources bundle, decide project-specific client data migration policy, or validate tenant-specific WorkOS/Supabase data availability.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# 2026-05-09 -- Command System SDK Release Train
|
|
2
|
+
|
|
3
|
+
## Why this note exists
|
|
4
|
+
|
|
5
|
+
This train adds SDK CLI catalog, acquisition CLI read, API-key external route, and deterministic knowledge-routing changes to the existing SDK release queue. It publishes updated `@elevasis/core` and `@elevasis/sdk` baselines, then syncs the template dependency pins to derived projects.
|
|
6
|
+
|
|
7
|
+
## Applies to
|
|
8
|
+
|
|
9
|
+
- Template-derived projects consuming `@elevasis/core` or `@elevasis/sdk`.
|
|
10
|
+
- Operators using `elevasis-sdk cli`, `acquisition:list:*`, `acquisition:deal:*`, `client:*`, or generated `/knowledge` routing guidance.
|
|
11
|
+
- Projects that rely on API-key-gated SDK CLI access to platform external routes.
|
|
12
|
+
|
|
13
|
+
## Required actions
|
|
14
|
+
|
|
15
|
+
1. Pull the synced template changes through `/git-sync`.
|
|
16
|
+
2. Accept the package baseline bumps published by this train:
|
|
17
|
+
- `core/package.json`: `@elevasis/core`
|
|
18
|
+
- `operations/package.json`: `@elevasis/core` and `@elevasis/sdk`
|
|
19
|
+
3. Verify local `operations` commands still have the expected platform key environment variables before using SDK CLI API calls.
|
|
20
|
+
4. Review local operator guidance if the project documents SDK CLI command discovery or acquisition/client/deal command usage.
|
|
21
|
+
|
|
22
|
+
## Verification
|
|
23
|
+
|
|
24
|
+
- `pnpm -C operations check`
|
|
25
|
+
- `pnpm -C operations check-types`
|
|
26
|
+
- `pnpm -C operations test`
|
|
27
|
+
- `pnpm -C core test`
|
|
28
|
+
|
|
29
|
+
## Not handled by /git-sync
|
|
30
|
+
|
|
31
|
+
- Platform API route deployment remains an Elevasis monorepo/API deployment concern.
|
|
32
|
+
- Tenant-specific platform keys and API base URLs remain project-owned secrets and environment configuration.
|
|
33
|
+
- Project-authored knowledge nodes and routing guidance remain project-owned content.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Resource Governance Runtime + CRM Detail Pages + Service-Context Rename
|
|
2
|
+
|
|
3
|
+
## Why this note exists
|
|
4
|
+
|
|
5
|
+
The 2026-05-09 release train extends the clients-domain ship with three additional bodies of work that affect template-derived projects:
|
|
6
|
+
|
|
7
|
+
1. **Resource Governance runtime cutover.** The shared resource-governance validator now defaults to **strict** mode. The OM Resources/Systems descriptor catalog is the source of truth for resource identity. Operations bundles must bind workflows, agents, and integrations to descriptors via `defineResource(s)` + descriptor binding helpers; raw `resourceId` literals in `DeploymentSpec` no longer pass strict validation.
|
|
8
|
+
2. **CRM detail-page surface expansion.** `@elevasis/ui` now publishes `ContactDetailPage` (new) and `CompanyDetailPage` (now exported from `sdk-barrel`) under `@elevasis/ui/features/crm`. The lead-gen flow no longer renders detail modals on row click — both pages are reached via TanStack Router routes (`/crm/contacts/$contactId`, `/crm/companies/$companyId`). The legacy `CompanyDetailModal` and `ContactDetailModal` exports were removed from `@elevasis/ui/features/lead-gen/shared`.
|
|
9
|
+
3. **`ElevasisServiceContext` field rename.** `useElevasisServices().organizationId` is renamed to `useElevasisServices().workOSOrganizationId` to make the WorkOS-vs-Supabase distinction loud at call sites. The old `organizationId` field is preserved as a back-compat alias on both `ElevasisServiceContextValue` and `ElevasisServiceProviderProps` for one release cycle, so existing template consumers continue to work without immediate migration.
|
|
10
|
+
|
|
11
|
+
Companion items already covered elsewhere:
|
|
12
|
+
|
|
13
|
+
- Scaffold/agent guidance for descriptor-first authoring → see `2026-05-08-resource-governance-scaffold-guidance.md`.
|
|
14
|
+
- Clients domain (new sidebar pillar, write operations, project/client linkage) → see `2026-05-09-clients-domain.md`.
|
|
15
|
+
|
|
16
|
+
## Applies to
|
|
17
|
+
|
|
18
|
+
Any template-derived project (e.g. `nirvana-marketing`, `ZentaraHQ`) that:
|
|
19
|
+
|
|
20
|
+
- Deploys workflows, agents, or integrations through `operations/src/index.ts` (resource-governance validator).
|
|
21
|
+
- Renders contacts/companies in any feature surface, including custom CRM views (CRM detail pages + modal removal).
|
|
22
|
+
- Uses `useElevasisServices()` from `@elevasis/ui` in custom hooks, components, or test fixtures (service-context rename).
|
|
23
|
+
|
|
24
|
+
## Required actions
|
|
25
|
+
|
|
26
|
+
### 1. Resource Governance — descriptor-backed deployment
|
|
27
|
+
|
|
28
|
+
- Confirm `core/config/organization-model.ts` declares your tenant's resources at `organizationModel.resources.entries` (single-author resource IDs).
|
|
29
|
+
- In `operations/src/index.ts`, bind your workflow/agent/integration definitions to those descriptors via the helpers exported from `@elevasis/sdk` instead of authoring raw `resourceId` strings inline in `DeploymentSpec`.
|
|
30
|
+
- Run `pnpm -C operations check`. The default validator mode is now strict; missing descriptors, raw-ID authoring, runtime/OM type mismatches, and missing Systems will fail the build. Set `ELEVASIS_RESOURCE_VALIDATOR=warn-only` only as a temporary emergency escape hatch — do not let normal CI silently depend on it.
|
|
31
|
+
- New SDK CLI commands are available: `elevasis-sdk agent:list`, `elevasis-sdk agent:get \<id>`, `elevasis-sdk session:list`, `elevasis-sdk session:get \<id>`, `elevasis-sdk session:end \<id>`. Existing `resources` / `describe` / `exec` / `executions` / `execution` are unchanged.
|
|
32
|
+
|
|
33
|
+
### 2. CRM detail pages
|
|
34
|
+
|
|
35
|
+
- If your project imports `CompanyDetailModal` or `ContactDetailModal` from `@elevasis/ui/features/lead-gen/shared`, those exports were removed. Replace modal-on-row-click patterns with `useNavigate` to `/crm/contacts/$contactId` or `/crm/companies/$companyId`.
|
|
36
|
+
- If you need detail-page UI in custom routes, import `ContactDetailPage` and `CompanyDetailPage` from `@elevasis/ui/features/crm`. Both are part of the published `sdk-barrel` and accept `contactId` / `companyId` props.
|
|
37
|
+
- The `extend-lead-gen.md` recipe in `node_modules/@elevasis/sdk/reference/scaffold/recipes/` was updated — it no longer documents the modal helpers.
|
|
38
|
+
|
|
39
|
+
### 3. `workOSOrganizationId` field rename
|
|
40
|
+
|
|
41
|
+
- New idiomatic destructure: `const { apiRequest, workOSOrganizationId, isReady } = useElevasisServices()`.
|
|
42
|
+
- The old `organizationId` field still resolves correctly through the back-compat alias, so existing template code compiles and runs without changes. New code in this project should use `workOSOrganizationId`.
|
|
43
|
+
- If your project uses `<ElevasisServiceProvider organizationId={...}>`, that prop also accepts both names. Provider's resolver is `workOSOrganizationId ?? organizationId ?? null` — passing both names is supported but unnecessary.
|
|
44
|
+
- For test fixtures that mock `useElevasisServices` via `vi.mock`, return `workOSOrganizationId` rather than `organizationId` when authoring NEW mocks; existing mocks will continue to work via the alias but should be migrated opportunistically. The runtime trap is: `vi.mock(...)` is untyped — TypeScript will not catch a mock that returns the deprecated key, but the resolver bypass means downstream `services.workOSOrganizationId` reads `undefined`.
|
|
45
|
+
|
|
46
|
+
## Verification
|
|
47
|
+
|
|
48
|
+
After reconciling local project guidance and writing any descriptor / service-context updates:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pnpm -C operations check
|
|
52
|
+
pnpm -C operations check-types
|
|
53
|
+
pnpm -C ui check-types
|
|
54
|
+
pnpm -C ui test
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
If your project deploys to production and you author runtime resources directly:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pnpm -C operations exec elevasis-sdk deploy
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Expect strict-mode validator output. Investigate any "OM resource missing for code resource" or "raw resourceId authoring detected" errors as descriptor-binding work, not as test bypass.
|
|
64
|
+
|
|
65
|
+
## Not handled by /git-sync
|
|
66
|
+
|
|
67
|
+
- `/git-sync` pulls the new `@elevasis/sdk`, `@elevasis/ui`, and `@elevasis/core` versions and template-owned files, but it does **not** rewrite existing project-owned `operations/src/**` workflow/agent/integration files to use descriptor-backed binding. Maintainers must migrate raw `resourceId` literals to descriptor lookups intentionally.
|
|
68
|
+
- `/git-sync` does **not** rewrite custom UI routes that import `CompanyDetailModal` / `ContactDetailModal` from `@elevasis/ui/features/lead-gen/shared`. Replace those imports with `useNavigate` to detail-page routes manually.
|
|
69
|
+
- `/git-sync` does **not** rename `useElevasisServices().organizationId` reads in project-owned code. The back-compat alias keeps existing code working; proactive renaming is a manual cleanup.
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Pure reference file -- NOT imported anywhere.
|
|
5
5
|
// Copy individual examples into core/config/organization-model.ts or resource definitions as needed.
|
|
6
6
|
|
|
7
|
-
import { defineOrganizationModel } from '@elevasis/core/organization-model'
|
|
7
|
+
import { defineOrganizationModel, defineResources } from '@elevasis/core/organization-model'
|
|
8
8
|
|
|
9
9
|
// ---------------------------------------------------------------------------
|
|
10
10
|
// Branding override
|
|
@@ -166,12 +166,24 @@ export const customersAndOfferingsExample = defineOrganizationModel({
|
|
|
166
166
|
})
|
|
167
167
|
|
|
168
168
|
// ---------------------------------------------------------------------------
|
|
169
|
-
// Resource
|
|
169
|
+
// Resource descriptor example
|
|
170
170
|
// ---------------------------------------------------------------------------
|
|
171
|
-
export const
|
|
172
|
-
|
|
171
|
+
export const workflowResourceDescriptorsExample = defineResources({
|
|
172
|
+
leadEnrichment: {
|
|
173
|
+
id: 'lead-enrichment-workflow',
|
|
174
|
+
kind: 'workflow',
|
|
175
|
+
systemId: 'sys.prospecting',
|
|
176
|
+
ownerRoleId: 'role-ops-lead',
|
|
177
|
+
capabilityKey: 'prospecting.lead-enrichment',
|
|
178
|
+
status: 'active' as const
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
export const workflowResourceRuntimeMetadataExample = {
|
|
183
|
+
resource: workflowResourceDescriptorsExample.leadEnrichment,
|
|
184
|
+
resourceId: workflowResourceDescriptorsExample.leadEnrichment.id,
|
|
173
185
|
name: 'Lead Enrichment',
|
|
174
|
-
type:
|
|
186
|
+
type: workflowResourceDescriptorsExample.leadEnrichment.kind,
|
|
175
187
|
version: '1.0.0',
|
|
176
188
|
status: 'prod' as const,
|
|
177
189
|
links: [
|
|
@@ -70,7 +70,7 @@ See [Memory System](memory.mdx) for architecture, error tracking format, scaling
|
|
|
70
70
|
|
|
71
71
|
### Project Structure
|
|
72
72
|
|
|
73
|
-
The scaffolded project separates concerns clearly: `
|
|
73
|
+
The scaffolded project separates concerns clearly: `operations/` for executable resources, `core/` for shared contracts and Organization Model configuration, `ui/` for the shell, `docs/` for platform documentation, and `.claude/` for agent infrastructure. Understanding which files are gitignored, which are committed, and why matters for collaborating on projects.
|
|
74
74
|
|
|
75
75
|
See [Project Structure](project-structure.mdx) for a file-by-file walkthrough of the scaffolded project.
|
|
76
76
|
|
|
@@ -6,7 +6,7 @@ loadWhen: "Understanding scaffolded files or project layout"
|
|
|
6
6
|
|
|
7
7
|
`elevasis-sdk init` creates a complete workspace structure. This page explains what each file does and when you will interact with it.
|
|
8
8
|
|
|
9
|
-
The current full-stack scaffold uses a workspace layout with `ui/`, `operations/`, `
|
|
9
|
+
The current full-stack scaffold uses a workspace layout with `ui/`, `operations/`, `core/`, and a root `docs/` directory. When older examples refer to `src/shared/`, read that as the current `core/` package for cross-runtime types, schemas, and organization-model configuration.
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
@@ -14,15 +14,17 @@ The current full-stack scaffold uses a workspace layout with `ui/`, `operations/
|
|
|
14
14
|
|
|
15
15
|
### `operations/src/index.ts`
|
|
16
16
|
|
|
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
|
|
17
|
+
The registry entry point for your workspace. This file imports OM resource governance from `core/config/organization-model.ts`, aggregates executable 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 assembly:
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
20
|
import type { DeploymentSpec } from '@elevasis/sdk'
|
|
21
|
+
import { resourceGovernanceModel } from '@core/config/organization-model'
|
|
21
22
|
import * as example from './example/index.js'
|
|
22
23
|
import * as emailNotification from './email-notification/exports.js'
|
|
23
24
|
|
|
24
25
|
const org: DeploymentSpec = {
|
|
25
26
|
version: '0.1.0',
|
|
27
|
+
organizationModel: resourceGovernanceModel,
|
|
26
28
|
workflows: [...example.workflows, ...emailNotification.workflows],
|
|
27
29
|
agents: [...example.agents, ...emailNotification.agents]
|
|
28
30
|
}
|
|
@@ -39,9 +41,9 @@ A multi-step workflow demonstrating real platform API usage. Sends an email noti
|
|
|
39
41
|
|
|
40
42
|
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.
|
|
41
43
|
|
|
42
|
-
### `
|
|
44
|
+
### `core/`
|
|
43
45
|
|
|
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.
|
|
46
|
+
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. Resource descriptors live in `core/config/organization-model.ts`.
|
|
45
47
|
|
|
46
48
|
### `operations/elevasis.config.ts`
|
|
47
49
|
|
|
@@ -104,7 +106,7 @@ The following directories are included in the scaffold:
|
|
|
104
106
|
| ------------------------------------ | --------------- | ------------------------------------------------------------------ |
|
|
105
107
|
| `operations/src/example/` | Scaffold | Always -- echo starter workflow lives here (replace with your own) |
|
|
106
108
|
| `operations/src/email-notification/` | Scaffold | Always -- multi-step notification workflow example |
|
|
107
|
-
| `
|
|
109
|
+
| `core/` | Scaffold | Always -- cross-runtime contracts, schemas, and organization model |
|
|
108
110
|
| `ui/` | Scaffold | Always -- React frontend application |
|
|
109
111
|
| `docs/` | Scaffold | Always |
|
|
110
112
|
| `docs/in-progress/` | Agent | When you create a task doc for in-progress work |
|
|
@@ -117,7 +119,7 @@ This structure keeps the initial workspace minimal and adds directories only whe
|
|
|
117
119
|
|
|
118
120
|
### `operations/src/lib/`
|
|
119
121
|
|
|
120
|
-
Shared code directory for utilities used by multiple workflows within the operations package. In the current workspace scaffold, prefer the top-level `
|
|
122
|
+
Shared code directory for utilities used by multiple workflows within the operations package. In the current workspace scaffold, prefer the top-level `core/` package for cross-runtime contracts. Included in the esbuild bundle alongside workflow code.
|
|
121
123
|
|
|
122
124
|
### `data/`
|
|
123
125
|
|
|
@@ -182,7 +184,7 @@ The most important file for AI-assisted development. It provides Claude Code wit
|
|
|
182
184
|
|
|
183
185
|
- **Project orientation** -- what an Elevasis SDK project is and how it works
|
|
184
186
|
- **Project structure** -- which files contain resources, documentation, and configuration
|
|
185
|
-
- **SDK patterns** -- working code examples for resource definitions, Zod schemas, and the `DeploymentSpec` export
|
|
187
|
+
- **SDK patterns** -- working code examples for descriptor-backed resource definitions, Zod schemas, and the `DeploymentSpec` export
|
|
186
188
|
- **CLI reference** -- all commands with flags (`check`, `deploy`, `exec`, `resources`, `executions`, `execution`, `deployments`, `env list/set/remove`)
|
|
187
189
|
- **Development rules** -- conventions the agent should enforce (source in `src/`, docs in `docs/`, use `@elevasis/sdk` types only)
|
|
188
190
|
|
|
@@ -249,7 +251,7 @@ Not all scaffolded files participate in template updates. Files fall into two ca
|
|
|
249
251
|
|
|
250
252
|
- `package.json`, `pnpm-workspace.yaml`, `tsconfig.json`
|
|
251
253
|
- `.env`, `.npmrc`
|
|
252
|
-
- `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`, `
|
|
254
|
+
- `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`, `core/`
|
|
253
255
|
- `docs/index.md`, `docs/in-progress/.gitkeep`
|
|
254
256
|
|
|
255
257
|
**MANAGED** -- Written during initial scaffold and updated when the template evolves:
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
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
4
|
|
|
5
|
-
External projects extend these in `
|
|
5
|
+
External projects extend these in `core/types/entities.ts` to attach project-specific metadata while keeping the canonical shape stable.
|
|
6
6
|
|
|
7
7
|
## Published Exports
|
|
8
8
|
|
|
@@ -49,4 +49,4 @@ export type Deal = BaseDeal
|
|
|
49
49
|
|
|
50
50
|
The full pattern is documented in the SDK scaffold bundle: `node_modules/@elevasis/sdk/reference/scaffold/recipes/extend-a-base-entity.md`.
|
|
51
51
|
|
|
52
|
-
The canonical template demo lives at `external/_template/
|
|
52
|
+
The canonical template demo lives at `external/_template/core/types/entities.ts`.
|
|
@@ -47,10 +47,13 @@ Top-level fields:
|
|
|
47
47
|
- `offerings`
|
|
48
48
|
- `roles`
|
|
49
49
|
- `goals`
|
|
50
|
+
- `systems`
|
|
51
|
+
- `resources`
|
|
50
52
|
- `statuses`
|
|
51
53
|
- `operations`
|
|
54
|
+
- `knowledge`
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
Resource identity is authored in `resources.entries`. Runtime workflows, agents, and integrations import those descriptors, derive `resourceId` and kind from them, and attach executable behavior in operations code.
|
|
54
57
|
|
|
55
58
|
## Feature Set
|
|
56
59
|
|
|
@@ -77,6 +80,10 @@ Cross-collection links use kind-prefixed IDs:
|
|
|
77
80
|
- `resource:lead-import`
|
|
78
81
|
- `capability:operations.queue.review`
|
|
79
82
|
|
|
83
|
+
## Resource Descriptors
|
|
84
|
+
|
|
85
|
+
The OM Resources domain is governance-only. Descriptors declare canonical `id`, required `systemId`, governance `status`, and optional role ownership. `DeploymentSpec` remains the runtime/deploy assembly around those descriptors, not a second resource identity catalog.
|
|
86
|
+
|
|
80
87
|
## Resolution Semantics
|
|
81
88
|
|
|
82
89
|
- `defineOrganizationModel()` is a typed helper.
|
|
@@ -92,11 +99,11 @@ Cross-collection links use kind-prefixed IDs:
|
|
|
92
99
|
- Child feature IDs require ancestor feature nodes.
|
|
93
100
|
- Container features omit `path`.
|
|
94
101
|
- Leaf features provide `path`.
|
|
95
|
-
-
|
|
102
|
+
- Systems, resources, roles, knowledge nodes, and goals must resolve their declared cross-references.
|
|
96
103
|
|
|
97
104
|
## Practical Guidance
|
|
98
105
|
|
|
99
106
|
- Use `resolveOrganizationModel()` when you need a runtime-safe model.
|
|
100
107
|
- Use `defineOrganizationModel()` when authoring static overrides.
|
|
101
108
|
- Keep feature IDs stable because shell routing, gating, breadcrumbs, and docs depend on them.
|
|
102
|
-
- Put
|
|
109
|
+
- Put resource identity and governance in `resources.entries`; attach executable behavior in operations.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Writing Resources
|
|
3
|
-
description: Guide to creating workflows and agents
|
|
3
|
+
description: Guide to creating descriptor-backed workflows and agents with the Elevasis SDK
|
|
4
4
|
loadWhen: "Building or modifying a workflow"
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
Resources are the building blocks of your Elevasis project.
|
|
7
|
+
Resources are the building blocks of your Elevasis project. Resource identity and governance metadata live in the Organization Model under `organizationModel.resources.entries`; operations code imports those descriptors, attaches executable workflow or agent behavior, and exports a `DeploymentSpec` for deployment.
|
|
8
8
|
|
|
9
|
-
This page covers how to structure
|
|
9
|
+
This page covers how to structure executable resources, derive runtime IDs from OM descriptors, write step handlers, and assemble the deployment spec without creating a second identity catalog.
|
|
10
10
|
|
|
11
11
|
## WorkflowDefinition
|
|
12
12
|
|
|
@@ -24,6 +24,7 @@ A complete workflow definition has four required properties:
|
|
|
24
24
|
```typescript
|
|
25
25
|
import { z } from 'zod';
|
|
26
26
|
import type { WorkflowDefinition } from '@elevasis/sdk';
|
|
27
|
+
import { resourceDescriptors } from '@core/config/organization-model';
|
|
27
28
|
|
|
28
29
|
const echoInput = z.object({
|
|
29
30
|
message: z.string(),
|
|
@@ -37,9 +38,10 @@ type EchoInput = z.infer<typeof echoInput>;
|
|
|
37
38
|
|
|
38
39
|
const echoWorkflow: WorkflowDefinition = {
|
|
39
40
|
config: {
|
|
40
|
-
|
|
41
|
+
resource: resourceDescriptors.echo,
|
|
42
|
+
resourceId: resourceDescriptors.echo.id,
|
|
41
43
|
name: 'Echo',
|
|
42
|
-
type:
|
|
44
|
+
type: resourceDescriptors.echo.kind,
|
|
43
45
|
description: 'Returns the input message unchanged',
|
|
44
46
|
version: '1.0.0',
|
|
45
47
|
status: 'dev',
|
|
@@ -68,16 +70,17 @@ const echoWorkflow: WorkflowDefinition = {
|
|
|
68
70
|
|
|
69
71
|
### config
|
|
70
72
|
|
|
71
|
-
The `config` block
|
|
72
|
-
|
|
73
|
-
| Field | Type | Description
|
|
74
|
-
| ------------- | ----------------- |
|
|
75
|
-
| `
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
73
|
+
The `config` block binds executable behavior to the OM resource descriptor:
|
|
74
|
+
|
|
75
|
+
| Field | Type | Description |
|
|
76
|
+
| ------------- | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
|
|
77
|
+
| `resource` | `ResourceEntry` | OM descriptor from `core/config/organization-model.ts`; owns stable identity, kind, system membership, ownership, and status. |
|
|
78
|
+
| `resourceId` | `string` | Derived from `resource.id`. Used by runtime invocation, CLI targeting, execution logs, and dashboard links. Do not invent it here. |
|
|
79
|
+
| `name` | `string` | Human-readable display name shown in the dashboard. |
|
|
80
|
+
| `type` | `'workflow'` | Derived from `resource.kind` for workflow resources. |
|
|
81
|
+
| `description` | `string` | Summary shown in the dashboard and command center. |
|
|
82
|
+
| `version` | `string` | Semver string (e.g., `'1.0.0'`). Increment when making breaking changes to the contract. |
|
|
83
|
+
| `status` | `'dev' | 'prod'` | Controls runtime availability. Use `'dev'` while building. See [Resource Status](#resource-status). |
|
|
81
84
|
| `domains` | `string[]` | Optional. Groups resources in the command center view. |
|
|
82
85
|
|
|
83
86
|
### contract
|
|
@@ -271,10 +274,14 @@ Agents are autonomous resources that use an LLM and tools to complete a goal. Yo
|
|
|
271
274
|
|
|
272
275
|
```typescript
|
|
273
276
|
import type { AgentDefinition } from '@elevasis/sdk';
|
|
277
|
+
import { resourceDescriptors } from '@core/config/organization-model';
|
|
274
278
|
|
|
275
279
|
const myAgent: AgentDefinition = {
|
|
276
280
|
config: {
|
|
281
|
+
resource: resourceDescriptors.myAgent,
|
|
282
|
+
resourceId: resourceDescriptors.myAgent.id,
|
|
277
283
|
name: 'my-agent',
|
|
284
|
+
type: resourceDescriptors.myAgent.kind,
|
|
278
285
|
description: 'Answers questions using platform tools',
|
|
279
286
|
status: 'dev',
|
|
280
287
|
},
|
|
@@ -291,12 +298,15 @@ const myAgent: AgentDefinition = {
|
|
|
291
298
|
|
|
292
299
|
## DeploymentSpec
|
|
293
300
|
|
|
294
|
-
All resources must be
|
|
301
|
+
All executable resources must be assembled through a `DeploymentSpec` default export from `operations/src/index.ts`. This is the entry point the platform reads when you deploy. Include the Organization Model payload so the validator can compare code-backed resources against OM descriptors.
|
|
295
302
|
|
|
296
303
|
```typescript
|
|
297
304
|
import type { DeploymentSpec } from '@elevasis/sdk';
|
|
305
|
+
import { resourceGovernanceModel } from '@core/config/organization-model';
|
|
298
306
|
|
|
299
307
|
const org: DeploymentSpec = {
|
|
308
|
+
version: '0.1.0',
|
|
309
|
+
organizationModel: resourceGovernanceModel,
|
|
300
310
|
workflows: [echoWorkflow, pipeline],
|
|
301
311
|
agents: [
|
|
302
312
|
// myAgent,
|
|
@@ -306,7 +316,7 @@ const org: DeploymentSpec = {
|
|
|
306
316
|
export default org;
|
|
307
317
|
```
|
|
308
318
|
|
|
309
|
-
Each resource's `config.resourceId` is
|
|
319
|
+
Each resource's `config.resourceId` is still the deployed runtime identifier. The important authoring rule is that `config.resourceId` derives from the OM descriptor (`resource.id`) instead of being duplicated by hand.
|
|
310
320
|
|
|
311
321
|
### Resource Status
|
|
312
322
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Organization Model
|
|
3
|
-
description: Organization OS Model layer documentation for the flat feature hierarchy, semantic domains, resource
|
|
3
|
+
description: Organization OS Model layer documentation for the flat feature hierarchy, semantic domains, resource descriptors, and curated @elevasis/core public API.
|
|
4
4
|
---
|
|
5
5
|
<!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
|
|
6
6
|
<!-- Regenerate: pnpm scaffold:sync -->
|
|
@@ -38,10 +38,13 @@ Top-level fields on `OrganizationModel`:
|
|
|
38
38
|
- `offerings`
|
|
39
39
|
- `roles`
|
|
40
40
|
- `goals`
|
|
41
|
+
- `systems`
|
|
42
|
+
- `resources`
|
|
41
43
|
- `statuses`
|
|
42
44
|
- `operations`
|
|
45
|
+
- `knowledge`
|
|
43
46
|
|
|
44
|
-
|
|
47
|
+
Resource identity is authored inside `OrganizationModel.resources.entries`. Runtime workflows, agents, and integrations import those descriptors, derive `resourceId` and kind from them, and attach executable behavior in operations code.
|
|
45
48
|
|
|
46
49
|
## Feature Shape
|
|
47
50
|
|
|
@@ -74,7 +77,7 @@ Development-only features remain defined and enabled with `devOnly: true`; shell
|
|
|
74
77
|
|
|
75
78
|
Navigation surfaces may also carry `devOnly` for compatibility with the legacy/domain navigation model. `knowledge.command-view` is intentionally development-only while its graph visualization modes continue to mature.
|
|
76
79
|
|
|
77
|
-
## Graph IDs and Resource
|
|
80
|
+
## Graph IDs and Resource Descriptors
|
|
78
81
|
|
|
79
82
|
Cross-collection links use kind-prefixed graph IDs:
|
|
80
83
|
|
|
@@ -83,18 +86,30 @@ Cross-collection links use kind-prefixed graph IDs:
|
|
|
83
86
|
- `resource:lead-import`
|
|
84
87
|
- `capability:operations.queue.review`
|
|
85
88
|
|
|
86
|
-
|
|
89
|
+
Resource identity is authored in the OM Resources domain. Operations imports descriptors from `organizationModel.resources.entries` and derives runtime `resourceId` / `type` while attaching executable behavior.
|
|
87
90
|
|
|
88
91
|
```ts
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
92
|
+
import { defineResources } from '@elevasis/core/organization-model'
|
|
93
|
+
|
|
94
|
+
export const resourceDescriptors = defineResources({
|
|
95
|
+
leadImport: {
|
|
96
|
+
id: 'lead-import',
|
|
97
|
+
kind: 'workflow',
|
|
98
|
+
systemId: 'sys.prospecting',
|
|
99
|
+
ownerRoleId: 'role-ops-lead',
|
|
100
|
+
status: 'active',
|
|
101
|
+
capabilityKey: 'prospecting.lead-import'
|
|
102
|
+
}
|
|
103
|
+
})
|
|
104
|
+
|
|
105
|
+
export const resourceGovernanceModel = {
|
|
106
|
+
systems: {
|
|
107
|
+
systems
|
|
108
|
+
},
|
|
109
|
+
resources: {
|
|
110
|
+
entries: Object.values(resourceDescriptors)
|
|
111
|
+
}
|
|
112
|
+
} as const
|
|
98
113
|
```
|
|
99
114
|
|
|
100
115
|
## Domain Semantics
|
|
@@ -105,7 +120,10 @@ The model keeps business semantics in named domains:
|
|
|
105
120
|
- `prospecting` -- company/contact lifecycle stages
|
|
106
121
|
- `projects` -- project, milestone, and task statuses
|
|
107
122
|
- `identity`, `customers`, `offerings`, `roles`, `goals` -- organizational reality
|
|
123
|
+
- `systems` -- bounded contexts that group governed operational resources
|
|
124
|
+
- `resources` -- governance-only workflow, agent, and integration descriptors
|
|
108
125
|
- `statuses` and `operations` -- runtime/vibe-layer semantic registries
|
|
126
|
+
- `knowledge` -- playbooks, strategies, references, and graph-governing links
|
|
109
127
|
|
|
110
128
|
## Authoring and Resolution
|
|
111
129
|
|
|
@@ -124,8 +142,9 @@ The model keeps business semantics in named domains:
|
|
|
124
142
|
- container/leaf path rules
|
|
125
143
|
- valid sidebar positions
|
|
126
144
|
- reality-domain cross references such as offering target segments and role reporting lines
|
|
145
|
+
- system, resource, role, knowledge, and goal cross references used by resource governance
|
|
127
146
|
|
|
128
|
-
|
|
147
|
+
`DeploymentSpec` remains the runtime/deploy assembly around these descriptors. It is not the source of resource identity.
|
|
129
148
|
|
|
130
149
|
## Provider Integration
|
|
131
150
|
|
|
@@ -16,21 +16,24 @@ description: Anatomy of a workflow, adapter usage, and trigger patterns -- runna
|
|
|
16
16
|
|
|
17
17
|
Every workflow is a `WorkflowDefinition` object with four top-level keys: `config`, `contract`, `steps`, and `entryPoint`. The `email-notification` workflow at `operations/src/email-notification/index.ts` is used as the running example throughout this section.
|
|
18
18
|
|
|
19
|
-
### Config
|
|
20
|
-
|
|
21
|
-
```typescript
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
19
|
+
### Config
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { resourceDescriptors } from '@core/config/organization-model'
|
|
23
|
+
|
|
24
|
+
config: {
|
|
25
|
+
resource: resourceDescriptors.emailNotification,
|
|
26
|
+
resourceId: resourceDescriptors.emailNotification.id,
|
|
27
|
+
name: 'Email Notification',
|
|
28
|
+
type: resourceDescriptors.emailNotification.kind,
|
|
29
|
+
description: 'Sends a notification email to a user...',
|
|
30
|
+
version: '1.0.0',
|
|
31
|
+
status: 'dev'
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
- The OM Resources descriptor owns the stable ID and kind. Runtime execution still uses that deployed `resourceId`, but workflow authoring should derive it from the descriptor.
|
|
36
|
+
- Bump `version` whenever you change `contract.inputSchema` or `contract.outputSchema`.
|
|
34
37
|
|
|
35
38
|
### Contract
|
|
36
39
|
|
|
@@ -389,7 +392,7 @@ pnpm exec elevasis --prod exec Elevasis/email-notification --input '{...}'
|
|
|
389
392
|
|
|
390
393
|
## 4. Registry Pattern
|
|
391
394
|
|
|
392
|
-
Workflows are discovered through `operations/src/index.ts`, which exports a `DeploymentSpec` as its default export.
|
|
395
|
+
Workflows are discovered through `operations/src/index.ts`, which exports a `DeploymentSpec` as its default export. The spec assembles deployable runtime resources; it is not a second resource identity catalog.
|
|
393
396
|
|
|
394
397
|
**Pattern:** each feature group in `operations/src/` has its own exports barrel. The top-level spec spreads all groups:
|
|
395
398
|
|
|
@@ -407,15 +410,17 @@ operations/src/
|
|
|
407
410
|
Top-level registry (`operations/src/index.ts`):
|
|
408
411
|
|
|
409
412
|
```typescript
|
|
410
|
-
import type { DeploymentSpec } from '@elevasis/sdk'
|
|
411
|
-
import
|
|
412
|
-
import * as
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
413
|
+
import type { DeploymentSpec } from '@elevasis/sdk'
|
|
414
|
+
import { resourceGovernanceModel } from '@core/config/organization-model'
|
|
415
|
+
import * as example from './example/index.js'
|
|
416
|
+
import * as emailNotification from './email-notification/exports.js'
|
|
417
|
+
|
|
418
|
+
const org: DeploymentSpec = {
|
|
419
|
+
version: '0.1.0',
|
|
420
|
+
organizationModel: resourceGovernanceModel,
|
|
421
|
+
workflows: [...example.workflows, ...emailNotification.workflows],
|
|
422
|
+
agents: [...example.agents, ...emailNotification.agents]
|
|
423
|
+
}
|
|
419
424
|
export default org
|
|
420
425
|
```
|
|
421
426
|
|
|
@@ -431,10 +436,11 @@ export const agents: never[] = []
|
|
|
431
436
|
|
|
432
437
|
**Adding a new workflow:**
|
|
433
438
|
|
|
434
|
-
1.
|
|
435
|
-
2. Create `operations/src/<feature>/
|
|
436
|
-
3.
|
|
437
|
-
4.
|
|
439
|
+
1. Add the resource descriptor to `core/config/organization-model.ts`.
|
|
440
|
+
2. Create `operations/src/<feature>/index.ts` with the `WorkflowDefinition`, deriving `config.resourceId` and `config.type` from the descriptor.
|
|
441
|
+
3. Create `operations/src/<feature>/exports.ts` with `workflows` and `agents` arrays.
|
|
442
|
+
4. Import the group barrel in `operations/src/index.ts` and spread into `workflows`/`agents`.
|
|
443
|
+
5. Run `pnpm -C operations check` to validate descriptor/code alignment, then `pnpm -C operations deploy` to publish.
|
|
438
444
|
|
|
439
445
|
**Note:** Use `.js` extensions in imports even though the source is TypeScript. The TypeScript compiler and esbuild bundler both require this for ESM interoperability.
|
|
440
446
|
|