@elevasis/sdk 0.5.12 → 0.5.13

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 (32) hide show
  1. package/dist/cli.cjs +92 -81
  2. package/dist/index.d.ts +11 -253
  3. package/dist/index.js +5 -9
  4. package/dist/templates.js +26 -23
  5. package/dist/types/worker/adapters/index.d.ts +0 -1
  6. package/dist/worker/index.js +47 -53
  7. package/package.json +1 -1
  8. package/reference/_navigation.md +13 -57
  9. package/reference/concepts.mdx +203 -0
  10. package/reference/deployment/{command-center-ui.mdx → command-center.mdx} +229 -151
  11. package/reference/deployment/index.mdx +158 -153
  12. package/reference/framework/agent.mdx +168 -151
  13. package/reference/framework/index.mdx +182 -103
  14. package/reference/framework/memory.mdx +347 -347
  15. package/reference/framework/tutorial-system.mdx +253 -0
  16. package/reference/{getting-started/index.mdx → getting-started.mdx} +4 -4
  17. package/reference/index.mdx +117 -114
  18. package/reference/platform-tools/adapters.mdx +175 -32
  19. package/reference/platform-tools/index.mdx +354 -195
  20. package/reference/resources/index.mdx +5 -0
  21. package/reference/{roadmap/index.mdx → roadmap.mdx} +1 -1
  22. package/reference/{runtime/index.mdx → runtime.mdx} +196 -141
  23. package/dist/types/worker/adapters/trello.d.ts +0 -14
  24. package/reference/concepts/index.mdx +0 -203
  25. package/reference/deployment/command-view.mdx +0 -154
  26. package/reference/framework/documentation.mdx +0 -92
  27. package/reference/platform-tools/examples.mdx +0 -170
  28. package/reference/runtime/limits.mdx +0 -75
  29. package/reference/security/credentials.mdx +0 -141
  30. /package/reference/{cli/index.mdx → cli.mdx} +0 -0
  31. /package/reference/{developer → framework}/interaction-guidance.mdx +0 -0
  32. /package/reference/{troubleshooting/common-errors.mdx → troubleshooting.mdx} +0 -0
package/dist/templates.js CHANGED
@@ -31,26 +31,30 @@ ui/dist/
31
31
 
32
32
  // src/cli/commands/templates/core/claude.ts
