@elevasis/sdk 1.22.0 → 1.22.1
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 +300 -14
- package/dist/index.d.ts +1217 -220
- package/dist/index.js +386 -12
- package/dist/test-utils/index.d.ts +963 -211
- package/dist/test-utils/index.js +253 -11
- package/dist/worker/index.js +118 -11
- package/package.json +3 -3
- package/reference/claude-config/rules/operations.md +3 -3
- package/reference/claude-config/rules/organization-model.md +11 -5
- package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +7 -4
- package/reference/examples/organization-model.ts +26 -2
- package/reference/scaffold/core/organization-model.mdx +16 -11
- package/reference/scaffold/recipes/add-a-feature.md +28 -26
- package/reference/scaffold/recipes/add-a-resource.md +26 -16
- package/reference/scaffold/recipes/customize-organization-model.md +5 -3
- package/reference/scaffold/recipes/extend-lead-gen.md +9 -9
- package/reference/scaffold/recipes/index.md +1 -1
- package/reference/scaffold/reference/contracts.md +45 -7
- package/reference/scaffold/reference/glossary.md +3 -3
|
@@ -32,11 +32,11 @@ The workflow is registered in `operations/src/index.ts` as part of the `example`
|
|
|
32
32
|
|
|
33
33
|
1. **Define the descriptor in `core/config/organization-model.ts`** -- Add the OM Resource descriptor under the id-keyed `resources` map so identity, System membership, owner role, and governance status are authored once.
|
|
34
34
|
|
|
35
|
-
2. **Model the semantic surface** -- Add durable business nouns, verbs, catalogs, links, events, and surfaces to the owning System's `ontology`; add system-local defaults/settings to `System.config`; add explanatory or governing material to `knowledge`; and keep transient DTOs and handler internals out of the OM. Top-level `entities`, top-level `actions`, and `System.content` are compatibility mirrors only when current published consumers still need them.
|
|
35
|
+
2. **Model the semantic surface** -- Add durable business nouns, verbs, catalogs, links, events, and surfaces to the owning System's `ontology`; bind executable Resources through `resource.ontology.actions` and optional `resource.ontology.primaryAction`; add system-local defaults/settings to `System.config`; add explanatory or governing material to `knowledge`; and keep transient DTOs and handler internals out of the OM. Top-level `entities`, top-level `actions`, and `System.content` are compatibility mirrors only when current published consumers still need them.
|
|
36
36
|
|
|
37
37
|
3. **Define the contract in `core/types/`** -- Add Zod schemas and inferred types to `core/types/index.ts` (or a new file under `core/types/`). Use `core/types/entities.ts` when workflows operate on project-specific entity contracts.
|
|
38
38
|
|
|
39
|
-
4. **Implement the workflow in `operations/src/`** -- Create a new directory under `operations/src/` for the feature. Import the descriptor, derive runtime `resourceId`
|
|
39
|
+
4. **Implement the workflow in `operations/src/`** -- Create a new directory under `operations/src/` for the feature. Import the descriptor, derive runtime `resourceId`, `type`, `name`, and `description` from it, export the workflow from its `index.ts`, and register it in `operations/src/index.ts`.
|
|
40
40
|
|
|
41
41
|
5. **Add the UI in `ui/src/routes/`** -- Create a new route file. Use TanStack Query to call the workflow execution endpoint. Import schemas from `@core/types` for validation and type inference. Read OM resources, ontology, knowledge, and graph data where possible instead of creating page-local semantic registries.
|
|
42
42
|
|
|
@@ -51,7 +51,7 @@ pnpm -C operations deploy # deploy to dev
|
|
|
51
51
|
|
|
52
52
|
## Resource Registry
|
|
53
53
|
|
|
54
|
-
`operations/src/index.ts` default-exports a `DeploymentSpec` with `version`, `organizationModel`, `workflows`, `agents`, and optional
|
|
54
|
+
`operations/src/index.ts` default-exports a `DeploymentSpec` with `version`, `organizationModel`, `workflows`, `agents`, and optional deployment mechanics such as `triggers`, `integrations`, `relationships`, `humanCheckpoints`, and `externalResources`. Durable operational wiring belongs in `organizationModel.topology.relationships`; deployment mechanics, credentials, provider webhook details, and per-run state stay outside the OM. Each feature group exports `workflows` and `agents` arrays from its own `index.ts`, spread into the top-level spec. `DeploymentSpec` assembles deployable behavior; it should not be treated as a second resource identity catalog.
|
|
55
55
|
|
|
56
56
|
When you need breadth first, read:
|
|
57
57
|
|
|
@@ -36,11 +36,13 @@ Author system-local semantics by boundary:
|
|
|
36
36
|
- `System.ontology` owns durable object types, action types, catalog types, link types, event types, and surfaces.
|
|
37
37
|
- `System.config` owns system-local JSON settings and defaults.
|
|
38
38
|
- `resources` own executable workflow/agent descriptors, `systemPath`, owners, governance status, code references, and runtime implementation links.
|
|
39
|
-
- `resource.ontology` describes
|
|
39
|
+
- `resource.ontology.actions` describes the ontology actions a Resource performs; `resource.ontology.primaryAction` names the default/selectable action when a Resource has one.
|
|
40
|
+
- `resource.ontology` also describes reads, writes, catalog use, and emitted events.
|
|
41
|
+
- `topology.relationships` owns durable operational wiring between Systems, Resources, ontology nodes, policies, roles, triggers, checkpoints, and external resources.
|
|
40
42
|
- `knowledge` owns long-form playbooks, strategies, references, and governance context.
|
|
41
43
|
- `System.content`, top-level `entities`, and top-level `actions` are compatibility mirrors only. Keep them aligned when current published consumers still need them, but do not treat them as the primary authoring surface.
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
Do not author Resource `actionKey` in the target contract. Runtime/UI routing that needs a single selectable action should read `resource.ontology.primaryAction`.
|
|
44
46
|
|
|
45
47
|
## Runtime Validation
|
|
46
48
|
|
|
@@ -79,9 +81,9 @@ schema validation. Use `getResourcesForSystem(model, path)` (from `@elevasis/cor
|
|
|
79
81
|
query resources for a system at runtime. Pass `{ includeDescendants: true }` to include
|
|
80
82
|
all descendant systems (segment-aware -- `'sales'` does NOT match `'salesforce.foo'`).
|
|
81
83
|
|
|
82
|
-
Some external templates may carry a `systemId` compatibility mirror while published
|
|
83
|
-
`@elevasis/core` releases catch up to the current source contract. Treat that field as
|
|
84
|
-
legacy adapter data only; author new resource relationships against `systemPath`.
|
|
84
|
+
Some external templates may carry a `systemId` compatibility mirror while published
|
|
85
|
+
`@elevasis/core` releases catch up to the current source contract. Treat that field as
|
|
86
|
+
legacy adapter data only; author new resource relationships against `systemPath`.
|
|
85
87
|
|
|
86
88
|
Do not fetch resources for every system-oriented read by default. For agent workflows, start
|
|
87
89
|
with the user's requested OM/knowledge context and query resources only when the task involves
|
|
@@ -103,6 +105,10 @@ entrypoint, handler, schema, test, docs, or config files that implement it. They
|
|
|
103
105
|
not define resource identity, System membership, runtime execution topology, or graph
|
|
104
106
|
relationships.
|
|
105
107
|
|
|
108
|
+
`topology.relationships` defines durable operational wiring in the OM. Keep credential
|
|
109
|
+
values, provider webhook mechanics, deployment environment settings, execution logs,
|
|
110
|
+
and per-run scheduler state outside the OM.
|
|
111
|
+
|
|
106
112
|
`System.ontology` owns durable semantic contracts: object types, action types, catalog
|
|
107
113
|
types, link types, event types, and surfaces. `System.config` owns local settings and
|
|
108
114
|
defaults. If current UI or runtime code still needs legacy mirrors, keep `entities`,
|
package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Why this note exists
|
|
4
4
|
|
|
5
|
-
The template now demonstrates the Organization Model ontology bridge. New semantic contracts should be authored in `System.ontology
|
|
5
|
+
The template now demonstrates the Organization Model ontology and topology bridge. New semantic contracts should be authored in `System.ontology`; executable Resources bind through `resource.ontology.actions` and optional `resource.ontology.primaryAction`; durable operational wiring belongs in `organizationModel.topology.relationships`. Legacy `entities`, `actions`, and `System.content` remain compatibility mirrors for current consumers.
|
|
6
6
|
|
|
7
7
|
## Applies to
|
|
8
8
|
|
|
@@ -14,13 +14,15 @@ The template now demonstrates the Organization Model ontology bridge. New semant
|
|
|
14
14
|
- `operations/src/resource-registry.test.ts`
|
|
15
15
|
- `operations/src/README.md`
|
|
16
16
|
- `.claude/rules/organization-model.md`
|
|
17
|
+
- `.claude/rules/operations.md`
|
|
17
18
|
|
|
18
19
|
## Required actions
|
|
19
20
|
|
|
20
21
|
1. Preserve system-colocated ontology scopes when syncing template organization-model changes.
|
|
21
|
-
2.
|
|
22
|
-
3.
|
|
23
|
-
4.
|
|
22
|
+
2. Migrate Resource descriptors from `ontology.implements` / `actionKey` to `ontology.actions` / `ontology.primaryAction`; keep `codeRefs` with the Resource descriptor.
|
|
23
|
+
3. Preserve `organizationModel.topology.relationships` when syncing template organization-model changes; keep secrets, credential values, provider webhook mechanics, and per-run state outside the OM.
|
|
24
|
+
4. Keep `entities`, `actions`, and `System.content` aligned as compatibility mirrors until downstream consumers move fully to compiled ontology indexes.
|
|
25
|
+
5. Do not overwrite project-owned `core/config/extensions/**` files.
|
|
24
26
|
|
|
25
27
|
## Verification
|
|
26
28
|
|
|
@@ -38,5 +40,6 @@ pnpm sync:verify --pre
|
|
|
38
40
|
## Not handled by /git-sync
|
|
39
41
|
|
|
40
42
|
- Choosing project-specific ontology IDs for tenant-owned systems.
|
|
43
|
+
- Choosing project-specific topology relationships for tenant-owned workflows, checkpoints, integrations, or schedules.
|
|
41
44
|
- Migrating project-owned extension files under `core/config/extensions/**`.
|
|
42
45
|
- Retiring compatibility mirrors before the full internal, SDK, scaffold, and external template-family green cycle.
|
|
@@ -217,13 +217,15 @@ export const customersAndOfferingsExample = defineOrganizationModel({
|
|
|
217
217
|
export const workflowResourceDescriptorsExample = defineResources({
|
|
218
218
|
leadEnrichment: {
|
|
219
219
|
id: 'lead-enrichment-workflow',
|
|
220
|
+
title: 'Lead Enrichment',
|
|
221
|
+
description: 'Enriches lead records and writes qualified opportunities into CRM.',
|
|
220
222
|
kind: 'workflow',
|
|
221
223
|
systemPath: 'sales.lead-gen',
|
|
222
224
|
ownerRoleId: 'role-ops-lead',
|
|
223
|
-
actionKey: 'prospecting.lead-enrichment',
|
|
224
225
|
status: 'active' as const,
|
|
225
226
|
ontology: {
|
|
226
|
-
|
|
227
|
+
actions: ['sales.lead-gen:action/lead.enrich'],
|
|
228
|
+
primaryAction: 'sales.lead-gen:action/lead.enrich',
|
|
227
229
|
reads: ['sales.lead-gen:object/lead'],
|
|
228
230
|
writes: ['sales.crm:object/deal'],
|
|
229
231
|
usesCatalogs: ['sales.crm:catalog/pipeline'],
|
|
@@ -256,6 +258,28 @@ export const compatibilityGraphLinksExample = {
|
|
|
256
258
|
]
|
|
257
259
|
}
|
|
258
260
|
|
|
261
|
+
export const topologyRelationshipsExample = defineOrganizationModel({
|
|
262
|
+
topology: {
|
|
263
|
+
relationships: [
|
|
264
|
+
{
|
|
265
|
+
source: { kind: 'trigger', id: 'daily-lead-enrichment' },
|
|
266
|
+
target: { kind: 'resource', id: workflowResourceDescriptorsExample.leadEnrichment.id },
|
|
267
|
+
kind: 'triggers'
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
source: { kind: 'resource', id: workflowResourceDescriptorsExample.leadEnrichment.id },
|
|
271
|
+
target: { kind: 'externalResource', id: 'apollo' },
|
|
272
|
+
kind: 'uses'
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
source: { kind: 'resource', id: workflowResourceDescriptorsExample.leadEnrichment.id },
|
|
276
|
+
target: { kind: 'role', id: 'role-ops-lead' },
|
|
277
|
+
kind: 'approval'
|
|
278
|
+
}
|
|
279
|
+
]
|
|
280
|
+
}
|
|
281
|
+
})
|
|
282
|
+
|
|
259
283
|
// ---------------------------------------------------------------------------
|
|
260
284
|
// Roles and goals
|
|
261
285
|
// ---------------------------------------------------------------------------
|
|
@@ -138,17 +138,22 @@ Resource identity is authored in the OM Resources domain. Operations imports des
|
|
|
138
138
|
```ts
|
|
139
139
|
import { defineResources } from '@elevasis/core/organization-model'
|
|
140
140
|
|
|
141
|
-
export const resourceDescriptors = defineResources({
|
|
142
|
-
leadImport: {
|
|
143
|
-
id: 'lgn-01c-apollo-import-workflow',
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
141
|
+
export const resourceDescriptors = defineResources({
|
|
142
|
+
leadImport: {
|
|
143
|
+
id: 'lgn-01c-apollo-import-workflow',
|
|
144
|
+
title: 'Apollo Import',
|
|
145
|
+
description: 'Imports Apollo company records into the lead generation pipeline.',
|
|
146
|
+
kind: 'workflow',
|
|
147
|
+
systemPath: 'sales.lead-gen',
|
|
148
|
+
ownerRoleId: 'role-ops-lead',
|
|
149
|
+
status: 'active',
|
|
150
|
+
ontology: {
|
|
151
|
+
actions: ['sales.lead-gen:action/company.apollo-import'],
|
|
152
|
+
primaryAction: 'sales.lead-gen:action/company.apollo-import'
|
|
153
|
+
},
|
|
154
|
+
codeRefs: [
|
|
155
|
+
{
|
|
156
|
+
path: 'packages/elevasis-operations/src/sales/prospecting/scrape/apollo-import.ts',
|
|
152
157
|
role: 'entrypoint',
|
|
153
158
|
symbol: 'lgnApolloImportWorkflow'
|
|
154
159
|
}
|
|
@@ -176,15 +176,16 @@ Resources are governed descriptors for executable workflows, agents, integration
|
|
|
176
176
|
import { defineResources } from '@elevasis/core/organization-model'
|
|
177
177
|
|
|
178
178
|
export const resourceDescriptors = defineResources({
|
|
179
|
-
approveReviewItem: {
|
|
180
|
-
id: 'approve-review-item-workflow',
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
179
|
+
approveReviewItem: {
|
|
180
|
+
id: 'approve-review-item-workflow',
|
|
181
|
+
title: 'Approve review item',
|
|
182
|
+
description: 'Routes a review item through the operations approval workflow.',
|
|
183
|
+
order: 10,
|
|
184
|
+
kind: 'workflow',
|
|
185
|
+
systemPath: 'operations.review',
|
|
186
|
+
ownerRoleId: 'role-ops-lead',
|
|
187
|
+
status: 'active',
|
|
188
|
+
codeRefs: [
|
|
188
189
|
{
|
|
189
190
|
path: 'operations/src/review/approve-review-item/index.ts',
|
|
190
191
|
role: 'entrypoint',
|
|
@@ -194,9 +195,10 @@ export const resourceDescriptors = defineResources({
|
|
|
194
195
|
path: 'operations/src/review/approve-review-item/approve-review-item.test.ts',
|
|
195
196
|
role: 'test'
|
|
196
197
|
}
|
|
197
|
-
],
|
|
198
|
+
],
|
|
198
199
|
ontology: {
|
|
199
|
-
|
|
200
|
+
actions: ['operations.review:action/review-item.approve'],
|
|
201
|
+
primaryAction: 'operations.review:action/review-item.approve',
|
|
200
202
|
reads: ['operations.review:object/review-item'],
|
|
201
203
|
writes: ['operations.review:object/review-item'],
|
|
202
204
|
emits: ['operations.review:event/review-item.approved']
|
|
@@ -205,15 +207,15 @@ export const resourceDescriptors = defineResources({
|
|
|
205
207
|
})
|
|
206
208
|
```
|
|
207
209
|
|
|
208
|
-
Use `
|
|
210
|
+
Use descriptor `title` and `description` for executable display metadata.
|
|
209
211
|
|
|
210
|
-
Use nested `resource.ontology` bindings for the semantic actions, objects, catalogs, and events a Resource
|
|
212
|
+
Use nested `resource.ontology` bindings for the semantic actions, objects, catalogs, and events a Resource performs, reads, writes, uses, or emits. `resource.ontology.primaryAction` is the default/selectable ontology action and must be included in `resource.ontology.actions`. Top-level resource `emits` remains readable for bridge-era descriptors, but new descriptors should keep event bindings in `resource.ontology.emits`.
|
|
211
213
|
|
|
212
214
|
Use `codeRefs` as repo-relative breadcrumbs for agents and operators. They point from the governed Resource descriptor to implementation files; they do not define resource identity, System membership, runtime topology, or graph links.
|
|
213
215
|
|
|
214
216
|
## 6. Bind Runtime to the Descriptor
|
|
215
217
|
|
|
216
|
-
Workflow and agent code owns schemas, handlers, steps, and runtime behavior. It should import the descriptor and derive `resourceId`, `type`, and
|
|
218
|
+
Workflow and agent code owns schemas, handlers, steps, and runtime behavior. It should import the descriptor and derive `resourceId`, `type`, and display metadata from it.
|
|
217
219
|
|
|
218
220
|
```ts
|
|
219
221
|
import type { WorkflowDefinition } from '@elevasis/sdk'
|
|
@@ -221,15 +223,15 @@ import { resourceDescriptors } from '@core/config/organization-model'
|
|
|
221
223
|
|
|
222
224
|
export const approveReviewItemWorkflow: WorkflowDefinition = {
|
|
223
225
|
config: {
|
|
224
|
-
resource: resourceDescriptors.approveReviewItem,
|
|
225
|
-
resourceId: resourceDescriptors.approveReviewItem.id,
|
|
226
|
-
name:
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
},
|
|
226
|
+
resource: resourceDescriptors.approveReviewItem,
|
|
227
|
+
resourceId: resourceDescriptors.approveReviewItem.id,
|
|
228
|
+
name: resourceDescriptors.approveReviewItem.title,
|
|
229
|
+
description: resourceDescriptors.approveReviewItem.description,
|
|
230
|
+
type: resourceDescriptors.approveReviewItem.kind,
|
|
231
|
+
version: '1.0.0',
|
|
232
|
+
status: 'dev',
|
|
233
|
+
category: 'production'
|
|
234
|
+
},
|
|
233
235
|
contract: {
|
|
234
236
|
inputSchema,
|
|
235
237
|
outputSchema
|
|
@@ -255,7 +257,7 @@ export const org = {
|
|
|
255
257
|
}
|
|
256
258
|
```
|
|
257
259
|
|
|
258
|
-
Use `relationships` for execution topology.
|
|
260
|
+
Use `organizationModel.topology.relationships` for durable execution topology. The initial topology relationship kinds are `triggers`, `uses`, and `approval`; use `systemPath` and `resource.ontology` for semantic binding. Existing compatibility graph links can stay readable while old consumers migrate.
|
|
259
261
|
|
|
260
262
|
## 7. Add UI Wiring
|
|
261
263
|
|
|
@@ -304,7 +306,7 @@ function ReviewLayout() {
|
|
|
304
306
|
Add tests for the boundaries you changed:
|
|
305
307
|
|
|
306
308
|
- OM config tests for systems, ontology object/action/catalog records, resources, and any compatibility `System.content`.
|
|
307
|
-
- Runtime registry tests that deployed workflows import descriptors and keep `resourceId`, `type`, and `
|
|
309
|
+
- Runtime registry tests that deployed workflows import descriptors and keep `resourceId`, `type`, title, description, and `resource.ontology.primaryAction` aligned.
|
|
308
310
|
- UI tests or type checks for route, manifest, and guard wiring.
|
|
309
311
|
- Graph or knowledge tests when new ontology records, resources, compatibility content nodes, or emitted events should appear in Command View.
|
|
310
312
|
- Scaffold sync when new docs or generated scaffold references are affected.
|
|
@@ -327,7 +329,7 @@ pnpm verify:scaffold-reference
|
|
|
327
329
|
- Ontology catalog types contain local vocabularies such as pipelines, stages, templates, and status flows.
|
|
328
330
|
- Compatibility `System.content` is used only for existing bridge-era local catalogs or schemas.
|
|
329
331
|
- Each executable workflow or agent has an OM Resource descriptor with `systemPath`.
|
|
330
|
-
-
|
|
332
|
+
- Executable Resources use descriptor `title` / `description`, `resource.ontology.actions`, and `resource.ontology.primaryAction`.
|
|
331
333
|
- `codeRefs` point to useful entrypoints, handlers, schemas, tests, docs, or config.
|
|
332
334
|
- Runtime assembly imports descriptors and derives identity from them.
|
|
333
335
|
- UI routes, manifests, and guards use the same System ID.
|
|
@@ -20,16 +20,18 @@ Add the descriptor in `core/config/organization-model.ts`:
|
|
|
20
20
|
import { defineResources } from '@elevasis/core/organization-model'
|
|
21
21
|
|
|
22
22
|
export const resourceDescriptors = defineResources({
|
|
23
|
-
myWorkflow: {
|
|
23
|
+
myWorkflow: {
|
|
24
24
|
id: 'my-workflow',
|
|
25
|
+
title: 'My Workflow',
|
|
26
|
+
description: 'Runs the governed work item workflow.',
|
|
25
27
|
order: 10,
|
|
26
28
|
kind: 'workflow',
|
|
27
29
|
systemPath: 'operations',
|
|
28
30
|
ownerRoleId: 'role-ops-lead',
|
|
29
31
|
status: 'active',
|
|
30
|
-
actionKey: 'operations.my-workflow',
|
|
31
32
|
ontology: {
|
|
32
|
-
|
|
33
|
+
actions: ['operations:action/my-workflow.run'],
|
|
34
|
+
primaryAction: 'operations:action/my-workflow.run',
|
|
33
35
|
reads: ['operations:object/work-item'],
|
|
34
36
|
writes: ['operations:object/work-item'],
|
|
35
37
|
usesCatalogs: ['operations:catalog/workflow-status'],
|
|
@@ -63,7 +65,7 @@ Use `organizationModel.resources` as the Resources descriptor catalog. Graph ref
|
|
|
63
65
|
|
|
64
66
|
Use `codeRefs` as repo-relative implementation breadcrumbs for agents and operators. They do not define resource identity, System membership, runtime topology, or graph links; they point from the governed Resource descriptor to the files that implement, validate, or document it.
|
|
65
67
|
|
|
66
|
-
Use `
|
|
68
|
+
Use descriptor `title` and `description` for executable display metadata. Use nested `resource.ontology` bindings to declare which ontology actions, objects, catalogs, and events the resource performs, reads, writes, uses, or emits. `resource.ontology.primaryAction` is the default/selectable ontology action and must be included in `resource.ontology.actions`. Optional top-level resource `emits` remains readable for bridge-era event descriptors, but new descriptors should keep event bindings in `resource.ontology.emits`.
|
|
67
69
|
|
|
68
70
|
## 2. Author executable behavior
|
|
69
71
|
|
|
@@ -124,18 +126,26 @@ Use `.js` extensions in TypeScript source imports for ESM compatibility.
|
|
|
124
126
|
|
|
125
127
|
## 4. Declare runtime relationships
|
|
126
128
|
|
|
127
|
-
Use `
|
|
128
|
-
|
|
129
|
-
```ts
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
129
|
+
Use `organizationModel.topology.relationships` for durable execution topology:
|
|
130
|
+
|
|
131
|
+
```ts
|
|
132
|
+
topology: {
|
|
133
|
+
relationships: [
|
|
134
|
+
{
|
|
135
|
+
source: { kind: 'trigger', id: 'daily-work-item-import' },
|
|
136
|
+
target: { kind: 'resource', id: 'my-workflow' },
|
|
137
|
+
kind: 'triggers'
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
source: { kind: 'resource', id: 'my-workflow' },
|
|
141
|
+
target: { kind: 'externalResource', id: 'hubspot' },
|
|
142
|
+
kind: 'uses'
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Use relationship kinds `triggers`, `uses`, and `approval` for the initial topology vocabulary. For semantic graph binding, prefer OM ontology IDs in `resource.ontology`; keep `config.links` only when maintaining older descriptors that still need the legacy graph bridge.
|
|
139
149
|
|
|
140
150
|
## 5. Verify
|
|
141
151
|
|
|
@@ -206,14 +206,16 @@ import { defineResources } from '@elevasis/core/organization-model'
|
|
|
206
206
|
export const resourceDescriptors = defineResources({
|
|
207
207
|
leadImport: {
|
|
208
208
|
id: 'lead-import',
|
|
209
|
+
title: 'Lead Import',
|
|
210
|
+
description: 'Updates CRM deal stage data from imported lead records.',
|
|
209
211
|
order: 10,
|
|
210
212
|
kind: 'workflow',
|
|
211
213
|
systemPath: 'sales.crm',
|
|
212
214
|
ownerRoleId: 'role-ops-lead',
|
|
213
215
|
status: 'active',
|
|
214
|
-
actionKey: 'sales.crm.deal.update-stage',
|
|
215
216
|
ontology: {
|
|
216
|
-
|
|
217
|
+
actions: ['sales.crm:action/deal.update-stage'],
|
|
218
|
+
primaryAction: 'sales.crm:action/deal.update-stage',
|
|
217
219
|
reads: ['sales.crm:object/deal'],
|
|
218
220
|
writes: ['sales.crm:object/deal'],
|
|
219
221
|
usesCatalogs: ['sales.crm:catalog/pipeline'],
|
|
@@ -243,7 +245,7 @@ Use kind-prefixed graph IDs for cross-collection links:
|
|
|
243
245
|
|
|
244
246
|
`category` is one of `production`, `diagnostic`, `internal`, or `testing`.
|
|
245
247
|
|
|
246
|
-
`
|
|
248
|
+
Descriptor `title` and `description` own executable display metadata. Use nested `resource.ontology` bindings to declare which ontology actions, objects, catalogs, and events the resource performs, reads, writes, uses, or emits. `resource.ontology.primaryAction` names the default/selectable action and must be included in `resource.ontology.actions`. Resource event emissions can still be declared through top-level `emits` for older descriptors, but new descriptors should use `resource.ontology.emits`.
|
|
247
249
|
|
|
248
250
|
## Compatibility Domain Mirrors
|
|
249
251
|
|
|
@@ -210,15 +210,15 @@ const companyCleanupLayout: StepConfigLayout<CompanyCleanupInput> = {
|
|
|
210
210
|
}
|
|
211
211
|
|
|
212
212
|
const listActions: ListBuilderRegistry = [
|
|
213
|
-
{
|
|
214
|
-
resourceId: companyCleanupResource.id,
|
|
215
|
-
workflowId: companyCleanupResource.id,
|
|
216
|
-
actionKey:
|
|
217
|
-
label:
|
|
218
|
-
description:
|
|
219
|
-
category: 'utility',
|
|
220
|
-
stagesAffected: ['populated'],
|
|
221
|
-
schema: companyCleanupInputSchema,
|
|
213
|
+
{
|
|
214
|
+
resourceId: companyCleanupResource.id,
|
|
215
|
+
workflowId: companyCleanupResource.id,
|
|
216
|
+
actionKey: companyCleanupResource.ontology.primaryAction ?? companyCleanupResource.ontology.actions[0],
|
|
217
|
+
label: companyCleanupResource.title,
|
|
218
|
+
description: companyCleanupResource.description,
|
|
219
|
+
category: 'utility',
|
|
220
|
+
stagesAffected: ['populated'],
|
|
221
|
+
schema: companyCleanupInputSchema,
|
|
222
222
|
layout: companyCleanupLayout,
|
|
223
223
|
defaultInput: (list) => ({
|
|
224
224
|
listId: list.id,
|
|
@@ -17,7 +17,7 @@ Before starting, read [glossary.md](../reference/glossary.md) to disambiguate ov
|
|
|
17
17
|
## Recipes
|
|
18
18
|
|
|
19
19
|
**[Add an OM-Backed System](add-a-feature.md)**
|
|
20
|
-
You want a new system with cohesive Organization Model semantics, executable resources, and optional UI. Covers Systems, System-owned ontology and config, Resource descriptors with `resource.ontology`, `
|
|
20
|
+
You want a new system with cohesive Organization Model semantics, executable resources, and optional UI. Covers Systems, System-owned ontology and config, Resource descriptors with `title`, `description`, `resource.ontology.actions`, `primaryAction`, `codeRefs`, OM topology, runtime assembly, manifests, routes, guards, tests, and compatibility notes for old `System.content` consumers.
|
|
21
21
|
|
|
22
22
|
**[Add a Resource](add-a-resource.md)**
|
|
23
23
|
You want a new workflow or agent deployed to the platform. Covers OM Resource descriptor authoring, descriptor-backed `WorkflowDefinition` binding, `DeploymentSpec` assembly, relationship declarations, and CLI verification.
|
|
@@ -421,6 +421,42 @@ export type OrganizationModelIntegrationResourceEntry = z.infer<typeof Integrati
|
|
|
421
421
|
export type OrganizationModelScriptResourceEntry = z.infer<typeof ScriptResourceEntrySchema>
|
|
422
422
|
```
|
|
423
423
|
|
|
424
|
+
### `OrganizationModelTopology`
|
|
425
|
+
|
|
426
|
+
```typescript
|
|
427
|
+
export type OrganizationModelTopology = z.infer<typeof OmTopologyDomainSchema>
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
### `OrganizationModelTopologyNodeKind`
|
|
431
|
+
|
|
432
|
+
```typescript
|
|
433
|
+
export type OrganizationModelTopologyNodeKind = z.infer<typeof OmTopologyNodeKindSchema>
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
### `OrganizationModelTopologyNodeRef`
|
|
437
|
+
|
|
438
|
+
```typescript
|
|
439
|
+
export type OrganizationModelTopologyNodeRef = z.infer<typeof OmTopologyNodeRefSchema>
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### `OrganizationModelTopologyRelationshipKind`
|
|
443
|
+
|
|
444
|
+
```typescript
|
|
445
|
+
export type OrganizationModelTopologyRelationshipKind = z.infer<typeof OmTopologyRelationshipKindSchema>
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
### `OrganizationModelTopologyRelationship`
|
|
449
|
+
|
|
450
|
+
```typescript
|
|
451
|
+
export type OrganizationModelTopologyRelationship = z.infer<typeof OmTopologyRelationshipSchema>
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### `OrganizationModelTopologyMetadata`
|
|
455
|
+
|
|
456
|
+
```typescript
|
|
457
|
+
export type OrganizationModelTopologyMetadata = z.infer<typeof OmTopologyMetadataSchema>
|
|
458
|
+
```
|
|
459
|
+
|
|
424
460
|
### `OrganizationModelActions`
|
|
425
461
|
|
|
426
462
|
```typescript
|
|
@@ -1290,13 +1326,15 @@ export interface HumanCheckpointDefinition extends ResourceDefinition {
|
|
|
1290
1326
|
* Used by ResourceRegistry for discovery and Command View for visualization.
|
|
1291
1327
|
*/
|
|
1292
1328
|
export interface DeploymentSpec {
|
|
1293
|
-
/** Deployment version (semver) */
|
|
1294
|
-
version: string
|
|
1295
|
-
/** Optional Organization Model governance catalog used for OM-code validation */
|
|
1296
|
-
organizationModel?:
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1329
|
+
/** Deployment version (semver) */
|
|
1330
|
+
version: string
|
|
1331
|
+
/** Optional Organization Model governance catalog used for OM-code validation */
|
|
1332
|
+
organizationModel?: Partial<
|
|
1333
|
+
Pick<
|
|
1334
|
+
OrganizationModel,
|
|
1335
|
+
'systems' | 'resources' | 'ontology' | 'topology' | 'roles' | 'policies' | 'entities' | 'actions'
|
|
1336
|
+
>
|
|
1337
|
+
>
|
|
1300
1338
|
/** Workflow definitions */
|
|
1301
1339
|
workflows?: WorkflowDefinition[]
|
|
1302
1340
|
/** Agent definitions */
|
|
@@ -32,7 +32,7 @@ description: Terminology disambiguation for Organization OS concepts used in the
|
|
|
32
32
|
|
|
33
33
|
**MembershipFeatureConfig** -- legacy per-member feature override config. Current System visibility should be authored through Organization Model System lifecycle/access metadata and resolved through provider compatibility layers for older consumers.
|
|
34
34
|
|
|
35
|
-
**OrganizationModel** -- top-level semantic contract for an organization. Current primary fields include `version`, `domainMetadata`, `branding`, `navigation`, `ontology`, `systems`, `resources`, `identity`, `customers`, `offerings`, `roles`, `goals`, `policies`, `statuses`, and `knowledge`. Legacy domain keys such as `sales`, `prospecting`, `projects`, `actions`, and `entities` remain compatibility inputs while projects migrate to System-owned ontology/config/resource contracts.
|
|
35
|
+
**OrganizationModel** -- top-level semantic contract for an organization. Current primary fields include `version`, `domainMetadata`, `branding`, `navigation`, `ontology`, `systems`, `resources`, `topology`, `identity`, `customers`, `offerings`, `roles`, `goals`, `policies`, `statuses`, and `knowledge`. Legacy domain keys such as `sales`, `prospecting`, `projects`, `actions`, and `entities` remain compatibility inputs while projects migrate to System-owned ontology/config/resource contracts.
|
|
36
36
|
|
|
37
37
|
**OrganizationModelSystemEntry** -- System node in `OrganizationModel.systems`. Primary authoring fields include `id`, `label`, `description`, `parentSystemId`, `systems`, `lifecycle`, `ui`, `requiresAdmin`, `devOnly`, `responsibleRoleId`, `governedByKnowledge`, `drivesGoals`, `actions`, `policies`, `ontology`, `config`, and `order`. `subsystems` and `content` are retained compatibility inputs for older projects and should not be used for new recursive Systems, schemas, catalogs, or config.
|
|
38
38
|
|
|
@@ -40,7 +40,7 @@ description: Terminology disambiguation for Organization OS concepts used in the
|
|
|
40
40
|
|
|
41
41
|
**Resource** -- governance-only descriptor in `OrganizationModel.resources` for a workflow, agent, integration, or script. Runtime code derives `resourceId` and kind from the descriptor, then attaches executable behavior in operations.
|
|
42
42
|
|
|
43
|
-
**Resource descriptor** -- OM entry with canonical `id`, required `systemPath`, governance `status`, optional role ownership,
|
|
43
|
+
**Resource descriptor** -- OM entry with canonical `id`, required `systemPath`, descriptor `title` / `description`, governance `status`, optional role ownership, `codeRefs`, and nested `ontology` bindings for `actions`, optional `primaryAction`, read/write objects, used catalogs, and emitted events. Top-level `emits` remains a compatibility mirror for older descriptors.
|
|
44
44
|
|
|
45
45
|
**System** -- tenant-defined bounded context in `OrganizationModel.systems` that groups operational resources and carries governance metadata such as responsible role, governing knowledge, driven goals, kind, lifecycle, System-local ontology, and System-local config.
|
|
46
46
|
|
|
@@ -54,7 +54,7 @@ description: Terminology disambiguation for Organization OS concepts used in the
|
|
|
54
54
|
|
|
55
55
|
**Subshell / Sidebar** -- System- or route-prefix-scoped UI region rendered when the current route matches a module whose manifest supplies a sidebar.
|
|
56
56
|
|
|
57
|
-
**Topology** --
|
|
57
|
+
**Topology** -- durable OM operational wiring declared in `OrganizationModel.topology.relationships`. Initial relationship kinds are `triggers`, `uses`, and `approval`; relationships use typed refs such as `{ kind: 'resource', id: 'lead-import' }`.
|
|
58
58
|
|
|
59
59
|
## Package Boundary
|
|
60
60
|
|