@elevasis/sdk 1.15.1 → 1.16.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 (59) hide show
  1. package/dist/cli.cjs +2325 -124
  2. package/dist/index.d.ts +410 -473
  3. package/dist/index.js +96 -44
  4. package/dist/node/index.d.ts +69 -0
  5. package/dist/node/index.js +273 -0
  6. package/dist/test-utils/index.d.ts +473 -466
  7. package/dist/types/worker/platform.d.ts +2 -9
  8. package/package.json +12 -3
  9. package/reference/_navigation.md +23 -1
  10. package/reference/_reference-manifest.json +98 -0
  11. package/reference/claude-config/rules/agent-start-here.md +13 -0
  12. package/reference/claude-config/rules/organization-model.md +40 -40
  13. package/reference/claude-config/rules/organization-os.md +16 -16
  14. package/reference/claude-config/rules/vibe.md +13 -13
  15. package/reference/claude-config/skills/knowledge/SKILL.md +253 -0
  16. package/reference/claude-config/skills/{configure → knowledge}/operations/codify-level-a.md +100 -100
  17. package/reference/claude-config/skills/{configure → knowledge}/operations/codify-level-b.md +158 -158
  18. package/reference/claude-config/skills/knowledge/operations/customers.md +109 -0
  19. package/reference/claude-config/skills/knowledge/operations/features.md +113 -0
  20. package/reference/claude-config/skills/knowledge/operations/goals.md +118 -0
  21. package/reference/claude-config/skills/knowledge/operations/identity.md +93 -0
  22. package/reference/claude-config/skills/knowledge/operations/labels.md +89 -0
  23. package/reference/claude-config/skills/knowledge/operations/offerings.md +109 -0
  24. package/reference/claude-config/skills/knowledge/operations/roles.md +99 -0
  25. package/reference/claude-config/skills/knowledge/operations/techStack.md +102 -0
  26. package/reference/claude-config/skills/run-ui/SKILL.md +73 -0
  27. package/reference/claude-config/skills/setup/SKILL.md +270 -270
  28. package/reference/claude-config/skills/tutorial/SKILL.md +249 -0
  29. package/reference/claude-config/skills/tutorial/progress-template.md +74 -0
  30. package/reference/claude-config/skills/tutorial/technical.md +1309 -0
  31. package/reference/claude-config/skills/tutorial/vibe-coder.md +890 -0
  32. package/reference/claude-config/sync-notes/2026-05-04-elevasis-workspace.md +71 -0
  33. package/reference/claude-config/sync-notes/2026-05-04-template-skills-run-ui-and-tutorial.md +59 -0
  34. package/reference/deployment/index.mdx +5 -5
  35. package/reference/examples/organization-model.ts +40 -0
  36. package/reference/framework/index.mdx +1 -1
  37. package/reference/framework/tutorial-system.mdx +86 -173
  38. package/reference/packages/core/src/knowledge/README.md +32 -0
  39. package/reference/packages/ui/src/knowledge/README.md +31 -0
  40. package/reference/packages/ui/src/theme/presets/README.md +19 -0
  41. package/reference/scaffold/core/organization-model.mdx +1 -1
  42. package/reference/scaffold/recipes/add-a-feature.md +1 -1
  43. package/reference/scaffold/recipes/customize-crm-actions.md +433 -433
  44. package/reference/scaffold/recipes/customize-organization-model.md +3 -3
  45. package/reference/scaffold/recipes/extend-lead-gen.md +90 -55
  46. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +1 -1
  47. package/reference/scaffold/recipes/index.md +6 -0
  48. package/reference/scaffold/reference/contracts.md +1265 -1154
  49. package/reference/scaffold/reference/feature-registry.md +2 -1
  50. package/reference/scaffold/ui/composition-extensibility.mdx +17 -0
  51. package/reference/claude-config/skills/configure/SKILL.md +0 -98
  52. package/reference/claude-config/skills/configure/operations/customers.md +0 -150
  53. package/reference/claude-config/skills/configure/operations/features.md +0 -162
  54. package/reference/claude-config/skills/configure/operations/goals.md +0 -147
  55. package/reference/claude-config/skills/configure/operations/identity.md +0 -133
  56. package/reference/claude-config/skills/configure/operations/labels.md +0 -128
  57. package/reference/claude-config/skills/configure/operations/offerings.md +0 -159
  58. package/reference/claude-config/skills/configure/operations/roles.md +0 -153
  59. package/reference/claude-config/skills/configure/operations/techStack.md +0 -139
