@elevasis/sdk 0.5.12 → 0.5.14

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 (37) hide show
  1. package/dist/cli.cjs +144 -118
  2. package/dist/index.d.ts +19 -253
  3. package/dist/index.js +20 -9
  4. package/dist/templates.js +62 -59
  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/{cli/index.mdx → cli.mdx} +568 -505
  10. package/reference/concepts.mdx +164 -0
  11. package/reference/deployment/api.mdx +297 -297
  12. package/reference/deployment/command-center.mdx +226 -0
  13. package/reference/deployment/index.mdx +158 -153
  14. package/reference/framework/agent.mdx +156 -151
  15. package/reference/framework/index.mdx +182 -103
  16. package/reference/{developer → framework}/interaction-guidance.mdx +182 -182
  17. package/reference/framework/memory.mdx +326 -347
  18. package/reference/framework/project-structure.mdx +277 -298
  19. package/reference/framework/tutorial-system.mdx +222 -0
  20. package/reference/{getting-started/index.mdx → getting-started.mdx} +152 -148
  21. package/reference/index.mdx +131 -114
  22. package/reference/platform-tools/adapters.mdx +868 -929
  23. package/reference/platform-tools/index.mdx +354 -195
  24. package/reference/resources/index.mdx +339 -336
  25. package/reference/resources/patterns.mdx +355 -354
  26. package/reference/resources/types.mdx +207 -207
  27. package/reference/{roadmap/index.mdx → roadmap.mdx} +163 -147
  28. package/reference/{runtime/index.mdx → runtime.mdx} +173 -141
  29. package/reference/{troubleshooting/common-errors.mdx → troubleshooting.mdx} +223 -210
  30. package/dist/types/worker/adapters/trello.d.ts +0 -14
  31. package/reference/concepts/index.mdx +0 -203
  32. package/reference/deployment/command-center-ui.mdx +0 -151
  33. package/reference/deployment/command-view.mdx +0 -154
  34. package/reference/framework/documentation.mdx +0 -92
  35. package/reference/platform-tools/examples.mdx +0 -170
  36. package/reference/runtime/limits.mdx +0 -75
  37. package/reference/security/credentials.mdx +0 -141
