@elevasis/core 0.21.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 (132) hide show
  1. package/dist/index.d.ts +2518 -2169
  2. package/dist/index.js +2495 -1095
  3. package/dist/knowledge/index.d.ts +706 -1044
  4. package/dist/knowledge/index.js +9 -9
  5. package/dist/organization-model/index.d.ts +2518 -2169
  6. package/dist/organization-model/index.js +2495 -1095
  7. package/dist/test-utils/index.d.ts +826 -1014
  8. package/dist/test-utils/index.js +1894 -1032
  9. package/package.json +3 -3
  10. package/src/__tests__/template-core-compatibility.test.ts +11 -79
  11. package/src/_gen/__tests__/__snapshots__/contracts.md.snap +852 -397
  12. package/src/auth/multi-tenancy/permissions.ts +20 -8
  13. package/src/business/README.md +2 -2
  14. package/src/business/acquisition/api-schemas.test.ts +175 -2
  15. package/src/business/acquisition/api-schemas.ts +132 -16
  16. package/src/business/acquisition/build-templates.test.ts +4 -4
  17. package/src/business/acquisition/build-templates.ts +72 -30
  18. package/src/business/acquisition/crm-state-actions.test.ts +13 -11
  19. package/src/business/acquisition/index.ts +12 -0
  20. package/src/business/acquisition/types.ts +7 -3
  21. package/src/business/clients/api-schemas.test.ts +115 -0
  22. package/src/business/clients/api-schemas.ts +158 -0
  23. package/src/business/clients/index.ts +1 -0
  24. package/src/business/deals/api-schemas.ts +8 -0
  25. package/src/business/index.ts +5 -2
  26. package/src/business/projects/types.ts +19 -0
  27. package/src/execution/engine/__tests__/fixtures/test-agents.ts +10 -8
  28. package/src/execution/engine/agent/core/__tests__/agent.test.ts +16 -12
  29. package/src/execution/engine/agent/core/__tests__/error-passthrough.test.ts +4 -3
  30. package/src/execution/engine/agent/core/types.ts +25 -15
  31. package/src/execution/engine/agent/index.ts +6 -4
  32. package/src/execution/engine/agent/reasoning/__tests__/request-builder.test.ts +24 -18
  33. package/src/execution/engine/index.ts +3 -0
  34. package/src/execution/engine/workflow/types.ts +9 -2
  35. package/src/knowledge/README.md +8 -7
  36. package/src/knowledge/__tests__/queries.test.ts +74 -73
  37. package/src/knowledge/format.ts +10 -9
  38. package/src/knowledge/index.ts +1 -1
  39. package/src/knowledge/published.ts +1 -1
  40. package/src/knowledge/queries.ts +26 -25
  41. package/src/organization-model/README.md +73 -26
  42. package/src/organization-model/__tests__/content-kinds-registry.test.ts +210 -0
  43. package/src/organization-model/__tests__/defaults.test.ts +76 -96
  44. package/src/organization-model/__tests__/domains/actions.test.ts +56 -0
  45. package/src/organization-model/__tests__/domains/customers.test.ts +299 -295
  46. package/src/organization-model/__tests__/domains/entities.test.ts +56 -0
  47. package/src/organization-model/__tests__/domains/goals.test.ts +493 -479
  48. package/src/organization-model/__tests__/domains/identity.test.ts +280 -279
  49. package/src/organization-model/__tests__/domains/navigation.test.ts +268 -212
  50. package/src/organization-model/__tests__/domains/offerings.test.ts +414 -419
  51. package/src/organization-model/__tests__/domains/policies.test.ts +323 -0
  52. package/src/organization-model/__tests__/domains/resource-mappings.test.ts +271 -271
  53. package/src/organization-model/__tests__/domains/resources.test.ts +310 -0
  54. package/src/organization-model/__tests__/domains/roles.test.ts +463 -347
  55. package/src/organization-model/__tests__/domains/statuses.test.ts +246 -243
  56. package/src/organization-model/__tests__/domains/systems.test.ts +209 -0
  57. package/src/organization-model/__tests__/flatten-additive-merge.test.ts +361 -0
  58. package/src/organization-model/__tests__/foundation.test.ts +74 -102
  59. package/src/organization-model/__tests__/get-resources-for-system.test.ts +144 -0
  60. package/src/organization-model/__tests__/graph.test.ts +899 -71
  61. package/src/organization-model/__tests__/knowledge.test.ts +209 -49
  62. package/src/organization-model/__tests__/lookup-helpers.test.ts +438 -0
  63. package/src/organization-model/__tests__/migration-helpers.test.ts +591 -0
  64. package/src/organization-model/__tests__/prospecting-ssot.test.ts +36 -27
  65. package/src/organization-model/__tests__/recursive-system-schema.test.ts +520 -0
  66. package/src/organization-model/__tests__/resolve.test.ts +174 -23
  67. package/src/organization-model/__tests__/schema.test.ts +291 -114
  68. package/src/organization-model/__tests__/surface-projection.test.ts +207 -97
  69. package/src/organization-model/catalogs/lead-gen.ts +144 -0
  70. package/src/organization-model/content-kinds/config.ts +36 -0
  71. package/src/organization-model/content-kinds/index.ts +74 -0
  72. package/src/organization-model/content-kinds/pipeline.ts +68 -0
  73. package/src/organization-model/content-kinds/registry.ts +44 -0
  74. package/src/organization-model/content-kinds/status.ts +71 -0
  75. package/src/organization-model/content-kinds/template.ts +83 -0
  76. package/src/organization-model/content-kinds/types.ts +117 -0
  77. package/src/organization-model/contracts.ts +13 -3
  78. package/src/organization-model/defaults.ts +499 -86
  79. package/src/organization-model/domains/actions.ts +239 -0
  80. package/src/organization-model/domains/customers.ts +78 -75
  81. package/src/organization-model/domains/entities.ts +144 -0
  82. package/src/organization-model/domains/goals.ts +83 -80
  83. package/src/organization-model/domains/knowledge.ts +76 -17
  84. package/src/organization-model/domains/navigation.ts +107 -384
  85. package/src/organization-model/domains/offerings.ts +71 -66
  86. package/src/organization-model/domains/policies.ts +102 -0
  87. package/src/organization-model/domains/projects.ts +14 -48
  88. package/src/organization-model/domains/prospecting.ts +62 -181
  89. package/src/organization-model/domains/resources.ts +145 -0
  90. package/src/organization-model/domains/roles.ts +96 -55
  91. package/src/organization-model/domains/sales.ts +10 -219
  92. package/src/organization-model/domains/shared.ts +57 -57
  93. package/src/organization-model/domains/statuses.ts +339 -130
  94. package/src/organization-model/domains/systems.ts +203 -0
  95. package/src/organization-model/foundation.ts +54 -67
  96. package/src/organization-model/graph/build.ts +682 -54
  97. package/src/organization-model/graph/link.ts +1 -1
  98. package/src/organization-model/graph/schema.ts +24 -9
  99. package/src/organization-model/graph/types.ts +20 -7
  100. package/src/organization-model/helpers.ts +231 -26
  101. package/src/organization-model/icons.ts +1 -0
  102. package/src/organization-model/index.ts +118 -5
  103. package/src/organization-model/migration-helpers.ts +249 -0
  104. package/src/organization-model/organization-graph.mdx +16 -15
  105. package/src/organization-model/organization-model.mdx +111 -44
  106. package/src/organization-model/published.ts +172 -19
  107. package/src/organization-model/resolve.ts +117 -54
  108. package/src/organization-model/schema.ts +654 -112
  109. package/src/organization-model/surface-projection.ts +116 -122
  110. package/src/organization-model/types.ts +146 -20
  111. package/src/platform/api/types.ts +38 -35
  112. package/src/platform/constants/versions.ts +1 -1
  113. package/src/platform/registry/__tests__/command-view.test.ts +6 -8
  114. package/src/platform/registry/__tests__/resource-link.test.ts +13 -8
  115. package/src/platform/registry/__tests__/resource-registry.integration.test.ts +16 -31
  116. package/src/platform/registry/__tests__/resource-registry.nested-systems.test.ts +245 -0
  117. package/src/platform/registry/__tests__/resource-registry.test.ts +2053 -2005
  118. package/src/platform/registry/__tests__/validation.test.ts +1347 -1086
  119. package/src/platform/registry/index.ts +14 -0
  120. package/src/platform/registry/resource-registry.ts +52 -2
  121. package/src/platform/registry/serialization.ts +241 -202
  122. package/src/platform/registry/serialized-types.ts +1 -0
  123. package/src/platform/registry/types.ts +411 -361
  124. package/src/platform/registry/validation.ts +745 -513
  125. package/src/projects/api-schemas.ts +290 -267
  126. package/src/reference/_generated/contracts.md +853 -397
  127. package/src/reference/glossary.md +23 -18
  128. package/src/supabase/database.types.ts +181 -0
  129. package/src/test-utils/test-utils.test.ts +1 -6
  130. package/src/organization-model/__tests__/domains/operations.test.ts +0 -203
  131. package/src/organization-model/domains/features.ts +0 -31
  132. package/src/organization-model/domains/operations.ts +0 -85
@@ -15,34 +15,58 @@ description: Auto-generated TypeScript contracts for SDK consumers. Do not edit
15
15
  export type OrganizationModel = z.infer<typeof OrganizationModelSchema>
16
16
  ```
17
17
 
18
+ ### `OrganizationModelDomainKey`
19
+
20
+ ```typescript
21
+ export type OrganizationModelDomainKey = z.infer<typeof OrganizationModelDomainKeySchema>
22
+ ```
23
+
24
+ ### `OrganizationModelDomainMetadata`
25
+
26
+ ```typescript
27
+ export type OrganizationModelDomainMetadata = z.infer<typeof OrganizationModelDomainMetadataSchema>
28
+ ```
29
+
30
+ ### `OrganizationModelDomainMetadataByDomain`
31
+
32
+ ```typescript
33
+ export type OrganizationModelDomainMetadataByDomain = z.infer<typeof OrganizationModelDomainMetadataByDomainSchema>
34
+ ```
35
+
18
36
  ### `OrganizationModelBranding`
19
37
 
20
38
  ```typescript
