@elevasis/sdk 0.5.13 → 0.5.15

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.
@@ -1,210 +1,223 @@
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_API_KEY not set
14
-
15
- **Cause:** The `.env` file is missing the API key, or the file was not loaded.
16
-
17
- **Fix:**
18
- 1. Check that `.env` exists in the workspace root
19
- 2. Confirm it contains `ELEVASIS_API_KEY=sk_...`
20
- 3. Make sure you are running the CLI from the workspace directory (where `.env` is located)
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
- 1. Check your internet connection
29
- 2. If using a custom API URL via `--api-url` or `ELEVASIS_API_URL`, verify it is correct
30
- 3. Remove `NODE_ENV=development` from `.env` if you are not running a local API server
31
-
32
- ### NODE_ENV=development in .env
33
-
34
- **Cause:** The SDK is pointing at a local API server (port 5170 by default) instead of the hosted platform.
35
-
36
- **Fix:** Remove `NODE_ENV=development` from `.env`. The CLI connects to the hosted platform by default.
37
-
38
- ---
39
-
40
- ## Validation Errors (elevasis-sdk check)
41
-
42
- ### Duplicate resource ID
43
-
44
- **Message:** `Duplicate resource ID 'name' in organization 'org'`
45
-
46
- **Cause:** Two resources in `src/` share the same `resourceId`.
47
-
48
- **Fix:** Each resource must have a unique `resourceId` within your organization. Check all domain directories in `src/` and rename the duplicate.
49
-
50
- ### Workflow step references non-existent next step
51
-
52
- **Message:** `Workflow step 'stepA' references non-existent next step 'stepB'`
53
-
54
- **Cause:** A step's `next.target` or `next.routes[*].target` points to a step name that does not exist in the `steps` record.
55
-
56
- **Fix:** Check the spelling of the target step name. All target values must exactly match keys in the `steps` object.
57
-
58
- ### Missing entryPoint
59
-
60
- **Cause:** The workflow's `entryPoint` field names a step that does not exist in `steps`.
61
-
62
- **Fix:** Confirm `entryPoint` matches an exact key in your `steps` record.
63
-
64
- ---
65
-
66
- ## Schema Validation Errors
67
-
68
- ### Schema validation failed (input)
69
-
70
- **Message:** `Schema validation failed` with field-level details
71
-
72
- **Cause:** The input passed to the workflow does not match the `inputSchema`.
73
-
74
- **Fix:**
75
- 1. Read the error's field details -- it names the failing field and expected type
76
- 2. Compare against your `inputSchema` definition
77
- 3. Common causes: wrong type (string vs number), missing required field, extra field not in schema, misspelled field name
78
- 4. Check that `z.infer` types match what your handler actually receives
79
-
80
- ### outputSchema validation failed
81
-
82
- **Cause:** Your handler's return value does not match the workflow's `outputSchema`.
83
-
84
- **Fix:**
85
- 1. Compare what your handler returns to what `outputSchema` expects
86
- 2. Check field names for typos (the schema says `companyName`, handler returns `company_name`)
87
- 3. Check types -- the schema says `z.number()` but the handler returns a string
88
- 4. Check required vs optional -- do not return undefined for a required field
89
-
90
- ### Cannot find name 'z'
91
-
92
- **Cause:** Missing Zod import.
93
-
94
- **Fix:** Add `import { z } from 'zod'` at the top of the file.
95
-
96
- ---
97
-
98
- ## TypeScript Errors
99
-
100
- ### Type 'X' is not assignable to type 'Y'
101
-
102
- **Cause:** The data flowing into a step or returned from a handler does not match the declared type.
103
-
104
- **Fix:**
105
- 1. Check the input type annotation on the handler: `async (input: MyInput) => ...`
106
- 2. Confirm the `z.infer<typeof mySchema>` type matches what the previous step returns
107
- 3. Check that all optional fields are handled (do not assume they are always present)
108
-
109
- ### Cannot find module '@elevasis/sdk'
110
-
111
- **Cause:** Dependencies are not installed.
112
-
113
- **Fix:** Run `pnpm install` in the workspace root.
114
-
115
- ### Cannot find module '@elevasis/sdk/worker'
116
-
117
- **Cause:** Dependencies not installed, or using an old SDK version that does not export the `worker` subpath.
118
-
119
- **Fix:**
120
- 1. Run `pnpm install`
121
- 2. Check that `@elevasis/sdk` version is recent enough to include `worker` export
122
- 3. Confirm your `tsconfig.json` has `"moduleResolution": "Bundler"` or `"NodeNext"`
123
-
124
- ---
125
-
126
- ## Platform Tool Errors
127
-
128
- ### PlatformToolError: credential not found
129
-
130
- **Cause:** The credential name passed to `platform.call()` does not match any credential stored in the platform.
131
-
132
- **Fix:**
133
- 1. Check spelling and case -- credential names are case-sensitive
134
- 2. Open the command center and confirm the credential exists and is named exactly as referenced
135
- 3. Check that the credential belongs to the correct organization
136
-
137
- ### PlatformToolError: credentials_invalid
138
-
139
- **Cause:** The credential exists but has the wrong shape for the tool being called.
140
-
141
- **Fix:**
142
- 1. For the `http` tool: verify the credential type matches the API's auth method (bearer, api-key-header, basic, etc.)
143
- 2. For the Supabase tool: verify the credential contains `url` and `serviceRoleKey` fields
144
- 3. Re-create the credential in the command center if the format is wrong
145
-
146
- ### PlatformToolError: timeout_error
147
-
148
- **Cause:** The platform tool call took longer than 60 seconds.
149
-
150
- **Fix:**
151
- 1. Check if the external API is slow or down
152
- 2. Reduce the amount of data being processed in a single call
153
- 3. For `http` tool: the external endpoint may be unresponsive -- check directly
154
-
155
- ### PlatformToolError: service_unavailable
156
-
157
- **Cause:** The platform service or integration adapter is not available.
158
-
159
- **Fix:**
160
- 1. Check the Elevasis status page
161
- 2. Retry -- transient availability issues resolve quickly
162
-
163
- ---
164
-
165
- ## Runtime Errors
166
-
167
- ### Execution timeout (300s)
168
-
169
- **Cause:** The entire workflow execution exceeded the 300-second limit.
170
-
171
- **Fix:**
172
- 1. Identify which step is slow -- check execution logs for step timing
173
- 2. Reduce work per step or parallelize if possible
174
- 3. For long-running operations, consider breaking into multiple workflows with the `execution` platform tool to chain them
175
-
176
- ### Worker ran out of memory (256MB limit)
177
-
178
- **Cause:** The workflow processed too much data in memory at once.
179
-
180
- **Fix:**
181
- 1. Reduce the size of data loaded per execution
182
- 2. Use pagination for large data sets (fetch in chunks, process one at a time)
183
- 3. Avoid loading large files or arrays entirely into memory
184
-
185
- ### Module resolution error at runtime
186
-
187
- **Cause:** An import in your workflow bundle cannot be resolved.
188
-
189
- **Fix:**
190
- 1. Run `elevasis-sdk check` -- it catches most resolution errors before deploy
191
- 2. If the import is a built-in Node.js module, ensure it is compatible with the worker environment
192
- 3. Avoid imports that require file system access or native modules
193
-
194
- ---
195
-
196
- ## Memory Error Structure
197
-
198
- When recording a new error in `.claude/memory/errors/`, use this table format:
199
-
200
- ```
201
- | Error | Context | Fix | Count | Last Seen | Status |
202
- | --- | --- | --- | --- | --- | --- |
203
- | `Schema validation failed` on lead-scorer | Added score field | Changed score from z.string() to z.number() | 1 | 2026-02-26 | Resolved |
204
- ```
205
-
206
- Status values: `Resolved` (fixed this session), `Recurring` (seen 2+ times), `Promoted` (3+ times, now in Rules).
207
-
208
- ---
209
-
210
- **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
+ 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 workspace root
20
+ 2. Confirm it contains `ELEVASIS_PLATFORM_KEY=sk_...`
21
+ 3. Make sure you are running the CLI from the workspace directory (where `.env` is located)
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