@elevasis/sdk 1.2.0 → 1.4.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.
Files changed (35) hide show
  1. package/dist/cli.cjs +16 -5
  2. package/dist/index.d.ts +476 -49
  3. package/dist/types/worker/adapters/index.d.ts +1 -0
  4. package/dist/types/worker/adapters/lead.d.ts +1 -1
  5. package/dist/types/worker/adapters/list.d.ts +9 -0
  6. package/dist/worker/index.js +20 -3
  7. package/package.json +7 -5
  8. package/reference/_navigation.md +64 -39
  9. package/reference/_reference-manifest.json +509 -0
  10. package/reference/cli.mdx +75 -3
  11. package/reference/deployment/index.mdx +2 -1
  12. package/reference/deployment/provided-features.mdx +259 -0
  13. package/reference/deployment/ui-execution.mdx +251 -0
  14. package/reference/index.mdx +5 -3
  15. package/reference/packages/core/src/README.md +34 -0
  16. package/reference/packages/core/src/organization-model/README.md +79 -0
  17. package/reference/packages/ui/src/api/README.md +18 -0
  18. package/reference/packages/ui/src/auth/README.md +18 -0
  19. package/reference/packages/ui/src/components/README.md +24 -0
  20. package/reference/packages/ui/src/execution/README.md +16 -0
  21. package/reference/packages/ui/src/features/README.md +28 -0
  22. package/reference/packages/ui/src/graph/README.md +16 -0
  23. package/reference/packages/ui/src/hooks/README.md +24 -0
  24. package/reference/packages/ui/src/initialization/README.md +19 -0
  25. package/reference/packages/ui/src/organization/README.md +18 -0
  26. package/reference/packages/ui/src/profile/README.md +19 -0
  27. package/reference/packages/ui/src/provider/README.md +31 -0
  28. package/reference/packages/ui/src/router/README.md +18 -0
  29. package/reference/packages/ui/src/sse/README.md +13 -0
  30. package/reference/packages/ui/src/theme/README.md +23 -0
  31. package/reference/packages/ui/src/types/README.md +16 -0
  32. package/reference/packages/ui/src/utils/README.md +18 -0
  33. package/reference/packages/ui/src/zustand/README.md +18 -0
  34. package/reference/platform-tools/adapters-platform.mdx +93 -36
  35. package/reference/resources/patterns.mdx +48 -0