33
33
  function claudeSettingsTemplate() {
34
- return JSON.stringify({
35
- autoCompact: false,
36
- statusLine: {
37
- type: "command",
38
- command: "node .claude/scripts/statusline-command.js"
34
+ return JSON.stringify(
35
+ {
36
+ autoCompact: false,
37
+ statusLine: {
38
+ type: "command",
39
+ command: "node .claude/scripts/statusline-command.js"
40
+ },
41
+ hooks: {
42
+ PreToolUse: [
43
+ {
44
+ matcher: "Write|Edit|MultiEdit|Bash",
45
+ hooks: [
46
+ {
47
+ type: "command",
48
+ command: "node .claude/hooks/enforce-sdk-boundary.mjs"
49
+ }
50
+ ]
51
+ }
52
+ ]
53
+ }
39
54
  },
40
- hooks: {
41
- PreToolUse: [
42
- {
43
- matcher: "Write|Edit|MultiEdit|Bash",
44
- hooks: [
45
- {
46
- type: "command",
47
- command: "node .claude/hooks/enforce-sdk-boundary.mjs"
48
- }
49
- ]
50
- }
51
- ]
52
- }
53
- }, null, 2) + "\n";
55
+ null,
56
+ 2
57
+ ) + "\n";
54
58
  }
55
59
  function claudeStatuslineScriptTemplate() {
56
60
  return `#!/usr/bin/env node
@@ -313,7 +317,8 @@ When an error occurs:
313
317
  - Import from \`@elevasis/sdk-ui\`, never from \`@elevasis/sdk\` or \`@repo/ui\`
314
318
  - Dev server runs on port 5100: \`cd ui && pnpm dev\`
315
319
  - Set \`VITE_WORKOS_CLIENT_ID\` in \`ui/.env\` before running
316
- - \`ElevasisProvider\` is pre-configured in \`ui/src/App.tsx\` (oauth mode, redirectUri \`http://localhost:5100/auth-redirect\`, apiUrl \`http://localhost:5170\`)
320
+ - \`ElevasisCoreProvider\` (headless, no Mantine dependency) is pre-configured in \`ui/src/App.tsx\` with \`auth={{ mode: 'oauth', clientId, redirectUri }}\`, \`apiUrl="http://localhost:5170"\`, and \`theme={{ colorScheme: 'dark', preset: 'default' }}\`
321
+ - To use pre-built Mantine components from \`@elevasis/sdk-ui\`, switch to \`ElevasisUIProvider\` and install \`@mantine/core\` and \`@mantine/hooks\`
317
322
  - OAuth redirect is handled by the \`AuthRedirect\` component at \`/auth-redirect\` -- it uses \`useAuthContext()\` from \`@elevasis/sdk-ui/auth\` and navigates home once \`user\` is set
318
323
  - API must be running on port 5170 for the UI to work (\`pnpm --filter api dev\` from the platform monorepo)` : ""}
319
324
 
@@ -1495,7 +1500,6 @@ Your \`ELEVASIS_PLATFORM_KEY\` in \`.env\` determines the organization.
1495
1500
  | --- | --- | --- |
1496
1501
  | \`api-key\` | \`{"apiKey": "sk-..."}\` | Stripe, Resend, Apify, Attio, Instantly |
1497
1502
  | \`webhook-secret\` | \`{"signingSecret": "whsec_..."}\` | Cal.com, Stripe webhooks |
1498
- | \`trello\` | \`{"apiKey": "...", "token": "..."}\` | Trello |
1499
1503
  | \`oauth\` | N/A (browser flow only) | Notion, Google Sheets, Dropbox |
1500
1504
 
1501
1505
  OAuth credentials **cannot** be created via CLI. Redirect the user to the Command Center UI.
@@ -1518,12 +1522,11 @@ elevasis-sdk creds list
1518
1522
  Display the output. Note which are \`oauth\` (not modifiable via CLI).
1519
1523
 
1520
1524
  **\`create\`:** Guided credential creation flow:
1521
- 1. Ask credential type (\`api-key\`, \`webhook-secret\`, or \`trello\`). Not \`oauth\`.
1525
+ 1. Ask credential type (\`api-key\` or \`webhook-secret\`). Not \`oauth\`.
1522
1526
  2. Ask credential name. Validate naming rules before proceeding.
1523
1527
  3. Ask the user to paste the credential value directly in chat.
1524
1528
  - For \`api-key\`: ask for the API key, construct \`{"apiKey": "..."}\`
1525
1529
  - For \`webhook-secret\`: ask for the signing secret, construct \`{"signingSecret": "..."}\`
1526
- - For \`trello\`: ask for API key AND user token, construct \`{"apiKey": "...", "token": "..."}\`
1527
1530
  4. Pipe to CLI: \`echo '{"apiKey":"..."}' | elevasis-sdk creds create --name {name} --type {type}\`
1528
1531
  5. Confirm success. **NEVER echo the credential value back.**
1529
1532
 
@@ -17,7 +17,6 @@ export { createNotionAdapter } from './notion.js';
17
17
  export { createResendAdapter } from './resend.js';
18
18
  export { createSignatureApiAdapter } from './signature-api.js';
19
19
  export { createStripeAdapter } from './stripe.js';
20
- export { createTrelloAdapter } from './trello.js';
21
20
  export { scheduler } from './scheduler.js';
22
21
  export { llm } from './llm.js';
23
22
  export { storage } from './storage.js';
@@ -2464,7 +2464,6 @@ You have control over session memory. Use memoryOps to manage critical informati
2464
2464
  **IMPORTANT - System-Managed Memory:**
2465
2465
  Do NOT update these keys via memoryOps (managed automatically by tools/actions):
2466
2466
  - notion-pages-cache (managed by Notion tools)
2467
- - trello-boards-cache (managed by Trello tools)
2468
2467
  - knowledge-map-state (managed by navigate-knowledge)
2469
2468
 
2470
2469
  Attempting to update system-managed keys will be rejected. Use tools to update their caches.
@@ -2877,6 +2876,14 @@ var AgentCancellationError = class extends ExecutionError {
2877
2876
  super(message, context);
2878
2877
  }
2879
2878
  };
2879
+ var AgentStalledError = class extends ExecutionError {
2880
+ type = "agent_stalled_error";
2881
+ severity = "critical";
2882
+ category = "agent";
2883
+ constructor(message, context) {
2884
+ super(message, context);
2885
+ }
2886
+ };
2880
2887
  var AgentMemoryValidationError = class extends ExecutionError {
2881
2888
  type = "agent_memory_validation_error";
2882
2889
  severity = "info";
@@ -3142,10 +3149,8 @@ var MEMORY_DOMAINS = {
3142
3149
  // Notion tools manage page hierarchy
3143
3150
  "github-repo-cache",
3144
3151
  // GitHub tools manage repository structure
3145
- "slack-channel-cache",
3152
+ "slack-channel-cache"
3146
3153
  // Slack tools manage channel data
3147
- "trello-boards-cache"
3148
- // Trello tools manage boards/lists/cards
3149
3154
  ],
3150
3155
  /**
3151
3156
  * Action-owned keys
@@ -3972,9 +3977,7 @@ async function reloadKnowledgeMapTools(knowledgeMap, memory, context) {
3972
3977
  function initializeKnowledgeMap(knowledgeMap) {
3973
3978
  if (!knowledgeMap) return void 0;
3974
3979
  return {
3975
- nodes: Object.fromEntries(
3976
- Object.entries(knowledgeMap.nodes).map(([id, node]) => [id, { ...node }])
3977
- )
3980
+ nodes: Object.fromEntries(Object.entries(knowledgeMap.nodes).map(([id, node]) => [id, { ...node }]))
3978
3981
  };
3979
3982
  }
3980
3983
  var Agent = class {
@@ -4213,13 +4216,20 @@ var Agent = class {
4213
4216
  while (iteration <= maxIterations) {
4214
4217
  if (context.signal?.aborted) {
4215
4218
  if (context.signal.reason === "timeout") {
4216
- throw new AgentTimeoutError(
4217
- `Agent execution exceeded timeout (${this.config.constraints?.timeout}ms)`,
4218
- { timeout: this.config.constraints?.timeout ?? 0, iteration }
4219
- );
4219
+ throw new AgentTimeoutError(`Agent execution exceeded timeout (${this.config.constraints?.timeout}ms)`, {
4220
+ timeout: this.config.constraints?.timeout ?? 0,
4221
+ iteration
4222
+ });
4223
+ }
4224
+ if (context.signal.reason === "stalled") {
4225
+ throw new AgentStalledError("Execution stalled: no heartbeat received within threshold", { iteration });
4220
4226
  }
4221
4227
  throw new AgentCancellationError("Execution cancelled by user", { iteration });
4222
4228
  }
4229
+ try {
4230
+ await context.onHeartbeat?.();
4231
+ } catch {
4232
+ }
4223
4233
  const result = await this.runIteration(iteration, context);
4224
4234
  if (result.shouldComplete) {
4225
4235
  return;
@@ -4372,14 +4382,11 @@ var Agent = class {
4372
4382
  const finalOutput = this.contract.outputSchema.parse(retryOutput);
4373
4383
  return { output: finalOutput, attempts: 2 };
4374
4384
  } catch (error) {
4375
- throw new AgentOutputValidationError(
4376
- "Agent output validation failed after retry",
4377
- {
4378
- agentId: this.config.resourceId,
4379
- attempts: 2,
4380
- zodError: error instanceof ZodError ? error.format() : error
4381
- }
4382
- );
4385
+ throw new AgentOutputValidationError("Agent output validation failed after retry", {
4386
+ agentId: this.config.resourceId,
4387
+ attempts: 2,
4388
+ zodError: error instanceof ZodError ? error.format() : error
4389
+ });
4383
4390
  }
4384
4391
  }
4385
4392
  /**
@@ -4397,12 +4404,17 @@ var Agent = class {
4397
4404
  try {
4398
4405
  this.logger.action(actionType, `${actionType} started`, 0, generationStartTime, generationStartTime, 0);
4399
4406
  const attempt = actionType === "output-generation" ? 1 : 2;
4400
- const adapter = this.adapterFactory(this.modelConfig, this.executionContext?.aiUsageCollector, "agent-completion", {
4401
- type: "agent-completion",
4402
- attempt,
4403
- sessionId: this.executionContext?.sessionId,
4404
- turnNumber: this.executionContext?.sessionTurnNumber
4405
- });
4407
+ const adapter = this.adapterFactory(
4408
+ this.modelConfig,
4409
+ this.executionContext?.aiUsageCollector,
4410
+ "agent-completion",
4411
+ {
4412
+ type: "agent-completion",
4413
+ attempt,
4414
+ sessionId: this.executionContext?.sessionId,
4415
+ turnNumber: this.executionContext?.sessionTurnNumber
4416
+ }
4417
+ );
4406
4418
  const structuredOutput = await callLLMForAgentCompletion(adapter, {
4407
4419
  systemPrompt,
4408
4420
  memoryContext: this.memoryManager.toContext(this.iterationNumber, this.executionContext?.sessionTurnNumber),
@@ -4885,23 +4897,6 @@ function createStripeAdapter(credential) {
4885
4897
  return createAdapter("stripe", METHODS11, credential);
4886
4898
  }
4887
4899
 
4888
- // src/worker/adapters/trello.ts
4889
- var METHODS12 = [
4890
- "getBoard",
4891
- "getLists",
4892
- "getCards",
4893
- "createCard",
4894
- "updateCard",
4895
- "createList",
4896
- "createChecklist",
4897
- "addChecklistItem",
4898
- "updateChecklistItem",
4899
- "getCardChecklists"
4900
- ];
4901
- function createTrelloAdapter(credential) {
4902
- return createAdapter("trello", METHODS12, credential);
4903
- }
4904
-
4905
4900
  // src/worker/adapters/scheduler.ts
4906
4901
  var scheduler = createAdapter("scheduler", [
4907
4902
  "createSchedule",
@@ -5150,19 +5145,12 @@ function buildWorkerExecutionContext(params) {
5150
5145
  };
5151
5146
  }
5152
5147
  function startWorker(org) {
5153
- const workflows = new Map(
5154
- (org.workflows ?? []).map((w) => [w.config.resourceId, w])
5155
- );
5156
- const agents = new Map(
5157
- (org.agents ?? []).map((a) => [a.config.resourceId, a])
5158
- );
5148
+ const workflows = new Map((org.workflows ?? []).map((w) => [w.config.resourceId, w]));
5149
+ const agents = new Map((org.agents ?? []).map((a) => [a.config.resourceId, a]));
5159
5150
  let localAbortController = new AbortController();
5160
5151
  console.log(`[SDK-WORKER] Worker started with ${workflows.size} workflow(s), ${agents.size} agent(s)`);
5161
5152
  parentPort.on("message", async (msg) => {
5162
5153
  if (msg.type === "manifest") {
5163
- const workflowList = (org.workflows ?? []).map((w) => w.config.resourceId);
5164
- const agentList = (org.agents ?? []).map((a) => a.config.resourceId);
5165
- console.log(`[SDK-WORKER] Manifest requested: workflows=[${workflowList.join(", ")}], agents=[${agentList.join(", ")}]`);
5166
5154
  parentPort.postMessage({
5167
5155
  type: "manifest",
5168
5156
  workflows: (org.workflows ?? []).map((w) => ({
@@ -5244,7 +5232,13 @@ function startWorker(org) {
5244
5232
  } catch (err) {
5245
5233
  const durationMs = Date.now() - startTime;
5246
5234
  console.error(`[SDK-WORKER] Workflow '${resourceId}' failed (${durationMs}ms): ${String(err)}`);
5247
- parentPort.postMessage({ type: "result", status: "failed", error: String(err), logs: [], metrics: { durationMs } });
5235
+ parentPort.postMessage({
5236
+ type: "result",
5237
+ status: "failed",
5238
+ error: String(err),
5239
+ logs: [],
5240
+ metrics: { durationMs }
5241
+ });
5248
5242
  }
5249
5243
  return;
5250
5244
  }
@@ -5321,4 +5315,4 @@ function startWorker(org) {
5321
5315
  });
5322
5316
  }
5323
5317
 
5324
- export { PlatformToolError, approval, createAdapter, createApifyAdapter, createAttioAdapter, createDropboxAdapter, createGmailAdapter, createGoogleSheetsAdapter, createInstantlyAdapter, createMailsoAdapter, createNotionAdapter, createResendAdapter, createSignatureApiAdapter, createStripeAdapter, createTrelloAdapter, email, execution, lead, llm, notifications, pdf, platform, scheduler, startWorker, storage };
5318
+ export { PlatformToolError, approval, createAdapter, createApifyAdapter, createAttioAdapter, createDropboxAdapter, createGmailAdapter, createGoogleSheetsAdapter, createInstantlyAdapter, createMailsoAdapter, createNotionAdapter, createResendAdapter, createSignatureApiAdapter, createStripeAdapter, email, execution, lead, llm, notifications, pdf, platform, scheduler, startWorker, storage };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/sdk",
3
- "version": "0.5.12",
3
+ "version": "0.5.13",
4
4
  "description": "SDK for building Elevasis organization resources",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  # SDK Reference Navigation
2
2
 
3
- Auto-generated from reference file frontmatter. 32 files indexed.
3
+ Auto-generated from reference file frontmatter. 28 files indexed.
4
4
 
5
5
  All paths are relative to `node_modules/@elevasis/sdk/reference/`.
6
6
 
@@ -8,58 +8,39 @@ All paths are relative to `node_modules/@elevasis/sdk/reference/`.
8
8
 
9
9
  | Resource | Location | Description | When to Load |
10
10
  | --- | --- | --- | --- |
11
+ | CLI Reference | `cli.mdx` | Full reference for every elevasis-sdk CLI command -- scaffold, validate, deploy, execute, and inspect resources | Running CLI operations |
12
+ | Concepts Reference | `concepts.mdx` | Plain-English explanations of Elevasis SDK concepts -- glossary, workflow analogies, Zod schemas, execution model, platform tools, common errors, and design decisions | User asks what is or needs conceptual grounding |
13
+ | Getting Started | `getting-started.mdx` | Install the Elevasis SDK, scaffold a project, and run your first deployment | Setting up a new project or onboarding |
11
14
  | Elevasis SDK | `index.mdx` | Build and deploy workflows, agents, and resources with the Elevasis SDK | First session or new to the SDK |
12
-
13
- ## Cli
14
-
15
- | Resource | Location | Description | When to Load |
16
- | --- | --- | --- | --- |
17
- | CLI Reference | `cli/index.mdx` | Full reference for every elevasis-sdk CLI command -- scaffold, validate, deploy, execute, and inspect resources | Running CLI operations |
18
-
19
- ## Concepts
20
-
21
- | Resource | Location | Description | When to Load |
22
- | --- | --- | --- | --- |
23
- | Concepts Reference | `concepts/index.mdx` | Plain-English explanations of Elevasis SDK concepts -- glossary, workflow analogies, Zod schemas, execution model, platform tools, common errors, and design decisions | User asks what is or needs conceptual grounding |
15
+ | Roadmap | `roadmap.mdx` | Planned SDK features -- error taxonomy, retry semantics, circuit breaker, metrics, alerting, and resource lifecycle extensions | Asking about future features or planned capabilities |
16
+ | Execution Runtime | `runtime.mdx` | How your code runs on the Elevasis platform -- execution lifecycle, concurrency, timeouts, cancellation, error handling, observability, resource limits, and v1 limitations | Debugging execution behavior or understanding the runtime model |
17
+ | Common Errors | `troubleshooting.mdx` | Static SDK-level error catalog -- CLI errors, deployment errors, schema validation, platform tool failures, and runtime errors with diagnostic steps | Debugging an unknown error not found in workspace memory |
24
18
 
25
19
  ## Deployment
26
20
 
27
21
  | Resource | Location | Description | When to Load |
28
22
  | --- | --- | --- | --- |
29
23
  | Execution API | `deployment/api.mdx` | REST endpoints for executing resources, querying execution history, and managing deployments via the Elevasis external API | Calling the API directly or debugging API responses |
30
- | Command Center UI | `deployment/command-center-ui.mdx` | Reference for the Elevasis Command Center -- what each page does, when to use it post-deployment, and how SDK concepts map to UI actions | User asks about the Command Center UI, post-deployment workflow, or monitoring deployed resources |
31
- | Command View | `deployment/command-view.mdx` | How the Command View graph works -- node types, relationships, what is enforced vs decorative, and what the platform needs to render your resource graph | Deploying resources or building resources that invoke other resources |
24
+ | Command Center | `deployment/command-center.mdx` | Post-deployment UI reference -- what each page does, the resource graph model, relationships, validation, and how SDK concepts map to Command Center actions | User asks about the Command Center UI, post-deployment workflow, monitoring, or the resource graph |
32
25
  | Deploying Resources | `deployment/index.mdx` | How to deploy your Elevasis SDK resources to the platform using elevasis-sdk deploy, including configuration, validation, and environment setup | Preparing to deploy or debugging deploy failures |
33
26
 
34
- ## Developer
35
-
36
- | Resource | Location | Description | When to Load |
37
- | --- | --- | --- | --- |
38
- | Interaction Guidance | `developer/interaction-guidance.mdx` | Full dimensional adaptation rules per skill axis -- platform navigation, API integration, automation concepts, domain expertise -- with growth tracking protocol | Unsure how to adapt for a skill combination |
39
-
40
27
  ## Framework
41
28
 
42
29
  | Resource | Location | Description | When to Load |
43
30
  | --- | --- | --- | --- |
44
31
  | Agent System | `framework/agent.mdx` | CLAUDE.md drives all agent behavior -- project instructions, slash commands, memory-based developer profile, and three-tier adaptive guidance | Configuring agent behavior or capabilities |
45
- | Resource Documentation | `framework/documentation.mdx` | Write and deploy MDX documentation alongside your Elevasis resources | Writing or updating project documentation |
46
- | Development Framework | `framework/index.mdx` | The SDK scaffolds a complete development environment for Claude Code -- project instructions, slash commands, cross-session memory, and template versioning | Understanding the agent framework structure |
32
+ | Development Framework | `framework/index.mdx` | The SDK scaffolds a complete development environment for Claude Code -- project instructions, slash commands, cross-session memory, template versioning, and resource documentation | Understanding the agent framework structure |
33
+ | Interaction Guidance | `framework/interaction-guidance.mdx` | Full dimensional adaptation rules per skill axis -- platform navigation, API integration, automation concepts, domain expertise -- with growth tracking protocol | Unsure how to adapt for a skill combination |
47
34
  | Memory System | `framework/memory.mdx` | Cross-session project knowledge stored in .claude/memory/ -- deployment state, environment, decisions, and error patterns that persist between Claude Code sessions | Working with agent memory or session state |
48
35
  | Project Structure | `framework/project-structure.mdx` | Each file scaffolded by elevasis-sdk init and its purpose in the development workflow | Understanding scaffolded files or project layout |
49
-
50
- ## Getting-started
51
-
52
- | Resource | Location | Description | When to Load |
53
- | --- | --- | --- | --- |
54
- | Getting Started | `getting-started/index.mdx` | Install the Elevasis SDK, scaffold a project, and run your first deployment | Setting up a new project or onboarding |
36
+ | Tutorial System | `framework/tutorial-system.mdx` | Reference for the SDK tutorial system -- 21-item menu across 4 sections, skill-level adaptation rules, progress tracking format, and per-lesson module contents | (not specified) |
55
37
 
56
38
  ## Platform-tools
57
39
 
58
40
  | Resource | Location | Description | When to Load |
59
41
  | --- | --- | --- | --- |
60
- | Typed Adapters | `platform-tools/adapters.mdx` | Type-safe wrappers over platform.call() for all integrations and platform tools -- Attio, Stripe, Notion, Google Sheets, Trello, and more -- with full autocomplete, compile-time checking, and zero boilerplate | Using typed adapters instead of raw platform.call(), or needs to know what adapter methods are available |
61
- | Integration Examples | `platform-tools/examples.mdx` | Working code examples for email, CRM, PDF, LLM inference, resource triggering, and storage using typed adapters and platform.call() | Implementing a platform tool call in a workflow step |
62
- | Platform Tools | `platform-tools/index.mdx` | Access 70+ tools across integration adapters and platform services from your SDK workflows -- typed adapters with full autocomplete for all tools, plus platform.call() as a fallback | Connecting to external services |
42
+ | Typed Adapters | `platform-tools/adapters.mdx` | Type-safe wrappers over platform.call() for all integrations and platform tools -- Attio, Stripe, Notion, Google Sheets, and more -- with full autocomplete, compile-time checking, and zero boilerplate | Using typed adapters instead of raw platform.call(), or needs to know what adapter methods are available |
43
+ | Platform Tools | `platform-tools/index.mdx` | Access 70+ tools across integration adapters and platform services from your SDK workflows -- typed adapters, credential security model, and working code examples | Connecting to external services |
63
44
 
64
45
  ## Resources
65
46
 
@@ -69,25 +50,6 @@ All paths are relative to `node_modules/@elevasis/sdk/reference/`.
69
50
  | Common Patterns | `resources/patterns.mdx` | Common resource patterns for Elevasis SDK developers -- sequential steps, conditional branching, platform tools, error handling, and resource status management | Building or modifying a workflow |
70
51
  | SDK Types | `resources/types.mdx` | Complete type reference for @elevasis/sdk -- package exports, re-exported platform types, ElevasConfig interface, StepHandler context, and runtime values | Looking up type signatures or SDK exports |
71
52
 
72
- ## Roadmap
73
-
74
- | Resource | Location | Description | When to Load |
75
- | --- | --- | --- | --- |
76
- | Roadmap | `roadmap/index.mdx` | Planned SDK features -- error taxonomy, retry semantics, circuit breaker, metrics, alerting, and resource lifecycle extensions | Asking about future features or planned capabilities |
77
-
78
- ## Runtime
79
-
80
- | Resource | Location | Description | When to Load |
81
- | --- | --- | --- | --- |
82
- | Execution Runtime | `runtime/index.mdx` | How your code runs on the Elevasis platform -- execution lifecycle, concurrency, timeouts, cancellation, error handling, and observability | Debugging execution behavior or understanding the runtime model |
83
- | Resource Limits & Quotas | `runtime/limits.mdx` | Memory limits, execution timeouts, scale quotas, networking constraints, and v1 platform limitations for SDK resources | Hitting resource limits or planning for scale |
84
-
85
- ## Security
86
-
87
- | Resource | Location | Description | When to Load |
88
- | --- | --- | --- | --- |
89
- | Credential Security | `security/credentials.mdx` | Three-layer credential model: platform tools (server-side injection), http tool (arbitrary APIs), getCredential() (explicit opt-in raw access) -- .env scope and security boundaries | Setting up integrations or configuring tool access |
90
-
91
53
  ## Templates
92
54
 
93
55
  | Resource | Location | Description | When to Load |
@@ -99,9 +61,3 @@ All paths are relative to `node_modules/@elevasis/sdk/reference/`.
99
61
  | Template: Recurring Job | `templates/recurring-job.mdx` | Scheduler-triggered periodic workflow -- run a task on a schedule (daily, weekly, hourly, or custom cron) | Applying the recurring-job workflow template |
100
62
  | Template: Text Classifier | `templates/text-classifier.mdx` | Multi-label text classification with structured output -- classify text into predefined categories using an LLM with JSON output | Applying the text-classifier workflow template |
101
63
  | Template: Web Scraper | `templates/web-scraper.mdx` | Apify-based web scraper that stores results in Supabase -- fetch structured data from any website via Apify actors | Applying the web-scraper workflow template |
102
-
103
- ## Troubleshooting
104
-
105
- | Resource | Location | Description | When to Load |
106
- | --- | --- | --- | --- |
107
- | Common Errors | `troubleshooting/common-errors.mdx` | Static SDK-level error catalog -- CLI errors, deployment errors, schema validation, platform tool failures, and runtime errors with diagnostic steps | Debugging an unknown error not found in workspace memory |
@@ -0,0 +1,203 @@
1
+ ---
2
+ title: Concepts Reference
3
+ description: Plain-English explanations of Elevasis SDK concepts -- glossary, workflow analogies, Zod schemas, execution model, platform tools, common errors, and design decisions
4
+ loadWhen: "User asks what is or needs conceptual grounding"
5
+ ---
6
+
7
+ This page covers core Elevasis concepts in plain English. It is the teaching vocabulary for the agent when helping you build workflows, and a reference you can return to whenever a term or behavior is unclear.
8
+
9
+ ## Glossary
10
+
11
+ | Term | Definition |
12
+ | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
13
+ | Workflow | A series of named steps that run one after another. Each step does one job. The workflow receives input data and produces output data. |
14
+ | Agent | An autonomous AI resource with access to platform tools. Agents can make decisions and call tools on their own. Run agents with `--async` to avoid HTTP timeout limits on long-running executions. |
15
+ | Resource | Anything you deploy to the platform -- a workflow or an agent. Each resource has a unique ID. |
16
+ | Step | One job inside a workflow. A step receives data, processes it, and passes data to the next step. |
17
+ | Schema | A description of what your data looks like. Schemas validate that input and output data has the right shape -- the right fields with the right types. |
18
+ | Credential | A saved API key or login for an external service (Gmail, Attio, Stripe). Stored securely on the platform, never in your code. |
19
+ | Execution | One run of a resource. Each time someone triggers your workflow, that is one execution. |
20
+ | Deployment | The act of uploading your code to the platform. After deploying, your resources are live and can be executed. |
21
+ | Platform Tool | A pre-built integration the platform provides. You call platform tools from your workflow steps using `platform.call()`. |
22
+ | Organization | Your team or company on the Elevasis platform. Resources, credentials, and executions belong to an organization. |
23
+ | Handler | The function inside a step that does the actual work. It receives input data and returns output data. |
24
+ | Entry Point | The first step that runs when a workflow is executed. Every workflow must have one. |
25
+ | Resource ID | A unique lowercase name for your resource (e.g., `lead-scorer`, `send-welcome-email`). Must be unique within your organization. |
26
+ | Workspace | Your Elevasis project directory. Contains resources (workflows and agents), documentation, and optionally a database connection and custom apps. Created by `elevasis-sdk init`. |
27
+ | Data Table | A table in your database (e.g., Supabase) that stores structured data your workflows can read and write. Defined in `data/schema.ts` as documentation for the agent. |
28
+
29
+ ---
30
+
31
+ ## What is a Workflow?
32
+
33
+ A workflow is a piece of automation that runs on the Elevasis platform. You define the steps in TypeScript; the platform handles running them, logging results, and retrying on failure.
34
+
35
+ ### Two Analogies
36
+
37
+ **Recipe analogy:** A recipe has ingredients (input), instructions (steps), and a finished dish (output). Each instruction is one step. You follow them in order. If a step fails (you burn the sauce), the recipe stops.
38
+
39
+ **Assembly line analogy:** Raw material goes in one end (input). Each station does one job (step). The finished product comes out the other end (output).
40
+
41
+ ### When to Use a Workflow
42
+
43
+ - Automating a repeatable task with defined input and output
44
+ - Chaining multiple actions together (fetch data, process it, send an email)
45
+ - When you need the platform to handle execution, retries, and logging
46
+
47
+ ### When NOT to Use a Workflow
48
+
49
+ - One-off tasks you will only do once
50
+ - Tasks that need constant human judgment at every step
51
+
52
+ ---
53
+
54
+ ## Understanding Schemas (Zod)
55
+
56
+ ### What Schemas Do
57
+
58
+ Schemas describe and validate the shape of data your workflow expects and produces. If someone sends the wrong data, the platform rejects it before your code runs. This prevents confusing errors deep inside your handler.
59
+
60
+ The Elevasis SDK uses [Zod](https://zod.dev) for schema definition. Zod is a TypeScript-first validation library. Every workflow has an `inputSchema` and an `outputSchema`.
61
+
62
+ ### Common Zod Types
63
+
64
+ | Zod Type | What It Means | Example |
65
+ | -------------------------------- | ------------------------------- | ----------------------------- |
66
+ | `z.string()` | Text | `"hello"`, `"user@email.com"` |
67
+ | `z.number()` | A number | `42`, `3.14` |
68
+ | `z.boolean()` | True or false | `true`, `false` |
69
+ | `z.array(z.string())` | A list of text values | `["a", "b", "c"]` |
70
+ | `z.object({ name: z.string() })` | A group of named fields | `{ "name": "Jane" }` |
71
+ | `z.string().optional()` | Text that might be missing | `"hello"` or not provided |
72
+ | `z.enum(['a', 'b', 'c'])` | One of a specific set of values | `"a"` |
73
+ | `z.string().email()` | Text that must be a valid email | `"user@example.com"` |
74
+
75
+ ### Why `z.infer` Exists
76
+
77
+ `z.infer` creates a TypeScript type from a schema so the type system can check your code. You define the schema once and get both runtime validation and compile-time checking. Without it, you would have to define the same shape twice -- once as a Zod schema and once as a TypeScript type.
78
+
79
+ ```ts
80
+ const myInput = z.object({ name: z.string(), age: z.number() });
81
+ type MyInput = z.infer<typeof myInput>;
82
+ // MyInput is now: { name: string; age: number }
83
+ ```
84
+
85
+ ### Common Schema Mistakes
86
+
87
+ - Forgetting `.optional()` on fields that might be missing -- the platform will reject valid input that omits those fields
88
+ - Returning data from a handler that does not match the output schema -- causes `outputSchema validation failed`
89
+ - Misspelling field names -- the schema says `companyName`, but the handler returns `company_name`
90
+
91
+ ---
92
+
93
+ ## The Execution Model
94
+
95
+ ### What Happens When You Run a Workflow
96
+
97
+ 1. A request arrives at the Elevasis platform (someone runs `elevasis-sdk exec` or a schedule triggers)
98
+ 2. The platform creates a temporary server just for this execution
99
+ 3. Your code runs on that server
100
+ 4. The result is sent back
101
+ 5. The temporary server is deleted
102
+
103
+ ### Practical Implications
104
+
105
+ | What You Might Expect | What Actually Happens | Why |
106
+ | --------------------------- | ------------------------------------- | ----------------------------- |
107
+ | Files I create persist | Files disappear after execution | The server is temporary |
108
+ | I can see logs in real-time | Logs appear after execution completes | No streaming from workers |
109
+ | My code runs on my computer | Your code runs on Elevasis servers | That is what "deploy" means |
110
+ | I can use unlimited memory | 256MB memory limit per execution | Prevents runaway processes |
111
+ | Executions share state | Each execution is independent | No shared memory between runs |
112
+ | I can call external APIs | Yes, outbound network is unrestricted | Workers have internet access |
113
+
114
+ ### What "completed" vs "failed" Means
115
+
116
+ - **completed** -- Your code ran successfully and returned output
117
+ - **failed** -- Something went wrong: your code threw an error, timed out (300s default), or ran out of memory
118
+
119
+ ---
120
+
121
+ ## Platform Tools Overview
122
+
123
+ Platform tools are pre-built integrations the platform provides. You call them from inside workflow steps using `platform.call()` without managing API keys in your code.
124
+
125
+ ### Tool Categories
126
+
127
+ | Category | Tools | Example Use |
128
+ | ------------- | -------------------------- | -------------------------------------------------- |
129
+ | Communication | Gmail, Resend, email | Send transactional emails, notifications |
130
+ | CRM | Attio (11 methods) | Create leads, update records, search contacts |
131
+ | Documents | PDF, Google Sheets, Notion | Generate invoices, read spreadsheets, update pages |
132
+ | AI | LLM (GPT, Gemini, Claude) | Classify text, extract data, generate content |
133
+ | Storage | Dropbox, platform storage | Upload files, create signed URLs |
134
+ | Scheduling | Scheduler | Run workflows on a schedule or after a delay |
135
+ | Approvals | Approval gates | Pause workflow until a human approves |
136
+ | Verification | Mailso | Verify email addresses |
137
+ | E-Signatures | SignatureAPI | Create and manage document envelopes |
138
+ | Marketing | Instantly | Send email campaigns |
139
+ | Payments | Stripe | Create payment links, checkout sessions |
140
+ | Automation | Apify | Run web scraping actors |
141
+
142
+ ### How Credentials Work
143
+
144
+ 1. Create a credential in the Elevasis platform (API key, OAuth token, etc.) via the command center UI
145
+ 2. Give it a name (e.g., `my-gmail`, `production-attio`)
146
+ 3. In your code, pass that name: `platform.call({ credential: 'my-gmail', ... })`
147
+ 4. The platform injects the actual API key at runtime -- it never appears in your code
148
+
149
+ ### What Happens When a Credential Name is Wrong
150
+
151
+ You will see a `PlatformToolError` with the message "credential not found". Check for typos -- credential names are case-sensitive.
152
+
153
+ ---
154
+
155
+ ## Common Errors (Quick Reference)
156
+
157
+ | Error | How to Fix |
158
+ | ----------------------------------------- | ------------------------------------------------------------------------------- |
159
+ | `ELEVASIS_API_KEY not set` | Add `ELEVASIS_API_KEY=sk_...` to `.env` |
160
+ | `Schema validation failed` | Compare error field names to your schema. Check types and required vs optional. |
161
+ | `Cannot find module '@elevasis/sdk'` | Run `pnpm install` |
162
+ | `PlatformToolError: credential not found` | Check spelling and case in the command center UI |
163
+ | `Execution timeout (300s)` | Optimize handler or break into smaller steps |
164
+ | `Cannot find name 'z'` | Add `import { z } from 'zod'` |
165
+ | `outputSchema validation failed` | Check field names, types, and required fields against output schema |
166
+ | `NODE_ENV=development` in .env | Remove `NODE_ENV` from `.env` |
167
+
168
+ For the full error catalog with detailed diagnostic steps, see [Troubleshooting](troubleshooting.mdx).
169
+
170
+ ---
171
+
172
+ ## Design Decisions Guide
173
+
174
+ ### Single-Step vs Multi-Step
175
+
176
+ Use a single step when the workflow does one thing -- validate an email, format a message, call one API.
177
+
178
+ Use multiple steps when you have distinct phases (fetch data, process it, send a notification) or when you want separate error handling per phase. Each step failure is logged independently, making it easier to identify where something went wrong.
179
+
180
+ ### dev vs production Status
181
+
182
+ - **dev** -- Resource is visible in the dashboard and can be triggered manually, but will not auto-trigger from schedules or webhooks. Use while building and testing.
183
+ - **production** -- Resource is fully live. All trigger sources work. Use when you are confident it works correctly.
184
+
185
+ You can switch between them by changing `status` in the workflow config and redeploying.
186
+
187
+ ### When to Use Conditional Routing
188
+
189
+ Use `StepType.CONDITIONAL` when different inputs should follow different processing paths.
190
+
191
+ Example: score >= 80 goes to the approve path, score >= 50 goes to the review path, everything else goes to the reject path. Each path can have its own steps and logic.
192
+
193
+ Always include a `defaultTarget` fallback for inputs that do not match any condition. Without a fallback, an unmatched execution will fail.
194
+
195
+ ### When to Use Platform Tools vs Custom Code
196
+
197
+ Use platform tools when the integration exists in the tool catalog -- they handle auth, retries, and error normalization for you.
198
+
199
+ Write custom code (e.g., using `fetch` directly) only when you need a service or API method that is not in the catalog, or when you need fine-grained control over the HTTP request.
200
+
201
+ ---
202
+
203
+ **Last Updated:** 2026-02-26