@@ -1,141 +0,0 @@
1
- ---
2
- title: "Credential Security"
3
- description: "Three-layer credential model: platform tools (server-side injection), http tool (arbitrary APIs), getCredential() (explicit opt-in raw access) -- .env scope and security boundaries"
4
- loadWhen: "Setting up integrations or configuring tool access"
5
- ---
6
-
7
- This reference covers the Elevasis credential security model. Read it when helping a user connect to an external service, set up platform tools, or understand why environment variables are not used in workflows.
8
-
9
- ---
10
-
11
- ## The Core Rule
12
-
13
- Integration credentials are never stored in `.env` and never available via `process.env` inside worker threads.
14
-
15
- Credentials live in the platform credential system, created via the command center UI. Worker threads access credentials only through controlled channels: `platform.call()` (server-side injection) or `platform.getCredential()` (explicit opt-in).
16
-
17
- `.env` contains only `ELEVASIS_API_KEY`, used by the CLI for authentication. It is never uploaded to the platform and never injected into workers.
18
-
19
- ---
20
-
21
- ## Three-Layer Model
22
-
23
- ### Layer 1: Platform Tools (Default)
24
-
25
- All platform tools resolve credentials server-side. The tool dispatcher in the API process looks up the credential by name, injects it into the service call, and returns only the result. Credential values never cross the postMessage boundary into the worker.
26
-
27
- ```typescript
28
- // Credential 'my-gmail' is resolved server-side -- value never enters worker memory
29
- const result = await platform.call({
30
- tool: 'gmail',
31
- method: 'sendEmail',
32
- credential: 'my-gmail',
33
- params: { to: '...', subject: '...', body: '...' },
34
- })
35
- ```
36
-
37
- This is the default pattern for all integrations that have a platform adapter (Gmail, Attio, Stripe, Resend, etc.).
38
-
39
- ### Layer 2: HTTP Platform Tool
40
-
41
- For APIs without a dedicated platform adapter, use the `http` platform tool. Credentials are resolved and injected server-side before the outgoing HTTP request.
42
-
43
- ```typescript
44
- const result = await platform.call({
45
- tool: 'http',
46
- method: 'request',
47
- credential: 'my-custom-api',
48
- params: {
49
- url: 'https://api.example.com/v1/data',
50
- method: 'GET',
51
- headers: { 'Content-Type': 'application/json' },
52
- },
53
- })
54
- // result = { status: 200, headers: {...}, body: {...} }
55
- ```
56
-
57
- **Supported credential injection patterns:**
58
-
59
- | Pattern | Credential Config | How Injected |
60
- | --- | --- | --- |
61
- | Bearer token | `{ type: 'bearer', token: 'sk_...' }` | `Authorization: Bearer sk_...` header |
62
- | API key header | `{ type: 'api-key-header', header: 'X-API-Key', key: 'ak_...' }` | Custom header with key value |
63
- | Basic auth | `{ type: 'basic', username: '...', password: '...' }` | `Authorization: Basic base64(user:pass)` header |
64
- | Query parameter | `{ type: 'query-param', param: 'api_key', value: 'ak_...' }` | Appended to URL query string |
65
- | Body field | `{ type: 'body-field', field: 'apiKey', value: 'ak_...' }` | Merged into JSON request body |
66
- | Custom header | `{ type: 'custom-header', header: 'X-Custom', value: '...' }` | Arbitrary header with value |
67
-
68
- The credential type is selected when creating the credential in the command center UI.
69
-
70
- ### Layer 3: getCredential() (Explicit Opt-In)
71
-
72
- For cases where a third-party SDK must be initialized with a raw key (e.g., `new Stripe(key)`), use `platform.getCredential()`. This is an explicit opt-in that causes the credential value to enter worker memory.
73
-
74
- ```typescript
75
- import { platform } from '@elevasis/sdk/worker'
76
-
77
- // Explicit opt-in -- secret enters worker memory for duration of execution
78
- const cred = await platform.getCredential('my-stripe-key')
79
- const stripe = new Stripe(cred.credentials.secretKey)
80
- ```
81
-
82
- `getCredential()` returns `{ provider: string, credentials: Record<string, string> }`. The fields in `credentials` depend on the credential type stored in the command center.
83
-
84
- **Security guardrails:**
85
-
86
- - All `getCredential()` calls are logged with credential name, deployment ID, and execution ID
87
- - Workers are ephemeral (destroyed after each execution) -- no credential persistence
88
- - Use `platform.call()` with the `http` tool instead when possible
89
-
90
- ---
91
-
92
- ## Credential Setup
93
-
94
- Credentials are created in the command center UI:
95
-
96
- 1. Open the Elevasis command center
97
- 2. Navigate to Credentials
98
- 3. Click "Add Credential"
99
- 4. Enter a name (e.g., `my-gmail`, `production-attio`, `custom-api`)
100
- 5. Select the credential type (bearer, api-key-header, basic, etc.)
101
- 6. Enter the secret values
102
- 7. Save
103
-
104
- The credential name is what you pass as `credential: 'my-gmail'` in `platform.call()`.
105
-
106
- Credential names are case-sensitive. A mismatch causes a `PlatformToolError` with the message "credential not found."
107
-
108
- ---
109
-
110
- ## .env Scope
111
-
112
- `.env` in your workspace contains only:
113
-
114
- ```
115
- ELEVASIS_API_KEY=sk_your_key_here
116
- ```
117
-
118
- This key authenticates CLI operations (`elevasis-sdk deploy`, `elevasis-sdk check`, `elevasis-sdk exec`). It is never uploaded to the platform and never injected into workers.
119
-
120
- Do not put integration API keys in `.env`. They will not be available inside workflows.
121
-
122
- ---
123
-
124
- ## Choosing a Credential Pattern
125
-
126
- | Situation | Pattern |
127
- | --- | --- |
128
- | Using a supported platform tool (Gmail, Attio, Stripe, etc.) | `platform.call()` with the tool name |
129
- | Calling an API not in the tool catalog | `platform.call()` with `tool: 'http'` |
130
- | Third-party SDK that requires a raw key | `platform.getCredential()` |
131
- | CLI authentication | `ELEVASIS_API_KEY` in `.env` only |
132
-
133
- ---
134
-
135
- ## Migrating from elevasis-sdk env
136
-
137
- If you previously set integration credentials via `elevasis-sdk env set`, that command no longer exists. Use `elevasis-sdk env list` to see what was set, then recreate each entry as a platform credential in the command center. Update workflow code from `process.env.KEY` to `platform.call({ tool: 'http', credential: '...', ... })` or `platform.getCredential('...')`, then redeploy. The `.env` file remains but is scoped to `ELEVASIS_API_KEY` only.
138
-
139
- ---
140
-
141
- **Last Updated:** 2026-02-26