@elevasis/sdk 1.10.0 → 1.12.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 (40) hide show
  1. package/dist/cli.cjs +52 -149
  2. package/dist/index.d.ts +468 -198
  3. package/dist/index.js +225 -147
  4. package/dist/test-utils/index.d.ts +272 -99
  5. package/dist/test-utils/index.js +4756 -125
  6. package/dist/types/worker/adapters/llm.d.ts +1 -1
  7. package/dist/worker/index.js +14 -6
  8. package/package.json +2 -2
  9. package/reference/claude-config/rules/agent-start-here.md +14 -14
  10. package/reference/claude-config/skills/configure/SKILL.md +3 -3
  11. package/reference/claude-config/skills/setup/SKILL.md +6 -6
  12. package/reference/claude-config/sync-notes/2026-04-25-auth-role-system-and-settings-roles.md +55 -0
  13. package/reference/claude-config/sync-notes/2026-04-27-crm-hitl-action-layer-cutover.md +101 -0
  14. package/reference/cli.mdx +57 -0
  15. package/reference/deployment/provided-features.mdx +40 -267
  16. package/reference/examples/organization-model.ts +99 -564
  17. package/reference/packages/core/src/organization-model/README.md +102 -97
  18. package/reference/resources/types.mdx +72 -163
  19. package/reference/scaffold/core/organization-graph.mdx +92 -272
  20. package/reference/scaffold/core/organization-model.mdx +155 -320
  21. package/reference/scaffold/index.mdx +3 -0
  22. package/reference/scaffold/operations/propagation-pipeline.md +4 -1
  23. package/reference/scaffold/operations/scaffold-maintenance.md +3 -0
  24. package/reference/scaffold/operations/workflow-recipes.md +13 -10
  25. package/reference/scaffold/recipes/add-a-feature.md +105 -158
  26. package/reference/scaffold/recipes/add-a-resource.md +88 -158
  27. package/reference/scaffold/recipes/customize-organization-model.md +144 -400
  28. package/reference/scaffold/recipes/extend-a-base-entity.md +11 -8
  29. package/reference/scaffold/recipes/gate-by-feature-or-admin.md +117 -158
  30. package/reference/scaffold/recipes/index.md +3 -0
  31. package/reference/scaffold/reference/contracts.md +107 -435
  32. package/reference/scaffold/reference/feature-registry.md +11 -8
  33. package/reference/scaffold/reference/glossary.md +74 -105
  34. package/reference/scaffold/ui/composition-extensibility.mdx +3 -0
  35. package/reference/scaffold/ui/customization.md +3 -0
  36. package/reference/scaffold/ui/feature-flags-and-gating.md +29 -231
  37. package/reference/scaffold/ui/feature-shell.mdx +53 -219
  38. package/reference/scaffold/ui/recipes.md +65 -397
  39. package/reference/claude-config/logs/pre-edit-vibe-gate.log +0 -40
  40. package/reference/claude-config/logs/scaffold-registry-reminder.log +0 -38
@@ -1,3 +1,6 @@
1
+ <!-- @generated by packages/sdk/scripts/copy-reference-docs.mjs -- DO NOT EDIT -->
2
+ <!-- Regenerate: pnpm scaffold:sync -->
3
+
1
4
  <!-- @generated by scripts/monorepo/generate-scaffold-contracts.js — DO NOT EDIT -->
2
5
  <!-- Regenerate: pnpm scaffold:sync -->
3
6
  ---
@@ -45,22 +48,28 @@ export type OrganizationModelProjects = z.infer<typeof OrganizationModelProjects
45
48
  export type OrganizationModelFeature = z.infer<typeof FeatureSchema>
46
49
  ```
47
50
 
48
- ### `OrganizationModelNavigation`
51
+ ### `NodeIdPath`
49
52
 
50
53
  ```typescript
51
- export type OrganizationModelNavigation = z.infer<typeof OrganizationModelNavigationSchema>
54
+ export type NodeIdPath = z.infer<typeof NodeIdPathSchema>
52
55
  ```
53
56
 
54
- ### `OrganizationModelSurface`
57
+ ### `NodeIdString`
55
58
 
56
59
  ```typescript
57
- export type OrganizationModelSurface = z.infer<typeof SurfaceDefinitionSchema>
60
+ export type NodeIdString = z.infer<typeof NodeIdStringSchema>
61
+ ```
62
+
63
+ ### `OrganizationModelNavigation`
64
+
65
+ ```typescript
66
+ export type OrganizationModelNavigation = z.infer<typeof OrganizationModelNavigationSchema>
58
67
  ```
59
68
 
60
- ### `OrganizationModelResourceMapping`
69
+ ### `OrganizationModelSurface`
61
70
 
62
71
  ```typescript
