@elevasis/sdk 1.8.3 → 1.10.0
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 +495 -153
- package/dist/index.d.ts +2 -0
- package/dist/test-utils/index.d.ts +8273 -0
- package/dist/test-utils/index.js +20070 -0
- package/dist/types/worker/index.d.ts +20 -1
- package/dist/worker/index.js +3 -2
- package/package.json +8 -2
- package/reference/_navigation.md +15 -1
- package/reference/_reference-manifest.json +56 -0
- package/reference/claude-config/sync-notes/2026-04-24-test-utils-and-template-tests.md +73 -0
- package/reference/claude-config/sync-notes/2026-04-24-ui-consolidation-and-sdk-cli-train.md +86 -0
- package/reference/deployment/index.mdx +42 -7
- package/reference/examples/organization-model.ts +689 -0
- package/reference/index.mdx +6 -5
- package/reference/packages/core/src/test-utils/README.md +5 -10
- package/reference/packages/ui/src/test-utils/README.md +5 -0
- package/reference/scaffold/operations/workflow-recipes.md +94 -1
- package/reference/scaffold/recipes/add-a-feature.md +4 -4
- package/reference/scaffold/recipes/add-a-resource.md +1 -1
- package/reference/scaffold/recipes/customize-organization-model.md +2 -2
- package/reference/scaffold/recipes/gate-by-feature-or-admin.md +2 -2
- package/reference/claude-config/commands/submit-request.md +0 -11
package/reference/index.mdx
CHANGED
|
@@ -8,7 +8,7 @@ loadWhen: "First session or new to the SDK"
|
|
|
8
8
|
|
|
9
9
|
Workflows are step-based automations with typed inputs and outputs. Agents are autonomous AI resources with access to platform tools. Both are defined in TypeScript, exported from a single entry point, and deployed with `elevasis-sdk deploy`. Resources appear in AI Studio immediately after a successful deploy.
|
|
10
10
|
|
|
11
|
-
The SDK ships with a full CLI (`elevasis-sdk`) for validation, deployment, execution, inspection, and project-management operations. Platform tools expose 70+
|
|
11
|
+
The SDK ships with a full CLI (`elevasis-sdk`) for validation, deployment, execution, inspection, and project-management operations. Platform tools expose 70+ tools across integration adapters and platform services -- Gmail, Stripe, Google Sheets, Attio, and more -- with credentials managed server-side so API keys never cross the execution boundary.
|
|
12
12
|
|
|
13
13
|
## Quick Start
|
|
14
14
|
|
|
@@ -25,7 +25,7 @@ After `pnpm dlx @elevasis/sdk init`, your project is scaffolded with a working e
|
|
|
25
25
|
|
|
26
26
|
- **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.
|
|
27
27
|
- **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.
|
|
28
|
-
- **Feature-driven apps** -- The published `@elevasis/ui
|
|
28
|
+
- **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.mdx).
|
|
29
29
|
|
|
30
30
|
## Platform Tools
|
|
31
31
|
|
|
@@ -41,7 +41,7 @@ await scheduler.createSchedule({ ... })
|
|
|
41
41
|
const result = await llm.generate({ messages: [...] })
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
The platform exposes 70+ tools across
|
|
44
|
+
The platform exposes 70+ tools across integration adapters and platform services -- Gmail, Stripe, Google Sheets, Attio, and more. Credentials are managed server-side; API keys never cross the execution boundary.
|
|
45
45
|
|
|
46
46
|
See [Platform Tools](platform-tools/index.mdx) for the full catalog.
|
|
47
47
|
|
|
@@ -72,7 +72,7 @@ See [Platform Tools](platform-tools/index.mdx) for the full catalog.
|
|
|
72
72
|
|
|
73
73
|
### Typed Adapters
|
|
74
74
|
|
|
75
|
-
- [Integration Adapters](platform-tools/adapters-integration.mdx) -
|
|
75
|
+
- [Integration Adapters](platform-tools/adapters-integration.mdx) - Integration adapter catalog for Attio, Stripe, Google Sheets, Resend, and more
|
|
76
76
|
- [Platform Adapters](platform-tools/adapters-platform.mdx) - All 9 platform service adapters: scheduler, storage, llm, pdf, approval, and more
|
|
77
77
|
|
|
78
78
|
### Framework
|
|
@@ -94,6 +94,7 @@ See [Platform Tools](platform-tools/index.mdx) for the full catalog.
|
|
|
94
94
|
- [Command Center](deployment/command-center.mdx) - Resource graph, relationships, node types, and post-deployment UI reference
|
|
95
95
|
- [Provided Features](deployment/provided-features.mdx) - Manifest-backed shared features, compatibility components, and host shell wiring
|
|
96
96
|
- [Execution API](deployment/api.mdx) - REST endpoints for executing resources and managing deployments
|
|
97
|
+
- [UI Execution](deployment/ui-execution.mdx) - Custom React execution dialogs, forms, and hooks built with `@elevasis/ui`
|
|
97
98
|
|
|
98
99
|
### More
|
|
99
100
|
|
|
@@ -102,4 +103,4 @@ See [Platform Tools](platform-tools/index.mdx) for the full catalog.
|
|
|
102
103
|
|
|
103
104
|
---
|
|
104
105
|
|
|
105
|
-
**Last Updated:** 2026-04-
|
|
106
|
+
**Last Updated:** 2026-04-23
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Published test helpers for downstream consumers of `@elevasis/core`.
|
|
4
4
|
|
|
5
|
-
The public `@elevasis/core/test-utils` subpath
|
|
5
|
+
The public `@elevasis/core/test-utils` subpath exposes:
|
|
6
6
|
|
|
7
7
|
- `RLSTestContext` for dev-database RLS integration tests
|
|
8
8
|
- `setupMatchMedia`, `setupResizeObserver`, and `setupBrowserMocks` for jsdom/browser test setup
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
- `TEST_USERS`, `TEST_ORGS`, `TEST_MEMBERSHIPS`, and related fixture factories
|
|
10
|
+
- `createMockSupabaseClient`, `createMockWorkOSClient`, and related mocks
|
|
11
|
+
- base entity factories such as `makeProject`, `makeDeal`, and `makeTask`
|
|
12
|
+
- organization model/profile builders such as `makeOrganizationModel`, `makeInitializationState`, and `makeUserProfile`
|
|
11
13
|
|
|
12
14
|
## Published Usage
|
|
13
15
|
|
|
@@ -33,10 +35,3 @@ const ctx = new RLSTestContext()
|
|
|
33
35
|
- `SUPABASE_ANON_KEY`
|
|
34
36
|
- `SUPABASE_SERVICE_KEY`
|
|
35
37
|
- `SUPABASE_JWT_SECRET`
|
|
36
|
-
|
|
37
|
-
## Internal Scope
|
|
38
|
-
|
|
39
|
-
The following folders remain implementation detail for the monorepo and are not published:
|
|
40
|
-
|
|
41
|
-
- `fixtures/`
|
|
42
|
-
- `mocks/`
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# UI Test Utilities
|
|
2
|
+
|
|
3
|
+
Published test helpers for consumers that test Elevasis UI composition.
|
|
4
|
+
|
|
5
|
+
Use `@elevasis/ui/test-utils` for provider-aware React rendering, WorkOS auth mocks, MSW handlers, and test query clients. Use `@elevasis/ui/test-utils/setup` or `@elevasis/ui/test-utils/setup-integration` from Vitest `setupFiles` when a consumer wants the shared browser and auth mocks.
|
|
@@ -433,4 +433,97 @@ export const agents: never[] = []
|
|
|
433
433
|
3. Import the group barrel in `operations/src/index.ts` and spread into `workflows`/`agents`.
|
|
434
434
|
4. Run `pnpm -C operations check` to validate, then `pnpm -C operations deploy` to publish.
|
|
435
435
|
|
|
436
|
-
**Note:** Use `.js` extensions in imports even though the source is TypeScript. The TypeScript compiler and esbuild bundler both require this for ESM interoperability.
|
|
436
|
+
**Note:** Use `.js` extensions in imports even though the source is TypeScript. The TypeScript compiler and esbuild bundler both require this for ESM interoperability.
|
|
437
|
+
|
|
438
|
+
---
|
|
439
|
+
|
|
440
|
+
## 5. Testing Custom Workflows And UI
|
|
441
|
+
|
|
442
|
+
Package-owned test helpers are the stable way to test custom downstream code. Do not copy template-only tests into a project unless the project owns the matching workflow, route, or component.
|
|
443
|
+
|
|
444
|
+
After the bundled package release lands, use these public subpaths:
|
|
445
|
+
|
|
446
|
+
```typescript
|
|
447
|
+
import { makeProject } from '@elevasis/core/test-utils'
|
|
448
|
+
import { renderWithProviders, mockAuthenticatedUser } from '@elevasis/ui/test-utils'
|
|
449
|
+
import { assertResourceRegistry, mockNotifications, runWorkflow } from '@elevasis/sdk/test-utils'
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### Workflow Smoke Test
|
|
453
|
+
|
|
454
|
+
Use `runWorkflow` for project-owned workflows. This tests the workflow contract, step execution, and parsed output without deploying.
|
|
455
|
+
|
|
456
|
+
```typescript
|
|
457
|
+
import { describe, expect, it } from 'vitest'
|
|
458
|
+
import { runWorkflow, mockNotifications } from '@elevasis/sdk/test-utils'
|
|
459
|
+
import { emailNotification } from './index'
|
|
460
|
+
import type { EmailNotificationOutput } from '@foundation/types'
|
|
461
|
+
|
|
462
|
+
describe('emailNotification workflow', () => {
|
|
463
|
+
it('runs the notify step with a mocked notification adapter', async () => {
|
|
464
|
+
const notifications = mockNotifications({
|
|
465
|
+
create: { id: 'notification-1' }
|
|
466
|
+
})
|
|
467
|
+
|
|
468
|
+
const result = await runWorkflow<EmailNotificationOutput>(
|
|
469
|
+
emailNotification,
|
|
470
|
+
{
|
|
471
|
+
recipientEmail: 'jane@example.com',
|
|
472
|
+
recipientName: 'Jane',
|
|
473
|
+
subject: 'Action ready',
|
|
474
|
+
body: 'Your request has been processed.'
|
|
475
|
+
},
|
|
476
|
+
{ adapters: { notification: notifications } }
|
|
477
|
+
)
|
|
478
|
+
|
|
479
|
+
expect(result.output.delivered).toBe(true)
|
|
480
|
+
expect(result.stepEvents.map((event) => event.stepId)).toContain('notify')
|
|
481
|
+
})
|
|
482
|
+
})
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
### Registry Smoke Test
|
|
486
|
+
|
|
487
|
+
Use `assertResourceRegistry` for a project-owned `operations/src/index.ts` manifest. Keep assertions generic unless the project intentionally owns a fixed workflow list.
|
|
488
|
+
|
|
489
|
+
```typescript
|
|
490
|
+
import { describe, expect, it } from 'vitest'
|
|
491
|
+
import { assertResourceRegistry } from '@elevasis/sdk/test-utils'
|
|
492
|
+
import org from './index'
|
|
493
|
+
|
|
494
|
+
describe('operations registry', () => {
|
|
495
|
+
it('registers a valid operations manifest', () => {
|
|
496
|
+
const spec = assertResourceRegistry(org, { organizationName: 'Example Project' })
|
|
497
|
+
const workflows = spec.workflows ?? []
|
|
498
|
+
|
|
499
|
+
expect(workflows.length + (spec.agents?.length ?? 0)).toBeGreaterThan(0)
|
|
500
|
+
expect(new Set(workflows.map((workflow) => workflow.config.resourceId)).size).toBe(workflows.length)
|
|
501
|
+
})
|
|
502
|
+
})
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
### UI And Core Fixtures
|
|
506
|
+
|
|
507
|
+
Use `@elevasis/ui/test-utils` for route/component tests and `@elevasis/core/test-utils` for schema-compatible fixtures.
|
|
508
|
+
|
|
509
|
+
```tsx
|
|
510
|
+
import { describe, expect, it } from 'vitest'
|
|
511
|
+
import { screen } from '@testing-library/react'
|
|
512
|
+
import { makeProject } from '@elevasis/core/test-utils'
|
|
513
|
+
import { mockAuthenticatedUser, renderWithProviders } from '@elevasis/ui/test-utils'
|
|
514
|
+
import { ProjectCard } from './ProjectCard'
|
|
515
|
+
|
|
516
|
+
describe('ProjectCard', () => {
|
|
517
|
+
it('renders a project fixture for an authenticated user', () => {
|
|
518
|
+
const project = makeProject({ name: 'Website Refresh' })
|
|
519
|
+
|
|
520
|
+
renderWithProviders(<ProjectCard project={project} />, {
|
|
521
|
+
auth: mockAuthenticatedUser()
|
|
522
|
+
})
|
|
523
|
+
|
|
524
|
+
expect(screen.getByText('Website Refresh')).toBeInTheDocument()
|
|
525
|
+
})
|
|
526
|
+
})
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
Template tests are examples and smoke coverage. Downstream projects should keep custom tests close to the feature they validate, then consume these package helpers instead of copying scaffold internals.
|
|
@@ -16,7 +16,7 @@ See [glossary.md](../reference/glossary.md) for term disambiguation throughout t
|
|
|
16
16
|
A shell feature requires a `feature.id` in the org model's `features[]` array to gate it. You have two options:
|
|
17
17
|
|
|
18
18
|
- **Reuse an existing feature** (e.g., `operations`, `monitoring`). The new shell module shares the on/off toggle with the existing feature entry. Fine for sub-modules within the same product area.
|
|
19
|
-
- **Add a new feature object** -- add an entry to the `features[]` array in `
|
|
19
|
+
- **Add a new feature object** -- add an entry to the `features[]` array in `core/config/organization-model.ts`. This is always a template-local change; no core package change is required.
|
|
20
20
|
|
|
21
21
|
For a genuinely new capability (e.g., `analytics`), you add a feature object to the defaults array and author a matching manifest.
|
|
22
22
|
|
|
@@ -26,7 +26,7 @@ See [glossary.md](../reference/glossary.md) under **Feature** (three contexts).
|
|
|
26
26
|
|
|
27
27
|
## 2. Update the organization model
|
|
28
28
|
|
|
29
|
-
File: `
|
|
29
|
+
File: `core/config/organization-model.ts`
|
|
30
30
|
|
|
31
31
|
Add a new feature object to the `features[]` array passed to `defineOrganizationModel`.
|
|
32
32
|
|
|
@@ -63,7 +63,7 @@ Each field of the feature object:
|
|
|
63
63
|
|
|
64
64
|
No domain entry or separate key resolver is needed. The `features[]` array is the sole source of truth.
|
|
65
65
|
|
|
66
|
-
**Two-step pattern:** in a template-derived project, the `defineOrganizationModel` output is passed to `createFoundationOrganizationModel(override)` in `
|
|
66
|
+
**Two-step pattern:** in a template-derived project, the `defineOrganizationModel` output is passed to `createFoundationOrganizationModel(override)` in `core/config/organization-model.ts`. The result exposes `.model`, `.canonical`, and `.homeLabel`. See `external/_template/core/config/organization-model.ts` for the canonical two-step example.
|
|
67
67
|
|
|
68
68
|
---
|
|
69
69
|
|
|
@@ -154,5 +154,5 @@ pnpm -C ui dev
|
|
|
154
154
|
|
|
155
155
|
- Feature appears in the nav sidebar.
|
|
156
156
|
- Route is accessible and the subshell sidebar renders.
|
|
157
|
-
- Toggle `features.enabled.analytics` to `false` in `
|
|
157
|
+
- Toggle `features.enabled.analytics` to `false` in `core/config/organization-model.ts` and confirm the nav item disappears and the route redirects.
|
|
158
158
|
- Check `FeatureGuard` by navigating directly to `/analytics` with the feature disabled.
|
|
@@ -115,7 +115,7 @@ Full relationship and checkpoint types are defined in `@elevasis/sdk` (`Deployme
|
|
|
115
115
|
|
|
116
116
|
## 4. (Optional) Map to a domain
|
|
117
117
|
|
|
118
|
-
To make the resource referenceable from the org model (so the Operations graph and Command View can link to it), add an entry to `resourceMappings` in `
|
|
118
|
+
To make the resource referenceable from the org model (so the Operations graph and Command View can link to it), add an entry to `resourceMappings` in `core/config/organization-model.ts`:
|
|
119
119
|
|
|
120
120
|
```ts
|
|
121
121
|
resourceMappings: [
|
|
@@ -5,7 +5,7 @@ description: Annotated walkthrough for customizing the organization model in tem
|
|
|
5
5
|
|
|
6
6
|
# Customize organization-model.ts
|
|
7
7
|
|
|
8
|
-
`
|
|
8
|
+
`core/config/organization-model.ts` is the semantic contract between your UI runtime
|
|
9
9
|
and your platform operations. Every feature your users can access, every nav surface they can
|
|
10
10
|
navigate to, and every resource backed by a workflow is declared here. The provider reads this
|
|
11
11
|
contract at startup; everything downstream -- routing, gating, nav rendering -- derives from it.
|
|
@@ -366,7 +366,7 @@ Both sides must be consistent (schema validates bidirectionality):
|
|
|
366
366
|
|
|
367
367
|
The organization model flows through the runtime in one direction:
|
|
368
368
|
|
|
369
|
-
1. `
|
|
369
|
+
1. `core/config/organization-model.ts` calls `resolveOrganizationModel` at module load.
|
|
370
370
|
The resolved `canonicalOrganizationModel` is exported.
|
|
371
371
|
2. `ui/src/routes/__root.tsx` imports `canonicalOrganizationModel` and passes it to
|
|
372
372
|
`ElevasisFeaturesProvider` along with the `FEATURE_MANIFESTS` array.
|
|
@@ -27,7 +27,7 @@ Do not substitute one for the other. `FeatureGuard` reads feature flags; `AdminG
|
|
|
27
27
|
|
|
28
28
|
## 2. Feature gate -- org level
|
|
29
29
|
|
|
30
|
-
Ensure a feature object with the matching `id` exists in the org model. File: `
|
|
30
|
+
Ensure a feature object with the matching `id` exists in the org model. File: `core/config/organization-model.ts`.
|
|
31
31
|
|
|
32
32
|
```ts
|
|
33
33
|
import { defineOrganizationModel, OPERATIONS_FEATURE_ID, SALES_FEATURE_ID } from '@elevasis/core/organization-model'
|
|
@@ -155,4 +155,4 @@ State matrix -- confirm each combination:
|
|
|
155
155
|
| true | (absent) | non-admin | Admin-gated route redirects, admin nav hidden |
|
|
156
156
|
| true | (absent) | admin | Admin-gated route accessible, nav visible |
|
|
157
157
|
|
|
158
|
-
Check each gate independently: feature toggle in `
|
|
158
|
+
Check each gate independently: feature toggle in `core/config/organization-model.ts`, membership config in `org_memberships.config`, and admin status in the user profile.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
# Submit Request
|
|
2
|
-
|
|
3
|
-
**Usage:** `/submit-request [optional one-line description]`
|
|
4
|
-
|
|
5
|
-
**Goal:** File a structured request report to the Elevasis platform after agent-driven pre-analysis.
|
|
6
|
-
|
|
7
|
-
**EXECUTE:** `.claude/skills/submit-request/SKILL.md`
|
|
8
|
-
|
|
9
|
-
## Env Requirements
|
|
10
|
-
|
|
11
|
-
- `ELEVASIS_PLATFORM_KEY` (same key used by all `elevasis-sdk` commands — no extra setup if deploy already works)
|