@@ -36,14 +36,14 @@ const override = defineOrganizationModel({
36
36
  label: 'Dashboard',
37
37
  enabled: true,
38
38
  path: '/',
39
- icon: 'dashboard',
39
+ icon: 'feature.dashboard',
40
40
  uiPosition: 'sidebar-primary'
41
41
  },
42
42
  {
43
43
  id: 'sales',
44
44
  label: 'Sales',
45
45
  enabled: true,
46
- icon: 'briefcase',
46
+ icon: 'feature.sales',
47
47
  uiPosition: 'sidebar-primary'
48
48
  },
49
49
  {
@@ -71,7 +71,7 @@ Feature field reference:
71
71
  - `description` -- optional settings/help text.
72
72
  - `enabled` -- organization default.
73
73
  - `path` -- route path for leaf nodes. Containers omit it.
74
- - `icon` and `color` -- optional display metadata.
74
+ - `icon` and `color` -- optional display metadata. Use semantic icon tokens such as `feature.dashboard`, `feature.sales`, or project-owned `custom.*` tokens; UI icon libraries are implementation details.
75
75
  - `uiPosition` -- `sidebar-primary` or `sidebar-bottom`; descendants inherit it.
76
76
  - `requiresAdmin` -- hides the node for non-admin members; descendants inherit it.
77
77
  - `devOnly` -- hides the node outside development contexts; descendants inherit it.
@@ -30,31 +30,31 @@ Lead gen is a layered platform surface, not one component:
30
30
 
31
31
  ## Decision Table
32
32
 
33
- | User wants | Start here | Notes |
34
- | --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
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
- | 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`, `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
- | 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
- | 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
- | 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. |
33
+ | User wants | Start here | Notes |
34
+ | --------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
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
+ | 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`, `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
+ | 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
+ | 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
+ | 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. |
42
42
 
43
43
  ## Published Lead-Gen Surfaces
44
44
 
45
- | Surface | Import from | Use for |
46
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- | -------------------------------------------------------------------- |
47
- | `leadGenManifest`, `LEAD_GEN_ITEMS`, `LeadGenSidebar`, `LeadGenSidebarTop`, `LeadGenSidebarMiddle` | `@elevasis/ui/features/lead-gen` | Feature registration and sidebar composition |
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 |
50
- | `LeadGenRouteShell`, `CompanyDetailModal`, `ContactDetailModal`, `LIST_TEMPLATE_OPTIONS`, `buildListConfig` | `@elevasis/ui/features/lead-gen` | Route shell helpers, detail modals, and list creation config helpers |
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 |
53
- | `useCompanies`, `useCompany`, `useContacts`, `useContact` | `@elevasis/ui/hooks` | Acquisition company/contact data access |
54
- | `useArtifacts`, `useCreateArtifact`, `useListMembers`, `useListMember` | `@elevasis/ui/hooks` | Lead-gen substrate data access |
55
- | `useTransitionList`, `useTransitionListMember`, `useTransitionListCompany`, `useDeriveActions` | `@elevasis/ui/hooks` | Stateful transition mutations and contextual action derivation |
56
- | `ElevasisUIProvider`, `ElevasisCoreProvider`, `useElevasisServices` | `@elevasis/ui/provider` | Provider setup, API access, organization context, and `listActions` registry injection |
57
- | `acqDb`, `list` | `@elevasis/sdk/worker` | Workflow-side acquisition and list-scoped platform adapters |
45
+ | Surface | Import from | Use for |
46
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------- | ------------------------------------------------------------------------------------------- |
47
+ | `leadGenManifest`, `LEAD_GEN_ITEMS`, `LeadGenSidebar`, `LeadGenSidebarTop`, `LeadGenSidebarMiddle` | `@elevasis/ui/features/lead-gen` | Feature registration and sidebar composition |
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`, `LeadGenCapabilityKey` | `@elevasis/ui/features/lead-gen` | List Builder workflow registry, slot-based field contracts, and project-owned action wiring |
50
+ | `LeadGenRouteShell`, `CompanyDetailModal`, `ContactDetailModal`, `LIST_TEMPLATE_OPTIONS`, `buildListConfig` | `@elevasis/ui/features/lead-gen` | Route shell helpers, detail modals, and list creation config helpers |
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 |
53
+ | `useCompanies`, `useCompany`, `useContacts`, `useContact` | `@elevasis/ui/hooks` | Acquisition company/contact data access |
54
+ | `useArtifacts`, `useCreateArtifact`, `useListMembers`, `useListMember` | `@elevasis/ui/hooks` | Lead-gen substrate data access |
55
+ | `useTransitionList`, `useTransitionListMember`, `useTransitionListCompany`, `useDeriveActions` | `@elevasis/ui/hooks` | Stateful transition mutations and contextual action derivation |
56
+ | `ElevasisUIProvider`, `ElevasisCoreProvider`, `useElevasisServices` | `@elevasis/ui/provider` | Provider setup, API access, organization context, and `listActions` registry injection |
57
+ | `acqDb`, `list` | `@elevasis/sdk/worker` | Workflow-side acquisition and list-scoped platform adapters |
58
58
 
59
59
  Read the generated contracts before changing typed boundaries:
60
60
 
@@ -153,50 +153,77 @@ function ListBuilderRoute() {
153
153
  }
154
154
  ```
155
155
 
156
- Register project workflow actions at the provider boundary. The shared UI owns the contract; each project owns workflow ids and form choices:
156
+ Register project workflow actions at the provider boundary. The shared UI owns the contract; each project owns workflow ids, capability keys, default inputs, and field components.
157
+
158
+ Each registry entry declares a Zod `schema` and a `layout` of declarative field hints (`StepConfigLayout<Input>`). The shared `StepConfigForm` renders the layout, validates against the schema, and wires `value`/`onChange` for you — no per-action React components. The List Builder right column renders the form as `Configuration | Advanced | Runs` tabs with a sticky action footer; `RunWorkflowModal` renders the same form inline. Omit the `advanced:` section when a step has none.
159
+
160
+ Available field component variants: `textinput`, `textarea`, `numberinput`, `switch`, `segmented`, `select`, `multiselect`, `tags`, `json`. Field hints support `label`, `description`, `placeholder`, `min`/`max`/`step` (numbers), `options` (selects), and `when: (values) => boolean` for conditional visibility.
157
161
 
158
162
  ```tsx
159
- import {
160
- CompanyCleanupForm,
161
- EmailDiscoveryForm,
162
- EmailVerificationForm,
163
- WebsiteExtractForm,
164
- type ListBuilderRegistry
165
- } from '@elevasis/ui/features/lead-gen'
163
+ import * as z from 'zod'
164
+ import { type ListBuilderRegistry } from '@elevasis/ui/features/lead-gen'
165
+ import type { StepConfigLayout } from '@elevasis/ui/components/forms'
166
166
  import { ElevasisUIProvider } from '@elevasis/ui/provider'
167
167
 
168
+ const companyCleanupInputSchema = z.object({
169
+ listId: z.string().uuid(),
170
+ targetDescription: z.string(),
171
+ dryRun: z.boolean().default(true),
172
+ batchSize: z.number().int().min(1).default(20),
173
+ mode: z.enum(['mock', 'live']).default('live')
174
+ })
175
+
176
+ type CompanyCleanupInput = z.infer<typeof companyCleanupInputSchema>
177
+
178
+ const companyCleanupLayout: StepConfigLayout<CompanyCleanupInput> = {
179
+ sections: [
180
+ {
181
+ id: 'configuration',
182
+ fields: [
183
+ {
184
+ path: 'targetDescription',
185
+ component: 'textarea',
186
+ label: 'Target description',
187
+ placeholder: 'independent veterinary clinics in Orange County'
188
+ },
189
+ { path: 'dryRun', component: 'switch', label: 'Dry run' }
190
+ ]
191
+ }
192
+ ],
193
+ advanced: {
194
+ id: 'advanced',
195
+ fields: [
196
+ { path: 'batchSize', component: 'numberinput', label: 'Batch size', min: 1 },
197
+ {
198
+ path: 'mode',
199
+ component: 'segmented',
200
+ options: [
201
+ { value: 'mock', label: 'Mock' },
202
+ { value: 'live', label: 'Live' }
203
+ ],
204
+ when: () => import.meta.env.DEV
205
+ }
206
+ ]
207
+ }
208
+ }
209
+
168
210
  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
211
  {
194
212
  resourceId: 'lgn-company-cleanup-workflow',
213
+ workflowId: 'lgn-company-cleanup-workflow',
214
+ capabilityKey: 'lead-gen.company.cleanup',
195
215
  label: 'Company Cleanup',
196
216
  description: 'Normalize and clean company records for the list.',
197
217
  category: 'utility',
198
218
  stagesAffected: ['populated'],
199
- inputForm: CompanyCleanupForm
219
+ schema: companyCleanupInputSchema,
220
+ layout: companyCleanupLayout,
221
+ defaultInput: (list) => ({
222
+ listId: list.id,
223
+ targetDescription: '',
224
+ dryRun: true,
225
+ batchSize: 20
226
+ })
200
227
  }
201
228
  ]
202
229
 
@@ -209,6 +236,14 @@ export function App() {
209
236
  }
210
237
  ```
211
238
 
239
+ Author the `schema` in a browser-safe sibling file (no Node-only imports) so it can be reused by the workflow runtime AND the UI form. See `apollo-import-schema.ts` in the platform for the canonical split pattern.
240
+
241
+ Per-section split rule (operator-grade vs power-user):
242
+
243
+ - **Configuration:** target/limit, dry-run toggle, mode (preview/finalize), and any field an operator changes between runs.
244
+ - **Advanced:** concurrency, batch size, timeouts, credential names, workflow chaining, dev-only mode toggles. Omit the `advanced:` key entirely when a step has none.
245
+ - **`defaultInput`:** seeds the form before the user touches anything; must include `listId: list.id`.
246
+
212
247
  ## 3. Build a Custom Campaign Workspace
213
248
 
214
249
  When the project needs custom layout or vertical-specific rendering, use the hooks directly:
@@ -29,7 +29,7 @@ features: [
29
29
  label: 'Analytics',
30
30
  enabled: false,
31
31
  path: '/analytics',
32
- icon: 'chart',
32
+ icon: 'custom.analytics',
33
33
  uiPosition: 'sidebar-primary'
34
34
  }
35
35
  ]
@@ -34,6 +34,12 @@ You want to build on the shared lead-gen system without forking it: add lead-gen
34
34
  **[Customize CRM Actions](customize-crm-actions.md)**
35
35
  You want to add, hide, or replace CRM deal action buttons, configure the shared `crmActions` provider path, or call a project-owned workflow from custom UI when server-side action dispatch constraints require it. Covers `ActionDef`, `DEFAULT_CRM_ACTIONS`, provider wiring, and the current v1 boundary for custom action dispatch.
36
36
 
37
+ **[Customize Knowledge Browser](customize-knowledge-browser.md)**
38
+ You want to mount, extend, or replace the default Knowledge Browser. Covers the three customization tiers (default manifest mount, sidebar composition via `KnowledgeSidebarMiddle` + `KNOWLEDGE_ITEMS`, and direct query access via `@elevasis/core/knowledge`), the one-line `vite.config.ts` plugin add (`knowledgePlugin()` from `@elevasis/ui/vite-plugin-knowledge`), and the CSS import requirement.
39
+
40
+ **[Query the Knowledge Graph](query-the-knowledge-graph.md)**
41
+ You want to browse, inspect, or traverse the OrganizationModel knowledge graph from the command line. Covers the three verbs (`knowledge:ls`, `knowledge:cat`, `knowledge:graph`), all five mount axes (`/by-feature/`, `/by-kind/`, `/by-owner/`, `/graph/.../governs/`, `/graph/.../governed-by/`), dual-CLI invocation patterns (`elevasis-sdk` for external projects, `elevasis` for the monorepo), and the Windows/MSYS PowerShell gotcha.
42
+
37
43
  ---
38
44
 
39
45
  ## Reference docs these recipes link into