@@ -0,0 +1,18 @@
1
+ # Auth
2
+
3
+ The auth surface is the published authentication entry point for UI shells.
4
+
5
+ ## Exports
6
+
7
+ - `AuthProvider`
8
+ - `useAuthContext`
9
+ - `useStableAccessToken`
10
+ - `useSessionCheck`
11
+ - `ProtectedRoute`
12
+ - `AdminGuard`
13
+
14
+ ## Use When
15
+
16
+ - You need auth state, access tokens, or session lifecycle checks.
17
+ - You need route-level guards for protected or admin-only UI.
18
+
@@ -0,0 +1,24 @@
1
+ # Components
2
+
3
+ This barrel groups the shared visual and domain UI surfaces that remain part of the published component layer.
4
+
5
+ ## What It Covers
6
+
7
+ - Acquisition and CRM UI primitives
8
+ - Navigation, breadcrumbs, tables, forms, modals, and display components
9
+ - Charts, monitoring widgets, notifications, and error states
10
+ - Layout shells, backgrounds, and sidebar primitives
11
+ - Typeform, rich text, content, and resource-definition helpers
12
+ - Operations UI surfaces that are still shared at the component layer
13
+
14
+ ## Related Subpaths
15
+
16
+ - `./components/navigation`
17
+ - `./components/chat`
18
+ - `./layout`
19
+ - `./charts`
20
+
21
+ ## Notes
22
+
23
+ - The component layer is broad by design, but feature-oriented application shells should still prefer `./features/*` when a dedicated feature surface exists.
24
+
@@ -0,0 +1,16 @@
1
+ # Execution
2
+
3
+ The execution surface contains headless helpers for execution timelines, workflow layouts, and execution-specific data shaping.
4
+
5
+ ## Exports
6
+
7
+ - Hooks under `./hooks`
8
+ - Utilities under `./utils`
9
+ - Execution types under `./types`
10
+ - Shared execution constants
11
+
12
+ ## Use When
13
+
14
+ - You need execution timeline or workflow graph helpers without pulling in visual shells.
15
+ - You need shared execution math or formatting utilities.
16
+
@@ -0,0 +1,28 @@
1
+ # Features
2
+
3
+ Feature subpaths package complete shell-level UI flows for downstream apps.
4
+
5
+ ## Published Feature Surfaces
6
+
7
+ - `./features/auth`
8
+ - `./features/crm`
9
+ - `./features/dashboard`
10
+ - `./features/delivery`
11
+ - `./features/lead-gen`
12
+ - `./features/operations`
13
+ - `./features/monitoring`
14
+ - `./features/seo`
15
+ - `./features/settings`
16
+
17
+ ## What They Contain
18
+
19
+ - Route shells and page-level components
20
+ - Sidebars and feature-specific navigation
21
+ - Feature manifests for registry consumers
22
+ - Feature-specific hooks and shared constants
23
+
24
+ ## Notes
25
+
26
+ - These surfaces are meant for app composition, not for low-level design-system primitives.
27
+ - Some feature exports are also re-exported through `./components` for convenience in legacy or mixed consumers.
28
+
@@ -0,0 +1,16 @@
1
+ # Graph
2
+
3
+ The graph surface is headless. It provides hooks, types, constants, and utilities for ReactFlow-based graph behavior.
4
+
5
+ ## Exports
6
+
7
+ - Graph constants
8
+ - Graph types
9
+ - Graph hooks
10
+ - Graph utilities
11
+
12
+ ## Notes
13
+
14
+ - Visual graph components moved out of this package surface.
15
+ - Use this subpath when you need graph behavior without the visual shell.
16
+
@@ -0,0 +1,24 @@
1
+ # Hooks
2
+
3
+ The hooks barrel is the published headless hook surface for the UI package.
4
+
5
+ ## Grouped Areas
6
+
7
+ - Execution and workflow hooks
8
+ - Scheduling hooks
9
+ - Monitoring, observability, and notification hooks
10
+ - Session and SSE hooks
11
+ - Operations hooks, including command-view and knowledge-base helpers
12
+ - Feature access, table state, and service helpers
13
+ - Acquisition and delivery hooks
14
+
15
+ ## Published Subpaths
16
+
17
+ - `./hooks`
18
+ - `./hooks/delivery`
19
+ - `./hooks/operations/command-view/utils/transformCommandViewData`
20
+
21
+ ## Notes
22
+
23
+ - This barrel is intentionally headless. It should not pull in the visual component layer.
24
+
@@ -0,0 +1,19 @@
1
+ # Initialization
2
+
3
+ The initialization surface coordinates org-aware app startup.
4
+
5
+ ## Exports
6
+
7
+ - `InitializationProvider`
8
+ - `useInitialization`
9
+ - `InitializationContext`
10
+ - `createUseAppInitialization`
11
+ - `InitializationError`
12
+ - `AppInitializationState`
13
+ - `SupabaseUserProfile` type re-export
14
+
15
+ ## Use When
16
+
17
+ - You need zero-config app bootstrap inside an organization-aware provider tree.
18
+ - You still need the deprecated factory pattern for older consumers.
19
+
@@ -0,0 +1,18 @@
1
+ # Organization
2
+
3
+ The organization surface manages multi-tenancy state and the related UI controls.
4
+
5
+ ## Exports
6
+
7
+ - `OrganizationProvider`
8
+ - `OrganizationContext`
9
+ - `useOrganization`
10
+ - `OrganizationSwitcher`
11
+ - Store types and the legacy slice creator
12
+ - Deprecated hook factories for older consumers
13
+
14
+ ## Notes
15
+
16
+ - Prefer the provider and context exports for new code.
17
+ - Legacy Zustand-based helpers remain exported for migration compatibility.
18
+
@@ -0,0 +1,19 @@
1
+ # Profile
2
+
3
+ The profile surface manages the user profile context and profile-backed helpers.
4
+
5
+ ## Exports
6
+
7
+ - `ProfileProvider`
8
+ - `useProfile`
9
+ - `ProfileContextValue`
10
+ - `useUserProfile`
11
+ - `UseUserProfileReturn`
12
+ - `UserProfileService`
13
+ - `SupabaseUserProfile` type re-export
14
+
15
+ ## Use When
16
+
17
+ - You need a shared user profile context.
18
+ - You need a standalone profile service or hook for sync and access.
19
+
@@ -0,0 +1,31 @@
1
+ # Provider
2
+
3
+ The provider surface composes the shared Elevasis service, feature, appearance, notification, and UI providers.
4
+
5
+ ## Exports
6
+
7
+ - `ElevasisCoreProvider`
8
+ - `ElevasisFeaturesProvider`
9
+ - `useElevasisFeatures`
10
+ - `useOptionalElevasisFeatures`
11
+ - `FeatureShell`
12
+ - `AppearanceProvider`
13
+ - `useAppearance`
14
+ - `ElevasisServiceProvider`
15
+ - `useElevasisServices`
16
+ - `NotificationProvider`
17
+ - `useNotificationAdapter`
18
+ - `ElevasisUIProvider`
19
+ - Related provider and service types
20
+
21
+ ## Related Published Subpaths
22
+
23
+ - `./provider`
24
+ - `./provider/ui`
25
+ - `./provider/ElevasisServiceContext`
26
+
27
+ ## Notes
28
+
29
+ - `published.ts` is the external consumer surface.
30
+ - `ElevasisUIProvider` is the Mantine-facing visual layer; `ElevasisCoreProvider` and `ElevasisFeaturesProvider` handle the platform shell.
31
+
@@ -0,0 +1,18 @@
1
+ # Router
2
+
3
+ The router surface provides the shared TanStack Router bridge and router context helpers.
4
+
5
+ ## Exports
6
+
7
+ - `RouterProvider`
8
+ - `useRouterContext`
9
+ - `RouterAdapter`
10
+ - `LinkProps`
11
+ - `TanStackRouterBridge`
12
+ - `ScrollToTop`
13
+
14
+ ## Use When
15
+
16
+ - You need the shared routing abstraction for Elevasis apps.
17
+ - You need a small adapter layer around TanStack Router in a consuming app.
18
+
@@ -0,0 +1,13 @@
1
+ # SSE
2
+
3
+ The SSE surface provides connection management and token-refresh helpers for server-sent events.
4
+
5
+ ## Exports
6
+
7
+ - `SSEConnectionManager`
8
+ - `fetchEventSourceWithTokenRefresh`
9
+
10
+ ## Use When
11
+
12
+ - You need a shared SSE client with auth-aware reconnect behavior.
13
+
@@ -0,0 +1,23 @@
1
+ # Theme
2
+
3
+ The theme surface provides the preset system, CSS variable bridge, and Mantine theme integration.
4
+
5
+ ## Exports
6
+
7
+ - `getPreset`
8
+ - `generateShades`
9
+ - `presets`
10
+ - Theme preset types
11
+ - `createCssVariablesResolver`
12
+ - `TOKEN_VAR_MAP`
13
+ - `mantineThemeOverride`
14
+ - `componentThemes`
15
+ - `PresetsProvider`
16
+ - `usePresetsContext`
17
+ - `useAvailablePresets`
18
+
19
+ ## Use When
20
+
21
+ - You need to build or customize the Elevasis visual theme.
22
+ - You need access to the shared preset registry or CSS variable mapping.
23
+
@@ -0,0 +1,16 @@
1
+ # Types
2
+
3
+ The types surface re-exports the shared platform types that UI consumers need without a direct `@repo/core` dependency.
4
+
5
+ ## Exports
6
+
7
+ - Execution and resource types
8
+ - Command queue and scheduling types
9
+ - Monitoring, observability, and notification types
10
+ - Session, feature-access, and webhook types
11
+ - Multi-tenancy, deployment, and CRM acquisition types
12
+
13
+ ## Notes
14
+
15
+ - This is a type-only bridge. It should stay aligned with the current platform contracts.
16
+
@@ -0,0 +1,18 @@
1
+ # Utils
2
+
3
+ The utils surface groups shared date, formatting, validation, error, and resource helper functions.
4
+
5
+ ## Exports
6
+
7
+ - Date formatting helpers
8
+ - Relative time helpers
9
+ - Email validation
10
+ - Error helpers
11
+ - Resource icon helpers
12
+ - Shared constants
13
+ - Warning suppression helpers
14
+
15
+ ## Use When
16
+
17
+ - You need lightweight shared helpers that do not belong in a feature barrel.
18
+
@@ -0,0 +1,18 @@
1
+ # Zustand
2
+
3
+ The Zustand surface exposes the shared slice creators used by the UI package.
4
+
5
+ ## Exports
6
+
7
+ - `createSSESlice`
8
+ - `resetSSEState`
9
+ - `createThemeSlice`
10
+ - `resetThemeState`
11
+ - `createTimeRangeSlice`
12
+ - `resetTimeRangeState`
13
+ - Slice state and configuration types
14
+
15
+ ## Use When
16
+
17
+ - You need the shared state slices used by the UI package internals or a compatible consumer.
18
+
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  title: Platform Adapters
3
- description: Type-safe singleton adapters for built-in platform services -- scheduler, storage, LLM, PDF, approval, notifications, acqDb, execution, and email -- no credentials required
4
- loadWhen: "Using platform service adapters (scheduler, storage, llm, pdf, approval, acqDb, notifications, execution, email)"
3
+ description: Type-safe singleton adapters for built-in platform services -- scheduler, storage, LLM, PDF, approval, notifications, acqDb, list, execution, and email -- no credentials required
4
+ loadWhen: "Using platform service adapters (scheduler, storage, llm, pdf, approval, notifications, acqDb, list, execution, email)"
5
5
  ---
