@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.
- package/dist/cli.cjs +745 -409
- package/dist/index.d.ts +32 -0
- package/dist/index.js +68 -0
- package/dist/templates.js +254 -37
- package/dist/worker/index.js +3 -7
- package/package.json +1 -1
- package/reference/cli.mdx +568 -505
- package/reference/concepts.mdx +4 -43
- package/reference/deployment/api.mdx +297 -297
- package/reference/deployment/command-center.mdx +9 -12
- package/reference/deployment/index.mdx +7 -7
- package/reference/framework/agent.mdx +6 -18
- package/reference/framework/interaction-guidance.mdx +182 -182
- package/reference/framework/memory.mdx +3 -24
- package/reference/framework/project-structure.mdx +277 -298
- package/reference/framework/tutorial-system.mdx +13 -44
- package/reference/getting-started.mdx +152 -148
- package/reference/index.mdx +28 -14
- package/reference/platform-tools/adapters.mdx +868 -1072
- package/reference/platform-tools/index.mdx +3 -3
- package/reference/resources/index.mdx +339 -341
- package/reference/resources/patterns.mdx +355 -354
- package/reference/resources/types.mdx +207 -207
- package/reference/roadmap.mdx +163 -147
- package/reference/runtime.mdx +2 -25
- package/reference/troubleshooting.mdx +223 -210
|
@@ -1,207 +1,207 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: SDK Types
|
|
3
|
-
description: Complete type reference for @elevasis/sdk -- package exports, re-exported platform types, ElevasConfig interface, StepHandler context, and runtime values
|
|
4
|
-
loadWhen: "Looking up type signatures or SDK exports"
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
`@elevasis/sdk` is published to the public npm registry. It bundles all platform types from `@repo/core` into a single self-contained type declaration file with zero internal monorepo references. External developers install the package and get full TypeScript support without any monorepo tooling.
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
pnpm add @elevasis/sdk zod
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Zod is a peer dependency and must be installed separately.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Package Exports
|
|
18
|
-
|
|
19
|
-
The package exposes two subpaths:
|
|
20
|
-
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"exports": {
|
|
24
|
-
".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
|
|
25
|
-
"./worker": { "import": "./dist/worker/index.js" }
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
- `@elevasis/sdk` -- all types plus runtime values (`StepType`, `ExecutionError`, `ToolingError`)
|
|
31
|
-
- `@elevasis/sdk/worker` -- worker runtime module (`startWorker`, `platform`, `PlatformToolError`)
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Type Re-exports
|
|
36
|
-
|
|
37
|
-
All types come from the platform core. The SDK re-exports them grouped by source domain:
|
|
38
|
-
|
|
39
|
-
### Platform Types
|
|
40
|
-
|
|
41
|
-
| Type
|
|
42
|
-
|
|
|
43
|
-
| `ResourceDefinition`
|
|
44
|
-
| `ResourceType`
|
|
45
|
-
| `ResourceStatus`
|
|
46
|
-
| `ResourceDomain`
|
|
47
|
-
| `DomainDefinition`
|
|
48
|
-
| `OrganizationResources` | Top-level export shape: `{ workflows, agents }` |
|
|
49
|
-
| `TriggerDefinition`
|
|
50
|
-
| `IntegrationDefinition` | Integration configuration structure
|
|
51
|
-
| `WebhookProviderType`
|
|
52
|
-
| `WebhookTriggerConfig`
|
|
53
|
-
| `ScheduleTriggerConfig` | Cron/schedule trigger configuration
|
|
54
|
-
| `EventTriggerConfig`
|
|
55
|
-
| `TriggerConfig`
|
|
56
|
-
|
|
57
|
-
### Execution Types
|
|
58
|
-
|
|
59
|
-
| Type
|
|
60
|
-
|
|
|
61
|
-
| `WorkflowDefinition`
|
|
62
|
-
| `WorkflowStep`
|
|
63
|
-
| `WorkflowConfig`
|
|
64
|
-
| `StepHandler`
|
|
65
|
-
| `NextConfig`
|
|
66
|
-
| `LinearNext`
|
|
67
|
-
| `ConditionalNext`
|
|
68
|
-
| `StepType`
|
|
69
|
-
| `AgentDefinition`
|
|
70
|
-
| `AgentConfig`
|
|
71
|
-
| `AgentConstraints`
|
|
72
|
-
| `Tool`
|
|
73
|
-
| `ToolExecutionOptions` | Options passed when a tool executes
|
|
74
|
-
| `ToolingErrorType`
|
|
75
|
-
| `ToolingError`
|
|
76
|
-
| `ExecutionError`
|
|
77
|
-
| `Contract`
|
|
78
|
-
| `ExecutionContext`
|
|
79
|
-
| `ExecutionMetadata`
|
|
80
|
-
| `LLMModel`
|
|
81
|
-
| `ModelConfig`
|
|
82
|
-
| `ExecutionInterface`
|
|
83
|
-
|
|
84
|
-
### Form and Metrics Types
|
|
85
|
-
|
|
86
|
-
| Type
|
|
87
|
-
|
|
|
88
|
-
| `FormField`
|
|
89
|
-
| `FormSchema`
|
|
90
|
-
| `FormFieldType`
|
|
91
|
-
| `ResourceMetricsConfig` | Observability configuration for a resource |
|
|
92
|
-
|
|
93
|
-
---
|
|
94
|
-
|
|
95
|
-
## ElevasConfig
|
|
96
|
-
|
|
97
|
-
`ElevasConfig` is the only type defined by the SDK itself (not re-exported from the platform). It configures SDK behavior via `elevasis.config.ts` in your project root.
|
|
98
|
-
|
|
99
|
-
```typescript
|
|
100
|
-
export interface ElevasConfig {
|
|
101
|
-
defaultStatus?: ResourceStatus
|
|
102
|
-
dev?: { port?: number }
|
|
103
|
-
}
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
| Field
|
|
107
|
-
|
|
|
108
|
-
| `defaultStatus` | `'dev' | '
|
|
109
|
-
| `dev.port`
|
|
110
|
-
|
|
111
|
-
Usage:
|
|
112
|
-
|
|
113
|
-
```typescript
|
|
114
|
-
import type { ElevasConfig } from '@elevasis/sdk';
|
|
115
|
-
|
|
116
|
-
const config: ElevasConfig = {
|
|
117
|
-
defaultStatus: 'dev',
|
|
118
|
-
dev: { port: 3002 },
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export default config;
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
|
|
126
|
-
## StepHandler Context
|
|
127
|
-
|
|
128
|
-
`StepHandler` accepts two parameters: `input` (validated by your contract schema) and `context` (runtime metadata). The `context` parameter is not optional in the type definition, but TypeScript allows you to omit it in your handler function -- writing `async (input) => { ... }` works without error.
|
|
129
|
-
|
|
130
|
-
```typescript
|
|
131
|
-
import type { StepHandler, ExecutionContext } from '@elevasis/sdk';
|
|
132
|
-
|
|
133
|
-
const handler: StepHandler = async (input, context: ExecutionContext) => {
|
|
134
|
-
const { executionId, organizationId, resourceId, logger, store } = context;
|
|
135
|
-
|
|
136
|
-
logger.info('Processing', { executionId, resourceId });
|
|
137
|
-
|
|
138
|
-
await store.set('checkpoint', JSON.stringify({ step: 'started' }));
|
|
139
|
-
|
|
140
|
-
return { done: true };
|
|
141
|
-
};
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
### ExecutionContext Fields
|
|
145
|
-
|
|
146
|
-
| Field
|
|
147
|
-
|
|
|
148
|
-
| `executionId`
|
|
149
|
-
| `organizationId` | `string` | Your organization identifier
|
|
150
|
-
| `resourceId`
|
|
151
|
-
| `logger`
|
|
152
|
-
| `store`
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
## Runtime Values
|
|
157
|
-
|
|
158
|
-
Three runtime values are exported from `@elevasis/sdk` as JavaScript values (not just types). They are defined directly in the SDK package to avoid pulling in the full platform execution engine.
|
|
159
|
-
|
|
160
|
-
### StepType
|
|
161
|
-
|
|
162
|
-
An enum used to configure step routing in multi-step workflows.
|
|
163
|
-
|
|
164
|
-
```typescript
|
|
165
|
-
import { StepType } from '@elevasis/sdk';
|
|
166
|
-
|
|
167
|
-
// StepType.LINEAR -- fixed next step via { target: 'stepName' }
|
|
168
|
-
// StepType.CONDITIONAL -- branching via { routes: [...],
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
### ToolingError
|
|
172
|
-
|
|
173
|
-
Thrown by platform tool calls when a tool fails. Use this class to distinguish tool failures from general errors in `try/catch` blocks.
|
|
174
|
-
|
|
175
|
-
```typescript
|
|
176
|
-
import { ToolingError } from '@elevasis/sdk';
|
|
177
|
-
|
|
178
|
-
try {
|
|
179
|
-
const result = await platform.call({ ... });
|
|
180
|
-
} catch (err) {
|
|
181
|
-
if (err instanceof ToolingError) {
|
|
182
|
-
// tool-specific failure -- check err.type for category
|
|
183
|
-
console.error('Tool failed:', err.type, err.message);
|
|
184
|
-
} else {
|
|
185
|
-
throw err; // re-throw unexpected errors
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
### ExecutionError
|
|
191
|
-
|
|
192
|
-
Represents a failure at the execution level (distinct from a tool-level failure). Throw this from a step handler to signal that the execution should be marked as failed with a structured error message.
|
|
193
|
-
|
|
194
|
-
```typescript
|
|
195
|
-
import { ExecutionError } from '@elevasis/sdk';
|
|
196
|
-
|
|
197
|
-
const handler = async (input) => {
|
|
198
|
-
if (!input.userId) {
|
|
199
|
-
throw new ExecutionError('userId is required', { code: 'MISSING_INPUT' });
|
|
200
|
-
}
|
|
201
|
-
return { result: 'ok' };
|
|
202
|
-
};
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
**Last Updated:** 2026-02-25
|
|
1
|
+
---
|
|
2
|
+
title: SDK Types
|
|
3
|
+
description: Complete type reference for @elevasis/sdk -- package exports, re-exported platform types, ElevasConfig interface, StepHandler context, and runtime values
|
|
4
|
+
loadWhen: "Looking up type signatures or SDK exports"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
`@elevasis/sdk` is published to the public npm registry. It bundles all platform types from `@repo/core` into a single self-contained type declaration file with zero internal monorepo references. External developers install the package and get full TypeScript support without any monorepo tooling.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pnpm add @elevasis/sdk zod
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Zod is a peer dependency and must be installed separately.
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Package Exports
|
|
18
|
+
|
|
19
|
+
The package exposes two subpaths:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"exports": {
|
|
24
|
+
".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" },
|
|
25
|
+
"./worker": { "import": "./dist/worker/index.js" }
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- `@elevasis/sdk` -- all types plus runtime values (`StepType`, `ExecutionError`, `ToolingError`)
|
|
31
|
+
- `@elevasis/sdk/worker` -- worker runtime module (`startWorker`, `platform`, `PlatformToolError`)
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Type Re-exports
|
|
36
|
+
|
|
37
|
+
All types come from the platform core. The SDK re-exports them grouped by source domain:
|
|
38
|
+
|
|
39
|
+
### Platform Types
|
|
40
|
+
|
|
41
|
+
| Type | Description |
|
|
42
|
+
| ----------------------- | ----------------------------------------------- |
|
|
43
|
+
| `ResourceDefinition` | Base interface for all resource types |
|
|
44
|
+
| `ResourceType` | Enum: `'workflow' | 'agent'` |
|
|
45
|
+
| `ResourceStatus` | Enum: `'dev' | 'prod'` |
|
|
46
|
+
| `ResourceDomain` | Domain classification for a resource |
|
|
47
|
+
| `DomainDefinition` | Structure for grouping resources by domain |
|
|
48
|
+
| `OrganizationResources` | Top-level export shape: `{ workflows, agents }` |
|
|
49
|
+
| `TriggerDefinition` | Base for trigger configuration |
|
|
50
|
+
| `IntegrationDefinition` | Integration configuration structure |
|
|
51
|
+
| `WebhookProviderType` | Supported webhook providers |
|
|
52
|
+
| `WebhookTriggerConfig` | Webhook trigger configuration |
|
|
53
|
+
| `ScheduleTriggerConfig` | Cron/schedule trigger configuration |
|
|
54
|
+
| `EventTriggerConfig` | Internal event trigger configuration |
|
|
55
|
+
| `TriggerConfig` | Union of all trigger config types |
|
|
56
|
+
|
|
57
|
+
### Execution Types
|
|
58
|
+
|
|
59
|
+
| Type | Description |
|
|
60
|
+
| ---------------------- | -------------------------------------------------------------------------------- |
|
|
61
|
+
| `WorkflowDefinition` | Complete workflow definition including config, contract, steps, entryPoint |
|
|
62
|
+
| `WorkflowStep` | Individual step definition with type, handler, and next routing |
|
|
63
|
+
| `WorkflowConfig` | Metadata block: name, description, status |
|
|
64
|
+
| `StepHandler` | Function type: `(input: unknown, context: StepContext) => Promise<unknown>` |
|
|
65
|
+
| `NextConfig` | Union of `LinearNext` and `ConditionalNext` |
|
|
66
|
+
| `LinearNext` | `{ type: 'linear', target: string }` -- fixed next step |
|
|
67
|
+
| `ConditionalNext` | `{ type: 'conditional', routes: Route[], default: string }` -- branching routing |
|
|
68
|
+
| `StepType` | Runtime enum: `LINEAR | CONDITIONAL` (also a runtime value -- see below) |
|
|
69
|
+
| `AgentDefinition` | Complete agent definition including config, agentConfig, tools |
|
|
70
|
+
| `AgentConfig` | Agent metadata: name, description, status |
|
|
71
|
+
| `AgentConstraints` | Execution limits for agents |
|
|
72
|
+
| `Tool` | Tool definition for agent use |
|
|
73
|
+
| `ToolExecutionOptions` | Options passed when a tool executes |
|
|
74
|
+
| `ToolingErrorType` | Enum of tool error categories |
|
|
75
|
+
| `ToolingError` | Error class for tool execution failures (also a runtime value -- see below) |
|
|
76
|
+
| `ExecutionError` | Error class for execution-level failures (also a runtime value -- see below) |
|
|
77
|
+
| `Contract` | Input/output Zod schema pair |
|
|
78
|
+
| `ExecutionContext` | Runtime context passed to step handlers |
|
|
79
|
+
| `ExecutionMetadata` | Metadata about a running execution |
|
|
80
|
+
| `LLMModel` | Model identifier: provider + model name |
|
|
81
|
+
| `ModelConfig` | Full model configuration including temperature and token limits |
|
|
82
|
+
| `ExecutionInterface` | Interface for triggering and inspecting executions |
|
|
83
|
+
|
|
84
|
+
### Form and Metrics Types
|
|
85
|
+
|
|
86
|
+
| Type | Description |
|
|
87
|
+
| ----------------------- | ------------------------------------------ |
|
|
88
|
+
| `FormField` | Individual form field definition |
|
|
89
|
+
| `FormSchema` | Collection of form fields |
|
|
90
|
+
| `FormFieldType` | Enum of supported field types |
|
|
91
|
+
| `ResourceMetricsConfig` | Observability configuration for a resource |
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## ElevasConfig
|
|
96
|
+
|
|
97
|
+
`ElevasConfig` is the only type defined by the SDK itself (not re-exported from the platform). It configures SDK behavior via `elevasis.config.ts` in your project root.
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
export interface ElevasConfig {
|
|
101
|
+
defaultStatus?: ResourceStatus
|
|
102
|
+
dev?: { port?: number }
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
| Field | Type | Default | Description |
|
|
107
|
+
| --------------- | ----------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
108
|
+
| `defaultStatus` | `'dev' | 'prod'` | `'prod'` | Default status applied to all resources that do not set their own `config.status`. Set to `'dev'` to keep resources inactive while building. |
|
|
109
|
+
| `dev.port` | `number` | `3001` | Local port for the development worker process. Change this if port 3001 conflicts with another service. |
|
|
110
|
+
|
|
111
|
+
Usage:
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
import type { ElevasConfig } from '@elevasis/sdk';
|
|
115
|
+
|
|
116
|
+
const config: ElevasConfig = {
|
|
117
|
+
defaultStatus: 'dev',
|
|
118
|
+
dev: { port: 3002 },
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export default config;
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## StepHandler Context
|
|
127
|
+
|
|
128
|
+
`StepHandler` accepts two parameters: `input` (validated by your contract schema) and `context` (runtime metadata). The `context` parameter is not optional in the type definition, but TypeScript allows you to omit it in your handler function -- writing `async (input) => { ... }` works without error.
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
import type { StepHandler, ExecutionContext } from '@elevasis/sdk';
|
|
132
|
+
|
|
133
|
+
const handler: StepHandler = async (input, context: ExecutionContext) => {
|
|
134
|
+
const { executionId, organizationId, resourceId, logger, store } = context;
|
|
135
|
+
|
|
136
|
+
logger.info('Processing', { executionId, resourceId });
|
|
137
|
+
|
|
138
|
+
await store.set('checkpoint', JSON.stringify({ step: 'started' }));
|
|
139
|
+
|
|
140
|
+
return { done: true };
|
|
141
|
+
};
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### ExecutionContext Fields
|
|
145
|
+
|
|
146
|
+
| Field | Type | Description |
|
|
147
|
+
| ---------------- | -------- | ----------------------------------------------------------------------------------------------------------------- |
|
|
148
|
+
| `executionId` | `string` | Unique identifier for this execution run |
|
|
149
|
+
| `organizationId` | `string` | Your organization identifier |
|
|
150
|
+
| `resourceId` | `string` | Identifier of the executing workflow or agent |
|
|
151
|
+
| `logger` | `Logger` | Structured logger -- messages appear in the Elevasis dashboard under the execution |
|
|
152
|
+
| `store` | `Store` | Key-value store scoped to the current execution. Useful for passing data between steps or checkpointing progress. |
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## Runtime Values
|
|
157
|
+
|
|
158
|
+
Three runtime values are exported from `@elevasis/sdk` as JavaScript values (not just types). They are defined directly in the SDK package to avoid pulling in the full platform execution engine.
|
|
159
|
+
|
|
160
|
+
### StepType
|
|
161
|
+
|
|
162
|
+
An enum used to configure step routing in multi-step workflows.
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
import { StepType } from '@elevasis/sdk';
|
|
166
|
+
|
|
167
|
+
// StepType.LINEAR -- fixed next step via { target: 'stepName' }
|
|
168
|
+
// StepType.CONDITIONAL -- branching via { type: 'conditional', routes: [...], default: 'stepName' }
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### ToolingError
|
|
172
|
+
|
|
173
|
+
Thrown by platform tool calls when a tool fails. Use this class to distinguish tool failures from general errors in `try/catch` blocks.
|
|
174
|
+
|
|
175
|
+
```typescript
|
|
176
|
+
import { ToolingError } from '@elevasis/sdk';
|
|
177
|
+
|
|
178
|
+
try {
|
|
179
|
+
const result = await platform.call({ ... });
|
|
180
|
+
} catch (err) {
|
|
181
|
+
if (err instanceof ToolingError) {
|
|
182
|
+
// tool-specific failure -- check err.type for category
|
|
183
|
+
console.error('Tool failed:', err.type, err.message);
|
|
184
|
+
} else {
|
|
185
|
+
throw err; // re-throw unexpected errors
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
### ExecutionError
|
|
191
|
+
|
|
192
|
+
Represents a failure at the execution level (distinct from a tool-level failure). Throw this from a step handler to signal that the execution should be marked as failed with a structured error message.
|
|
193
|
+
|
|
194
|
+
```typescript
|
|
195
|
+
import { ExecutionError } from '@elevasis/sdk';
|
|
196
|
+
|
|
197
|
+
const handler = async (input) => {
|
|
198
|
+
if (!input.userId) {
|
|
199
|
+
throw new ExecutionError('userId is required', { code: 'MISSING_INPUT' });
|
|
200
|
+
}
|
|
201
|
+
return { result: 'ok' };
|
|
202
|
+
};
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
**Last Updated:** 2026-02-25
|