@elevasis/core 0.22.0 → 0.23.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 (112) hide show
  1. package/dist/index.d.ts +2330 -2391
  2. package/dist/index.js +2322 -1147
  3. package/dist/knowledge/index.d.ts +702 -1136
  4. package/dist/knowledge/index.js +9 -9
  5. package/dist/organization-model/index.d.ts +2330 -2391
  6. package/dist/organization-model/index.js +2322 -1147
  7. package/dist/test-utils/index.d.ts +703 -1106
  8. package/dist/test-utils/index.js +1735 -1089
  9. package/package.json +1 -1
  10. package/src/__tests__/template-core-compatibility.test.ts +11 -79
  11. package/src/_gen/__tests__/__snapshots__/contracts.md.snap +360 -98
  12. package/src/business/acquisition/api-schemas.test.ts +2 -2
  13. package/src/business/acquisition/api-schemas.ts +7 -9
  14. package/src/business/acquisition/build-templates.test.ts +4 -4
  15. package/src/business/acquisition/build-templates.ts +72 -30
  16. package/src/business/acquisition/crm-state-actions.test.ts +13 -11
  17. package/src/business/acquisition/types.ts +7 -3
  18. package/src/execution/engine/agent/core/types.ts +1 -1
  19. package/src/execution/engine/workflow/types.ts +2 -2
  20. package/src/knowledge/README.md +8 -7
  21. package/src/knowledge/__tests__/queries.test.ts +74 -73
  22. package/src/knowledge/format.ts +10 -9
  23. package/src/knowledge/index.ts +1 -1
  24. package/src/knowledge/published.ts +1 -1
  25. package/src/knowledge/queries.ts +26 -25
  26. package/src/organization-model/README.md +66 -26
  27. package/src/organization-model/__tests__/content-kinds-registry.test.ts +210 -0
  28. package/src/organization-model/__tests__/defaults.test.ts +72 -98
  29. package/src/organization-model/__tests__/domains/actions.test.ts +56 -0
  30. package/src/organization-model/__tests__/domains/customers.test.ts +299 -295
  31. package/src/organization-model/__tests__/domains/entities.test.ts +56 -0
  32. package/src/organization-model/__tests__/domains/goals.test.ts +493 -479
  33. package/src/organization-model/__tests__/domains/identity.test.ts +280 -279
  34. package/src/organization-model/__tests__/domains/navigation.test.ts +268 -212
  35. package/src/organization-model/__tests__/domains/offerings.test.ts +414 -419
  36. package/src/organization-model/__tests__/domains/policies.test.ts +323 -0
  37. package/src/organization-model/__tests__/domains/resource-mappings.test.ts +271 -271
  38. package/src/organization-model/__tests__/domains/resources.test.ts +159 -37
  39. package/src/organization-model/__tests__/domains/roles.test.ts +147 -86
  40. package/src/organization-model/__tests__/domains/statuses.test.ts +246 -243
  41. package/src/organization-model/__tests__/domains/systems.test.ts +67 -51
  42. package/src/organization-model/__tests__/flatten-additive-merge.test.ts +361 -0
  43. package/src/organization-model/__tests__/foundation.test.ts +74 -102
  44. package/src/organization-model/__tests__/get-resources-for-system.test.ts +144 -0
  45. package/src/organization-model/__tests__/graph.test.ts +899 -71
  46. package/src/organization-model/__tests__/knowledge.test.ts +173 -52
  47. package/src/organization-model/__tests__/lookup-helpers.test.ts +438 -0
  48. package/src/organization-model/__tests__/migration-helpers.test.ts +591 -0
  49. package/src/organization-model/__tests__/prospecting-ssot.test.ts +36 -27
  50. package/src/organization-model/__tests__/recursive-system-schema.test.ts +520 -0
  51. package/src/organization-model/__tests__/resolve.test.ts +174 -23
  52. package/src/organization-model/__tests__/schema.test.ts +291 -114
  53. package/src/organization-model/__tests__/surface-projection.test.ts +207 -97
  54. package/src/organization-model/catalogs/lead-gen.ts +144 -0
  55. package/src/organization-model/content-kinds/config.ts +36 -0
  56. package/src/organization-model/content-kinds/index.ts +74 -0
  57. package/src/organization-model/content-kinds/pipeline.ts +68 -0
  58. package/src/organization-model/content-kinds/registry.ts +44 -0
  59. package/src/organization-model/content-kinds/status.ts +71 -0
  60. package/src/organization-model/content-kinds/template.ts +83 -0
  61. package/src/organization-model/content-kinds/types.ts +117 -0
  62. package/src/organization-model/contracts.ts +13 -3
  63. package/src/organization-model/defaults.ts +488 -96
  64. package/src/organization-model/domains/actions.ts +239 -0
  65. package/src/organization-model/domains/customers.ts +78 -75
  66. package/src/organization-model/domains/entities.ts +144 -0
  67. package/src/organization-model/domains/goals.ts +83 -80
  68. package/src/organization-model/domains/knowledge.ts +74 -16
  69. package/src/organization-model/domains/navigation.ts +107 -384
  70. package/src/organization-model/domains/offerings.ts +71 -66
  71. package/src/organization-model/domains/policies.ts +102 -0
  72. package/src/organization-model/domains/projects.ts +14 -48
  73. package/src/organization-model/domains/prospecting.ts +62 -181
  74. package/src/organization-model/domains/resources.ts +81 -24
  75. package/src/organization-model/domains/roles.ts +13 -10
  76. package/src/organization-model/domains/sales.ts +10 -219
  77. package/src/organization-model/domains/shared.ts +57 -57
  78. package/src/organization-model/domains/statuses.ts +339 -130
  79. package/src/organization-model/domains/systems.ts +186 -29
  80. package/src/organization-model/foundation.ts +54 -67
  81. package/src/organization-model/graph/build.ts +682 -54
  82. package/src/organization-model/graph/link.ts +1 -1
  83. package/src/organization-model/graph/schema.ts +24 -9
  84. package/src/organization-model/graph/types.ts +20 -7
  85. package/src/organization-model/helpers.ts +231 -26
  86. package/src/organization-model/index.ts +116 -5
  87. package/src/organization-model/migration-helpers.ts +249 -0
  88. package/src/organization-model/organization-graph.mdx +16 -15
  89. package/src/organization-model/organization-model.mdx +89 -41
  90. package/src/organization-model/published.ts +120 -18
  91. package/src/organization-model/resolve.ts +117 -54
  92. package/src/organization-model/schema.ts +561 -140
  93. package/src/organization-model/surface-projection.ts +116 -122
  94. package/src/organization-model/types.ts +102 -21
  95. package/src/platform/constants/versions.ts +1 -1
  96. package/src/platform/registry/__tests__/command-view.test.ts +6 -8
  97. package/src/platform/registry/__tests__/resource-link.test.ts +13 -8
  98. package/src/platform/registry/__tests__/resource-registry.integration.test.ts +16 -31
  99. package/src/platform/registry/__tests__/resource-registry.nested-systems.test.ts +245 -0
  100. package/src/platform/registry/__tests__/resource-registry.test.ts +9 -7
  101. package/src/platform/registry/__tests__/validation.test.ts +15 -11
  102. package/src/platform/registry/resource-registry.ts +20 -8
  103. package/src/platform/registry/serialization.ts +7 -7
  104. package/src/platform/registry/types.ts +3 -3
  105. package/src/platform/registry/validation.ts +17 -15
  106. package/src/reference/_generated/contracts.md +362 -99
  107. package/src/reference/glossary.md +18 -18
  108. package/src/supabase/database.types.ts +60 -0
  109. package/src/test-utils/test-utils.test.ts +1 -6
  110. package/src/organization-model/__tests__/domains/operations.test.ts +0 -203
  111. package/src/organization-model/domains/features.ts +0 -31
  112. package/src/organization-model/domains/operations.ts +0 -85
