@elevasis/sdk 1.25.0 → 1.26.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/cli.cjs +87 -120
  2. package/dist/index.d.ts +220 -50
  3. package/dist/index.js +4 -435
  4. package/dist/node/index.d.ts +46 -38
  5. package/dist/test-utils/index.d.ts +154 -40
  6. package/dist/test-utils/index.js +27 -355
  7. package/dist/types/worker/adapters/clickup.d.ts +22 -0
  8. package/dist/types/worker/adapters/index.d.ts +1 -0
  9. package/dist/worker/index.js +32 -354
  10. package/package.json +2 -2
  11. package/reference/_navigation.md +11 -1
  12. package/reference/_reference-manifest.json +70 -0
  13. package/reference/claude-config/rules/organization-model.md +12 -1
  14. package/reference/claude-config/rules/organization-os.md +12 -1
  15. package/reference/claude-config/skills/om/SKILL.md +13 -5
  16. package/reference/claude-config/skills/om/operations/codify-level-a.md +109 -100
  17. package/reference/claude-config/skills/om/operations/customers.md +10 -6
  18. package/reference/claude-config/skills/om/operations/features.md +7 -3
  19. package/reference/claude-config/skills/om/operations/goals.md +10 -6
  20. package/reference/claude-config/skills/om/operations/identity.md +8 -5
  21. package/reference/claude-config/skills/om/operations/labels.md +17 -1
  22. package/reference/claude-config/skills/om/operations/offerings.md +11 -7
  23. package/reference/claude-config/skills/om/operations/roles.md +11 -7
  24. package/reference/claude-config/skills/om/operations/techStack.md +10 -2
  25. package/reference/claude-config/skills/setup/SKILL.md +2 -2
  26. package/reference/claude-config/sync-notes/2026-05-20-om-define-helpers.md +32 -0
  27. package/reference/claude-config/sync-notes/2026-05-22-access-model-and-right-panel.md +43 -0
  28. package/reference/claude-config/sync-notes/2026-05-22-lead-gen-tenant-config.md +40 -0
  29. package/reference/claude-config/sync-notes/2026-05-22-org-model-multi-file-split.md +61 -0
  30. package/reference/claude-config/sync-notes/2026-05-23-branding-names-to-identity.md +49 -0
  31. package/reference/claude-config/sync-notes/2026-05-23-om-deployment-drift-detection.md +42 -0
  32. package/reference/cli-management.mdx +541 -0
  33. package/reference/cli.mdx +4 -532
  34. package/reference/concepts.mdx +134 -146
  35. package/reference/deployment/api.mdx +296 -297
  36. package/reference/deployment/command-center.mdx +208 -209
  37. package/reference/deployment/index.mdx +194 -195
  38. package/reference/deployment/provided-features.mdx +110 -107
  39. package/reference/deployment/ui-execution.mdx +249 -250
  40. package/reference/examples/organization-model.ts +14 -4
  41. package/reference/framework/index.mdx +111 -195
  42. package/reference/framework/resource-documentation.mdx +90 -0
  43. package/reference/framework/tutorial-system.mdx +135 -135
  44. package/reference/getting-started.mdx +141 -142
  45. package/reference/index.mdx +95 -106
  46. package/reference/packages/ui/src/auth/README.md +6 -6
  47. package/reference/platform-tools/adapters-integration.mdx +300 -301
  48. package/reference/platform-tools/adapters-platform.mdx +552 -553
  49. package/reference/platform-tools/index.mdx +216 -217
  50. package/reference/platform-tools/type-safety.mdx +82 -82
  51. package/reference/resources/index.mdx +348 -349
  52. package/reference/resources/patterns.mdx +446 -449
  53. package/reference/resources/types.mdx +115 -116
  54. package/reference/roadmap.mdx +164 -165
  55. package/reference/rules/organization-model.md +14 -0
  56. package/reference/runtime.mdx +172 -173
  57. package/reference/scaffold/operations/propagation-pipeline.md +1 -1
  58. package/reference/scaffold/recipes/extend-lead-gen.md +130 -77
  59. package/reference/scaffold/reference/contracts.md +376 -446
  60. package/reference/scaffold/reference/glossary.md +8 -6
  61. package/reference/scaffold/ui/feature-flags-and-gating.md +59 -46
  62. package/reference/scaffold/ui/feature-shell.mdx +11 -11
  63. package/reference/scaffold/ui/recipes.md +24 -24
  64. package/reference/troubleshooting.mdx +222 -223