21
39
  export type OrganizationModelBranding = z.infer<typeof OrganizationModelBrandingSchema>
22
40
  ```
23
41
 
24
- ### `OrganizationModelSales`
42
+ ### `SalesPipeline`
25
43
 
26
44
  ```typescript
27
- export type OrganizationModelSales = z.infer<typeof OrganizationModelSalesSchema>
45
+ export type SalesPipeline = z.infer<typeof SalesPipelineSchema>
28
46
  ```
29
47
 
30
- ### `OrganizationModelProspecting`
48
+ ### `SalesStage`
31
49
 
32
50
  ```typescript
33
- export type OrganizationModelProspecting = z.infer<typeof OrganizationModelProspectingSchema>
51
+ export type SalesStage = z.infer<typeof SalesStageSchema>
34
52
  ```
35
53
 
36
- ### `OrganizationModelProjects`
54
+ ### `ProspectingBuildTemplate`
37
55
 
38
56
  ```typescript
39
- export type OrganizationModelProjects = z.infer<typeof OrganizationModelProjectsSchema>
57
+ export type ProspectingBuildTemplate = z.infer<typeof ProspectingBuildTemplateSchema>
40
58
  ```
41
59
 
42
- ### `OrganizationModelFeature`
60
+ ### `ProspectingLifecycleStage`
43
61
 
44
62
  ```typescript
45
- export type OrganizationModelFeature = z.infer<typeof FeatureSchema>
63
+ export type ProspectingLifecycleStage = z.infer<typeof ProspectingLifecycleStageSchema>
64
+ ```
65
+
66
+ ### `ProjectsDomainState`
67
+
68
+ ```typescript
69
+ export type ProjectsDomainState = z.infer<typeof ProjectsDomainStateSchema>
46
70
  ```
47
71
 
48
72
  ### `NodeIdPath`
@@ -57,58 +81,82 @@ export type NodeIdPath = z.infer<typeof NodeIdPathSchema>
57
81
  export type NodeIdString = z.infer<typeof NodeIdStringSchema>
58
82
  ```
59
83
 
84
+ ### `OrganizationModelSurface`
85
+
86
+ ```typescript
87
+ export type OrganizationModelSurface = z.infer<typeof SurfaceDefinitionSchema>
88
+ ```
89
+
90
+ ### `OrganizationModelNavigationGroup`
91
+
92
+ ```typescript
93
+ export type OrganizationModelNavigationGroup = z.infer<typeof NavigationGroupSchema>
94
+ ```
95
+
60
96
  ### `OrganizationModelNavigation`
61
97
 
62
98
  ```typescript
63
99
  export type OrganizationModelNavigation = z.infer<typeof OrganizationModelNavigationSchema>
64
100
  ```
65
101
 
66
- ### `OrganizationModelSurface`
102
+ ### `OrganizationModelSidebar`
67
103
 
68
104
  ```typescript
69
- export type OrganizationModelSurface = z.infer<typeof SurfaceDefinitionSchema>
105
+ export type OrganizationModelSidebar = z.infer<typeof SidebarNavigationSchema>
70
106
  ```
71
107
 
72
- ### `OrganizationModelTechStackEntry`
108
+ ### `OrganizationModelSidebarSection`
73
109
 
74
110
  ```typescript
75
- export type OrganizationModelTechStackEntry = z.infer<typeof TechStackEntrySchema>
111
+ export type OrganizationModelSidebarSection = z.infer<typeof SidebarSectionSchema>
76
112
  ```
77
113
 
78
- ### `OrganizationModelStatuses`
114
+ ### `OrganizationModelSidebarNode`
79
115
 
80
116
  ```typescript
81
- export type OrganizationModelStatuses = z.infer<typeof StatusesDomainSchema>
117
+ export type OrganizationModelSidebarNode = z.infer<typeof SidebarNodeSchema>
82
118
  ```
83
119
 
84
- ### `OrganizationModelStatusEntry`
120
+ ### `OrganizationModelSidebarSurfaceTargets`
85
121
 
86
122
  ```typescript
87
- export type OrganizationModelStatusEntry = z.infer<typeof StatusEntrySchema>
123
+ export type OrganizationModelSidebarSurfaceTargets = z.infer<typeof SidebarSurfaceTargetsSchema>
88
124
  ```
89
125
 
90
- ### `OrganizationModelStatusSemanticClass`
126
+ ### `OrganizationModelSidebarSurfaceNode`
91
127
 
92
128
  ```typescript
93
- export type OrganizationModelStatusSemanticClass = z.infer<typeof StatusSemanticClassSchema>
129
+ export type OrganizationModelSidebarSurfaceNode = Extract<OrganizationModelSidebarNode, { type: 'surface' }>
130
+ ```
131
+
132
+ ### `OrganizationModelSidebarGroupNode`
133
+
134
+ ```typescript
135
+ export type OrganizationModelSidebarGroupNode = Extract<OrganizationModelSidebarNode, { type: 'group' }>
136
+ ```
137
+
138
+ ### `OrganizationModelTechStackEntry`
139
+
140
+ ```typescript
141
+ export type OrganizationModelTechStackEntry = z.infer<typeof TechStackEntrySchema>
94
142
  ```
95
143
 
96
- ### `OrganizationModelOperations`
144
+ ### `OrganizationModelStatuses`
97
145
 
98
146
  ```typescript
99
- export type OrganizationModelOperations = z.infer<typeof OperationsDomainSchema>
147
+ export type OrganizationModelStatuses = z.infer<typeof StatusesDomainSchema>
100
148
  ```
101
149
 
102
- ### `OrganizationModelOperationEntry`
150
+ ### `OrganizationModelStatusEntry`
103
151
 
104
152
  ```typescript
105
- export type OrganizationModelOperationEntry = z.infer<typeof OperationEntrySchema>
153
+ export type OrganizationModelStatusEntry = z.infer<typeof StatusEntrySchema>
106
154
  ```
107
155
 
108
- ### `OrganizationModelOperationSemanticClass`
156
+ ### `OrganizationModelStatusSemanticClass`
109
157
 
110
158
  ```typescript
111
- export type OrganizationModelOperationSemanticClass = z.infer<typeof OperationSemanticClassSchema>
159
+ export type OrganizationModelStatusSemanticClass = z.infer<typeof StatusSemanticClassSchema>
112
160
  ```
113
161
 
114
162
  ### `OrganizationModelCustomers`
@@ -159,6 +207,36 @@ export type OrganizationModelRoles = z.infer<typeof RolesDomainSchema>
159
207
  export type OrganizationModelRole = z.infer<typeof RoleSchema>
160
208
  ```
161
209
 
210
+ ### `OrganizationModelRoleId`
211
+
212
+ ```typescript
213
+ export type OrganizationModelRoleId = z.infer<typeof RoleIdSchema>
214
+ ```
215
+
216
+ ### `OrganizationModelRoleHolder`
217
+
218
+ ```typescript
219
+ export type OrganizationModelRoleHolder = z.infer<typeof RoleHolderSchema>
220
+ ```
221
+
222
+ ### `OrganizationModelHumanRoleHolder`
223
+
224
+ ```typescript
225
+ export type OrganizationModelHumanRoleHolder = z.infer<typeof HumanRoleHolderSchema>
226
+ ```
227
+
228
+ ### `OrganizationModelAgentRoleHolder`
229
+
230
+ ```typescript
231
+ export type OrganizationModelAgentRoleHolder = z.infer<typeof AgentRoleHolderSchema>
232
+ ```
233
+
234
+ ### `OrganizationModelTeamRoleHolder`
235
+
236
+ ```typescript
237
+ export type OrganizationModelTeamRoleHolder = z.infer<typeof TeamRoleHolderSchema>
238
+ ```
239
+
162
240
  ### `OrganizationModelGoals`
163
241
 
164
242
  ```typescript
@@ -177,6 +255,252 @@ export type OrganizationModelObjective = z.infer<typeof ObjectiveSchema>
177
255
  export type OrganizationModelKeyResult = z.infer<typeof KeyResultSchema>