@@ -1030,10 +1030,10 @@ describe('BuildPlanSnapshotSchema', () => {
1030
1030
  expect(result.success).toBe(false)
1031
1031
  })
1032
1032
 
1033
- it('rejects a step capabilityKey outside CAPABILITY_REGISTRY', () => {
1033
+ it('rejects a step actionKey outside ACTION_REGISTRY', () => {
1034
1034
  const result = BuildPlanSnapshotSchema.safeParse({
1035
1035
  ...validSnapshot,
1036
- steps: [{ ...validSnapshot!.steps[0], capabilityKey: 'lead-gen.missing.capability' }]
1036
+ steps: [{ ...validSnapshot!.steps[0], actionKey: 'lead-gen.missing.action' }]
1037
1037
  })
1038
1038
 
1039
1039
  expect(result.success).toBe(false)
@@ -2,7 +2,7 @@ import { z } from 'zod'
2
2
  import { UuidSchema, NonEmptyStringSchema } from '../../platform/utils/validation'
3
3
  import { CRM_PIPELINE_DEFINITION, LEAD_GEN_STAGE_CATALOG } from '../../organization-model/domains/sales'
4
4
  import {
5
- CAPABILITY_REGISTRY,
5
+ ACTION_REGISTRY,
6
6
  CredentialRequirementSchema,
7
7
  RecordColumnConfigSchema
8
8
  } from '../../organization-model/domains/prospecting'
@@ -18,11 +18,9 @@ export const LeadGenStageKeySchema = z
18
18
  message: 'processing state key must match LEAD_GEN_STAGE_CATALOG'
19
19
  })
20
20
 
21
- export const LeadGenCapabilityKeySchema = z
22
- .string()
23
- .refine((value) => CAPABILITY_REGISTRY.some((c) => c.id === value), {
24
- message: 'capabilityKey must match CAPABILITY_REGISTRY'
25
- })
21
+ export const LeadGenActionKeySchema = z.string().refine((value) => ACTION_REGISTRY.some((c) => c.id === value), {
22
+ message: 'actionKey must match ACTION_REGISTRY'
23
+ })
26
24
 
27
25
  const crmStageKeys = CRM_PIPELINE_DEFINITION.stages.map((stage) => stage.stageKey) as [string, ...string[]]
28
26
  const crmStateKeys = CRM_PIPELINE_DEFINITION.stages.flatMap((stage) => stage.states.map((state) => state.stateKey)) as [
@@ -544,7 +542,7 @@ export const BuildPlanSnapshotStepSchema = z
544
542
  recordSourceStageKey: LeadGenStageKeySchema.optional(),
545
543
  dependsOn: z.array(z.string().trim().min(1).max(100)).optional(),
546
544
  dependencyMode: z.literal('per-record-eligibility'),
547
- capabilityKey: LeadGenCapabilityKeySchema,
545
+ actionKey: LeadGenActionKeySchema,
548
546
  defaultBatchSize: z.number().int().positive(),
549
547
  maxBatchSize: z.number().int().positive(),
550
548
  recordColumns: z
@@ -1396,7 +1394,7 @@ export const AcqListSchemas = {
1396
1394
  BuildPlanSnapshotStep: BuildPlanSnapshotStepSchema,
1397
1395
  AcqListMetadata: AcqListMetadataSchema,
1398
1396
  LeadGenStageKey: LeadGenStageKeySchema,
1399
- LeadGenCapabilityKey: LeadGenCapabilityKeySchema,
1397
+ LeadGenActionKey: LeadGenActionKeySchema,
1400
1398
  ProcessingStageStatus: ProcessingStageStatusSchema,
1401
1399
  ProcessingState: ProcessingStateSchema,
1402
1400
  ListStageCounts: ListStageCountsSchema,
@@ -1494,7 +1492,7 @@ export type PipelineConfig = z.infer<typeof PipelineConfigSchema>
1494
1492
  export type BuildPlanSnapshotStep = z.infer<typeof BuildPlanSnapshotStepSchema>
1495
1493
  export type BuildPlanSnapshot = z.infer<typeof BuildPlanSnapshotSchema>
1496
1494
  export type AcqListMetadata = z.infer<typeof AcqListMetadataSchema>
1497
- export type LeadGenCapabilityKey = z.infer<typeof LeadGenCapabilityKeySchema>
1495
+ export type LeadGenActionKey = z.infer<typeof LeadGenActionKeySchema>
1498
1496
  export type ProcessingStageStatus = z.infer<typeof ProcessingStageStatusSchema>
1499
1497
  export type ListStageCountsInput = z.infer<typeof ListStageCountsSchema>['stageCounts']
1500
1498
  export type ListTelemetryInput = z.infer<typeof ListTelemetrySchema>
@@ -88,7 +88,7 @@ describe('createBuildPlanSnapshotFromTemplateId — "local-services"', () => {
88
88
  expect(snapshot?.steps).toHaveLength(7)
89
89
  })
90
90
 
91
- it('every step has required fields: id, label, primaryEntity, outputs, stageKey, dependencyMode, capabilityKey', () => {
91
+ it('every step has required fields: id, label, primaryEntity, outputs, stageKey, dependencyMode, actionKey', () => {
92
92
  for (const step of snapshot?.steps ?? []) {
93
93
  expect(step.id).toBeTruthy()
94
94
  expect(step.label).toBeTruthy()
@@ -96,7 +96,7 @@ describe('createBuildPlanSnapshotFromTemplateId — "local-services"', () => {
96
96
  expect(step.outputs.length).toBeGreaterThanOrEqual(1)
97
97
  expect(step.stageKey).toBeTruthy()
98
98
  expect(step.dependencyMode).toBe('per-record-eligibility')
99
- expect(step.capabilityKey).toBeTruthy()
99
+ expect(step.actionKey).toBeTruthy()
100
100
  }
101
101
  })
102
102
 
@@ -149,7 +149,7 @@ describe('createBuildPlanSnapshotFromTemplateId — "dtc-subscription-apollo-cli
149
149
  expect(snapshot?.steps).toHaveLength(6)
150
150
  })
151
151
 
152
- it('every step has required fields: id, label, primaryEntity, outputs, stageKey, dependencyMode, capabilityKey', () => {
152
+ it('every step has required fields: id, label, primaryEntity, outputs, stageKey, dependencyMode, actionKey', () => {
153
153
  for (const step of snapshot?.steps ?? []) {
154
154
  expect(step.id).toBeTruthy()
155
155
  expect(step.label).toBeTruthy()
@@ -157,7 +157,7 @@ describe('createBuildPlanSnapshotFromTemplateId — "dtc-subscription-apollo-cli
157
157
  expect(step.outputs.length).toBeGreaterThanOrEqual(1)
158
158
  expect(step.stageKey).toBeTruthy()
159
159
  expect(step.dependencyMode).toBe('per-record-eligibility')
160
- expect(step.capabilityKey).toBeTruthy()
160
+ expect(step.actionKey).toBeTruthy()
161
161
  }
162
162
  })
163
163
 
@@ -1,28 +1,60 @@
1
- import { DEFAULT_ORGANIZATION_MODEL_PROSPECTING } from '../../organization-model/domains/prospecting'
2
- import type { BuildPlanSnapshot, BuildPlanSnapshotStep } from './types'
3
-
4
- export const PROSPECTING_BUILD_TEMPLATE_OPTIONS = DEFAULT_ORGANIZATION_MODEL_PROSPECTING.buildTemplates.map(
5
- ({ id, label, description }) => ({
6
- id,
7
- label,
8
- description
9
- })
10
- )
11
-
12
- export const DEFAULT_PROSPECTING_BUILD_TEMPLATE_ID = DEFAULT_ORGANIZATION_MODEL_PROSPECTING.defaultBuildTemplateId
13
-
14
- export function isProspectingBuildTemplateId(value: string): boolean {
15
- return PROSPECTING_BUILD_TEMPLATE_OPTIONS.some((template) => template.id === value)
16
- }
17
-
18
- export function createBuildPlanSnapshotFromTemplateId(templateId: string): BuildPlanSnapshot | null {
19
- const template = DEFAULT_ORGANIZATION_MODEL_PROSPECTING.buildTemplates.find((item) => item.id === templateId)
20
- if (!template) return null
21
-
22
- return {
23
- templateId: template.id,
24
- templateLabel: template.label,
25
- steps: template.steps.map((step): BuildPlanSnapshotStep => {
1
+ // Phase 4: DEFAULT_ORGANIZATION_MODEL_PROSPECTING was deleted (compound domain removed per D8).
2
+ // Build-template definitions are now sourced inline from PROSPECTING_STEPS, which retains
3
+ // the step catalog. The template catalog (id, label, description, steps[]) is declared here
4
+ // as a local constant — Wave 2 will author these as system.content entries on the canonical OM.
5
+ import {
6
+ PROSPECTING_STEPS,
7
+ type CredentialRequirement,
8
+ type ListBuilderStep,
9
+ type RecordColumnConfig
10
+ } from '../../organization-model/domains/prospecting'
11
+ import type { BuildPlanSnapshot, BuildPlanSnapshotStep } from './types'
12
+
13
+ interface BuildTemplateCatalogEntry {
14
+ id: string
15
+ label: string
16
+ description?: string
17
+ steps: ListBuilderStep[]
18
+ }
19
+
20
+ // Template catalog — mirrors the data that lived in DEFAULT_ORGANIZATION_MODEL_PROSPECTING.buildTemplates.
21
+ // Wave 2 canonical OM will author these as (kind:'schema', type:'template') content nodes.
22
+ const BUILD_TEMPLATE_CATALOG: BuildTemplateCatalogEntry[] = [
23
+ {
24
+ id: 'local-services',
25
+ label: 'Local Services',
26
+ description: 'Source, analyze, qualify, and personalize local service businesses for outreach.',
27
+ steps: Object.values(PROSPECTING_STEPS.localServices)
28
+ },
29
+ {
30
+ id: 'dtc-subscription-apollo-clickup',
31
+ label: 'DTC Subscription (Apollo + ClickUp)',
32
+ description:
33
+ 'Import DTC brand leads from Apollo, crawl their websites, score fit, enrich contacts, and export via ClickUp.',
34
+ steps: Object.values(PROSPECTING_STEPS.dtcApolloClickup)
35
+ }
36
+ ]
37
+
38
+ export const DEFAULT_PROSPECTING_BUILD_TEMPLATE_ID = 'local-services'
39
+
40
+ export const PROSPECTING_BUILD_TEMPLATE_OPTIONS = BUILD_TEMPLATE_CATALOG.map(({ id, label, description }) => ({
41
+ id,
42
+ label,
43
+ description
44
+ }))
45
+
46
+ export function isProspectingBuildTemplateId(value: string): boolean {
47
+ return PROSPECTING_BUILD_TEMPLATE_OPTIONS.some((template) => template.id === value)
48
+ }
49
+
50
+ export function createBuildPlanSnapshotFromTemplateId(templateId: string): BuildPlanSnapshot | null {
51
+ const template = BUILD_TEMPLATE_CATALOG.find((item: BuildTemplateCatalogEntry) => item.id === templateId)
52
+ if (!template) return null
53
+
54
+ return {
55
+ templateId: template.id,
56
+ templateLabel: template.label,
57
+ steps: template.steps.map((step: ListBuilderStep): BuildPlanSnapshotStep => {
26
58
  const snapshotStep: BuildPlanSnapshotStep = {
27
59
  id: step.id,
28
60
  label: step.label,
@@ -32,7 +64,7 @@ export function createBuildPlanSnapshotFromTemplateId(templateId: string): Build
32
64
  recordsStageKey: step.recordsStageKey ?? step.stageKey,
33
65
  recordSourceStageKey: step.recordSourceStageKey ?? step.recordsStageKey ?? step.stageKey,
34
66
  dependencyMode: step.dependencyMode,
35
- capabilityKey: step.capabilityKey,
67
+ actionKey: step.actionKey,
36
68
  defaultBatchSize: step.defaultBatchSize,
37
69
  maxBatchSize: step.maxBatchSize
38
70
  }
@@ -41,16 +73,26 @@ export function createBuildPlanSnapshotFromTemplateId(templateId: string): Build
41
73
  if (step.recordEntity) snapshotStep.recordEntity = step.recordEntity
42
74
  if (step.dependsOn?.length) snapshotStep.dependsOn = [...step.dependsOn]
43
75
  if (step.credentialRequirements?.length) {
44
- snapshotStep.credentialRequirements = step.credentialRequirements.map((requirement) => ({ ...requirement }))
76
+ snapshotStep.credentialRequirements = step.credentialRequirements.map((requirement: CredentialRequirement) => ({
77
+ ...requirement
78
+ }))
45
79
  }
46
80
  if (step.recordColumns) {
47
81
  snapshotStep.recordColumns = {
48
- ...(step.recordColumns.company ? { company: step.recordColumns.company.map((column) => ({ ...column })) } : {}),
49
- ...(step.recordColumns.contact ? { contact: step.recordColumns.contact.map((column) => ({ ...column })) } : {})
82
+ ...(step.recordColumns.company
83
+ ? {
84
+ company: step.recordColumns.company.map((column: RecordColumnConfig) => ({ ...column }))
85
+ }
86
+ : {}),
87
+ ...(step.recordColumns.contact
88
+ ? {
89
+ contact: step.recordColumns.contact.map((column: RecordColumnConfig) => ({ ...column }))
90
+ }
91
+ : {})
50
92
  }
51
93
  }
52
94
 
53
95
  return snapshotStep
54
96
  })
55
97
  }
56
- }
98
+ }
@@ -1,5 +1,8 @@
1
1
  import { describe, expect, it } from 'vitest'
2
- import { DEFAULT_ORGANIZATION_MODEL_SALES, LEAD_GEN_PIPELINE_DEFINITIONS } from '../../organization-model/domains/sales'
2
+ // Phase 4 (D8): DEFAULT_ORGANIZATION_MODEL_SALES no longer exported — pipeline data moved to
3
+ // system.content. CRM_PIPELINE_DEFINITION is retained as the Stateful pipeline shape
4
+ // for CRM business logic (separate from the OM content nodes).
5
+ import { CRM_PIPELINE_DEFINITION, LEAD_GEN_PIPELINE_DEFINITIONS } from '../../organization-model/domains/sales'
3
6
  import { ActivityEventSchema } from './activity-events'
4
7
  import { DealStageSchema, TransitionItemRequestSchema } from './api-schemas'
5
8
  import { deriveActions } from './derive-actions'
@@ -106,15 +109,14 @@ describe('ActivityEventSchema', () => {
106
109
  })
107
110
 
108
111
  describe('CRM stage and transition vocabulary contracts', () => {
109
- it('keeps DealStage, DealStageSchema, and the default sales pipeline stages aligned', () => {
110
- const defaultPipeline = DEFAULT_ORGANIZATION_MODEL_SALES.pipelines.find(
111
- (pipeline) => pipeline.id === DEFAULT_ORGANIZATION_MODEL_SALES.defaultPipelineId
112
- )
113
- const defaultSalesStages = defaultPipeline?.stages
114
- .toSorted((left, right) => left.order - right.order)
115
- .map((stage) => stage.id)
116
-
117
- expect(defaultSalesStages).toEqual([...DEAL_STAGES])
112
+ // Phase 4 (D8): DEFAULT_ORGANIZATION_MODEL_SALES.pipelines removed.
113
+ // CRM_PIPELINE_DEFINITION (StatefulPipelineDefinition) is the retained Stateful-trait
114
+ // pipeline shape used by CRM business logic. stageKey → DealStageSchema alignment
115
+ // is now verified against CRM_PIPELINE_DEFINITION.stages[*].stageKey.
116
+ it('keeps DealStage, DealStageSchema, and CRM_PIPELINE_DEFINITION stages aligned', () => {
117
+ const crmStageKeys = CRM_PIPELINE_DEFINITION.stages.map((stage) => stage.stageKey)
118
+
119
+ expect(crmStageKeys).toEqual([...DEAL_STAGES])
118
120
  expect(DealStageSchema.options).toEqual([...DEAL_STAGES])
119
121
  })
120
122
 
@@ -122,7 +124,7 @@ describe('CRM stage and transition vocabulary contracts', () => {
122
124
  for (const stageKey of DEAL_STAGES) {
123
125
  expect(
124
126
  TransitionItemRequestSchema.safeParse({
125
- pipelineKey: DEFAULT_ORGANIZATION_MODEL_SALES.defaultPipelineId,
127
+ pipelineKey: CRM_PIPELINE_DEFINITION.pipelineKey,
126
128
  stageKey,
127
129
  stateKey: null,
128
130
  expectedUpdatedAt: '2026-04-27T12:34:56.000Z'
@@ -1,5 +1,9 @@
1
1
  import type { Database } from '../../supabase/database.types'
2
- import type { Capability, CredentialRequirement, RecordColumnConfig } from '../../organization-model/domains/prospecting'
2
+ import type {
3
+ ActionRegistry,
4
+ CredentialRequirement,
5
+ RecordColumnConfig
6
+ } from '../../organization-model/domains/prospecting'
3
7
  import type { LEAD_GEN_STAGE_CATALOG } from '../../organization-model/domains/sales'
4
8
  import type { PipelineStage, ProcessingStageStatus } from './api-schemas'
5
9
 
@@ -52,7 +56,7 @@ export interface WebPost {
52
56
  }
53
57
 
54
58
  export type LeadGenStageKey = (typeof LEAD_GEN_STAGE_CATALOG)[keyof typeof LEAD_GEN_STAGE_CATALOG]['key']
55
- export type LeadGenCapabilityKey = Capability['id']
59
+ export type LeadGenActionKey = ActionRegistry[number]['id']
56
60
 
57
61
  export interface ProcessingStateEntry {
58
62
  status: ProcessingStageStatus
@@ -172,7 +176,7 @@ export interface BuildPlanSnapshotStep {
172
176
  recordSourceStageKey?: string
173
177
  dependsOn?: string[]
174
178
  dependencyMode: BuildPlanSnapshotDependencyMode
175
- capabilityKey: string
179
+ actionKey: string
176
180
  defaultBatchSize: number
177
181
  maxBatchSize: number
178
182
  recordColumns?: Partial<Record<BuildPlanSnapshotPrimaryEntity, RecordColumnConfig[]>>
@@ -33,7 +33,7 @@ export type LLMAdapterFactory = (
33
33
  ...args: any[]
34
34
  ) => LLMAdapter
35
35
 
36
- export type AgentKind = 'orchestrator' | 'specialist' | 'utility' | 'system'
36
+ export type AgentKind = 'orchestrator' | 'specialist' | 'utility' | 'platform'
37
37
 
38
38
  // Agent configuration
39
39
  export interface AgentConfig extends ResourceDefinition {
@@ -16,8 +16,8 @@ export interface WorkflowConfig extends ResourceDefinition {
16
16
  type: 'workflow'
17
17
  /** OM descriptor backing canonical identity and governance metadata. */
18
18
  resource?: WorkflowResourceEntry
19
- /** Lead-gen capability key for registry derivation (e.g. 'lead-gen.company.apollo-import') */
20
- capabilityKey?: string
19
+ /** Lead-gen action key for registry derivation (e.g. 'lead-gen.company.apollo-import') */
20
+ actionKey?: string
21
21
  }
22
22
 
23
23
  export type DescriptorBackedWorkflowConfig = Omit<WorkflowConfig, 'resourceId' | 'type' | 'resource'> & {
@@ -1,4 +1,4 @@
1
- # @elevasis/core/knowledge
1
+ # @elevasis/core/knowledge
2
2
 
3
3
  Pure query layer over the organization graph. Browser-safe (no Node APIs); shared by the SDK CLI, platform CLI, and the `@elevasis/ui/knowledge` browser.
4
4
 
@@ -6,18 +6,18 @@ Pure query layer over the organization graph. Browser-safe (no Node APIs); share
6
6
 
7
7
  | Export | Purpose |
8
8
  | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- |
9
- | `byFeature(graph, featureId, knowledgeNodes)` | Knowledge nodes that govern the given feature. |
9
+ | `bySystem(graph, systemId, knowledgeNodes)` | Knowledge nodes that govern the given system. |
10
10
  | `byKind(graph, kind, knowledgeNodes)` | Filter knowledge nodes by `OrgKnowledgeKind`. |
11
11
  | `byOwner(graph, ownerId, knowledgeNodes)` | Knowledge nodes whose `ownerIds` includes the given owner. |
12
- | `governs(graph, nodeId)` | Outgoing `governs` targets (governed-feature ids) from a knowledge node. |
13
- | `governedBy(graph, nodeId)` | Incoming `governs` sources (governing knowledge-node ids) into a feature. |
14
- | `parsePath(pathString)` | Parse `/by-feature/$id`, `/by-kind/$kind`, `/by-owner/$id`, `/graph/$id/{governs,governed-by}`, or `/$id`. Throws on invalid input. |
12
+ | `governs(graph, nodeId)` | Outgoing `governs` targets (governed-system ids) from a knowledge node. |
13
+ | `governedBy(graph, nodeId)` | Incoming `governs` sources (governing knowledge-node ids) into a system. |
14
+ | `parsePath(pathString)` | Parse `/by-system/$id`, `/by-kind/$kind`, `/by-owner/$id`, `/graph/$id/{governs,governed-by}`, or `/$id`. Throws on invalid input. |
15
15
  | `formatText`, `formatJson`, `formatIdsOnly` | Output formatters used by the `knowledge:*` CLI subcommands. |
16
16
 
17
17
  ## Path syntax
18
18
 
19
19
  ```
20
- /by-feature/<featureId>
20
+ /by-system/<systemId>
21
21
  /by-kind/<playbook|strategy|reference>
22
22
  /by-owner/<ownerId>
23
23
  /graph/<nodeId>/governs
@@ -27,6 +27,7 @@ Pure query layer over the organization graph. Browser-safe (no Node APIs); share
27
27
 
28
28
  ## JSON envelope
29
29
 
30
- `formatJson` returns `{ path, mount, args, results }` the same wrapped envelope used by `pnpm exec elevasis knowledge:ls --json` and `pnpm exec elevasis-sdk knowledge:ls --json`.
30
+ `formatJson` returns `{ path, mount, args, results }` — the same wrapped envelope used by `pnpm exec elevasis knowledge:ls --json` and `pnpm exec elevasis-sdk knowledge:ls --json`.
31
31
 
32
32
  `governs` and `governedBy` accept either bare or graph-namespaced ids (`knowledge.foo` or `knowledge:knowledge.foo`).
33
+