6
6
 
7
7
  Platform adapters are singleton objects imported directly from `@elevasis/sdk/worker`. They require no credential argument because the platform injects context server-side. For integration adapters (Attio, Stripe, etc.), see [Integration Adapters](adapters-integration.mdx).
@@ -9,7 +9,7 @@ Platform adapters are singleton objects imported directly from `@elevasis/sdk/wo
9
9
  ```typescript
10
10
  import {
11
11
  acqDb, scheduler, storage, pdf, approval,
12
- notifications, llm, execution, email,
12
+ notifications, llm, list, execution, email,
13
13
  } from '@elevasis/sdk/worker'
14
14
  ```
15
15
 
@@ -19,13 +19,14 @@ import {
19
19
 
20
20
  | Import | Methods | Purpose |
21
21
  | --------------- | ------- | ------------------------------------ |
22
- | `acqDb` | 35 | Acquisition database CRUD and sync |
22
+ | `acqDb` | 49 | Acquisition database CRUD and sync |
23
23
  | `scheduler` | 9 | Task schedule management |
24
24
  | `storage` | 5 | File upload, download, signed URLs |
25
25
  | `pdf` | 2 | PDF rendering to storage or buffer |
26
26
  | `approval` | 2 | Human-in-the-loop approval gates |
27
27
  | `notifications` | 1 | In-app team notifications |
28
28
  | `llm` | 1 | LLM inference with structured output |
29
+ | `list` | 4 | List-scoped execution and stage ops |
29
30
  | `execution` | 1 | Trigger nested child executions |
30
31
  | `email` | 1 | Send email to org members |
31
32
 
@@ -287,7 +288,7 @@ await notifications.create({
287
288
 
288
289
  ## AcqDb Adapter
289
290
 
290
- Singleton -- 35 methods for acquisition database management (lists, companies, contacts, deals, deal-sync). `organizationId` is injected server-side -- never pass it.
291
+ Singleton -- 41 methods for acquisition database management (lists, companies, contacts, deals, deal-sync, enrichment, social monitoring). `organizationId` is injected server-side -- never pass it.
291
292
 
292
293
  ```typescript