178
256
  ```
179
257
 
258
+ ### `OrganizationModelSystems`
259
+
260
+ ```typescript
261
+ export type OrganizationModelSystems = z.infer<typeof SystemsDomainSchema>
262
+ ```
263
+
264
+ ### `OrganizationModelSystemEntry`
265
+
266
+ ```typescript
267
+ export type OrganizationModelSystemEntry = z.infer<typeof SystemEntrySchema>
268
+ ```
269
+
270
+ ### `OrganizationModelSystemId`
271
+
272
+ ```typescript
273
+ export type OrganizationModelSystemId = z.infer<typeof SystemIdSchema>
274
+ ```
275
+
276
+ ### `OrganizationModelSystemPath`
277
+
278
+ ```typescript
279
+ export type OrganizationModelSystemPath = z.infer<typeof SystemPathSchema>
280
+ ```
281
+
282
+ ### `OrganizationModelSystemKind`
283
+
284
+ ```typescript
285
+ export type OrganizationModelSystemKind = z.infer<typeof SystemKindSchema>
286
+ ```
287
+
288
+ ### `OrganizationModelSystemLifecycle`
289
+
290
+ ```typescript
291
+ export type OrganizationModelSystemLifecycle = z.infer<typeof SystemLifecycleSchema>
292
+ ```
293
+
294
+ ### `OrganizationModelSystemStatus`
295
+
296
+ ```typescript
297
+ export type OrganizationModelSystemStatus = z.infer<typeof SystemStatusSchema>
298
+ ```
299
+
300
+ ### `OrganizationModelResources`
301
+
302
+ ```typescript
303
+ export type OrganizationModelResources = z.infer<typeof ResourcesDomainSchema>
304
+ ```
305
+
306
+ ### `OrganizationModelResourceEntry`
307
+
308
+ ```typescript
309
+ export type OrganizationModelResourceEntry = z.infer<typeof ResourceEntrySchema>
310
+ ```
311
+
312
+ ### `OrganizationModelResourceId`
313
+
314
+ ```typescript
315
+ export type OrganizationModelResourceId = z.infer<typeof ResourceIdSchema>
316
+ ```
317
+
318
+ ### `EventId`
319
+
320
+ ```typescript
321
+ export type EventId = z.infer<typeof EventIdSchema>
322
+ ```
323
+
324
+ ### `EventEmissionDescriptor`
325
+
326
+ ```typescript
327
+ export type EventEmissionDescriptor = z.infer<typeof EventEmissionDescriptorSchema>
328
+ ```
329
+
330
+ ### `EventDescriptor`
331
+
332
+ ```typescript
333
+ export type EventDescriptor = z.infer<typeof EventDescriptorSchema>
334
+ ```
335
+
336
+ ### `OrganizationModelResourceKind`
337
+
338
+ ```typescript
339
+ export type OrganizationModelResourceKind = z.infer<typeof ResourceKindSchema>
340
+ ```
341
+
342
+ ### `OrganizationModelResourceGovernanceStatus`
343
+
344
+ ```typescript
345
+ export type OrganizationModelResourceGovernanceStatus = z.infer<typeof ResourceGovernanceStatusSchema>
346
+ ```
347
+
348
+ ### `OrganizationModelAgentKind`
349
+
350
+ ```typescript
351
+ export type OrganizationModelAgentKind = z.infer<typeof AgentKindSchema>
352
+ ```
353
+
354
+ ### `OrganizationModelScriptResourceLanguage`
355
+
356
+ ```typescript
357
+ export type OrganizationModelScriptResourceLanguage = z.infer<typeof ScriptResourceLanguageSchema>
358
+ ```
359
+
360
+ ### `OrganizationModelScriptResourceSource`
361
+
362
+ ```typescript
363
+ export type OrganizationModelScriptResourceSource = z.infer<typeof ScriptResourceSourceSchema>
364
+ ```
365
+
366
+ ### `OrganizationModelWorkflowResourceEntry`
367
+
368
+ ```typescript
369
+ export type OrganizationModelWorkflowResourceEntry = z.infer<typeof WorkflowResourceEntrySchema>
370
+ ```
371
+
372
+ ### `OrganizationModelAgentResourceEntry`
373
+
374
+ ```typescript
375
+ export type OrganizationModelAgentResourceEntry = z.infer<typeof AgentResourceEntrySchema>
376
+ ```
377
+
378
+ ### `OrganizationModelIntegrationResourceEntry`
379
+
380
+ ```typescript
381
+ export type OrganizationModelIntegrationResourceEntry = z.infer<typeof IntegrationResourceEntrySchema>
382
+ ```
383
+
384
+ ### `OrganizationModelScriptResourceEntry`
385
+
386
+ ```typescript
387
+ export type OrganizationModelScriptResourceEntry = z.infer<typeof ScriptResourceEntrySchema>
388
+ ```
389
+
390
+ ### `OrganizationModelActions`
391
+
392
+ ```typescript
393
+ export type OrganizationModelActions = z.infer<typeof ActionsDomainSchema>
394
+ ```
395
+
396
+ ### `OrganizationModelAction`
397
+
398
+ ```typescript
399
+ export type OrganizationModelAction = z.infer<typeof ActionSchema>
400
+ ```
401
+
402
+ ### `OrganizationModelActionId`
403
+
404
+ ```typescript
405
+ export type OrganizationModelActionId = z.infer<typeof ActionIdSchema>
406
+ ```
407
+
408
+ ### `OrganizationModelActionScope`
409
+
410
+ ```typescript
411
+ export type OrganizationModelActionScope = z.infer<typeof ActionScopeSchema>
412
+ ```
413
+
414
+ ### `OrganizationModelActionRef`
415
+
416
+ ```typescript
417
+ export type OrganizationModelActionRef = z.infer<typeof ActionRefSchema>
418
+ ```
419
+
420
+ ### `OrganizationModelActionInvocationKind`
421
+
422
+ ```typescript
423
+ export type OrganizationModelActionInvocationKind = z.infer<typeof ActionInvocationKindSchema>
424
+ ```
425
+
426
+ ### `OrganizationModelActionInvocation`
427
+
428
+ ```typescript
429
+ export type OrganizationModelActionInvocation = z.infer<typeof ActionInvocationSchema>
430
+ ```
431
+
432
+ ### `EntityId`
433
+
434
+ ```typescript
435
+ export type EntityId = z.infer<typeof EntityIdSchema>
436
+ ```
437
+
438
+ ### `EntityLink`
439
+
440
+ ```typescript
441
+ export type EntityLink = z.infer<typeof EntityLinkSchema>
442
+ ```
443
+
444
+ ### `Entity`
445
+
446
+ ```typescript
447
+ export type Entity = z.infer<typeof EntitySchema>
448
+ ```
449
+
450
+ ### `OrganizationModelEntity`
451
+
452
+ ```typescript
453
+ export type OrganizationModelEntity = z.infer<typeof EntitySchema>
454
+ ```
455
+
456
+ ### `OrganizationModelEntities`
457
+
458
+ ```typescript
459
+ export type OrganizationModelEntities = z.infer<typeof EntitiesDomainSchema>
460
+ ```
461
+
462
+ ### `OrganizationModelPolicies`
463
+
464
+ ```typescript
465
+ export type OrganizationModelPolicies = z.infer<typeof PoliciesDomainSchema>
466
+ ```
467
+
468
+ ### `OrganizationModelPolicy`
469
+
470
+ ```typescript
471
+ export type OrganizationModelPolicy = z.infer<typeof PolicySchema>
472
+ ```
473
+
474
+ ### `OrganizationModelPolicyId`
475
+
476
+ ```typescript
477
+ export type OrganizationModelPolicyId = z.infer<typeof PolicyIdSchema>
478
+ ```
479
+
480
+ ### `OrganizationModelPolicyApplicability`
481
+
482
+ ```typescript
483
+ export type OrganizationModelPolicyApplicability = z.infer<typeof PolicyApplicabilitySchema>
484
+ ```
485
+
486
+ ### `OrganizationModelPolicyTrigger`
487
+
488
+ ```typescript
489
+ export type OrganizationModelPolicyTrigger = z.infer<typeof PolicyTriggerSchema>
490
+ ```
491
+
492
+ ### `OrganizationModelPolicyPredicate`
493
+
494
+ ```typescript
495
+ export type OrganizationModelPolicyPredicate = z.infer<typeof PolicyPredicateSchema>
496
+ ```
497
+
498
+ ### `OrganizationModelPolicyEffect`
499
+
500
+ ```typescript
501
+ export type OrganizationModelPolicyEffect = z.infer<typeof PolicyEffectSchema>
502
+ ```
503
+
180
504
  ### `OrganizationModelKnowledge`
181
505
 
182
506
  ```typescript
@@ -189,22 +513,34 @@ export type OrganizationModelKnowledge = z.infer<typeof KnowledgeDomainSchema>
189
513
  export type OrgKnowledgeNode = z.infer<typeof OrgKnowledgeNodeSchema>
190
514
  ```
191
515
 
516
+ ### `OrgKnowledgeNodeInput`
517
+
518
+ ```typescript
519
+ export type OrgKnowledgeNodeInput = z.input<typeof OrgKnowledgeNodeSchema>
520
+ ```
521
+
192
522
  ### `OrgKnowledgeKind`
193
523
 
194
524
  ```typescript
195
525
  export type OrgKnowledgeKind = z.infer<typeof OrgKnowledgeKindSchema>
196
526
  ```
197
527
 
198
- ### `KnowledgeSkillBinding`
528
+ ### `KnowledgeTargetKind`
199
529
 
200
530
  ```typescript
201
- export type KnowledgeSkillBinding = z.infer<typeof KnowledgeSkillBindingSchema>
531
+ export type KnowledgeTargetKind = z.infer<typeof KnowledgeTargetKindSchema>
202
532
  ```
203
533
 
204
- ### `KnowledgeDomainBinding`
534
+ ### `KnowledgeTargetRef`
205
535
 
206
536
  ```typescript
207
- export type KnowledgeDomainBinding = z.infer<typeof KnowledgeDomainBindingSchema>
537
+ export type KnowledgeTargetRef = z.infer<typeof KnowledgeTargetRefSchema>
538
+ ```
539
+
540
+ ### `KnowledgeLink`
541
+
542
+ ```typescript
543
+ export type KnowledgeLink = z.infer<typeof KnowledgeLinkSchema>
208
544
  ```
209
545
 
210
546
  ### `OrganizationModelIconToken`
@@ -236,76 +572,80 @@ export type ElevasisOrganizationModel = Omit<OrganizationModel, 'knowledge'> & {
236
572
  }
237
573
  ```
238
574
 
239
- ### `FeatureSidebarComponent`
575
+ ### `SystemSidebarComponent`
240
576
 
241
577
  ```typescript
242
- export type FeatureSidebarComponent = ComponentType
578
+ export type SystemSidebarComponent = ComponentType
243
579
  ```
244
580
 
245
- ### `FeatureIconComponent`
581
+ ### `SystemIconComponent`
246
582
 
247
583
  ```typescript
248
- export type FeatureIconComponent = ComponentType<{ size?: number; stroke?: number }>
584
+ export type SystemIconComponent = ComponentType<{ size?: number; stroke?: number }>
249
585
  ```
250
586
 
251
- ### `FeatureSidebarWidthResolver`
587
+ ### `SystemSidebarWidthResolver`
252
588
 
253
589
  ```typescript
254
- export type FeatureSidebarWidthResolver = number | ((context: { currentPath: string }) => number)
590
+ export type SystemSidebarWidthResolver = number | ((context: { currentPath: string }) => number)
255
591
  ```
256
592
 
257
- ### `FeatureModule`
593
+ ### `SystemModule`
258
594
 