63
- export type OrganizationModelResourceMapping = z.infer<typeof ResourceMappingSchema>
72
+ export type OrganizationModelSurface = z.infer<typeof SurfaceDefinitionSchema>
64
73
  ```
65
74
 
66
75
  ### `OrganizationModelTechStackEntry`
@@ -174,69 +183,47 @@ export type OrganizationModelKeyResult = z.infer<typeof KeyResultSchema>
174
183
  ### `DeepPartial`
175
184
 
176
185
  ```typescript
177
- export type DeepPartial<T> = T extends Array<infer U> ? Array<DeepPartial<U>> : T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T
186
+ export type DeepPartial<T> =
187
+ T extends Array<infer U> ? Array<DeepPartial<U>> : T extends object ? { [K in keyof T]?: DeepPartial<T[K]> } : T
178
188
  ```
179
189
 
180
190
  ## Feature System
181
191
 
182
- ### `FeatureNavLink`
192
+ ### `FeatureSidebarComponent`
183
193
 
184
194
  ```typescript
185
- export interface FeatureNavLink {
186
- label: string
187
- link: string
188
- featureKey?: string
189
- onClick?: () => void
190
- links?: FeatureNavLink[]
191
- }
195
+ export type FeatureSidebarComponent = ComponentType
192
196
  ```
193
197
 
194
- ### `FeatureNavEntry`
198
+ ### `FeatureIconComponent`
195
199
 
196
200
  ```typescript
197
- export interface FeatureNavEntry {
198
- label: string
199
- icon: ComponentType
200
- link?: string
201
- featureKey?: string
202
- requiresAdmin?: boolean
203
- dataOnboardingTourId?: string
204
- links?: FeatureNavLink[]
205
- }
201
+ export type FeatureIconComponent = ComponentType<{ size?: number; stroke?: number }>
206
202
  ```
207
203
 
208
- ### `FeatureSidebarComponent`
204
+ ### `FeatureSidebarWidthResolver`
209
205
 
210
206
  ```typescript
211
- export type FeatureSidebarComponent = ComponentType
207
+ export type FeatureSidebarWidthResolver = number | ((context: { currentPath: string }) => number)
212
208
  ```
213
209
 
214
210
  ### `FeatureModule`
215
211
 
216
212
  ```typescript
217
213
  export interface FeatureModule {
218
- /** Unique stable identifier for this feature (e.g. `'crm'`, `'projects'`). */
214
+ /** Unique stable identifier for this feature module. */
219
215
  key: string
220
- /** Feature ID used for access-flag gating — must match the `id` of a feature in the organization model. */
216
+ /** Organization Model feature id this module presents. */
221
217
  featureId: string
222
- /**
223
- * Capability identifiers contributed by this feature.
224
- * Merged into `ResolvedFeatureSemantics.capabilityIds` at resolution time.
225
- * Not queried at runtime — kept for semantic graph completeness so that
226
- * capability membership is fully represented in the resolved model even when
227
- * a surface does not declare it directly.
228
- */
218
+ /** Capability identifiers contributed by this feature module. */
229
219
  capabilityIds?: string[]
230
- /** Top-level navigation entry rendered in the app shell when this feature is enabled. */
231
- navEntry?: FeatureNavEntry
232
- /** Sidebar component rendered when a matching subshell route is active. */
220
+ /** Icon used when this feature node appears in shell navigation. */
221
+ icon?: FeatureIconComponent
222
+ /** Sidebar component rendered when this feature's subtree route is active. */
233
223
  sidebar?: FeatureSidebarComponent
234
- /** Route path prefixes that activate this feature's sidebar and subshell context. */
235
- subshellRoutes?: string[]
236
- /**
237
- * Operations-only bridge surface connecting this feature to the organization graph.
238
- * Ignored by all other features. Only one manifest in the registry should set this.
239
- */
224
+ /** Optional shell sidebar width override. Defaults to 250px. */
225
+ sidebarWidth?: FeatureSidebarWidthResolver
226
+ /** Operations-only bridge connecting this feature to the organization graph node. */
240
227
  organizationGraph?: OrganizationGraphFeatureBridge
241
228
  }
242
229
  ```
@@ -255,8 +242,6 @@ export interface ResolvedFeatureAccess {
255
242
  ```typescript
256
243
  export interface ResolvedFeatureSemantics {
257
244
  capabilityIds: string[]
258
- surfaceIds: string[]
259
- surfaces: OrganizationModelSurface[]
260
245
  }
261
246
  ```
262
247
 
@@ -269,25 +254,11 @@ export interface ResolvedFeatureModule extends FeatureModule {
269
254
  }
270
255
  ```
