@elevasis/sdk 1.44.3 → 1.46.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 (259) hide show
  1. package/dist/cli.cjs +35026 -30226
  2. package/dist/index.d.ts +1786 -808
  3. package/dist/index.js +789 -739
  4. package/dist/node/index.d.ts +105 -181
  5. package/dist/node/index.js +2 -2
  6. package/dist/test-utils/index.d.ts +901 -359
  7. package/dist/test-utils/index.js +587 -824
  8. package/dist/worker/index.d.ts +12685 -0
  9. package/dist/worker/index.js +188 -216
  10. package/package.json +4 -7
  11. package/reference/_navigation.md +161 -22
  12. package/reference/_reference-manifest.json +228 -4
  13. package/reference/claude-config.md +8 -0
  14. package/reference/core/exports.mdx +2 -0
  15. package/reference/core/index.mdx +3 -3
  16. package/reference/examples/organization-model.ts +117 -111
  17. package/reference/index.mdx +4 -4
  18. package/reference/packages/core/src/business/README.md +4 -1
  19. package/reference/packages/core/src/content/README.md +19 -0
  20. package/reference/packages/core/src/organization-model/README.md +148 -149
  21. package/reference/packages/core/src/organization-model/readiness/README.md +42 -0
  22. package/reference/packages/ui/src/features/README.md +28 -28
  23. package/reference/rules/active-change-index.md +40 -54
  24. package/reference/rules/agent-runtime.md +81 -0
  25. package/reference/rules/agent-start-here.md +71 -163
  26. package/reference/rules/deployment.md +33 -10
  27. package/reference/rules/error-handling.md +26 -0
  28. package/reference/rules/execution.md +13 -0
  29. package/reference/rules/frontend.md +10 -3
  30. package/reference/rules/observability.md +9 -1
  31. package/reference/rules/operations.md +26 -17
  32. package/reference/rules/organization-model.md +74 -88
  33. package/reference/rules/organization-os.md +71 -88
  34. package/reference/rules/package-taxonomy.md +11 -2
  35. package/reference/rules/platform.md +13 -7
  36. package/reference/rules/shared-types.md +36 -0
  37. package/reference/rules/task-tracking.md +30 -5
  38. package/reference/rules/ui.md +145 -3
  39. package/reference/rules/vibe-intents.md +271 -0
  40. package/reference/rules/vibe.md +17 -243
  41. package/reference/scaffold/core/organization-graph.mdx +112 -99
  42. package/reference/scaffold/core/organization-model.mdx +231 -215
  43. package/reference/scaffold/operations/propagation-pipeline.md +16 -17
  44. package/reference/scaffold/operations/scaffold-maintenance.md +22 -20
  45. package/reference/scaffold/operations/workflow-recipes.md +72 -20
  46. package/reference/scaffold/recipes/add-a-feature.md +156 -146
  47. package/reference/scaffold/recipes/add-a-resource.md +123 -117
  48. package/reference/scaffold/recipes/customize-crm-actions.md +28 -13
  49. package/reference/scaffold/recipes/customize-knowledge-browser.md +52 -117
  50. package/reference/scaffold/recipes/customize-organization-model.md +161 -149
  51. package/reference/scaffold/recipes/extend-a-base-entity.md +156 -140
  52. package/reference/scaffold/recipes/extend-content.md +265 -0
  53. package/reference/scaffold/recipes/extend-crm.md +16 -11
  54. package/reference/scaffold/recipes/extend-lead-gen.md +37 -21
  55. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +160 -118
  56. package/reference/scaffold/recipes/index.md +6 -3
  57. package/reference/scaffold/recipes/query-the-knowledge-graph.md +23 -23
  58. package/reference/scaffold/reference/contracts.md +30 -56
  59. package/reference/scaffold/reference/feature-registry.md +3 -0
  60. package/reference/scaffold/reference/glossary.md +4 -4
  61. package/reference/scaffold/reference/system-interface-capabilities.md +5 -4
  62. package/reference/scaffold/ui/composition-extensibility.mdx +271 -232
  63. package/reference/scaffold/ui/customization.md +2 -2
  64. package/reference/scaffold/ui/feature-flags-and-gating.md +14 -6
  65. package/reference/scaffold/ui/feature-shell.mdx +277 -62
  66. package/reference/scaffold/ui/recipes.md +229 -197
  67. package/reference/sdk/cli-management.mdx +166 -33
  68. package/reference/sdk/cli.mdx +90 -13
  69. package/reference/sdk/concepts.mdx +2 -0
  70. package/reference/sdk/define-builders.mdx +76 -0
  71. package/reference/sdk/deployment/command-center.mdx +6 -2
  72. package/reference/sdk/deployment/execution-reference.mdx +64 -186
  73. package/reference/sdk/deployment/index.mdx +2 -0
  74. package/reference/sdk/exports.mdx +4 -4
  75. package/reference/sdk/framework/agent.mdx +52 -116
  76. package/reference/sdk/framework/index.mdx +46 -65
  77. package/reference/sdk/framework/project-structure.mdx +150 -205
  78. package/reference/sdk/framework/tutorial-system.mdx +2 -2
  79. package/reference/sdk/human-in-the-loop.mdx +152 -0
  80. package/reference/sdk/index.mdx +6 -7
  81. package/reference/sdk/platform-tools/adapters-platform.mdx +3 -1
  82. package/reference/sdk/platform-tools/index.mdx +12 -0
  83. package/reference/sdk/platform-tools/type-safety.mdx +4 -0
  84. package/reference/sdk/project-deployment-spec.mdx +131 -0
  85. package/reference/sdk/resources/index.mdx +21 -7
  86. package/reference/sdk/resources/patterns.mdx +54 -24
  87. package/reference/sdk/resources/types.mdx +7 -4
  88. package/reference/sdk/templates/data-enrichment.mdx +7 -3
  89. package/reference/sdk/templates/email-sender.mdx +139 -135
  90. package/reference/sdk/templates/lead-scorer.mdx +5 -1
  91. package/reference/sdk/templates/pdf-generator.mdx +155 -151
  92. package/reference/sdk/templates/recurring-job.mdx +195 -189
  93. package/reference/sdk/templates/text-classifier.mdx +4 -0
  94. package/reference/sdk/templates/web-scraper.mdx +139 -135
  95. package/reference/spine/spine-primer.md +135 -96
  96. package/reference/ui/exports.mdx +1 -0
  97. package/reference/ui/index.mdx +14 -7
  98. package/dist/types/worker/adapters/anymailfinder.d.ts +0 -14
  99. package/dist/types/worker/adapters/apify.d.ts +0 -14
  100. package/dist/types/worker/adapters/approval.d.ts +0 -23
  101. package/dist/types/worker/adapters/attio.d.ts +0 -22
  102. package/dist/types/worker/adapters/clickup.d.ts +0 -22
  103. package/dist/types/worker/adapters/create-adapter.d.ts +0 -41
  104. package/dist/types/worker/adapters/crm.d.ts +0 -20
  105. package/dist/types/worker/adapters/dropbox.d.ts +0 -14
  106. package/dist/types/worker/adapters/email.d.ts +0 -25
  107. package/dist/types/worker/adapters/execution.d.ts +0 -22
  108. package/dist/types/worker/adapters/gmail.d.ts +0 -14
  109. package/dist/types/worker/adapters/google-sheets.d.ts +0 -14
  110. package/dist/types/worker/adapters/index.d.ts +0 -33
  111. package/dist/types/worker/adapters/instantly.d.ts +0 -14
  112. package/dist/types/worker/adapters/lead.d.ts +0 -28
  113. package/dist/types/worker/adapters/list.d.ts +0 -9
  114. package/dist/types/worker/adapters/llm.d.ts +0 -45
  115. package/dist/types/worker/adapters/millionverifier.d.ts +0 -14
  116. package/dist/types/worker/adapters/notification.d.ts +0 -28
  117. package/dist/types/worker/adapters/pdf.d.ts +0 -22
  118. package/dist/types/worker/adapters/projects.d.ts +0 -20
  119. package/dist/types/worker/adapters/resend.d.ts +0 -14
  120. package/dist/types/worker/adapters/scheduler.d.ts +0 -25
  121. package/dist/types/worker/adapters/signature-api.d.ts +0 -14
  122. package/dist/types/worker/adapters/storage.d.ts +0 -33
  123. package/dist/types/worker/adapters/stripe.d.ts +0 -14
  124. package/dist/types/worker/adapters/tomba.d.ts +0 -14
  125. package/dist/types/worker/index.d.ts +0 -60
  126. package/dist/types/worker/platform.d.ts +0 -90
  127. package/dist/types/worker/utils.d.ts +0 -9
  128. package/reference/claude-config/Overview.md +0 -230
  129. package/reference/claude-config/hooks/post-edit-validate.mjs +0 -98
  130. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +0 -187
  131. package/reference/claude-config/hooks/tool-failure-recovery.mjs +0 -73
  132. package/reference/claude-config/registries/graph-skills.json +0 -4
  133. package/reference/claude-config/registries/knowledge-flags.json +0 -154
  134. package/reference/claude-config/registries/skill-coverage.json +0 -20
  135. package/reference/claude-config/rules/active-change-index.md +0 -22
  136. package/reference/claude-config/rules/agent-start-here.md +0 -22
  137. package/reference/claude-config/rules/deployment.md +0 -22
  138. package/reference/claude-config/rules/error-handling.md +0 -22
  139. package/reference/claude-config/rules/execution.md +0 -22
  140. package/reference/claude-config/rules/frontend.md +0 -22
  141. package/reference/claude-config/rules/observability.md +0 -22
  142. package/reference/claude-config/rules/operations.md +0 -22
  143. package/reference/claude-config/rules/organization-model.md +0 -22
  144. package/reference/claude-config/rules/organization-os.md +0 -22
  145. package/reference/claude-config/rules/package-taxonomy.md +0 -22
  146. package/reference/claude-config/rules/platform.md +0 -22
  147. package/reference/claude-config/rules/shared-types.md +0 -22
  148. package/reference/claude-config/rules/task-tracking.md +0 -22
  149. package/reference/claude-config/rules/topbar-actions.md +0 -70
  150. package/reference/claude-config/rules/ui.md +0 -22
  151. package/reference/claude-config/rules/vibe.md +0 -22
  152. package/reference/claude-config/scripts/statusline-command.js +0 -18
  153. package/reference/claude-config/settings.json +0 -30
  154. package/reference/claude-config/skills/client/SKILL.md +0 -201
  155. package/reference/claude-config/skills/deploy/SKILL.md +0 -159
  156. package/reference/claude-config/skills/dsp/SKILL.md +0 -66
  157. package/reference/claude-config/skills/elevasis/SKILL.md +0 -251
  158. package/reference/claude-config/skills/explore/SKILL.md +0 -78
  159. package/reference/claude-config/skills/git-sync/SKILL.md +0 -166
  160. package/reference/claude-config/skills/om/SKILL.md +0 -475
  161. package/reference/claude-config/skills/om/operations/build.md +0 -237
  162. package/reference/claude-config/skills/om/operations/codify-level-a.md +0 -109
  163. package/reference/claude-config/skills/om/operations/codify-level-b.md +0 -159
  164. package/reference/claude-config/skills/om/operations/customers.md +0 -114
  165. package/reference/claude-config/skills/om/operations/features.md +0 -88
  166. package/reference/claude-config/skills/om/operations/goals.md +0 -123
  167. package/reference/claude-config/skills/om/operations/identity.md +0 -97
  168. package/reference/claude-config/skills/om/operations/labels.md +0 -110
  169. package/reference/claude-config/skills/om/operations/offerings.md +0 -114
  170. package/reference/claude-config/skills/om/operations/roles.md +0 -104
  171. package/reference/claude-config/skills/om/operations/scaffold.md +0 -163
  172. package/reference/claude-config/skills/om/operations/techStack.md +0 -38
  173. package/reference/claude-config/skills/project/SKILL.md +0 -1114
  174. package/reference/claude-config/skills/run-ui/SKILL.md +0 -73
  175. package/reference/claude-config/skills/save/SKILL.md +0 -183
  176. package/reference/claude-config/skills/setup/SKILL.md +0 -290
  177. package/reference/claude-config/skills/status/SKILL.md +0 -59
  178. package/reference/claude-config/skills/submit-request/SKILL.md +0 -180
  179. package/reference/claude-config/skills/sync/SKILL.md +0 -47
  180. package/reference/claude-config/skills/tutorial/SKILL.md +0 -259
  181. package/reference/claude-config/skills/tutorial/progress-template.md +0 -74
  182. package/reference/claude-config/skills/tutorial/technical.md +0 -1303
  183. package/reference/claude-config/skills/tutorial/vibe-coder.md +0 -890
  184. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +0 -27
  185. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +0 -30
  186. package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +0 -73
  187. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +0 -86
  188. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +0 -55
  189. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +0 -97
  190. package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +0 -112
  191. package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +0 -93
  192. package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +0 -58
  193. package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +0 -56
  194. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +0 -71
  195. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +0 -83
  196. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +0 -59
  197. package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +0 -42
  198. package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +0 -60
  199. package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +0 -37
  200. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +0 -34
  201. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +0 -38
  202. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +0 -32
  203. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +0 -33
  204. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +0 -69
  205. package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +0 -30
  206. package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +0 -45
  207. package/reference/claude-config/sync-notes/2026-05-15-om-skill-rename-and-write-family.md +0 -52
  208. package/reference/claude-config/sync-notes/2026-05-17-sdk-boundary-consolidation.md +0 -33
  209. package/reference/claude-config/sync-notes/2026-05-20-om-define-helpers.md +0 -32
  210. package/reference/claude-config/sync-notes/2026-05-22-access-model-and-right-panel.md +0 -43
  211. package/reference/claude-config/sync-notes/2026-05-22-lead-gen-tenant-config.md +0 -40
  212. package/reference/claude-config/sync-notes/2026-05-22-org-model-multi-file-split.md +0 -61
  213. package/reference/claude-config/sync-notes/2026-05-23-branding-names-to-identity.md +0 -49
  214. package/reference/claude-config/sync-notes/2026-05-23-lead-gen-manage-access.md +0 -31
  215. package/reference/claude-config/sync-notes/2026-05-23-om-deployment-drift-detection.md +0 -42
  216. package/reference/claude-config/sync-notes/2026-05-23-om-full-model-deploy-contract.md +0 -33
  217. package/reference/claude-config/sync-notes/2026-05-23-ui-sdk-package-fixes.md +0 -37
  218. package/reference/claude-config/sync-notes/2026-05-24-platform-invite-router-core-baseline.md +0 -28
  219. package/reference/claude-config/sync-notes/2026-05-24-system-interface-readiness.md +0 -43
  220. package/reference/claude-config/sync-notes/2026-05-25-invitation-login-loader.md +0 -26
  221. package/reference/claude-config/sync-notes/2026-05-25-om-topbar-requests.md +0 -33
  222. package/reference/claude-config/sync-notes/2026-05-25-system-interface-profile-registry-and-substrate.md +0 -35
  223. package/reference/claude-config/sync-notes/2026-05-25-tenant-om-scaffold-cli.md +0 -49
  224. package/reference/claude-config/sync-notes/2026-05-25-vibe-operate-intent.md +0 -47
  225. package/reference/claude-config/sync-notes/2026-05-28-om-snapshot-sdk-workflow-config.md +0 -33
  226. package/reference/claude-config/sync-notes/2026-05-30-client-source-and-om-profiles.md +0 -39
  227. package/reference/claude-config/sync-notes/2026-06-02-knowledge-nested-group-routing.md +0 -27
  228. package/reference/claude-config/sync-notes/2026-06-02-nest-projects-under-platform.md +0 -45
  229. package/reference/claude-config/sync-notes/2026-06-03-skill-autogen-and-client-skill.md +0 -34
  230. package/reference/claude-config/sync-notes/2026-06-04-scaffold-registry-lane-severity.md +0 -34
  231. package/reference/claude-config/sync-notes/2026-06-05-appearance-app-mode-decouple.md +0 -29
  232. package/reference/claude-config/sync-notes/2026-06-05-ontology-endpoint-rename-and-knowledge-browser-ui.md +0 -86
  233. package/reference/claude-config/sync-notes/2026-06-06-om-build-systems-scaffold.md +0 -47
  234. package/reference/claude-config/sync-notes/2026-06-06-om-item-copy-references.md +0 -50
  235. package/reference/claude-config/sync-notes/2026-06-08-knowledge-base-page-not-found-fix.md +0 -76
  236. package/reference/claude-config/sync-notes/2026-06-09-agent-sessions-public-agent-chat-route.md +0 -75
  237. package/reference/claude-config/sync-notes/2026-06-09-sdk-cli-load-org-model-resolution.md +0 -42
  238. package/reference/claude-config/sync-notes/2026-06-12-agent-grants-visualizer-operations.md +0 -30
  239. package/reference/claude-config/sync-notes/2026-06-14-session-ux-and-project-cli-json.md +0 -33
  240. package/reference/claude-config/sync-notes/2026-06-14-shared-session-conversation-view.md +0 -26
  241. package/reference/claude-config/sync-notes/2026-06-15-session-chat-zero-wiring.md +0 -46
  242. package/reference/claude-config/sync-notes/2026-06-17-agent-session-ux-features.md +0 -34
  243. package/reference/claude-config/sync-notes/2026-06-25-shared-page-scroll-contract-guard.md +0 -52
  244. package/reference/claude-config/sync-notes/2026-06-26-leadgen-overview-om-telemetry.md +0 -47
  245. package/reference/claude-config/sync-notes/2026-07-21-agent-scaffold-hardening.md +0 -75
  246. package/reference/claude-config/sync-notes/2026-07-23-agent-session-memory.md +0 -49
  247. package/reference/claude-config/sync-notes/2026-07-23-workos-org-marker.md +0 -50
  248. package/reference/claude-config/sync-notes/2026-07-24-claude-5-models-and-session-surface-fixes.md +0 -116
  249. package/reference/claude-config/sync-notes/2026-07-27-agent-strict-output-and-turn-drift.md +0 -73
  250. package/reference/claude-config/sync-notes/2026-07-28-agent-reply-is-its-own-field.md +0 -84
  251. package/reference/claude-config/sync-notes/2026-07-30-login-screen-and-member-provisioning-state.md +0 -114
  252. package/reference/claude-config/sync-notes/2026-08-02-auth-guard-defaults-and-truncation-fix.md +0 -122
  253. package/reference/claude-config/sync-notes/2026-08-03-agent-prose-escape-normalization.md +0 -88
  254. package/reference/claude-config/sync-notes/2026-08-03-cli-gateway-errors-and-request-timeout.md +0 -120
  255. package/reference/claude-config/sync-notes/README.md +0 -43
  256. package/reference/sdk/framework/interaction-guidance.mdx +0 -182
  257. package/reference/sdk/framework/memory.mdx +0 -326
  258. package/reference/sdk/framework/resource-documentation.mdx +0 -90
  259. package/reference/sdk/roadmap.mdx +0 -164