@@ -1,223 +1,222 @@
1
- ---
2
- title: Common Errors
3
- description: Static SDK-level error catalog -- CLI errors, deployment errors, schema validation, platform tool failures, and runtime errors with diagnostic steps
4
- loadWhen: "Debugging an unknown error not found in workspace memory"
5
- ---
6
-
7
- This is the static SDK-level error catalog. Check `.claude/memory/errors/` first for workspace-specific fixes. Use this file when the error is new to the workspace or when the memory has no match.
8
-
9
- ---
10
-
11
- ## CLI Errors
12
-
13
- ### ELEVASIS_PLATFORM_KEY not set
14
-
15
- **Cause:** The `.env` file is missing the API key, or the file was not loaded.
16
-
17
- **Fix:**
18
-
19
- 1. Check that `.env` exists in the project root (or any parent directory)
20
- 2. Confirm it contains `ELEVASIS_PLATFORM_KEY=sk_...`
21
- 3. The CLI walks up directories to find `.env`, so running from subdirectories like `operations/` works automatically
22
- 4. If the file exists with the right content, run `elevasis-sdk check` again
23
-
24
- ### Cannot connect to API
25
-
26
- **Cause:** Network issue or the API URL is incorrect.
27
-
28
- **Fix:**
29
-
30
- 1. Check your internet connection
31
- 2. If using a custom API URL via `--api-url` or `ELEVASIS_API_URL`, verify it is correct
32
- 3. Remove `NODE_ENV=development` from `.env` if you are not running a local API server
33
-
34
- ### NODE_ENV=development in .env
35
-
36
- **Cause:** The SDK is pointing at a local API server (port 5170 by default) instead of the hosted platform.
37
-
38
- **Fix:** Remove `NODE_ENV=development` from `.env`. The CLI connects to the hosted platform by default.
39
-
40
- ---
41
-
42
- ## Validation Errors (elevasis-sdk check)
43
-
44
- ### Duplicate resource ID
45
-
46
- **Message:** `Duplicate resource ID 'name' in organization 'org'`
47
-
48
- **Cause:** Two resources in `src/` share the same `resourceId`.
49
-
50
- **Fix:** Each resource must have a unique `resourceId` within your organization. Check all domain directories in `src/` and rename the duplicate.
51
-
52
- ### Workflow step references non-existent next step
53
-
54
- **Message:** `Workflow step 'stepA' references non-existent next step 'stepB'`
55
-
56
- **Cause:** A step's `next.target` or `next.routes[*].target` points to a step name that does not exist in the `steps` record.
57
-
58
- **Fix:** Check the spelling of the target step name. All target values must exactly match keys in the `steps` object.
59
-
60
- ### Missing entryPoint
61
-
62
- **Cause:** The workflow's `entryPoint` field names a step that does not exist in `steps`.
63
-
64
- **Fix:** Confirm `entryPoint` matches an exact key in your `steps` record.
65
-
66
- ---
67
-
68
- ## Schema Validation Errors
69
-
70
- ### Schema validation failed (input)
71
-
72
- **Message:** `Schema validation failed` with field-level details
73
-
74
- **Cause:** The input passed to the workflow does not match the `inputSchema`.
75
-
76
- **Fix:**
77
-
78
- 1. Read the error's field details -- it names the failing field and expected type
79
- 2. Compare against your `inputSchema` definition
80
- 3. Common causes: wrong type (string vs number), missing required field, extra field not in schema, misspelled field name
81
- 4. Check that `z.infer` types match what your handler actually receives
82
-
83
- ### outputSchema validation failed
84
-
85
- **Cause:** Your handler's return value does not match the workflow's `outputSchema`.
86
-
87
- **Fix:**
88
-
89
- 1. Compare what your handler returns to what `outputSchema` expects
90
- 2. Check field names for typos (the schema says `companyName`, handler returns `company_name`)
91
- 3. Check types -- the schema says `z.number()` but the handler returns a string
92
- 4. Check required vs optional -- do not return undefined for a required field
93
-
94
- ### Cannot find name 'z'
95
-
96
- **Cause:** Missing Zod import.
97
-
98
- **Fix:** Add `import { z } from 'zod'` at the top of the file.
99
-
100
- ---
101
-
102
- ## TypeScript Errors
103
-
104
- ### Type 'X' is not assignable to type 'Y'
105
-
106
- **Cause:** The data flowing into a step or returned from a handler does not match the declared type.
107
-
108
- **Fix:**
109
-
110
- 1. Check the input type annotation on the handler: `async (input: MyInput) => ...`
111
- 2. Confirm the `z.infer<typeof mySchema>` type matches what the previous step returns
112
- 3. Check that all optional fields are handled (do not assume they are always present)
113
-
114
- ### Cannot find module '@elevasis/sdk'
115
-
116
- **Cause:** Dependencies are not installed.
117
-
118
- **Fix:** Run `pnpm install` in the workspace root.
119
-
120
- ### Cannot find module '@elevasis/sdk/worker'
121
-
122
- **Cause:** Dependencies not installed, or using an old SDK version that does not export the `worker` subpath.
123
-
124
- **Fix:**
125
-
126
- 1. Run `pnpm install`
127
- 2. Check that `@elevasis/sdk` version is recent enough to include `worker` export
128
- 3. Confirm your `tsconfig.json` has `"moduleResolution": "Bundler"` or `"NodeNext"`
129
-
130
- ---
131
-
132
- ## Platform Tool Errors
133
-
134
- ### PlatformToolError: credential not found
135
-
136
- **Cause:** The credential name passed to `platform.call()` does not match any credential stored in the platform.
137
-
138
- **Fix:**
139
-
140
- 1. Check spelling and case -- credential names are case-sensitive
141
- 2. Open the command center and confirm the credential exists and is named exactly as referenced
142
- 3. Check that the credential belongs to the correct organization
143
-
144
- ### PlatformToolError: credentials_invalid
145
-
146
- **Cause:** The credential exists but has the wrong shape for the tool being called.
147
-
148
- **Fix:**
149
-
150
- 1. For the `http` tool: verify the credential type matches the API's auth method (bearer, api-key-header, basic, etc.)
151
- 2. For the Supabase tool: verify the credential contains `url` and `serviceRoleKey` fields
152
- 3. Re-create the credential in the command center if the format is wrong
153
-
154
- ### PlatformToolError: timeout_error
155
-
156
- **Cause:** The platform tool call took longer than 60 seconds.
157
-
158
- **Fix:**
159
-
160
- 1. Check if the external API is slow or down
161
- 2. Reduce the amount of data being processed in a single call
162
- 3. For `http` tool: the external endpoint may be unresponsive -- check directly
163
-
164
- ### PlatformToolError: service_unavailable
165
-
166
- **Cause:** The platform service or integration adapter is not available.
167
-
168
- **Fix:**
169
-
170
- 1. Check the Elevasis status page
171
- 2. Retry -- transient availability issues resolve quickly
172
-
173
- ---
174
-
175
- ## Runtime Errors
176
-
177
- ### Execution timeout (300s)
178
-
179
- **Cause:** The entire workflow execution exceeded the 300-second limit.
180
-
181
- **Fix:**
182
-
183
- 1. Identify which step is slow -- check execution logs for step timing
184
- 2. Reduce work per step or parallelize if possible
185
- 3. For long-running operations, consider breaking into multiple workflows with the `execution` platform tool to chain them
186
-
187
- ### Worker ran out of memory (256MB limit)
188
-
189
- **Cause:** The workflow processed too much data in memory at once.
190
-
191
- **Fix:**
192
-
193
- 1. Reduce the size of data loaded per execution
194
- 2. Use pagination for large data sets (fetch in chunks, process one at a time)
195
- 3. Avoid loading large files or arrays entirely into memory
196
-
197
- ### Module resolution error at runtime
198
-
199
- **Cause:** An import in your workflow bundle cannot be resolved.
200
-
201
- **Fix:**
202
-
203
- 1. Run `elevasis-sdk check` -- it catches most resolution errors before deploy
204
- 2. If the import is a built-in Node.js module, ensure it is compatible with the worker environment
205
- 3. Avoid imports that require file system access or native modules
206
-
207
- ---
208
-
209
- ## Memory Error Structure
210
-
211
- When recording a new error in `.claude/memory/errors/`, use this table format:
212
-
213
- ```
214
- | Error | Context | Fix | Count | Last Seen | Status |
215
- | --- | --- | --- | --- | --- | --- |
216
- | `Schema validation failed` on lead-scorer | Added score field | Changed score from z.string() to z.number() | 1 | 2026-02-26 | Resolved |
217
- ```
218
-
219
- Status values: `Resolved` (fixed this session), `Recurring` (seen 2+ times), `Promoted` (3+ times, now in Rules).
220
-
221
- ---
222
-
223
- **Last Updated:** 2026-02-26
1
+ ---
2
+ title: Common Errors
3
+ description: Static SDK-level error catalog -- CLI errors, deployment errors, schema validation, platform tool failures, and runtime errors with diagnostic steps
4
+ ---
5
+
6
+ This is the static SDK-level error catalog. Check `.claude/memory/errors/` first for workspace-specific fixes. Use this file when the error is new to the workspace or when the memory has no match.
7
+
8
+ ---
9
+
10
+ ## CLI Errors
11
+
12
+ ### ELEVASIS_PLATFORM_KEY not set
13
+
14
+ **Cause:** The `.env` file is missing the API key, or the file was not loaded.
15
+
16
+ **Fix:**
17
+
18
+ 1. Check that `.env` exists in the project root (or any parent directory)
19
+ 2. Confirm it contains `ELEVASIS_PLATFORM_KEY=sk_...`
20
+ 3. The CLI walks up directories to find `.env`, so running from subdirectories like `operations/` works automatically
21
+ 4. If the file exists with the right content, run `elevasis-sdk check` again
22
+
23
+ ### Cannot connect to API
24
+
25
+ **Cause:** Network issue or the API URL is incorrect.
26
+
27
+ **Fix:**
28
+
29
+ 1. Check your internet connection
30
+ 2. If using a custom API URL via `--api-url` or `ELEVASIS_API_URL`, verify it is correct
31
+ 3. Remove `NODE_ENV=development` from `.env` if you are not running a local API server
32
+
33
+ ### NODE_ENV=development in .env
34
+
35
+ **Cause:** The SDK is pointing at a local API server (port 5170 by default) instead of the hosted platform.
36
+
37
+ **Fix:** Remove `NODE_ENV=development` from `.env`. The CLI connects to the hosted platform by default.
38
+
39
+ ---
40
+
41
+ ## Validation Errors (elevasis-sdk check)
42
+
43
+ ### Duplicate resource ID
44
+
45
+ **Message:** `Duplicate resource ID 'name' in organization 'org'`
46
+
47
+ **Cause:** Two resources in `src/` share the same `resourceId`.
48
+
49
+ **Fix:** Each resource must have a unique `resourceId` within your organization. Check all domain directories in `src/` and rename the duplicate.
50
+
51
+ ### Workflow step references non-existent next step
52
+
53
+ **Message:** `Workflow step 'stepA' references non-existent next step 'stepB'`
54
+
55
+ **Cause:** A step's `next.target` or `next.routes[*].target` points to a step name that does not exist in the `steps` record.
56
+
57
+ **Fix:** Check the spelling of the target step name. All target values must exactly match keys in the `steps` object.
58
+
59
+ ### Missing entryPoint
60
+
61
+ **Cause:** The workflow's `entryPoint` field names a step that does not exist in `steps`.
62
+
63
+ **Fix:** Confirm `entryPoint` matches an exact key in your `steps` record.
64
+
65
+ ---
66
+
67
+ ## Schema Validation Errors
68
+
69
+ ### Schema validation failed (input)
70
+
71
+ **Message:** `Schema validation failed` with field-level details
72
+
73
+ **Cause:** The input passed to the workflow does not match the `inputSchema`.
74
+
75
+ **Fix:**
76
+
77
+ 1. Read the error's field details -- it names the failing field and expected type
78
+ 2. Compare against your `inputSchema` definition
79
+ 3. Common causes: wrong type (string vs number), missing required field, extra field not in schema, misspelled field name
80
+ 4. Check that `z.infer` types match what your handler actually receives
81
+
82
+ ### outputSchema validation failed
83
+
84
+ **Cause:** Your handler's return value does not match the workflow's `outputSchema`.
85
+
86
+ **Fix:**
87
+
88
+ 1. Compare what your handler returns to what `outputSchema` expects
89
+ 2. Check field names for typos (the schema says `companyName`, handler returns `company_name`)
90
+ 3. Check types -- the schema says `z.number()` but the handler returns a string
91
+ 4. Check required vs optional -- do not return undefined for a required field
92
+
93
+ ### Cannot find name 'z'
94
+
95
+ **Cause:** Missing Zod import.
96
+
97
+ **Fix:** Add `import { z } from 'zod'` at the top of the file.
98
+
99
+ ---
100
+
101
+ ## TypeScript Errors
102
+
103
+ ### Type 'X' is not assignable to type 'Y'
104
+
105
+ **Cause:** The data flowing into a step or returned from a handler does not match the declared type.
106
+
107
+ **Fix:**
108
+
109
+ 1. Check the input type annotation on the handler: `async (input: MyInput) => ...`
110
+ 2. Confirm the `z.infer<typeof mySchema>` type matches what the previous step returns
111
+ 3. Check that all optional fields are handled (do not assume they are always present)
112
+
113
+ ### Cannot find module '@elevasis/sdk'
114
+
115
+ **Cause:** Dependencies are not installed.
116
+
117
+ **Fix:** Run `pnpm install` in the workspace root.
118
+
119
+ ### Cannot find module '@elevasis/sdk/worker'
120
+
121
+ **Cause:** Dependencies not installed, or using an old SDK version that does not export the `worker` subpath.
122
+
123
+ **Fix:**
124
+
125
+ 1. Run `pnpm install`
126
+ 2. Check that `@elevasis/sdk` version is recent enough to include `worker` export
127
+ 3. Confirm your `tsconfig.json` has `"moduleResolution": "Bundler"` or `"NodeNext"`
128
+
129
+ ---
130
+
131
+ ## Platform Tool Errors
132
+
133
+ ### PlatformToolError: credential not found
134
+
135
+ **Cause:** The credential name passed to `platform.call()` does not match any credential stored in the platform.
136
+
137
+ **Fix:**
138
+
139
+ 1. Check spelling and case -- credential names are case-sensitive
140
+ 2. Open the command center and confirm the credential exists and is named exactly as referenced
141
+ 3. Check that the credential belongs to the correct organization
142
+
143
+ ### PlatformToolError: credentials_invalid
144
+
145
+ **Cause:** The credential exists but has the wrong shape for the tool being called.
146
+
147
+ **Fix:**
148
+
149
+ 1. For the `http` tool: verify the credential type matches the API's auth method (bearer, api-key-header, basic, etc.)
150
+ 2. For the Supabase tool: verify the credential contains `url` and `serviceRoleKey` fields
151
+ 3. Re-create the credential in the command center if the format is wrong
152
+
153
+ ### PlatformToolError: timeout_error
154
+
155
+ **Cause:** The platform tool call took longer than 60 seconds.
156
+
157
+ **Fix:**
158
+
159
+ 1. Check if the external API is slow or down
160
+ 2. Reduce the amount of data being processed in a single call
161
+ 3. For `http` tool: the external endpoint may be unresponsive -- check directly
162
+
163
+ ### PlatformToolError: service_unavailable
164
+
165
+ **Cause:** The platform service or integration adapter is not available.
166
+
167
+ **Fix:**
168
+
169
+ 1. Check the Elevasis status page
170
+ 2. Retry -- transient availability issues resolve quickly
171
+
172
+ ---
173
+
174
+ ## Runtime Errors
175
+
176
+ ### Execution timeout (300s)
177
+
178
+ **Cause:** The entire workflow execution exceeded the 300-second limit.
179
+
180
+ **Fix:**
181
+
182
+ 1. Identify which step is slow -- check execution logs for step timing
183
+ 2. Reduce work per step or parallelize if possible
184
+ 3. For long-running operations, consider breaking into multiple workflows with the `execution` platform tool to chain them
185
+
186
+ ### Worker ran out of memory (256MB limit)
187
+
188
+ **Cause:** The workflow processed too much data in memory at once.
189
+
190
+ **Fix:**
191
+
192
+ 1. Reduce the size of data loaded per execution
193
+ 2. Use pagination for large data sets (fetch in chunks, process one at a time)
194
+ 3. Avoid loading large files or arrays entirely into memory
195
+
196
+ ### Module resolution error at runtime
197
+
198
+ **Cause:** An import in your workflow bundle cannot be resolved.
199
+
200
+ **Fix:**
201
+
202
+ 1. Run `elevasis-sdk check` -- it catches most resolution errors before deploy
203
+ 2. If the import is a built-in Node.js module, ensure it is compatible with the worker environment
204
+ 3. Avoid imports that require file system access or native modules
205
+
206
+ ---
207
+
208
+ ## Memory Error Structure
209
+
210
+ When recording a new error in `.claude/memory/errors/`, use this table format:
211
+
212
+ ```
213
+ | Error | Context | Fix | Count | Last Seen | Status |
214
+ | --- | --- | --- | --- | --- | --- |
215
+ | `Schema validation failed` on lead-scorer | Added score field | Changed score from z.string() to z.number() | 1 | 2026-02-26 | Resolved |
216
+ ```
217
+
218
+ Status values: `Resolved` (fixed this session), `Recurring` (seen 2+ times), `Promoted` (3+ times, now in Rules).
219
+
220
+ ---
221
+
222
+ **Last Updated:** 2026-02-26