@elevasis/sdk 0.4.8 → 0.4.10
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 +656 -46
- package/dist/index.d.ts +4343 -3
- package/dist/templates.js +156 -33
- package/dist/types/templates.d.ts +1 -1
- package/dist/types/worker/index.d.ts +8 -2
- package/dist/worker/index.js +350 -28
- package/package.json +1 -1
- package/reference/_navigation.md +60 -58
- package/reference/deployment/command-view.mdx +154 -0
- package/reference/framework/index.mdx +1 -1
- package/reference/framework/project-structure.mdx +34 -15
- package/reference/getting-started/index.mdx +12 -6
- package/reference/platform-tools/adapters.mdx +927 -0
- package/reference/platform-tools/examples.mdx +89 -106
- package/reference/platform-tools/index.mdx +61 -47
- package/reference/resources/patterns.mdx +23 -10
- package/reference/troubleshooting/common-errors.mdx +1 -1
- package/reference/_index.md +0 -95
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Command View
|
|
3
|
+
description: How the Command View graph works -- node types, relationships, what is enforced vs decorative, and what the platform needs to render your resource graph
|
|
4
|
+
loadWhen: "Deploying resources or building resources that invoke other resources"
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
The Command View is a visual graph in the Elevasis command center that shows how your organization's resources connect. Nodes are resources (workflows, agents, integrations). Edges are relationships you declare between them. The graph helps operators understand how automation flows through the system at a glance.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## Node Types
|
|
12
|
+
|
|
13
|
+
Every resource you deploy becomes a node in the Command View. Some nodes are executable (the platform runs them); others are visual-only (they exist for the graph but have no runtime behavior).
|
|
14
|
+
|
|
15
|
+
### Executable Nodes
|
|
16
|
+
|
|
17
|
+
| Type | What It Does | Deployed By |
|
|
18
|
+
| ---- | ------------ | ----------- |
|
|
19
|
+
| Workflow | Runs step handlers in sequence or branching paths | `elevasis deploy` |
|
|
20
|
+
| Agent | Autonomous LLM-powered resource with tools | `elevasis deploy` |
|
|
21
|
+
|
|
22
|
+
### Visual-Only Nodes
|
|
23
|
+
|
|
24
|
+
These exist solely for the Command View graph. They have no runtime behavior -- the platform does not execute them.
|
|
25
|
+
|
|
26
|
+
| Type | What It Represents | Why It Exists |
|
|
27
|
+
| ---- | ------------------ | ------------- |
|
|
28
|
+
| Trigger | A webhook or schedule that starts a workflow | Shows how executions begin |
|
|
29
|
+
| Integration | A credential reference (provider + credential name) | Shows which external services a resource uses |
|
|
30
|
+
| External Resource | A third-party automation (n8n, Make, Zapier) | Documents automations outside the platform |
|
|
31
|
+
| Human Checkpoint | A point where a human makes a decision | Shows where HITL approval gates exist |
|
|
32
|
+
|
|
33
|
+
Visual-only nodes are declarations. A `TriggerDefinition` does not set up actual trigger routing -- the webhook gateway routes independently. An `IntegrationDefinition` does not configure or connect to anything -- it is a visual node referencing a credential.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Relationships
|
|
38
|
+
|
|
39
|
+
Relationships are edges in the Command View graph. You declare them in `OrganizationResources` to tell the platform how resources connect.
|
|
40
|
+
|
|
41
|
+
### Declaring Relationships
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
const org: OrganizationResources = {
|
|
45
|
+
workflows: {
|
|
46
|
+
'score-lead': scoreLeadWorkflow,
|
|
47
|
+
'send-proposal': sendProposalWorkflow,
|
|
48
|
+
},
|
|
49
|
+
agents: {
|
|
50
|
+
'research-agent': researchAgent,
|
|
51
|
+
},
|
|
52
|
+
relationships: {
|
|
53
|
+
'score-lead': {
|
|
54
|
+
triggers: {
|
|
55
|
+
workflows: ['send-proposal'], // score-lead triggers send-proposal
|
|
56
|
+
agents: ['research-agent'], // score-lead triggers research-agent
|
|
57
|
+
},
|
|
58
|
+
uses: {
|
|
59
|
+
integrations: ['attio-integration'], // score-lead uses Attio
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Relationship Fields
|
|
67
|
+
|
|
68
|
+
| Field | Type | Meaning |
|
|
69
|
+
| ----- | ---- | ------- |
|
|
70
|
+
| `triggers.workflows` | `string[]` | Workflows this resource starts |
|
|
71
|
+
| `triggers.agents` | `string[]` | Agents this resource starts |
|
|
72
|
+
| `uses.integrations` | `string[]` | Integrations this resource depends on |
|
|
73
|
+
|
|
74
|
+
All referenced IDs must exist in the same organization. Missing targets cause a validation error at deploy time.
|
|
75
|
+
|
|
76
|
+
### Relationships Are Declarations, Not Routing
|
|
77
|
+
|
|
78
|
+
Relationships tell the Command View what edges to draw. They do **not** create execution paths. If you declare that workflow A triggers workflow B, the platform does not automatically route A's output to B. Your handler code must explicitly invoke B using the `execution` adapter or `platform.call()`.
|
|
79
|
+
|
|
80
|
+
This means the graph can drift from reality:
|
|
81
|
+
|
|
82
|
+
- If your code invokes resource B but you forgot to declare the relationship, the edge is **missing** from the graph
|
|
83
|
+
- If you declared a relationship to resource B but your code never invokes it, the edge is **stale** in the graph
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## What Is Enforced vs Decorative
|
|
88
|
+
|
|
89
|
+
| Category | Validated at Deploy | Matches Runtime | Status |
|
|
90
|
+
| -------- | ------------------- | --------------- | ------ |
|
|
91
|
+
| Resource IDs unique | Yes | Yes | **Enforced** |
|
|
92
|
+
| Input schema matches execution interface | Yes | Yes | **Enforced** |
|
|
93
|
+
| Relationship targets exist | Yes | No -- invocations are hardcoded strings in handlers | **Decorative** |
|
|
94
|
+
| Trigger routing | No | No -- webhook handlers route independently | **Decorative** |
|
|
95
|
+
| Tool availability per agent | No | No -- tools built dynamically at runtime | **Decorative** |
|
|
96
|
+
| Model config | Yes (provider + model valid) | No -- runtime uses environment config | **Decorative** |
|
|
97
|
+
| Integration usage | Partial (IDs checked) | No -- credentials resolved at runtime | **Decorative** |
|
|
98
|
+
|
|
99
|
+
**Enforced** means the platform rejects invalid state. **Decorative** means the platform trusts your declaration but does not verify it matches what the code actually does.
|
|
100
|
+
|
|
101
|
+
### What This Means for You
|
|
102
|
+
|
|
103
|
+
- Keep relationships in sync with your handler code. When you add an `execution.trigger('other-resource')` call, add the corresponding relationship declaration.
|
|
104
|
+
- When you remove an invocation, remove the relationship.
|
|
105
|
+
- The Command View is only as accurate as your declarations.
|
|
106
|
+
|
|
107
|
+
---
|
|
108
|
+
|
|
109
|
+
## Deploy-Time Validation
|
|
110
|
+
|
|
111
|
+
When you run `elevasis deploy` or `elevasis check`, the SDK validates your resource definitions locally using the same `ResourceRegistry` the platform uses.
|
|
112
|
+
|
|
113
|
+
### What Gets Checked
|
|
114
|
+
|
|
115
|
+
- **Duplicate resource IDs** -- two resources with the same key in `workflows` or `agents`
|
|
116
|
+
- **Relationship targets exist** -- every ID in `triggers` and `uses` must match a resource or integration in the same `OrganizationResources`
|
|
117
|
+
- **Model configuration** -- agent model params (provider, model name, temperature bounds) are valid
|
|
118
|
+
- **Step chains** -- `next.target` values in multi-step workflows point to existing step names
|
|
119
|
+
|
|
120
|
+
### What Does Not Get Checked
|
|
121
|
+
|
|
122
|
+
- Whether your handler code actually invokes the resources you declared in relationships
|
|
123
|
+
- Whether your handler code invokes resources you did **not** declare in relationships
|
|
124
|
+
- Whether triggers route to the workflows you declared
|
|
125
|
+
- Whether agents use the tools you expect
|
|
126
|
+
|
|
127
|
+
These are the decorative gaps listed above. The graph is a best-effort representation that depends on you keeping declarations in sync with code.
|
|
128
|
+
|
|
129
|
+
### Validation Error Examples
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
ERROR Relationship target 'send-proposal' not found in organization resources
|
|
133
|
+
Resource: score-lead
|
|
134
|
+
Field: relationships.triggers.workflows
|
|
135
|
+
|
|
136
|
+
ERROR Duplicate resource ID 'score-lead' in organization
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Fix relationship errors by checking that the target resource ID is spelled correctly and exists in your `OrganizationResources` export. If the resource was renamed or removed, update the relationship to match.
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Graph Serialization
|
|
144
|
+
|
|
145
|
+
The platform converts your resource definitions and relationships into a visual graph using two data structures:
|
|
146
|
+
|
|
147
|
+
- **`CommandViewNode`** -- one per resource (workflow, agent, trigger, integration, etc.). Contains the resource ID, type, name, status, and metadata.
|
|
148
|
+
- **`CommandViewEdge`** -- one per relationship. Contains source node, target node, and edge type (triggers, uses).
|
|
149
|
+
|
|
150
|
+
The `buildEdges()` function in the platform registry reads your `relationships` declarations and produces `CommandViewEdge[]`. This is a pure transformation -- it does not add or remove edges based on runtime behavior.
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
**Last Updated:** 2026-03-02
|
|
@@ -12,23 +12,39 @@ loadWhen: "Understanding scaffolded files or project layout"
|
|
|
12
12
|
|
|
13
13
|
### `src/index.ts`
|
|
14
14
|
|
|
15
|
-
The registry entry point for your workspace. This file
|
|
15
|
+
The registry entry point for your workspace. This file aggregates resources from domain barrel files and re-exports them as an `OrganizationResources` default export. It does not contain workflow logic itself -- its sole job is aggregation:
|
|
16
16
|
|
|
17
17
|
```ts
|
|
18
18
|
import type { OrganizationResources } from '@elevasis/sdk'
|
|
19
|
-
import
|
|
19
|
+
import * as operations from './operations/index.js'
|
|
20
|
+
import * as example from './example/index.js'
|
|
20
21
|
|
|
21
22
|
const org: OrganizationResources = {
|
|
22
|
-
workflows: [
|
|
23
|
+
workflows: [
|
|
24
|
+
...operations.workflows,
|
|
25
|
+
...example.workflows,
|
|
26
|
+
],
|
|
27
|
+
agents: [
|
|
28
|
+
...operations.agents,
|
|
29
|
+
...example.agents,
|
|
30
|
+
],
|
|
23
31
|
}
|
|
24
32
|
export default org
|
|
25
33
|
```
|
|
26
34
|
|
|
27
|
-
|
|
35
|
+
Each domain directory exports `workflows` and `agents` arrays via an `index.ts` barrel. When you add a new domain, import it here and spread its arrays. The `/resource workflow` command updates the appropriate domain barrel automatically.
|
|
28
36
|
|
|
29
|
-
### `src/
|
|
37
|
+
### `src/operations/platform-status.ts`
|
|
30
38
|
|
|
31
|
-
|
|
39
|
+
A multi-step workflow demonstrating real platform API usage. Calls `platform.call({ tool: 'status', method: 'overview' })` to gather platform status data, then passes it to `platform.call({ tool: 'llm', method: 'generate' })` for a natural language summary. Shows the pattern for workflows that interact with platform tools and chain steps with `StepType.LINEAR`.
|
|
40
|
+
|
|
41
|
+
### `src/example/echo.ts`
|
|
42
|
+
|
|
43
|
+
The starter workflow, scaffolded to demonstrate the per-file pattern: one workflow per file with its own Zod input/output schemas, config object, contract, and step handler. Replace this domain with your own when you're ready.
|
|
44
|
+
|
|
45
|
+
### `src/shared/`
|
|
46
|
+
|
|
47
|
+
Cross-domain shared types and utilities. This directory starts empty (`.gitkeep`). Place code here when two or more domains share the same utility -- for example, formatters, shared types, or notification helpers. Domain-specific shared code goes in `<domain>/shared/` instead.
|
|
32
48
|
|
|
33
49
|
### `elevasis.config.ts`
|
|
34
50
|
|
|
@@ -38,7 +54,7 @@ Project-level configuration. The scaffolded file includes `templateVersion`, whi
|
|
|
38
54
|
import type { ElevasConfig } from '@elevasis/sdk'
|
|
39
55
|
|
|
40
56
|
export default {
|
|
41
|
-
templateVersion:
|
|
57
|
+
templateVersion: 5,
|
|
42
58
|
// defaultStatus: 'dev', // Default status for new resources ('dev' | 'production')
|
|
43
59
|
// dev: { port: 5170 }, // Local API port (internal development only)
|
|
44
60
|
} satisfies ElevasConfig
|
|
@@ -92,7 +108,9 @@ Only `src/` and `docs/` are scaffolded by `elevasis init`. The following directo
|
|
|
92
108
|
|
|
93
109
|
| Directory | Created by | When |
|
|
94
110
|
|-----------|-----------|------|
|
|
95
|
-
| `src/
|
|
111
|
+
| `src/operations/` | `elevasis init` (default) | Always -- platform-status workflow lives here |
|
|
112
|
+
| `src/example/` | `elevasis init` (default) | Always -- echo starter workflow lives here (replace with your own) |
|
|
113
|
+
| `src/shared/` | `elevasis init` (default) | Always -- cross-domain shared utilities (starts empty) |
|
|
96
114
|
| `docs/` | `elevasis init` (default) | Always |
|
|
97
115
|
| `docs/in-progress/` | Agent (on first `/docs checkpoint`) | When you save work-in-progress across sessions |
|
|
98
116
|
| `docs/navigation.mdx` | Agent (on first `/meta deploy`) | Auto-generated and updated on each deploy |
|
|
@@ -105,7 +123,7 @@ This structure keeps the initial workspace minimal and adds directories only whe
|
|
|
105
123
|
|
|
106
124
|
### `src/lib/`
|
|
107
125
|
|
|
108
|
-
|
|
126
|
+
Legacy shared code directory. In v5+ projects, use `src/shared/` for cross-domain utilities instead. The agent may still create `src/lib/` in older projects that predate the domain-based organization. Included in the esbuild bundle alongside workflow code.
|
|
109
127
|
|
|
110
128
|
### `data/`
|
|
111
129
|
|
|
@@ -250,7 +268,7 @@ Applies pre-built workflow templates to your workspace. Three operations:
|
|
|
250
268
|
|
|
251
269
|
- **No arguments** -- List available template categories (Data Collection, Data Processing, Communication, CRM, Documents, AI, Scheduling)
|
|
252
270
|
- **`<category>`** -- Show templates in a category with descriptions
|
|
253
|
-
- **`apply <name>`** -- Generate a workflow from a template: writes to
|
|
271
|
+
- **`apply <name>`** -- Generate a workflow from a template: writes to the appropriate domain directory, wires into the domain barrel, prompts for credential setup if needed, and runs `elevasis check` to validate
|
|
254
272
|
|
|
255
273
|
Templates are documentation files bundled with the SDK, not rigid copy-paste code. The agent reads the template and generates a workflow adapted to your existing schemas, credentials, and naming conventions.
|
|
256
274
|
|
|
@@ -260,12 +278,13 @@ Templates are documentation files bundled with the SDK, not rigid copy-paste cod
|
|
|
260
278
|
|
|
261
279
|
Not all scaffolded files participate in template updates. Files fall into two categories:
|
|
262
280
|
|
|
263
|
-
**SCAFFOLD_FILES total:
|
|
281
|
+
**SCAFFOLD_FILES total: 27**
|
|
264
282
|
|
|
265
|
-
**INIT_ONLY** (
|
|
283
|
+
**INIT_ONLY** (14 files) -- Written once during `elevasis init`, never updated by `elevasis update`:
|
|
266
284
|
- `package.json`, `pnpm-workspace.yaml`, `tsconfig.json`
|
|
267
285
|
- `.env`, `.env.example`, `.npmrc`
|
|
268
|
-
- `src/index.ts`, `src/
|
|
286
|
+
- `src/index.ts`, `src/operations/platform-status.ts`, `src/operations/index.ts`, `src/example/echo.ts`, `src/example/index.ts`, `src/shared/.gitkeep`
|
|
287
|
+
- `docs/index.mdx`, `docs/in-progress/.gitkeep`
|
|
269
288
|
|
|
270
289
|
**MANAGED** (13 files) -- Written during `elevasis init` and checked/updatable by `elevasis update`:
|
|
271
290
|
- `elevasis.config.ts`, `.gitignore`, `CLAUDE.md`, `docs/navigation.mdx`
|
|
@@ -280,7 +299,7 @@ Run `elevasis update` after installing a new SDK version to bring managed files
|
|
|
280
299
|
| File | When You Edit It |
|
|
281
300
|
|------|-----------------|
|
|
282
301
|
| `src/index.ts` | Adding or removing resources (the `/resource` command does this automatically) |
|
|
283
|
-
| `src
|
|
302
|
+
| `src/<domain>/*.ts` | Writing and modifying workflow logic (organized by business domain) |
|
|
284
303
|
| `docs/index.mdx` | Updating project documentation |
|
|
285
304
|
| `docs/navigation.mdx` | Never -- auto-generated by `/meta deploy` |
|
|
286
305
|
| `docs/priorities.mdx` | When goals or priorities change |
|
|
@@ -291,4 +310,4 @@ Run `elevasis update` after installing a new SDK version to bring managed files
|
|
|
291
310
|
|
|
292
311
|
---
|
|
293
312
|
|
|
294
|
-
**Last Updated:** 2026-02-
|
|
313
|
+
**Last Updated:** 2026-02-27
|
|
@@ -29,7 +29,7 @@ elevasis init my-project
|
|
|
29
29
|
cd my-project
|
|
30
30
|
```
|
|
31
31
|
|
|
32
|
-
The command scaffolds
|
|
32
|
+
The command scaffolds 27 files covering configuration, source, documentation, and Claude Code integration:
|
|
33
33
|
|
|
34
34
|
```
|
|
35
35
|
my-project/
|
|
@@ -47,9 +47,15 @@ my-project/
|
|
|
47
47
|
│ ├── tutorial.md # Progressive learning
|
|
48
48
|
│ └── profile.md # View and update user profile
|
|
49
49
|
├── src/
|
|
50
|
-
│ ├── index.ts # Registry entry point
|
|
51
|
-
│
|
|
52
|
-
│
|
|
50
|
+
│ ├── index.ts # Registry entry point (aggregates domain barrels)
|
|
51
|
+
│ ├── operations/
|
|
52
|
+
│ │ ├── index.ts # Domain barrel (exports workflows + agents)
|
|
53
|
+
│ │ └── platform-status.ts # Platform status workflow (real API example)
|
|
54
|
+
│ ├── example/
|
|
55
|
+
│ │ ├── index.ts # Domain barrel (exports workflows + agents)
|
|
56
|
+
│ │ └── echo.ts # Starter workflow (replace with your own)
|
|
57
|
+
│ └── shared/
|
|
58
|
+
│ └── .gitkeep # Cross-domain shared utilities
|
|
53
59
|
├── docs/
|
|
54
60
|
│ ├── index.mdx # Starter documentation page
|
|
55
61
|
│ └── in-progress/
|
|
@@ -70,7 +76,7 @@ The scaffolded `elevasis.config.ts` includes a `templateVersion` field that trac
|
|
|
70
76
|
import type { ElevasConfig } from '@elevasis/sdk'
|
|
71
77
|
|
|
72
78
|
export default {
|
|
73
|
-
templateVersion:
|
|
79
|
+
templateVersion: 5,
|
|
74
80
|
} satisfies ElevasConfig
|
|
75
81
|
```
|
|
76
82
|
|
|
@@ -145,4 +151,4 @@ When a new SDK version is released, run `elevasis update` to bring your project'
|
|
|
145
151
|
|
|
146
152
|
---
|
|
147
153
|
|
|
148
|
-
**Last Updated:** 2026-02-
|
|
154
|
+
**Last Updated:** 2026-02-27
|