@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
@@ -5,6 +5,8 @@ description: elevasis-sdk management commands -- project, note, acquisition, cli
5
5
 
6
6
  This page covers the domain management commands for `elevasis-sdk`. For core SDK commands (check, deploy, exec, resources, executions, describe, creds, rename), see [CLI Reference](cli.mdx).
7
7
 
8
+ Every command family on this page -- `project`, `note`, `acquisition`, `client`, `agent`, `session`, `queue`, `schedule`, `om:doctor`, and `request` -- also accepts `--prod` to target production, overriding `NODE_ENV=development` (live as of `@elevasis/sdk` 1.45.0). See [CLI Reference's Global Flags](cli.mdx#global-flags) for the full description; per-command flag tables below list `--api-url` and other command-specific flags only, not `--prod` or `--json`.
9
+
8
10
  ---
9
11
 
10
12
  ## JSON-valued options
@@ -94,10 +96,16 @@ elevasis-sdk project:task:get <id>
94
96
  elevasis-sdk project:task:create --project <id> --title "Implement API"
95
97
  elevasis-sdk project:task:create --project <id> --title "Implement API" --checklist @json:tmp/task-checklist.json
96
98
  elevasis-sdk project:task:update <id> --status in_progress
99
+ elevasis-sdk project:task:update <id> --parent <parent-task-id>
100
+ elevasis-sdk project:task:update <id> --clear-milestone
97
101
  elevasis-sdk project:task:update <id> --checklist @json:tmp/task-checklist.json
98
102
  elevasis-sdk project:task:delete <id>
99
103
  ```
100
104
 
105
+ `milestone_id` and `parent_task_id` are nullable, and `--clear-milestone` / `--clear-parent` are how they are set to null. Each is mutually exclusive with its set-flag and exits `CONFLICTING_FLAGS` if both are passed, matching `project:update --client` / `--clear-client`. An empty string does **not** clear either one -- `--milestone ""` fails UUID validation rather than detaching.
106
+
107
+ `--sequence <n>` on `project:milestone:create` and `project:milestone:update` writes the display order that `project:milestone:list` sorts by. It takes a non-negative integer and rejects anything else with `INVALID_SEQUENCE` before the request is sent.
108
+
101
109
  Task commands also expose agent-oriented resume state:
102
110
 
103
111
  ```bash
@@ -186,9 +194,9 @@ elevasis-sdk request:get <id>
186
194
 
187
195
  Most `project:*` commands support:
188
196
 
189
- | Flag | Description |
190
- | ----------------- | -------------------------------------------------- |
191
- | `--pretty` | Human-readable terminal output instead of raw JSON |
197
+ | Flag | Description |
198
+ | ------------------- | -------------------------------------------------- |
199
+ | `--pretty` | Human-readable terminal output instead of raw JSON |
192
200
  | `--api-url <url>` | Override the API base URL |
193
201
 
194
202
  For exact required flags and accepted enum values, see the command source under `packages/sdk/src/cli/commands/project/`.
@@ -416,7 +424,22 @@ JWT-gated routes at the original unprefixed paths remain for the Command Center.
416
424
 
417
425
  Full CRUD management for client records. The `client:*` family covers create, read, update, and delete operations at `/api/external/clients`.
418
426
 
419
- For complete field definitions, filter options, and relationship semantics, see the [Clients feature documentation](/technical/features/operations/clients).
427
+ **Field definitions** (`ClientProfileSchema` in `@elevasis/core/organization-model`):
428
+
429
+ | Field | Shape |
430
+ | -------------- | ---------------------------------------------------------------------------------------------- |
431
+ | `id` | UUID |
432
+ | `slug` | stable model id |
433
+ | `name` | display label |
434
+ | `status` | `active | onboarding | paused | completed | churned` (default `onboarding`) |
435
+ | `source` | optional lowercase source key |
436
+ | `identity` | `organizationName`, `shortName`, `clientBrief`, `geographicFocus[]`, `timeZone` |
437
+ | `branding` | `voice`, `tagline`, `values[]` |
438
+ | `workspace` | `kind` (`external-project | internal-project | none`), `owner`, `projectId`, `workspacePath` |
439
+ | `links` | `projectIds[]`, `primaryCompanyId`, `primaryContactId`, `sourceDealId` |
440
+ | `prompts` | `defaultContext` |
441
+ | `config` | free-form JSON record |
442
+ | `customValues` | free-form JSON record |
420
443
 
421
444
  **Quick reference:**
422
445
 
@@ -506,12 +529,12 @@ must be exposed as a separate explicit command.
506
529
 
507
530
  **`session:turn` flags:**
508
531
 
509
- | Flag | Description |
510
- | --------------------------- | -------------------------------------------- |
511
- | `-i, --input <json>` | Turn input as JSON |
512
- | `-f, --input-file <path>` | Read turn input from a JSON file |
513
- | `--json` | Output as JSON |
514
- | `--api-url <url>` | Override the API base URL |
532
+ | Flag | Description |
533
+ | --------------------------- | -------------------------------- |
534
+ | `-i, --input <json>` | Turn input as JSON |
535
+ | `-f, --input-file <path>` | Read turn input from a JSON file |
536
+ | `--json` | Output as JSON |
537
+ | `--api-url <url>` | Override the API base URL |
515
538
 
516
539
  **`session:messages` flags:**
517
540
 
@@ -547,7 +570,7 @@ must be exposed as a separate explicit command.
547
570
 
548
571
  ## elevasis-sdk queue:\*
549
572
 
550
- Manage HITL command queue tasks. See the [Command Queue CLI Guide](/technical/development/agent-driven-development/cli-operations) for the full command reference.
573
+ Manage HITL command queue tasks.
551
574
 
552
575
  **Quick reference:**
553
576
 
@@ -583,13 +606,42 @@ elevasis-sdk queue:status --pretty
583
606
  | `--pretty` | Human-readable output instead of raw JSON |
584
607
  | `--api-url <url>` | Override the API base URL |
585
608
 
609
+ **Shared flags (`queue:get`, `queue:expire`, `queue:status`):**
610
+
611
+ | Flag | Description |
612
+ | ------------------- | ----------------------------------------- |
613
+ | `--pretty` | Human-readable output instead of raw JSON |
614
+ | `--api-url <url>` | Override the API base URL |
615
+
586
616
  **Auth:** Calls `/api/external/command-queue/*` with API-key auth.
587
617
 
588
618
  ---
589
619
 
590
620
  ## elevasis-sdk schedule:\*
591
621
 
592
- Manage recurring, relative, and absolute task schedules. See the [Schedule CLI Guide](/technical/development/agent-driven-development/cli-operations) for the full command reference including schedule config JSON shapes.
622
+ Manage recurring, relative, and absolute task schedules. `schedule:create` and `schedule:update --schedule-config` accept raw JSON; the CLI does not parse natural-language or shorthand cron flags.
623
+
624
+ **`--schedule-config` JSON shapes:**
625
+
626
+ ```json
627
+ // recurring, fixed interval
628
+ { "type": "recurring", "interval": "weekly", "time": "09:00", "timezone": "America/Los_Angeles", "payload": {} }
629
+ ```
630
+
631
+ ```json
632
+ // recurring, cron expression
633
+ { "type": "recurring", "cron": "0 9 * * 1", "timezone": "America/Los_Angeles", "payload": {} }
634
+ ```
635
+
636
+ ```json
637
+ // relative to an anchor time
638
+ { "type": "relative", "anchorAt": "2026-06-01T00:00:00Z", "payload": {} }
639
+ ```
640
+
641
+ ```json
642
+ // absolute, one or more fixed run times
643
+ { "type": "absolute", "items": [{ "runAt": "2026-06-01T09:00:00Z", "payload": {}, "label": "Launch" }] }
644
+ ```
593
645
 
594
646
  **Quick reference:**
595
647
 
@@ -623,9 +675,14 @@ At least one field must be provided. `--description` and `--clear-description` a
623
675
 
624
676
  ## elevasis-sdk om:\*
625
677
 
626
- Knowledge map inspection. The `om:*` (Organization Model) commands expose knowledge graph traversal via the CLI.
678
+ Knowledge graph inspection, plus an Organization Model write surface (`om:scaffold:*`, `om:rename`, `om:deprecate`). The `om:*` (Organization Model) commands expose knowledge graph traversal via the CLI. `om:*` and `knowledge:*` are aliases of the same subcommands for the read-only surface described below -- the write commands are registered under `om:*` only, with no `knowledge:*` alias.
627
679
 
628
- For the full command reference, flag details, and graph architecture, see the [knowledge:\* CLI documentation](/technical/features/knowledge/cli-and-skill).
680
+ **Path axes for `knowledge:ls` / `om:ls`:** `/by-system/<id>`, `/by-ontology/<ontologyId>`, `/by-kind/<kind>`, `/by-owner/<ownerId>`, `/by-domain/<domain>` (enumerate all items in a domain: `clients`, `roles`, `policies`, `customers`, `offerings`, `goals`), `/by-item/<domain>/<itemId>` (single domain-item profile), `/graph/<nodeId>/governs`, `/graph/<nodeId>/governed-by`, `/<nodeId>` (single node), `/all-systems`, `/all-resources`, `/all-roles`.
681
+
682
+ - `knowledge:ls <path>` -- list nodes/edges for the mount; default output is an id + summary table, `--json` returns `{ path, mount, args, results }`.
683
+ - `knowledge:cat <id>` -- render a node's `body` MDX to stdout; `--json` returns the full node object (body, links, owners, timestamps).
684
+ - `knowledge:graph <id>` -- show outgoing + incoming edges grouped by edge kind.
685
+ - `om:doctor` -- validate Organization Model integrity against published `@elevasis/core/organization-model` primitives. This is a deliberately reduced 3-check command: two of the monorepo platform CLI's five checks assert monorepo-only paths that do not exist in a tenant project, so they are not ported. `--json` output includes `checksRun: 3` so a caller can tell it apart from the platform CLI's 5-check version.
629
686
 
630
687
  In tenant projects, SDK read commands load `core/config/organization-model.ts` through the SDK's layout-aware TypeScript loader. The temporary bundle and dependency resolution are anchored at the package root that owns SDK dependencies, so hoisted pnpm workspaces resolve `esbuild` and `@elevasis/core` correctly. Missing org-model files still return the default model; malformed files or files with no usable export emit diagnostics. `knowledge:generate` / `om:generate` is the exception because it reads MDX and codegen inputs directly.
631
688
 
@@ -639,6 +696,7 @@ elevasis-sdk knowledge:search <query>
639
696
  elevasis-sdk knowledge:describe <nodeId>
640
697
  elevasis-sdk knowledge:skills <nodeId>
641
698
  elevasis-sdk knowledge:generate
699
+ elevasis-sdk om:doctor --org <OrgName>
642
700
  ```
643
701
 
644
702
  These are registered as `knowledge:*` subcommands on `elevasis-sdk`. Both the SDK CLI (`elevasis-sdk knowledge:*`) and the platform CLI (`elevasis knowledge:*`) call the same query functions in `@repo/core/knowledge/queries`.
@@ -715,6 +773,81 @@ elevasis-sdk knowledge:generate [--source <path>] [--output <path>] [--flags-out
715
773
  elevasis-sdk om:generate
716
774
  ```
717
775
 
776
+ ### om:scaffold:\*
777
+
778
+ Six scaffolders that splice new Organization Model entries into project source files: `om:scaffold:system`, `om:scaffold:resource`, `om:scaffold:role`, `om:scaffold:knowledge`, `om:scaffold:ontology`, `om:scaffold:fill`. There is no `knowledge:scaffold:*` alias.
779
+
780
+ ```bash
781
+ elevasis-sdk om:scaffold:system --id sales.pipeline --title "Sales Pipeline" --kind operational
782
+ elevasis-sdk om:scaffold:resource --id lead-discovery-workflow --system-path sales.pipeline --title "Lead Discovery"
783
+ elevasis-sdk om:scaffold:role --id ops-lead --title "Ops Lead" --responsibility "Own weekly pipeline review"
784
+ elevasis-sdk om:scaffold:knowledge --id outreach-playbook --kind playbook --system-path sales.pipeline
785
+ elevasis-sdk om:scaffold:ontology --id deal --system-path sales.pipeline --kind object
786
+ elevasis-sdk om:scaffold:fill --gaps tmp/conformance-gaps.json
787
+ ```
788
+
789
+ **Default is dry-run.** Every `om:scaffold:*` command previews its change and writes nothing unless `--write` is passed (the one exception, `om:scaffold:ontology`, never writes at all -- see below). This inverted from earlier behavior, where these commands applied by default. An existing invocation that does not pass `--write` now only previews and silently stops applying -- this is the single most important thing to know about this command family.
790
+
791
+ **`--dry-run` is not a flag on any `om:scaffold:*` command.** It exists only as a deprecated programmatic/TypeScript option consumed internally by the handler functions; passing `--dry-run` on the command line is an unrecognized-option error. `om:rename` and `om:deprecate`, documented in the next section, are different commands with their own real `--dry-run` flag -- do not carry that convention over here.
792
+
793
+ **Splice targets:**
794
+
795
+ | Subcommand | Writes |
796
+ | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
797
+ | `om:scaffold:system` | Splices `core/config/organization-model/systems.ts` |
798
+ | `om:scaffold:resource` | Splices `core/config/organization-model/systems.ts` -- **known-broken, see below** |
799
+ | `om:scaffold:role` | Splices `core/config/organization-model/profile.ts` |
800
+ | `om:scaffold:knowledge` | Writes a new `core/config/knowledge/nodes/<id>.mdx` file (no splice) |
801
+ | `om:scaffold:ontology` | Print-only by design -- writes nothing, and carries no `--write` flag |
802
+ | `om:scaffold:fill` | Writes new `core/config/organization-model/api-interfaces/<systemPath>.ts` const files and splices the import + field into `systems.ts` |
803
+
804
+ **`om:scaffold:resource` is currently non-functional against all three real project layouts.** Its splice anchor never received the anchor-scoping fix that landed for `om:scaffold:role` on 2026-08-11, so it still searches for the resource-descriptors closing brace unscoped -- in a real file that closing-brace shape recurs, and it splices into the wrong one, producing invalid TypeScript. The command's own post-write validation catches this and rolls the file back, so it fails safely, but it does not currently produce a usable result. Do not rely on it until the anchor fix ships.
805
+
806
+ **Common flag:**
807
+
808
+ | Flag | Description |
809
+ | --------- | ---------------------------------------------------------------------------- |
810
+ | `--write` | Apply the change. Default (omitted) is a dry-run preview -- no files written |
811
+
812
+ `om:scaffold:ontology` has no `--write` flag; it is always print-only. Each subcommand also has its own identifying flags (`--id`, `--title`, `--system-path`, and so on) -- omit any of them to be prompted interactively. `om:scaffold:fill` is the exception: it is non-interactive and requires `--gaps <path>` pointing at a conformance-gap JSON file.
813
+
814
+ ### om:rename / om:deprecate
815
+
816
+ Plan or apply an Organization Model system rename cascade, or a lifecycle transition (deprecate/archive). Neither has a `knowledge:*` alias.
817
+
818
+ ```bash
819
+ elevasis-sdk om:rename sales.crm sales.pipeline
820
+ elevasis-sdk om:rename sales.crm sales.pipeline --write
821
+
822
+ elevasis-sdk om:deprecate sales.crm --to deprecated
823
+ elevasis-sdk om:deprecate sales.crm --to archived --force --confirm archive:sales.crm --write
824
+ ```
825
+
826
+ **Unlike `om:scaffold:*`, both commands default to preview via a real `--dry-run` flag, not the absence of `--write`.** `--write` applies the edit, regenerates knowledge nodes when needed, and runs `om:doctor`. The two conventions on this page name their default state differently -- `om:scaffold:*` has no flag describing its default at all, while `om:rename` / `om:deprecate` spell it out with `--dry-run` -- so do not assume one family's flag shape from the other.
827
+
828
+ `om:rename` cannot re-parent a system: root-to-nested or nested-to-root moves must be done by hand.
829
+
830
+ **`om:rename <oldPath> <newPath>` flags:**
831
+
832
+ | Flag | Description |
833
+ | ----------- | ------------------------------------------------------------------------ |
834
+ | `--dry-run` | Preview only (default) |
835
+ | `--write` | Apply edits, regenerate knowledge nodes when needed, and run `om:doctor` |
836
+ | `--json` | Output JSON |
837
+
838
+ **`om:deprecate <systemPath>` flags:**
839
+
840
+ | Flag | Description |
841
+ | --------------------- | -------------------------------------------------------------------------- |
842
+ | `--to <lifecycle>` | Target lifecycle: `deprecated` or `archived`. Default: `deprecated` |
843
+ | `--dry-run` | Preview only (default) |
844
+ | `--write` | Apply the lifecycle edit and run `om:doctor` |
845
+ | `--force` | Allow archiving despite live dependents when paired with exact `--confirm` |
846
+ | `--confirm <token>` | Exact archive confirmation token: `archive:<systemPath>` |
847
+ | `--json` | Output JSON |
848
+
849
+ **Implementation:** `packages/sdk/src/cli/commands/om/rename.ts`, `packages/sdk/src/cli/commands/om/deprecate.ts` -- registered in `packages/sdk/src/cli/index.ts`
850
+
718
851
  ---
719
852
 
720
853
  ## elevasis-sdk ui:use-local / ui:use-published
@@ -761,25 +894,25 @@ The same coverage gate runs inside `elevasis-sdk check` when the coverage regist
761
894
 
762
895
  Current status of all SDK CLI domains. Domains marked `deferred` have no CLI commands yet.
763
896
 
764
- | Domain | CLI surface | API surface | Status |
765
- | ----------- | ------------------------------------------------------------------------- | -------------------------------------------------------------- | ----------------------------- |
766
- | platform | top-level SDK commands | mixed platform APIs | implemented |
767
- | project | `project:*` | `apps/api/src/projects/` | implemented |
768
- | knowledge | `knowledge:*` | file/generated knowledge data | implemented |
769
- | creds | `creds *` nested Commander group | credentials API | implemented |
770
- | ui | `ui:*` | local project file edits | implemented |
771
- | request | `request:submit`, `request:list`, `request:get` | requests API | implemented read/write scope |
772
- | error | `error resolve`, `error resolve-execution` | execution error APIs | partial |
773
- | acquisition | `acquisition:list:*`, `acquisition:deal:*` | `/api/external/acquisition/lists*`, `/api/external/deals*` | implemented read-only scope |
774
- | client | `client:*` | `/api/external/clients` | implemented read/write scope |
775
- | agent | `agent:list`, `agent:get` | `/api/external/agents*` | implemented read-only scope |
897
+ | Domain | CLI surface | API surface | Status |
898
+ | ----------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- | ----------------------------- |
899
+ | platform | top-level SDK commands | mixed platform APIs | implemented |
900
+ | project | `project:*` | `apps/api/src/projects/` | implemented |
901
+ | knowledge | `knowledge:*` | file/generated knowledge data | implemented |
902
+ | creds | `creds *` nested Commander group | credentials API | implemented |
903
+ | ui | `ui:*` | local project file edits | implemented |
904
+ | request | `request:submit`, `request:list`, `request:get` | requests API | implemented read/write scope |
905
+ | error | `error resolve`, `error resolve-execution` | execution error APIs | partial |
906
+ | acquisition | `acquisition:list:*`, `acquisition:deal:*` | `/api/external/acquisition/lists*`, `/api/external/deals*` | implemented read-only scope |
907
+ | client | `client:*` | `/api/external/clients` | implemented read/write scope |
908
+ | agent | `agent:list`, `agent:get` | `/api/external/agents*` | implemented read-only scope |
776
909
  | session | `session:create`, `session:turn`, `session:messages`, `session:list`, `session:get`, `session:end` | `/api/external/sessions*` | implemented multi-turn scope |
777
- | queue | `queue:list`, `queue:get`, `queue:select`, `queue:expire`, `queue:status` | `/api/external/command-queue*` | implemented |
778
- | schedule | `schedule:list`, `schedule:get`, `schedule:create`, `schedule:update` | `/api/external/task-scheduler/schedules*` | implemented |
779
- | skill | `skill:scaffold`, `skill:check-coverage` | local CLI catalog and `.claude/registries/skill-coverage.json` | implemented developer tooling |
780
- | content | none | not scoped here | deferred |
781
- | seo | none | not scoped here | deferred |
782
- | monitoring | none | not scoped here | deferred |
910
+ | queue | `queue:list`, `queue:get`, `queue:select`, `queue:expire`, `queue:status` | `/api/external/command-queue*` | implemented |
911
+ | schedule | `schedule:list`, `schedule:get`, `schedule:create`, `schedule:update` | `/api/external/task-scheduler/schedules*` | implemented |
912
+ | skill | `skill:scaffold`, `skill:check-coverage` | local CLI catalog and `.claude/registries/skill-coverage.json` | implemented developer tooling |
913
+ | content | none | not scoped here | deferred |
914
+ | seo | none | not scoped here | deferred |
915
+ | monitoring | none | not scoped here | deferred |
783
916
 
784
917
  ### Promotion Criteria
785
918
 
@@ -792,4 +925,4 @@ A domain should meet all four criteria before gaining a `*:list` / `*:get` surfa
792
925
 
793
926
  ---
794
927
 
795
- **Last Updated:** 2026-05-19
928
+ **Last Updated:** 2026-08-12
@@ -39,11 +39,7 @@ elevasis-sdk check
39
39
  - Relationship declarations referencing non-existent resources
40
40
  - Exits with code 0 on success, code 1 on validation failure
41
41
 
42
- **Flags:**
43
-
44
- | Flag | Description |
45
- | ------------------- | ------------------------- |
46
- | `--api-url <url>` | Override the API base URL |
42
+ `check` declares no `--api-url` flag -- it validates project source locally and never calls the API, so there is no base URL to override.
47
43
 
48
44
  **Example output (success):**
49
45
 
@@ -88,10 +84,10 @@ elevasis-sdk deploy
88
84
 
89
85
  **Flags:**
90
86
 
91
- | Flag | Description |
92
- | ------------------- | ------------------------------------------------------------------------- |
93
- | `--api-url <url>` | Override the API base URL (default: production) |
94
- | `--prod` | Force production target, overriding `NODE_ENV=development` (internal use) |
87
+ | Flag | Description |
88
+ | ------------------- | ---------------------------------------------------------- |
89
+ | `--api-url <url>` | Override the API base URL (default: production) |
90
+ | `--prod` | Force production target, overriding `NODE_ENV=development` |
95
91
 
96
92
  **Environment variables:**
97
93
 
@@ -320,6 +316,84 @@ elevasis-sdk execution onboard-client exec_abc001
320
316
 
321
317
  ---
322
318
 
319
+ ## elevasis-sdk execution:cancel
320
+
321
+ Cancel a running execution.
322
+
323
+ **Synopsis:**
324
+
325
+ ```
326
+ elevasis-sdk execution:cancel <resourceId> <executionId>
327
+ ```
328
+
329
+ **Behavior:**
330
+
331
+ - Calls `POST /api/external/executions/:resourceId/:executionId/cancel`
332
+ - The result reports which method was used: an in-memory signal if the execution's worker process is still reachable, or a database fallback if not
333
+ - A 409 response means the execution is not in a running state -- it already finished. That is a normal race, not a command failure
334
+
335
+ **Flags:**
336
+
337
+ | Flag | Description |
338
+ | ------------------- | ---------------------------------------------------- |
339
+ | `--prod` | Target production (overrides `NODE_ENV=development`) |
340
+ | `--api-url <url>` | Override the API base URL |
341
+ | `--json` | Output raw JSON response |
342
+
343
+ **Example:**
344
+
345
+ ```bash
346
+ elevasis-sdk execution:cancel my-workflow 9c47c944-67eb-4c84-98cb-bb951d05ede3
347
+ ```
348
+
349
+ ```
350
+ Execution cancelled
351
+ Resource: my-workflow
352
+ Execution ID: 9c47c944-67eb-4c84-98cb-bb951d05ede3
353
+ Method: in-memory signal
354
+ ```
355
+
356
+ **Implementation:** `packages/sdk/src/cli/commands/execution-cancel.ts`, registered in `packages/sdk/src/cli/index.ts`
357
+
358
+ ---
359
+
360
+ ## elevasis-sdk executions:delete
361
+
362
+ Delete a resource's execution history (destructive).
363
+
364
+ **Synopsis:**
365
+
366
+ ```
367
+ elevasis-sdk executions:delete <resourceId> [--force]
368
+ ```
369
+
370
+ **Behavior:**
371
+
372
+ - Calls `DELETE /api/external/executions/:resourceId`
373
+ - Requires a typed `DELETE` confirmation at an interactive prompt unless `--force` is passed
374
+ - `--resource-status <status>` (`dev` or `prod`) scopes the delete to runs from one deployment lane only
375
+ - `--json` without `--force` is a hard error -- it throws `executions:delete requires --force when --json is set`, because a JSON caller is assumed non-interactive and there is nothing to answer the confirmation prompt
376
+
377
+ **Flags:**
378
+
379
+ | Flag | Description |
380
+ | ------------------------------ | ------------------------------------------------------------ |
381
+ | `--prod` | Target production (overrides `NODE_ENV=development`) |
382
+ | `--api-url <url>` | Override the API base URL |
383
+ | `--resource-status <status>` | Only delete runs from this deployment lane (`dev` | `prod`) |
384
+ | `--force` | Skip the typed confirmation prompt |
385
+ | `--json` | Output raw JSON response |
386
+
387
+ **Example:**
388
+
389
+ ```bash
390
+ elevasis-sdk executions:delete my-workflow --force
391
+ ```
392
+
393
+ **Implementation:** `packages/sdk/src/cli/commands/executions-delete.ts`, registered in `packages/sdk/src/cli/index.ts`
394
+
395
+ ---
396
+
323
397
  ## elevasis-sdk deployments
324
398
 
325
399
  List all deployments for your organization.
@@ -541,7 +615,8 @@ elevasis-sdk cli [domain] [--format markdown|json]
541
615
  | --------------------- | ----------------------------------------------------------- |
542
616
  | `--domain <domain>` | Filter output to one domain (alternative to positional arg) |
543
617
  | `--format <format>` | Output format: `markdown` (default) or `json` |
544
- | `--api-url <url>` | Override the API base URL |
618
+
619
+ `cli` declares no `--api-url` flag -- it walks the locally registered Commander command graph and never calls the API.
545
620
 
546
621
  **Examples:**
547
622
 
@@ -579,7 +654,7 @@ Check that your Elevasis project is correctly configured.
579
654
  **Synopsis:**
580
655
 
581
656
  ```
582
- elevasis-sdk doctor [--verbose]
657
+ elevasis-sdk doctor [--verbose] [--prod]
583
658
  ```
584
659
 
585
660
  **Behavior:**
@@ -596,6 +671,7 @@ Runs four sequential checks and reports `[OK]` / `[FAIL]` / `[WARN]` for each. E
596
671
  | Flag | Description |
597
672
  | ----------- | ------------------------------------------------------------------- |
598
673
  | `--verbose` | Print full paths, response bodies, and error details for each check |
674
+ | `--prod` | Report against production (overrides `NODE_ENV=development`) |
599
675
 
600
676
  **Example output (all passing):**
601
677
 
@@ -623,14 +699,15 @@ These flags are accepted by all commands:
623
699
  | ------------------- | --------------------------------------------------------------------------------------------------- |
624
700
  | `--api-url <url>` | Override the API base URL. Priority: flag > `ELEVASIS_API_URL` env var > `NODE_ENV`-based default |
625
701
  | `--json` | Output raw JSON (available on most commands) |
702
+ | `--prod` | Target production, overriding `NODE_ENV=development` |
626
703
 
627
704
  **API base URL resolution:**
628
705
 
629
706
  - Production (default): `https://api.elevasis.io`
630
707
  - Development (`NODE_ENV=development`): `http://localhost:<port>`
631
708
  - Override: set `ELEVASIS_API_URL` or pass `--api-url`
632
- - Force production: pass `--prod` on `deploy` (overrides `NODE_ENV=development`)
709
+ - Force production: pass `--prod` after the command name on any authenticated command (overrides `NODE_ENV=development`). Live as of `@elevasis/sdk` 1.45.0; `--api-url https://api.elevasis.io` is the equivalent form on older installs.
633
710
 
634
711
  ---
635
712
 
636
- **Last Updated:** 2026-05-19
713
+ **Last Updated:** 2026-08-12
@@ -75,6 +75,8 @@ The Elevasis SDK uses [Zod](https://zod.dev) for schema definition. Zod is a Typ
75
75
 
76
76
  `z.infer` creates a TypeScript type from a schema so the type system can check your code. You define the schema once and get both runtime validation and compile-time checking. Without it, you would have to define the same shape twice -- once as a Zod schema and once as a TypeScript type.
77
77
 
78
+ {/* doc-snippet:skip: illustrative excerpt -- omits `import { z } from 'zod'` since the point is z.infer's behavior, not a runnable module */}
79
+
78
80
  ```ts
79
81
  const myInput = z.object({ name: z.string(), age: z.number() });
80
82
  type MyInput = z.infer<typeof myInput>;
@@ -0,0 +1,76 @@
1
+ ---
2
+ title: When to Reach for the define* Builders
3
+ description: defineWorkflow, defineStep, defineContract, defineResource, and defineTopology exist for two different reasons -- this page teaches which reason applies before you pick a builder over a plain object literal.
4
+ ---
5
+
6
+ `@elevasis/sdk`'s root export includes a family of `define*` functions: `defineWorkflow`, `defineStep`, `defineContract`, `defineWorkflowConfig`, `defineResource`, `defineResources`, `defineResourceOntology`, `defineTopology`, `defineTopologyRelationship`, plus the `topologyRelationship` / `topologyRef` helpers. Every existing recipe in this bundle teaches the plain object-literal shape instead (a `WorkflowDefinition` written out by hand with a `: WorkflowDefinition` annotation), which is completely valid TypeScript -- but it means the builders are never actually demonstrated, so there is nothing here to tell you when reaching for one buys you something real versus when it is just a different way to write the same object. This page is that judgment call. For the full list of what `@elevasis/sdk` exports, see the [Export Catalog](exports.mdx).
7
+
8
+ The family splits into two groups that do genuinely different things, and the judgment call is different for each.
9
+
10
+ ## Group 1: Workflow Builders Are Type Inference, Not Validation
11
+
12
+ `defineWorkflow`, `defineStep`, and `defineContract` do nothing at runtime. Their entire implementation is an identity function constrained by a generic:
13
+
14
+ {/* doc-snippet:skip: source excerpt (WorkflowDefinition intentionally unimported), not a standalone compilable file */}
15
+
16
+ ```typescript
17
+ export function defineWorkflow<TWorkflow extends WorkflowDefinition>(workflow: TWorkflow): TWorkflow {
18
+ return workflow
19
+ }
20
+ ```
21
+
22
+ `defineStep` and `defineContract` are the same three lines against `WorkflowStep` and `Contract`. Calling one of these does not validate, transform, or check anything beyond what TypeScript's structural typing already does on the argument you pass it.
23
+
24
+ What it buys you is narrower inference. Annotate a literal `const echo: WorkflowDefinition = { ... }` and TypeScript widens every field to the interface's declared type -- `config.resourceId` becomes `string`, not `'echo'`. Pass the same object to `defineWorkflow({ ... })` with no annotation and `TWorkflow` is inferred from the literal you wrote, so `defineWorkflow(...).config.resourceId` keeps the literal type `'echo'`. That distinction only matters if something downstream reads the value back and wants the narrower type -- a test asserting on `resourceId`, a lookup table keyed by it, a second resource that imports the first and needs its literal id. A workflow file that is only ever consumed by the deploy pipeline, which just needs it to satisfy `WorkflowDefinition`, gets nothing extra from the wrapper.
25
+
26
+ That is a real, but narrow, upside -- and it is honestly reflected in what ships. The scaffolded template's own workflow files (`echo.ts`, `email-notification.ts`) use the plain annotated-literal form, not `defineWorkflow`. The builder is real, exported, and demonstrated in the SDK's own test fixtures with exactly the calling convention above -- it is simply not the house style the template ships with. Use the annotated literal by default, matching what a scaffolded project already contains; reach for `defineWorkflow` / `defineStep` / `defineContract` specifically when you want the object's literal types preserved past its own definition.
27
+
28
+ `defineWorkflowConfig` is a different kind of helper in this same group -- it derives `config` fields from an Organization Model resource descriptor instead of preserving literal types. It has its own page: see [The Deployment Spec Pattern](project-deployment-spec.mdx#defineworkflowconfig-deriving-config-from-one-om-descriptor).
29
+
30
+ ## Group 2: Resource and Topology Builders Do Real Work
31
+
32
+ `defineResource`, `defineResources`, `defineResourceOntology`, `defineTopology`, and `defineTopologyRelationship` are a different animal entirely -- each one calls a Zod schema's `.parse()` on its way out:
33
+
34
+ {/* doc-snippet:skip: source excerpt (ResourceEntry/ResourceEntrySchema intentionally unimported), not a standalone compilable file */}
35
+
36
+ ```typescript
37
+ export function defineResource<const TResource extends ResourceEntry>(resource: TResource): TResource {
38
+ return ResourceEntrySchema.parse(resource) as TResource
39
+ }
40
+ ```
41
+
42
+ A hand-typed object that satisfies the `ResourceEntry` TypeScript interface skips that check entirely at the point you write it. It is not unvalidated forever -- the whole Organization Model gets parsed eventually -- but a mistake surfaces later, at whole-model validation, as a less specific error than the one `defineResource` would have raised on the exact line that defined the bad resource.
43
+
44
+ `defineTopology` and `defineTopologyRelationship` go a step further: they compile human-authored references into the canonical shape the graph actually stores. A relationship's `from` / `to` can be written as an already-typed node ref, or as a resource descriptor object handed to you by another part of the model -- `compileTopologyNodeRef` resolves either into the canonical `{ kind, id }` form. This is not something a plain object literal can replicate without reimplementing that resolution step by hand:
45
+
46
+ {/* doc-snippet:skip: illustrative excerpt (someWorkflowResourceDescriptor intentionally undefined), not a standalone compilable file */}
47
+
48
+ ```typescript
49
+ import { defineTopology, topologyRef, topologyRelationship } from '@elevasis/sdk'
50
+
51
+ const topology = defineTopology({
52
+ 'trigger-handles-webhook': topologyRelationship.triggers(
53
+ topologyRef.trigger('inbound-webhook'),
54
+ someWorkflowResourceDescriptor, // a resource object, resolved for you
55
+ { systemPath: 'sales.lead-gen', required: true }
56
+ )
57
+ })
58
+ ```
59
+
60
+ For this group, reaching for the builder is not a style preference -- it is the only path that gets you both the validation and the reference compilation. Do not hand-author the parsed topology shape (`{ from: { kind: 'resource', id: '...' }, to: ... }`) directly; author against the helpers and let them produce it.
61
+
62
+ **Tenant caveat:** these builders live in the Organization Model authoring layer. In a template-based project, `core/config/organization-model.ts` and its split sibling files are edited through the `/om` command, not by hand -- so day to day you are unlikely to call `defineResource` or `defineTopology` yourself even though they are part of the published surface. Understanding what they do is still useful: it is why hand-editing those files instead of going through `/om` is risky, since you would be reproducing Zod validation and reference compilation by hand and likely getting one of them wrong.
63
+
64
+ ## Quick Decision Guide
65
+
66
+ - Writing a workflow, step, or contract, and nothing downstream needs the literal types back -- use the plain annotated object literal. This is what the scaffolded template ships.
67
+ - Writing a workflow, step, or contract, and something downstream reads the value back and needs its literal types preserved -- wrap it in `defineWorkflow` / `defineStep` / `defineContract`.
68
+ - Deriving a workflow's `config` from an OM resource descriptor that already has `ontology.primaryAction` set -- use `defineWorkflowConfig`.
69
+ - Authoring an Organization Model resource, resource ontology binding, or topology relationship directly (Elevasis's own workspace-internal model, or inside the tooling `/om` itself runs) -- always use `defineResource` / `defineResourceOntology` / `defineTopology` / `defineTopologyRelationship`, never the raw parsed shape.
70
+ - Authoring a tenant project's own Organization Model -- go through `/om`; you generally will not call the Group 2 builders yourself.
71
+
72
+ ## Documentation
73
+
74
+ - [Export Catalog](exports.mdx) -- the generated, per-subpath inventory of everything `@elevasis/sdk` exports
75
+ - [Resources](resources/index.mdx) -- the `WorkflowDefinition` / `AgentDefinition` shape these builders wrap
76
+ - [The Deployment Spec Pattern](project-deployment-spec.mdx) -- `defineWorkflowConfig` and `projectDeploymentSpec` in context
@@ -54,6 +54,8 @@ Every resource you deploy becomes a node in the graph. Some nodes are executable
54
54
 
55
55
  Relationships are edges in the graph. Declare them in `DeploymentSpec`:
56
56
 
57
+ {/* doc-snippet:skip: illustrative excerpt -- DeploymentSpec, scoreLeadWorkflow, sendProposalWorkflow are shown as already-defined resources from elsewhere in the project, not a standalone compilable file */}
58
+
57
59
  ```typescript
58
60
  const org: DeploymentSpec = {
59
61
  workflows: [scoreLeadWorkflow, sendProposalWorkflow],
@@ -126,7 +128,9 @@ The Command Queue surfaces all pending Human-in-the-Loop (HITL) approval request
126
128
  - Approve or reject with an optional comment
127
129
  - See the history of past decisions
128
130
 
129
- **How it connects to your code:** Approval requests appear when a workflow step calls `approval.create()`. The workflow pauses at that step and waits for a decision.
131
+ **How it connects to your code:** Approval requests appear when a workflow step calls `approval.create()`. The step then **completes normally — the workflow does not pause.** Resolving the request later triggers a **new** execution of whichever resource the selected action's `target` names. Structure the work accordingly: everything that must happen after the decision belongs in that target resource, not in later steps of the workflow that raised the request.
132
+
133
+ {/* doc-snippet:skip: illustrative excerpt -- dealId/proposalUrl are shorthand for values from the enclosing step handler's input, not a standalone compilable file */}
130
134
 
131
135
  ```typescript
132
136
  import { approval } from '@elevasis/sdk/worker'
@@ -141,7 +145,7 @@ const task = await approval.create({
141
145
  })
142
146
  ```
143
147
 
144
- > **SDK takeaway:** Use `approval.create()` to create approval gates. Provide rich `context` so reviewers have what they need to decide.
148
+ > **SDK takeaway:** Use `approval.create()` to raise an approval request, and put the post-decision work in the resource each action targets. Provide rich `context` so reviewers have what they need to decide. See [Human-in-the-Loop Workflows](../human-in-the-loop.mdx) for the full path from workflow to checkpoint to queue resolution.
145
149
 
146
150
  ---
147
151