@elevasis/sdk 1.19.0 → 1.20.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.
- package/dist/cli.cjs +1712 -72
- package/dist/index.d.ts +659 -5
- package/dist/index.js +565 -42
- package/dist/node/index.d.ts +1 -0
- package/dist/node/index.js +213 -2
- package/dist/test-utils/index.d.ts +459 -4
- package/dist/test-utils/index.js +509 -37
- package/dist/worker/index.js +365 -37
- package/package.json +4 -4
- package/reference/_navigation.md +2 -1
- package/reference/_reference-manifest.json +14 -0
- package/reference/claude-config/rules/agent-start-here.md +5 -5
- package/reference/claude-config/rules/deployment.md +4 -3
- package/reference/claude-config/rules/frontend.md +2 -2
- package/reference/claude-config/rules/operations.md +17 -13
- package/reference/claude-config/rules/organization-model.md +7 -5
- package/reference/claude-config/rules/organization-os.md +13 -11
- package/reference/claude-config/rules/ui.md +3 -3
- package/reference/claude-config/rules/vibe.md +4 -4
- package/reference/claude-config/skills/explore/SKILL.md +4 -4
- package/reference/claude-config/skills/knowledge/SKILL.md +8 -8
- package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +7 -7
- package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +13 -13
- package/reference/claude-config/skills/knowledge/operations/customers.md +1 -1
- package/reference/claude-config/skills/knowledge/operations/goals.md +1 -1
- package/reference/claude-config/skills/knowledge/operations/identity.md +1 -1
- package/reference/claude-config/skills/knowledge/operations/offerings.md +1 -1
- package/reference/claude-config/skills/knowledge/operations/roles.md +1 -1
- package/reference/claude-config/skills/knowledge/operations/techStack.md +19 -91
- package/reference/claude-config/skills/project/SKILL.md +73 -13
- package/reference/claude-config/skills/save/SKILL.md +5 -5
- package/reference/claude-config/skills/tutorial/technical.md +5 -6
- package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -0
- package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -0
- package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -0
- package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -0
- package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -0
- package/reference/examples/organization-model.ts +17 -5
- package/reference/framework/index.mdx +1 -1
- package/reference/framework/project-structure.mdx +10 -8
- package/reference/packages/core/src/business/README.md +2 -2
- package/reference/packages/core/src/organization-model/README.md +10 -3
- package/reference/resources/index.mdx +27 -17
- package/reference/scaffold/core/organization-model.mdx +33 -14
- package/reference/scaffold/operations/workflow-recipes.md +35 -29
- package/reference/scaffold/recipes/add-a-feature.md +18 -3
- package/reference/scaffold/recipes/add-a-resource.md +50 -10
- package/reference/scaffold/recipes/customize-crm-actions.md +12 -6
- package/reference/scaffold/recipes/customize-organization-model.md +18 -3
- package/reference/scaffold/recipes/extend-crm.md +17 -19
- package/reference/scaffold/recipes/extend-lead-gen.md +31 -31
- package/reference/scaffold/recipes/index.md +1 -1
- package/reference/scaffold/reference/contracts.md +501 -303
- package/reference/scaffold/reference/feature-registry.md +1 -1
- package/reference/scaffold/reference/glossary.md +8 -3
- package/reference/scaffold/ui/recipes.md +21 -6
|
@@ -162,6 +162,36 @@ export type OrganizationModelRoles = z.infer<typeof RolesDomainSchema>
|
|
|
162
162
|
export type OrganizationModelRole = z.infer<typeof RoleSchema>
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
+
### `OrganizationModelRoleId`
|
|
166
|
+
|
|
167
|
+
```typescript
|
|
168
|
+
export type OrganizationModelRoleId = z.infer<typeof RoleIdSchema>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### `OrganizationModelRoleHolder`
|
|
172
|
+
|
|
173
|
+
```typescript
|
|
174
|
+
export type OrganizationModelRoleHolder = z.infer<typeof RoleHolderSchema>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
### `OrganizationModelHumanRoleHolder`
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
export type OrganizationModelHumanRoleHolder = z.infer<typeof HumanRoleHolderSchema>
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
### `OrganizationModelAgentRoleHolder`
|
|
184
|
+
|
|
185
|
+
```typescript
|
|
186
|
+
export type OrganizationModelAgentRoleHolder = z.infer<typeof AgentRoleHolderSchema>
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### `OrganizationModelTeamRoleHolder`
|
|
190
|
+
|
|
191
|
+
```typescript
|
|
192
|
+
export type OrganizationModelTeamRoleHolder = z.infer<typeof TeamRoleHolderSchema>
|
|
193
|
+
```
|
|
194
|
+
|
|
165
195
|
### `OrganizationModelGoals`
|
|
166
196
|
|
|
167
197
|
```typescript
|
|
@@ -180,6 +210,90 @@ export type OrganizationModelObjective = z.infer<typeof ObjectiveSchema>
|
|
|
180
210
|
export type OrganizationModelKeyResult = z.infer<typeof KeyResultSchema>
|
|
181
211
|
```
|
|
182
212
|
|
|
213
|
+
### `OrganizationModelSystems`
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
export type OrganizationModelSystems = z.infer<typeof SystemsDomainSchema>
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### `OrganizationModelSystemEntry`
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
export type OrganizationModelSystemEntry = z.infer<typeof SystemEntrySchema>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### `OrganizationModelSystemId`
|
|
226
|
+
|
|
227
|
+
```typescript
|
|
228
|
+
export type OrganizationModelSystemId = z.infer<typeof SystemIdSchema>
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### `OrganizationModelSystemKind`
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
export type OrganizationModelSystemKind = z.infer<typeof SystemKindSchema>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### `OrganizationModelSystemStatus`
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
export type OrganizationModelSystemStatus = z.infer<typeof SystemStatusSchema>
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### `OrganizationModelResources`
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
export type OrganizationModelResources = z.infer<typeof ResourcesDomainSchema>
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### `OrganizationModelResourceEntry`
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
export type OrganizationModelResourceEntry = z.infer<typeof ResourceEntrySchema>
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### `OrganizationModelResourceId`
|
|
256
|
+
|
|
257
|
+
```typescript
|
|
258
|
+
export type OrganizationModelResourceId = z.infer<typeof ResourceIdSchema>
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
### `OrganizationModelResourceKind`
|
|
262
|
+
|
|
263
|
+
```typescript
|
|
264
|
+
export type OrganizationModelResourceKind = z.infer<typeof ResourceKindSchema>
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
### `OrganizationModelResourceGovernanceStatus`
|
|
268
|
+
|
|
269
|
+
```typescript
|
|
270
|
+
export type OrganizationModelResourceGovernanceStatus = z.infer<typeof ResourceGovernanceStatusSchema>
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### `OrganizationModelAgentKind`
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
export type OrganizationModelAgentKind = z.infer<typeof AgentKindSchema>
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### `OrganizationModelWorkflowResourceEntry`
|
|
280
|
+
|
|
281
|
+
```typescript
|
|
282
|
+
export type OrganizationModelWorkflowResourceEntry = z.infer<typeof WorkflowResourceEntrySchema>
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### `OrganizationModelAgentResourceEntry`
|
|
286
|
+
|
|
287
|
+
```typescript
|
|
288
|
+
export type OrganizationModelAgentResourceEntry = z.infer<typeof AgentResourceEntrySchema>
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### `OrganizationModelIntegrationResourceEntry`
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
export type OrganizationModelIntegrationResourceEntry = z.infer<typeof IntegrationResourceEntrySchema>
|
|
295
|
+
```
|
|
296
|
+
|
|
183
297
|
### `OrganizationModelKnowledge`
|
|
184
298
|
|
|
185
299
|
```typescript
|
|
@@ -414,413 +528,464 @@ export interface ElevasisFeaturesContextValue {
|
|
|
414
528
|
### `ResourceStatus`
|
|
415
529
|
|
|
416
530
|
```typescript
|
|
417
|
-
/**
|
|
418
|
-
* Environment/deployment status for resources
|
|
419
|
-
*/
|
|
531
|
+
/**
|
|
532
|
+
* Environment/deployment status for resources
|
|
533
|
+
*/
|
|
420
534
|
export type ResourceStatus = 'dev' | 'prod'
|
|
421
535
|
```
|
|
422
536
|
|
|
423
537
|
### `ResourceType`
|
|
424
538
|
|
|
425
539
|
```typescript
|
|
426
|
-
/**
|
|
427
|
-
* All resource types in the platform
|
|
428
|
-
* Used as the discriminator field in ResourceDefinition
|
|
429
|
-
*/
|
|
540
|
+
/**
|
|
541
|
+
* All resource types in the platform
|
|
542
|
+
* Used as the discriminator field in ResourceDefinition
|
|
543
|
+
*/
|
|
430
544
|
export type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human'
|
|
431
545
|
```
|
|
432
546
|
|
|
433
547
|
### `ExecutableResourceType`
|
|
434
548
|
|
|
435
549
|
```typescript
|
|
436
|
-
/**
|
|
437
|
-
* Executable resource types (subset of ResourceType)
|
|
438
|
-
* These resources can be directly executed by the execution engine
|
|
439
|
-
*/
|
|
550
|
+
/**
|
|
551
|
+
* Executable resource types (subset of ResourceType)
|
|
552
|
+
* These resources can be directly executed by the execution engine
|
|
553
|
+
*/
|
|
440
554
|
export type ExecutableResourceType = 'workflow' | 'agent'
|
|
441
555
|
```
|
|
442
556
|
|
|
557
|
+
### `ResourceSystemSummary`
|
|
558
|
+
|
|
559
|
+
```typescript
|
|
560
|
+
export type ResourceSystemSummary = Pick<SystemEntry, 'id' | 'title' | 'description' | 'kind' | 'status'>
|
|
561
|
+
```
|
|
562
|
+
|
|
443
563
|
### `ResourceDefinition`
|
|
444
564
|
|
|
445
565
|
```typescript
|
|
446
|
-
/**
|
|
447
|
-
* Base interface for ALL platform resources
|
|
448
|
-
* Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
|
|
449
|
-
*/
|
|
450
|
-
export interface ResourceDefinition {
|
|
451
|
-
/** Unique resource identifier */
|
|
452
|
-
resourceId: string
|
|
453
|
-
|
|
454
|
-
/** Display name */
|
|
455
|
-
name: string
|
|
456
|
-
|
|
457
|
-
/** Purpose and functionality description */
|
|
458
|
-
description: string
|
|
459
|
-
|
|
460
|
-
/** Version for change tracking and evolution */
|
|
461
|
-
version: string
|
|
462
|
-
|
|
463
|
-
/** Resource type discriminator */
|
|
464
|
-
type: ResourceType
|
|
465
|
-
|
|
466
|
-
/** Environment/deployment status */
|
|
467
|
-
status: ResourceStatus
|
|
468
|
-
|
|
566
|
+
/**
|
|
567
|
+
* Base interface for ALL platform resources
|
|
568
|
+
* Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
|
|
569
|
+
*/
|
|
570
|
+
export interface ResourceDefinition {
|
|
571
|
+
/** Unique resource identifier */
|
|
572
|
+
resourceId: string
|
|
573
|
+
|
|
574
|
+
/** Display name */
|
|
575
|
+
name: string
|
|
576
|
+
|
|
577
|
+
/** Purpose and functionality description */
|
|
578
|
+
description: string
|
|
579
|
+
|
|
580
|
+
/** Version for change tracking and evolution */
|
|
581
|
+
version: string
|
|
582
|
+
|
|
583
|
+
/** Resource type discriminator */
|
|
584
|
+
type: ResourceType
|
|
585
|
+
|
|
586
|
+
/** Environment/deployment status */
|
|
587
|
+
status: ResourceStatus
|
|
588
|
+
|
|
469
589
|
/** Graph links to Organization Model nodes */
|
|
470
590
|
links?: ResourceLink[]
|
|
471
591
|
|
|
472
592
|
/** Infrastructure category for filtering */
|
|
473
593
|
category?: ResourceCategory
|
|
474
|
-
|
|
475
|
-
/** Whether the agent supports multi-turn sessions (agents only) */
|
|
476
|
-
sessionCapable?: boolean
|
|
477
|
-
|
|
478
|
-
/** Whether the resource is local (monorepo) or remote (externally deployed) */
|
|
479
|
-
origin?: 'local' | 'remote'
|
|
480
|
-
|
|
481
|
-
/**
|
|
482
|
-
|
|
594
|
+
|
|
595
|
+
/** Whether the agent supports multi-turn sessions (agents only) */
|
|
596
|
+
sessionCapable?: boolean
|
|
597
|
+
|
|
598
|
+
/** Whether the resource is local (monorepo) or remote (externally deployed) */
|
|
599
|
+
origin?: 'local' | 'remote'
|
|
600
|
+
|
|
601
|
+
/** OM System membership, when backed by a Resource descriptor */
|
|
602
|
+
systemId?: string
|
|
603
|
+
|
|
604
|
+
/** Display metadata for the owning OM System */
|
|
605
|
+
system?: ResourceSystemSummary
|
|
606
|
+
|
|
607
|
+
/** Governance lifecycle status from the OM Resource descriptor */
|
|
608
|
+
governanceStatus?: ResourceGovernanceStatus
|
|
609
|
+
|
|
610
|
+
/** Whether this resource is archived and should be excluded from registration and deployment */
|
|
611
|
+
archived?: boolean
|
|
612
|
+
}
|
|
613
|
+
```
|
|
614
|
+
|
|
615
|
+
### `RuntimeResourceDescriptor`
|
|
616
|
+
|
|
617
|
+
```typescript
|
|
618
|
+
export type RuntimeResourceDescriptor = Extract<ResourceEntry, { kind: 'workflow' | 'agent' | 'integration' }>
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
### `DescriptorBackedResourceDefinition`
|
|
622
|
+
|
|
623
|
+
```typescript
|
|
624
|
+
export type DescriptorBackedResourceDefinition<
|
|
625
|
+
TResource extends RuntimeResourceDescriptor = RuntimeResourceDescriptor
|
|
626
|
+
> = Omit<ResourceDefinition, 'resourceId' | 'type'> & {
|
|
627
|
+
/** OM descriptor that owns canonical identity and governance metadata. */
|
|
628
|
+
resource: TResource
|
|
629
|
+
resourceId?: never
|
|
630
|
+
type?: never
|
|
483
631
|
}
|
|
484
632
|
```
|
|
485
633
|
|
|
634
|
+
### `BoundResourceDefinition`
|
|
635
|
+
|
|
636
|
+
```typescript
|
|
637
|
+
export type BoundResourceDefinition<TResource extends RuntimeResourceDescriptor = RuntimeResourceDescriptor> = Omit<
|
|
638
|
+
DescriptorBackedResourceDefinition<TResource>,
|
|
639
|
+
'resource'
|
|
640
|
+
> &
|
|
641
|
+
ResourceDefinition & {
|
|
642
|
+
resource: TResource
|
|
643
|
+
resourceId: TResource['id']
|
|
644
|
+
type: TResource['kind']
|
|
645
|
+
}
|
|
646
|
+
```
|
|
647
|
+
|
|
486
648
|
### `ResourceList`
|
|
487
649
|
|
|
488
650
|
```typescript
|
|
489
651
|
/**
|
|
490
652
|
* Resource list for organization
|
|
491
653
|
* Returns ResourceDefinition metadata (not full definitions)
|
|
492
|
-
*/
|
|
493
|
-
export interface ResourceList {
|
|
494
|
-
workflows: ResourceDefinition[]
|
|
495
|
-
agents: ResourceDefinition[]
|
|
496
|
-
total: number
|
|
497
|
-
organizationName: string
|
|
498
|
-
environment?: 'dev' | 'prod'
|
|
654
|
+
*/
|
|
655
|
+
export interface ResourceList {
|
|
656
|
+
workflows: ResourceDefinition[]
|
|
657
|
+
agents: ResourceDefinition[]
|
|
658
|
+
total: number
|
|
659
|
+
organizationName: string
|
|
660
|
+
environment?: 'dev' | 'prod'
|
|
499
661
|
}
|
|
500
662
|
```
|
|
501
663
|
|
|
502
664
|
### `WebhookProviderType`
|
|
503
665
|
|
|
504
666
|
```typescript
|
|
505
|
-
/** Webhook provider identifiers */
|
|
667
|
+
/** Webhook provider identifiers */
|
|
506
668
|
export type WebhookProviderType = 'cal-com' | 'stripe' | 'signature-api' | 'instantly' | 'apify' | 'test'
|
|
507
669
|
```
|
|
508
670
|
|
|
509
671
|
### `WebhookTriggerConfig`
|
|
510
672
|
|
|
511
673
|
```typescript
|
|
512
|
-
/** Webhook trigger configuration */
|
|
513
|
-
export interface WebhookTriggerConfig {
|
|
514
|
-
/** Provider identifier */
|
|
515
|
-
provider: WebhookProviderType
|
|
516
|
-
/** Event type for documentation (not used for matching - workflow handles routing) */
|
|
517
|
-
event?: string
|
|
518
|
-
/** Optional filtering (e.g., specific form ID for Fillout) */
|
|
519
|
-
filter?: Record<string, string>
|
|
520
|
-
/** References credential in credentials table for per-org webhook secrets */
|
|
521
|
-
credentialName?: string
|
|
674
|
+
/** Webhook trigger configuration */
|
|
675
|
+
export interface WebhookTriggerConfig {
|
|
676
|
+
/** Provider identifier */
|
|
677
|
+
provider: WebhookProviderType
|
|
678
|
+
/** Event type for documentation (not used for matching - workflow handles routing) */
|
|
679
|
+
event?: string
|
|
680
|
+
/** Optional filtering (e.g., specific form ID for Fillout) */
|
|
681
|
+
filter?: Record<string, string>
|
|
682
|
+
/** References credential in credentials table for per-org webhook secrets */
|
|
683
|
+
credentialName?: string
|
|
522
684
|
}
|
|
523
685
|
```
|
|
524
686
|
|
|
525
687
|
### `ScheduleTriggerConfig`
|
|
526
688
|
|
|
527
689
|
```typescript
|
|
528
|
-
/** Schedule trigger configuration */
|
|
529
|
-
export interface ScheduleTriggerConfig {
|
|
530
|
-
/** Cron expression (e.g., '0 6 * * *') */
|
|
531
|
-
cron: string
|
|
532
|
-
/** Optional timezone (default: UTC) */
|
|
533
|
-
timezone?: string
|
|
690
|
+
/** Schedule trigger configuration */
|
|
691
|
+
export interface ScheduleTriggerConfig {
|
|
692
|
+
/** Cron expression (e.g., '0 6 * * *') */
|
|
693
|
+
cron: string
|
|
694
|
+
/** Optional timezone (default: UTC) */
|
|
695
|
+
timezone?: string
|
|
534
696
|
}
|
|
535
697
|
```
|
|
536
698
|
|
|
537
699
|
### `EventTriggerConfig`
|
|
538
700
|
|
|
539
701
|
```typescript
|
|
540
|
-
/** Event trigger configuration */
|
|
541
|
-
export interface EventTriggerConfig {
|
|
542
|
-
/** Internal event type */
|
|
543
|
-
eventType: string
|
|
544
|
-
/** Event source */
|
|
545
|
-
source?: string
|
|
702
|
+
/** Event trigger configuration */
|
|
703
|
+
export interface EventTriggerConfig {
|
|
704
|
+
/** Internal event type */
|
|
705
|
+
eventType: string
|
|
706
|
+
/** Event source */
|
|
707
|
+
source?: string
|
|
546
708
|
}
|
|
547
709
|
```
|
|
548
710
|
|
|
549
711
|
### `TriggerConfig`
|
|
550
712
|
|
|
551
713
|
```typescript
|
|
552
|
-
/** Union of all trigger configs */
|
|
714
|
+
/** Union of all trigger configs */
|
|
553
715
|
export type TriggerConfig = WebhookTriggerConfig | ScheduleTriggerConfig | EventTriggerConfig
|
|
554
716
|
```
|
|
555
717
|
|
|
556
718
|
### `TriggerDefinition`
|
|
557
719
|
|
|
558
720
|
```typescript
|
|
559
|
-
/**
|
|
560
|
-
* Trigger metadata - entry points that initiate resource execution
|
|
561
|
-
*
|
|
562
|
-
* Triggers represent how executions start: webhooks from external services,
|
|
563
|
-
* scheduled cron jobs, platform events, or manual user actions.
|
|
564
|
-
*
|
|
565
|
-
* BREAKING CHANGES (2025-11-30):
|
|
721
|
+
/**
|
|
722
|
+
* Trigger metadata - entry points that initiate resource execution
|
|
723
|
+
*
|
|
724
|
+
* Triggers represent how executions start: webhooks from external services,
|
|
725
|
+
* scheduled cron jobs, platform events, or manual user actions.
|
|
726
|
+
*
|
|
727
|
+
* BREAKING CHANGES (2025-11-30):
|
|
566
728
|
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
|
|
567
|
-
* - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
|
|
568
|
-
* - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
|
|
569
|
-
* - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
|
|
570
|
-
* - triggers object now includes `externalResources` option
|
|
571
|
-
*
|
|
572
|
-
* @example
|
|
573
|
-
* // TriggerDefinition - metadata only
|
|
574
|
-
* {
|
|
575
|
-
* resourceId: 'trigger-new-order',
|
|
576
|
-
* type: 'trigger',
|
|
577
|
-
* triggerType: 'webhook',
|
|
578
|
-
* name: 'New Order',
|
|
579
|
-
* description: 'Webhook from Shopify on new orders',
|
|
580
|
-
* version: '1.0.0',
|
|
581
|
-
* status: 'prod',
|
|
582
|
-
* webhookPath: '/webhooks/shopify/orders'
|
|
583
|
-
* }
|
|
584
|
-
*
|
|
585
|
-
* // Relationships declared in ResourceRelationships (not on TriggerDefinition):
|
|
586
|
-
* // relationships: {
|
|
587
|
-
* // 'trigger-new-order': { triggers: { workflows: ['order-fulfillment-workflow'] } }
|
|
588
|
-
* // }
|
|
589
|
-
*/
|
|
590
|
-
export interface TriggerDefinition extends ResourceDefinition {
|
|
591
|
-
/** Resource type discriminator (narrowed from base union) */
|
|
592
|
-
type: 'trigger'
|
|
593
|
-
|
|
594
|
-
/** Trigger mechanism type (renamed from 'type' to avoid collision with base type discriminator) */
|
|
595
|
-
triggerType: 'webhook' | 'schedule' | 'manual' | 'event'
|
|
596
|
-
|
|
597
|
-
/** Type-specific configuration */
|
|
598
|
-
config?: TriggerConfig
|
|
599
|
-
|
|
600
|
-
// Legacy fields (deprecated, use config instead)
|
|
601
|
-
/** For webhook triggers: path like '/webhooks/shopify/orders' */
|
|
602
|
-
webhookPath?: string
|
|
603
|
-
/** For schedule triggers: cron expression like '0 6 * * *' */
|
|
604
|
-
schedule?: string
|
|
605
|
-
/** For event triggers: event type like 'low-stock-alert' */
|
|
606
|
-
eventType?: string
|
|
607
|
-
|
|
608
|
-
// NOTE: What this trigger starts is declared in ResourceRelationships, not here
|
|
609
|
-
// This prevents duplication - triggers are forward-declared in relationships
|
|
729
|
+
* - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
|
|
730
|
+
* - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
|
|
731
|
+
* - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
|
|
732
|
+
* - triggers object now includes `externalResources` option
|
|
733
|
+
*
|
|
734
|
+
* @example
|
|
735
|
+
* // TriggerDefinition - metadata only
|
|
736
|
+
* {
|
|
737
|
+
* resourceId: 'trigger-new-order',
|
|
738
|
+
* type: 'trigger',
|
|
739
|
+
* triggerType: 'webhook',
|
|
740
|
+
* name: 'New Order',
|
|
741
|
+
* description: 'Webhook from Shopify on new orders',
|
|
742
|
+
* version: '1.0.0',
|
|
743
|
+
* status: 'prod',
|
|
744
|
+
* webhookPath: '/webhooks/shopify/orders'
|
|
745
|
+
* }
|
|
746
|
+
*
|
|
747
|
+
* // Relationships declared in ResourceRelationships (not on TriggerDefinition):
|
|
748
|
+
* // relationships: {
|
|
749
|
+
* // 'trigger-new-order': { triggers: { workflows: ['order-fulfillment-workflow'] } }
|
|
750
|
+
* // }
|
|
751
|
+
*/
|
|
752
|
+
export interface TriggerDefinition extends ResourceDefinition {
|
|
753
|
+
/** Resource type discriminator (narrowed from base union) */
|
|
754
|
+
type: 'trigger'
|
|
755
|
+
|
|
756
|
+
/** Trigger mechanism type (renamed from 'type' to avoid collision with base type discriminator) */
|
|
757
|
+
triggerType: 'webhook' | 'schedule' | 'manual' | 'event'
|
|
758
|
+
|
|
759
|
+
/** Type-specific configuration */
|
|
760
|
+
config?: TriggerConfig
|
|
761
|
+
|
|
762
|
+
// Legacy fields (deprecated, use config instead)
|
|
763
|
+
/** For webhook triggers: path like '/webhooks/shopify/orders' */
|
|
764
|
+
webhookPath?: string
|
|
765
|
+
/** For schedule triggers: cron expression like '0 6 * * *' */
|
|
766
|
+
schedule?: string
|
|
767
|
+
/** For event triggers: event type like 'low-stock-alert' */
|
|
768
|
+
eventType?: string
|
|
769
|
+
|
|
770
|
+
// NOTE: What this trigger starts is declared in ResourceRelationships, not here
|
|
771
|
+
// This prevents duplication - triggers are forward-declared in relationships
|
|
610
772
|
}
|
|
611
773
|
```
|
|
612
774
|
|
|
613
775
|
### `IntegrationDefinition`
|
|
614
776
|
|
|
615
777
|
```typescript
|
|
616
|
-
/**
|
|
617
|
-
* Integration metadata - external service connections
|
|
618
|
-
*
|
|
619
|
-
* References credentials table for actual connection. No connection status
|
|
620
|
-
* stored here (queried at runtime from credentials table).
|
|
621
|
-
*
|
|
622
|
-
* BREAKING CHANGES (2025-11-30):
|
|
778
|
+
/**
|
|
779
|
+
* Integration metadata - external service connections
|
|
780
|
+
*
|
|
781
|
+
* References credentials table for actual connection. No connection status
|
|
782
|
+
* stored here (queried at runtime from credentials table).
|
|
783
|
+
*
|
|
784
|
+
* BREAKING CHANGES (2025-11-30):
|
|
623
785
|
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
|
|
624
|
-
* - Field renames: `id` -> `resourceId` (inherited)
|
|
625
|
-
* - New required field: `status` (inherited) - organizations must add status to all integrations
|
|
626
|
-
* - New required field: `version` (inherited) - organizations must add version to all integrations
|
|
627
|
-
* - New required field: `type: 'integration'` (inherited) - resource type discriminator
|
|
628
|
-
*
|
|
629
|
-
* @example
|
|
630
|
-
* {
|
|
631
|
-
* resourceId: 'integration-shopify-prod',
|
|
632
|
-
* type: 'integration',
|
|
633
|
-
* provider: 'shopify',
|
|
634
|
-
* credentialName: 'shopify-prod',
|
|
635
|
-
* name: 'Shopify Production',
|
|
636
|
-
* description: 'E-commerce platform',
|
|
637
|
-
* version: '1.0.0',
|
|
638
|
-
* status: 'prod'
|
|
639
|
-
* }
|
|
640
|
-
*/
|
|
641
|
-
export interface IntegrationDefinition extends ResourceDefinition {
|
|
642
|
-
/** Resource type discriminator (narrowed from base union) */
|
|
643
|
-
type: 'integration'
|
|
644
|
-
|
|
645
|
-
/**
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
786
|
+
* - Field renames: `id` -> `resourceId` (inherited)
|
|
787
|
+
* - New required field: `status` (inherited) - organizations must add status to all integrations
|
|
788
|
+
* - New required field: `version` (inherited) - organizations must add version to all integrations
|
|
789
|
+
* - New required field: `type: 'integration'` (inherited) - resource type discriminator
|
|
790
|
+
*
|
|
791
|
+
* @example
|
|
792
|
+
* {
|
|
793
|
+
* resourceId: 'integration-shopify-prod',
|
|
794
|
+
* type: 'integration',
|
|
795
|
+
* provider: 'shopify',
|
|
796
|
+
* credentialName: 'shopify-prod',
|
|
797
|
+
* name: 'Shopify Production',
|
|
798
|
+
* description: 'E-commerce platform',
|
|
799
|
+
* version: '1.0.0',
|
|
800
|
+
* status: 'prod'
|
|
801
|
+
* }
|
|
802
|
+
*/
|
|
803
|
+
export interface IntegrationDefinition extends ResourceDefinition {
|
|
804
|
+
/** Resource type discriminator (narrowed from base union) */
|
|
805
|
+
type: 'integration'
|
|
806
|
+
|
|
807
|
+
/** OM descriptor that owns canonical identity and governance metadata. */
|
|
808
|
+
resource?: Extract<ResourceEntry, { kind: 'integration' }>
|
|
809
|
+
|
|
810
|
+
/** Integration provider type */
|
|
811
|
+
provider: IntegrationType
|
|
812
|
+
/** References credentials table (e.g., 'shopify-prod', 'zendesk-api') */
|
|
813
|
+
credentialName: string
|
|
649
814
|
}
|
|
650
815
|
```
|
|
651
816
|
|
|
652
817
|
### `RelationshipDeclaration`
|
|
653
818
|
|
|
654
819
|
```typescript
|
|
655
|
-
/**
|
|
656
|
-
* Explicit resource relationship declaration
|
|
657
|
-
*
|
|
658
|
-
* Single-direction only - Command View derives reverse relationships.
|
|
659
|
-
* Agents/workflows declare what they trigger and use.
|
|
660
|
-
*
|
|
661
|
-
* @example
|
|
662
|
-
* {
|
|
663
|
-
* triggers: { workflows: ['order-fulfillment-workflow'] },
|
|
664
|
-
* uses: { integrations: ['integration-shopify-prod', 'integration-postgres'] }
|
|
665
|
-
* }
|
|
666
|
-
*/
|
|
667
|
-
export interface RelationshipDeclaration {
|
|
668
|
-
/** Resources this resource triggers */
|
|
669
|
-
triggers?: {
|
|
670
|
-
/** Agent resourceIds this resource triggers */
|
|
671
|
-
agents?: string[]
|
|
672
|
-
/** Workflow resourceIds this resource triggers */
|
|
673
|
-
workflows?: string[]
|
|
674
|
-
}
|
|
675
|
-
/** Integrations this resource uses */
|
|
676
|
-
uses?: {
|
|
677
|
-
/** Integration IDs this resource uses */
|
|
678
|
-
integrations?: string[]
|
|
679
|
-
}
|
|
820
|
+
/**
|
|
821
|
+
* Explicit resource relationship declaration
|
|
822
|
+
*
|
|
823
|
+
* Single-direction only - Command View derives reverse relationships.
|
|
824
|
+
* Agents/workflows declare what they trigger and use.
|
|
825
|
+
*
|
|
826
|
+
* @example
|
|
827
|
+
* {
|
|
828
|
+
* triggers: { workflows: ['order-fulfillment-workflow'] },
|
|
829
|
+
* uses: { integrations: ['integration-shopify-prod', 'integration-postgres'] }
|
|
830
|
+
* }
|
|
831
|
+
*/
|
|
832
|
+
export interface RelationshipDeclaration {
|
|
833
|
+
/** Resources this resource triggers */
|
|
834
|
+
triggers?: {
|
|
835
|
+
/** Agent resourceIds this resource triggers */
|
|
836
|
+
agents?: string[]
|
|
837
|
+
/** Workflow resourceIds this resource triggers */
|
|
838
|
+
workflows?: string[]
|
|
839
|
+
}
|
|
840
|
+
/** Integrations this resource uses */
|
|
841
|
+
uses?: {
|
|
842
|
+
/** Integration IDs this resource uses */
|
|
843
|
+
integrations?: string[]
|
|
844
|
+
}
|
|
680
845
|
}
|
|
681
846
|
```
|
|
682
847
|
|
|
683
848
|
### `ResourceRelationships`
|
|
684
849
|
|
|
685
850
|
```typescript
|
|
686
|
-
/**
|
|
687
|
-
* Resource relationships map
|
|
688
|
-
* Maps resourceId to its relationship declarations
|
|
689
|
-
*
|
|
690
|
-
* @example
|
|
691
|
-
* {
|
|
692
|
-
* 'order-processor-agent': {
|
|
693
|
-
* triggers: { workflows: ['order-fulfillment-workflow'] },
|
|
694
|
-
* uses: { integrations: ['integration-shopify-prod'] }
|
|
695
|
-
* }
|
|
696
|
-
* }
|
|
697
|
-
*/
|
|
851
|
+
/**
|
|
852
|
+
* Resource relationships map
|
|
853
|
+
* Maps resourceId to its relationship declarations
|
|
854
|
+
*
|
|
855
|
+
* @example
|
|
856
|
+
* {
|
|
857
|
+
* 'order-processor-agent': {
|
|
858
|
+
* triggers: { workflows: ['order-fulfillment-workflow'] },
|
|
859
|
+
* uses: { integrations: ['integration-shopify-prod'] }
|
|
860
|
+
* }
|
|
861
|
+
* }
|
|
862
|
+
*/
|
|
698
863
|
export type ResourceRelationships = Record<string, RelationshipDeclaration>
|
|
699
864
|
```
|
|
700
865
|
|
|
701
866
|
### `ExternalPlatform`
|
|
702
867
|
|
|
703
868
|
```typescript
|
|
704
|
-
/**
|
|
705
|
-
* External platform type
|
|
706
|
-
* Supported third-party automation platforms
|
|
707
|
-
*/
|
|
869
|
+
/**
|
|
870
|
+
* External platform type
|
|
871
|
+
* Supported third-party automation platforms
|
|
872
|
+
*/
|
|
708
873
|
export type ExternalPlatform = 'n8n' | 'make' | 'zapier' | 'other'
|
|
709
874
|
```
|
|
710
875
|
|
|
711
876
|
### `ExternalResourceDefinition`
|
|
712
877
|
|
|
713
878
|
```typescript
|
|
714
|
-
/**
|
|
715
|
-
* External automation resource metadata
|
|
716
|
-
*
|
|
717
|
-
* Represents workflows/automations running on third-party platforms
|
|
718
|
-
* (n8n, Make, Zapier, etc.) for visualization in Command View.
|
|
719
|
-
*
|
|
720
|
-
* NOTE: This is metadata ONLY for visualization. No execution logic,
|
|
721
|
-
* no API integration with external platforms, no status syncing.
|
|
722
|
-
*
|
|
723
|
-
* BREAKING CHANGES (2025-11-30):
|
|
879
|
+
/**
|
|
880
|
+
* External automation resource metadata
|
|
881
|
+
*
|
|
882
|
+
* Represents workflows/automations running on third-party platforms
|
|
883
|
+
* (n8n, Make, Zapier, etc.) for visualization in Command View.
|
|
884
|
+
*
|
|
885
|
+
* NOTE: This is metadata ONLY for visualization. No execution logic,
|
|
886
|
+
* no API integration with external platforms, no status syncing.
|
|
887
|
+
*
|
|
888
|
+
* BREAKING CHANGES (2025-11-30):
|
|
724
889
|
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
|
|
725
|
-
* - Field renames: `id` -> `resourceId` (inherited)
|
|
726
|
-
* - New required field: `version` (inherited) - organizations must add version to all external resources
|
|
727
|
-
* - New required field: `type: 'external'` (inherited) - resource type discriminator
|
|
728
|
-
* - REMOVED FIELD: `triggeredBy` - per relationship-consolidation design, all relationships are forward-only declarations
|
|
729
|
-
*
|
|
730
|
-
* @example
|
|
731
|
-
* {
|
|
732
|
-
* resourceId: 'external-n8n-order-sync',
|
|
733
|
-
* type: 'external',
|
|
734
|
-
* version: '1.0.0',
|
|
735
|
-
* platform: 'n8n',
|
|
736
|
-
* name: 'Shopify Order Sync',
|
|
737
|
-
* description: 'Legacy n8n workflow for syncing Shopify orders',
|
|
738
|
-
* status: 'prod',
|
|
739
|
-
* platformUrl: 'https://n8n.client.com/workflow/123',
|
|
740
|
-
* triggers: { workflows: ['order-fulfillment-workflow'] },
|
|
741
|
-
* uses: { integrations: ['integration-shopify-prod'] }
|
|
742
|
-
* }
|
|
743
|
-
*/
|
|
744
|
-
export interface ExternalResourceDefinition extends ResourceDefinition {
|
|
745
|
-
/** Resource type discriminator (narrowed from base union) */
|
|
746
|
-
type: 'external'
|
|
747
|
-
|
|
748
|
-
/** Platform type */
|
|
749
|
-
platform: ExternalPlatform
|
|
750
|
-
|
|
751
|
-
// Optional platform-specific metadata
|
|
752
|
-
/** Link to external platform (e.g., n8n workflow editor URL) */
|
|
753
|
-
platformUrl?: string
|
|
754
|
-
/** Platform's internal ID/reference */
|
|
755
|
-
externalId?: string
|
|
756
|
-
|
|
757
|
-
/** What this external resource triggers (external -> internal) */
|
|
758
|
-
triggers?: {
|
|
759
|
-
/** Elevasis workflow resourceIds this external automation triggers */
|
|
760
|
-
workflows?: string[]
|
|
761
|
-
/** Elevasis agent resourceIds this external automation triggers */
|
|
762
|
-
agents?: string[]
|
|
763
|
-
}
|
|
764
|
-
|
|
765
|
-
/** Integrations this external resource uses (shared credentials) */
|
|
766
|
-
uses?: {
|
|
767
|
-
/** Integration IDs this external automation uses */
|
|
768
|
-
integrations?: string[]
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
// NOTE: triggeredBy field removed - per relationship-consolidation design,
|
|
772
|
-
// all relationships are forward-only declarations. Graph edges are built
|
|
773
|
-
// from forward declarations only.
|
|
890
|
+
* - Field renames: `id` -> `resourceId` (inherited)
|
|
891
|
+
* - New required field: `version` (inherited) - organizations must add version to all external resources
|
|
892
|
+
* - New required field: `type: 'external'` (inherited) - resource type discriminator
|
|
893
|
+
* - REMOVED FIELD: `triggeredBy` - per relationship-consolidation design, all relationships are forward-only declarations
|
|
894
|
+
*
|
|
895
|
+
* @example
|
|
896
|
+
* {
|
|
897
|
+
* resourceId: 'external-n8n-order-sync',
|
|
898
|
+
* type: 'external',
|
|
899
|
+
* version: '1.0.0',
|
|
900
|
+
* platform: 'n8n',
|
|
901
|
+
* name: 'Shopify Order Sync',
|
|
902
|
+
* description: 'Legacy n8n workflow for syncing Shopify orders',
|
|
903
|
+
* status: 'prod',
|
|
904
|
+
* platformUrl: 'https://n8n.client.com/workflow/123',
|
|
905
|
+
* triggers: { workflows: ['order-fulfillment-workflow'] },
|
|
906
|
+
* uses: { integrations: ['integration-shopify-prod'] }
|
|
907
|
+
* }
|
|
908
|
+
*/
|
|
909
|
+
export interface ExternalResourceDefinition extends ResourceDefinition {
|
|
910
|
+
/** Resource type discriminator (narrowed from base union) */
|
|
911
|
+
type: 'external'
|
|
912
|
+
|
|
913
|
+
/** Platform type */
|
|
914
|
+
platform: ExternalPlatform
|
|
915
|
+
|
|
916
|
+
// Optional platform-specific metadata
|
|
917
|
+
/** Link to external platform (e.g., n8n workflow editor URL) */
|
|
918
|
+
platformUrl?: string
|
|
919
|
+
/** Platform's internal ID/reference */
|
|
920
|
+
externalId?: string
|
|
921
|
+
|
|
922
|
+
/** What this external resource triggers (external -> internal) */
|
|
923
|
+
triggers?: {
|
|
924
|
+
/** Elevasis workflow resourceIds this external automation triggers */
|
|
925
|
+
workflows?: string[]
|
|
926
|
+
/** Elevasis agent resourceIds this external automation triggers */
|
|
927
|
+
agents?: string[]
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
/** Integrations this external resource uses (shared credentials) */
|
|
931
|
+
uses?: {
|
|
932
|
+
/** Integration IDs this external automation uses */
|
|
933
|
+
integrations?: string[]
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
// NOTE: triggeredBy field removed - per relationship-consolidation design,
|
|
937
|
+
// all relationships are forward-only declarations. Graph edges are built
|
|
938
|
+
// from forward declarations only.
|
|
774
939
|
}
|
|
775
940
|
```
|
|
776
941
|
|
|
777
942
|
### `HumanCheckpointDefinition`
|
|
778
943
|
|
|
779
944
|
```typescript
|
|
780
|
-
/**
|
|
781
|
-
* Human Checkpoint definition - human decision points in automation
|
|
782
|
-
*
|
|
783
|
-
* Represents where human judgment is deployed in the automation landscape.
|
|
784
|
-
* Tasks with matching command_queue_group are routed to this checkpoint.
|
|
785
|
-
*
|
|
786
|
-
* BREAKING CHANGES (2025-11-30):
|
|
945
|
+
/**
|
|
946
|
+
* Human Checkpoint definition - human decision points in automation
|
|
947
|
+
*
|
|
948
|
+
* Represents where human judgment is deployed in the automation landscape.
|
|
949
|
+
* Tasks with matching command_queue_group are routed to this checkpoint.
|
|
950
|
+
*
|
|
951
|
+
* BREAKING CHANGES (2025-11-30):
|
|
787
952
|
* - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
|
|
788
|
-
* - Field renames: `id` -> `resourceId` (inherited)
|
|
789
|
-
* - description is now REQUIRED (was optional) - organizations must add description to all human checkpoints
|
|
790
|
-
* - New required field: `version` (inherited) - organizations must add version to all human checkpoints
|
|
791
|
-
* - New required field: `type: 'human'` (inherited) - resource type discriminator
|
|
792
|
-
*
|
|
793
|
-
* @example
|
|
794
|
-
* {
|
|
795
|
-
* resourceId: 'sales-approval',
|
|
796
|
-
* type: 'human',
|
|
797
|
-
* name: 'Sales Approval Queue',
|
|
798
|
-
* description: 'High-value order approvals for sales team',
|
|
799
|
-
* version: '1.0.0',
|
|
800
|
-
* status: 'prod',
|
|
801
|
-
* requestedBy: { agents: ['order-processor-agent'] },
|
|
802
|
-
* routesTo: { agents: ['order-fulfillment-agent'] }
|
|
803
|
-
* }
|
|
804
|
-
*/
|
|
805
|
-
export interface HumanCheckpointDefinition extends ResourceDefinition {
|
|
806
|
-
/** Resource type discriminator (narrowed from base union) */
|
|
807
|
-
type: 'human'
|
|
808
|
-
|
|
809
|
-
/** Resources that create tasks for this checkpoint */
|
|
810
|
-
requestedBy?: {
|
|
811
|
-
/** Agent resourceIds that request approval here */
|
|
812
|
-
agents?: string[]
|
|
813
|
-
/** Workflow resourceIds that request approval here */
|
|
814
|
-
workflows?: string[]
|
|
815
|
-
}
|
|
816
|
-
|
|
817
|
-
/** Resources that receive approved decisions */
|
|
818
|
-
routesTo?: {
|
|
819
|
-
/** Agent resourceIds that handle approved tasks */
|
|
820
|
-
agents?: string[]
|
|
821
|
-
/** Workflow resourceIds that handle approved tasks */
|
|
822
|
-
workflows?: string[]
|
|
823
|
-
}
|
|
953
|
+
* - Field renames: `id` -> `resourceId` (inherited)
|
|
954
|
+
* - description is now REQUIRED (was optional) - organizations must add description to all human checkpoints
|
|
955
|
+
* - New required field: `version` (inherited) - organizations must add version to all human checkpoints
|
|
956
|
+
* - New required field: `type: 'human'` (inherited) - resource type discriminator
|
|
957
|
+
*
|
|
958
|
+
* @example
|
|
959
|
+
* {
|
|
960
|
+
* resourceId: 'sales-approval',
|
|
961
|
+
* type: 'human',
|
|
962
|
+
* name: 'Sales Approval Queue',
|
|
963
|
+
* description: 'High-value order approvals for sales team',
|
|
964
|
+
* version: '1.0.0',
|
|
965
|
+
* status: 'prod',
|
|
966
|
+
* requestedBy: { agents: ['order-processor-agent'] },
|
|
967
|
+
* routesTo: { agents: ['order-fulfillment-agent'] }
|
|
968
|
+
* }
|
|
969
|
+
*/
|
|
970
|
+
export interface HumanCheckpointDefinition extends ResourceDefinition {
|
|
971
|
+
/** Resource type discriminator (narrowed from base union) */
|
|
972
|
+
type: 'human'
|
|
973
|
+
|
|
974
|
+
/** Resources that create tasks for this checkpoint */
|
|
975
|
+
requestedBy?: {
|
|
976
|
+
/** Agent resourceIds that request approval here */
|
|
977
|
+
agents?: string[]
|
|
978
|
+
/** Workflow resourceIds that request approval here */
|
|
979
|
+
workflows?: string[]
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
/** Resources that receive approved decisions */
|
|
983
|
+
routesTo?: {
|
|
984
|
+
/** Agent resourceIds that handle approved tasks */
|
|
985
|
+
agents?: string[]
|
|
986
|
+
/** Workflow resourceIds that handle approved tasks */
|
|
987
|
+
workflows?: string[]
|
|
988
|
+
}
|
|
824
989
|
}
|
|
825
990
|
```
|
|
826
991
|
|
|
@@ -838,6 +1003,11 @@ export interface HumanCheckpointDefinition extends ResourceDefinition {
|
|
|
838
1003
|
export interface DeploymentSpec {
|
|
839
1004
|
/** Deployment version (semver) */
|
|
840
1005
|
version: string
|
|
1006
|
+
/** Optional Organization Model governance catalog used for OM-code validation */
|
|
1007
|
+
organizationModel?: {
|
|
1008
|
+
systems?: OrganizationModelSystems
|
|
1009
|
+
resources?: OrganizationModelResources
|
|
1010
|
+
}
|
|
841
1011
|
/** Workflow definitions */
|
|
842
1012
|
workflows?: WorkflowDefinition[]
|
|
843
1013
|
/** Agent definitions */
|
|
@@ -1158,6 +1328,9 @@ export const DealTaskIdParamsSchema = z.object({
|
|
|
1158
1328
|
export const ListDealsQuerySchema = z
|
|
1159
1329
|
.object({
|
|
1160
1330
|
stage: DealStageSchema.optional(),
|
|
1331
|
+
list: UuidSchema.optional(),
|
|
1332
|
+
batch: z.string().trim().min(1).max(255).optional(),
|
|
1333
|
+
staleSince: z.string().datetime().optional(),
|
|
1161
1334
|
search: z.string().optional(),
|
|
1162
1335
|
limit: z.coerce.number().int().positive().default(50),
|
|
1163
1336
|
offset: z.coerce.number().int().min(0).default(0)
|
|
@@ -1303,6 +1476,7 @@ export const DealListItemSchema = z.object({
|
|
|
1303
1476
|
// acq_deals columns
|
|
1304
1477
|
id: z.string(),
|
|
1305
1478
|
organization_id: z.string(),
|
|
1479
|
+
client_id: z.string().nullable().optional(),
|
|
1306
1480
|
contact_id: z.string().nullable(),
|
|
1307
1481
|
contact_email: z.string(),
|
|
1308
1482
|
pipeline_key: z.string(),
|
|
@@ -1351,7 +1525,8 @@ export const DealListResponseSchema = z.object({
|
|
|
1351
1525
|
* Additive fields keep existing DealListItem callers compatible.
|
|
1352
1526
|
*/
|
|
1353
1527
|
export const DealDetailResponseSchema = DealListItemSchema.extend({
|
|
1354
|
-
conversation: DealConversationSchema
|
|
1528
|
+
conversation: DealConversationSchema,
|
|
1529
|
+
lineage: DealLineageSchema.optional()
|
|
1355
1530
|
})
|
|
1356
1531
|
```
|
|
1357
1532
|
|
|
@@ -1440,6 +1615,10 @@ export const DealSchemas = {
|
|
|
1440
1615
|
DealSummaryResponse: DealSummaryResponseSchema,
|
|
1441
1616
|
DealLookupResponse: DealLookupResponseSchema,
|
|
1442
1617
|
ConversationMessage: ConversationMessageSchema,
|
|
1618
|
+
DealLineageListRef: DealLineageListRefSchema,
|
|
1619
|
+
DealLineageProjectRef: DealLineageProjectRefSchema,
|
|
1620
|
+
DealLineageClientRef: DealLineageClientRefSchema,
|
|
1621
|
+
DealLineage: DealLineageSchema,
|
|
1443
1622
|
DealDetailResponse: DealDetailResponseSchema,
|
|
1444
1623
|
DealNoteResponse: DealNoteResponseSchema,
|
|
1445
1624
|
DealNoteListResponse: DealNoteListResponseSchema,
|
|
@@ -2096,6 +2275,7 @@ export const ListContactsQuerySchema = z
|
|
|
2096
2275
|
export const CreateCompanyRequestSchema = z
|
|
2097
2276
|
.object({
|
|
2098
2277
|
name: z.string().trim().min(1).max(255),
|
|
2278
|
+
clientId: UuidSchema.nullable().optional(),
|
|
2099
2279
|
domain: z.string().trim().min(1).max(255).optional(),
|
|
2100
2280
|
linkedinUrl: z.string().trim().url().optional(),
|
|
2101
2281
|
website: z.string().trim().url().optional(),
|
|
@@ -2118,6 +2298,7 @@ export const CreateCompanyRequestSchema = z
|
|
|
2118
2298
|
export const UpdateCompanyRequestSchema = z
|
|
2119
2299
|
.object({
|
|
2120
2300
|
name: z.string().trim().min(1).max(255).optional(),
|
|
2301
|
+
clientId: UuidSchema.nullable().optional(),
|
|
2121
2302
|
domain: z.string().trim().min(1).max(255).optional(),
|
|
2122
2303
|
linkedinUrl: z.string().trim().url().optional(),
|
|
2123
2304
|
website: z.string().trim().url().optional(),
|
|
@@ -2139,6 +2320,7 @@ export const UpdateCompanyRequestSchema = z
|
|
|
2139
2320
|
.refine(
|
|
2140
2321
|
(data) =>
|
|
2141
2322
|
data.name !== undefined ||
|
|
2323
|
+
data.clientId !== undefined ||
|
|
2142
2324
|
data.domain !== undefined ||
|
|
2143
2325
|
data.linkedinUrl !== undefined ||
|
|
2144
2326
|
data.website !== undefined ||
|
|
@@ -2167,6 +2349,7 @@ export const UpdateCompanyRequestSchema = z
|
|
|
2167
2349
|
export const CreateContactRequestSchema = z
|
|
2168
2350
|
.object({
|
|
2169
2351
|
email: z.string().trim().email(),
|
|
2352
|
+
clientId: UuidSchema.nullable().optional(),
|
|
2170
2353
|
companyId: UuidSchema.optional(),
|
|
2171
2354
|
firstName: z.string().trim().min(1).max(255).optional(),
|
|
2172
2355
|
lastName: z.string().trim().min(1).max(255).optional(),
|
|
@@ -2186,6 +2369,7 @@ export const CreateContactRequestSchema = z
|
|
|
2186
2369
|
export const UpdateContactRequestSchema = z
|
|
2187
2370
|
.object({
|
|
2188
2371
|
companyId: UuidSchema.optional(),
|
|
2372
|
+
clientId: UuidSchema.nullable().optional(),
|
|
2189
2373
|
emailValid: AcqEmailValidSchema.optional(),
|
|
2190
2374
|
firstName: z.string().trim().min(1).max(255).optional(),
|
|
2191
2375
|
lastName: z.string().trim().min(1).max(255).optional(),
|
|
@@ -2203,6 +2387,7 @@ export const UpdateContactRequestSchema = z
|
|
|
2203
2387
|
.refine(
|
|
2204
2388
|
(data) =>
|
|
2205
2389
|
data.companyId !== undefined ||
|
|
2390
|
+
data.clientId !== undefined ||
|
|
2206
2391
|
data.emailValid !== undefined ||
|
|
2207
2392
|
data.firstName !== undefined ||
|
|
2208
2393
|
data.lastName !== undefined ||
|
|
@@ -2227,6 +2412,7 @@ export const UpdateContactRequestSchema = z
|
|
|
2227
2412
|
export const AcqCompanyResponseSchema = z.object({
|
|
2228
2413
|
id: z.string(),
|
|
2229
2414
|
organizationId: z.string(),
|
|
2415
|
+
clientId: z.string().nullable().optional(),
|
|
2230
2416
|
name: z.string(),
|
|
2231
2417
|
domain: z.string().nullable(),
|
|
2232
2418
|
linkedinUrl: z.string().nullable(),
|
|
@@ -2293,6 +2479,7 @@ export const AcqContactCompanySummarySchema = z.object({
|
|
|
2293
2479
|
export const AcqContactResponseSchema = z.object({
|
|
2294
2480
|
id: z.string(),
|
|
2295
2481
|
organizationId: z.string(),
|
|
2482
|
+
clientId: z.string().nullable().optional(),
|
|
2296
2483
|
companyId: z.string().nullable(),
|
|
2297
2484
|
email: z.string(),
|
|
2298
2485
|
emailValid: AcqEmailValidSchema.nullable(),
|
|
@@ -2521,6 +2708,8 @@ export const AcqListSchemas = {
|
|
|
2521
2708
|
ListTelemetry: ListTelemetrySchema,
|
|
2522
2709
|
|
|
2523
2710
|
// Requests
|
|
2711
|
+
ListReadQuery: ListReadQuerySchema,
|
|
2712
|
+
GetListQuery: GetListQuerySchema,
|
|
2524
2713
|
CreateListRequest: CreateListRequestSchema,
|
|
2525
2714
|
UpdateListRequest: UpdateListRequestSchema,
|
|
2526
2715
|
UpdateListStatusRequest: UpdateListStatusRequestSchema,
|
|
@@ -2532,7 +2721,11 @@ export const AcqListSchemas = {
|
|
|
2532
2721
|
|
|
2533
2722
|
// Responses
|
|
2534
2723
|
AcqListResponse: AcqListResponseSchema,
|
|
2724
|
+
AcqListDetailResponse: AcqListDetailResponseSchema,
|
|
2535
2725
|
AcqListListResponse: AcqListListResponseSchema,
|
|
2726
|
+
AcqListDealRef: AcqListDealRefSchema,
|
|
2727
|
+
AcqListLineage: AcqListLineageSchema,
|
|
2728
|
+
AcqListStatusResponse: AcqListStatusResponseSchema,
|
|
2536
2729
|
ListTelemetryResponse: ListTelemetryResponseSchema,
|
|
2537
2730
|
ListTelemetryListResponse: ListTelemetryListResponseSchema,
|
|
2538
2731
|
ListExecutionsResponse: ListExecutionsResponseSchema,
|
|
@@ -2552,9 +2745,14 @@ export const AcqSubstrateSchemas = {
|
|
|
2552
2745
|
|
|
2553
2746
|
// List members
|
|
2554
2747
|
ListMembersQuery: ListMembersQuerySchema,
|
|
2748
|
+
ListRecordsQuery: ListRecordsQuerySchema,
|
|
2555
2749
|
MemberIdParams: MemberIdParamsSchema,
|
|
2556
2750
|
AcqListMemberResponse: AcqListMemberResponseSchema,
|
|
2557
2751
|
AcqListMembersResponse: AcqListMembersResponseSchema,
|
|
2752
|
+
AcqListCompanyRecordRow: AcqListCompanyRecordRowSchema,
|
|
2753
|
+
AcqListContactRecordRow: AcqListContactRecordRowSchema,
|
|
2754
|
+
ListRecordRow: ListRecordRowSchema,
|
|
2755
|
+
ListRecordsResponse: ListRecordsResponseSchema,
|
|
2558
2756
|
|
|
2559
2757
|
// List companies
|
|
2560
2758
|
ListCompanyIdParams: ListCompanyIdParamsSchema,
|
|
@@ -2712,7 +2910,7 @@ export const ACQ_LIST_COMPANIES_LEAD_GEN_PIPELINE: StatefulPipelineDefinition =
|
|
|
2712
2910
|
{
|
|
2713
2911
|
stageKey: 'outreach',
|
|
2714
2912
|
label: 'Outreach',
|
|
2715
|
-
states: [PENDING_STATE]
|
|
2913
|
+
states: [PENDING_STATE, { stateKey: 'uploaded', label: 'Uploaded' }]
|
|
2716
2914
|
},
|
|
2717
2915
|
{
|
|
2718
2916
|
stageKey: 'prospecting',
|
|
@@ -3358,8 +3556,8 @@ export const OrgKnowledgeNodeSchema = z.object({
|
|
|
3358
3556
|
skills: z.array(KnowledgeSkillBindingSchema).optional(),
|
|
3359
3557
|
/** Domain key used to derive fast graph->skill registries. */
|
|
3360
3558
|
domain: KnowledgeDomainBindingSchema.optional(),
|
|
3361
|
-
/**
|
|
3362
|
-
ownerIds: z.array(
|
|
3559
|
+
/** Role identifiers that own this knowledge node. */
|
|
3560
|
+
ownerIds: z.array(RoleIdSchema).default([]),
|
|
3363
3561
|
/** ISO date string (YYYY-MM-DD or full ISO 8601) of last meaningful update. */
|
|
3364
3562
|
updatedAt: z.string().trim().min(1).max(50)
|
|
3365
3563
|
})
|