293
294
  import { acqDb } from '@elevasis/sdk/worker'
@@ -297,12 +298,13 @@ import { acqDb } from '@elevasis/sdk/worker'
297
298
 
298
299
  **List operations:**
299
300
 
300
- | Method | Params | Returns |
301
- | ------------ | -------------------------------------------- | ----------- |
302
- | `listLists` | none | `AcqList[]` |
303
- | `createList` | `Omit<CreateListParams, 'organizationId'>` | `AcqList` |
304
- | `updateList` | `{ id } & UpdateListParams` | `AcqList` |
305
- | `deleteList` | `{ id }` | `void` |
301
+ | Method | Params | Returns |
302
+ | ------------------- | --------------------------------------------------- | ------------------------- |
303
+ | `listLists` | none | `AcqList[]` |
304
+ | `createList` | `Omit<CreateListParams, 'organizationId'>` | `AcqList` |
305
+ | `updateList` | `{ id } & UpdateListParams` | `AcqList` |
306
+ | `deleteList` | `{ id }` | `void` |
307
+ | `addContactsToList` | `Omit<AddContactsToListParams, 'organizationId'>` | `AddContactsToListResult` |
306
308
 
307
309
  **Company operations:**
308
310
 
@@ -317,16 +319,18 @@ import { acqDb } from '@elevasis/sdk/worker'
317
319
 