259
595
  ```typescript
260
- export interface FeatureModule {
261
- /** Unique stable identifier for this feature module. */
596
+ export interface SystemModule {
597
+ /** Unique stable identifier for this UI system module. */
262
598
  key: string
263
- /** Organization Model feature id this module presents. */
264
- featureId: string
265
- /** Capability identifiers contributed by this feature module. */
599
+ /** Organization Model system id this module presents. Omit for navigation-only app surfaces. */
600
+ systemId?: string
601
+ /** Route prefixes owned by navigation-only app surfaces. */
602
+ routePrefixes?: string[]
603
+ /** Capability identifiers contributed by this system module. */
266
604
  capabilityIds?: string[]
267
- /** Icon used when this feature node appears in shell navigation. */
268
- icon?: FeatureIconComponent
269
- /** Sidebar component rendered when this feature's subtree route is active. */
270
- sidebar?: FeatureSidebarComponent
605
+ /** Icon used when this system node appears in shell navigation. */
606
+ icon?: SystemIconComponent
607
+ /** Sidebar component rendered when this system's subtree route is active. */
608
+ sidebar?: SystemSidebarComponent
271
609
  /** Optional shell sidebar width override. Defaults to 250px. */
272
- sidebarWidth?: FeatureSidebarWidthResolver
273
- /** Operations-only bridge connecting this feature to the organization graph node. */
274
- organizationGraph?: OrganizationGraphFeatureBridge
610
+ sidebarWidth?: SystemSidebarWidthResolver
611
+ /** Operations-only bridge connecting this system to the organization graph node. */
612
+ organizationGraph?: OrganizationGraphSystemBridge
275
613
  }
276
614
  ```
277
615
 
278
- ### `ResolvedFeatureAccess`
616
+ ### `ResolvedSystemAccess`
279
617
 
280
618
  ```typescript
281
- export interface ResolvedFeatureAccess {
282
- featureId: string
619
+ export interface ResolvedSystemAccess {
620
+ featureKey: string
621
+ systemId?: string
283
622
  enabled: boolean
284
623
  }
285
624
  ```
286
625
 
287
- ### `ResolvedFeatureSemantics`
626
+ ### `ResolvedSystemSemantics`
288
627
 
289
628
  ```typescript
290
- export interface ResolvedFeatureSemantics {
629
+ export interface ResolvedSystemSemantics {
291
630
  capabilityIds: string[]
292
631
  }
293
632
  ```
294
633
 
295
- ### `ResolvedFeatureModule`
634
+ ### `ResolvedSystemModule`
296
635
 
297
636
  ```typescript
298
- export interface ResolvedFeatureModule extends FeatureModule {
299
- access: ResolvedFeatureAccess
300
- semantics: ResolvedFeatureSemantics
637
+ export interface ResolvedSystemModule extends SystemModule {
638
+ access: ResolvedSystemAccess
639
+ semantics: ResolvedSystemSemantics
301
640
  }
302
641
  ```
303
642
 
304
- ### `ResolvedShellFeature`
643
+ ### `ResolvedShellSystem`
305
644
 
306
645
  ```typescript
307
- export interface ResolvedShellFeature extends OrganizationModelFeature {
308
- iconComponent?: FeatureIconComponent
646
+ export type ResolvedShellSystem = OrganizationModelSystemEntry & {
647
+ label: string
648
+ iconComponent?: SystemIconComponent
309
649
  }
310
650
  ```
311
651
 