271
256
 
272
- ### `ShellNavPlacement`
273
-
274
- ```typescript
275
- export type ShellNavPlacement = 'primary' | 'bottom'
276
- ```
277
-
278
- ### `ShellNavSource`
279
-
280
- ```typescript
281
- export type ShellNavSource = 'app' | 'feature'
282
- ```
283
-
284
- ### `ResolvedShellNavItem`
257
+ ### `ResolvedShellFeature`
285
258
 
286
259
  ```typescript
287
- export interface ResolvedShellNavItem extends FeatureNavEntry {
288
- placement: ShellNavPlacement
289
- source: ShellNavSource
290
- featureId?: string
260
+ export interface ResolvedShellFeature extends OrganizationModelFeature {
261
+ iconComponent?: FeatureIconComponent
291
262
  }
292
263
  ```
293
264
 
@@ -295,16 +266,16 @@ export interface ResolvedShellNavItem extends FeatureNavEntry {
295
266
 
296
267
  ```typescript
297
268
  export interface ResolvedShellModel {
298
- navItems: ResolvedShellNavItem[]
299
- }
300
- ```
301
-
302
- ### `AppShellOverrides`
303
-
304
- ```typescript
305
- export interface AppShellOverrides {
306
- primaryNavItems?: FeatureNavEntry[]
307
- bottomNavItems?: FeatureNavEntry[]
269
+ features: readonly ResolvedShellFeature[]
270
+ findByPath: (path: string) => ResolvedShellFeature | undefined
271
+ findById: (id: string) => ResolvedShellFeature | undefined
272
+ childrenOf: (id: string) => ResolvedShellFeature[]
273
+ ancestorsOf: (id: string) => ResolvedShellFeature[]
274
+ parentOf: (id: string) => ResolvedShellFeature | undefined
275
+ topLevel: () => ResolvedShellFeature[]
276
+ uiPositionFor: (id: string) => OrganizationModelFeature['uiPosition'] | undefined
277
+ requiresAdminFor: (id: string) => boolean
278
+ devOnlyFor: (id: string) => boolean
308
279
  }
309
280
  ```
310
281
 
@@ -321,8 +292,7 @@ export interface ResolvedShellRouteMatch {
321
292
  status: ShellRouteMatchStatus
322
293
  path: string
323
294
  feature?: ResolvedFeatureModule
324
- navItem?: ResolvedShellNavItem
325
- navLink?: FeatureNavLink
295
+ node?: ResolvedShellFeature
326
296
  }
327
297
  ```
328
298
 
@@ -338,7 +308,7 @@ export interface ShellRuntime {
338
308
 
339
309
  ```typescript
340
310
  export interface OrganizationGraphFeatureBridge {
341
- surfaceId: string
311
+ featureId: string
342
312
  }
343
313
  ```
344
314
 
@@ -347,10 +317,8 @@ export interface OrganizationGraphFeatureBridge {
347
317
  ```typescript
348
318
  export interface OrganizationGraphContextValue {
349
319
  available: boolean
350
- surfaceId?: string
351
- surfacePath?: string
352
- surfaceType?: OrganizationModelSurface['surfaceType']
353
320
  featureId?: string
321
+ featurePath?: string
354
322
  }
355
323
  ```
356
324
 
@@ -360,7 +328,6 @@ export interface OrganizationGraphContextValue {
360
328
  export interface ElevasisFeaturesProviderProps {
361
329
  features: FeatureModule[]
362
330
  organizationModel?: OrganizationModel
363
- appShellOverrides?: AppShellOverrides
364
331
  timeRange?: TimeRange
365
332
  operationsApiUrl?: string
366
333
  operationsSSEManager?: SSEConnectionManagerLike
@@ -397,26 +364,10 @@ export interface ElevasisFeaturesContextValue {
397
364
  ### `ResourceStatus`
398
365
 
399
366
  ```typescript
400
- /**
401
- * Resource Registry type definitions
402
- */
403
-
404
- import type { IntegrationType } from '../../execution/engine/tools/integration'
405
- import type { ResourceDomain } from './domains'
406
-
407
- // ============================================================================
408
- // Core Resource Type Definitions
409
- // ============================================================================
410
-
411
367
  /**
412
368
  * Environment/deployment status for resources
413
- */
414
- export type ResourceStatus = 'dev' | 'prod'
415
-
416
- /**
417
- * All resource types in the platform
418
- * Used as the discriminator field in ResourceDefinition
419
- */
369
+ */
370
+ export type ResourceStatus = 'dev' | 'prod'
420
371
  ```
421
372
 
422
373
  ### `ResourceType`
@@ -425,13 +376,8 @@ export type ResourceStatus = 'dev' | 'prod'
425
376
  /**
426
377
  * All resource types in the platform
427
378
  * Used as the discriminator field in ResourceDefinition
428
- */
429
- export type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human'
430
-
431
- /**
432
- * Executable resource types (subset of ResourceType)
433
- * These resources can be directly executed by the execution engine
434
- */
379
+ */
380
+ export type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human'
435
381
  ```
436
382
 
437
383
  ### `ExecutableResourceType`
@@ -440,17 +386,8 @@ export type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'e
440
386
  /**
441
387
  * Executable resource types (subset of ResourceType)
442
388
  * These resources can be directly executed by the execution engine
443
- */
444
- export type ExecutableResourceType = 'workflow' | 'agent'
445
-
446
- // ============================================================================
447
- // Base Resource Interface
448
- // ============================================================================
449
-
450
- /**
451
- * Base interface for ALL platform resources
452
- * Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
453
- */
389
+ */
390
+ export type ExecutableResourceType = 'workflow' | 'agent'
454
391
  ```
455
392
 
456
393
  ### `ResourceDefinition`
@@ -459,7 +396,7 @@ export type ExecutableResourceType = 'workflow' | 'agent'
459
396
  /**
460
397
  * Base interface for ALL platform resources
461
398
  * Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
462
- */
399
+ */
463
400
  export interface ResourceDefinition {
464
401
  /** Unique resource identifier */
465
402
  resourceId: string
@@ -479,43 +416,11 @@ export interface ResourceDefinition {
479
416
  /** Environment/deployment status */
480
417
  status: ResourceStatus
481
418
 
482
- /** Domain tags for filtering and organization */
483
- domains?: ResourceDomain[]
484
-
485
- /** Whether the agent supports multi-turn sessions (agents only) */
486
- sessionCapable?: boolean
487
-
488
- /** Whether the resource is local (monorepo) or remote (externally deployed) */
489
- origin?: 'local' | 'remote'
490
-
491
- /** Whether this resource is archived and should be excluded from registration and deployment */
492
- archived?: boolean
493
- }
494
- ```
495
-
496
- ### `DomainDefinition`
419
+ /** Graph links to Organization Model nodes */
420
+ links?: ResourceLink[]
497
421
 
498
- ```typescript
499
- /** Unique resource identifier */
500
- resourceId: string
501
-
502
- /** Display name */
503
- name: string
504
-
505
- /** Purpose and functionality description */
506
- description: string
507
-
508
- /** Version for change tracking and evolution */
509
- version: string
510
-
511
- /** Resource type discriminator */
512
- type: ResourceType
513
-
514
- /** Environment/deployment status */
515
- status: ResourceStatus
516
-
517
- /** Domain tags for filtering and organization */
518
- domains?: ResourceDomain[]
422
+ /** Infrastructure category for filtering */
423
+ category?: ResourceCategory
519
424
 
520
425
  /** Whether the agent supports multi-turn sessions (agents only) */
521
426
  sessionCapable?: boolean
@@ -525,60 +430,16 @@ export interface ResourceDefinition {
525
430
 
526
431
  /** Whether this resource is archived and should be excluded from registration and deployment */
527
432
  archived?: boolean
528
- }
529
-
530
- // ============================================================================
531
- // Domain Definition Types
532
- // ============================================================================
533
-
534
- /**
535
- * Domain definition for Command View filtering
536
- *
537
- * Domains are organizational metadata for UI filtering/grouping.
538
- * No execution impact - purely for visualization.
539
- *
540
- * @example
541
- * {
542
- * id: 'support',
543
- * name: 'Customer Support',
544
- * description: 'Ticket triage, knowledge base, escalations',
545
- * color: 'green',
546
- * icon: 'IconHeadset'
547
- * }
548
- */
549
- export interface DomainDefinition {
550
- /** Unique identifier (e.g., 'support') */
551
- id: string
552
- /** Display name (e.g., 'Customer Support') */
553
- name: string
554
- /** Purpose description */
555
- description: string
556
- /** Optional Mantine color for UI (e.g., 'blue', 'green', 'orange') */
557
- color?: string
558
- /** Optional Tabler icon name (e.g., 'IconHeadset') */
559
- icon?: string
560
433
  }
561
434
  ```
562
435
 
563
436
  ### `ResourceList`
564
437
 
565
438
  ```typescript
566
- /** Unique identifier (e.g., 'support') */
567
- id: string
568
- /** Display name (e.g., 'Customer Support') */
569
- name: string
570
- /** Purpose description */
571
- description: string
572
- /** Optional Mantine color for UI (e.g., 'blue', 'green', 'orange') */
573
- color?: string
574
- /** Optional Tabler icon name (e.g., 'IconHeadset') */
575
- icon?: string
576
- }
577
-
578
- /**
579
- * Resource list for organization
580
- * Returns ResourceDefinition metadata (not full definitions)
581
- */
439
+ /**
440
+ * Resource list for organization
441
+ * Returns ResourceDefinition metadata (not full definitions)
442
+ */
582
443
  export interface ResourceList {
583
444
  workflows: ResourceDefinition[]
584
445
  agents: ResourceDefinition[]
@@ -591,16 +452,14 @@ export interface ResourceList {
591
452
  ### `WebhookProviderType`
592
453
 
593
454
  ```typescript
594
- /** Webhook provider identifiers */
595
- export type WebhookProviderType = 'cal-com' | 'stripe' | 'signature-api' | 'instantly' | 'apify' | 'test'
596
-
597
- /** Webhook trigger configuration */
455
+ /** Webhook provider identifiers */
456
+ export type WebhookProviderType = 'cal-com' | 'stripe' | 'signature-api' | 'instantly' | 'apify' | 'test'
598
457
  ```
599
458
 
600
459
  ### `WebhookTriggerConfig`
601
460
 
602
461
  ```typescript
603
- /** Webhook trigger configuration */
462
+ /** Webhook trigger configuration */
604
463
  export interface WebhookTriggerConfig {
605
464
  /** Provider identifier */
606
465
  provider: WebhookProviderType
@@ -616,17 +475,7 @@ export interface WebhookTriggerConfig {
616
475
  ### `ScheduleTriggerConfig`
617
476
 
618
477
  ```typescript
619
- /** Provider identifier */
620
- provider: WebhookProviderType
621
- /** Event type for documentation (not used for matching - workflow handles routing) */
622
- event?: string
623
- /** Optional filtering (e.g., specific form ID for Fillout) */
624
- filter?: Record<string, string>
625
- /** References credential in credentials table for per-org webhook secrets */
626
- credentialName?: string
627
- }
628
-
629
- /** Schedule trigger configuration */
478
+ /** Schedule trigger configuration */
630
479
  export interface ScheduleTriggerConfig {
631
480
  /** Cron expression (e.g., '0 6 * * *') */
632
481
  cron: string
@@ -638,13 +487,7 @@ export interface ScheduleTriggerConfig {
638
487
  ### `EventTriggerConfig`
639
488
 
640
489
  ```typescript
641
- /** Cron expression (e.g., '0 6 * * *') */
642
- cron: string
643
- /** Optional timezone (default: UTC) */
644
- timezone?: string
645
- }
646
-
647
- /** Event trigger configuration */
490
+ /** Event trigger configuration */
648
491
  export interface EventTriggerConfig {
649
492
  /** Internal event type */
650
493
  eventType: string
@@ -656,50 +499,8 @@ export interface EventTriggerConfig {
656
499
  ### `TriggerConfig`
657
500
 
658
501
  ```typescript
659
- /** Internal event type */
660
- eventType: string
661
- /** Event source */
662
- source?: string
663
- }
664
-
665
- /** Union of all trigger configs */
666
- export type TriggerConfig = WebhookTriggerConfig | ScheduleTriggerConfig | EventTriggerConfig
667
-
668
- // ============================================================================
669
- // Trigger Definition
670
- // ============================================================================
671
-
672
- /**
673
- * Trigger metadata - entry points that initiate resource execution
674
- *
675
- * Triggers represent how executions start: webhooks from external services,
676
- * scheduled cron jobs, platform events, or manual user actions.
677
- *
678
- * BREAKING CHANGES (2025-11-30):
679
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
680
- * - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
681
- * - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
682
- * - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
683
- * - triggers object now includes `externalResources` option
684
- *
685
- * @example
686
- * // TriggerDefinition - metadata only
687
- * {
688
- * resourceId: 'trigger-new-order',
689
- * type: 'trigger',
690
- * triggerType: 'webhook',
691
- * name: 'New Order',
692
- * description: 'Webhook from Shopify on new orders',
693
- * version: '1.0.0',
694
- * status: 'prod',
695
- * webhookPath: '/webhooks/shopify/orders'
696
- * }
697
- *
698
- * // Relationships declared in ResourceRelationships (not on TriggerDefinition):
699
- * // relationships: {
700
- * // 'trigger-new-order': { triggers: { workflows: ['order-fulfillment-workflow'] } }
701
- * // }
702
- */
502
+ /** Union of all trigger configs */
503
+ export type TriggerConfig = WebhookTriggerConfig | ScheduleTriggerConfig | EventTriggerConfig
703
504
  ```
704
505
 
705
506
  ### `TriggerDefinition`
@@ -712,7 +513,7 @@ export type TriggerConfig = WebhookTriggerConfig | ScheduleTriggerConfig | Event
712
513
  * scheduled cron jobs, platform events, or manual user actions.
713
514
  *
714
515
  * BREAKING CHANGES (2025-11-30):
715
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
516
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
716
517
  * - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
717
518
  * - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
718
519
  * - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
@@ -735,7 +536,7 @@ export type TriggerConfig = WebhookTriggerConfig | ScheduleTriggerConfig | Event
735
536
  * // relationships: {
736
537
  * // 'trigger-new-order': { triggers: { workflows: ['order-fulfillment-workflow'] } }
737
538
  * // }
738
- */
539
+ */
739
540
  export interface TriggerDefinition extends ResourceDefinition {
740
541
  /** Resource type discriminator (narrowed from base union) */
741
542
  type: 'trigger'
@@ -762,27 +563,6 @@ export interface TriggerDefinition extends ResourceDefinition {
762
563
  ### `IntegrationDefinition`
763
564
 
764
565
  ```typescript
765
- /** Resource type discriminator (narrowed from base union) */
766
- type: 'trigger'
767
-
768
- /** Trigger mechanism type (renamed from 'type' to avoid collision with base type discriminator) */
769
- triggerType: 'webhook' | 'schedule' | 'manual' | 'event'
770
-
771
- /** Type-specific configuration */
772
- config?: TriggerConfig
773
-
774
- // Legacy fields (deprecated, use config instead)
775
- /** For webhook triggers: path like '/webhooks/shopify/orders' */
776
- webhookPath?: string
777
- /** For schedule triggers: cron expression like '0 6 * * *' */
778
- schedule?: string
779
- /** For event triggers: event type like 'low-stock-alert' */
780
- eventType?: string
781
-
782
- // NOTE: What this trigger starts is declared in ResourceRelationships, not here
783
- // This prevents duplication - triggers are forward-declared in relationships
784
- }
785
-
786
566
  /**
787
567
  * Integration metadata - external service connections
788
568
  *
@@ -790,7 +570,7 @@ export interface TriggerDefinition extends ResourceDefinition {
790
570
  * stored here (queried at runtime from credentials table).
791
571
  *
792
572
  * BREAKING CHANGES (2025-11-30):
793
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
573
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
794
574
  * - Field renames: `id` -> `resourceId` (inherited)
795
575
  * - New required field: `status` (inherited) - organizations must add status to all integrations
796
576
  * - New required field: `version` (inherited) - organizations must add version to all integrations
@@ -807,7 +587,7 @@ export interface TriggerDefinition extends ResourceDefinition {
807
587
  * version: '1.0.0',
808
588
  * status: 'prod'
809
589
  * }
810
- */
590
+ */
811
591
  export interface IntegrationDefinition extends ResourceDefinition {
812
592
  /** Resource type discriminator (narrowed from base union) */
813
593
  type: 'integration'
@@ -822,15 +602,6 @@ export interface IntegrationDefinition extends ResourceDefinition {
822
602
  ### `RelationshipDeclaration`
823
603
 
824
604
  ```typescript
825
- /** Resource type discriminator (narrowed from base union) */
826
- type: 'integration'
827
-
828
- /** Integration provider type */
829
- provider: IntegrationType
830
- /** References credentials table (e.g., 'shopify-prod', 'zendesk-api') */
831
- credentialName: string
832
- }
833
-
834
605
  /**
835
606
  * Explicit resource relationship declaration
836
607
  *
@@ -842,7 +613,7 @@ export interface IntegrationDefinition extends ResourceDefinition {
842
613
  * triggers: { workflows: ['order-fulfillment-workflow'] },
843
614
  * uses: { integrations: ['integration-shopify-prod', 'integration-postgres'] }
844
615
  * }
845
- */
616
+ */
846
617
  export interface RelationshipDeclaration {
847
618
  /** Resources this resource triggers */
848
619
  triggers?: {
@@ -862,20 +633,6 @@ export interface RelationshipDeclaration {
862
633
  ### `ResourceRelationships`
863
634
 
864
635
  ```typescript
865
- /** Resources this resource triggers */
866
- triggers?: {
867
- /** Agent resourceIds this resource triggers */
868
- agents?: string[]
869
- /** Workflow resourceIds this resource triggers */
870
- workflows?: string[]
871
- }
872
- /** Integrations this resource uses */
873
- uses?: {
874
- /** Integration IDs this resource uses */
875
- integrations?: string[]
876
- }
877
- }
878
-
879
636
  /**
880
637
  * Resource relationships map
881
638
  * Maps resourceId to its relationship declarations
@@ -887,17 +644,8 @@ export interface RelationshipDeclaration {
887
644
  * uses: { integrations: ['integration-shopify-prod'] }
888
645
  * }
889
646
  * }
890
- */
891
- export type ResourceRelationships = Record<string, RelationshipDeclaration>
892
-
893
- // ============================================================================
894
- // External Resource Types
895
- // ============================================================================
896
-
897
- /**
898
- * External platform type
899
- * Supported third-party automation platforms
900
- */
647
+ */
648
+ export type ResourceRelationships = Record<string, RelationshipDeclaration>
901
649
  ```
902
650
 
903
651
  ### `ExternalPlatform`
@@ -906,39 +654,8 @@ export type ResourceRelationships = Record<string, RelationshipDeclaration>
906
654
  /**
907
655
  * External platform type
908
656
  * Supported third-party automation platforms
909
- */
910
- export type ExternalPlatform = 'n8n' | 'make' | 'zapier' | 'other'
911
-
912
- /**
913
- * External automation resource metadata
914
- *
915
- * Represents workflows/automations running on third-party platforms
916
- * (n8n, Make, Zapier, etc.) for visualization in Command View.
917
- *
918
- * NOTE: This is metadata ONLY for visualization. No execution logic,
919
- * no API integration with external platforms, no status syncing.
920
- *
921
- * BREAKING CHANGES (2025-11-30):
922
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
923
- * - Field renames: `id` -> `resourceId` (inherited)
924
- * - New required field: `version` (inherited) - organizations must add version to all external resources
925
- * - New required field: `type: 'external'` (inherited) - resource type discriminator
926
- * - REMOVED FIELD: `triggeredBy` - per relationship-consolidation design, all relationships are forward-only declarations
927
- *
928
- * @example
929
- * {
930
- * resourceId: 'external-n8n-order-sync',
931
- * type: 'external',
932
- * version: '1.0.0',
933
- * platform: 'n8n',
934
- * name: 'Shopify Order Sync',
935
- * description: 'Legacy n8n workflow for syncing Shopify orders',
936
- * status: 'prod',
937
- * platformUrl: 'https://n8n.client.com/workflow/123',
938
- * triggers: { workflows: ['order-fulfillment-workflow'] },
939
- * uses: { integrations: ['integration-shopify-prod'] }
940
- * }
941
- */
657
+ */
658
+ export type ExternalPlatform = 'n8n' | 'make' | 'zapier' | 'other'
942
659
  ```
943
660
 
944
661
  ### `ExternalResourceDefinition`
@@ -954,7 +671,7 @@ export type ExternalPlatform = 'n8n' | 'make' | 'zapier' | 'other'
954
671
  * no API integration with external platforms, no status syncing.
955
672
  *
956
673
  * BREAKING CHANGES (2025-11-30):
957
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
674
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
958
675
  * - Field renames: `id` -> `resourceId` (inherited)
959
676
  * - New required field: `version` (inherited) - organizations must add version to all external resources
960
677
  * - New required field: `type: 'external'` (inherited) - resource type discriminator
@@ -973,7 +690,7 @@ export type ExternalPlatform = 'n8n' | 'make' | 'zapier' | 'other'
973
690
  * triggers: { workflows: ['order-fulfillment-workflow'] },
974
691
  * uses: { integrations: ['integration-shopify-prod'] }
975
692
  * }
976
- */
693
+ */
977
694
  export interface ExternalResourceDefinition extends ResourceDefinition {
978
695
  /** Resource type discriminator (narrowed from base union) */
979
696
  type: 'external'
@@ -1010,37 +727,6 @@ export interface ExternalResourceDefinition extends ResourceDefinition {
1010
727
  ### `HumanCheckpointDefinition`
1011
728
 
1012
729
  ```typescript
1013
- /** Resource type discriminator (narrowed from base union) */
1014
- type: 'external'
1015
-
1016
- /** Platform type */
1017
- platform: ExternalPlatform
1018
-
1019
- // Optional platform-specific metadata
1020
- /** Link to external platform (e.g., n8n workflow editor URL) */
1021
- platformUrl?: string
1022
- /** Platform's internal ID/reference */
1023
- externalId?: string
1024
-
1025
- /** What this external resource triggers (external -> internal) */
1026
- triggers?: {
1027
- /** Elevasis workflow resourceIds this external automation triggers */
1028
- workflows?: string[]
1029
- /** Elevasis agent resourceIds this external automation triggers */
1030
- agents?: string[]
1031
- }
1032
-
1033
- /** Integrations this external resource uses (shared credentials) */
1034
- uses?: {
1035
- /** Integration IDs this external automation uses */
1036
- integrations?: string[]
1037
- }
1038
-
1039
- // NOTE: triggeredBy field removed - per relationship-consolidation design,
1040
- // all relationships are forward-only declarations. Graph edges are built
1041
- // from forward declarations only.
1042
- }
1043
-
1044
730
  /**
1045
731
  * Human Checkpoint definition - human decision points in automation
1046
732
  *
@@ -1048,7 +734,7 @@ export interface ExternalResourceDefinition extends ResourceDefinition {
1048
734
  * Tasks with matching command_queue_group are routed to this checkpoint.
1049
735
  *
1050
736
  * BREAKING CHANGES (2025-11-30):
1051
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, domains)
737
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
1052
738
  * - Field renames: `id` -> `resourceId` (inherited)
1053
739
  * - description is now REQUIRED (was optional) - organizations must add description to all human checkpoints
1054
740
  * - New required field: `version` (inherited) - organizations must add version to all human checkpoints
@@ -1065,7 +751,7 @@ export interface ExternalResourceDefinition extends ResourceDefinition {
1065
751
  * requestedBy: { agents: ['order-processor-agent'] },
1066
752
  * routesTo: { agents: ['order-fulfillment-agent'] }
1067
753
  * }
1068
- */
754
+ */
1069
755
  export interface HumanCheckpointDefinition extends ResourceDefinition {
1070
756
  /** Resource type discriminator (narrowed from base union) */
1071
757
  type: 'human'
@@ -1093,44 +779,30 @@ export interface HumanCheckpointDefinition extends ResourceDefinition {
1093
779
  ### `DeploymentSpec`
1094
780
 
1095
781
  ```typescript
1096
- /** Supabase Storage path: "{orgId}/{deploymentId}/bundle.js" */
1097
- storagePath: string
1098
- /** Deployment record ID */
1099
- deploymentId: string
1100
- /** OS temp path to bundle -- set after first download, used by worker threads */
1101
- cachedTempPath?: string
1102
- /** Platform tool name -> credential name mapping */
1103
- toolCredentials?: Record<string, string>
1104
- /** SDK version used to deploy this bundle */
1105
- sdkVersion?: string
1106
- /** Deployment version (semver) of the deployed bundle */
1107
- deploymentVersion?: string
1108
- }
1109
-
1110
- /**
1111
- * Organization-specific resource collection
1112
- *
1113
- * Complete manifest of all automation resources for an organization.
1114
- * Used by ResourceRegistry for discovery and Command View for visualization.
782
+ /**
783
+ * Organization-specific resource collection
784
+ *
785
+ * Complete manifest of all automation resources for an organization.
786
+ * Used by ResourceRegistry for discovery and Command View for visualization.
1115
787
  */
1116
- export interface DeploymentSpec {
1117
- /** Deployment version (semver) */
1118
- version: string
1119
- /** Workflow definitions */
1120
- workflows?: WorkflowDefinition[]
1121
- /** Agent definitions */
1122
- agents?: AgentDefinition[]
1123
-
1124
- // Resource Manifest fields (optional for backwards compatibility)
1125
- /** Trigger definitions - entry points that initiate executions */
1126
- triggers?: TriggerDefinition[]
1127
- /** Integration definitions - external service connections */
1128
- integrations?: IntegrationDefinition[]
1129
- /** Explicit relationship declarations between resources */
1130
- relationships?: ResourceRelationships
1131
- /** External automation resources (n8n, Make, Zapier, etc.) */
1132
- externalResources?: ExternalResourceDefinition[]
1133
- /** Human checkpoint definitions - human decision points in automation */
1134
- humanCheckpoints?: HumanCheckpointDefinition[]
788
+ export interface DeploymentSpec {
789
+ /** Deployment version (semver) */
790
+ version: string
791
+ /** Workflow definitions */
792
+ workflows?: WorkflowDefinition[]
793
+ /** Agent definitions */
794
+ agents?: AgentDefinition[]
795
+
796
+ // Resource Manifest fields (optional for backwards compatibility)
797
+ /** Trigger definitions - entry points that initiate executions */
798
+ triggers?: TriggerDefinition[]
799
+ /** Integration definitions - external service connections */
800
+ integrations?: IntegrationDefinition[]
801
+ /** Explicit relationship declarations between resources */
802
+ relationships?: ResourceRelationships
803
+ /** External automation resources (n8n, Make, Zapier, etc.) */
804
+ externalResources?: ExternalResourceDefinition[]
805
+ /** Human checkpoint definitions - human decision points in automation */
806
+ humanCheckpoints?: HumanCheckpointDefinition[]
1135
807
  }
1136
808
  ```