@elevasis/sdk 0.4.6 → 0.4.7
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.
- package/dist/cli.cjs +814 -451
- package/dist/index.d.ts +79 -14
- package/dist/index.js +17 -12
- package/dist/templates.js +747 -0
- package/dist/types/templates.d.ts +1 -0
- package/dist/types/worker/index.d.ts +6 -0
- package/dist/types/worker/platform.d.ts +32 -0
- package/dist/worker/index.js +4701 -9
- package/package.json +16 -10
- package/reference/_index.md +48 -6
- package/reference/_navigation.md +104 -0
- package/reference/cli/index.mdx +2 -1
- package/reference/concepts/index.mdx +203 -0
- package/reference/deployment/api.mdx +1 -0
- package/reference/deployment/index.mdx +1 -0
- package/reference/developer/interaction-guidance.mdx +213 -0
- package/reference/framework/agent.mdx +175 -0
- package/reference/{documentation/index.mdx → framework/documentation.mdx} +1 -0
- package/reference/framework/index.mdx +95 -0
- package/reference/framework/memory.mdx +337 -0
- package/reference/framework/project-structure.mdx +294 -0
- package/reference/getting-started/index.mdx +39 -15
- package/reference/index.mdx +10 -2
- package/reference/platform-tools/examples.mdx +1 -0
- package/reference/platform-tools/index.mdx +43 -2
- package/reference/resources/index.mdx +1 -0
- package/reference/resources/patterns.mdx +2 -1
- package/reference/resources/types.mdx +1 -0
- package/reference/roadmap/index.mdx +1 -0
- package/reference/runtime/index.mdx +1 -0
- package/reference/runtime/limits.mdx +1 -0
- package/reference/security/credentials.mdx +141 -0
- package/reference/templates/data-enrichment.mdx +162 -0
- package/reference/templates/email-sender.mdx +135 -0
- package/reference/templates/lead-scorer.mdx +175 -0
- package/reference/templates/pdf-generator.mdx +151 -0
- package/reference/templates/recurring-job.mdx +189 -0
- package/reference/templates/text-classifier.mdx +147 -0
- package/reference/templates/web-scraper.mdx +135 -0
- package/reference/troubleshooting/common-errors.mdx +210 -0
- package/reference/getting-started/project-structure.mdx +0 -148
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Template: Text Classifier"
|
|
3
|
+
description: "Multi-label text classification with structured output -- classify text into predefined categories using an LLM with JSON output"
|
|
4
|
+
loadWhen: "Applying the text-classifier workflow template"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Category:** AI
|
|
8
|
+
|
|
9
|
+
**Platform Tools:** `llm` (structured generation)
|
|
10
|
+
|
|
11
|
+
**Credentials Required:**
|
|
12
|
+
|
|
13
|
+
- LLM API keys are resolved server-side from platform configuration (no credential name needed)
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## What This Workflow Does
|
|
18
|
+
|
|
19
|
+
Classifies input text into one or more predefined categories using an LLM. Returns structured output with category assignments and confidence reasoning. Suitable for ticket categorization, email routing, content tagging, sentiment analysis, and any text classification task where the categories are known in advance.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Input Schema
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
z.object({
|
|
27
|
+
text: z.string(), // Text to classify
|
|
28
|
+
categories: z.array(z.string()), // Available category labels
|
|
29
|
+
multiLabel: z.boolean().optional(), // Allow multiple categories (default: false)
|
|
30
|
+
instructions: z.string().optional(), // Additional instructions for the LLM
|
|
31
|
+
})
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Output Schema
|
|
35
|
+
|
|
36
|
+
```typescript
|
|
37
|
+
z.object({
|
|
38
|
+
categories: z.array(z.string()), // Assigned category labels
|
|
39
|
+
reasoning: z.string(), // LLM explanation of classification
|
|
40
|
+
confidence: z.enum(['high', 'medium', 'low']),
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## Workflow Code Pattern
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import type { WorkflowDefinition } from '@elevasis/sdk'
|
|
50
|
+
import { platform } from '@elevasis/sdk/worker'
|
|
51
|
+
import { z } from 'zod'
|
|
52
|
+
|
|
53
|
+
const inputSchema = z.object({
|
|
54
|
+
text: z.string(),
|
|
55
|
+
categories: z.array(z.string()),
|
|
56
|
+
multiLabel: z.boolean().optional(),
|
|
57
|
+
instructions: z.string().optional(),
|
|
58
|
+
})
|
|
59
|
+
const outputSchema = z.object({
|
|
60
|
+
categories: z.array(z.string()),
|
|
61
|
+
reasoning: z.string(),
|
|
62
|
+
confidence: z.enum(['high', 'medium', 'low']),
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
type Input = z.infer<typeof inputSchema>
|
|
66
|
+
|
|
67
|
+
export const textClassifier: WorkflowDefinition = {
|
|
68
|
+
config: {
|
|
69
|
+
resourceId: 'text-classifier',
|
|
70
|
+
name: 'Text Classifier',
|
|
71
|
+
type: 'workflow',
|
|
72
|
+
description: 'Classifies text into predefined categories using an LLM',
|
|
73
|
+
version: '1.0.0',
|
|
74
|
+
status: 'dev',
|
|
75
|
+
},
|
|
76
|
+
contract: { inputSchema, outputSchema },
|
|
77
|
+
steps: {
|
|
78
|
+
classify: {
|
|
79
|
+
id: 'classify',
|
|
80
|
+
name: 'Classify Text',
|
|
81
|
+
description: 'Use LLM to classify the input text',
|
|
82
|
+
inputSchema,
|
|
83
|
+
outputSchema,
|
|
84
|
+
handler: async (input) => {
|
|
85
|
+
const { text, categories, multiLabel, instructions } = input as Input
|
|
86
|
+
const mode = multiLabel ? 'one or more' : 'exactly one'
|
|
87
|
+
const categoryList = categories.map(c => `- ${c}`).join('\n')
|
|
88
|
+
|
|
89
|
+
const prompt = `Classify the following text into ${mode} of these categories:
|
|
90
|
+
${categoryList}
|
|
91
|
+
${instructions ? `\nAdditional instructions: ${instructions}` : ''}
|
|
92
|
+
|
|
93
|
+
Text to classify:
|
|
94
|
+
"${text}"
|
|
95
|
+
|
|
96
|
+
Return JSON with:
|
|
97
|
+
- categories: array of matching category names (from the list above only)
|
|
98
|
+
- reasoning: brief explanation of your classification
|
|
99
|
+
- confidence: "high" (very clear match), "medium" (reasonable but uncertain), or "low" (ambiguous)`
|
|
100
|
+
|
|
101
|
+
const result = await platform.call({
|
|
102
|
+
tool: 'llm',
|
|
103
|
+
method: 'generate',
|
|
104
|
+
params: {
|
|
105
|
+
provider: 'openai',
|
|
106
|
+
model: 'gpt-4o-mini',
|
|
107
|
+
messages: [{ role: 'user', content: prompt }],
|
|
108
|
+
responseSchema: {
|
|
109
|
+
type: 'object',
|
|
110
|
+
properties: {
|
|
111
|
+
categories: { type: 'array', items: { type: 'string' } },
|
|
112
|
+
reasoning: { type: 'string' },
|
|
113
|
+
confidence: { type: 'string', enum: ['high', 'medium', 'low'] },
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
}) as { categories: string[]; reasoning: string; confidence: 'high' | 'medium' | 'low' }
|
|
118
|
+
|
|
119
|
+
// Validate that returned categories are from the allowed list
|
|
120
|
+
const validCategories = result.categories.filter(c => categories.includes(c))
|
|
121
|
+
|
|
122
|
+
return {
|
|
123
|
+
categories: validCategories,
|
|
124
|
+
reasoning: result.reasoning,
|
|
125
|
+
confidence: result.confidence,
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
next: null,
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
entryPoint: 'classify',
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Adaptation Notes
|
|
138
|
+
|
|
139
|
+
- **Category design:** Help the user define clear, mutually exclusive category names. Ambiguous categories produce inconsistent results.
|
|
140
|
+
- **Multi-label use:** Enable `multiLabel: true` when a single piece of text can legitimately belong to multiple categories (e.g., a support ticket about "billing AND account access").
|
|
141
|
+
- **Confidence routing:** Common pattern: use the output with `StepType.CONDITIONAL` routing. High confidence routes to automated processing; low confidence routes to human review.
|
|
142
|
+
- **Model selection:** `gpt-4o-mini` is fast and cost-effective for classification. For complex or nuanced categorization, suggest `gpt-4o`.
|
|
143
|
+
- **Skill adaptation:** For beginners, explain what "structured output" means and why the LLM returns JSON instead of free text.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
**Last Updated:** 2026-02-26
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Template: Web Scraper"
|
|
3
|
+
description: "Apify-based web scraper that stores results in Supabase -- fetch structured data from any website via Apify actors"
|
|
4
|
+
loadWhen: "Applying the web-scraper workflow template"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Category:** Data Collection
|
|
8
|
+
|
|
9
|
+
**Platform Tools:** `apify` (run actor), `supabase` (insert results)
|
|
10
|
+
|
|
11
|
+
**Credentials Required:**
|
|
12
|
+
|
|
13
|
+
- `apify` -- Apify API token (bearer type)
|
|
14
|
+
- `my-database` -- Supabase project URL and service role key
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## What This Workflow Does
|
|
19
|
+
|
|
20
|
+
Runs an Apify actor to scrape structured data from a URL, then stores the scraped results in a Supabase table. The actor and table names are configurable. Suitable for extracting product listings, job postings, contact information, or any structured web content.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Input Schema
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
z.object({
|
|
28
|
+
actorId: z.string(), // Apify actor ID (e.g., 'apify/web-scraper')
|
|
29
|
+
startUrls: z.array(z.string()), // URLs to scrape
|
|
30
|
+
tableName: z.string(), // Supabase table to store results in
|
|
31
|
+
maxItems: z.number().optional(), // Maximum number of items to collect (default: 100)
|
|
32
|
+
})
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
## Output Schema
|
|
36
|
+
|
|
37
|
+
```typescript
|
|
38
|
+
z.object({
|
|
39
|
+
itemsScraped: z.number(), // Total items scraped
|
|
40
|
+
itemsInserted: z.number(), // Items successfully inserted into Supabase
|
|
41
|
+
runId: z.string(), // Apify run ID for reference
|
|
42
|
+
})
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Workflow Code Pattern
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import type { WorkflowDefinition } from '@elevasis/sdk'
|
|
51
|
+
import { StepType } from '@elevasis/sdk'
|
|
52
|
+
import { platform, PlatformToolError } from '@elevasis/sdk/worker'
|
|
53
|
+
import { z } from 'zod'
|
|
54
|
+
|
|
55
|
+
const inputSchema = z.object({
|
|
56
|
+
actorId: z.string(),
|
|
57
|
+
startUrls: z.array(z.string()),
|
|
58
|
+
tableName: z.string(),
|
|
59
|
+
maxItems: z.number().optional(),
|
|
60
|
+
})
|
|
61
|
+
const outputSchema = z.object({
|
|
62
|
+
itemsScraped: z.number(),
|
|
63
|
+
itemsInserted: z.number(),
|
|
64
|
+
runId: z.string(),
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
type Input = z.infer<typeof inputSchema>
|
|
68
|
+
|
|
69
|
+
export const webScraper: WorkflowDefinition = {
|
|
70
|
+
config: {
|
|
71
|
+
resourceId: 'web-scraper',
|
|
72
|
+
name: 'Web Scraper',
|
|
73
|
+
type: 'workflow',
|
|
74
|
+
description: 'Scrapes structured data via Apify and stores in Supabase',
|
|
75
|
+
version: '1.0.0',
|
|
76
|
+
status: 'dev',
|
|
77
|
+
},
|
|
78
|
+
contract: { inputSchema, outputSchema },
|
|
79
|
+
steps: {
|
|
80
|
+
scrape: {
|
|
81
|
+
id: 'scrape',
|
|
82
|
+
name: 'Run Apify Actor',
|
|
83
|
+
description: 'Execute the Apify actor and collect results',
|
|
84
|
+
inputSchema,
|
|
85
|
+
outputSchema: z.object({ items: z.array(z.unknown()), runId: z.string() }),
|
|
86
|
+
handler: async (input) => {
|
|
87
|
+
const { actorId, startUrls, maxItems } = input as Input
|
|
88
|
+
const result = await platform.call({
|
|
89
|
+
tool: 'apify',
|
|
90
|
+
method: 'runActor',
|
|
91
|
+
credential: 'apify',
|
|
92
|
+
params: { actorId, input: { startUrls: startUrls.map(url => ({ url })), maxItems: maxItems ?? 100 } },
|
|
93
|
+
}) as { items: unknown[]; runId: string }
|
|
94
|
+
return { items: result.items, runId: result.runId }
|
|
95
|
+
},
|
|
96
|
+
next: { type: StepType.LINEAR, target: 'store' },
|
|
97
|
+
},
|
|
98
|
+
store: {
|
|
99
|
+
id: 'store',
|
|
100
|
+
name: 'Store Results',
|
|
101
|
+
description: 'Insert scraped items into Supabase',
|
|
102
|
+
inputSchema: z.object({ items: z.array(z.unknown()), runId: z.string(), tableName: z.string() }),
|
|
103
|
+
outputSchema,
|
|
104
|
+
handler: async (input, context) => {
|
|
105
|
+
const { items, runId, tableName } = input as { items: unknown[]; runId: string; tableName: string }
|
|
106
|
+
const data = items.map(item => ({ ...(item as Record<string, unknown>), scraped_at: new Date().toISOString() }))
|
|
107
|
+
await platform.call({
|
|
108
|
+
tool: 'supabase',
|
|
109
|
+
method: 'insert',
|
|
110
|
+
credential: 'my-database',
|
|
111
|
+
params: { table: tableName, data },
|
|
112
|
+
})
|
|
113
|
+
context.logger.info('Stored scraped items', { count: data.length, table: tableName })
|
|
114
|
+
return { itemsScraped: items.length, itemsInserted: data.length, runId }
|
|
115
|
+
},
|
|
116
|
+
next: null,
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
entryPoint: 'scrape',
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Adaptation Notes
|
|
126
|
+
|
|
127
|
+
- **Credential names:** Replace `'apify'` and `'my-database'` with the credential names the user configured in the command center.
|
|
128
|
+
- **Table schema:** Ensure the Supabase table exists and has columns that match the scraped data fields. The agent should check `data/schema.ts` if it exists.
|
|
129
|
+
- **Actor selection:** Apify has hundreds of public actors. Common choices: `apify/web-scraper` (generic), `apify/cheerio-scraper` (fast HTML parsing), specialized actors for LinkedIn, Amazon, etc.
|
|
130
|
+
- **Error handling:** Add try/catch for `PlatformToolError` if partial failure tolerance is needed.
|
|
131
|
+
- **Skill adaptation:** For beginners, explain what Apify is and walk through actor selection before generating code.
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
**Last Updated:** 2026-02-26
|
|
@@ -0,0 +1,210 @@
|
|
|
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 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 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 files in `src/workflows/` 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 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,148 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Project Structure
|
|
3
|
-
description: Each file scaffolded by elevasis init and its purpose in the development workflow
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
`elevasis init` creates a complete project structure. This page explains what each file does and when you will interact with it.
|
|
7
|
-
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
## Source Files
|
|
11
|
-
|
|
12
|
-
### `src/index.ts`
|
|
13
|
-
|
|
14
|
-
Your resource definitions live here. This file must export an `OrganizationResources` object as its default export. The scaffolded file contains a working echo workflow that demonstrates the `z.infer` pattern for Zod schema types.
|
|
15
|
-
|
|
16
|
-
Every resource you add -- workflows and agents -- is registered through this default export.
|
|
17
|
-
|
|
18
|
-
### `elevasis.config.ts`
|
|
19
|
-
|
|
20
|
-
Project-level configuration. The scaffolded file contains commented-out options (`defaultStatus`, `dev.port`) so you can discover available settings without having to look them up. Leave this file minimal; the platform provides sensible defaults.
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Documentation
|
|
25
|
-
|
|
26
|
-
### `docs/index.mdx`
|
|
27
|
-
|
|
28
|
-
The entry point for your project's documentation. Documentation files in `docs/` are deployed alongside your code during `elevasis deploy` and rendered in the Elevasis platform UI.
|
|
29
|
-
|
|
30
|
-
Use MDX frontmatter to set page metadata:
|
|
31
|
-
|
|
32
|
-
```yaml
|
|
33
|
-
---
|
|
34
|
-
title: Overview
|
|
35
|
-
description: Documentation for this project
|
|
36
|
-
order: 0
|
|
37
|
-
---
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Add more pages by creating additional `.mdx` files in `docs/`. Nested directories create sections: `docs/guides/setup.mdx` becomes a `guides/setup` page under your deployment's documentation.
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Configuration Files
|
|
45
|
-
|
|
46
|
-
### `.env`
|
|
47
|
-
|
|
48
|
-
Contains your `ELEVASIS_API_KEY`. This file is gitignored. Never commit it.
|
|
49
|
-
|
|
50
|
-
### `.env.example`
|
|
51
|
-
|
|
52
|
-
A git-safe template showing which variables are needed:
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
ELEVASIS_API_KEY=sk_your_key_here
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Commit this file so collaborators know what to configure.
|
|
59
|
-
|
|
60
|
-
### `.npmrc`
|
|
61
|
-
|
|
62
|
-
Sets `auto-install-peers = true`. The SDK uses Zod as a peer dependency, so this ensures Zod installs automatically.
|
|
63
|
-
|
|
64
|
-
### `tsconfig.json`
|
|
65
|
-
|
|
66
|
-
App-focused TypeScript configuration. It does not include `declaration` or `declarationMap` settings because your project is a deployable application, not a library.
|
|
67
|
-
|
|
68
|
-
### `.gitignore`
|
|
69
|
-
|
|
70
|
-
Pre-configured to exclude:
|
|
71
|
-
- `.env` -- API key
|
|
72
|
-
- `__elevasis_worker.ts` -- temporary file generated during deployment
|
|
73
|
-
- `.claude/settings.local.json` -- local Claude Code overrides
|
|
74
|
-
- `.claude/profile.json` -- your personal onboarding profile
|
|
75
|
-
|
|
76
|
-
---
|
|
77
|
-
|
|
78
|
-
## Claude Code Integration
|
|
79
|
-
|
|
80
|
-
The `.claude/` directory and `CLAUDE.md` give Claude Code full awareness of the SDK, CLI, and your project structure from the first session.
|
|
81
|
-
|
|
82
|
-
### `CLAUDE.md`
|
|
83
|
-
|
|
84
|
-
The most important file for AI-assisted development. It provides Claude Code with:
|
|
85
|
-
|
|
86
|
-
- **Project orientation** -- what an Elevasis SDK project is and how it works
|
|
87
|
-
- **Project structure** -- which files contain resources, documentation, and configuration
|
|
88
|
-
- **SDK patterns** -- working code examples for resource definitions, Zod schemas, and the `OrganizationResources` export
|
|
89
|
-
- **CLI reference** -- all commands with flags (`check`, `deploy`, `exec`, `resources`, `executions`, `execution`, `deployments`, `env list/set/remove`)
|
|
90
|
-
- **Development rules** -- conventions the agent should enforce (source in `src/`, docs in `docs/`, use `@elevasis/sdk` types only)
|
|
91
|
-
|
|
92
|
-
Do not remove or heavily edit `CLAUDE.md`. It is the primary context source that makes the slash commands work well.
|
|
93
|
-
|
|
94
|
-
### `.claude/settings.json`
|
|
95
|
-
|
|
96
|
-
Sets `autoCompact: false`. This prevents Claude Code from automatically compacting context during long sessions, which can lose important earlier context about your project.
|
|
97
|
-
|
|
98
|
-
### `.claude/profile.json`
|
|
99
|
-
|
|
100
|
-
Created automatically on your first Claude Code session. The agent runs a one-time onboarding flow asking about your organization, project goals, and experience level. Answers are stored here and used to personalize subsequent sessions.
|
|
101
|
-
|
|
102
|
-
This file is gitignored -- it is personal to you and not shared with collaborators.
|
|
103
|
-
|
|
104
|
-
---
|
|
105
|
-
|
|
106
|
-
## Slash Commands
|
|
107
|
-
|
|
108
|
-
The `.claude/commands/` directory contains three commands covering the core development loop. Invoke them in Claude Code with `/docs`, `/resource`, and `/deploy`.
|
|
109
|
-
|
|
110
|
-
### `/docs` -- Documentation Assistant
|
|
111
|
-
|
|
112
|
-
Helps you write and maintain documentation in `docs/`. Three operations:
|
|
113
|
-
|
|
114
|
-
- **No arguments** -- Review existing `docs/` files, identify undocumented resources and gaps, suggest improvements
|
|
115
|
-
- **`create <page-name>`** -- Scaffold a new documentation page with correct frontmatter, populated from your resource definitions
|
|
116
|
-
- **`review`** -- Check all `docs/` files for accuracy against the actual code in `src/`, flag mismatches between documented schemas and implementation
|
|
117
|
-
|
|
118
|
-
### `/resource` -- Resource Scaffolding
|
|
119
|
-
|
|
120
|
-
Scaffolds new workflow definitions with proper types, Zod schemas, and step structure. Three operations:
|
|
121
|
-
|
|
122
|
-
- **`workflow <name>`** -- Single-step workflow with Zod input/output schemas, config object, contract, step handler, and addition to the `OrganizationResources` export
|
|
123
|
-
- **`multi-step <name>`** -- Multi-step workflow with `StepType.LINEAR` or `StepType.CONDITIONAL`, connected steps, and per-step schemas
|
|
124
|
-
- **`tool-step <name>`** -- Step that calls a platform tool via `platform.call()` with `PlatformToolError` error handling and a credential note
|
|
125
|
-
|
|
126
|
-
### `/deploy` -- Deployment Assistant
|
|
127
|
-
|
|
128
|
-
Guides you through validation and deployment. Two operations:
|
|
129
|
-
|
|
130
|
-
- **No arguments** -- Runs `elevasis check`, reports any validation errors, then runs `elevasis deploy` if check passes. Analyzes failure output and suggests fixes if the deploy fails
|
|
131
|
-
- **`status`** -- Runs `elevasis deployments` and `elevasis resources` to show current deployment state
|
|
132
|
-
|
|
133
|
-
---
|
|
134
|
-
|
|
135
|
-
## File Reference
|
|
136
|
-
|
|
137
|
-
| File | When You Edit It |
|
|
138
|
-
|------|-----------------|
|
|
139
|
-
| `src/index.ts` | Adding or modifying resources |
|
|
140
|
-
| `docs/index.mdx` | Updating project documentation |
|
|
141
|
-
| `elevasis.config.ts` | Changing project-level settings |
|
|
142
|
-
| `.env` | Adding environment variables |
|
|
143
|
-
| `CLAUDE.md` | Rarely -- only to add project-specific context |
|
|
144
|
-
| `.claude/commands/*.md` | Rarely -- commands work well as scaffolded |
|
|
145
|
-
|
|
146
|
-
---
|
|
147
|
-
|
|
148
|
-
**Last Updated:** 2026-02-25
|