@@ -1,25 +1,25 @@
1
1
  <!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
2
2
  <!-- Regenerate: pnpm scaffold:sync -->
3
3
 
4
- ---
5
- title: Add a Resource
6
- description: Add an OM-owned workflow or agent descriptor, bind executable behavior in operations, and verify descriptor-backed deployment.
7
- ---
8
-
9
- # Add a Resource
10
-
11
- Resources are governed descriptors in the Organization Model. The OM owns resource identity, System membership, owner role, and lifecycle status. Operations code imports those descriptors, attaches executable workflow or agent behavior, and exports a `DeploymentSpec` for deployment.
12
-
13
- Do not keep a second identity catalog in operations. `DeploymentSpec` is the runtime/deploy assembly artifact; it should not be the place where a workflow ID is invented.
14
-
15
- ## 1. Author the OM descriptor
16
-
17
- Add the descriptor in `core/config/organization-model.ts`:
18
-
19
- ```ts
20
- import { defineResources } from '@elevasis/core/organization-model'
21
-
22
- export const resourceDescriptors = defineResources({
4
+ ---
5
+ title: Add a Resource
6
+ description: Add an OM-owned workflow or agent descriptor, bind executable behavior in operations, and verify descriptor-backed deployment.
7
+ ---
8
+
9
+ # Add a Resource
10
+
11
+ Resources are governed descriptors in the Organization Model. The OM owns resource identity, System membership, owner role, and lifecycle status. Operations code imports those descriptors, attaches executable workflow or agent behavior, and exports a `DeploymentSpec` for deployment.
12
+
13
+ Do not keep a second identity catalog in operations. `DeploymentSpec` is the runtime/deploy assembly artifact; it should not be the place where a workflow ID is invented.
14
+
15
+ ## 1. Author the OM descriptor
16
+
17
+ Add the descriptor in `core/config/organization-model.ts`:
18
+
19
+ ```ts
20
+ import { defineResources } from '@elevasis/core/organization-model'
21
+
22
+ export const resourceDescriptors = defineResources({
23
23
  myWorkflow: {
24
24
  id: 'my-workflow',
25
25
  title: 'My Workflow',
@@ -38,79 +38,87 @@ export const resourceDescriptors = defineResources({
38
38
  emits: ['operations:event/my-workflow.completed']
39
39
  },
40
40
  codeRefs: [
41
- {
42
- path: 'operations/src/my-workflow/index.ts',
43
- role: 'entrypoint',
44
- symbol: 'myWorkflow'
45
- },
46
- {
47
- path: 'operations/src/my-workflow/my-workflow.test.ts',
48
- role: 'test'
49
- }
50
- ]
51
- }
52
- })
53
- ```
54
-
55
- Then expose the descriptor catalog through the Organization Model:
56
-
57
- ```ts
58
- export const resourceGovernanceModel = {
59
- systems,
60
- resources: resourceDescriptors
61
- } as const
62
- ```
63
-
41
+ {
42
+ path: 'operations/src/my-workflow/index.ts',
43
+ role: 'entrypoint',
44
+ symbol: 'myWorkflow'
45
+ },
46
+ {
47
+ path: 'operations/src/my-workflow/my-workflow.test.ts',
48
+ role: 'test'
49
+ }
50
+ ]
51
+ }
52
+ })
53
+ ```
54
+
55
+ Then expose the descriptor catalog through the Organization Model:
56
+
57
+ <!-- doc-snippet:skip: illustrative excerpt -- `systems` refers to the System map authored elsewhere in the same organization-model.ts file, not a local declaration -->
58
+
59
+ ```ts
60
+ export const resourceGovernanceModel = {
61
+ systems,
62
+ resources: resourceDescriptors
63
+ } as const
64
+ ```
65
+
64
66
  Use `organizationModel.resources` as the Resources descriptor catalog. Graph references still use kind-prefixed IDs, such as `system:sales.crm`, `resource:lead-import`, or `action:operations.queue.review`, when runtime behavior needs semantic graph binding.
65
67
 
66
68
  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.
67
69
 
68
70
  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`.
69
-
70
- ## 2. Author executable behavior
71
-
72
- Operations code owns schemas, steps, handlers, triggers, and UI execution metadata. Import the descriptor and derive runtime identity from it at the binding boundary:
73
-
74
- ```ts
75
- import type { WorkflowDefinition } from '@elevasis/sdk'
76
- import { resourceDescriptors } from '@core/config/organization-model'
77
-
78
- export const myWorkflow: WorkflowDefinition = {
79
- config: {
80
- resource: resourceDescriptors.myWorkflow,
81
- resourceId: resourceDescriptors.myWorkflow.id,
82
- name: 'My Workflow',
83
- type: resourceDescriptors.myWorkflow.kind,
84
- version: '1.0.0',
85
- status: 'dev',
86
- category: 'production'
87
- },
88
- contract: {
89
- inputSchema,
90
- outputSchema
91
- },
92
- steps: {
93
- run: {
94
- id: 'run',
95
- name: 'Run',
96
- handler: async (_input, context) => {
97
- context.logger.info('[my-workflow] starting')
98
- return { ok: true }
99
- },
100
- inputSchema,
101
- outputSchema,
102
- next: null
103
- }
104
- },
105
- entryPoint: 'run'
106
- }
107
- ```
108
-
109
- `category` is one of `production`, `diagnostic`, `internal`, or `testing`.
110
-
111
- ## 3. Register in the deployment spec
112
-
113
- ```ts
71
+
72
+ ## 2. Author executable behavior
73
+
74
+ Operations code owns schemas, steps, handlers, triggers, and UI execution metadata. Import the descriptor and derive runtime identity from it at the binding boundary:
75
+
76
+ <!-- doc-snippet:skip: illustrative excerpt -- `resourceDescriptors` names the project's own resource-descriptors export from step 1, and `inputSchema`/`outputSchema` are shown unimported for readability -->
77
+
78
+ ```ts
79
+ import type { WorkflowDefinition } from '@elevasis/sdk'
80
+ import { resourceDescriptors } from '@core/config/organization-model'
81
+
82
+ export const myWorkflow: WorkflowDefinition = {
83
+ config: {
84
+ resource: resourceDescriptors.myWorkflow,
85
+ resourceId: resourceDescriptors.myWorkflow.id,
86
+ name: 'My Workflow',
87
+ description: resourceDescriptors.myWorkflow.description,
88
+ type: resourceDescriptors.myWorkflow.kind,
89
+ version: '1.0.0',
90
+ status: 'dev',
91
+ category: 'production'
92
+ },
93
+ contract: {
94
+ inputSchema,
95
+ outputSchema
96
+ },
97
+ steps: {
98
+ run: {
99
+ id: 'run',
100
+ name: 'Run',
101
+ description: 'Runs the governed work item workflow.',
102
+ handler: async (_input, context) => {
103
+ context.logger.info('[my-workflow] starting')
104
+ return { ok: true }
105
+ },
106
+ inputSchema,
107
+ outputSchema,
108
+ next: null
109
+ }
110
+ },
111
+ entryPoint: 'run'
112
+ }
113
+ ```
114
+
115
+ `category` is one of `production`, `diagnostic`, `internal`, or `testing`.
116
+
117
+ ## 3. Register in the deployment spec
118
+
119
+ <!-- doc-snippet:skip: illustrative excerpt with a relative import to the project's own workflow file, not a standalone compilable file -->
120
+
121
+ ```ts
114
122
  import { organizationModel } from '@core/config/organization-model'
115
123
  import { myWorkflow } from './my-workflow/index.js'
116
124
 
@@ -119,40 +127,38 @@ export const org = {
119
127
  organizationModel,
120
128
  workflows: [myWorkflow],
121
129
  agents: []
122
- }
123
- ```
124
-
125
- Use `.js` extensions in TypeScript source imports for ESM compatibility.
126
-
127
- ## 4. Declare runtime relationships
128
-
129
- Use `organizationModel.topology.relationships` for durable execution topology:
130
+ }
131
+ ```
132
+
133
+ Use `.js` extensions in TypeScript source imports for ESM compatibility.
134
+
135
+ ## 4. Declare runtime relationships
136
+
137
+ Use `organizationModel.topology` for durable execution topology. Author it with the typed helpers rather than by hand — `relationships` is an id-keyed record, not an array, and each relationship uses `from`/`to`:
130
138
 
131
139
  ```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
