@elevasis/core 0.37.0 → 0.39.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.
@@ -973,29 +973,29 @@ export interface ElevasisSystemsContextValue {
973
973
  ### `ResourceStatus`
974
974
 
975
975
  ```typescript
976
- /**
977
- * Environment/deployment status for resources
978
- */
976
+ /**
977
+ * Environment/deployment status for resources
978
+ */
979
979
  export type ResourceStatus = 'dev' | 'prod'
980
980
  ```
981
981
 
982
982
  ### `ResourceType`
983
983
 
984
984
  ```typescript
985
- /**
986
- * All resource types in the platform
987
- * Used as the discriminator field in ResourceDefinition
988
- */
985
+ /**
986
+ * All resource types in the platform
987
+ * Used as the discriminator field in ResourceDefinition
988
+ */
989
989
  export type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human'
990
990
  ```
991
991
 
992
992
  ### `ExecutableResourceType`
993
993
 
994
994
  ```typescript
995
- /**
996
- * Executable resource types (subset of ResourceType)
997
- * These resources can be directly executed by the execution engine
998
- */
995
+ /**
996
+ * Executable resource types (subset of ResourceType)
997
+ * These resources can be directly executed by the execution engine
998
+ */
999
999
  export type ExecutableResourceType = 'workflow' | 'agent'
1000
1000
  ```
1001
1001
 
@@ -1008,52 +1008,52 @@ export type ResourceSystemSummary = Pick<SystemEntry, 'id' | 'title' | 'descript
1008
1008
  ### `ResourceDefinition`
1009
1009
 
1010
1010
  ```typescript
1011
- /**
1012
- * Base interface for ALL platform resources
1013
- * Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
1014
- */
1015
- export interface ResourceDefinition {
1016
- /** Unique resource identifier */
1017
- resourceId: string
1018
-
1019
- /** Display name */
1020
- name: string
1021
-
1022
- /** Purpose and functionality description */
1023
- description: string
1024
-
1025
- /** Version for change tracking and evolution */
1026
- version: string
1027
-
1028
- /** Resource type discriminator */
1029
- type: ResourceType
1030
-
1031
- /** Environment/deployment status */
1032
- status: ResourceStatus
1033
-
1034
- /** Graph links to Organization Model nodes */
1035
- links?: ResourceLink[]
1036
-
1037
- /** Infrastructure category for filtering */
1038
- category?: ResourceCategory
1039
-
1040
- /** Whether the agent supports multi-turn sessions (agents only) */
1041
- sessionCapable?: boolean
1042
-
1043
- /** Whether the resource is local (monorepo) or remote (externally deployed) */
1044
- origin?: 'local' | 'remote'
1045
-
1046
- /** OM System membership — dot-separated system path (e.g. "sys.lead-gen"), when backed by a Resource descriptor */
1047
- systemPath?: string
1048
-
1049
- /** Display metadata for the owning OM System */
1050
- system?: ResourceSystemSummary
1051
-
1052
- /** Governance lifecycle status from the OM Resource descriptor */
1053
- governanceStatus?: ResourceGovernanceStatus
1054
-
1055
- /** Whether this resource is archived and should be excluded from registration and deployment */
1056
- archived?: boolean
1011
+ /**
1012
+ * Base interface for ALL platform resources
1013
+ * Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
1014
+ */
1015
+ export interface ResourceDefinition {
1016
+ /** Unique resource identifier */
1017
+ resourceId: string
1018
+
1019
+ /** Display name */
1020
+ name: string
1021
+
1022
+ /** Purpose and functionality description */
1023
+ description: string
1024
+
1025
+ /** Version for change tracking and evolution */
1026
+ version: string
1027
+
1028
+ /** Resource type discriminator */
1029
+ type: ResourceType
1030
+
1031
+ /** Environment/deployment status */
1032
+ status: ResourceStatus
1033
+
1034
+ /** Graph links to Organization Model nodes */
1035
+ links?: ResourceLink[]
1036
+
1037
+ /** Infrastructure category for filtering */
1038
+ category?: ResourceCategory
1039
+
1040
+ /** Whether the agent supports multi-turn sessions (agents only) */
1041
+ sessionCapable?: boolean
1042
+
1043
+ /** Whether the resource is local (monorepo) or remote (externally deployed) */
1044
+ origin?: 'local' | 'remote'
1045
+
1046
+ /** OM System membership — dot-separated system path (e.g. "sys.lead-gen"), when backed by a Resource descriptor */
1047
+ systemPath?: string
1048
+
1049
+ /** Display metadata for the owning OM System */
1050
+ system?: ResourceSystemSummary
1051
+
1052
+ /** Governance lifecycle status from the OM Resource descriptor */
1053
+ governanceStatus?: ResourceGovernanceStatus
1054
+
1055
+ /** Whether this resource is archived and should be excluded from registration and deployment */
1056
+ archived?: boolean
1057
1057
  }
1058
1058
  ```
1059
1059
 
@@ -1066,371 +1066,389 @@ export type RuntimeResourceDescriptor = Extract<ResourceEntry, { kind: 'workflow
1066
1066
  ### `DescriptorBackedResourceDefinition`
1067
1067
 
1068
1068
  ```typescript
1069
- export type DescriptorBackedResourceDefinition<
1070
- TResource extends RuntimeResourceDescriptor = RuntimeResourceDescriptor
1071
- > = Omit<ResourceDefinition, 'resourceId' | 'type'> & {
1072
- /** OM descriptor that owns canonical identity and governance metadata. */
1073
- resource: TResource
1074
- resourceId?: never
1075
- type?: never
1069
+ export type DescriptorBackedResourceDefinition<
1070
+ TResource extends RuntimeResourceDescriptor = RuntimeResourceDescriptor
1071
+ > = Omit<ResourceDefinition, 'resourceId' | 'type'> & {
1072
+ /** OM descriptor that owns canonical identity and governance metadata. */
1073
+ resource: TResource
1074
+ resourceId?: never
1075
+ type?: never
1076
1076
  }
1077
1077
  ```
1078
1078
 
1079
1079
  ### `BoundResourceDefinition`
1080
1080
 
1081
1081
  ```typescript
1082
- export type BoundResourceDefinition<TResource extends RuntimeResourceDescriptor = RuntimeResourceDescriptor> = Omit<
1083
- DescriptorBackedResourceDefinition<TResource>,
1084
- 'resource'
1085
- > &
1086
- ResourceDefinition & {
1087
- resource: TResource
1088
- resourceId: TResource['id']
1089
- type: TResource['kind']
1082
+ export type BoundResourceDefinition<TResource extends RuntimeResourceDescriptor = RuntimeResourceDescriptor> = Omit<
1083
+ DescriptorBackedResourceDefinition<TResource>,
1084
+ 'resource'
1085
+ > &
1086
+ ResourceDefinition & {
1087
+ resource: TResource
1088
+ resourceId: TResource['id']
1089
+ type: TResource['kind']
1090
1090
  }
1091
1091
  ```
1092
1092
 
1093
1093
  ### `ResourceList`
1094
1094
 
1095
1095
  ```typescript
1096
- /**
1097
- * Resource list for organization
1098
- * Returns ResourceDefinition metadata (not full definitions)
1099
- */
1100
- export interface ResourceList {
1101
- workflows: ResourceDefinition[]
1102
- agents: ResourceDefinition[]
1103
- total: number
1104
- organizationName: string
1105
- environment?: 'dev' | 'prod'
1096
+ /**
1097
+ * Resource list for organization
1098
+ * Returns ResourceDefinition metadata (not full definitions)
1099
+ */
1100
+ export interface ResourceList {
1101
+ workflows: ResourceDefinition[]
1102
+ agents: ResourceDefinition[]
1103
+ total: number
1104
+ organizationName: string
1105
+ environment?: 'dev' | 'prod'
1106
1106
  }
1107
1107
  ```
1108
1108
 
1109
1109
  ### `WebhookProviderType`
1110
1110
 
1111
1111
  ```typescript
1112
- /** Webhook provider identifiers */
1112
+ /** Webhook provider identifiers */
1113
1113
  export type WebhookProviderType = 'cal-com' | 'stripe' | 'signature-api' | 'instantly' | 'apify' | 'test'
1114
1114
  ```
1115
1115
 
1116
1116
  ### `WebhookTriggerConfig`
1117
1117
 
1118
1118
  ```typescript
1119
- /** Webhook trigger configuration */
1120
- export interface WebhookTriggerConfig {
1121
- /** Provider identifier */
1122
- provider: WebhookProviderType
1123
- /** Event type for documentation (not used for matching - workflow handles routing) */
1124
- event?: string
1125
- /** Optional filtering (e.g., specific form ID for Fillout) */
1126
- filter?: Record<string, string>
1127
- /** References credential in credentials table for per-org webhook secrets */
1128
- credentialName?: string
1119
+ /** Webhook trigger configuration */
1120
+ export interface WebhookTriggerConfig {
1121
+ /** Provider identifier */
1122
+ provider: WebhookProviderType
1123
+ /** Event type for documentation (not used for matching - workflow handles routing) */
1124
+ event?: string
1125
+ /** Optional filtering (e.g., specific form ID for Fillout) */
1126
+ filter?: Record<string, string>
1127
+ /** References credential in credentials table for per-org webhook secrets */
1128
+ credentialName?: string
1129
1129
  }
1130
1130
  ```
1131
1131
 
1132
1132
  ### `ScheduleTriggerConfig`
1133
1133
 
1134
1134
  ```typescript
1135
- /** Schedule trigger configuration */
1136
- export interface ScheduleTriggerConfig {
1137
- /** Cron expression (e.g., '0 6 * * *') */
1138
- cron: string
1139
- /** Optional timezone (default: UTC) */
1140
- timezone?: string
1135
+ /** Schedule trigger configuration */
1136
+ export interface ScheduleTriggerConfig {
1137
+ /** Cron expression (e.g., '0 6 * * *') */
1138
+ cron: string
1139
+ /** Optional timezone (default: UTC) */
1140
+ timezone?: string
1141
1141
  }
1142
1142
  ```
1143
1143
 
1144
1144
  ### `EventTriggerConfig`
1145
1145
 
1146
1146
  ```typescript
1147
- /** Event trigger configuration */
1148
- export interface EventTriggerConfig {
1149
- /** Internal event type */
1150
- eventType: string
1151
- /** Event source */
1152
- source?: string
1147
+ /** Event trigger configuration */
1148
+ export interface EventTriggerConfig {
1149
+ /** Internal event type */
1150
+ eventType: string
1151
+ /** Event source */
1152
+ source?: string
1153
1153
  }
1154
1154
  ```
1155
1155
 
1156
1156
  ### `TriggerConfig`
1157
1157
 
1158
1158
  ```typescript
1159
- /** Union of all trigger configs */
1159
+ /** Union of all trigger configs */
1160
1160
  export type TriggerConfig = WebhookTriggerConfig | ScheduleTriggerConfig | EventTriggerConfig
1161
1161
  ```
1162
1162
 
1163
1163
  ### `TriggerDefinition`
1164
1164
 
1165
1165
  ```typescript
1166
- /**
1167
- * Trigger metadata - entry points that initiate resource execution
1168
- *
1169
- * Triggers represent how executions start: webhooks from external services,
1170
- * scheduled cron jobs, platform events, or manual user actions.
1171
- *
1172
- * BREAKING CHANGES (2025-11-30):
1173
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
1174
- * - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
1175
- * - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
1176
- * - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
1177
- * - triggers object now includes `externalResources` option
1178
- *
1179
- * @example
1180
- * // TriggerDefinition - metadata only
1181
- * {
1182
- * resourceId: 'trigger-new-order',
1183
- * type: 'trigger',
1184
- * triggerType: 'webhook',
1185
- * name: 'New Order',
1186
- * description: 'Webhook from Shopify on new orders',
1187
- * version: '1.0.0',
1188
- * status: 'prod',
1189
- * webhookPath: '/webhooks/shopify/orders'
1190
- * }
1191
- *
1192
- * // Relationships declared in ResourceRelationships (not on TriggerDefinition):
1193
- * // relationships: {
1194
- * // 'trigger-new-order': { triggers: { workflows: ['order-fulfillment-workflow'] } }
1195
- * // }
1196
- */
1197
- export interface TriggerDefinition extends ResourceDefinition {
1198
- /** Resource type discriminator (narrowed from base union) */
1199
- type: 'trigger'
1200
-
1201
- /** Trigger mechanism type (renamed from 'type' to avoid collision with base type discriminator) */
1202
- triggerType: 'webhook' | 'schedule' | 'manual' | 'event'
1203
-
1204
- /** Type-specific configuration */
1205
- config?: TriggerConfig
1206
-
1207
- // Legacy fields (deprecated, use config instead)
1208
- /** For webhook triggers: path like '/webhooks/shopify/orders' */
1209
- webhookPath?: string
1210
- /** For schedule triggers: cron expression like '0 6 * * *' */
1211
- schedule?: string
1212
- /** For event triggers: event type like 'low-stock-alert' */
1213
- eventType?: string
1214
-
1215
- // NOTE: What this trigger starts is declared in ResourceRelationships, not here
1216
- // This prevents duplication - triggers are forward-declared in relationships
1166
+ /**
1167
+ * Trigger metadata - entry points that initiate resource execution
1168
+ *
1169
+ * Triggers represent how executions start: webhooks from external services,
1170
+ * scheduled cron jobs, platform events, or manual user actions.
1171
+ *
1172
+ * BREAKING CHANGES (2025-11-30):
1173
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
1174
+ * - Field renames: `id` -> `resourceId` (inherited), `type` -> `triggerType`
1175
+ * - Relationship rename: `invokes` -> `triggers` (unified vocabulary)
1176
+ * - New required fields: `version` (inherited), `type: 'trigger'` (inherited)
1177
+ * - triggers object now includes `externalResources` option
1178
+ *
1179
+ * @example
1180
+ * // TriggerDefinition - metadata only
1181
+ * {
1182
+ * resourceId: 'trigger-new-order',
1183
+ * type: 'trigger',
1184
+ * triggerType: 'webhook',
1185
+ * name: 'New Order',
1186
+ * description: 'Webhook from Shopify on new orders',
1187
+ * version: '1.0.0',
1188
+ * status: 'prod',
1189
+ * webhookPath: '/webhooks/shopify/orders'
1190
+ * }
1191
+ *
1192
+ * // Relationships declared in ResourceRelationships (not on TriggerDefinition):
1193
+ * // relationships: {
1194
+ * // 'trigger-new-order': { triggers: { workflows: ['order-fulfillment-workflow'] } }
1195
+ * // }
1196
+ */
1197
+ export interface TriggerDefinition extends ResourceDefinition {
1198
+ /** Resource type discriminator (narrowed from base union) */
1199
+ type: 'trigger'
1200
+
1201
+ /** Trigger mechanism type (renamed from 'type' to avoid collision with base type discriminator) */
1202
+ triggerType: 'webhook' | 'schedule' | 'manual' | 'event'
1203
+
1204
+ /** Type-specific configuration */
1205
+ config?: TriggerConfig
1206
+
1207
+ // Legacy fields (deprecated, use config instead)
1208
+ /** For webhook triggers: path like '/webhooks/shopify/orders' */
1209
+ webhookPath?: string
1210
+ /** For schedule triggers: cron expression like '0 6 * * *' */
1211
+ schedule?: string
1212
+ /** For event triggers: event type like 'low-stock-alert' */
1213
+ eventType?: string
1214
+
1215
+ // NOTE: What this trigger starts is declared in ResourceRelationships, not here
1216
+ // This prevents duplication - triggers are forward-declared in relationships
1217
1217
  }
1218
1218
  ```
1219
1219
 
1220
1220
  ### `IntegrationDefinition`
1221
1221
 
1222
1222
  ```typescript
1223
- /**
1224
- * Integration metadata - external service connections
1225
- *
1226
- * References credentials table for actual connection. No connection status
1227
- * stored here (queried at runtime from credentials table).
1228
- *
1229
- * BREAKING CHANGES (2025-11-30):
1230
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
1231
- * - Field renames: `id` -> `resourceId` (inherited)
1232
- * - New required field: `status` (inherited) - organizations must add status to all integrations
1233
- * - New required field: `version` (inherited) - organizations must add version to all integrations
1234
- * - New required field: `type: 'integration'` (inherited) - resource type discriminator
1235
- *
1236
- * @example
1237
- * {
1238
- * resourceId: 'integration-shopify-prod',
1239
- * type: 'integration',
1240
- * provider: 'shopify',
1241
- * credentialName: 'shopify-prod',
1242
- * name: 'Shopify Production',
1243
- * description: 'E-commerce platform',
1244
- * version: '1.0.0',
1245
- * status: 'prod'
1246
- * }
1247
- */
1248
- export interface IntegrationDefinition extends ResourceDefinition {
1249
- /** Resource type discriminator (narrowed from base union) */
1250
- type: 'integration'
1251
-
1252
- /** OM descriptor that owns canonical identity and governance metadata. */
1253
- resource?: Extract<ResourceEntry, { kind: 'integration' }>
1254
-
1255
- /** Integration provider type */
1256
- provider: IntegrationType
1257
- /** References credentials table (e.g., 'shopify-prod', 'zendesk-api') */
1258
- credentialName: string
1223
+ /**
1224
+ * Integration metadata - external service connections
1225
+ *
1226
+ * References credentials table for actual connection. No connection status
1227
+ * stored here (queried at runtime from credentials table).
1228
+ *
1229
+ * BREAKING CHANGES (2025-11-30):
1230
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
1231
+ * - Field renames: `id` -> `resourceId` (inherited)
1232
+ * - New required field: `status` (inherited) - organizations must add status to all integrations
1233
+ * - New required field: `version` (inherited) - organizations must add version to all integrations
1234
+ * - New required field: `type: 'integration'` (inherited) - resource type discriminator
1235
+ *
1236
+ * @example
1237
+ * {
1238
+ * resourceId: 'integration-shopify-prod',
1239
+ * type: 'integration',
1240
+ * provider: 'shopify',
1241
+ * credentialName: 'shopify-prod',
1242
+ * name: 'Shopify Production',
1243
+ * description: 'E-commerce platform',
1244
+ * version: '1.0.0',
1245
+ * status: 'prod'
1246
+ * }
1247
+ */
1248
+ export interface IntegrationDefinition extends ResourceDefinition {
1249
+ /** Resource type discriminator (narrowed from base union) */
1250
+ type: 'integration'
1251
+
1252
+ /** OM descriptor that owns canonical identity and governance metadata. */
1253
+ resource?: Extract<ResourceEntry, { kind: 'integration' }>
1254
+
1255
+ /** Integration provider type */
1256
+ provider: IntegrationType
1257
+ /** References credentials table (e.g., 'shopify-prod', 'zendesk-api') */
1258
+ credentialName: string
1259
1259
  }
1260
1260
  ```
1261
1261
 
1262
1262
  ### `RelationshipDeclaration`
1263
1263
 
1264
1264
  ```typescript
1265
- /**
1266
- * Explicit resource relationship declaration
1267
- *
1268
- * Single-direction only - Command View derives reverse relationships.
1269
- * Agents/workflows declare what they trigger and use.
1270
- *
1271
- * @example
1272
- * {
1273
- * triggers: { workflows: ['order-fulfillment-workflow'] },
1274
- * uses: { integrations: ['integration-shopify-prod', 'integration-postgres'] }
1275
- * }
1276
- */
1277
- export interface RelationshipDeclaration {
1278
- /** Resources this resource triggers */
1279
- triggers?: {
1280
- /** Agent resourceIds this resource triggers */
1281
- agents?: string[]
1282
- /** Workflow resourceIds this resource triggers */
1283
- workflows?: string[]
1284
- }
1285
- /** Integrations this resource uses */
1286
- uses?: {
1287
- /** Integration IDs this resource uses */
1288
- integrations?: string[]
1289
- }
1265
+ /**
1266
+ * Explicit resource relationship declaration
1267
+ *
1268
+ * Single-direction only - Command View derives reverse relationships.
1269
+ * Agents/workflows declare what they trigger and use.
1270
+ *
1271
+ * @example
1272
+ * {
1273
+ * triggers: { workflows: ['order-fulfillment-workflow'] },
1274
+ * uses: { integrations: ['integration-shopify-prod', 'integration-postgres'] }
1275
+ * }
1276
+ */
1277
+ export interface RelationshipDeclaration {
1278
+ /** Resources this resource triggers */
1279
+ triggers?: {
1280
+ /** Agent resourceIds this resource triggers */
1281
+ agents?: string[]
1282
+ /** Workflow resourceIds this resource triggers */
1283
+ workflows?: string[]
1284
+ }
1285
+ /** Integrations this resource uses */
1286
+ uses?: {
1287
+ /** Integration IDs this resource uses */
1288
+ integrations?: string[]
1289
+ }
1290
1290
  }
1291
1291
  ```
1292
1292
 
1293
1293
  ### `ResourceRelationships`
1294
1294
 
1295
1295
  ```typescript
1296
- /**
1297
- * Resource relationships map
1298
- * Maps resourceId to its relationship declarations
1299
- *
1300
- * @example
1301
- * {
1302
- * 'order-processor-agent': {
1303
- * triggers: { workflows: ['order-fulfillment-workflow'] },
1304
- * uses: { integrations: ['integration-shopify-prod'] }
1305
- * }
1306
- * }
1307
- */
1296
+ /**
1297
+ * Resource relationships map
1298
+ * Maps resourceId to its relationship declarations
1299
+ *
1300
+ * @example
1301
+ * {
1302
+ * 'order-processor-agent': {
1303
+ * triggers: { workflows: ['order-fulfillment-workflow'] },
1304
+ * uses: { integrations: ['integration-shopify-prod'] }
1305
+ * }
1306
+ * }
1307
+ */
1308
1308
  export type ResourceRelationships = Record<string, RelationshipDeclaration>
1309
1309
  ```
1310
1310
 
1311
1311
  ### `ExternalPlatform`
1312
1312
 
1313
1313
  ```typescript
1314
- /**
1315
- * External platform type
1316
- * Supported third-party automation platforms
1317
- */
1314
+ /**
1315
+ * External platform type
1316
+ * Supported third-party automation platforms
1317
+ */
1318
1318
  export type ExternalPlatform = 'n8n' | 'make' | 'zapier' | 'other'
1319
1319
  ```
1320
1320
 
1321
1321
  ### `ExternalResourceDefinition`
1322
1322
 
1323
1323
  ```typescript
1324
- /**
1325
- * External automation resource metadata
1326
- *
1327
- * Represents workflows/automations running on third-party platforms
1328
- * (n8n, Make, Zapier, etc.) for visualization in Command View.
1329
- *
1330
- * NOTE: This is metadata ONLY for visualization. No execution logic,
1331
- * no API integration with external platforms, no status syncing.
1332
- *
1333
- * BREAKING CHANGES (2025-11-30):
1334
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
1335
- * - Field renames: `id` -> `resourceId` (inherited)
1336
- * - New required field: `version` (inherited) - organizations must add version to all external resources
1337
- * - New required field: `type: 'external'` (inherited) - resource type discriminator
1338
- * - REMOVED FIELD: `triggeredBy` - per relationship-consolidation design, all relationships are forward-only declarations
1339
- *
1340
- * @example
1341
- * {
1342
- * resourceId: 'external-n8n-order-sync',
1343
- * type: 'external',
1344
- * version: '1.0.0',
1345
- * platform: 'n8n',
1346
- * name: 'Shopify Order Sync',
1347
- * description: 'Legacy n8n workflow for syncing Shopify orders',
1348
- * status: 'prod',
1349
- * platformUrl: 'https://n8n.client.com/workflow/123',
1350
- * triggers: { workflows: ['order-fulfillment-workflow'] },
1351
- * uses: { integrations: ['integration-shopify-prod'] }
1352
- * }
1353
- */
1354
- export interface ExternalResourceDefinition extends ResourceDefinition {
1355
- /** Resource type discriminator (narrowed from base union) */
1356
- type: 'external'
1357
-
1358
- /** Platform type */
1359
- platform: ExternalPlatform
1360
-
1361
- // Optional platform-specific metadata
1362
- /** Link to external platform (e.g., n8n workflow editor URL) */
1363
- platformUrl?: string
1364
- /** Platform's internal ID/reference */
1365
- externalId?: string
1366
-
1367
- /** What this external resource triggers (external -> internal) */
1368
- triggers?: {
1369
- /** Elevasis workflow resourceIds this external automation triggers */
1370
- workflows?: string[]
1371
- /** Elevasis agent resourceIds this external automation triggers */
1372
- agents?: string[]
1373
- }
1374
-
1375
- /** Integrations this external resource uses (shared credentials) */
1376
- uses?: {
1377
- /** Integration IDs this external automation uses */
1378
- integrations?: string[]
1379
- }
1380
-
1381
- // NOTE: triggeredBy field removed - per relationship-consolidation design,
1382
- // all relationships are forward-only declarations. Graph edges are built
1383
- // from forward declarations only.
1324
+ /**
1325
+ * External automation resource metadata
1326
+ *
1327
+ * Represents workflows/automations running on third-party platforms
1328
+ * (n8n, Make, Zapier, etc.) for visualization in Command View.
1329
+ *
1330
+ * NOTE: This is metadata ONLY for visualization. No execution logic,
1331
+ * no API integration with external platforms, no status syncing.
1332
+ *
1333
+ * BREAKING CHANGES (2025-11-30):
1334
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
1335
+ * - Field renames: `id` -> `resourceId` (inherited)
1336
+ * - New required field: `version` (inherited) - organizations must add version to all external resources
1337
+ * - New required field: `type: 'external'` (inherited) - resource type discriminator
1338
+ * - REMOVED FIELD: `triggeredBy` - per relationship-consolidation design, all relationships are forward-only declarations
1339
+ *
1340
+ * @example
1341
+ * {
1342
+ * resourceId: 'external-n8n-order-sync',
1343
+ * type: 'external',
1344
+ * version: '1.0.0',
1345
+ * platform: 'n8n',
1346
+ * name: 'Shopify Order Sync',
1347
+ * description: 'Legacy n8n workflow for syncing Shopify orders',
1348
+ * status: 'prod',
1349
+ * platformUrl: 'https://n8n.client.com/workflow/123',
1350
+ * triggers: { workflows: ['order-fulfillment-workflow'] },
1351
+ * uses: { integrations: ['integration-shopify-prod'] }
1352
+ * }
1353
+ */
1354
+ export interface ExternalResourceDefinition extends ResourceDefinition {
1355
+ /** Resource type discriminator (narrowed from base union) */
1356
+ type: 'external'
1357
+
1358
+ /** Platform type */
1359
+ platform: ExternalPlatform
1360
+
1361
+ // Optional platform-specific metadata
1362
+ /** Link to external platform (e.g., n8n workflow editor URL) */
1363
+ platformUrl?: string
1364
+ /** Platform's internal ID/reference */
1365
+ externalId?: string
1366
+
1367
+ /** What this external resource triggers (external -> internal) */
1368
+ triggers?: {
1369
+ /** Elevasis workflow resourceIds this external automation triggers */
1370
+ workflows?: string[]
1371
+ /** Elevasis agent resourceIds this external automation triggers */
1372
+ agents?: string[]
1373
+ }
1374
+
1375
+ /** Integrations this external resource uses (shared credentials) */
1376
+ uses?: {
1377
+ /** Integration IDs this external automation uses */
1378
+ integrations?: string[]
1379
+ }
1380
+
1381
+ // NOTE: triggeredBy field removed - per relationship-consolidation design,
1382
+ // all relationships are forward-only declarations. Graph edges are built
1383
+ // from forward declarations only.
1384
+ }
1385
+ ```
1386
+
1387
+ ### `ApiInterfaceConformanceGap`
1388
+
1389
+ ```typescript
1390
+ /**
1391
+ * Describes a system that has API-backed resources but lacks an `apiInterface`
1392
+ * declaration. Used by `detectMissingApiInterfaceDeclarations` as the return
1393
+ * payload that drives both CLI warnings and scaffold fill-mode input.
1394
+ */
1395
+ export interface ApiInterfaceConformanceGap {
1396
+ /** Dot-separated system path (e.g. "sales.lead-gen"). */
1397
+ systemPath: string
1398
+ /** Resource IDs in this system that have non-empty ontology bindings. */
1399
+ resourceIds: string[]
1400
+ /** Human-readable description of the gap. */
1401
+ message: string
1384
1402
  }
1385
1403
  ```
1386
1404
 
1387
1405
  ### `HumanCheckpointDefinition`
1388
1406
 
1389
1407
  ```typescript
1390
- /**
1391
- * Human Checkpoint definition - human decision points in automation
1392
- *
1393
- * Represents where human judgment is deployed in the automation landscape.
1394
- * Tasks with matching command_queue_group are routed to this checkpoint.
1395
- *
1396
- * BREAKING CHANGES (2025-11-30):
1397
- * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
1398
- * - Field renames: `id` -> `resourceId` (inherited)
1399
- * - description is now REQUIRED (was optional) - organizations must add description to all human checkpoints
1400
- * - New required field: `version` (inherited) - organizations must add version to all human checkpoints
1401
- * - New required field: `type: 'human'` (inherited) - resource type discriminator
1402
- *
1403
- * @example
1404
- * {
1405
- * resourceId: 'sales-approval',
1406
- * type: 'human',
1407
- * name: 'Sales Approval Queue',
1408
- * description: 'High-value order approvals for sales team',
1409
- * version: '1.0.0',
1410
- * status: 'prod',
1411
- * requestedBy: { agents: ['order-processor-agent'] },
1412
- * routesTo: { agents: ['order-fulfillment-agent'] }
1413
- * }
1414
- */
1415
- export interface HumanCheckpointDefinition extends ResourceDefinition {
1416
- /** Resource type discriminator (narrowed from base union) */
1417
- type: 'human'
1418
-
1419
- /** Resources that create tasks for this checkpoint */
1420
- requestedBy?: {
1421
- /** Agent resourceIds that request approval here */
1422
- agents?: string[]
1423
- /** Workflow resourceIds that request approval here */
1424
- workflows?: string[]
1425
- }
1426
-
1427
- /** Resources that receive approved decisions */
1428
- routesTo?: {
1429
- /** Agent resourceIds that handle approved tasks */
1430
- agents?: string[]
1431
- /** Workflow resourceIds that handle approved tasks */
1432
- workflows?: string[]
1433
- }
1408
+ /**
1409
+ * Human Checkpoint definition - human decision points in automation
1410
+ *
1411
+ * Represents where human judgment is deployed in the automation landscape.
1412
+ * Tasks with matching command_queue_group are routed to this checkpoint.
1413
+ *
1414
+ * BREAKING CHANGES (2025-11-30):
1415
+ * - Now extends ResourceDefinition (inherits: resourceId, name, description, version, type, status, links, category)
1416
+ * - Field renames: `id` -> `resourceId` (inherited)
1417
+ * - description is now REQUIRED (was optional) - organizations must add description to all human checkpoints
1418
+ * - New required field: `version` (inherited) - organizations must add version to all human checkpoints
1419
+ * - New required field: `type: 'human'` (inherited) - resource type discriminator
1420
+ *
1421
+ * @example
1422
+ * {
1423
+ * resourceId: 'sales-approval',
1424
+ * type: 'human',
1425
+ * name: 'Sales Approval Queue',
1426
+ * description: 'High-value order approvals for sales team',
1427
+ * version: '1.0.0',
1428
+ * status: 'prod',
1429
+ * requestedBy: { agents: ['order-processor-agent'] },
1430
+ * routesTo: { agents: ['order-fulfillment-agent'] }
1431
+ * }
1432
+ */
1433
+ export interface HumanCheckpointDefinition extends ResourceDefinition {
1434
+ /** Resource type discriminator (narrowed from base union) */
1435
+ type: 'human'
1436
+
1437
+ /** Resources that create tasks for this checkpoint */
1438
+ requestedBy?: {
1439
+ /** Agent resourceIds that request approval here */
1440
+ agents?: string[]
1441
+ /** Workflow resourceIds that request approval here */
1442
+ workflows?: string[]
1443
+ }
1444
+
1445
+ /** Resources that receive approved decisions */
1446
+ routesTo?: {
1447
+ /** Agent resourceIds that handle approved tasks */
1448
+ agents?: string[]
1449
+ /** Workflow resourceIds that handle approved tasks */
1450
+ workflows?: string[]
1451
+ }
1434
1452
  }
1435
1453
  ```
1436
1454