@elevasis/sdk 1.26.1 → 1.26.2
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/test-utils/index.d.ts +2 -2
- package/dist/test-utils/index.js +6 -5
- package/dist/types/worker/index.d.ts +2 -2
- package/dist/worker/index.js +1 -0
- package/package.json +2 -2
- package/reference/claude-config/sync-notes/2026-05-23-lead-gen-manage-access.md +31 -0
- package/reference/claude-config/sync-notes/2026-05-23-ui-sdk-package-fixes.md +37 -0
- package/reference/cli-management.mdx +3 -3
- package/reference/deployment/{ui-execution.mdx → execution-reference.mdx} +297 -24
- package/reference/deployment/index.mdx +101 -6
- package/reference/index.mdx +2 -4
- package/reference/resources/patterns.mdx +1 -1
- package/reference/rules/ui.md +8 -1
- package/reference/deployment/api.mdx +0 -296
- package/reference/deployment/provided-features.mdx +0 -110
package/dist/cli.cjs
CHANGED
|
@@ -44124,7 +44124,7 @@ function wrapAction(commandName, fn) {
|
|
|
44124
44124
|
// package.json
|
|
44125
44125
|
var package_default = {
|
|
44126
44126
|
name: "@elevasis/sdk",
|
|
44127
|
-
version: "1.26.
|
|
44127
|
+
version: "1.26.2",
|
|
44128
44128
|
description: "SDK for building Elevasis organization resources",
|
|
44129
44129
|
type: "module",
|
|
44130
44130
|
bin: {
|
package/dist/index.d.ts
CHANGED
|
@@ -7694,7 +7694,7 @@ declare function compileBusinessOntologyValidationIndex(model: OrganizationModel
|
|
|
7694
7694
|
* organization model's `sales.lead-gen` stage records). Hosts that own a
|
|
7695
7695
|
* populated tenant model (e.g. `apps/api` with the Elevasis canonical model)
|
|
7696
7696
|
* MUST build their own index via `compileBusinessOntologyValidationIndex(model)`
|
|
7697
|
-
* and call `createLeadGenStageValidators(index)`.
|
|
7697
|
+
* and call `createLeadGenStageValidators(index)`. The core package stays generic;
|
|
7698
7698
|
* it must never import a tenant model.
|
|
7699
7699
|
*/
|
|
7700
7700
|
type LeadGenStageValidators = {
|
|
@@ -10547,8 +10547,8 @@ type TypedAdapter<TMap extends ToolMethodMap$1> = {
|
|
|
10547
10547
|
* Message protocol:
|
|
10548
10548
|
* Parent -> Worker: { type: 'manifest' }
|
|
10549
10549
|
* Worker -> Parent: { type: 'manifest', workflows: [...], agents: [...],
|
|
10550
|
-
*
|
|
10551
|
-
* relationships?: {...} }
|
|
10550
|
+
* organizationModel?: {...}, triggers?: [...], integrations?: [...],
|
|
10551
|
+
* humanCheckpoints?: [...], relationships?: {...} }
|
|
10552
10552
|
*
|
|
10553
10553
|
* Parent -> Worker: { type: 'execute', resourceId, executionId, input, organizationId?, organizationName?,
|
|
10554
10554
|
* sessionId?, sessionTurnNumber?, parentExecutionId?, executionDepth }
|
package/dist/test-utils/index.js
CHANGED
|
@@ -9284,6 +9284,7 @@ function startWorker(org) {
|
|
|
9284
9284
|
if (msg.type === "manifest") {
|
|
9285
9285
|
parentPort.postMessage({
|
|
9286
9286
|
type: "manifest",
|
|
9287
|
+
organizationModel: org.organizationModel,
|
|
9287
9288
|
workflows: (org.workflows ?? []).map((w2) => ({
|
|
9288
9289
|
resourceId: w2.config.resourceId,
|
|
9289
9290
|
name: w2.config.name,
|
|
@@ -21298,7 +21299,7 @@ function recordAsyncAnnotation(test5, promise) {
|
|
|
21298
21299
|
return promise;
|
|
21299
21300
|
}
|
|
21300
21301
|
|
|
21301
|
-
// ../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime+
|
|
21302
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime+_d1cccf33043c821cd797d4ac11d33b3e/node_modules/vitest/dist/chunks/utils.XdZDrNZV.js
|
|
21302
21303
|
var NAME_WORKER_STATE = "__vitest_worker__";
|
|
21303
21304
|
function getWorkerState() {
|
|
21304
21305
|
const workerState = globalThis[NAME_WORKER_STATE];
|
|
@@ -21346,7 +21347,7 @@ async function waitForImportsToResolve() {
|
|
|
21346
21347
|
await waitForImportsToResolve();
|
|
21347
21348
|
}
|
|
21348
21349
|
|
|
21349
|
-
// ../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime+
|
|
21350
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime+_d1cccf33043c821cd797d4ac11d33b3e/node_modules/vitest/dist/chunks/_commonjsHelpers.BFTU3MAI.js
|
|
21350
21351
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
21351
21352
|
function getDefaultExportFromCjs3(x2) {
|
|
21352
21353
|
return x2 && x2.__esModule && Object.prototype.hasOwnProperty.call(x2, "default") ? x2["default"] : x2;
|
|
@@ -23379,7 +23380,7 @@ var SnapshotClient = class {
|
|
|
23379
23380
|
}
|
|
23380
23381
|
};
|
|
23381
23382
|
|
|
23382
|
-
// ../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime+
|
|
23383
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime+_d1cccf33043c821cd797d4ac11d33b3e/node_modules/vitest/dist/chunks/date.Bq6ZW5rf.js
|
|
23383
23384
|
var RealDate = Date;
|
|
23384
23385
|
var now2 = null;
|
|
23385
23386
|
var MockDate = class _MockDate extends RealDate {
|
|
@@ -23427,7 +23428,7 @@ function resetDate() {
|
|
|
23427
23428
|
globalThis.Date = RealDate;
|
|
23428
23429
|
}
|
|
23429
23430
|
|
|
23430
|
-
// ../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime+
|
|
23431
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime+_d1cccf33043c821cd797d4ac11d33b3e/node_modules/vitest/dist/chunks/vi.bdSIJ99Y.js
|
|
23431
23432
|
var unsupported = [
|
|
23432
23433
|
"matchSnapshot",
|
|
23433
23434
|
"toMatchSnapshot",
|
|
@@ -26108,7 +26109,7 @@ function getImporter(name) {
|
|
|
26108
26109
|
return stack?.file || "";
|
|
26109
26110
|
}
|
|
26110
26111
|
|
|
26111
|
-
// ../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime+
|
|
26112
|
+
// ../../node_modules/.pnpm/vitest@3.2.4_@edge-runtime+_d1cccf33043c821cd797d4ac11d33b3e/node_modules/vitest/dist/index.js
|
|
26112
26113
|
__toESM(require_dist());
|
|
26113
26114
|
|
|
26114
26115
|
// src/test-utils/mock-adapters.ts
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Message protocol:
|
|
8
8
|
* Parent -> Worker: { type: 'manifest' }
|
|
9
9
|
* Worker -> Parent: { type: 'manifest', workflows: [...], agents: [...],
|
|
10
|
-
*
|
|
11
|
-
* relationships?: {...} }
|
|
10
|
+
* organizationModel?: {...}, triggers?: [...], integrations?: [...],
|
|
11
|
+
* humanCheckpoints?: [...], relationships?: {...} }
|
|
12
12
|
*
|
|
13
13
|
* Parent -> Worker: { type: 'execute', resourceId, executionId, input, organizationId?, organizationName?,
|
|
14
14
|
* sessionId?, sessionTurnNumber?, parentExecutionId?, executionDepth }
|
package/dist/worker/index.js
CHANGED
|
@@ -6801,6 +6801,7 @@ function startWorker(org) {
|
|
|
6801
6801
|
if (msg.type === "manifest") {
|
|
6802
6802
|
parentPort.postMessage({
|
|
6803
6803
|
type: "manifest",
|
|
6804
|
+
organizationModel: org.organizationModel,
|
|
6804
6805
|
workflows: (org.workflows ?? []).map((w) => ({
|
|
6805
6806
|
resourceId: w.config.resourceId,
|
|
6806
6807
|
name: w.config.name,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elevasis/sdk",
|
|
3
|
-
"version": "1.26.
|
|
3
|
+
"version": "1.26.2",
|
|
4
4
|
"description": "SDK for building Elevasis organization resources",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"tsup": "^8.0.0",
|
|
59
59
|
"typescript": "5.9.2",
|
|
60
60
|
"zod": "^4.1.0",
|
|
61
|
-
"@repo/core": "0.
|
|
61
|
+
"@repo/core": "0.33.0",
|
|
62
62
|
"@repo/eslint-config": "0.0.0",
|
|
63
63
|
"@repo/typescript-config": "0.0.0"
|
|
64
64
|
},
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Lead Gen Manage Access Package Baseline
|
|
2
|
+
|
|
3
|
+
## Why this note exists
|
|
4
|
+
|
|
5
|
+
This train adds `sales.lead-gen.manage` as the OM-aligned runtime permission for operating Lead Gen list-builder mutations. The implementation ships through `@elevasis/core` and `@elevasis/ui`; template projects need the package baseline update so derived apps receive the new access key and shared Lead Gen UI guards.
|
|
6
|
+
|
|
7
|
+
## Applies to
|
|
8
|
+
|
|
9
|
+
- Template UI package baseline: `external/_template/ui/package.json`
|
|
10
|
+
- Template core package baseline: `external/_template/core/package.json`
|
|
11
|
+
- Template operations package baseline: `external/_template/operations/package.json`
|
|
12
|
+
- Derived projects that expose the shared Lead Gen list-builder UI
|
|
13
|
+
|
|
14
|
+
## Required actions
|
|
15
|
+
|
|
16
|
+
1. Publish the prepared `@elevasis/core` release containing `sales.lead-gen.manage` and `AccessKeys.leadGenManage`.
|
|
17
|
+
2. Publish the prepared `@elevasis/ui` release containing the shared Lead Gen mutation affordance guards.
|
|
18
|
+
3. Run the prepared external sync manifest so derived projects receive the updated package baselines.
|
|
19
|
+
4. For client launches, verify Operator users receive `sales.lead-gen.manage` through platform role grants before list-builder smoke.
|
|
20
|
+
|
|
21
|
+
## Verification
|
|
22
|
+
|
|
23
|
+
- `pnpm -C packages/core build:publish`
|
|
24
|
+
- `pnpm -C packages/ui build:publish`
|
|
25
|
+
- `pnpm -C external/_template/ui check-types`
|
|
26
|
+
- `pnpm -C external/_template/ui build`
|
|
27
|
+
- `pnpm sync:verify` after the manifest-scoped external sync stage
|
|
28
|
+
|
|
29
|
+
## Not handled by /git-sync
|
|
30
|
+
|
|
31
|
+
Database permission rows and system role grants are environment state, not template files. Apply the SQL migration or equivalent environment change separately before inviting Operator users.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# UI + SDK package fixes (lastVisitedOrg, worker-manifest organizationModel)
|
|
2
|
+
|
|
3
|
+
## Why this note exists
|
|
4
|
+
|
|
5
|
+
`@elevasis/ui` and `@elevasis/sdk` were republished with two backward-compatible fixes:
|
|
6
|
+
|
|
7
|
+
- `@elevasis/ui`: `OrganizationProvider` now persists org preference as `lastVisitedOrg` (matching the `/api/users/me` schema), removing the noisy 400 on organization switching.
|
|
8
|
+
- `@elevasis/sdk`: the worker manifest now includes `organizationModel`, so platform deployment persistence receives your tenant Organization Model snapshot.
|
|
9
|
+
|
|
10
|
+
The SDK change requires a deploy, not just an install, to take effect on your active platform deployment.
|
|
11
|
+
|
|
12
|
+
## Applies to
|
|
13
|
+
|
|
14
|
+
All template-derived projects that consume `@elevasis/ui` and `@elevasis/sdk` and run an `operations/` resources bundle on the Elevasis platform.
|
|
15
|
+
|
|
16
|
+
## Required actions
|
|
17
|
+
|
|
18
|
+
1. Pull and install so the new baselines land:
|
|
19
|
+
- `@elevasis/ui` baseline bump in `ui/package.json`
|
|
20
|
+
- `@elevasis/sdk` baseline bump in `operations/package.json`
|
|
21
|
+
2. `pnpm -C ui install && pnpm -C operations install` (or a project-root install) to update lockfiles.
|
|
22
|
+
3. Redeploy your operations bundle so the worker manifest publishes your Organization Model to the active deployment:
|
|
23
|
+
- dev: `pnpm -C operations deploy`
|
|
24
|
+
- prod: `pnpm -C operations deploy:prod`
|
|
25
|
+
4. Redeploy the UI (your host, e.g. Vercel) so the `lastVisitedOrg` fix ships to the browser.
|
|
26
|
+
|
|
27
|
+
No source merges are required; both changes are internal to the published packages.
|
|
28
|
+
|
|
29
|
+
## Verification
|
|
30
|
+
|
|
31
|
+
- `pnpm -C ui check-types && pnpm -C ui build`
|
|
32
|
+
- `pnpm -C operations check && pnpm -C operations check-types`
|
|
33
|
+
- After deploy, confirm the active deployment persists an Organization Model snapshot (Lead Gen / list surfaces resolve the tenant model rather than erroring), and that organization switching no longer emits a 400 against `/api/users/me`.
|
|
34
|
+
|
|
35
|
+
## Not handled by /git-sync
|
|
36
|
+
|
|
37
|
+
`/git-sync` pulls the new baselines and surfaces this note, but it does NOT install dependencies, deploy your operations bundle, or redeploy your UI. Run the install + deploy steps above yourself; the worker-manifest fix only takes effect on your active deployment after an operations redeploy.
|
|
@@ -428,7 +428,7 @@ elevasis-sdk session:end <id>
|
|
|
428
428
|
|
|
429
429
|
## elevasis-sdk queue:\*
|
|
430
430
|
|
|
431
|
-
Manage HITL command queue tasks. See the [Command Queue CLI Guide](/technical/development/agent-driven-development/
|
|
431
|
+
Manage HITL command queue tasks. See the [Command Queue CLI Guide](/technical/development/agent-driven-development/cli-operations) for the full command reference.
|
|
432
432
|
|
|
433
433
|
**Quick reference:**
|
|
434
434
|
|
|
@@ -446,7 +446,7 @@ elevasis-sdk queue:status --pretty
|
|
|
446
446
|
|
|
447
447
|
## elevasis-sdk schedule:\*
|
|
448
448
|
|
|
449
|
-
Manage recurring, relative, and absolute task schedules. See the [Schedule CLI Guide](/technical/development/agent-driven-development/
|
|
449
|
+
Manage recurring, relative, and absolute task schedules. See the [Schedule CLI Guide](/technical/development/agent-driven-development/cli-operations) for the full command reference including schedule config JSON shapes.
|
|
450
450
|
|
|
451
451
|
**Quick reference:**
|
|
452
452
|
|
|
@@ -468,7 +468,7 @@ elevasis-sdk schedule:cancel <id> --pretty
|
|
|
468
468
|
|
|
469
469
|
Knowledge map inspection. The `om:*` (Organization Model) commands expose knowledge graph traversal via the CLI.
|
|
470
470
|
|
|
471
|
-
For the full command reference, flag details, and graph architecture, see the [knowledge:\* CLI documentation](/technical/features/knowledge/
|
|
471
|
+
For the full command reference, flag details, and graph architecture, see the [knowledge:\* CLI documentation](/technical/features/knowledge/cli-and-skill).
|
|
472
472
|
|
|
473
473
|
**Quick reference:**
|
|
474
474
|
|
|
@@ -1,15 +1,300 @@
|
|
|
1
1
|
---
|
|
2
|
-
title:
|
|
3
|
-
description:
|
|
2
|
+
title: Execution Reference
|
|
3
|
+
description: REST endpoints for executing resources, querying execution history, and managing deployments; plus React UI components and hooks for triggering executions from custom pages via @elevasis/ui
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
This page covers two complementary surfaces for driving resource executions:
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
- **REST API** -- the `/api/external/` endpoints you call directly or through the CLI.
|
|
9
|
+
- **UI components** -- the `@elevasis/ui` components and hooks for building interactive Run dialogs in custom React pages.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## REST API
|
|
14
|
+
|
|
15
|
+
The Elevasis external API exposes REST endpoints under `/api/external/` for executing your deployed resources and inspecting results. All endpoints require your `ELEVASIS_PLATFORM_KEY` sent as a Bearer token. Organization is resolved server-side from the API key -- you never pass an org identifier in requests.
|
|
16
|
+
|
|
17
|
+
**Authentication header:**
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
Authorization: Bearer sk_...
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### API Base URL
|
|
24
|
+
|
|
25
|
+
| Environment | Base URL |
|
|
26
|
+
| ----------- | --------------------------- |
|
|
27
|
+
| Production | `https://api.elevasis.io` |
|
|
28
|
+
| Development | `http://localhost:<port>` |
|
|
29
|
+
|
|
30
|
+
Override the base URL by setting `ELEVASIS_API_URL` in your environment or passing `--api-url` to any CLI command.
|
|
31
|
+
|
|
32
|
+
### Endpoint Overview
|
|
33
|
+
|
|
34
|
+
| Method | Path | Purpose |
|
|
35
|
+
| ------ | ---------------------------------------------------------- | ---------------------------------------- |
|
|
36
|
+
| `GET` | `/api/external/resources` | List all resources for your organization |
|
|
37
|
+
| `GET` | `/api/external/resources/:resourceId/definition` | Get resource metadata and schemas |
|
|
38
|
+
| `POST` | `/api/external/execute` | Execute a resource synchronously |
|
|
39
|
+
| `POST` | `/api/external/execute-async` | Execute a resource asynchronously |
|
|
40
|
+
| `POST` | `/api/external/executions/:resourceId/:executionId/cancel` | Cancel a running execution |
|
|
41
|
+
| `GET` | `/api/external/executions/:resourceId` | List execution history for a resource |
|
|
42
|
+
| `GET` | `/api/external/executions/:resourceId/:executionId` | Get full execution detail |
|
|
43
|
+
| `POST` | `/api/external/deploy` | Upload bundle and deploy resources |
|
|
44
|
+
| `GET` | `/api/external/deployments` | List all deployments |
|
|
45
|
+
| `GET` | `/api/external/deployments/:id` | Get a deployment by ID |
|
|
46
|
+
|
|
47
|
+
### Execution Endpoints
|
|
48
|
+
|
|
49
|
+
#### POST /api/external/execute
|
|
50
|
+
|
|
51
|
+
Execute a resource synchronously. The request waits for the resource to complete and returns the full result.
|
|
52
|
+
|
|
53
|
+
**Request body:**
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"resourceId": "onboard-client",
|
|
58
|
+
"input": {
|
|
59
|
+
"clientName": "Jane",
|
|
60
|
+
"email": "jane@example.com"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
**Response:**
|
|
66
|
+
|
|
67
|
+
```json
|
|
68
|
+
{
|
|
69
|
+
"executionId": "550e8400-e29b-41d4-a716-446655440000",
|
|
70
|
+
"success": true,
|
|
71
|
+
"data": {
|
|
72
|
+
"success": true,
|
|
73
|
+
"clientId": "client_1708521600000",
|
|
74
|
+
"welcomeEmailSent": true
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
#### POST /api/external/execute-async
|
|
80
|
+
|
|
81
|
+
Execute a resource asynchronously. Returns immediately with an `executionId`. Poll `GET /executions/:resourceId/:executionId` to check status and retrieve output.
|
|
82
|
+
|
|
83
|
+
**Request body:**
|
|
84
|
+
|
|
85
|
+
```json
|
|
86
|
+
{
|
|
87
|
+
"resourceId": "onboard-client",
|
|
88
|
+
"input": { "clientName": "Jane" }
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**Response:**
|
|
93
|
+
|
|
94
|
+
```json
|
|
95
|
+
{
|
|
96
|
+
"executionId": "550e8400-e29b-41d4-a716-446655440000",
|
|
97
|
+
"status": "running"
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### POST /api/external/executions/:resourceId/:executionId/cancel
|
|
102
|
+
|
|
103
|
+
Cancel a running execution. If the execution is found in memory, sends a cancellation signal immediately. Falls back to a database status update if no in-memory signal is found.
|
|
104
|
+
|
|
105
|
+
**Response:**
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"success": true
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Resource Endpoints
|
|
114
|
+
|
|
115
|
+
#### GET /api/external/resources
|
|
116
|
+
|
|
117
|
+
List all resources registered to your organization. In production, only `status: 'prod'` resources are returned.
|
|
118
|
+
|
|
119
|
+
**Response:**
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
[
|
|
123
|
+
{
|
|
124
|
+
"resourceId": "onboard-client",
|
|
125
|
+
"resourceType": "workflow",
|
|
126
|
+
"name": "Onboard Client",
|
|
127
|
+
"status": "prod"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"resourceId": "email-assistant",
|
|
131
|
+
"resourceType": "agent",
|
|
132
|
+
"name": "Email Assistant",
|
|
133
|
+
"status": "prod"
|
|
134
|
+
}
|
|
135
|
+
]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
#### GET /api/external/resources/:resourceId/definition
|
|
139
|
+
|
|
140
|
+
Get the full definition for a single resource: metadata, input schema, and output schema.
|
|
141
|
+
|
|
142
|
+
**Response:**
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"resourceId": "onboard-client",
|
|
147
|
+
"resourceType": "workflow",
|
|
148
|
+
"name": "Onboard Client",
|
|
149
|
+
"description": "Creates a client record and sends a welcome email",
|
|
150
|
+
"status": "prod",
|
|
151
|
+
"inputSchema": {
|
|
152
|
+
"type": "object",
|
|
153
|
+
"properties": {
|
|
154
|
+
"clientName": { "type": "string" },
|
|
155
|
+
"email": { "type": "string", "format": "email" }
|
|
156
|
+
},
|
|
157
|
+
"required": ["clientName", "email"]
|
|
158
|
+
},
|
|
159
|
+
"outputSchema": {
|
|
160
|
+
"type": "object",
|
|
161
|
+
"properties": {
|
|
162
|
+
"success": { "type": "boolean" },
|
|
163
|
+
"clientId": { "type": "string" }
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
Returns `404` if the resource is not found.
|
|
170
|
+
|
|
171
|
+
### Execution History Endpoints
|
|
172
|
+
|
|
173
|
+
#### GET /api/external/executions/:resourceId
|
|
174
|
+
|
|
175
|
+
List execution history for a resource.
|
|
176
|
+
|
|
177
|
+
**Query parameters:**
|
|
178
|
+
|
|
179
|
+
| Parameter | Description |
|
|
180
|
+
| --------- | --------------------------------------------------------------- |
|
|
181
|
+
| `limit` | Maximum number of results (default: 20) |
|
|
182
|
+
| `status` | Filter by status: `running`, `completed`, `failed`, `cancelled` |
|
|
183
|
+
|
|
184
|
+
**Response:**
|
|
185
|
+
|
|
186
|
+
```json
|
|
187
|
+
[
|
|
188
|
+
{
|
|
189
|
+
"executionId": "550e8400-e29b-41d4-a716-446655440000",
|
|
190
|
+
"resourceId": "onboard-client",
|
|
191
|
+
"status": "completed",
|
|
192
|
+
"createdAt": "2026-02-25T14:32:01Z",
|
|
193
|
+
"durationMs": 1234
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
#### GET /api/external/executions/:resourceId/:executionId
|
|
199
|
+
|
|
200
|
+
Get the full detail for a single execution including input, output, logs, and error.
|
|
201
|
+
|
|
202
|
+
**Response:**
|
|
203
|
+
|
|
204
|
+
```json
|
|
205
|
+
{
|
|
206
|
+
"executionId": "550e8400-e29b-41d4-a716-446655440000",
|
|
207
|
+
"resourceId": "onboard-client",
|
|
208
|
+
"status": "completed",
|
|
209
|
+
"createdAt": "2026-02-25T14:32:01Z",
|
|
210
|
+
"durationMs": 1234,
|
|
211
|
+
"input": {
|
|
212
|
+
"clientName": "Jane",
|
|
213
|
+
"email": "jane@example.com"
|
|
214
|
+
},
|
|
215
|
+
"output": {
|
|
216
|
+
"success": true,
|
|
217
|
+
"clientId": "client_1708521600000",
|
|
218
|
+
"welcomeEmailSent": true
|
|
219
|
+
},
|
|
220
|
+
"logs": [
|
|
221
|
+
{ "timestamp": "2026-02-25T14:32:01.123Z", "message": "Starting onboard-client workflow" },
|
|
222
|
+
{ "timestamp": "2026-02-25T14:32:01.456Z", "message": "Created client record" }
|
|
223
|
+
],
|
|
224
|
+
"error": null
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Deployment Endpoints
|
|
229
|
+
|
|
230
|
+
#### POST /api/external/deploy
|
|
231
|
+
|
|
232
|
+
Upload a resource bundle and deploy it. Accepts a multipart request with the compiled bundle and resource metadata.
|
|
233
|
+
|
|
234
|
+
**Response:**
|
|
235
|
+
|
|
236
|
+
```json
|
|
237
|
+
{
|
|
238
|
+
"deployId": "deploy_abc123",
|
|
239
|
+
"status": "active",
|
|
240
|
+
"resources": 4
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
Use `elevasis-sdk deploy` from the CLI rather than calling this endpoint directly -- the CLI handles bundling, metadata generation, and status streaming automatically.
|
|
245
|
+
|
|
246
|
+
#### GET /api/external/deployments
|
|
247
|
+
|
|
248
|
+
List all deployments for your organization.
|
|
249
|
+
|
|
250
|
+
**Response:**
|
|
251
|
+
|
|
252
|
+
```json
|
|
253
|
+
[
|
|
254
|
+
{
|
|
255
|
+
"id": "deploy_abc123",
|
|
256
|
+
"status": "active",
|
|
257
|
+
"createdAt": "2026-02-25T14:00:00Z",
|
|
258
|
+
"resources": 4
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
"id": "deploy_abc122",
|
|
262
|
+
"status": "stopped",
|
|
263
|
+
"createdAt": "2026-02-24T09:30:00Z",
|
|
264
|
+
"resources": 3
|
|
265
|
+
}
|
|
266
|
+
]
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
#### GET /api/external/deployments/:id
|
|
270
|
+
|
|
271
|
+
Get a single deployment by ID.
|
|
272
|
+
|
|
273
|
+
**Response shape:** Same as a single item from `GET /deployments`.
|
|
274
|
+
|
|
275
|
+
### CLI Execution Commands
|
|
276
|
+
|
|
277
|
+
The SDK CLI wraps all execution endpoints. Use these commands instead of calling the API directly during development:
|
|
278
|
+
|
|
279
|
+
| Command | API call | Purpose |
|
|
280
|
+
| ------------------------------------------------------ | -------------------------------------------- | ------------------------ |
|
|
281
|
+
| `elevasis-sdk resources` | `GET /api/external/resources` | List all resources |
|
|
282
|
+
| `elevasis-sdk describe <resource>` | `GET /api/external/resources/:id/definition` | Show resource definition |
|
|
283
|
+
| `elevasis-sdk exec <resource> --input '...'` | `POST /api/external/execute` | Execute synchronously |
|
|
284
|
+
| `elevasis-sdk exec <resource> --input '...' --async` | `POST /api/external/execute-async` | Execute asynchronously |
|
|
285
|
+
| `elevasis-sdk executions <resource>` | `GET /api/external/executions/:id` | List execution history |
|
|
286
|
+
| `elevasis-sdk execution <resource> <id>` | `GET /api/external/executions/:id/:execId` | Get execution detail |
|
|
287
|
+
| `elevasis-sdk deployments` | `GET /api/external/deployments` | List deployments |
|
|
9
288
|
|
|
10
289
|
---
|
|
11
290
|
|
|
12
|
-
##
|
|
291
|
+
## UI Execution
|
|
292
|
+
|
|
293
|
+
`@elevasis/ui` ships a set of components and hooks that let your custom React pages trigger workflow and agent executions without wiring up API calls manually. This section is for template users building interactive resource pages in `external/_template` who want to add Run buttons, input forms, and execution result displays.
|
|
294
|
+
|
|
295
|
+
The API comes in three tiers: a convenience one-tag component that handles everything, a controlled form primitive for custom modal chrome, and low-level hooks for fully custom rendering. Most template pages need only the first tier.
|
|
296
|
+
|
|
297
|
+
### Quick Start -- `ResourceExecuteDialog`
|
|
13
298
|
|
|
14
299
|
`ResourceExecuteDialog` combines a modal shell, an input form, mutation state, and result display into a single component. Drop it next to a Button and you have a working Run dialog in about fifteen lines.
|
|
15
300
|
|
|
@@ -62,9 +347,7 @@ What the user sees when they click Run:
|
|
|
62
347
|
|
|
63
348
|
If `formSchema` is omitted or has no fields, the form skips to a single "Run" button with the message "This workflow takes no input."
|
|
64
349
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
## The Three-Tier API
|
|
350
|
+
### The Three-Tier API
|
|
68
351
|
|
|
69
352
|
| Tier | Component / Hook | Use case |
|
|
70
353
|
| --------------- | ------------------------------------------ | ----------------------------------------------------------------------------------------------- |
|
|
@@ -74,9 +357,7 @@ If `formSchema` is omitted or has no fields, the form skips to a single "Run" bu
|
|
|
74
357
|
|
|
75
358
|
Start with `ResourceExecuteDialog`. Move down the tiers only when you need something the convenience component cannot do.
|
|
76
359
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
## Controlled Usage with `ResourceExecuteForm`
|
|
360
|
+
### Controlled Usage with `ResourceExecuteForm`
|
|
80
361
|
|
|
81
362
|
Use `ResourceExecuteForm` when you want to own the modal or display the result somewhere outside the dialog -- for example, rendering the execution ID inline on the page after submission.
|
|
82
363
|
|
|
@@ -138,9 +419,7 @@ export function CustomRunPanel() {
|
|
|
138
419
|
| `disabled` | `boolean` | `false` | Disables all fields and button |
|
|
139
420
|
| `submitLabel` | `string` | `'Run'` | Button label when not pending |
|
|
140
421
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
## Low-Level: Hooks and `ExecuteWorkflowModal`
|
|
422
|
+
### Low-Level: Hooks and `ExecuteWorkflowModal`
|
|
144
423
|
|
|
145
424
|
For complete rendering control, use `useExecuteAsync` and `ExecuteWorkflowModal` independently. `ExecuteWorkflowModal` is a Mantine Modal pre-wired with a loading overlay, a success card (execution ID + "View execution" button), and an error alert. You pass `children` for the input area.
|
|
146
425
|
|
|
@@ -168,9 +447,7 @@ The modal locks close interactions (click-outside, Escape, close button) while `
|
|
|
168
447
|
|
|
169
448
|
Source: `packages/ui/src/features/operations/executions/ExecuteWorkflowModal.tsx`, `packages/ui/src/hooks/executions/useExecuteAsync.ts`
|
|
170
449
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
## Zod-Validated Execution with `useExecuteWorkflow`
|
|
450
|
+
### Zod-Validated Execution with `useExecuteWorkflow`
|
|
174
451
|
|
|
175
452
|
`useExecuteWorkflow` wraps `useExecuteAsync` with a Zod parse step before the POST. Use it when you are constructing input programmatically (not from a form) and want to catch schema mismatches before they reach the API.
|
|
176
453
|
|
|
@@ -207,9 +484,7 @@ Prefer `useExecuteWorkflow` over raw `useExecuteAsync` when:
|
|
|
207
484
|
|
|
208
485
|
Source: `packages/ui/src/hooks/executions/useExecuteWorkflow.ts`
|
|
209
486
|
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
## Input Forms
|
|
487
|
+
### Input Forms
|
|
213
488
|
|
|
214
489
|
`ResourceExecuteDialog` and `ResourceExecuteForm` auto-render form fields from `formSchema.fields`. Each field is a `SerializedFormField` with at minimum `name`, `label`, and `type`.
|
|
215
490
|
|
|
@@ -227,9 +502,7 @@ Required fields (`required: true`) are validated on submit. Custom field-to-inpu
|
|
|
227
502
|
|
|
228
503
|
If `formSchema` is undefined, an empty object, or has `fields: []`, the form skips rendering fields entirely and shows "This workflow takes no input." with a single Run button.
|
|
229
504
|
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
## Error and Result Handling
|
|
505
|
+
### Error and Result Handling
|
|
233
506
|
|
|
234
507
|
Mutation state flows automatically into the modal chrome when using `ResourceExecuteDialog` or `ExecuteWorkflowModal`:
|
|
235
508
|
|
|
@@ -243,7 +516,7 @@ Mutation state flows automatically into the modal chrome when using `ResourceExe
|
|
|
243
516
|
|
|
244
517
|
## Related
|
|
245
518
|
|
|
246
|
-
- [
|
|
519
|
+
- [Deployment Overview](index.mdx) -- deploy pipeline, versioning, and bundle upload
|
|
247
520
|
- [Command Center](command-center.mdx) -- built-in managed UI; includes Run buttons for all deployed resources
|
|
248
521
|
- [Resource Patterns](../resources/patterns.mdx) -- HITL approval patterns and `approval.create()`
|
|
249
522
|
- [Platform Adapters](../platform-tools/adapters-platform.mdx) -- `approval.create()` reference
|
|
@@ -182,13 +182,108 @@ The deploy bundle is a single CJS file produced by esbuild. It includes:
|
|
|
182
182
|
|
|
183
183
|
The bundle is stored on the platform for durability and restart recovery. If the platform API restarts, it re-downloads your bundle and re-registers your resources automatically -- no action required on your part.
|
|
184
184
|
|
|
185
|
-
|
|
185
|
+
---
|
|
186
186
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
187
|
+
## Provided Features
|
|
188
|
+
|
|
189
|
+
The SDK includes more than workflow execution. The published `@elevasis/ui` package provides system manifests, pages, hooks, and headless provider exports for building shell-aware applications.
|
|
190
|
+
|
|
191
|
+
### Shared Shell Contract
|
|
192
|
+
|
|
193
|
+
`ElevasisSystemsProvider` reads the canonical `OrganizationModel`, including `navigation.sidebar`, and exposes a shell model plus sidebar projection helpers. System manifests provide implementation hooks such as icons and subshell sidebars; they do not own structural navigation.
|
|
194
|
+
|
|
195
|
+
```tsx
|
|
196
|
+
import { Outlet } from '@tanstack/react-router'
|
|
197
|
+
import { ElevasisSystemsProvider, SystemShell } from '@elevasis/ui/provider'
|
|
198
|
+
import { leadGenManifest } from '@elevasis/ui/features/lead-gen'
|
|
199
|
+
import { crmManifest } from '@elevasis/ui/features/crm'
|
|
200
|
+
import { deliveryManifest } from '@elevasis/ui/features/delivery'
|
|
201
|
+
import { monitoringManifest } from '@elevasis/ui/features/monitoring'
|
|
202
|
+
import { settingsManifest } from '@elevasis/ui/features/settings'
|
|
203
|
+
import { canonicalOrganizationModel } from '@core/config/organization-model'
|
|
204
|
+
|
|
205
|
+
const systems = [
|
|
206
|
+
leadGenManifest,
|
|
207
|
+
crmManifest,
|
|
208
|
+
deliveryManifest,
|
|
209
|
+
monitoringManifest,
|
|
210
|
+
settingsManifest
|
|
211
|
+
]
|
|
212
|
+
|
|
213
|
+
export function AppShell() {
|
|
214
|
+
return (
|
|
215
|
+
<ElevasisSystemsProvider systems={systems} organizationModel={canonicalOrganizationModel}>
|
|
216
|
+
<SystemShell>
|
|
217
|
+
<Outlet />
|
|
218
|
+
</SystemShell>
|
|
219
|
+
</ElevasisSystemsProvider>
|
|
220
|
+
)
|
|
221
|
+
}
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Host apps still own TanStack route registration, topbar behavior, branding, auth wiring, and any root dashboard composition.
|
|
225
|
+
|
|
226
|
+
### Contract Matrix
|
|
227
|
+
|
|
228
|
+
| Contract type | What is published | Current examples |
|
|
229
|
+
| --------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
|
|
230
|
+
| Manifest-backed shared subshell systems | System manifest plus shared sidebar/pages, mounted through `@elevasis/ui/provider` | Lead Gen, CRM, Projects, Operations |
|
|
231
|
+
| Shared feature pages and hooks | Pages, hooks, and helpers that can be composed inside host routes | Monitoring, Settings, Dashboard widgets |
|
|
232
|
+
| Headless provider contract | Provider, hooks, and shell model helpers | `ElevasisSystemsProvider`, `useElevasisSystems`, `SystemShell` |
|
|
233
|
+
| Compatibility barrel | Existing imports remain available while newer integrations prefer feature/provider subpaths | `@elevasis/ui/components` |
|
|
234
|
+
|
|
235
|
+
### System Map
|
|
236
|
+
|
|
237
|
+
| System | Primary route space | Shared UI surface | Best SDK entry point |
|
|
238
|
+
| ---------- | ------------------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
|
|
239
|
+
| Lead Gen | `/lead-gen/*` | Lead Gen pages, sidebars, list detail page, run dialogs | `@elevasis/ui/features/lead-gen`, `@elevasis/ui/hooks`, `@elevasis/sdk/worker` |
|
|
240
|
+
| CRM | `/crm/*` | CRM sidebar, overview widgets, deal/detail pages, workbench panels | `@elevasis/ui/features/crm`, `@elevasis/ui/hooks`, `@elevasis/sdk/worker` |
|
|
241
|
+
| Projects | `/projects/*` | Projects list page, milestones/tasks/notes sidebars and pages | `@elevasis/ui/features/delivery`, `@elevasis/ui/hooks/delivery`, `elevasis-sdk project:*` |
|
|
242
|
+
| Operations | `/operations/*` | Command View, resources, organization graph, sessions | `@elevasis/ui/features/operations` |
|
|
243
|
+
| Dashboard | `/` host-owned | Dashboard and overview components only | `@elevasis/ui/features/dashboard` |
|
|
244
|
+
| Monitoring | `/monitoring/*` | Monitoring pages/components | `@elevasis/ui/features/monitoring` |
|
|
245
|
+
| Settings | `/settings/*` | Settings/account/org components | `@elevasis/ui/features/settings` |
|
|
246
|
+
|
|
247
|
+
### Organization Model Alignment
|
|
248
|
+
|
|
249
|
+
Manifest `systemId` values must match Organization Model System IDs. Sidebar placement is authored in the Organization Model navigation domain:
|
|
250
|
+
|
|
251
|
+
```ts
|
|
252
|
+
systems: {
|
|
253
|
+
dashboard: { id: 'dashboard', order: 10, label: 'Dashboard', lifecycle: 'active' },
|
|
254
|
+
clients: { id: 'clients', order: 20, label: 'Clients', lifecycle: 'active' }
|
|
255
|
+
},
|
|
256
|
+
navigation: {
|
|
257
|
+
sidebar: {
|
|
258
|
+
primary: {
|
|
259
|
+
dashboard: { type: 'surface', order: 10, label: 'Dashboard', path: '/', surfaceType: 'dashboard', targets: { systems: ['dashboard'] } },
|
|
260
|
+
business: {
|
|
261
|
+
type: 'group',
|
|
262
|
+
order: 20,
|
|
263
|
+
label: 'Business',
|
|
264
|
+
children: {
|
|
265
|
+
clients: { type: 'surface', order: 20, label: 'Clients', path: '/clients', surfaceType: 'list', targets: { systems: ['clients'] } }
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
bottom: {}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Dashboard appears before Business in the primary sidebar. Business is a navigation group only; `/clients` is the canonical client route.
|
|
275
|
+
|
|
276
|
+
### Choosing the Right Surface
|
|
277
|
+
|
|
278
|
+
- Need packaged sidebar/page composition? Use `ElevasisSystemsProvider`, `SystemShell`, and manifests from `@elevasis/ui/features/*`.
|
|
279
|
+
- Need a root dashboard? Keep that route host-owned and compose dashboard components.
|
|
280
|
+
- Need list-scoped lead-gen runtime behavior? Use the `list` adapter, then `acqDb` for broader acquisition CRUD.
|
|
281
|
+
- Need project/task automation? Use `elevasis-sdk project:*`.
|
|
191
282
|
|
|
192
283
|
---
|
|
193
284
|
|
|
194
|
-
|
|
285
|
+
## Documentation
|
|
286
|
+
|
|
287
|
+
- [Command Center](command-center.mdx) - Resource graph, relationships, node types, and post-deployment UI reference
|
|
288
|
+
- [Execution Reference](execution-reference.mdx) - REST endpoints for executing resources, managing deployments, and React UI components for custom Run dialogs
|
|
289
|
+
- [Platform Adapters](../platform-tools/adapters-platform.mdx) - `approval.create()` and all platform service adapters
|
package/reference/index.mdx
CHANGED
|
@@ -24,7 +24,7 @@ After `pnpm dlx @elevasis/sdk init`, your project is scaffolded with a working e
|
|
|
24
24
|
|
|
25
25
|
- **Workflows** -- Step-based automation with typed inputs and outputs. Steps can be linear, conditional, or branching. Each step is a plain async function. See [Resources](resources/index.mdx) for the complete definition API.
|
|
26
26
|
- **Agents** -- Autonomous AI resources with access to platform tools. Agents run in the worker runtime with full LLM access and platform tool support. Use `--async` when executing agents to avoid HTTP timeout limits on long-running runs.
|
|
27
|
-
- **Feature-driven apps** -- The published `@elevasis/ui` surface includes manifest-backed shared features for Lead Gen, CRM, Projects, Operations, Monitoring, Settings, and SEO, plus dashboard-oriented compatibility components for host-owned shells. See [Provided Features](deployment/provided-features
|
|
27
|
+
- **Feature-driven apps** -- The published `@elevasis/ui` surface includes manifest-backed shared features for Lead Gen, CRM, Projects, Operations, Monitoring, Settings, and SEO, plus dashboard-oriented compatibility components for host-owned shells. See [Provided Features](deployment/index.mdx#provided-features).
|
|
28
28
|
|
|
29
29
|
## Platform Tools
|
|
30
30
|
|
|
@@ -81,9 +81,7 @@ See [Platform Tools](platform-tools/index.mdx) for the full catalog, adapter ref
|
|
|
81
81
|
### Deployment Subpages
|
|
82
82
|
|
|
83
83
|
- [Command Center](deployment/command-center.mdx) - Resource graph, relationships, node types, and post-deployment UI reference
|
|
84
|
-
- [
|
|
85
|
-
- [Execution API](deployment/api.mdx) - REST endpoints for executing resources and managing deployments
|
|
86
|
-
- [UI Execution](deployment/ui-execution.mdx) - Custom React execution dialogs, forms, and hooks built with `@elevasis/ui`
|
|
84
|
+
- [Execution Reference](deployment/execution-reference.mdx) - REST endpoints for executing resources, managing deployments, and React UI components for custom Run dialogs
|
|
87
85
|
|
|
88
86
|
### More
|
|
89
87
|
|
|
@@ -439,7 +439,7 @@ The Command Queue page in the Command Center surfaces all pending approval tasks
|
|
|
439
439
|
|
|
440
440
|
Use these hooks to build a custom approval queue surface in your template UI. `useSubmitAction` accepts `taskId`, `actionId`, and optional `notes`, and optimistically marks the task as `processing` while the request is in flight.
|
|
441
441
|
|
|
442
|
-
For triggering executions from custom pages (the other side of the workflow interaction), see [UI Execution](../deployment/ui-execution
|
|
442
|
+
For triggering executions from custom pages (the other side of the workflow interaction), see [UI Execution](../deployment/execution-reference.mdx#ui-execution).
|
|
443
443
|
|
|
444
444
|
---
|
|
445
445
|
|
package/reference/rules/ui.md
CHANGED
|
@@ -109,7 +109,14 @@ import { sseConnectionManager } from '@/lib/sse/SSEConnectionManager'
|
|
|
109
109
|
|
|
110
110
|
**WorkOS config:**
|
|
111
111
|
|
|
112
|
-
WorkOS `clientId`, `redirectUri`, and `signoutUri` are
|
|
112
|
+
WorkOS `clientId`, `redirectUri`, and `signoutUri` are resolved in `ui/src/config/workos.ts` from `VITE_WORKOS_CLIENT_ID`, `VITE_WORKOS_REDIRECT_URI`, `VITE_WORKOS_SIGNOUT_URI`, and `VITE_APP_ORIGIN`, with localhost fallbacks so the template runs locally without production env vars. For deployed apps, set the production env vars in the hosting provider and allow the exact redirect and sign-out URLs in the WorkOS application dashboard:
|
|
113
|
+
|
|
114
|
+
- Redirect URI: `https://your-production-domain/auth-redirect`
|
|
115
|
+
- Sign-out redirect: `https://your-production-domain/login`
|
|
116
|
+
- Configure CORS origin: `https://your-production-domain`; required for browser AuthKit calls to `api.workos.com`
|
|
117
|
+
- App homepage origin: `https://your-production-domain`
|
|
118
|
+
|
|
119
|
+
The dev server runs on port `4300` with Vite `strictPort: true`, so a second `pnpm -C ui dev` on the same machine fails fast instead of drifting.
|
|
113
120
|
|
|
114
121
|
The API URL is centralized in `ui/src/lib/constants/api.ts`. In the current template it is hard-coded to `https://api.elevasis.io`, so if the bootstrap is repointed to another API target, that file is the source of truth.
|
|
115
122
|
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Execution API
|
|
3
|
-
description: REST endpoints for executing resources, querying execution history, and managing deployments via the Elevasis external API
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
The Elevasis external API exposes REST endpoints under `/api/external/` for executing your deployed resources and inspecting results. All endpoints require your `ELEVASIS_PLATFORM_KEY` sent as a Bearer token. Organization is resolved server-side from the API key -- you never pass an org identifier in requests.
|
|
7
|
-
|
|
8
|
-
**Authentication header:**
|
|
9
|
-
|
|
10
|
-
```
|
|
11
|
-
Authorization: Bearer sk_...
|
|
12
|
-
```
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
## API Base URL
|
|
17
|
-
|
|
18
|
-
| Environment | Base URL |
|
|
19
|
-
| ----------- | --------------------------- |
|
|
20
|
-
| Production | `https://api.elevasis.io` |
|
|
21
|
-
| Development | `http://localhost:<port>` |
|
|
22
|
-
|
|
23
|
-
Override the base URL by setting `ELEVASIS_API_URL` in your environment or passing `--api-url` to any CLI command.
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
## Endpoints
|
|
28
|
-
|
|
29
|
-
| Method | Path | Purpose |
|
|
30
|
-
| ------ | ---------------------------------------------------------- | ---------------------------------------- |
|
|
31
|
-
| `GET` | `/api/external/resources` | List all resources for your organization |
|
|
32
|
-
| `GET` | `/api/external/resources/:resourceId/definition` | Get resource metadata and schemas |
|
|
33
|
-
| `POST` | `/api/external/execute` | Execute a resource synchronously |
|
|
34
|
-
| `POST` | `/api/external/execute-async` | Execute a resource asynchronously |
|
|
35
|
-
| `POST` | `/api/external/executions/:resourceId/:executionId/cancel` | Cancel a running execution |
|
|
36
|
-
| `GET` | `/api/external/executions/:resourceId` | List execution history for a resource |
|
|
37
|
-
| `GET` | `/api/external/executions/:resourceId/:executionId` | Get full execution detail |
|
|
38
|
-
| `POST` | `/api/external/deploy` | Upload bundle and deploy resources |
|
|
39
|
-
| `GET` | `/api/external/deployments` | List all deployments |
|
|
40
|
-
| `GET` | `/api/external/deployments/:id` | Get a deployment by ID |
|
|
41
|
-
|
|
42
|
-
---
|
|
43
|
-
|
|
44
|
-
## Execution Endpoints
|
|
45
|
-
|
|
46
|
-
### POST /api/external/execute
|
|
47
|
-
|
|
48
|
-
Execute a resource synchronously. The request waits for the resource to complete and returns the full result.
|
|
49
|
-
|
|
50
|
-
**Request body:**
|
|
51
|
-
|
|
52
|
-
```json
|
|
53
|
-
{
|
|
54
|
-
"resourceId": "onboard-client",
|
|
55
|
-
"input": {
|
|
56
|
-
"clientName": "Jane",
|
|
57
|
-
"email": "jane@example.com"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
**Response:**
|
|
63
|
-
|
|
64
|
-
```json
|
|
65
|
-
{
|
|
66
|
-
"executionId": "550e8400-e29b-41d4-a716-446655440000",
|
|
67
|
-
"success": true,
|
|
68
|
-
"data": {
|
|
69
|
-
"success": true,
|
|
70
|
-
"clientId": "client_1708521600000",
|
|
71
|
-
"welcomeEmailSent": true
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### POST /api/external/execute-async
|
|
77
|
-
|
|
78
|
-
Execute a resource asynchronously. Returns immediately with an `executionId`. Poll `GET /executions/:resourceId/:executionId` to check status and retrieve output.
|
|
79
|
-
|
|
80
|
-
**Request body:**
|
|
81
|
-
|
|
82
|
-
```json
|
|
83
|
-
{
|
|
84
|
-
"resourceId": "onboard-client",
|
|
85
|
-
"input": { "clientName": "Jane" }
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
**Response:**
|
|
90
|
-
|
|
91
|
-
```json
|
|
92
|
-
{
|
|
93
|
-
"executionId": "550e8400-e29b-41d4-a716-446655440000",
|
|
94
|
-
"status": "running"
|
|
95
|
-
}
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### POST /api/external/executions/:resourceId/:executionId/cancel
|
|
99
|
-
|
|
100
|
-
Cancel a running execution. If the execution is found in memory, sends a cancellation signal immediately. Falls back to a database status update if no in-memory signal is found.
|
|
101
|
-
|
|
102
|
-
**Response:**
|
|
103
|
-
|
|
104
|
-
```json
|
|
105
|
-
{
|
|
106
|
-
"success": true
|
|
107
|
-
}
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Resource Endpoints
|
|
113
|
-
|
|
114
|
-
### GET /api/external/resources
|
|
115
|
-
|
|
116
|
-
List all resources registered to your organization. In production, only `status: 'prod'` resources are returned.
|
|
117
|
-
|
|
118
|
-
**Response:**
|
|
119
|
-
|
|
120
|
-
```json
|
|
121
|
-
[
|
|
122
|
-
{
|
|
123
|
-
"resourceId": "onboard-client",
|
|
124
|
-
"resourceType": "workflow",
|
|
125
|
-
"name": "Onboard Client",
|
|
126
|
-
"status": "prod"
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
"resourceId": "email-assistant",
|
|
130
|
-
"resourceType": "agent",
|
|
131
|
-
"name": "Email Assistant",
|
|
132
|
-
"status": "prod"
|
|
133
|
-
}
|
|
134
|
-
]
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### GET /api/external/resources/:resourceId/definition
|
|
138
|
-
|
|
139
|
-
Get the full definition for a single resource: metadata, input schema, and output schema.
|
|
140
|
-
|
|
141
|
-
**Response:**
|
|
142
|
-
|
|
143
|
-
```json
|
|
144
|
-
{
|
|
145
|
-
"resourceId": "onboard-client",
|
|
146
|
-
"resourceType": "workflow",
|
|
147
|
-
"name": "Onboard Client",
|
|
148
|
-
"description": "Creates a client record and sends a welcome email",
|
|
149
|
-
"status": "prod",
|
|
150
|
-
"inputSchema": {
|
|
151
|
-
"type": "object",
|
|
152
|
-
"properties": {
|
|
153
|
-
"clientName": { "type": "string" },
|
|
154
|
-
"email": { "type": "string", "format": "email" }
|
|
155
|
-
},
|
|
156
|
-
"required": ["clientName", "email"]
|
|
157
|
-
},
|
|
158
|
-
"outputSchema": {
|
|
159
|
-
"type": "object",
|
|
160
|
-
"properties": {
|
|
161
|
-
"success": { "type": "boolean" },
|
|
162
|
-
"clientId": { "type": "string" }
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
|
-
}
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
Returns `404` if the resource is not found.
|
|
169
|
-
|
|
170
|
-
---
|
|
171
|
-
|
|
172
|
-
## Execution History Endpoints
|
|
173
|
-
|
|
174
|
-
### GET /api/external/executions/:resourceId
|
|
175
|
-
|
|
176
|
-
List execution history for a resource.
|
|
177
|
-
|
|
178
|
-
**Query parameters:**
|
|
179
|
-
|
|
180
|
-
| Parameter | Description |
|
|
181
|
-
| --------- | --------------------------------------------------------------- |
|
|
182
|
-
| `limit` | Maximum number of results (default: 20) |
|
|
183
|
-
| `status` | Filter by status: `running`, `completed`, `failed`, `cancelled` |
|
|
184
|
-
|
|
185
|
-
**Response:**
|
|
186
|
-
|
|
187
|
-
```json
|
|
188
|
-
[
|
|
189
|
-
{
|
|
190
|
-
"executionId": "550e8400-e29b-41d4-a716-446655440000",
|
|
191
|
-
"resourceId": "onboard-client",
|
|
192
|
-
"status": "completed",
|
|
193
|
-
"createdAt": "2026-02-25T14:32:01Z",
|
|
194
|
-
"durationMs": 1234
|
|
195
|
-
}
|
|
196
|
-
]
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### GET /api/external/executions/:resourceId/:executionId
|
|
200
|
-
|
|
201
|
-
Get the full detail for a single execution including input, output, logs, and error.
|
|
202
|
-
|
|
203
|
-
**Response:**
|
|
204
|
-
|
|
205
|
-
```json
|
|
206
|
-
{
|
|
207
|
-
"executionId": "550e8400-e29b-41d4-a716-446655440000",
|
|
208
|
-
"resourceId": "onboard-client",
|
|
209
|
-
"status": "completed",
|
|
210
|
-
"createdAt": "2026-02-25T14:32:01Z",
|
|
211
|
-
"durationMs": 1234,
|
|
212
|
-
"input": {
|
|
213
|
-
"clientName": "Jane",
|
|
214
|
-
"email": "jane@example.com"
|
|
215
|
-
},
|
|
216
|
-
"output": {
|
|
217
|
-
"success": true,
|
|
218
|
-
"clientId": "client_1708521600000",
|
|
219
|
-
"welcomeEmailSent": true
|
|
220
|
-
},
|
|
221
|
-
"logs": [
|
|
222
|
-
{ "timestamp": "2026-02-25T14:32:01.123Z", "message": "Starting onboard-client workflow" },
|
|
223
|
-
{ "timestamp": "2026-02-25T14:32:01.456Z", "message": "Created client record" }
|
|
224
|
-
],
|
|
225
|
-
"error": null
|
|
226
|
-
}
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
---
|
|
230
|
-
|
|
231
|
-
## Deployment Endpoints
|
|
232
|
-
|
|
233
|
-
### POST /api/external/deploy
|
|
234
|
-
|
|
235
|
-
Upload a resource bundle and deploy it. Accepts a multipart request with the compiled bundle and resource metadata.
|
|
236
|
-
|
|
237
|
-
**Response:**
|
|
238
|
-
|
|
239
|
-
```json
|
|
240
|
-
{
|
|
241
|
-
"deployId": "deploy_abc123",
|
|
242
|
-
"status": "active",
|
|
243
|
-
"resources": 4
|
|
244
|
-
}
|
|
245
|
-
```
|
|
246
|
-
|
|
247
|
-
Use `elevasis-sdk deploy` from the CLI rather than calling this endpoint directly -- the CLI handles bundling, metadata generation, and status streaming automatically.
|
|
248
|
-
|
|
249
|
-
### GET /api/external/deployments
|
|
250
|
-
|
|
251
|
-
List all deployments for your organization.
|
|
252
|
-
|
|
253
|
-
**Response:**
|
|
254
|
-
|
|
255
|
-
```json
|
|
256
|
-
[
|
|
257
|
-
{
|
|
258
|
-
"id": "deploy_abc123",
|
|
259
|
-
"status": "active",
|
|
260
|
-
"createdAt": "2026-02-25T14:00:00Z",
|
|
261
|
-
"resources": 4
|
|
262
|
-
},
|
|
263
|
-
{
|
|
264
|
-
"id": "deploy_abc122",
|
|
265
|
-
"status": "stopped",
|
|
266
|
-
"createdAt": "2026-02-24T09:30:00Z",
|
|
267
|
-
"resources": 3
|
|
268
|
-
}
|
|
269
|
-
]
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
### GET /api/external/deployments/:id
|
|
273
|
-
|
|
274
|
-
Get a single deployment by ID.
|
|
275
|
-
|
|
276
|
-
**Response shape:** Same as a single item from `GET /deployments`.
|
|
277
|
-
|
|
278
|
-
---
|
|
279
|
-
|
|
280
|
-
## CLI Execution Commands
|
|
281
|
-
|
|
282
|
-
The SDK CLI wraps all execution endpoints. Use these commands instead of calling the API directly during development:
|
|
283
|
-
|
|
284
|
-
| Command | API call | Purpose |
|
|
285
|
-
| ------------------------------------------------------ | -------------------------------------------- | ------------------------ |
|
|
286
|
-
| `elevasis-sdk resources` | `GET /api/external/resources` | List all resources |
|
|
287
|
-
| `elevasis-sdk describe <resource>` | `GET /api/external/resources/:id/definition` | Show resource definition |
|
|
288
|
-
| `elevasis-sdk exec <resource> --input '...'` | `POST /api/external/execute` | Execute synchronously |
|
|
289
|
-
| `elevasis-sdk exec <resource> --input '...' --async` | `POST /api/external/execute-async` | Execute asynchronously |
|
|
290
|
-
| `elevasis-sdk executions <resource>` | `GET /api/external/executions/:id` | List execution history |
|
|
291
|
-
| `elevasis-sdk execution <resource> <id>` | `GET /api/external/executions/:id/:execId` | Get execution detail |
|
|
292
|
-
| `elevasis-sdk deployments` | `GET /api/external/deployments` | List deployments |
|
|
293
|
-
|
|
294
|
-
---
|
|
295
|
-
|
|
296
|
-
**Last Updated:** 2026-02-25
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Provided Features
|
|
3
|
-
description: Shared UI and API surfaces for packaged business systems like Lead Gen, CRM, Projects, Operations, Monitoring, and Settings via @elevasis/ui/features/*.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
The SDK includes more than workflow execution. The published `@elevasis/ui` package provides system manifests, pages, hooks, and headless provider exports for building shell-aware applications.
|
|
7
|
-
|
|
8
|
-
## Shared Shell Contract
|
|
9
|
-
|
|
10
|
-
`ElevasisSystemsProvider` reads the canonical `OrganizationModel`, including `navigation.sidebar`, and exposes a shell model plus sidebar projection helpers. System manifests provide implementation hooks such as icons and subshell sidebars; they do not own structural navigation.
|
|
11
|
-
|
|
12
|
-
```tsx
|
|
13
|
-
import { Outlet } from '@tanstack/react-router'
|
|
14
|
-
import { ElevasisSystemsProvider, SystemShell } from '@elevasis/ui/provider'
|
|
15
|
-
import { leadGenManifest } from '@elevasis/ui/features/lead-gen'
|
|
16
|
-
import { crmManifest } from '@elevasis/ui/features/crm'
|
|
17
|
-
import { deliveryManifest } from '@elevasis/ui/features/delivery'
|
|
18
|
-
import { monitoringManifest } from '@elevasis/ui/features/monitoring'
|
|
19
|
-
import { settingsManifest } from '@elevasis/ui/features/settings'
|
|
20
|
-
import { canonicalOrganizationModel } from '@core/config/organization-model'
|
|
21
|
-
|
|
22
|
-
const systems = [
|
|
23
|
-
leadGenManifest,
|
|
24
|
-
crmManifest,
|
|
25
|
-
deliveryManifest,
|
|
26
|
-
monitoringManifest,
|
|
27
|
-
settingsManifest
|
|
28
|
-
]
|
|
29
|
-
|
|
30
|
-
export function AppShell() {
|
|
31
|
-
return (
|
|
32
|
-
<ElevasisSystemsProvider systems={systems} organizationModel={canonicalOrganizationModel}>
|
|
33
|
-
<SystemShell>
|
|
34
|
-
<Outlet />
|
|
35
|
-
</SystemShell>
|
|
36
|
-
</ElevasisSystemsProvider>
|
|
37
|
-
)
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
Host apps still own TanStack route registration, topbar behavior, branding, auth wiring, and any root dashboard composition.
|
|
42
|
-
|
|
43
|
-
## Contract Matrix
|
|
44
|
-
|
|
45
|
-
| Contract type | What is published | Current examples |
|
|
46
|
-
| --------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
|
|
47
|
-
| Manifest-backed shared subshell systems | System manifest plus shared sidebar/pages, mounted through `@elevasis/ui/provider` | Lead Gen, CRM, Projects, Operations |
|
|
48
|
-
| Shared feature pages and hooks | Pages, hooks, and helpers that can be composed inside host routes | Monitoring, Settings, Dashboard widgets |
|
|
49
|
-
| Headless provider contract | Provider, hooks, and shell model helpers | `ElevasisSystemsProvider`, `useElevasisSystems`, `SystemShell` |
|
|
50
|
-
| Compatibility barrel | Existing imports remain available while newer integrations prefer feature/provider subpaths | `@elevasis/ui/components` |
|
|
51
|
-
|
|
52
|
-
## System Map
|
|
53
|
-
|
|
54
|
-
| System | Primary route space | Shared UI surface | Best SDK entry point |
|
|
55
|
-
| ---------- | ------------------- | ------------------------------------------------------------------ | ----------------------------------------------------------------------------------------- |
|
|
56
|
-
| Lead Gen | `/lead-gen/*` | Lead Gen pages, sidebars, list detail page, run dialogs | `@elevasis/ui/features/lead-gen`, `@elevasis/ui/hooks`, `@elevasis/sdk/worker` |
|
|
57
|
-
| CRM | `/crm/*` | CRM sidebar, overview widgets, deal/detail pages, workbench panels | `@elevasis/ui/features/crm`, `@elevasis/ui/hooks`, `@elevasis/sdk/worker` |
|
|
58
|
-
| Projects | `/projects/*` | Projects list page, milestones/tasks/notes sidebars and pages | `@elevasis/ui/features/delivery`, `@elevasis/ui/hooks/delivery`, `elevasis-sdk project:*` |
|
|
59
|
-
| Operations | `/operations/*` | Command View, resources, organization graph, sessions | `@elevasis/ui/features/operations` |
|
|
60
|
-
| Dashboard | `/` host-owned | Dashboard and overview components only | `@elevasis/ui/features/dashboard` |
|
|
61
|
-
| Monitoring | `/monitoring/*` | Monitoring pages/components | `@elevasis/ui/features/monitoring` |
|
|
62
|
-
| Settings | `/settings/*` | Settings/account/org components | `@elevasis/ui/features/settings` |
|
|
63
|
-
|
|
64
|
-
## Organization Model Alignment
|
|
65
|
-
|
|
66
|
-
Manifest `systemId` values must match Organization Model System IDs. Sidebar placement is authored in the Organization Model navigation domain:
|
|
67
|
-
|
|
68
|
-
```ts
|
|
69
|
-
systems: {
|
|
70
|
-
dashboard: { id: 'dashboard', order: 10, label: 'Dashboard', lifecycle: 'active' },
|
|
71
|
-
clients: { id: 'clients', order: 20, label: 'Clients', lifecycle: 'active' }
|
|
72
|
-
},
|
|
73
|
-
navigation: {
|
|
74
|
-
sidebar: {
|
|
75
|
-
primary: {
|
|
76
|
-
dashboard: { type: 'surface', order: 10, label: 'Dashboard', path: '/', surfaceType: 'dashboard', targets: { systems: ['dashboard'] } },
|
|
77
|
-
business: {
|
|
78
|
-
type: 'group',
|
|
79
|
-
order: 20,
|
|
80
|
-
label: 'Business',
|
|
81
|
-
children: {
|
|
82
|
-
clients: { type: 'surface', order: 20, label: 'Clients', path: '/clients', surfaceType: 'list', targets: { systems: ['clients'] } }
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
bottom: {}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
Dashboard appears before Business in the primary sidebar. Business is a navigation group only; `/clients` is the canonical client route.
|
|
92
|
-
|
|
93
|
-
## Choosing The Right Surface
|
|
94
|
-
|
|
95
|
-
- Need packaged sidebar/page composition? Use `ElevasisSystemsProvider`, `SystemShell`, and manifests from `@elevasis/ui/features/*`.
|
|
96
|
-
- Need a root dashboard? Keep that route host-owned and compose dashboard components.
|
|
97
|
-
- Need list-scoped lead-gen runtime behavior? Use the `list` adapter, then `acqDb` for broader acquisition CRUD.
|
|
98
|
-
- Need project/task automation? Use `elevasis-sdk project:*`.
|
|
99
|
-
|
|
100
|
-
## Related
|
|
101
|
-
|
|
102
|
-
- [Deployment](index.mdx)
|
|
103
|
-
- [Command Center](command-center.mdx)
|
|
104
|
-
- [UI Execution](ui-execution.mdx)
|
|
105
|
-
- [Platform Adapters](../platform-tools/adapters-platform.mdx)
|
|
106
|
-
- [CLI Reference](../cli.mdx)
|
|
107
|
-
|
|
108
|
-
---
|
|
109
|
-
|
|
110
|
-
**Last Updated:** 2026-03-06
|