- }
140
+ import { defineTopology, topologyRef, topologyRelationship } from '@elevasis/core/organization-model'
141
+
142
+ export const topology = defineTopology({
143
+ dailyImportTriggersMyWorkflow: topologyRelationship.triggers(
144
+ topologyRef.trigger('daily-work-item-import'),
145
+ topologyRef.resource('my-workflow')
146
+ ),
147
+ myWorkflowUsesHubspot: topologyRelationship.uses(
148
+ topologyRef.resource('my-workflow'),
149
+ topologyRef.externalResource('hubspot')
150
+ )
151
+ })
146
152
  ```
147
153
 
154
+ `defineTopology` also accepts an array, in which case it assigns the keys `relationship-1`, `relationship-2`, and so on. Prefer explicit keys — they are what diagnostics name when a reference dangles.
155
+
148
156
  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.
149
-
150
- ## 5. Verify
151
-
152
- ```bash
157
+
158
+ ## 5. Verify
159
+
160
+ ```bash
153
161
  pnpm -C operations check
154
- pnpm -C operations deploy
155
- pnpm exec elevasis describe Elevasis/my-workflow
156
- pnpm scaffold:sync
157
- pnpm scaffold:verify
162
+ pnpm -C operations run deploy
163
+ pnpm elevasis-sdk describe my-workflow
158
164
  ```