318
320
  **Contact operations:**
319
321
 
320
- | Method | Params | Returns |
321
- | -------------------- | ----------------------------------------------- | ------------------------------- |
322
- | `createContact` | `Omit<CreateContactParams, 'organizationId'>` | `AcqContact` |
323
- | `upsertContact` | `Omit<UpsertContactParams, 'organizationId'>` | `AcqContact` |
324
- | `updateContact` | `{ id } & UpdateContactParams` | `AcqContact` |
325
- | `getContact` | `{ id }` | `AcqContact | null` |
326
- | `getContactByEmail` | `{ email }` | `AcqContact | null` |
327
- | `listContacts` | `{ filters?, pagination? }` | `PaginatedResult<AcqContact>` |
328
- | `deleteContact` | `{ id }` | `void` |
329
- | `bulkImportContacts` | `Omit<BulkImportParams, 'organizationId'>` | `BulkImportResult` |
322
+ | Method | Params | Returns |
323
+ | ----------------------------- | ----------------------------------------------------- | ------------------------------- |
324
+ | `createContact` | `Omit<CreateContactParams, 'organizationId'>` | `AcqContact` |
325
+ | `upsertContact` | `Omit<UpsertContactParams, 'organizationId'>` | `AcqContact` |
326
+ | `updateContact` | `{ id } & UpdateContactParams` | `AcqContact` |
327
+ | `getContact` | `{ id }` | `AcqContact | null` |
328
+ | `getContactByEmail` | `{ email }` | `AcqContact | null` |
329
+ | `listContacts` | `{ filters?, pagination? }` | `PaginatedResult<AcqContact>` |
330
+ | `deleteContact` | `{ id }` | `void` |
331
+ | `bulkImportContacts` | `Omit<BulkImportParams, 'organizationId'>` | `BulkImportResult` |
332
+ | `bulkImportCompanies` | `Omit<BulkImportCompaniesParams, 'organizationId'>` | `BulkImportCompaniesResult` |
333
+ | `deactivateContactsByCompany` | `{ companyId }` | `{ deactivated: number }` |
330
334
 
331
335
  **Deal operations:**
332
336
 
@@ -340,20 +344,34 @@ import { acqDb } from '@elevasis/sdk/worker'
340
344
 
341
345
  **Deal-sync operations:**
342
346
 
