@elevasis/sdk 1.20.2 → 1.22.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 (164) hide show
  1. package/dist/cli.cjs +4220 -1583
  2. package/dist/index.d.ts +1035 -481
  3. package/dist/index.js +7381 -4187
  4. package/dist/node/index.d.ts +1 -3
  5. package/dist/node/index.js +40 -49
  6. package/dist/test-utils/index.d.ts +699 -123
  7. package/dist/test-utils/index.js +3826 -630
  8. package/dist/worker/index.js +3616 -442
  9. package/package.json +3 -3
  10. package/reference/_navigation.md +9 -7
  11. package/reference/_reference-manifest.json +1 -1
  12. package/reference/claude-config/hooks/post-edit-validate.mjs +98 -98
  13. package/reference/claude-config/hooks/scaffold-registry-reminder.mjs +188 -188
  14. package/reference/claude-config/hooks/tool-failure-recovery.mjs +73 -73
  15. package/reference/claude-config/registries/graph-skills.json +4 -4
  16. package/reference/claude-config/registries/knowledge-flags.json +0 -2
  17. package/reference/claude-config/rules/active-change-index.md +80 -80
  18. package/reference/claude-config/rules/agent-start-here.md +277 -273
  19. package/reference/claude-config/rules/deployment.md +57 -57
  20. package/reference/claude-config/rules/error-handling.md +56 -56
  21. package/reference/claude-config/rules/execution.md +40 -40
  22. package/reference/claude-config/rules/frontend.md +4 -4
  23. package/reference/claude-config/rules/observability.md +31 -31
  24. package/reference/claude-config/rules/operations.md +29 -17
  25. package/reference/claude-config/rules/organization-model.md +108 -40
  26. package/reference/claude-config/rules/organization-os.md +115 -113
  27. package/reference/claude-config/rules/package-taxonomy.md +33 -33
  28. package/reference/claude-config/rules/platform.md +42 -42
  29. package/reference/claude-config/rules/shared-types.md +49 -46
  30. package/reference/claude-config/rules/task-tracking.md +47 -47
  31. package/reference/claude-config/rules/ui.md +200 -200
  32. package/reference/claude-config/rules/vibe.md +235 -231
  33. package/reference/claude-config/scripts/statusline-command.js +18 -18
  34. package/reference/claude-config/settings.json +34 -34
  35. package/reference/claude-config/skills/deploy/{SKILL.md → skill.md} +156 -156
  36. package/reference/claude-config/skills/dsp/SKILL.md +66 -66
  37. package/reference/claude-config/skills/elevasis/SKILL.md +235 -235
  38. package/reference/claude-config/skills/explore/SKILL.md +6 -6
  39. package/reference/claude-config/skills/git-sync/SKILL.md +126 -126
  40. package/reference/claude-config/skills/knowledge/SKILL.md +330 -271
  41. package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +100 -100
  42. package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +159 -158
  43. package/reference/claude-config/skills/knowledge/operations/customers.md +109 -109
  44. package/reference/claude-config/skills/knowledge/operations/features.md +76 -113
  45. package/reference/claude-config/skills/knowledge/operations/goals.md +118 -118
  46. package/reference/claude-config/skills/knowledge/operations/identity.md +93 -93
  47. package/reference/claude-config/skills/knowledge/operations/labels.md +94 -89
  48. package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -109
  49. package/reference/claude-config/skills/knowledge/operations/roles.md +99 -99
  50. package/reference/claude-config/skills/knowledge/operations/techStack.md +30 -30
  51. package/reference/claude-config/skills/project/SKILL.md +1088 -1088
  52. package/reference/claude-config/skills/run-ui/SKILL.md +73 -73
  53. package/reference/claude-config/skills/save/SKILL.md +3 -3
  54. package/reference/claude-config/skills/setup/SKILL.md +275 -275
  55. package/reference/claude-config/skills/status/SKILL.md +59 -59
  56. package/reference/claude-config/skills/submit-request/SKILL.md +180 -180
  57. package/reference/claude-config/skills/sync/SKILL.md +47 -47
  58. package/reference/claude-config/skills/tutorial/SKILL.md +259 -259
  59. package/reference/claude-config/skills/tutorial/progress-template.md +74 -74
  60. package/reference/claude-config/skills/tutorial/technical.md +1303 -1306
  61. package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -890
  62. package/reference/claude-config/sync-notes/2026-04-22-git-sync-and-sync-notes.md +27 -27
  63. package/reference/claude-config/sync-notes/2026-04-22-lead-gen-deliverability-removal.md +30 -30
  64. package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +73 -73
  65. package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +86 -86
  66. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +55 -55
  67. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +97 -97
  68. package/reference/claude-config/sync-notes/2026-04-27-lead-gen-substrate-train.md +112 -112
  69. package/reference/claude-config/sync-notes/2026-04-29-crm-state-and-lead-gen-processing-status.md +93 -93
  70. package/reference/claude-config/sync-notes/2026-05-02-crm-ownership-next-action.md +58 -58
  71. package/reference/claude-config/sync-notes/2026-05-02-template-hardcode-workos-config.md +56 -56
  72. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -71
  73. package/reference/claude-config/sync-notes/2026-05-04-knowledge-bundle.md +83 -83
  74. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -59
  75. package/reference/claude-config/sync-notes/2026-05-05-list-builder.md +42 -42
  76. package/reference/claude-config/sync-notes/2026-05-06-crm-spine.md +60 -60
  77. package/reference/claude-config/sync-notes/2026-05-06-sdk-changes-release-train.md +37 -37
  78. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -34
  79. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -38
  80. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -32
  81. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -33
  82. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -69
  83. package/reference/claude-config/sync-notes/2026-05-12-sdk-ready-release-train.md +30 -0
  84. package/reference/claude-config/sync-notes/2026-05-14-organization-model-ontology-refactor.md +42 -0
  85. package/reference/claude-config/sync-notes/README.md +43 -43
  86. package/reference/cli.mdx +808 -668
  87. package/reference/concepts.mdx +146 -146
  88. package/reference/deployment/api.mdx +297 -297
  89. package/reference/deployment/command-center.mdx +209 -209
  90. package/reference/deployment/index.mdx +195 -195
  91. package/reference/deployment/provided-features.mdx +107 -93
  92. package/reference/deployment/ui-execution.mdx +250 -250
  93. package/reference/examples/organization-model.ts +147 -84
  94. package/reference/framework/agent.mdx +156 -156
  95. package/reference/framework/index.mdx +195 -195
  96. package/reference/framework/interaction-guidance.mdx +182 -182
  97. package/reference/framework/memory.mdx +326 -326
  98. package/reference/framework/project-structure.mdx +282 -282
  99. package/reference/framework/tutorial-system.mdx +135 -135
  100. package/reference/getting-started.mdx +142 -142
  101. package/reference/index.mdx +106 -106
  102. package/reference/packages/core/src/README.md +14 -14
  103. package/reference/packages/core/src/business/README.md +2 -2
  104. package/reference/packages/core/src/knowledge/README.md +33 -32
  105. package/reference/packages/core/src/organization-model/README.md +149 -109
  106. package/reference/packages/core/src/test-utils/README.md +37 -37
  107. package/reference/packages/ui/src/api/README.md +18 -18
  108. package/reference/packages/ui/src/app/README.md +24 -24
  109. package/reference/packages/ui/src/auth/README.md +18 -18
  110. package/reference/packages/ui/src/components/README.md +24 -24
  111. package/reference/packages/ui/src/execution/README.md +16 -16
  112. package/reference/packages/ui/src/features/README.md +28 -28
  113. package/reference/packages/ui/src/graph/README.md +16 -16
  114. package/reference/packages/ui/src/hooks/README.md +23 -23
  115. package/reference/packages/ui/src/initialization/README.md +19 -19
  116. package/reference/packages/ui/src/knowledge/README.md +31 -31
  117. package/reference/packages/ui/src/organization/README.md +18 -18
  118. package/reference/packages/ui/src/profile/README.md +19 -19
  119. package/reference/packages/ui/src/provider/README.md +32 -32
  120. package/reference/packages/ui/src/router/README.md +18 -18
  121. package/reference/packages/ui/src/sse/README.md +13 -13
  122. package/reference/packages/ui/src/test-utils/README.md +7 -7
  123. package/reference/packages/ui/src/theme/README.md +23 -23
  124. package/reference/packages/ui/src/theme/presets/README.md +19 -19
  125. package/reference/packages/ui/src/types/README.md +16 -16
  126. package/reference/packages/ui/src/utils/README.md +18 -18
  127. package/reference/packages/ui/src/zustand/README.md +18 -18
  128. package/reference/platform-tools/adapters-integration.mdx +301 -301
  129. package/reference/platform-tools/adapters-platform.mdx +553 -553
  130. package/reference/platform-tools/index.mdx +217 -217
  131. package/reference/platform-tools/type-safety.mdx +82 -82
  132. package/reference/resources/index.mdx +349 -349
  133. package/reference/resources/patterns.mdx +449 -449
  134. package/reference/resources/types.mdx +116 -116
  135. package/reference/roadmap.mdx +165 -165
  136. package/reference/runtime.mdx +173 -173
  137. package/reference/scaffold/core/organization-graph.mdx +110 -89
  138. package/reference/scaffold/core/organization-model.mdx +226 -171
  139. package/reference/scaffold/index.mdx +67 -67
  140. package/reference/scaffold/operations/propagation-pipeline.md +77 -77
  141. package/reference/scaffold/operations/scaffold-maintenance.md +10 -10
  142. package/reference/scaffold/operations/workflow-recipes.md +138 -138
  143. package/reference/scaffold/recipes/add-a-feature.md +310 -88
  144. package/reference/scaffold/recipes/add-a-resource.md +137 -117
  145. package/reference/scaffold/recipes/customize-crm-actions.md +439 -439
  146. package/reference/scaffold/recipes/customize-knowledge-browser.md +384 -0
  147. package/reference/scaffold/recipes/customize-organization-model.md +281 -118
  148. package/reference/scaffold/recipes/extend-a-base-entity.md +8 -8
  149. package/reference/scaffold/recipes/extend-crm.md +40 -39
  150. package/reference/scaffold/recipes/extend-lead-gen.md +400 -401
  151. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +118 -114
  152. package/reference/scaffold/recipes/index.md +47 -46
  153. package/reference/scaffold/recipes/query-the-knowledge-graph.md +227 -0
  154. package/reference/scaffold/reference/contracts.md +2389 -2121
  155. package/reference/scaffold/reference/feature-registry.md +9 -20
  156. package/reference/scaffold/reference/glossary.md +76 -76
  157. package/reference/scaffold/ui/composition-extensibility.mdx +233 -233
  158. package/reference/scaffold/ui/customization.md +243 -243
  159. package/reference/scaffold/ui/feature-flags-and-gating.md +46 -46
  160. package/reference/scaffold/ui/feature-shell.mdx +72 -72
  161. package/reference/scaffold/ui/recipes.md +221 -213
  162. package/reference/spine/spine-primer.md +96 -96
  163. package/reference/templates/index.mdx +47 -47
  164. package/reference/troubleshooting.mdx +223 -223