@@ -12,7 +12,7 @@ CRM deal pages derive their action buttons from an `ActionDef[]` array. The shar
12
12
 
13
13
  For the broader CRM extension map -- pages, sidebars, hooks, workflow adapters, System Interfaces, and org-model boundaries -- start with [Build and Extend CRM](extend-crm.md). This recipe is only the deal-action path.
14
14
 
15
- **Shape reference:** The `ActionDef` flat shape and the consolidation that replaced the old `handler`/`kind` union are documented in `apps/docs/content/docs/in-progress/active-development/sdk-changes/crm/crm-current-state-assessment.mdx`.
15
+ **Shape reference:** The `ActionDef` flat shape and the consolidation that replaced the old `handler`/`kind` union are documented in `apps/docs/content/docs/in-progress/active-development/_pipeline/crm/crm-current-state-assessment.mdx`.
16
16
 
17
17
  Use this recipe when a user asks for work like:
18
18
 
@@ -42,6 +42,8 @@ Read the generated contract reference before editing:
42
42
 
43
43
  The current flat shape (no `handler` nesting, no `kind` discriminator):
44
44
 
45
+ <!-- doc-snippet:skip: shape excerpt from derive-actions.ts -- AcqDealRow and z are shown unimported here for readability -->
46
+
45
47
  ```ts
46
48
  export interface ActionDef {
47
49
  key: string
@@ -56,6 +58,8 @@ export interface ActionDef {
56
58
 
57
59
  A minimal entry looks like:
58
60
 
61
+ <!-- doc-snippet:skip: illustrative excerpt, not a standalone compilable file -->
62
+
59
63
  ```ts