343
- | Method | Params | Returns |
344
- | ------------------------------- | ------------------------------------------------------- | ------------------------------------- |
345
- | `updateDiscoveryData` | `Omit<UpdateDiscoveryDataParams, 'organizationId'>` | `void` |
346
- | `updateProposalData` | `Omit<UpdateProposalDataParams, 'organizationId'>` | `void` |
347
- | `markProposalSent` | `Omit<MarkProposalSentParams, 'organizationId'>` | `void` |
348
- | `markProposalReviewed` | `Omit<MarkProposalReviewedParams, 'organizationId'>` | `void` |
349
- | `updateCloseLostReason` | `Omit<UpdateCloseLostReasonParams, 'organizationId'>` | `void` |
350
- | `updateFees` | `Omit<UpdateFeesParams, 'organizationId'>` | `void` |
351
- | `syncDealStage` | `Omit<SyncDealStageParams, 'organizationId'>` | `void` |
352
- | `setContactNurture` | `Omit<SetContactNurtureParams, 'organizationId'>` | `void` |
353
- | `cancelSchedulesAndHitlByEmail` | `Omit<..., 'organizationId'>` | `{ schedulesCancelled, hitlDeleted }` |
354
- | `cancelHitlByDealId` | `Omit<..., 'organizationId'>` | `{ hitlDeleted }` |
355
- | `clearDealFields` | `Omit<ClearDealFieldsParams, 'organizationId'>` | `void` |
356
- | `deleteDeal` | `Omit<DeleteDealParams, 'organizationId'>` | `void` |
347
+ | Method | Params | Returns |
348
+ | ------------------------------- | ----------------------------------------------------------- | ------------------------------------- |
349
+ | `updateDiscoveryData` | `Omit<UpdateDiscoveryDataParams, 'organizationId'>` | `void` |
350
+ | `updateProposalData` | `Omit<UpdateProposalDataParams, 'organizationId'>` | `void` |
351
+ | `markProposalSent` | `Omit<MarkProposalSentParams, 'organizationId'>` | `void` |
352
+ | `markProposalReviewed` | `Omit<MarkProposalReviewedParams, 'organizationId'>` | `void` |
353
+ | `updateCloseLostReason` | `Omit<UpdateCloseLostReasonParams, 'organizationId'>` | `void` |
354
+ | `updateFees` | `Omit<UpdateFeesParams, 'organizationId'>` | `void` |
355
+ | `syncDealStage` | `Omit<SyncDealStageParams, 'organizationId'>` | `void` |
356
+ | `setContactNurture` | `Omit<SetContactNurtureParams, 'organizationId'>` | `void` |
357
+ | `cancelSchedulesAndHitlByEmail` | `Omit<..., 'organizationId'>` | `{ schedulesCancelled, hitlDeleted }` |
358
+ | `cancelHitlByDealId` | `Omit<..., 'organizationId'>` | `{ hitlDeleted }` |
359
+ | `clearDealFields` | `Omit<ClearDealFieldsParams, 'organizationId'>` | `void` |
360
+ | `deleteDeal` | `Omit<DeleteDealParams, 'organizationId'>` | `void` |
361
+ | `recordReply` | `{ contactEmail, replyText, replySubject?, campaignName? }` | `void` |
362
+ | `recordDealActivity` | `{ attioDealId?, contactEmail?, type, ... }` | `void` |
363
+
364
+ **Enrichment operations:**
365
+
366
+ | Method | Params | Returns |
367
+ | --------------------- | -------------------------------------------------------- | ------- |
368
+ | `mergeEnrichmentData` | `{ id, table: 'acq_companies' | 'acq_contacts', data }` | `void` |
369
+
370
+ **Social monitoring operations:**
371
+
372
+ | Method | Params | Returns |
373
+ | ------------------- | --------------------------------------------------------------- | ------------------------- |
374
+ | `upsertSocialPosts` | `{ posts: Omit<UpsertSocialPostParams, 'organizationId'>[] }` | `UpsertSocialPostsResult` |
357
375
 
358
376
  ### Example
359
377
 