@@ -1,57 +1,57 @@
1
- ---
2
- description: Deployment workflow -- check-first, dev vs prod, version bumping, common errors
3
- paths:
4
- - operations/**
5
- ---
6
-
7
- # Deployment
8
-
9
- ## Always Check Before Deploy
10
-
11
- ```bash
12
- pnpm -C operations run check # Validate resource definitions
13
- pnpm -C operations run check-types # TypeScript type-check
14
- pnpm -C operations run deploy # Deploy to dev (only after both pass)
15
- ```
16
-
17
- `check` catches duplicate resource IDs, OM descriptor/code mismatches, invalid step chains, broken relationships, and schema serialization issues. Same validation runs during deploy -- if `check` passes, deploy validation will pass.
18
-
19
- ## Dev vs Prod
20
-
21
- | Command | Target | When |
22
- | ------------------------------------ | ----------------- | ----------------------- |
23
- | `pnpm -C operations run deploy` | Local dev API | Development and testing |
24
- | `pnpm -C operations run deploy:prod` | `api.elevasis.io` | Production release |
25
-
26
- Always test in dev first, verify with `elevasis-sdk exec`, then deploy to prod.
27
-
28
- ## Version Bumping
29
-
30
- Deploy accepts `--major`, `--minor`, `--patch` flags to bump the deployment version. The bumped version is written back to `src/index.ts`. Bump on contract changes (input/output schema modifications).
31
-
32
- ## What Gets Deployed
33
-
34
- 1. **Bundle:** esbuild compiles `src/index.ts` + all dependencies into a single self-contained CJS file. No `node_modules` needed at runtime.
35
- 2. **Metadata:** Resource definitions, OM Resources descriptor bindings, Zod schemas (converted to JSON Schema), relationships, triggers.
36
-
37
- ## Environment
38
-
39
- - `ELEVASIS_PLATFORM_KEY` in `.env` is required for CLI auth
40
- - `.env` is never included in the bundle -- it stays local
41
- - Integration credentials live in Command Center, not `.env`
42
-
43
- ## Common Errors
44
-
45
- | Error | Fix |
46
- | ---------------------------------------- | ------------------------------------------------------- |
47
- | `401: Invalid API key` | Check `ELEVASIS_PLATFORM_KEY` in `.env` |
48
- | `Duplicate resource ID` | Fix the duplicated OM Resource descriptor ID, then derive runtime `resourceId` from that descriptor |
49
- | `Missing OM Resource descriptor` | Add the descriptor to `core/config/organization-model.ts` under `resources.entries` |
50
- | `Step references non-existent next step` | Fix the `next:` field in the step chain |
51
- | `Schema serialization failed` | Simplify the Zod schema (warning, still deploys) |
52
- | `No default export found` | `src/index.ts` must `export default` a `DeploymentSpec` |
53
- | `Documentation file exceeds 100KB` | Split the `.md` file |
54
-
55
- ## Deployment Replaces Previous
56
-
57
- Only one deployment can be `active` at a time. Deploying again automatically marks the previous deployment as `stopped`. Resources become executable immediately after deploy succeeds.
1
+ ---
2
+ description: Deployment workflow -- check-first, dev vs prod, version bumping, common errors
3
+ paths:
4
+ - operations/**
5
+ ---
6
+
7
+ # Deployment
8
+
9
+ ## Always Check Before Deploy
10
+
11
+ ```bash
12
+ pnpm -C operations run check # Validate resource definitions
13
+ pnpm -C operations run check-types # TypeScript type-check
14
+ pnpm -C operations run deploy # Deploy to dev (only after both pass)
15
+ ```
16
+
17
+ `check` catches duplicate resource IDs, OM descriptor/code mismatches, invalid step chains, broken relationships, and schema serialization issues. Same validation runs during deploy -- if `check` passes, deploy validation will pass.
18
+
19
+ ## Dev vs Prod
20
+
21
+ | Command | Target | When |
22
+ | ------------------------------------ | ----------------- | ----------------------- |
23
+ | `pnpm -C operations run deploy` | Local dev API | Development and testing |
24
+ | `pnpm -C operations run deploy:prod` | `api.elevasis.io` | Production release |
25
+
26
+ Always test in dev first, verify with `elevasis-sdk exec`, then deploy to prod.
27
+
28
+ ## Version Bumping
29
+
30
+ Deploy accepts `--major`, `--minor`, `--patch` flags to bump the deployment version. The bumped version is written back to `src/index.ts`. Bump on contract changes (input/output schema modifications).
31
+
32
+ ## What Gets Deployed
33
+
34
+ 1. **Bundle:** esbuild compiles `src/index.ts` + all dependencies into a single self-contained CJS file. No `node_modules` needed at runtime.
35
+ 2. **Metadata:** Resource definitions, OM Resources descriptor bindings, Zod schemas (converted to JSON Schema), relationships, triggers.
36
+
37
+ ## Environment
38
+
39
+ - `ELEVASIS_PLATFORM_KEY` in `.env` is required for CLI auth
40
+ - `.env` is never included in the bundle -- it stays local
41
+ - Integration credentials live in Command Center, not `.env`
42
+
43
+ ## Common Errors
44
+
45
+ | Error | Fix |
46
+ | ---------------------------------------- | ------------------------------------------------------- |
47
+ | `401: Invalid API key` | Check `ELEVASIS_PLATFORM_KEY` in `.env` |
48
+ | `Duplicate resource ID` | Fix the duplicated OM Resource descriptor ID, then derive runtime `resourceId` from that descriptor |
49
+ | `Missing OM Resource descriptor` | Add the descriptor to `core/config/organization-model.ts` under the id-keyed `resources` map |
50
+ | `Step references non-existent next step` | Fix the `next:` field in the step chain |
51
+ | `Schema serialization failed` | Simplify the Zod schema (warning, still deploys) |
52
+ | `No default export found` | `src/index.ts` must `export default` a `DeploymentSpec` |
53
+ | `Documentation file exceeds 100KB` | Split the `.md` file |
54
+
55
+ ## Deployment Replaces Previous
56
+
57
+ Only one deployment can be `active` at a time. Deploying again automatically marks the previous deployment as `stopped`. Resources become executable immediately after deploy succeeds.
@@ -1,56 +1,56 @@
1
- ---
2
- description: Error handling -- ExecutionError vs PlatformToolError, retry logic, no auto-retry
3
- paths:
4
- - operations/**
5
- ---
6
-
7
- # Error Handling
8
-
9
- ## Error Types
10
-
11
- Two error classes from `@elevasis/sdk`:
12
-
13
- **`ExecutionError`** -- base class for workflow/step failures.
14
-
15
- ```typescript
16
- import { ExecutionError } from '@elevasis/sdk'
17
-
18
- throw new ExecutionError('Payment processing failed', {
19
- context: { invoiceId: '123', amount: 500 }
20
- })
21
- ```
22
-
23
- **`PlatformToolError`** -- thrown by `platform.call()` and typed adapters.
24
-
25
- ```typescript
26
- import { PlatformToolError } from '@elevasis/sdk'
27
-
28
- try {
29
- await attio.createRecord({ ... })
30
- } catch (err) {
31
- if (err instanceof PlatformToolError && err.retryable) {
32
- // Transient error (rate limit, timeout, network) -- safe to retry
33
- } else {
34
- // Permanent error (invalid credentials, bad input) -- don't retry
35
- }
36
- }
37
- ```
38
-
39
- ## No Auto-Retry
40
-
41
- The platform does NOT automatically retry failed steps. Your handler is responsible for retry logic. Check `PlatformToolError.retryable` to decide whether retrying is safe.
42
-
43
- ## Error Visibility
44
-
45
- - Unhandled exceptions in handlers surface directly to CLI output and AI Studio.
46
- - Use `context.logger.error()` to log errors -- `console.error()` is NOT captured by the platform.
47
- - Write clear, descriptive error messages -- they're the primary debugging signal for end users.
48
-
49
- ## Common PlatformToolError Codes
50
-
51
- | Code | Retryable | Cause |
52
- | --------------------- | --------- | --------------------------------- |
53
- | `rate_limit_exceeded` | Yes | Integration API rate limit hit |
54
- | `timeout_error` | Yes | Integration call timed out |
55
- | `credentials_invalid` | No | Credential not found or expired |
56
- | `validation_error` | No | Invalid parameters passed to tool |
1
+ ---
2
+ description: Error handling -- ExecutionError vs PlatformToolError, retry logic, no auto-retry
3
+ paths:
4
+ - operations/**
5
+ ---
6
+
7
+ # Error Handling
8
+
9
+ ## Error Types
10
+
11
+ Two error classes from `@elevasis/sdk`:
12
+
13
+ **`ExecutionError`** -- base class for workflow/step failures.
14
+
15
+ ```typescript
16
+ import { ExecutionError } from '@elevasis/sdk'
17
+
18
+ throw new ExecutionError('Payment processing failed', {
19
+ context: { invoiceId: '123', amount: 500 }
20
+ })
21
+ ```
22
+
23
+ **`PlatformToolError`** -- thrown by `platform.call()` and typed adapters.
24
+
25
+ ```typescript
26
+ import { PlatformToolError } from '@elevasis/sdk'
27
+
28
+ try {
29
+ await attio.createRecord({ ... })
30
+ } catch (err) {
31
+ if (err instanceof PlatformToolError && err.retryable) {
32
+ // Transient error (rate limit, timeout, network) -- safe to retry
33
+ } else {
34
+ // Permanent error (invalid credentials, bad input) -- don't retry
35
+ }
36
+ }
37
+ ```
38
+
39
+ ## No Auto-Retry
40
+
41
+ The platform does NOT automatically retry failed steps. Your handler is responsible for retry logic. Check `PlatformToolError.retryable` to decide whether retrying is safe.
42
+
43
+ ## Error Visibility
44
+
45
+ - Unhandled exceptions in handlers surface directly to CLI output and AI Studio.
46
+ - Use `context.logger.error()` to log errors -- `console.error()` is NOT captured by the platform.
47
+ - Write clear, descriptive error messages -- they're the primary debugging signal for end users.
48
+
49
+ ## Common PlatformToolError Codes
50
+
51
+ | Code | Retryable | Cause |
52
+ | --------------------- | --------- | --------------------------------- |
53
+ | `rate_limit_exceeded` | Yes | Integration API rate limit hit |
54
+ | `timeout_error` | Yes | Integration call timed out |
55
+ | `credentials_invalid` | No | Credential not found or expired |
56
+ | `validation_error` | No | Invalid parameters passed to tool |
@@ -1,40 +1,40 @@
1
- ---
2
- description: Execution model -- timeouts, memory, concurrency, org isolation, runtime constraints
3
- paths:
4
- - operations/**
5
- ---
6
-
7
- # Execution Model
8
-
9
- ## Runtime Environment
10
-
11
- Each execution runs in an isolated Node.js worker thread spawned from the deployed bundle. Workers are ephemeral -- created on execution start, terminated on completion. No state persists between executions.
12
-
13
- ## Constraints
14
-
15
- | Constraint | Workflows | Agents |
16
- | ---------- | ------------------------------- | ----------------------------------------------------- |
17
- | Timeout | 300s (5 min) | 600s (10 min, configurable via `constraints.timeout`) |
18
- | Memory | 256MB hard limit | 256MB hard limit |
19
- | Disk | None (no persistent filesystem) | None |
20
-
21
- - Platform enforces timeouts -- no handler code needed, worker terminates automatically.
22
- - Memory overflow crashes the worker. Other tenants are unaffected.
23
- - For long-running tasks, break work into multiple steps or use agents with extended timeout.
24
-
25
- ## Concurrency
26
-
27
- Concurrent executions for the same organization run in completely separate workers with zero shared state. No locking, no race conditions between executions.
28
-
29
- ## Organization Isolation
30
-
31
- - `organizationId` is injected server-side from the JWT context -- workers never see it.
32
- - Storage paths are automatically org-prefixed.
33
- - Resource IDs are scoped per organization (not global).
34
- - External developers cannot access other organizations' data by construction.
35
-
36
- No developer action needed for multi-tenancy -- the platform handles it.
37
-
38
- ## Cancellation
39
-
40
- The platform can cancel in-flight executions. The worker terminates immediately with no cleanup handler.
1
+ ---
2
+ description: Execution model -- timeouts, memory, concurrency, org isolation, runtime constraints
3
+ paths:
4
+ - operations/**
5
+ ---
6
+
7
+ # Execution Model
8
+
9
+ ## Runtime Environment
10
+
11
+ Each execution runs in an isolated Node.js worker thread spawned from the deployed bundle. Workers are ephemeral -- created on execution start, terminated on completion. No state persists between executions.
12
+
13
+ ## Constraints
14
+
15
+ | Constraint | Workflows | Agents |
16
+ | ---------- | ------------------------------- | ----------------------------------------------------- |
17
+ | Timeout | 300s (5 min) | 600s (10 min, configurable via `constraints.timeout`) |
18
+ | Memory | 256MB hard limit | 256MB hard limit |
19
+ | Disk | None (no persistent filesystem) | None |
20
+
21
+ - Platform enforces timeouts -- no handler code needed, worker terminates automatically.
22
+ - Memory overflow crashes the worker. Other tenants are unaffected.
23
+ - For long-running tasks, break work into multiple steps or use agents with extended timeout.
24
+
25
+ ## Concurrency
26
+
27
+ Concurrent executions for the same organization run in completely separate workers with zero shared state. No locking, no race conditions between executions.
28
+
29
+ ## Organization Isolation
30
+
31
+ - `organizationId` is injected server-side from the JWT context -- workers never see it.
32
+ - Storage paths are automatically org-prefixed.
33
+ - Resource IDs are scoped per organization (not global).
34
+ - External developers cannot access other organizations' data by construction.
35
+
36
+ No developer action needed for multi-tenancy -- the platform handles it.
37
+
38
+ ## Cancellation
39
+
40
+ The platform can cancel in-flight executions. The worker terminates immediately with no cleanup handler.
@@ -17,8 +17,8 @@ paths:
17
17
  ## Silent-Break Gotchas
18
18
 
19
19
  - Route files vs layout files: `operations.tsx` is a layout (renders `<Outlet />`), `operations/my-page.index.tsx` is a page. Confusing the two breaks routing silently
20
- - `core/` cannot import React or `@elevasis/sdk/worker` -- it is runtime-agnostic shared types and organization configuration only
21
- - `@/*` resolves to `ui/src/*`, `@core/*` resolves to `core/*` -- never import from `operations/` (separate runtime)
20
+ - `core/` cannot import React or `@elevasis/sdk/worker` -- it is runtime-agnostic shared types and organization configuration only
21
+ - `@/*` resolves to `ui/src/*`, `@core/*` resolves to `core/*` -- never import from `operations/` (separate runtime)
22
22
 
23
23
  ## Stack Constraints
24
24
 
@@ -36,8 +36,8 @@ When building pages that display external data, use published `@elevasis/ui` com
36
36
  ## Detailed Reference
37
37
 
38
38
  - `node_modules/@elevasis/sdk/reference/scaffold/ui/recipes.md` -- add a page, add a nav item, theme tokens, feature-scoped components, route patterns (static, nested, dynamic)
39
- - `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md` -- `featureKey` / `FeatureGuard` / `AdminGuard` model
39
+ - `node_modules/@elevasis/sdk/reference/scaffold/ui/feature-flags-and-gating.md` -- `systemKey` / `SystemGuard` / `AdminGuard` model
40
40
  - `node_modules/@elevasis/sdk/reference/scaffold/ui/customization.md` -- sidebar composition via manifest overrides
41
- - `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` -- TypeScript shapes (`FeatureModule`, `NavItem`, `OrganizationModel`)
41
+ - `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md` -- TypeScript shapes (`SystemModule`, `NavItem`, `OrganizationModel`)
42
42
  - `ui/src/config/theme.ts` -- theme configuration and CSS variable definitions
43
43
  - `ui/src/config/nav-items.ts` -- sidebar navigation entries
@@ -1,31 +1,31 @@
1
- ---
2
- description: Observability -- context.logger API, execution inspection, step-level context
3
- paths:
4
- - operations/**
5
- ---
6
-
7
- # Observability
8
-
9
- ## Safety Invariants
10
-
11
- - Use `context.logger` for all logging in step handlers -- `console.*` is NOT captured by the platform
12
- - Log levels: `debug` (verbose), `info` (normal progress), `warn` (non-fatal, processing continues), `error` (fatal, processing stops)
13
- - Step lifecycle events (started, completed, failed, route taken) are auto-logged by the SDK worker -- no handler code needed
14
-
15
- ## Key Rules
16
-
17
- - Every handler should log at: entry (step name + key params), decisions (skips, branches), progress (per-item in loops), summary (counts at end)
18
- - Error messages in handlers surface as the execution's error message -- write for humans, not machines
19
- - String values truncated at 200 characters in logs
20
- - 30-day log retention (includes logs from deleted resources)
21
-
22
- ## Inspecting Executions
23
-
24
- ```bash
25
- pnpm elevasis-sdk execution <resourceId> <executionId>
26
- pnpm elevasis-sdk executions <resourceId>
27
- ```
28
-
29
- ## Detailed Reference
30
-
31
- - `node_modules/@elevasis/sdk/reference/scaffold/operations/workflow-recipes.md` -- full logging patterns and handler examples
1
+ ---
2
+ description: Observability -- context.logger API, execution inspection, step-level context
3
+ paths:
4
+ - operations/**
5
+ ---
6
+
7
+ # Observability
8
+
9
+ ## Safety Invariants
10
+
11
+ - Use `context.logger` for all logging in step handlers -- `console.*` is NOT captured by the platform
12
+ - Log levels: `debug` (verbose), `info` (normal progress), `warn` (non-fatal, processing continues), `error` (fatal, processing stops)
13
+ - Step lifecycle events (started, completed, failed, route taken) are auto-logged by the SDK worker -- no handler code needed
14
+
15
+ ## Key Rules
16
+
17
+ - Every handler should log at: entry (step name + key params), decisions (skips, branches), progress (per-item in loops), summary (counts at end)
18
+ - Error messages in handlers surface as the execution's error message -- write for humans, not machines
19
+ - String values truncated at 200 characters in logs
20
+ - 30-day log retention (includes logs from deleted resources)
21
+
22
+ ## Inspecting Executions
23
+
24
+ ```bash
25
+ pnpm elevasis-sdk execution <resourceId> <executionId>
26
+ pnpm elevasis-sdk executions <resourceId>
27
+ ```
28
+
29
+ ## Detailed Reference
30
+
31
+ - `node_modules/@elevasis/sdk/reference/scaffold/operations/workflow-recipes.md` -- full logging patterns and handler examples
@@ -12,16 +12,16 @@ paths:
12
12
 
13
13
  The `operations/` directory contains platform resources and deployment metadata that deploy to the Elevasis platform. It is a standalone TypeScript project with its own `package.json`, `tsconfig.json`, and dependencies.
14
14
 
15
- **Discovering deployed resources:** Read `operations/src/index.ts` for deployment assembly and `core/config/organization-model.ts` for the OM Resources descriptor catalog. Run `pnpm elevasis-sdk project:list --pretty` against the live DB for the deployed surface.
15
+ **Discovering deployed resources:** Read `operations/src/index.ts` for deployment assembly and `core/config/organization-model.ts` for the OM Resources descriptor catalog. Run `pnpm elevasis-sdk project:list --pretty` against the live DB for the deployed surface.
16
16
 
17
17
  ## Echo Workflow (Starter Example)
18
18
 
19
19
  **Location:** `operations/src/example/echo.ts`
20
20
 
21
- The echo workflow accepts a message string and returns it unchanged. Its purpose is the wiring, not the logic: input and output schemas are defined in `core/types/index.ts` and imported by both the workflow and the frontend.
21
+ The echo workflow accepts a message string and returns it unchanged. Its purpose is the wiring, not the logic: input and output schemas are defined in `core/types/index.ts` and imported by both the workflow and the frontend.
22
22
 
23
23
  ```
24
- core/types/index.ts -- defines echoInputSchema, echoOutputSchema
24
+ core/types/index.ts -- defines echoInputSchema, echoOutputSchema
25
25
  operations/src/example/echo.ts -- imports schemas for workflow contract
26
26
  ui/src/routes/ -- imports schemas for form validation and display
27
27
  ```
@@ -30,15 +30,19 @@ The workflow is registered in `operations/src/index.ts` as part of the `example`
30
30
 
31
31
  ## Adding a New Workflow
32
32
 
33
- 1. **Define the descriptor in `core/config/organization-model.ts`** -- Add the OM Resource descriptor under `resources.entries` so identity, System membership, owner role, and governance status are authored once.
34
-
35
- 2. **Define the contract in `core/types/`** -- Add Zod schemas and inferred types to `core/types/index.ts` (or a new file under `core/types/`).
36
-
37
- 3. **Implement the workflow in `operations/src/`** -- Create a new directory under `operations/src/` for the feature. Import the descriptor, derive runtime `resourceId` / `type` from it, export the workflow from its `index.ts`, and register it in `operations/src/index.ts`.
38
-
39
- 4. **Add the UI in `ui/src/routes/`** -- Create a new route file. Use TanStack Query to call the workflow execution endpoint. Import schemas from `@core/types` for validation and type inference.
40
-
41
- 5. **Deploy and verify:**
33
+ 1. **Define the descriptor in `core/config/organization-model.ts`** -- Add the OM Resource descriptor under the id-keyed `resources` map so identity, System membership, owner role, and governance status are authored once.
34
+
35
+ 2. **Model the semantic surface** -- Add durable business nouns, verbs, catalogs, links, events, and surfaces to the owning System's `ontology`; add system-local defaults/settings to `System.config`; add explanatory or governing material to `knowledge`; and keep transient DTOs and handler internals out of the OM. Top-level `entities`, top-level `actions`, and `System.content` are compatibility mirrors only when current published consumers still need them.
36
+
37
+ 3. **Define the contract in `core/types/`** -- Add Zod schemas and inferred types to `core/types/index.ts` (or a new file under `core/types/`). Use `core/types/entities.ts` when workflows operate on project-specific entity contracts.
38
+
39
+ 4. **Implement the workflow in `operations/src/`** -- Create a new directory under `operations/src/` for the feature. Import the descriptor, derive runtime `resourceId` / `type` from it, export the workflow from its `index.ts`, and register it in `operations/src/index.ts`.
40
+
41
+ 5. **Add the UI in `ui/src/routes/`** -- Create a new route file. Use TanStack Query to call the workflow execution endpoint. Import schemas from `@core/types` for validation and type inference. Read OM resources, ontology, knowledge, and graph data where possible instead of creating page-local semantic registries.
42
+
43
+ 6. **Update rules when the pattern persists** -- If the workflow introduces a reusable adapter pattern, checkpoint/schedule convention, domain vocabulary, or workflow family behavior that future agents must follow, update this rule or add a scoped rule under `.claude/rules/` in the same change.
44
+
45
+ 7. **Deploy and verify:**
42
46
 
43
47
  ```bash
44
48
  pnpm -C operations check # validate resource definitions
@@ -47,14 +51,14 @@ pnpm -C operations deploy # deploy to dev
47
51
 
48
52
  ## Resource Registry
49
53
 
50
- `operations/src/index.ts` default-exports a `DeploymentSpec` with `version`, `organizationModel`, `workflows`, `agents`, and optional topology-oriented metadata such as `triggers`, `integrations`, `relationships`, `humanCheckpoints`, and `externalResources`. Each feature group exports `workflows` and `agents` arrays from its own `index.ts`, spread into the top-level spec. `DeploymentSpec` assembles deployable behavior; it should not be treated as a second resource identity catalog.
54
+ `operations/src/index.ts` default-exports a `DeploymentSpec` with `version`, `organizationModel`, `workflows`, `agents`, and optional topology-oriented metadata such as `triggers`, `integrations`, `relationships`, `humanCheckpoints`, and `externalResources`. Each feature group exports `workflows` and `agents` arrays from its own `index.ts`, spread into the top-level spec. `DeploymentSpec` assembles deployable behavior; it should not be treated as a second resource identity catalog.
51
55
 
52
56
  When you need breadth first, read:
53
57
 
54
- - `operations/src/README.md` for the source boundary and drill-down guidance
55
- - `core/config/organization-model.ts` for descriptor identity and governance metadata
56
- - `operations/src/index.ts` for deployment assembly
57
- - `pnpm elevasis-sdk project:list --pretty` for the live deployed surface
58
+ - `operations/src/README.md` for the source boundary and drill-down guidance
59
+ - `core/config/organization-model.ts` for descriptor identity and governance metadata
60
+ - `operations/src/index.ts` for deployment assembly
61
+ - `pnpm elevasis-sdk project:list --pretty` for the live deployed surface
58
62
 
59
63
  ## Commands
60
64
 
@@ -66,3 +70,11 @@ When you need breadth first, read:
66
70
  | `pnpm -C operations deploy:prod` | Deploy to production |
67
71
 
68
72
  Always run `check` before `deploy`.
73
+
74
+ ## Rule Updates
75
+
76
+ When developing resources, workflows, agents, integrations, checkpoints, schedules, or recurring operational conventions, keep `.claude/rules/` current.
77
+
78
+ - Update `operations.md` for package-wide operations invariants.
79
+ - Add a scoped rule for domain-specific workflow families whose conventions should autoload for future edits.
80
+ - Do not bury durable operational rules only in task notes or chat context.
@@ -1,45 +1,113 @@
1
- ---
2
- description: Edits to the canonical organization model go through /knowledge
3
- paths:
4
- - core/config/organization-model.ts
5
- - core/config/extensions/**/*.ts
6
- ---
7
-
8
- # Organization Model Edit Guide
9
-
10
- `core/config/organization-model.ts` is the single source of truth for this
11
- project's organizational identity -- it encodes customers, offerings, roles, goals,
12
- features, statuses, Systems, and Resources descriptors that agents, workflows, and the
13
- UI shell all consume at runtime.
14
-
15
- ## Preferred Entry Point: `/knowledge`
16
-
17
- Direct edits to `organization-model.ts` are discouraged. Instead, use `/knowledge` (or
18
- `/knowledge <domain>`) to run the read → propose → confirm → write → validate ceremony:
19
-
20
- 1. The skill reads the current model so proposals start from ground truth.
21
- 2. It drafts only the specific block being changed, leaving everything else intact.
22
- 3. The user confirms before any file is written.
23
- 4. After writing, `pnpm -C operations check-types` runs and `OrganizationModelSchema.parse()`
24
- is verified. On failure the file is rolled back automatically.
25
-
26
- Use `/knowledge <domain>` for targeted edits: `identity`, `customers`, `offerings`,
27
- `roles`, `goals`, `techStack`, `features`, or `labels`. Resource identity and
28
- governance metadata belong in `resources.entries`; operations code derives runtime
1
+ ---
2
+ description: Edits to the canonical organization model go through /knowledge
3
+ paths:
4
+ - core/config/organization-model.ts
5
+ - core/config/extensions/**/*.ts
6
+ ---
7
+
8
+ # Organization Model Edit Guide
9
+
10
+ `core/config/organization-model.ts` is the single source of truth for this
11
+ project's organizational identity -- it encodes customers, offerings, roles, goals,
12
+ Systems, ontology, Policies, Knowledge, config, and Resources
13
+ descriptors that agents, workflows, and the UI shell all consume at runtime.
14
+ New semantic authoring should start in system-colocated `ontology` scopes. Top-level
15
+ `entities`, top-level `actions`, and `System.content` remain compatibility mirrors while
16
+ published consumers finish moving to compiled ontology indexes.
17
+
18
+ ## Preferred Entry Point: `/knowledge`
19
+
20
+ Direct edits to `organization-model.ts` are discouraged. Instead, use `/knowledge` (or
21
+ `/knowledge <domain>`) to run the read propose confirm write → validate ceremony:
22
+
23
+ 1. The skill reads the current model so proposals start from ground truth.
24
+ 2. It drafts only the specific block being changed, leaving everything else intact.
25
+ 3. The user confirms before any file is written.
26
+ 4. After writing, `pnpm -C operations check-types` runs and `OrganizationModelSchema.parse()`
27
+ is verified. On failure the file is rolled back automatically.
28
+
29
+ Use `/knowledge <domain>` for targeted edits: `identity`, `customers`, `offerings`,
30
+ `roles`, `goals`, `techStack`, `systems`, `actions`, or `labels`. Resource identity and
31
+ governance metadata belong in the id-keyed `resources` map; operations code derives runtime
29
32
  `resourceId` / `type` from those descriptors.