60
64
  {
61
65
  key: 'move_to_proposal',
@@ -80,7 +84,9 @@ These wrap existing `LeadService` logic -- they are extraction, not new business
80
84
 
81
85
  Deploy a workflow with the same `workflowId` as the default action you want to replace. The resource registry resolves your project-owned workflow first.
82
86
 
83
- The canonical transition workflow (see `packages/elevasis-operations/src/sales/crm/actions/move-to-proposal.ts` for the deployed reference):
87
+ The canonical transition workflow (see `packages/elevasis/operations/src/sales/crm/actions/move-to-proposal.ts` for the deployed reference):
88
+
89
+ <!-- doc-snippet:skip: illustrative excerpt -- `resourceDescriptors` names the project's own resource-descriptors export, and `../shared/action-workflow-schemas.js` is a project-local sibling file -->
84
90
 
85
91
  ```ts
86
92
  // operations/src/sales/crm/actions/move-to-proposal.ts
@@ -94,6 +100,7 @@ export const moveToProposalWorkflow: WorkflowDefinition = {
94
100
  resource: resourceDescriptors.moveToProposal,
95
101
  resourceId: resourceDescriptors.moveToProposal.id,
96
102
  name: 'Move to Proposal',
103
+ description: 'Transition a deal to the proposal stage.',
97
104
  type: resourceDescriptors.moveToProposal.kind,
98
105
  version: '1.0.0',
99
106
  status: 'prod',
@@ -107,6 +114,7 @@ export const moveToProposalWorkflow: WorkflowDefinition = {
107
114
  transition: {
108
115
  id: 'transition',
109
116
  name: 'Transition to Proposal',
117
+ description: 'Call transitionDeal to move the deal to the proposal stage',
110
118
  inputSchema: ActionWorkflowInputSchema,
111
119
  outputSchema: ActionWorkflowOutputSchema,
112
120
  handler: async (rawInput, context) => {
@@ -126,6 +134,8 @@ To add side effects (create a task, send a Slack message, log a deal activity),
126
134
 
127
135
  Register the workflow in the operations manifest:
128
136
 
137
+ <!-- doc-snippet:skip: illustrative excerpt with a relative import to the project's own workflow file, not a standalone compilable file -->
138
+
129
139
  ```ts
130
140
  // operations/src/index.ts
131
141
  import { moveToProposalWorkflow } from './sales/crm/actions/move-to-proposal.js'
@@ -146,6 +156,8 @@ pnpm exec elevasis-sdk deploy
146
156
 
147
157
  To hide, reorder, or relabel buttons in the shared deal UI, create a local action config module:
148
158
 
159
+ <!-- doc-snippet:skip: illustrative excerpt with a relative import to the project's own platform-crm-actions module, not a standalone compilable file -->
160
+
149
161
  ```ts
150
162
  // ui/src/config/crm-actions.ts
151
163
  import type { ActionDef } from '@elevasis/sdk'
@@ -156,6 +168,8 @@ export const crmActions: ActionDef[] = platformCrmActions.filter((action) => act
156
168
 
157
169
  To add a new action entry alongside the defaults (note: brand-new keys are not server-dispatched until the platform knows their `workflowId`):
158
170
 
171
+ <!-- doc-snippet:skip: illustrative excerpt with a relative import to the project's own platform-crm-actions module, not a standalone compilable file -->
172
+
159
173
  ```ts
160
174
  // ui/src/config/crm-actions.ts
161
175
  import type { ActionDef } from '@elevasis/sdk'
@@ -206,7 +220,7 @@ This controls the shared `DealDetailPage` and `DealDrawer` action row.
206
220
 
207
221
  For a brand-new action key that calls a project-owned workflow, define the workflow first.
208
222
 
209
- If the action sends email, writes to another channel, or otherwise touches a customer, use `acqDb.recordDealActivity` inside the workflow handler to append an audit entry to the deal's `activity_log`. For an advanced Instantly-thread-aware variant that prefers in-thread replies and falls back to fresh outbound, see the canonical CRM action examples in `packages/elevasis-operations/src/sales/crm/actions/`.
223
+ If the action sends email, writes to another channel, or otherwise touches a customer, use `acqDb.recordDealActivity` inside the workflow handler to append an audit entry to the deal's `activity_log`. For an advanced Instantly-thread-aware variant that prefers in-thread replies and falls back to fresh outbound, see the canonical CRM action examples in `packages/elevasis/operations/src/sales/crm/actions/`.
210
224
 
211
225
  ### Define the Workflow Contract
212
226
 
@@ -231,6 +245,8 @@ export type SendQuoteOutput = z.infer<typeof sendQuoteOutputSchema>
231
245
 
232
246
  ### Define the Workflow
233
247
 
248
+ <!-- doc-snippet:skip: illustrative excerpt -- `resourceDescriptors` names the project's own resource-descriptors export, and `sendQuoteInputSchema`/`sendQuoteOutputSchema` are the schemas defined in the previous step, not yet added to this project's real core/types/index.ts -->
249
+
234
250
  ```ts
235
251
  // operations/src/sales/send-quote.ts
236
252
  import type { WorkflowDefinition } from '@elevasis/sdk'
@@ -246,6 +262,7 @@ export const sendQuoteWorkflow: WorkflowDefinition = {
246
262
  resource: resourceDescriptors.sendQuote,
247
263
  resourceId: resourceDescriptors.sendQuote.id,
248
264
  name: 'Send Quote',
265
+ description: 'Sends a quote email to the deal contact.',
249
266
  type: resourceDescriptors.sendQuote.kind,
250
267
  version: '1.0.0',
251
268
  status: 'dev',
@@ -259,6 +276,7 @@ export const sendQuoteWorkflow: WorkflowDefinition = {
259
276
  send: {
260
277
  id: 'send',
261
278
  name: 'Send Quote Email',
279
+ description: 'Loads the deal, sends the quote email, and records a deal activity entry.',
262
280
  inputSchema: sendQuoteInputSchema,
263
281
  outputSchema: sendQuoteOutputSchema,
264
282
  handler: async (rawInput, context) => {
@@ -296,6 +314,8 @@ export const sendQuoteWorkflow: WorkflowDefinition = {
296
314
 
297
315
  Register the workflow in the operations manifest and deploy:
298
316
 
317
+ <!-- doc-snippet:skip: illustrative excerpt with a relative import to the project's own workflow file, not a standalone compilable file -->
318
+
299
319
  ```ts
300
320
  // operations/src/index.ts
301
321
  import { sendQuoteWorkflow } from './sales/send-quote.js'
@@ -400,16 +420,13 @@ export function CustomDealPage({ dealId }: { dealId: string }) {
400
420
 
401
421
  ## CRM State-Key Source of Truth
402
422
 
403
- CRM `stage_key` and `state_key` values are tenant/runtime data. In the Elevasis workspace, the canonical CRM pipeline definition lives in `@repo/elevasis-core/organization-model` and is authored into the `sales.crm:catalog/crm.pipeline` ontology catalog on the canonical organization model. Published `@elevasis/core` keeps only generic `StatefulPipelineDefinition` types/helpers and transport schemas.
423
+ CRM `stage_key` and `state_key` values are tenant/runtime data. In the Elevasis workspace, the canonical CRM pipeline definition lives in `@repo/elevasis-core/sales` and is authored into the `sales.crm:catalog/crm.pipeline` ontology catalog on the canonical organization model. Published `@elevasis/core` keeps only generic `StatefulPipelineDefinition` types/helpers and transport schemas.
404
424
 
405
- Within the Elevasis monorepo, import runtime CRM definitions from `@repo/elevasis-core/organization-model`:
425
+ Within the Elevasis monorepo, import the tenant pipeline data from `@repo/elevasis-core/sales` and the generic `getValidStatesForStage` helper from `@repo/core/organization-model`:
406
426
 
407
427
  ```ts
408
- import {
409
- CRM_PIPELINE_DEFINITION,
410
- CRM_DISCOVERY_REPLIED_STATE,
411
- getValidStatesForStage
412
- } from '@repo/elevasis-core/organization-model'
428
+ import { CRM_PIPELINE_DEFINITION, CRM_DISCOVERY_REPLIED_STATE } from '@repo/elevasis-core/sales'
429
+ import { getValidStatesForStage } from '@repo/core/organization-model'
413
430
 
414
431
  const validStates = getValidStatesForStage(CRM_PIPELINE_DEFINITION, 'interested')
415
432
  // [{ stateKey: 'discovery_replied', label: '...' }, ...]
@@ -432,7 +449,7 @@ Run the relevant checks from the project root:
432
449
 
433
450
  ```bash
434
451
  pnpm -C operations run check
435
- pnpm -C ui run check
452
+ pnpm -C ui run check-types
436
453
  ```
437
454
 
438
455
  For a workflow-backed action, deploy or run the workflow smoke before wiring it into the UI:
@@ -441,5 +458,3 @@ For a workflow-backed action, deploy or run the workflow smoke before wiring it
441
458
  pnpm -C operations exec elevasis-sdk check
442
459
  pnpm -C operations exec elevasis-sdk deploy
443
460
  ```
444
-
445
-