@@ -407,6 +425,45 @@ if (!result.success) {
407
425
 
408
426
  ---
409
427
 
428
+ ## List Adapter
429
+
430
+ Singleton -- 4 methods for list-scoped lead-gen runtime operations. This is the focused companion to `acqDb` for list-oriented workflows.
431
+
432
+ ```typescript
433
+ import { list } from '@elevasis/sdk/worker'
434
+ ```
435
+
436
+ ### Methods
437
+
438
+ | Method | Params | Returns |
439
+ | ------ | ------ | ------- |
440
+ | `getConfig` | `{ listId }` | `ListConfig` |
441
+ | `recordExecution` | `{ listId, executionId, payload? }` | `void` |
442
+ | `updateCompanyStage` | `{ listId, companyId, stage, metadata? }` | `void` |
443
+ | `updateContactStage` | `{ listId, contactId, stage, metadata? }` | `void` |
444
+
445
+ ### Example
446
+
447
+ ```typescript
448
+ const config = await list.getConfig({ listId })
449
+
450
+ await list.recordExecution({
451
+ listId,
452
+ executionId: context.executionId,
453
+ payload: { resourceId: context.resourceId, step: 'qualification' },
454
+ })
455
+
456
+ await list.updateCompanyStage({
457
+ listId,
458
+ companyId,
459
+ stage: 'qualified',
460
+ })
461
+ ```
462
+
463
+ Use `list` when the workflow is explicitly operating on a list pipeline run. Use `acqDb` when you need broader list, company, contact, or deal CRUD.
464
+
465
+ ---
466
+
410
467
  ## Email Adapter
411
468
 
412
469
  Singleton -- 1 method for sending platform emails to organization members (from `notifications@elevasis.io`). For client-facing emails, use the Resend or Instantly integration adapters instead.
@@ -493,4 +550,4 @@ Retryable error codes: `rate_limit_exceeded`, `network_error`, `timeout_error`,
493
550
 
494
551
  ---
495
552
 
496
- **Last Updated:** 2026-03-05
553
+ **Last Updated:** 2026-04-15
@@ -352,4 +352,52 @@ The keys in `workflows` and `agents` are the resource identifiers used in CLI co
352
352
 
353
353
  ---
354
354
 
355
+ ---
356
+
357
+ ## Human-in-the-Loop UI Integration
358
+
359
+ The platform's HITL mechanism works in two parts: your workflow code creates an approval task, and a UI surfaces that task to a reviewer.
360
+
361
+ ### Creating approval tasks
362
+
363
+ Call `approval.create()` from any workflow step to pause execution and emit a task to the Command Queue:
364
+
365
+ ```typescript
366
+ import { approval } from '@elevasis/sdk/worker'
367
+
368
+ const task = await approval.create({
369
+ actions: [
370
+ { id: 'approve', label: 'Approve', type: 'primary' },
371
+ { id: 'reject', label: 'Reject', type: 'danger' },
372
+ ],
373
+ context: { dealId, proposalUrl },
374
+ description: 'Review proposal before sending',
375
+ })
376
+
377
+ if (task.actionId === 'approve') {
378
+ // continue with approved path
379
+ }
380
+ ```
381
+
382
+ The workflow step suspends at `approval.create()` and resumes only after a reviewer submits an action. See [Platform Adapters](../platform-tools/adapters-platform.mdx) for the full `approval.create()` reference.
383
+
384
+ ### Built-in Command Center handling
385
+
386
+ The Command Queue page in the Command Center surfaces all pending approval tasks automatically. Reviewers can filter by resource, approve or reject with an optional comment, and view decision history. No custom UI code is required -- deploy your workflow and the queue populates as tasks arrive.
387
+
388
+ ### Custom UI handling
389
+
390
+ `@elevasis/ui` exposes the following hooks for approval task operations, exported from `@elevasis/ui/hooks`:
391
+
392
+ - `useCommandQueue` -- fetches the list of pending tasks for the organization
393
+ - `useSubmitAction` -- POSTs an action decision to `/command-queue/{taskId}/action`
394
+ - `usePatchTask` -- updates task metadata
395
+ - `useDeleteTask` -- removes a task
396
+
397
+ 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.
398
+
399
+ For triggering executions from custom pages (the other side of the workflow interaction), see [UI Execution](../deployment/ui-execution.mdx).
400
+
401
+ ---
402
+
355
403
  **Last Updated:** 2026-02-25