@@ -313,19 +653,50 @@ export interface ResolvedShellFeature extends OrganizationModelFeature {
313
653
 
314
654
  ```typescript
315
655
  export interface ResolvedShellModel {
316
- features: readonly ResolvedShellFeature[]
317
- findByPath: (path: string) => ResolvedShellFeature | undefined
318
- findById: (id: string) => ResolvedShellFeature | undefined
319
- childrenOf: (id: string) => ResolvedShellFeature[]
320
- ancestorsOf: (id: string) => ResolvedShellFeature[]
321
- parentOf: (id: string) => ResolvedShellFeature | undefined
322
- topLevel: () => ResolvedShellFeature[]
323
- uiPositionFor: (id: string) => OrganizationModelFeature['uiPosition'] | undefined
656
+ systems: readonly ResolvedShellSystem[]
657
+ findByPath: (path: string) => ResolvedShellSystem | undefined
658
+ findById: (id: string) => ResolvedShellSystem | undefined
659
+ childrenOf: (id: string) => ResolvedShellSystem[]
660
+ ancestorsOf: (id: string) => ResolvedShellSystem[]
661
+ parentOf: (id: string) => ResolvedShellSystem | undefined
662
+ topLevel: () => ResolvedShellSystem[]
324
663
  requiresAdminFor: (id: string) => boolean
325
664
  devOnlyFor: (id: string) => boolean
326
665
  }
327
666
  ```
328
667
 
668
+ ### `ShellSidebarLinkItem`
669
+
670
+ ```typescript
671
+ export interface ShellSidebarLinkItem {
672
+ label: string
673
+ link: string
674
+ exact?: boolean
675
+ activeMatchPaths?: string[]
676
+ }
677
+ ```
678
+
679
+ ### `ShellSidebarLinkGroup`
680
+
681
+ ```typescript
682
+ export interface ShellSidebarLinkGroup {
683
+ icon: SystemIconComponent
684
+ label: string
685
+ links?: ShellSidebarLinkItem[]
686
+ link?: string
687
+ }
688
+ ```
689
+
690
+ ### `ShellSidebarProjectionOptions`
691
+
692
+ ```typescript
693
+ export interface ShellSidebarProjectionOptions {
694
+ isPlatformAdmin?: boolean
695
+ isDev?: boolean
696
+ section?: 'primary' | 'bottom'
697
+ }
698
+ ```
699
+
329
700
  ### `ShellRouteMatchStatus`
330
701
 
331
702
  ```typescript
@@ -338,8 +709,8 @@ export type ShellRouteMatchStatus = 'matched' | 'hidden' | 'unmatched'
338
709
  export interface ResolvedShellRouteMatch {
339
710
  status: ShellRouteMatchStatus
340
711
  path: string
341
- feature?: ResolvedFeatureModule
342
- node?: ResolvedShellFeature
712
+ system?: ResolvedSystemModule
713
+ node?: ResolvedShellSystem
343
714
  }
344
715
  ```
345
716
 
@@ -351,11 +722,11 @@ export interface ShellRuntime {
351
722
  }
352
723
  ```
353
724
 
354
- ### `OrganizationGraphFeatureBridge`
725
+ ### `OrganizationGraphSystemBridge`
355
726
 
356
727
  ```typescript
357
- export interface OrganizationGraphFeatureBridge {
358
- featureId: string
728
+ export interface OrganizationGraphSystemBridge {
729
+ systemId?: string
359
730
  }
360
731
  ```
361
732
 
@@ -364,16 +735,16 @@ export interface OrganizationGraphFeatureBridge {
364
735
  ```typescript
365
736
  export interface OrganizationGraphContextValue {
366
737
  available: boolean
367
- featureId?: string
368
- featurePath?: string
738
+ systemId?: string
739
+ systemPath?: string
369
740
  }
370
741
  ```
371
742
 
372
- ### `ElevasisFeaturesProviderProps`
743
+ ### `ElevasisSystemsProviderProps`
373
744
 
374
745
  ```typescript
375
- export interface ElevasisFeaturesProviderProps {
376
- features: FeatureModule[]
746
+ export interface ElevasisSystemsProviderProps {
747
+ systems?: SystemModule[]
377
748
  organizationModel?: ElevasisOrganizationModel
378
749
  timeRange?: TimeRange
379
750
  operationsApiUrl?: string
@@ -385,14 +756,15 @@ export interface ElevasisFeaturesProviderProps {
385
756
  }
386
757
  ```
387
758
 
388
- ### `ElevasisFeaturesContextValue`
759
+ ### `ElevasisSystemsContextValue`
389
760
 
390
761
  ```typescript
391
- export interface ElevasisFeaturesContextValue {
762
+ export interface ElevasisSystemsContextValue {
392
763
  shellModel: ResolvedShellModel
393
764
  shellRuntime: ShellRuntime
394
- enabledResolvedFeatures: ResolvedFeatureModule[]
395
- resolvedFeatures: ResolvedFeatureModule[]
765
+ getSidebarLinks: (options?: ShellSidebarProjectionOptions) => ShellSidebarLinkGroup[]
766
+ enabledResolvedSystems: ResolvedSystemModule[]
767
+ resolvedSystems: ResolvedSystemModule[]
396
768
  organizationGraph: OrganizationGraphContextValue
397
769
  organizationModel?: OrganizationModel
398
770
  timeRange?: TimeRange
@@ -401,8 +773,8 @@ export interface ElevasisFeaturesContextValue {
401
773
  deliveryApiUrl?: string
402
774
  deliverySSEManager?: SSEConnectionManagerLike
403
775
  disabledSubsectionPaths: string[]
404
- isFeatureEnabled: (key: string) => boolean
405
- getResolvedFeature: (key: string) => ResolvedFeatureModule | undefined
776
+ isSystemEnabled: (key: string) => boolean
777
+ getResolvedSystem: (key: string) => ResolvedSystemModule | undefined
406
778
  }
407
779
  ```
408
780
 
@@ -411,413 +783,464 @@ export interface ElevasisFeaturesContextValue {
411
783
  ### `ResourceStatus`
412
784
 
413
785
  ```typescript
414
- /**
415
- * Environment/deployment status for resources
416
- */
786
+ /**
787
+ * Environment/deployment status for resources
788
+ */
417
789
  export type ResourceStatus = 'dev' | 'prod'
418
790
  ```
419
791
 
420
792
  ### `ResourceType`
421
793
 
422
794
  ```typescript
423
- /**
424
- * All resource types in the platform
425
- * Used as the discriminator field in ResourceDefinition
426
- */
795
+ /**
796
+ * All resource types in the platform
797
+ * Used as the discriminator field in ResourceDefinition
798
+ */
427
799
  export type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human'
428
800
  ```
429
801
 
430
802
  ### `ExecutableResourceType`
431
803
 
432
804
  ```typescript
433
- /**
434
- * Executable resource types (subset of ResourceType)
435
- * These resources can be directly executed by the execution engine
436
- */
805
+ /**
806
+ * Executable resource types (subset of ResourceType)
807
+ * These resources can be directly executed by the execution engine
808
+ */
437
809
  export type ExecutableResourceType = 'workflow' | 'agent'
438
810
  ```
439
811
 
812
+ ### `ResourceSystemSummary`
813
+
814
+ ```typescript
815
+ export type ResourceSystemSummary = Pick<SystemEntry, 'id' | 'title' | 'description' | 'kind' | 'status'>
816
+ ```
817
+
440
818
  ### `ResourceDefinition`
441
819
 
442
820
  ```typescript
443
- /**
444
- * Base interface for ALL platform resources
445
- * Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
446
- */
447
- export interface ResourceDefinition {
448
- /** Unique resource identifier */
449
- resourceId: string
450
-
451
- /** Display name */
452
- name: string
453
-
454
- /** Purpose and functionality description */
455
- description: string
456
-
457
- /** Version for change tracking and evolution */
458
- version: string
459
-
460
- /** Resource type discriminator */
461
- type: ResourceType
462
-
463
- /** Environment/deployment status */
464
- status: ResourceStatus
465
-
821
+ /**
822
+ * Base interface for ALL platform resources
823
+ * Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
824
+ */
825
+ export interface ResourceDefinition {
826
+ /** Unique resource identifier */
827
+ resourceId: string
828
+
829
+ /** Display name */
830
+ name: string
831
+
832
+ /** Purpose and functionality description */
833
+ description: string
834
+
835
+ /** Version for change tracking and evolution */
836
+ version: string
837
+
838
+ /** Resource type discriminator */
839
+ type: ResourceType
840
+
841
+ /** Environment/deployment status */
842
+ status: ResourceStatus
843
+
466
844
  /** Graph links to Organization Model nodes */
467
845
  links?: ResourceLink[]
468
846
 
469
847
  /** Infrastructure category for filtering */
470
848
  category?: ResourceCategory
471
-
472
- /** Whether the agent supports multi-turn sessions (agents only) */
473
- sessionCapable?: boolean
474
-
475
- /** Whether the resource is local (monorepo) or remote (externally deployed) */
476
- origin?: 'local' | 'remote'
477
-
478
- /** Whether this resource is archived and should be excluded from registration and deployment */
479
- archived?: boolean
849
+
850
+ /** Whether the agent supports multi-turn sessions (agents only) */
851
+ sessionCapable?: boolean
852
+
853
+ /** Whether the resource is local (monorepo) or remote (externally deployed) */
854
+ origin?: 'local' | 'remote'
855
+
856
+ /** OM System membership dot-separated system path (e.g. "sys.lead-gen"), when backed by a Resource descriptor */
857
+ systemPath?: string
858
+
859
+ /** Display metadata for the owning OM System */
860
+ system?: ResourceSystemSummary
861
+
862
+ /** Governance lifecycle status from the OM Resource descriptor */
863
+ governanceStatus?: ResourceGovernanceStatus
864
+
865
+ /** Whether this resource is archived and should be excluded from registration and deployment */
866
+ archived?: boolean
867
+ }
868
+ ```
869
+
870
+ ### `RuntimeResourceDescriptor`
871
+
872
+ ```typescript
873
+ export type RuntimeResourceDescriptor = Extract<ResourceEntry, { kind: 'workflow' | 'agent' | 'integration' }>
874
+ ```
875
+
876
+ ### `DescriptorBackedResourceDefinition`
877
+
878
+ ```typescript
879
+ export type DescriptorBackedResourceDefinition<
880
+ TResource extends RuntimeResourceDescriptor = RuntimeResourceDescriptor
881
+ > = Omit<ResourceDefinition, 'resourceId' | 'type'> & {
882
+ /** OM descriptor that owns canonical identity and governance metadata. */
883
+ resource: TResource
884
+ resourceId?: never
885
+ type?: never
480
886
  }
481
887
  ```
482
888
 
889
+ ### `BoundResourceDefinition`
890
+
891
+ ```typescript
892
+ export type BoundResourceDefinition<TResource extends RuntimeResourceDescriptor = RuntimeResourceDescriptor> = Omit<
893
+ DescriptorBackedResourceDefinition<TResource>,
894
+ 'resource'
895
+ > &
896
+ ResourceDefinition & {
897
+ resource: TResource
898
+ resourceId: TResource['id']
899
+ type: TResource['kind']
900
+ }
901
+ ```
902
+
483
903
  ### `ResourceList`
484
904
 
485
905
  ```typescript
486
906
  /**
487
907
  * Resource list for organization
488
908
  * Returns ResourceDefinition metadata (not full definitions)
489
- */
490
- export interface ResourceList {
491
- workflows: ResourceDefinition[]
492
- agents: ResourceDefinition[]
493
- total: number
494
- organizationName: string
495
- environment?: 'dev' | 'prod'
909
+ */
910
+ export interface ResourceList {
911
+ workflows: ResourceDefinition[]
912
+ agents: ResourceDefinition[]
913
+ total: number
914
+ organizationName: string
915
+ environment?: 'dev' | 'prod'
496
916
  }
497
917
  ```
498
918
 
499
919
  ### `WebhookProviderType`
500
920
 
501
921
  ```typescript
502
- /** Webhook provider identifiers */
922
+ /** Webhook provider identifiers */
503
923
  export type WebhookProviderType = 'cal-com' | 'stripe' | 'signature-api' | 'instantly' | 'apify' | 'test'
504
924
  ```
505
925
 
506
926
  ### `WebhookTriggerConfig`
507
927
 
508
928
  ```typescript
509
- /** Webhook trigger configuration */
510
- export interface WebhookTriggerConfig {
511
- /** Provider identifier */
512
- provider: WebhookProviderType
513
- /** Event type for documentation (not used for matching - workflow handles routing) */
514
- event?: string
515
- /** Optional filtering (e.g., specific form ID for Fillout) */
516
- filter?: Record<string, string>
517
- /** References credential in credentials table for per-org webhook secrets */
518
- credentialName?: string
929
+ /** Webhook trigger configuration */
930
+ export interface WebhookTriggerConfig {
931
+ /** Provider identifier */
932
+ provider: WebhookProviderType
933
+ /** Event type for documentation (not used for matching - workflow handles routing) */
934
+ event?: string
935
+ /** Optional filtering (e.g., specific form ID for Fillout) */
936
+ filter?: Record<string, string>
937
+ /** References credential in credentials table for per-org webhook secrets */
938
+ credentialName?: string
519
939
  }
520
940
  ```
521
941
 
522
942
  ### `ScheduleTriggerConfig`
523
943
 
524
944
  ```typescript
525
- /** Schedule trigger configuration */
526
- export interface ScheduleTriggerConfig {
527
- /** Cron expression (e.g., '0 6 * * *') */
528
- cron: string
529
- /** Optional timezone (default: UTC) */
530
- timezone?: string
945
+ /** Schedule trigger configuration */
946
+ export interface ScheduleTriggerConfig {
947
+ /** Cron expression (e.g., '0 6 * * *') */
948
+ cron: string
949
+ /** Optional timezone (default: UTC) */
950
+ timezone?: string
531
951
  }
532
952
  ```
533
953
 
534
954
  ### `EventTriggerConfig`
535
955
 
536
956
  ```typescript
537
- /** Event trigger configuration */
538
- export interface EventTriggerConfig {
539
- /** Internal event type */
540
- eventType: string
541
- /** Event source */
542
- source?: string
957
+ /** Event trigger configuration */
958
+ export interface EventTriggerConfig {
959
+ /** Internal event type */
960
+ eventType: string
961
+ /** Event source */
962
+ source?: string
543
963
  }
544
964
  ```
545
965
 
546
966
  ### `TriggerConfig`
547
967
 
548
968
  ```typescript
549
- /** Union of all trigger configs */
969
+ /** Union of all trigger configs */
550
970
  export type TriggerConfig = WebhookTriggerConfig | ScheduleTriggerConfig | EventTriggerConfig
551
971
  ```
552
972
 
553
973
  ### `TriggerDefinition`
554
974
 
555
975
  ```typescript
556
- /**
557
- * Trigger metadata - entry points that initiate resource execution
558
- *
559
- * Triggers represent how executions start: webhooks from external services,
560
- * scheduled cron jobs, platform events, or manual user actions.
561
- *
562
- * BREAKING CHANGES (2025-11-30):
976
+ /**
977
+ * Trigger metadata - entry points that initiate resource execution
978
+ *
979
+ * Triggers represent how executions start: webhooks from external services,
980
+ * scheduled cron jobs, platform events, or manual user actions.
981
+ *
982
+ * BREAKING CHANGES (2025-11-30):
563
983
  * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
564
- * - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
565
- * - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
566
- * - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
567
- * - triggers object now includes `externalResources` option
568
- *
569
- * @example
570
- * // TriggerDefinition - metadata only
571
- * {
572
- * resourceId: 'trigger-new-order',
573
- * type: 'trigger',
574
- * triggerType: 'webhook',
575
- * name: 'New Order',
576
- * description: 'Webhook from Shopify on new orders',
577
- * version: '1.0.0',
578
- * status: 'prod',
579
- * webhookPath: '/webhooks/shopify/orders'
580
- * }
581
- *
582
- * // Relationships declared in ResourceRelationships (not on TriggerDefinition):
583
- * // relationships: {
584
- * // 'trigger-new-order': { triggers: { workflows: ['order-fulfillment-workflow'] } }
585
- * // }
586
- */
587
- export interface TriggerDefinition extends ResourceDefinition {
588
- /** Resource type discriminator (narrowed from base union) */
589
- type: 'trigger'
590
-
591
- /** Trigger mechanism type (renamed from 'type' to avoid collision with base type discriminator) */
592
- triggerType: 'webhook' | 'schedule' | 'manual' | 'event'
593
-
594
- /** Type-specific configuration */
595
- config?: TriggerConfig
596
-
597
- // Legacy fields (deprecated, use config instead)
598
- /** For webhook triggers: path like '/webhooks/shopify/orders' */
599
- webhookPath?: string
600
- /** For schedule triggers: cron expression like '0 6 * * *' */
601
- schedule?: string
602
- /** For event triggers: event type like 'low-stock-alert' */
603
- eventType?: string
604
-
605
- // NOTE: What this trigger starts is declared in ResourceRelationships, not here
606
- // This prevents duplication - triggers are forward-declared in relationships
984
+ * - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
985
+ * - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
986
+ * - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
987
+ * - triggers object now includes `externalResources` option
988
+ *
989
+ * @example
990
+ * // TriggerDefinition - metadata only
991
+ * {
992
+ * resourceId: 'trigger-new-order',
993
+ * type: 'trigger',
994
+ * triggerType: 'webhook',
995
+ * name: 'New Order',
996
+ * description: 'Webhook from Shopify on new orders',
997
+ * version: '1.0.0',
998
+ * status: 'prod',
999
+ * webhookPath: '/webhooks/shopify/orders'
1000
+ * }
1001
+ *
1002
+ * // Relationships declared in ResourceRelationships (not on TriggerDefinition):
1003
+ * // relationships: {
1004
+ * // 'trigger-new-order': { triggers: { workflows: ['order-fulfillment-workflow'] } }
1005
+ * // }
1006
+ */
1007
+ export interface TriggerDefinition extends ResourceDefinition {
1008
+ /** Resource type discriminator (narrowed from base union) */
1009
+ type: 'trigger'
1010
+
1011
+ /** Trigger mechanism type (renamed from 'type' to avoid collision with base type discriminator) */
1012
+ triggerType: 'webhook' | 'schedule' | 'manual' | 'event'
1013
+
1014
+ /** Type-specific configuration */
1015
+ config?: TriggerConfig
1016
+
1017
+ // Legacy fields (deprecated, use config instead)
1018
+ /** For webhook triggers: path like '/webhooks/shopify/orders' */
1019
+ webhookPath?: string
1020
+ /** For schedule triggers: cron expression like '0 6 * * *' */
1021
+ schedule?: string
1022
+ /** For event triggers: event type like 'low-stock-alert' */
1023
+ eventType?: string
1024
+
1025
+ // NOTE: What this trigger starts is declared in ResourceRelationships, not here
1026
+ // This prevents duplication - triggers are forward-declared in relationships
607
1027
  }
608
1028
  ```
609
1029
 
610
1030
  ### `IntegrationDefinition`
611
1031
 
612
1032
  ```typescript
613
- /**
614
- * Integration metadata - external service connections
615
- *
616
- * References credentials table for actual connection. No connection status
617
- * stored here (queried at runtime from credentials table).
618
- *
619
- * BREAKING CHANGES (2025-11-30):
1033
+ /**
1034
+ * Integration metadata - external service connections
1035
+ *
1036
+ * References credentials table for actual connection. No connection status
1037
+ * stored here (queried at runtime from credentials table).
1038
+ *
1039
+ * BREAKING CHANGES (2025-11-30):
620
1040
  * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
621
- * - Field renames: `id` -> `resourceId` (inherited)
622
- * - New required field: `status` (inherited) - organizations must add status to all integrations
623
- * - New required field: `version` (inherited) - organizations must add version to all integrations
624
- * - New required field: `type: 'integration'` (inherited) - resource type discriminator
625
- *
626
- * @example
627
- * {
628
- * resourceId: 'integration-shopify-prod',
629
- * type: 'integration',
630
- * provider: 'shopify',
631
- * credentialName: 'shopify-prod',
632
- * name: 'Shopify Production',
633
- * description: 'E-commerce platform',
634
- * version: '1.0.0',
635
- * status: 'prod'
636
- * }
637
- */
638
- export interface IntegrationDefinition extends ResourceDefinition {
639
- /** Resource type discriminator (narrowed from base union) */
640
- type: 'integration'
641
-
642
- /** Integration provider type */
643
- provider: IntegrationType
644
- /** References credentials table (e.g., 'shopify-prod', 'zendesk-api') */
645
- credentialName: string
1041
+ * - Field renames: `id` -> `resourceId` (inherited)
1042
+ * - New required field: `status` (inherited) - organizations must add status to all integrations
1043
+ * - New required field: `version` (inherited) - organizations must add version to all integrations
1044
+ * - New required field: `type: 'integration'` (inherited) - resource type discriminator
1045
+ *
1046
+ * @example
1047
+ * {
1048
+ * resourceId: 'integration-shopify-prod',
1049
+ * type: 'integration',
1050
+ * provider: 'shopify',
1051
+ * credentialName: 'shopify-prod',
1052
+ * name: 'Shopify Production',
1053
+ * description: 'E-commerce platform',
1054
+ * version: '1.0.0',
1055
+ * status: 'prod'
1056
+ * }
1057
+ */
1058
+ export interface IntegrationDefinition extends ResourceDefinition {
1059
+ /** Resource type discriminator (narrowed from base union) */
1060
+ type: 'integration'
1061
+
1062
+ /** OM descriptor that owns canonical identity and governance metadata. */
1063
+ resource?: Extract<ResourceEntry, { kind: 'integration' }>
1064
+
1065
+ /** Integration provider type */
1066
+ provider: IntegrationType
1067
+ /** References credentials table (e.g., 'shopify-prod', 'zendesk-api') */
1068
+ credentialName: string
646
1069
  }
647
1070
  ```
648
1071
 
649
1072
  ### `RelationshipDeclaration`
650
1073
 
651
1074
  ```typescript
652
- /**
653
- * Explicit resource relationship declaration
654
- *
655
- * Single-direction only - Command View derives reverse relationships.
656
- * Agents/workflows declare what they trigger and use.
657
- *
658
- * @example
659
- * {
660
- * triggers: { workflows: ['order-fulfillment-workflow'] },
661
- * uses: { integrations: ['integration-shopify-prod', 'integration-postgres'] }
662
- * }
663
- */
664
- export interface RelationshipDeclaration {
665
- /** Resources this resource triggers */
666
- triggers?: {
667
- /** Agent resourceIds this resource triggers */
668
- agents?: string[]
669
- /** Workflow resourceIds this resource triggers */
670
- workflows?: string[]
671
- }
672
- /** Integrations this resource uses */
673
- uses?: {
674
- /** Integration IDs this resource uses */
675
- integrations?: string[]
676
- }
1075
+ /**
1076
+ * Explicit resource relationship declaration
1077
+ *
1078
+ * Single-direction only - Command View derives reverse relationships.
1079
+ * Agents/workflows declare what they trigger and use.
1080
+ *
1081
+ * @example
1082
+ * {
1083
+ * triggers: { workflows: ['order-fulfillment-workflow'] },
1084
+ * uses: { integrations: ['integration-shopify-prod', 'integration-postgres'] }
1085
+ * }
1086
+ */
1087
+ export interface RelationshipDeclaration {
1088
+ /** Resources this resource triggers */
1089
+ triggers?: {
1090
+ /** Agent resourceIds this resource triggers */
1091
+ agents?: string[]
1092
+ /** Workflow resourceIds this resource triggers */
1093
+ workflows?: string[]
1094
+ }
1095
+ /** Integrations this resource uses */
1096
+ uses?: {
1097
+ /** Integration IDs this resource uses */
1098
+ integrations?: string[]
1099
+ }
677
1100
  }
678
1101
  ```
679
1102
 
680
1103
  ### `ResourceRelationships`
681
1104
 
682
1105
  ```typescript
683
- /**
684
- * Resource relationships map
685
- * Maps resourceId to its relationship declarations
686
- *
687
- * @example
688
- * {
689
- * 'order-processor-agent': {
690
- * triggers: { workflows: ['order-fulfillment-workflow'] },
691
- * uses: { integrations: ['integration-shopify-prod'] }
692
- * }
693
- * }
694
- */
1106
+ /**
1107
+ * Resource relationships map
1108
+ * Maps resourceId to its relationship declarations
1109
+ *
1110
+ * @example
1111
+ * {
1112
+ * 'order-processor-agent': {
1113
+ * triggers: { workflows: ['order-fulfillment-workflow'] },
1114
+ * uses: { integrations: ['integration-shopify-prod'] }
1115
+ * }
1116
+ * }
1117
+ */
695
1118
  export type ResourceRelationships = Record<string, RelationshipDeclaration>
696
1119
  ```
697
1120
 
698
1121
  ### `ExternalPlatform`
699
1122
 
700
1123
  ```typescript
701
- /**
702
- * External platform type
703
- * Supported third-party automation platforms
704
- */
1124
+ /**
1125
+ * External platform type
1126
+ * Supported third-party automation platforms
1127
+ */
705
1128
  export type ExternalPlatform = 'n8n' | 'make' | 'zapier' | 'other'
706
1129
  ```
707
1130
 
708
1131
  ### `ExternalResourceDefinition`
709
1132
 
710
1133
  ```typescript
711
- /**
712
- * External automation resource metadata
713
- *
714
- * Represents workflows/automations running on third-party platforms
715
- * (n8n, Make, Zapier, etc.) for visualization in Command View.
716
- *
717
- * NOTE: This is metadata ONLY for visualization. No execution logic,
718
- * no API integration with external platforms, no status syncing.
719
- *
720
- * BREAKING CHANGES (2025-11-30):
1134
+ /**
1135
+ * External automation resource metadata
1136
+ *
1137
+ * Represents workflows/automations running on third-party platforms
1138
+ * (n8n, Make, Zapier, etc.) for visualization in Command View.
1139
+ *
1140
+ * NOTE: This is metadata ONLY for visualization. No execution logic,
1141
+ * no API integration with external platforms, no status syncing.
1142
+ *
1143
+ * BREAKING CHANGES (2025-11-30):
721
1144
  * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
722
- * - Field renames: `id` -> `resourceId` (inherited)
723
- * - New required field: `version` (inherited) - organizations must add version to all external resources
724
- * - New required field: `type: 'external'` (inherited) - resource type discriminator
725
- * - REMOVED FIELD: `triggeredBy` - per relationship-consolidation design, all relationships are forward-only declarations
726
- *
727
- * @example
728
- * {
729
- * resourceId: 'external-n8n-order-sync',
730
- * type: 'external',
731
- * version: '1.0.0',
732
- * platform: 'n8n',
733
- * name: 'Shopify Order Sync',
734
- * description: 'Legacy n8n workflow for syncing Shopify orders',
735
- * status: 'prod',
736
- * platformUrl: 'https://n8n.client.com/workflow/123',
737
- * triggers: { workflows: ['order-fulfillment-workflow'] },
738
- * uses: { integrations: ['integration-shopify-prod'] }
739
- * }
740
- */
741
- export interface ExternalResourceDefinition extends ResourceDefinition {
742
- /** Resource type discriminator (narrowed from base union) */
743
- type: 'external'
744
-
745
- /** Platform type */
746
- platform: ExternalPlatform
747
-
748
- // Optional platform-specific metadata
749
- /** Link to external platform (e.g., n8n workflow editor URL) */
750
- platformUrl?: string
751
- /** Platform's internal ID/reference */
752
- externalId?: string
753
-
754
- /** What this external resource triggers (external -> internal) */
755
- triggers?: {
756
- /** Elevasis workflow resourceIds this external automation triggers */
757
- workflows?: string[]
758
- /** Elevasis agent resourceIds this external automation triggers */
759
- agents?: string[]
760
- }
761
-
762
- /** Integrations this external resource uses (shared credentials) */
763
- uses?: {
764
- /** Integration IDs this external automation uses */
765
- integrations?: string[]
766
- }
767
-
768
- // NOTE: triggeredBy field removed - per relationship-consolidation design,
769
- // all relationships are forward-only declarations. Graph edges are built
770
- // from forward declarations only.
1145
+ * - Field renames: `id` -> `resourceId` (inherited)
1146
+ * - New required field: `version` (inherited) - organizations must add version to all external resources
1147
+ * - New required field: `type: 'external'` (inherited) - resource type discriminator
1148
+ * - REMOVED FIELD: `triggeredBy` - per relationship-consolidation design, all relationships are forward-only declarations
1149
+ *
1150
+ * @example
1151
+ * {
1152
+ * resourceId: 'external-n8n-order-sync',
1153
+ * type: 'external',
1154
+ * version: '1.0.0',
1155
+ * platform: 'n8n',
1156
+ * name: 'Shopify Order Sync',
1157
+ * description: 'Legacy n8n workflow for syncing Shopify orders',
1158
+ * status: 'prod',
1159
+ * platformUrl: 'https://n8n.client.com/workflow/123',
1160
+ * triggers: { workflows: ['order-fulfillment-workflow'] },
1161
+ * uses: { integrations: ['integration-shopify-prod'] }
1162
+ * }
1163
+ */
1164
+ export interface ExternalResourceDefinition extends ResourceDefinition {
1165
+ /** Resource type discriminator (narrowed from base union) */
1166
+ type: 'external'
1167
+
1168
+ /** Platform type */
1169
+ platform: ExternalPlatform
1170
+
1171
+ // Optional platform-specific metadata
1172
+ /** Link to external platform (e.g., n8n workflow editor URL) */
1173
+ platformUrl?: string
1174
+ /** Platform's internal ID/reference */
1175
+ externalId?: string
1176
+
1177
+ /** What this external resource triggers (external -> internal) */
1178
+ triggers?: {
1179
+ /** Elevasis workflow resourceIds this external automation triggers */
1180
+ workflows?: string[]
1181
+ /** Elevasis agent resourceIds this external automation triggers */
1182
+ agents?: string[]
1183
+ }
1184
+
1185
+ /** Integrations this external resource uses (shared credentials) */
1186
+ uses?: {
1187
+ /** Integration IDs this external automation uses */
1188
+ integrations?: string[]
1189
+ }
1190
+
1191
+ // NOTE: triggeredBy field removed - per relationship-consolidation design,
1192
+ // all relationships are forward-only declarations. Graph edges are built
1193
+ // from forward declarations only.
771
1194
  }
772
1195
  ```
773
1196
 
774
1197
  ### `HumanCheckpointDefinition`
775
1198
 
776
1199
  ```typescript
777
- /**
778
- * Human Checkpoint definition - human decision points in automation
779
- *
780
- * Represents where human judgment is deployed in the automation landscape.
781
- * Tasks with matching command_queue_group are routed to this checkpoint.
782
- *
783
- * BREAKING CHANGES (2025-11-30):
1200
+ /**
1201
+ * Human Checkpoint definition - human decision points in automation
1202
+ *
1203
+ * Represents where human judgment is deployed in the automation landscape.
1204
+ * Tasks with matching command_queue_group are routed to this checkpoint.
1205
+ *
1206
+ * BREAKING CHANGES (2025-11-30):
784
1207
  * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
785
- * - Field renames: `id` -> `resourceId` (inherited)
786
- * - description is now REQUIRED (was optional) - organizations must add description to all human checkpoints
787
- * - New required field: `version` (inherited) - organizations must add version to all human checkpoints
788
- * - New required field: `type: 'human'` (inherited) - resource type discriminator
789
- *
790
- * @example
791
- * {
792
- * resourceId: 'sales-approval',
793
- * type: 'human',
794
- * name: 'Sales Approval Queue',
795
- * description: 'High-value order approvals for sales team',
796
- * version: '1.0.0',
797
- * status: 'prod',
798
- * requestedBy: { agents: ['order-processor-agent'] },
799
- * routesTo: { agents: ['order-fulfillment-agent'] }
800
- * }
801
- */
802
- export interface HumanCheckpointDefinition extends ResourceDefinition {
803
- /** Resource type discriminator (narrowed from base union) */
804
- type: 'human'
805
-
806
- /** Resources that create tasks for this checkpoint */
807
- requestedBy?: {
808
- /** Agent resourceIds that request approval here */
809
- agents?: string[]
810
- /** Workflow resourceIds that request approval here */
811
- workflows?: string[]
812
- }
813
-
814
- /** Resources that receive approved decisions */
815
- routesTo?: {
816
- /** Agent resourceIds that handle approved tasks */
817
- agents?: string[]
818
- /** Workflow resourceIds that handle approved tasks */
819
- workflows?: string[]
820
- }
1208
+ * - Field renames: `id` -> `resourceId` (inherited)
1209
+ * - description is now REQUIRED (was optional) - organizations must add description to all human checkpoints
1210
+ * - New required field: `version` (inherited) - organizations must add version to all human checkpoints
1211
+ * - New required field: `type: 'human'` (inherited) - resource type discriminator
1212
+ *
1213
+ * @example
1214
+ * {
1215
+ * resourceId: 'sales-approval',
1216
+ * type: 'human',
1217
+ * name: 'Sales Approval Queue',
1218
+ * description: 'High-value order approvals for sales team',
1219
+ * version: '1.0.0',
1220
+ * status: 'prod',
1221
+ * requestedBy: { agents: ['order-processor-agent'] },
1222
+ * routesTo: { agents: ['order-fulfillment-agent'] }
1223
+ * }
1224
+ */
1225
+ export interface HumanCheckpointDefinition extends ResourceDefinition {
1226
+ /** Resource type discriminator (narrowed from base union) */
1227
+ type: 'human'
1228
+
1229
+ /** Resources that create tasks for this checkpoint */
1230
+ requestedBy?: {
1231
+ /** Agent resourceIds that request approval here */
1232
+ agents?: string[]
1233
+ /** Workflow resourceIds that request approval here */
1234
+ workflows?: string[]
1235
+ }
1236
+
1237
+ /** Resources that receive approved decisions */
1238
+ routesTo?: {
1239
+ /** Agent resourceIds that handle approved tasks */
1240
+ agents?: string[]
1241
+ /** Workflow resourceIds that handle approved tasks */
1242
+ workflows?: string[]
1243
+ }
821
1244
  }
822
1245
  ```
823
1246
 
@@ -835,6 +1258,11 @@ export interface HumanCheckpointDefinition extends ResourceDefinition {
835
1258
  export interface DeploymentSpec {
836
1259
  /** Deployment version (semver) */
837
1260
  version: string
1261
+ /** Optional Organization Model governance catalog used for OM-code validation */
1262
+ organizationModel?: {
1263
+ systems?: OrganizationModelSystems
1264
+ resources?: OrganizationModelResources
1265
+ }
838
1266
  /** Workflow definitions */
839
1267
  workflows?: WorkflowDefinition[]
840
1268
  /** Agent definitions */
@@ -1155,6 +1583,9 @@ export const DealTaskIdParamsSchema = z.object({
1155
1583
  export const ListDealsQuerySchema = z
1156
1584
  .object({
1157
1585
  stage: DealStageSchema.optional(),
1586
+ list: UuidSchema.optional(),
1587
+ batch: z.string().trim().min(1).max(255).optional(),
1588
+ staleSince: z.string().datetime().optional(),
1158
1589
  search: z.string().optional(),
1159
1590
  limit: z.coerce.number().int().positive().default(50),
1160
1591
  offset: z.coerce.number().int().min(0).default(0)
@@ -1300,6 +1731,7 @@ export const DealListItemSchema = z.object({
1300
1731
  // acq_deals columns
1301
1732
  id: z.string(),
1302
1733
  organization_id: z.string(),
1734
+ client_id: z.string().nullable().optional(),
1303
1735
  contact_id: z.string().nullable(),
1304
1736
  contact_email: z.string(),
1305
1737
  pipeline_key: z.string(),
@@ -1348,7 +1780,8 @@ export const DealListResponseSchema = z.object({
1348
1780
  * Additive fields keep existing DealListItem callers compatible.
1349
1781
  */
1350
1782
  export const DealDetailResponseSchema = DealListItemSchema.extend({
1351
- conversation: DealConversationSchema
1783
+ conversation: DealConversationSchema,
1784
+ lineage: DealLineageSchema.optional()
1352
1785
  })
1353
1786
  ```
1354
1787
 
@@ -1437,6 +1870,10 @@ export const DealSchemas = {
1437
1870
  DealSummaryResponse: DealSummaryResponseSchema,
1438
1871
  DealLookupResponse: DealLookupResponseSchema,
1439
1872
  ConversationMessage: ConversationMessageSchema,
1873
+ DealLineageListRef: DealLineageListRefSchema,
1874
+ DealLineageProjectRef: DealLineageProjectRefSchema,
1875
+ DealLineageClientRef: DealLineageClientRefSchema,
1876
+ DealLineage: DealLineageSchema,
1440
1877
  DealDetailResponse: DealDetailResponseSchema,
1441
1878
  DealNoteResponse: DealNoteResponseSchema,
1442
1879
  DealNoteListResponse: DealNoteListResponseSchema,
@@ -2093,6 +2530,7 @@ export const ListContactsQuerySchema = z
2093
2530
  export const CreateCompanyRequestSchema = z
2094
2531
  .object({
2095
2532
  name: z.string().trim().min(1).max(255),
2533
+ clientId: UuidSchema.nullable().optional(),
2096
2534
  domain: z.string().trim().min(1).max(255).optional(),
2097
2535
  linkedinUrl: z.string().trim().url().optional(),
2098
2536
  website: z.string().trim().url().optional(),
@@ -2115,6 +2553,7 @@ export const CreateCompanyRequestSchema = z
2115
2553
  export const UpdateCompanyRequestSchema = z
2116
2554
  .object({
2117
2555
  name: z.string().trim().min(1).max(255).optional(),
2556
+ clientId: UuidSchema.nullable().optional(),
2118
2557
  domain: z.string().trim().min(1).max(255).optional(),
2119
2558
  linkedinUrl: z.string().trim().url().optional(),
2120
2559
  website: z.string().trim().url().optional(),
@@ -2136,6 +2575,7 @@ export const UpdateCompanyRequestSchema = z
2136
2575
  .refine(
2137
2576
  (data) =>
2138
2577
  data.name !== undefined ||
2578
+ data.clientId !== undefined ||
2139
2579
  data.domain !== undefined ||
2140
2580
  data.linkedinUrl !== undefined ||
2141
2581
  data.website !== undefined ||
@@ -2164,6 +2604,7 @@ export const UpdateCompanyRequestSchema = z
2164
2604
  export const CreateContactRequestSchema = z
2165
2605
  .object({
2166
2606
  email: z.string().trim().email(),
2607
+ clientId: UuidSchema.nullable().optional(),
2167
2608
  companyId: UuidSchema.optional(),
2168
2609
  firstName: z.string().trim().min(1).max(255).optional(),
2169
2610
  lastName: z.string().trim().min(1).max(255).optional(),
@@ -2183,6 +2624,7 @@ export const CreateContactRequestSchema = z
2183
2624
  export const UpdateContactRequestSchema = z
2184
2625
  .object({
2185
2626
  companyId: UuidSchema.optional(),
2627
+ clientId: UuidSchema.nullable().optional(),
2186
2628
  emailValid: AcqEmailValidSchema.optional(),
2187
2629
  firstName: z.string().trim().min(1).max(255).optional(),
2188
2630
  lastName: z.string().trim().min(1).max(255).optional(),
@@ -2200,6 +2642,7 @@ export const UpdateContactRequestSchema = z
2200
2642
  .refine(
2201
2643
  (data) =>
2202
2644
  data.companyId !== undefined ||
2645
+ data.clientId !== undefined ||
2203
2646
  data.emailValid !== undefined ||
2204
2647
  data.firstName !== undefined ||
2205
2648
  data.lastName !== undefined ||
@@ -2224,6 +2667,7 @@ export const UpdateContactRequestSchema = z
2224
2667
  export const AcqCompanyResponseSchema = z.object({
2225
2668
  id: z.string(),
2226
2669
  organizationId: z.string(),
2670
+ clientId: z.string().nullable().optional(),
2227
2671
  name: z.string(),
2228
2672
  domain: z.string().nullable(),
2229
2673
  linkedinUrl: z.string().nullable(),
@@ -2290,6 +2734,7 @@ export const AcqContactCompanySummarySchema = z.object({
2290
2734
  export const AcqContactResponseSchema = z.object({
2291
2735
  id: z.string(),
2292
2736
  organizationId: z.string(),
2737
+ clientId: z.string().nullable().optional(),
2293
2738
  companyId: z.string().nullable(),
2294
2739
  email: z.string(),
2295
2740
  emailValid: AcqEmailValidSchema.nullable(),
@@ -2511,13 +2956,15 @@ export const AcqListSchemas = {
2511
2956
  BuildPlanSnapshotStep: BuildPlanSnapshotStepSchema,
2512
2957
  AcqListMetadata: AcqListMetadataSchema,
2513
2958
  LeadGenStageKey: LeadGenStageKeySchema,
2514
- LeadGenCapabilityKey: LeadGenCapabilityKeySchema,
2959
+ LeadGenActionKey: LeadGenActionKeySchema,
2515
2960
  ProcessingStageStatus: ProcessingStageStatusSchema,
2516
2961
  ProcessingState: ProcessingStateSchema,
2517
2962
  ListStageCounts: ListStageCountsSchema,
2518
2963
  ListTelemetry: ListTelemetrySchema,
2519
2964
 
2520
2965
  // Requests
2966
+ ListReadQuery: ListReadQuerySchema,
2967
+ GetListQuery: GetListQuerySchema,
2521
2968
  CreateListRequest: CreateListRequestSchema,
2522
2969
  UpdateListRequest: UpdateListRequestSchema,
2523
2970
  UpdateListStatusRequest: UpdateListStatusRequestSchema,
@@ -2529,7 +2976,11 @@ export const AcqListSchemas = {
2529
2976
 
2530
2977
  // Responses
2531
2978
  AcqListResponse: AcqListResponseSchema,
2979
+ AcqListDetailResponse: AcqListDetailResponseSchema,
2532
2980
  AcqListListResponse: AcqListListResponseSchema,
2981
+ AcqListDealRef: AcqListDealRefSchema,
2982
+ AcqListLineage: AcqListLineageSchema,
2983
+ AcqListStatusResponse: AcqListStatusResponseSchema,
2533
2984
  ListTelemetryResponse: ListTelemetryResponseSchema,
2534
2985
  ListTelemetryListResponse: ListTelemetryListResponseSchema,
2535
2986
  ListExecutionsResponse: ListExecutionsResponseSchema,
@@ -3329,15 +3780,23 @@ export type ListToolMap = {
3329
3780
  ### `KnowledgeLinkSchema`
3330
3781
 
3331
3782
  ```typescript
3332
- export const KnowledgeLinkSchema = z.object({
3333
- nodeId: NodeIdStringSchema
3334
- })
3783
+ export const KnowledgeLinkSchema = z
3784
+ .union([CanonicalKnowledgeLinkSchema, LegacyKnowledgeLinkSchema])
3785
+ .transform((link) => {
3786
+ const target = 'target' in link ? link.target : targetFromNodeId(link.nodeId)
3787
+ return {
3788
+ target,
3789
+ nodeId: nodeIdFromTarget(target)
3790
+ }
3791
+ })
3335
3792
  ```
3336
3793
 
3337
3794
  ### `OrgKnowledgeKindSchema`
3338
3795
 
3339
3796
  ```typescript
3340
- export const OrgKnowledgeKindSchema = z.enum(['playbook', 'strategy', 'reference'])
3797
+ export const OrgKnowledgeKindSchema = z
3798
+ .enum(['playbook', 'strategy', 'reference'])
3799
+ .meta({ label: 'Knowledge kind', color: 'grape' })
3341
3800
  ```
3342
3801
 
3343
3802
  ### `OrgKnowledgeNodeSchema`
@@ -3349,6 +3808,8 @@ export const OrgKnowledgeNodeSchema = z.object({
3349
3808
  title: z.string().trim().min(1).max(200),
3350
3809
  summary: z.string().trim().min(1).max(1000),
3351
3810
  icon: IconNameSchema.optional(),
3811
+ /** Canonical documentation URL when body content is a local summary. */
3812
+ externalUrl: z.string().trim().url().max(500).optional(),
3352
3813
  /** Raw MDX string. Phase 2 will introduce a structured block format. */
3353
3814
  body: z.string().trim().min(1),
3354
3815
  /**
@@ -3356,12 +3817,8 @@ export const OrgKnowledgeNodeSchema = z.object({
3356
3817
  * Each link emits a `governs` edge: knowledge-node -> target node.
3357
3818
  */
3358
3819
  links: z.array(KnowledgeLinkSchema).default([]),
3359
- /** Operator skill or command bindings relevant to this node. */
3360
- skills: z.array(KnowledgeSkillBindingSchema).optional(),
3361
- /** Domain key used to derive fast graph->skill registries. */
3362
- domain: KnowledgeDomainBindingSchema.optional(),
3363
- /** Identifiers of the roles or members who own this knowledge node. */
3364
- ownerIds: z.array(ModelIdSchema).default([]),
3820
+ /** Role identifiers that own this knowledge node. */
3821
+ ownerIds: z.array(RoleIdSchema.meta({ ref: 'role' })).default([]),
3365
3822
  /** ISO date string (YYYY-MM-DD or full ISO 8601) of last meaningful update. */
3366
3823
  updatedAt: z.string().trim().min(1).max(50)
3367
3824
  })
@@ -3370,9 +3827,7 @@ export const OrgKnowledgeNodeSchema = z.object({
3370
3827
  ### `KnowledgeDomainSchema`
3371
3828
 
3372
3829
  ```typescript
3373
- export const KnowledgeDomainSchema = z.object({
3374
- nodes: z.array(OrgKnowledgeNodeSchema).default([])
3375
- })
3830
+ export const KnowledgeDomainSchema = z.record(ModelIdSchema, OrgKnowledgeNodeSchema).default({})
3376
3831
  ```
3377
3832
 
3378
3833
  ### `OrgKnowledgeNode`