30
33
 
31
- ## Runtime Validation
32
-
33
- The model is validated at startup via `resolveOrganizationModel()` followed by
34
- `OrganizationModelSchema.parse()`. Cross-reference checks (segment ID refs in offerings,
35
- role reporting lines, period ordering in goals) are runtime-only and not caught by tsc
36
- alone -- always let the ceremony run both checks before treating a change as complete.
34
+ Author system-local semantics by boundary:
37
35
 
38
- ## Extension Files
36
+ - `System.ontology` owns durable object types, action types, catalog types, link types, event types, and surfaces.
37
+ - `System.config` owns system-local JSON settings and defaults.
38
+ - `resources` own executable workflow/agent descriptors, `systemPath`, owners, governance status, code references, and runtime implementation links.
39
+ - `resource.ontology` describes implemented actions, reads, writes, catalog use, and emitted events.
40
+ - `knowledge` owns long-form playbooks, strategies, references, and governance context.
41
+ - `System.content`, top-level `entities`, and top-level `actions` are compatibility mirrors only. Keep them aligned when current published consumers still need them, but do not treat them as the primary authoring surface.
39
42
 
40
- New Zod extension files under `core/config/extensions/` are Level B codify
41
- operations. Route these through `/knowledge <domain>` as well -- the skill gates Level B
42
- to explicit user confirmation before scaffolding a new `.ts` file.
43
+ Keep `actionKey` as the current runtime compatibility bridge to workflow metadata.
44
+
45
+ ## Runtime Validation
46
+
47
+ The model is validated at startup via `resolveOrganizationModel()` followed by
48
+ `OrganizationModelSchema.parse()`. Cross-reference checks (segment ID refs in offerings,
49
+ role reporting lines, period ordering in goals) are runtime-only and not caught by tsc
50
+ alone -- always let the ceremony run both checks before treating a change as complete.
51
+
52
+ ## Extension Files
53
+
54
+ New Zod extension files under `core/config/extensions/` are Level B codify
55
+ operations. Route these through `/knowledge <domain>` as well -- the skill gates Level B
56
+ to explicit user confirmation before scaffolding a new `.ts` file.
57
+
58
+ This is a soft guide, not a hard block. The ceremony exists to prevent silent schema
59
+ drift and to keep the model's editorial history visible.
60
+
61
+ ## Resource System Attachment
62
+
63
+ Every resource in the id-keyed `organizationModel.resources` map declares which System it belongs to
64
+ via `systemPath` -- a dot-separated path that resolves against the OM system tree
65
+ (e.g. `"sys.operations"`, `"sales.crm"`):
66
+
67
+ ```ts
68
+ {
69
+ id: 'apify-website-crawl',
70
+ systemPath: 'sys.operations', // canonical system attachment
71
+ kind: 'workflow',
72
+ ...
73
+ }
74
+ ```
75
+
76
+ `systemPath` is validated at parse time by `SystemPathSchema` and cross-checked by
77
+ `OrganizationModelSchema.superRefine` -- an unresolvable path causes a Zod error at
78
+ schema validation. Use `getResourcesForSystem(model, path)` (from `@elevasis/core`) to
79
+ query resources for a system at runtime. Pass `{ includeDescendants: true }` to include
80
+ all descendant systems (segment-aware -- `'sales'` does NOT match `'salesforce.foo'`).
81
+
82
+ Some external templates may carry a `systemId` compatibility mirror while published
83
+ `@elevasis/core` releases catch up to the current source contract. Treat that field as
84
+ legacy adapter data only; author new resource relationships against `systemPath`.
85
+
86
+ Do not fetch resources for every system-oriented read by default. For agent workflows, start
87
+ with the user's requested OM/knowledge context and query resources only when the task involves
88
+ runtime ownership, executable implementation, observability, deployment, or resource governance.
89
+ Use the descendant rollup only when parent-system scope is intended.
90
+
91
+ `resource.category` and `resource.links[].nodeId` are **runtime filter overlays** -- they
92
+ drive UI faceted filtering in the Command Center but do NOT define system membership.
93
+ System membership is `systemPath` only.
94
+
95
+ ```ts
96
+ // category and links power UI filter chips; systemPath is the
97
+ // canonical OM attachment used for graph edges and getResourcesForSystem queries.
98
+ ```
99
+
100
+ `resource.codeRefs[]` are repo-relative implementation breadcrumbs for agents and
101
+ operators. Use them to point from a governed OM Resource descriptor to the operations
102
+ entrypoint, handler, schema, test, docs, or config files that implement it. They do
103
+ not define resource identity, System membership, runtime execution topology, or graph
104
+ relationships.
43
105
 
44
- This is a soft guide, not a hard block. The ceremony exists to prevent silent schema
45
- drift and to keep the model's editorial history visible.
106
+ `System.ontology` owns durable semantic contracts: object types, action types, catalog
107
+ types, link types, event types, and surfaces. `System.config` owns local settings and
108
+ defaults. If current UI or runtime code still needs legacy mirrors, keep `entities`,
109
+ `actions`, or `System.content` aligned with the ontology/config record instead of
110
+ inventing a separate source of truth.
111
+
112
+ See `.claude/rules/system-shaping.md` (in the monorepo) for the substrate-shaping
113
+ propagation checklist that governs renames of this shape.