@elevasis/sdk 1.15.0 → 1.15.1

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.
@@ -58,7 +58,9 @@ Read the generated contracts before changing typed boundaries:
58
58
 
59
59
  `node_modules/@elevasis/sdk/reference/scaffold/reference/contracts.md`
60
60
 
61
- Look for the **CRM Platform Primitives** section. It includes deal stages, deal rows, task shapes, API schemas, action definitions, and the focused CRM workflow adapter map. The broader acquisition/list adapter maps live under **Lead Gen Platform Primitives**.
61
+ Look for the **CRM Platform Primitives** section. It includes deal stages, deal rows, task shapes, API schemas, action definitions, and the focused CRM workflow adapter map. The broader acquisition/list adapter maps live under **Lead Gen Platform Primitives**.
62
+
63
+ Deal list and detail responses include a server-derived `priority` object. Use `deal.priority.bucketKey`, `rank`, `label`, `reason`, `latestActivityAt`, and `nextActionAt` when composing custom deal workspaces or workflow-side follow-up logic instead of re-deriving priority from `updated_at`.
62
64
 
63
65
  ## 1. Extend CRM Navigation or Sidebar
64
66
 
@@ -192,13 +194,15 @@ export const followUpStaleDealsWorkflow: WorkflowDefinition = {
192
194
  outputSchema,
193
195
  next: null,
194
196
  handler: async (input) => {
195
- const deals = await crm.listDeals({ stage: input.stage })
196
-
197
- for (const deal of deals) {
198
- await crm.createDealTask({
199
- dealId: deal.id,
200
- title: 'Follow up',
201
- kind: 'email'
197
+ const deals = await crm.listDeals({ stage: input.stage })
198
+
199
+ for (const deal of deals) {
200
+ if (!['follow_up_due', 'stale'].includes(deal.priority.bucketKey)) continue
201
+
202
+ await crm.createDealTask({
203
+ dealId: deal.id,
204
+ title: 'Follow up',
205
+ kind: 'email'
202
206
  })
203
207
  await crm.recordActivity({
204
208
  dealId: deal.id,
@@ -34,8 +34,8 @@ Lead gen is a layered platform surface, not one component:
34
34
  | --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
35
35
  | Change lead-gen feature availability, labels, quick access, or pipeline semantics | `core/config/organization-model.ts` plus `core/config/organization-model.examples.ts` | Treat this as Organization OS work. Use the project's configure ceremony if available. |
36
36
  | Add lead-gen sidebar nav or a lead-gen route | `@elevasis/ui/features/lead-gen` and `node_modules/@elevasis/sdk/reference/scaffold/ui/customization.md` | Prefer manifest/sidebar composition. Do not fork shared source first. |
37
- | Wrap a shared lead-gen page with project chrome | `LeadGenOverviewPage`, `LeadGenListsPage`, `LeadGenListDetailPage`, `LeadGenCompaniesPage`, `LeadGenContactsPage` | Keep route files thin and put project-specific behavior in local feature modules. |
38
- | Build a custom campaign/list workspace | `useLists`, `useList`, `useListMembers`, `useArtifacts`, `useTransitionListMember` from `@elevasis/ui/hooks` | Use hooks for platform data and compose your own UI. |
37
+ | Wrap a shared lead-gen page with project chrome | `LeadGenOverviewPage`, `LeadGenListsPage`, `LeadGenListDetailPage`, `ListBuilderPage`, `LeadGenCompaniesPage`, `LeadGenContactsPage` | Keep route files thin and put project-specific behavior in local feature modules. |
38
+ | Build a custom campaign/list workspace | `ListBuilderPage`, `useLists`, `useList`, `useListProgress`, `useListExecutions`, `useWorkflowExecution`, `useExecutionSSE` from `@elevasis/ui` | Use the shared builder when possible; otherwise compose hooks for platform data and workflow execution. |
39
39
  | Render artifacts or list-member detail | `LeadGenListDetailPage`, `useArtifacts`, `useCreateArtifact`, `useListMember` | Artifacts are a substrate primitive. Keep vertical-specific rendering local until there are repeated use cases. |
40
40
  | Read or mutate lead-gen data inside a workflow | `acqDb` or `list` from `@elevasis/sdk/worker` | `organizationId` is injected server-side by the platform dispatcher. Do not pass it from workflow code. |
41
41
  | Add a new persisted lead-gen field, artifact kind, or transition API | Platform/API migration work, not just scaffold work | Update DB, core schemas/types, API service/handlers, hooks, docs, and scaffold contracts together. |
@@ -45,13 +45,15 @@ Lead gen is a layered platform surface, not one component:
45
45
  | Surface | Import from | Use for |
46
46
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- | -------------------------------------------------------------------- |
47
47
  | `leadGenManifest`, `LEAD_GEN_ITEMS`, `LeadGenSidebar`, `LeadGenSidebarTop`, `LeadGenSidebarMiddle` | `@elevasis/ui/features/lead-gen` | Feature registration and sidebar composition |
48
- | `LeadGenOverviewPage`, `LeadGenListsPage`, `LeadGenListDetailPage`, `LeadGenCompaniesPage`, `LeadGenContactsPage` | `@elevasis/ui/features/lead-gen` | Shared lead-gen pages you can route to or wrap |
48
+ | `LeadGenOverviewPage`, `LeadGenListsPage`, `LeadGenListDetailPage`, `ListBuilderPage`, `LeadGenCompaniesPage`, `LeadGenContactsPage` | `@elevasis/ui/features/lead-gen` | Shared lead-gen pages you can route to or wrap |
49
+ | `ListActionsProvider`, `useListActions`, `ListBuilderWorkflow`, `ListBuilderRegistry`, MVP workflow form components | `@elevasis/ui/features/lead-gen` | List Builder workflow registry, run modal inputs, and project-owned action wiring |
49
50
  | `LeadGenRouteShell`, `CompanyDetailModal`, `ContactDetailModal`, `LIST_TEMPLATE_OPTIONS`, `buildListConfig` | `@elevasis/ui/features/lead-gen` | Route shell helpers, detail modals, and list creation config helpers |
50
51
  | `useLists`, `useList`, `useListsTelemetry`, `useListProgress`, `useListExecutions`, `useCreateList`, `useUpdateList`, `useUpdateListConfig`, `useDeleteList` | `@elevasis/ui/hooks` | Headless list and telemetry data access |
52
+ | `useWorkflowExecution`, `useExecutionSSE`, `useAddCompaniesToList`, `useRemoveCompaniesFromList`, `useAddContactsToList` | `@elevasis/ui/hooks` | List Builder workflow triggering, live execution tailing, and list membership mutations |
51
53
  | `useCompanies`, `useCompany`, `useContacts`, `useContact` | `@elevasis/ui/hooks` | Acquisition company/contact data access |
52
54
  | `useArtifacts`, `useCreateArtifact`, `useListMembers`, `useListMember` | `@elevasis/ui/hooks` | Lead-gen substrate data access |
53
55
  | `useTransitionList`, `useTransitionListMember`, `useTransitionListCompany`, `useDeriveActions` | `@elevasis/ui/hooks` | Stateful transition mutations and contextual action derivation |
54
- | `ElevasisUIProvider`, `ElevasisCoreProvider`, `useElevasisServices` | `@elevasis/ui/provider` | Provider setup, API access, and organization context |
56
+ | `ElevasisUIProvider`, `ElevasisCoreProvider`, `useElevasisServices` | `@elevasis/ui/provider` | Provider setup, API access, organization context, and `listActions` registry injection |
55
57
  | `acqDb`, `list` | `@elevasis/sdk/worker` | Workflow-side acquisition and list-scoped platform adapters |
56
58
 
57
59
  Read the generated contracts before changing typed boundaries:
@@ -135,6 +137,78 @@ function ListDetailRoute() {
135
137
 
136
138
  Use the same wrapping pattern for `LeadGenOverviewPage`, `LeadGenCompaniesPage`, and `LeadGenContactsPage`.
137
139
 
140
+ For the real-time List Builder workspace, add a thin route that passes the route param into `ListBuilderPage`:
141
+
142
+ ```tsx
143
+ import { createFileRoute } from '@tanstack/react-router'
144
+ import { ListBuilderPage } from '@elevasis/ui/features/lead-gen'
145
+
146
+ export const Route = createFileRoute('/lead-gen/list-builder/$listId')({
147
+ component: ListBuilderRoute
148
+ })
149
+
150
+ function ListBuilderRoute() {
151
+ const { listId } = Route.useParams()
152
+ return <ListBuilderPage listId={listId} />
153
+ }
154
+ ```
155
+
156
+ Register project workflow actions at the provider boundary. The shared UI owns the contract; each project owns workflow ids and form choices:
157
+
158
+ ```tsx
159
+ import {
160
+ CompanyCleanupForm,
161
+ EmailDiscoveryForm,
162
+ EmailVerificationForm,
163
+ WebsiteExtractForm,
164
+ type ListBuilderRegistry
165
+ } from '@elevasis/ui/features/lead-gen'
166
+ import { ElevasisUIProvider } from '@elevasis/ui/provider'
167
+
168
+ const listActions: ListBuilderRegistry = [
169
+ {
170
+ resourceId: 'lgn-04-email-discovery-workflow',
171
+ label: 'Email Discovery',
172
+ description: 'Discover contact email addresses for companies in the list.',
173
+ category: 'enrich',
174
+ stagesAffected: ['discovered'],
175
+ inputForm: EmailDiscoveryForm
176
+ },
177
+ {
178
+ resourceId: 'lgn-05-email-verification-workflow',
179
+ label: 'Email Verification',
180
+ description: 'Verify deliverability for contact emails in the list.',
181
+ category: 'enrich',
182
+ stagesAffected: ['verified'],
183
+ inputForm: EmailVerificationForm
184
+ },
185
+ {
186
+ resourceId: 'lgn-02-website-extract-workflow',
187
+ label: 'Website Extract',
188
+ description: 'Extract website intelligence for companies in the list.',
189
+ category: 'scrape',
190
+ stagesAffected: ['extracted'],
191
+ inputForm: WebsiteExtractForm
192
+ },
193
+ {
194
+ resourceId: 'lgn-company-cleanup-workflow',
195
+ label: 'Company Cleanup',
196
+ description: 'Normalize and clean company records for the list.',
197
+ category: 'utility',
198
+ stagesAffected: ['populated'],
199
+ inputForm: CompanyCleanupForm
200
+ }
201
+ ]
202
+
203
+ export function App() {
204
+ return (
205
+ <ElevasisUIProvider listActions={listActions} {...providerProps}>
206
+ {children}
207
+ </ElevasisUIProvider>
208
+ )
209
+ }
210
+ ```
211
+
138
212
  ## 3. Build a Custom Campaign Workspace
139
213
 
140
214
  When the project needs custom layout or vertical-specific rendering, use the hooks directly: