@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.
Files changed (56) hide show
  1. package/dist/cli.cjs +1712 -72
  2. package/dist/index.d.ts +659 -5
  3. package/dist/index.js +565 -42
  4. package/dist/node/index.d.ts +1 -0
  5. package/dist/node/index.js +213 -2
  6. package/dist/test-utils/index.d.ts +459 -4
  7. package/dist/test-utils/index.js +509 -37
  8. package/dist/worker/index.js +365 -37
  9. package/package.json +4 -4
  10. package/reference/_navigation.md +2 -1
  11. package/reference/_reference-manifest.json +14 -0
  12. package/reference/claude-config/rules/agent-start-here.md +5 -5
  13. package/reference/claude-config/rules/deployment.md +4 -3
  14. package/reference/claude-config/rules/frontend.md +2 -2
  15. package/reference/claude-config/rules/operations.md +17 -13
  16. package/reference/claude-config/rules/organization-model.md +7 -5
  17. package/reference/claude-config/rules/organization-os.md +13 -11
  18. package/reference/claude-config/rules/ui.md +3 -3
  19. package/reference/claude-config/rules/vibe.md +4 -4
  20. package/reference/claude-config/skills/explore/SKILL.md +4 -4
  21. package/reference/claude-config/skills/knowledge/SKILL.md +8 -8
  22. package/reference/claude-config/skills/knowledge/operations/codify-level-a.md +7 -7
  23. package/reference/claude-config/skills/knowledge/operations/codify-level-b.md +13 -13
  24. package/reference/claude-config/skills/knowledge/operations/customers.md +1 -1
  25. package/reference/claude-config/skills/knowledge/operations/goals.md +1 -1
  26. package/reference/claude-config/skills/knowledge/operations/identity.md +1 -1
  27. package/reference/claude-config/skills/knowledge/operations/offerings.md +1 -1
  28. package/reference/claude-config/skills/knowledge/operations/roles.md +1 -1
  29. package/reference/claude-config/skills/knowledge/operations/techStack.md +19 -91
  30. package/reference/claude-config/skills/project/SKILL.md +73 -13
  31. package/reference/claude-config/skills/save/SKILL.md +5 -5
  32. package/reference/claude-config/skills/tutorial/technical.md +5 -6
  33. package/reference/claude-config/sync-notes/2026-05-07-sdk-changes-release-train.md +34 -0
  34. package/reference/claude-config/sync-notes/2026-05-08-resource-governance-scaffold-guidance.md +38 -0
  35. package/reference/claude-config/sync-notes/2026-05-09-clients-domain.md +32 -0
  36. package/reference/claude-config/sync-notes/2026-05-09-command-system.md +33 -0
  37. package/reference/claude-config/sync-notes/2026-05-09-resource-governance-and-misc.md +69 -0
  38. package/reference/examples/organization-model.ts +17 -5
  39. package/reference/framework/index.mdx +1 -1
  40. package/reference/framework/project-structure.mdx +10 -8
  41. package/reference/packages/core/src/business/README.md +2 -2
  42. package/reference/packages/core/src/organization-model/README.md +10 -3
  43. package/reference/resources/index.mdx +27 -17
  44. package/reference/scaffold/core/organization-model.mdx +33 -14
  45. package/reference/scaffold/operations/workflow-recipes.md +35 -29
  46. package/reference/scaffold/recipes/add-a-feature.md +18 -3
  47. package/reference/scaffold/recipes/add-a-resource.md +50 -10
  48. package/reference/scaffold/recipes/customize-crm-actions.md +12 -6
  49. package/reference/scaffold/recipes/customize-organization-model.md +18 -3
  50. package/reference/scaffold/recipes/extend-crm.md +17 -19
  51. package/reference/scaffold/recipes/extend-lead-gen.md +31 -31
  52. package/reference/scaffold/recipes/index.md +1 -1
  53. package/reference/scaffold/reference/contracts.md +501 -303
  54. package/reference/scaffold/reference/feature-registry.md +1 -1
  55. package/reference/scaffold/reference/glossary.md +8 -3
  56. package/reference/scaffold/ui/recipes.md +21 -6
@@ -335,6 +335,131 @@ interface ModelConfig {
335
335
  modelOptions?: ModelSpecificOptions;
336
336
  }
337
337
 
338
+ declare const ResourceGovernanceStatusSchema: z.ZodEnum<{
339
+ active: "active";
340
+ deprecated: "deprecated";
341
+ archived: "archived";
342
+ }>;
343
+ declare const WorkflowResourceEntrySchema: z.ZodObject<{
344
+ id: z.ZodString;
345
+ systemId: z.ZodString;
346
+ ownerRoleId: z.ZodOptional<z.ZodString>;
347
+ status: z.ZodEnum<{
348
+ active: "active";
349
+ deprecated: "deprecated";
350
+ archived: "archived";
351
+ }>;
352
+ kind: z.ZodLiteral<"workflow">;
353
+ capabilityKey: z.ZodOptional<z.ZodString>;
354
+ }, z.core.$strip>;
355
+ declare const AgentResourceEntrySchema: z.ZodObject<{
356
+ id: z.ZodString;
357
+ systemId: z.ZodString;
358
+ ownerRoleId: z.ZodOptional<z.ZodString>;
359
+ status: z.ZodEnum<{
360
+ active: "active";
361
+ deprecated: "deprecated";
362
+ archived: "archived";
363
+ }>;
364
+ kind: z.ZodLiteral<"agent">;
365
+ agentKind: z.ZodEnum<{
366
+ orchestrator: "orchestrator";
367
+ specialist: "specialist";
368
+ utility: "utility";
369
+ system: "system";
370
+ }>;
371
+ actsAsRoleId: z.ZodOptional<z.ZodString>;
372
+ sessionCapable: z.ZodBoolean;
373
+ }, z.core.$strip>;
374
+ declare const ResourceEntrySchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
375
+ id: z.ZodString;
376
+ systemId: z.ZodString;
377
+ ownerRoleId: z.ZodOptional<z.ZodString>;
378
+ status: z.ZodEnum<{
379
+ active: "active";
380
+ deprecated: "deprecated";
381
+ archived: "archived";
382
+ }>;
383
+ kind: z.ZodLiteral<"workflow">;
384
+ capabilityKey: z.ZodOptional<z.ZodString>;
385
+ }, z.core.$strip>, z.ZodObject<{
386
+ id: z.ZodString;
387
+ systemId: z.ZodString;
388
+ ownerRoleId: z.ZodOptional<z.ZodString>;
389
+ status: z.ZodEnum<{
390
+ active: "active";
391
+ deprecated: "deprecated";
392
+ archived: "archived";
393
+ }>;
394
+ kind: z.ZodLiteral<"agent">;
395
+ agentKind: z.ZodEnum<{
396
+ orchestrator: "orchestrator";
397
+ specialist: "specialist";
398
+ utility: "utility";
399
+ system: "system";
400
+ }>;
401
+ actsAsRoleId: z.ZodOptional<z.ZodString>;
402
+ sessionCapable: z.ZodBoolean;
403
+ }, z.core.$strip>, z.ZodObject<{
404
+ id: z.ZodString;
405
+ systemId: z.ZodString;
406
+ ownerRoleId: z.ZodOptional<z.ZodString>;
407
+ status: z.ZodEnum<{
408
+ active: "active";
409
+ deprecated: "deprecated";
410
+ archived: "archived";
411
+ }>;
412
+ kind: z.ZodLiteral<"integration">;
413
+ provider: z.ZodString;
414
+ }, z.core.$strip>], "kind">;
415
+ declare const ResourcesDomainSchema: z.ZodObject<{
416
+ entries: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
417
+ id: z.ZodString;
418
+ systemId: z.ZodString;
419
+ ownerRoleId: z.ZodOptional<z.ZodString>;
420
+ status: z.ZodEnum<{
421
+ active: "active";
422
+ deprecated: "deprecated";
423
+ archived: "archived";
424
+ }>;
425
+ kind: z.ZodLiteral<"workflow">;
426
+ capabilityKey: z.ZodOptional<z.ZodString>;
427
+ }, z.core.$strip>, z.ZodObject<{
428
+ id: z.ZodString;
429
+ systemId: z.ZodString;
430
+ ownerRoleId: z.ZodOptional<z.ZodString>;
431
+ status: z.ZodEnum<{
432
+ active: "active";
433
+ deprecated: "deprecated";
434
+ archived: "archived";
435
+ }>;
436
+ kind: z.ZodLiteral<"agent">;
437
+ agentKind: z.ZodEnum<{
438
+ orchestrator: "orchestrator";
439
+ specialist: "specialist";
440
+ utility: "utility";
441
+ system: "system";
442
+ }>;
443
+ actsAsRoleId: z.ZodOptional<z.ZodString>;
444
+ sessionCapable: z.ZodBoolean;
445
+ }, z.core.$strip>, z.ZodObject<{
446
+ id: z.ZodString;
447
+ systemId: z.ZodString;
448
+ ownerRoleId: z.ZodOptional<z.ZodString>;
449
+ status: z.ZodEnum<{
450
+ active: "active";
451
+ deprecated: "deprecated";
452
+ archived: "archived";
453
+ }>;
454
+ kind: z.ZodLiteral<"integration">;
455
+ provider: z.ZodString;
456
+ }, z.core.$strip>], "kind">>>;
457
+ }, z.core.$strip>;
458
+ type ResourceGovernanceStatus = z.infer<typeof ResourceGovernanceStatusSchema>;
459
+ type WorkflowResourceEntry = z.infer<typeof WorkflowResourceEntrySchema>;
460
+ type AgentResourceEntry = z.infer<typeof AgentResourceEntrySchema>;
461
+ type ResourceEntry = z.infer<typeof ResourceEntrySchema>;
462
+
338
463
  /**
339
464
  * Shared form field types for dynamic form generation
340
465
  * Used by: Command Queue, Execution Runner UI, future form-based features
@@ -442,6 +567,8 @@ interface WebhookConfig {
442
567
 
443
568
  interface WorkflowConfig extends ResourceDefinition {
444
569
  type: 'workflow';
570
+ /** OM descriptor backing canonical identity and governance metadata. */
571
+ resource?: WorkflowResourceEntry;
445
572
  /** Lead-gen capability key for registry derivation (e.g. 'lead-gen.company.apollo-import') */
446
573
  capabilityKey?: string;
447
574
  }
@@ -794,8 +921,12 @@ interface KnowledgeContent {
794
921
  * AIUsageCollector/AICallContext) and the worker proxy (which ignores them) satisfy the type.
795
922
  */
796
923
  type LLMAdapterFactory = (config: ModelConfig, ...args: any[]) => LLMAdapter;
924
+ type AgentKind = 'orchestrator' | 'specialist' | 'utility' | 'system';
797
925
  interface AgentConfig extends ResourceDefinition {
798
926
  type: 'agent';
927
+ /** OM descriptor backing canonical identity and governance metadata. */
928
+ resource?: AgentResourceEntry;
929
+ kind: AgentKind;
799
930
  systemPrompt: string;
800
931
  constraints?: AgentConstraints;
801
932
  /**
@@ -953,6 +1084,7 @@ type Database = {
953
1084
  batch_id: string | null;
954
1085
  category: string | null;
955
1086
  category_pain: string | null;
1087
+ client_id: string | null;
956
1088
  created_at: string;
957
1089
  domain: string | null;
958
1090
  enrichment_data: Json | null;
@@ -979,6 +1111,7 @@ type Database = {
979
1111
  batch_id?: string | null;
980
1112
  category?: string | null;
981
1113
  category_pain?: string | null;
1114
+ client_id?: string | null;
982
1115
  created_at?: string;
983
1116
  domain?: string | null;
984
1117
  enrichment_data?: Json | null;
@@ -1005,6 +1138,7 @@ type Database = {
1005
1138
  batch_id?: string | null;
1006
1139
  category?: string | null;
1007
1140
  category_pain?: string | null;
1141
+ client_id?: string | null;
1008
1142
  created_at?: string;
1009
1143
  domain?: string | null;
1010
1144
  enrichment_data?: Json | null;
@@ -1028,6 +1162,13 @@ type Database = {
1028
1162
  website?: string | null;
1029
1163
  };
1030
1164
  Relationships: [
1165
+ {
1166
+ foreignKeyName: "acq_companies_client_id_fkey";
1167
+ columns: ["client_id"];
1168
+ isOneToOne: false;
1169
+ referencedRelation: "clients";
1170
+ referencedColumns: ["id"];
1171
+ },
1031
1172
  {
1032
1173
  foreignKeyName: "acq_companies_organization_id_fkey";
1033
1174
  columns: ["organization_id"];
@@ -1042,6 +1183,7 @@ type Database = {
1042
1183
  batch_id: string | null;
1043
1184
  brochure_first_viewed_at: string | null;
1044
1185
  brochure_view_count: number;
1186
+ client_id: string | null;
1045
1187
  company_id: string | null;
1046
1188
  created_at: string;
1047
1189
  email: string;
@@ -1070,6 +1212,7 @@ type Database = {
1070
1212
  batch_id?: string | null;
1071
1213
  brochure_first_viewed_at?: string | null;
1072
1214
  brochure_view_count?: number;
1215
+ client_id?: string | null;
1073
1216
  company_id?: string | null;
1074
1217
  created_at?: string;
1075
1218
  email: string;
@@ -1098,6 +1241,7 @@ type Database = {
1098
1241
  batch_id?: string | null;
1099
1242
  brochure_first_viewed_at?: string | null;
1100
1243
  brochure_view_count?: number;
1244
+ client_id?: string | null;
1101
1245
  company_id?: string | null;
1102
1246
  created_at?: string;
1103
1247
  email?: string;
@@ -1123,6 +1267,13 @@ type Database = {
1123
1267
  updated_at?: string;
1124
1268
  };
1125
1269
  Relationships: [
1270
+ {
1271
+ foreignKeyName: "acq_contacts_client_id_fkey";
1272
+ columns: ["client_id"];
1273
+ isOneToOne: false;
1274
+ referencedRelation: "clients";
1275
+ referencedColumns: ["id"];
1276
+ },
1126
1277
  {
1127
1278
  foreignKeyName: "acq_contacts_company_id_fkey";
1128
1279
  columns: ["company_id"];
@@ -1366,8 +1517,10 @@ type Database = {
1366
1517
  acq_deals: {
1367
1518
  Row: {
1368
1519
  activity_log: Json;
1520
+ client_id: string | null;
1369
1521
  closed_lost_at: string | null;
1370
1522
  closed_lost_reason: string | null;
1523
+ company_id: string | null;
1371
1524
  contact_email: string;
1372
1525
  contact_id: string | null;
1373
1526
  created_at: string;
@@ -1403,8 +1556,10 @@ type Database = {
1403
1556
  };
1404
1557
  Insert: {
1405
1558
  activity_log?: Json;
1559
+ client_id?: string | null;
1406
1560
  closed_lost_at?: string | null;
1407
1561
  closed_lost_reason?: string | null;
1562
+ company_id?: string | null;
1408
1563
  contact_email: string;
1409
1564
  contact_id?: string | null;
1410
1565
  created_at?: string;
@@ -1440,8 +1595,10 @@ type Database = {
1440
1595
  };
1441
1596
  Update: {
1442
1597
  activity_log?: Json;
1598
+ client_id?: string | null;
1443
1599
  closed_lost_at?: string | null;
1444
1600
  closed_lost_reason?: string | null;
1601
+ company_id?: string | null;
1445
1602
  contact_email?: string;
1446
1603
  contact_id?: string | null;
1447
1604
  created_at?: string;
@@ -1476,6 +1633,20 @@ type Database = {
1476
1633
  updated_at?: string;
1477
1634
  };
1478
1635
  Relationships: [
1636
+ {
1637
+ foreignKeyName: "acq_deals_client_id_fkey";
1638
+ columns: ["client_id"];
1639
+ isOneToOne: false;
1640
+ referencedRelation: "clients";
1641
+ referencedColumns: ["id"];
1642
+ },
1643
+ {
1644
+ foreignKeyName: "acq_deals_company_id_fkey";
1645
+ columns: ["company_id"];
1646
+ isOneToOne: false;
1647
+ referencedRelation: "acq_companies";
1648
+ referencedColumns: ["id"];
1649
+ },
1479
1650
  {
1480
1651
  foreignKeyName: "acq_deals_contact_id_fkey";
1481
1652
  columns: ["contact_id"];
@@ -2093,6 +2264,77 @@ type Database = {
2093
2264
  }
2094
2265
  ];
2095
2266
  };
2267
+ clients: {
2268
+ Row: {
2269
+ converted_at: string | null;
2270
+ created_at: string;
2271
+ id: string;
2272
+ metadata: Json;
2273
+ name: string;
2274
+ organization_id: string;
2275
+ primary_company_id: string | null;
2276
+ primary_contact_id: string | null;
2277
+ source_deal_id: string | null;
2278
+ status: string;
2279
+ updated_at: string;
2280
+ };
2281
+ Insert: {
2282
+ converted_at?: string | null;
2283
+ created_at?: string;
2284
+ id?: string;
2285
+ metadata?: Json;
2286
+ name: string;
2287
+ organization_id: string;
2288
+ primary_company_id?: string | null;
2289
+ primary_contact_id?: string | null;
2290
+ source_deal_id?: string | null;
2291
+ status?: string;
2292
+ updated_at?: string;
2293
+ };
2294
+ Update: {
2295
+ converted_at?: string | null;
2296
+ created_at?: string;
2297
+ id?: string;
2298
+ metadata?: Json;
2299
+ name?: string;
2300
+ organization_id?: string;
2301
+ primary_company_id?: string | null;
2302
+ primary_contact_id?: string | null;
2303
+ source_deal_id?: string | null;
2304
+ status?: string;
2305
+ updated_at?: string;
2306
+ };
2307
+ Relationships: [
2308
+ {
2309
+ foreignKeyName: "clients_organization_id_fkey";
2310
+ columns: ["organization_id"];
2311
+ isOneToOne: false;
2312
+ referencedRelation: "organizations";
2313
+ referencedColumns: ["id"];
2314
+ },
2315
+ {
2316
+ foreignKeyName: "clients_primary_company_id_fkey";
2317
+ columns: ["primary_company_id"];
2318
+ isOneToOne: false;
2319
+ referencedRelation: "acq_companies";
2320
+ referencedColumns: ["id"];
2321
+ },
2322
+ {
2323
+ foreignKeyName: "clients_primary_contact_id_fkey";
2324
+ columns: ["primary_contact_id"];
2325
+ isOneToOne: false;
2326
+ referencedRelation: "acq_contacts";
2327
+ referencedColumns: ["id"];
2328
+ },
2329
+ {
2330
+ foreignKeyName: "clients_source_deal_id_fkey";
2331
+ columns: ["source_deal_id"];
2332
+ isOneToOne: false;
2333
+ referencedRelation: "acq_deals";
2334
+ referencedColumns: ["id"];
2335
+ }
2336
+ ];
2337
+ };
2096
2338
  command_queue: {
2097
2339
  Row: {
2098
2340
  action_payload: Json | null;
@@ -3062,6 +3304,7 @@ type Database = {
3062
3304
  Row: {
3063
3305
  actual_end_date: string | null;
3064
3306
  client_company_id: string | null;
3307
+ client_id: string | null;
3065
3308
  contract_value: number | null;
3066
3309
  created_at: string;
3067
3310
  deal_id: string | null;
@@ -3079,6 +3322,7 @@ type Database = {
3079
3322
  Insert: {
3080
3323
  actual_end_date?: string | null;
3081
3324
  client_company_id?: string | null;
3325
+ client_id?: string | null;
3082
3326
  contract_value?: number | null;
3083
3327
  created_at?: string;
3084
3328
  deal_id?: string | null;
@@ -3096,6 +3340,7 @@ type Database = {
3096
3340
  Update: {
3097
3341
  actual_end_date?: string | null;
3098
3342
  client_company_id?: string | null;
3343
+ client_id?: string | null;
3099
3344
  contract_value?: number | null;
3100
3345
  created_at?: string;
3101
3346
  deal_id?: string | null;
@@ -3132,6 +3377,13 @@ type Database = {
3132
3377
  referencedRelation: "acq_companies";
3133
3378
  referencedColumns: ["id"];
3134
3379
  },
3380
+ {
3381
+ foreignKeyName: "prj_projects_client_id_fkey";
3382
+ columns: ["client_id"];
3383
+ isOneToOne: false;
3384
+ referencedRelation: "clients";
3385
+ referencedColumns: ["id"];
3386
+ },
3135
3387
  {
3136
3388
  foreignKeyName: "prj_projects_deal_id_fkey";
3137
3389
  columns: ["deal_id"];
@@ -3793,6 +4045,41 @@ type Database = {
3793
4045
  };
3794
4046
  };
3795
4047
 
4048
+ declare const RecordColumnConfigSchema: z.ZodObject<{
4049
+ key: z.ZodString;
4050
+ label: z.ZodString;
4051
+ path: z.ZodString;
4052
+ width: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>;
4053
+ renderType: z.ZodOptional<z.ZodEnum<{
4054
+ text: "text";
4055
+ badge: "badge";
4056
+ datetime: "datetime";
4057
+ count: "count";
4058
+ json: "json";
4059
+ }>>;
4060
+ badgeColor: z.ZodOptional<z.ZodString>;
4061
+ }, z.core.$strip>;
4062
+ declare const CredentialRequirementSchema: z.ZodObject<{
4063
+ key: z.ZodString;
4064
+ provider: z.ZodString;
4065
+ credentialType: z.ZodEnum<{
4066
+ "api-key": "api-key";
4067
+ "api-key-secret": "api-key-secret";
4068
+ oauth: "oauth";
4069
+ "webhook-secret": "webhook-secret";
4070
+ }>;
4071
+ label: z.ZodString;
4072
+ required: z.ZodBoolean;
4073
+ selectionMode: z.ZodOptional<z.ZodEnum<{
4074
+ single: "single";
4075
+ multiple: "multiple";
4076
+ }>>;
4077
+ inputPath: z.ZodString;
4078
+ verifyOnRun: z.ZodOptional<z.ZodBoolean>;
4079
+ }, z.core.$strip>;
4080
+ type RecordColumnConfig = z.infer<typeof RecordColumnConfigSchema>;
4081
+ type CredentialRequirement = z.infer<typeof CredentialRequirementSchema>;
4082
+
3796
4083
  /** One entry in the lead-gen stage catalog. */
3797
4084
  interface LeadGenStageCatalogEntry {
3798
4085
  /** Matches the status key written into processing_state jsonb (e.g. 'scraped'). */
@@ -3805,6 +4092,15 @@ interface LeadGenStageCatalogEntry {
3805
4092
  order: number;
3806
4093
  /** Which entity's processing_state jsonb carries this stage status. */
3807
4094
  entity: 'company' | 'contact';
4095
+ /** Additional entities allowed to write/read this processing_state key. */
4096
+ additionalEntities?: Array<'company' | 'contact'>;
4097
+ /**
4098
+ * Optional read-side override for Records views when a company-scoped step
4099
+ * produces records on a different entity.
4100
+ */
4101
+ recordEntity?: 'company' | 'contact';
4102
+ /** Stage key to read from recordEntity.processing_state for Records views. */
4103
+ recordStageKey?: string;
3808
4104
  }
3809
4105
  /**
3810
4106
  * Canonical lead-gen processing stage catalog.
@@ -3841,6 +4137,9 @@ declare const DealSchemas: {
3841
4137
  stage: z.ZodOptional<z.ZodEnum<{
3842
4138
  [x: string]: string;
3843
4139
  }>>;
4140
+ list: z.ZodOptional<z.ZodString>;
4141
+ batch: z.ZodOptional<z.ZodString>;
4142
+ staleSince: z.ZodOptional<z.ZodString>;
3844
4143
  search: z.ZodOptional<z.ZodString>;
3845
4144
  limit: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
3846
4145
  offset: z.ZodDefault<z.ZodCoercedNumber<unknown>>;
@@ -3865,8 +4164,8 @@ declare const DealSchemas: {
3865
4164
  title: z.ZodString;
3866
4165
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3867
4166
  kind: z.ZodOptional<z.ZodEnum<{
3868
- other: "other";
3869
4167
  email: "email";
4168
+ other: "other";
3870
4169
  call: "call";
3871
4170
  meeting: "meeting";
3872
4171
  }>>;
@@ -3917,6 +4216,7 @@ declare const DealSchemas: {
3917
4216
  data: z.ZodArray<z.ZodObject<{
3918
4217
  id: z.ZodString;
3919
4218
  organization_id: z.ZodString;
4219
+ client_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
3920
4220
  contact_id: z.ZodNullable<z.ZodString>;
3921
4221
  contact_email: z.ZodString;
3922
4222
  pipeline_key: z.ZodString;
@@ -4036,9 +4336,46 @@ declare const DealSchemas: {
4036
4336
  body: z.ZodString;
4037
4337
  sentAt: z.ZodNullable<z.ZodString>;
4038
4338
  }, z.core.$strip>;
4339
+ DealLineageListRef: z.ZodObject<{
4340
+ id: z.ZodString;
4341
+ name: z.ZodString;
4342
+ status: z.ZodString;
4343
+ }, z.core.$strip>;
4344
+ DealLineageProjectRef: z.ZodObject<{
4345
+ id: z.ZodString;
4346
+ name: z.ZodString;
4347
+ kind: z.ZodString;
4348
+ status: z.ZodString;
4349
+ updatedAt: z.ZodString;
4350
+ }, z.core.$strip>;
4351
+ DealLineageClientRef: z.ZodObject<{
4352
+ id: z.ZodString;
4353
+ name: z.ZodString;
4354
+ status: z.ZodString;
4355
+ }, z.core.$strip>;
4356
+ DealLineage: z.ZodObject<{
4357
+ list: z.ZodNullable<z.ZodObject<{
4358
+ id: z.ZodString;
4359
+ name: z.ZodString;
4360
+ status: z.ZodString;
4361
+ }, z.core.$strip>>;
4362
+ projects: z.ZodArray<z.ZodObject<{
4363
+ id: z.ZodString;
4364
+ name: z.ZodString;
4365
+ kind: z.ZodString;
4366
+ status: z.ZodString;
4367
+ updatedAt: z.ZodString;
4368
+ }, z.core.$strip>>;
4369
+ client: z.ZodNullable<z.ZodObject<{
4370
+ id: z.ZodString;
4371
+ name: z.ZodString;
4372
+ status: z.ZodString;
4373
+ }, z.core.$strip>>;
4374
+ }, z.core.$strip>;
4039
4375
  DealDetailResponse: z.ZodObject<{
4040
4376
  id: z.ZodString;
4041
4377
  organization_id: z.ZodString;
4378
+ client_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
4042
4379
  contact_id: z.ZodNullable<z.ZodString>;
4043
4380
  contact_email: z.ZodString;
4044
4381
  pipeline_key: z.ZodString;
@@ -4123,6 +4460,25 @@ declare const DealSchemas: {
4123
4460
  sentAt: z.ZodNullable<z.ZodString>;
4124
4461
  }, z.core.$strip>>;
4125
4462
  }, z.core.$strip>;
4463
+ lineage: z.ZodOptional<z.ZodObject<{
4464
+ list: z.ZodNullable<z.ZodObject<{
4465
+ id: z.ZodString;
4466
+ name: z.ZodString;
4467
+ status: z.ZodString;
4468
+ }, z.core.$strip>>;
4469
+ projects: z.ZodArray<z.ZodObject<{
4470
+ id: z.ZodString;
4471
+ name: z.ZodString;
4472
+ kind: z.ZodString;
4473
+ status: z.ZodString;
4474
+ updatedAt: z.ZodString;
4475
+ }, z.core.$strip>>;
4476
+ client: z.ZodNullable<z.ZodObject<{
4477
+ id: z.ZodString;
4478
+ name: z.ZodString;
4479
+ status: z.ZodString;
4480
+ }, z.core.$strip>>;
4481
+ }, z.core.$strip>>;
4126
4482
  }, z.core.$strip>;
4127
4483
  DealNoteResponse: z.ZodObject<{
4128
4484
  id: z.ZodString;
@@ -4149,8 +4505,8 @@ declare const DealSchemas: {
4149
4505
  title: z.ZodString;
4150
4506
  description: z.ZodNullable<z.ZodString>;
4151
4507
  kind: z.ZodEnum<{
4152
- other: "other";
4153
4508
  email: "email";
4509
+ other: "other";
4154
4510
  call: "call";
4155
4511
  meeting: "meeting";
4156
4512
  }>;
@@ -4169,8 +4525,8 @@ declare const DealSchemas: {
4169
4525
  title: z.ZodString;
4170
4526
  description: z.ZodNullable<z.ZodString>;
4171
4527
  kind: z.ZodEnum<{
4172
- other: "other";
4173
4528
  email: "email";
4529
+ other: "other";
4174
4530
  call: "call";
4175
4531
  meeting: "meeting";
4176
4532
  }>;
@@ -4312,11 +4668,16 @@ interface BuildPlanSnapshotStep {
4312
4668
  primaryEntity: BuildPlanSnapshotPrimaryEntity;
4313
4669
  outputs: BuildPlanSnapshotOutput[];
4314
4670
  stageKey: string;
4671
+ recordEntity?: BuildPlanSnapshotPrimaryEntity;
4672
+ recordsStageKey?: string;
4673
+ recordSourceStageKey?: string;
4315
4674
  dependsOn?: string[];
4316
4675
  dependencyMode: BuildPlanSnapshotDependencyMode;
4317
4676
  capabilityKey: string;
4318
4677
  defaultBatchSize: number;
4319
4678
  maxBatchSize: number;
4679
+ recordColumns?: Partial<Record<BuildPlanSnapshotPrimaryEntity, RecordColumnConfig[]>>;
4680
+ credentialRequirements?: CredentialRequirement[];
4320
4681
  }
4321
4682
  interface BuildPlanSnapshot {
4322
4683
  templateId: string;
@@ -5038,6 +5399,22 @@ interface ProjectDetail extends ProjectRow {
5038
5399
  name: string;
5039
5400
  domain: string | null;
5040
5401
  } | null;
5402
+ deal: ProjectSourceDealRef | null;
5403
+ client: ProjectClientRef | null;
5404
+ }
5405
+ interface ProjectSourceDealRef {
5406
+ id: string;
5407
+ clientId?: string | null;
5408
+ contactEmail: string;
5409
+ stageKey: string | null;
5410
+ stateKey: string | null;
5411
+ sourceListId: string | null;
5412
+ updatedAt: string;
5413
+ }
5414
+ interface ProjectClientRef {
5415
+ id: string;
5416
+ name: string;
5417
+ status: string;
5041
5418
  }
5042
5419
 
5043
5420
  /**
@@ -6760,6 +7137,7 @@ declare const ProjectSchemas: {
6760
7137
  }>>;
6761
7138
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6762
7139
  deal_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7140
+ client_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6763
7141
  client_company_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6764
7142
  start_date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6765
7143
  target_end_date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -6784,6 +7162,7 @@ declare const ProjectSchemas: {
6784
7162
  }>>;
6785
7163
  description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6786
7164
  deal_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7165
+ client_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6787
7166
  client_company_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6788
7167
  start_date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
6789
7168
  target_end_date: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -6807,10 +7186,25 @@ declare const ProjectSchemas: {
6807
7186
  completed: "completed";
6808
7187
  }>>;
6809
7188
  search: z.ZodOptional<z.ZodString>;
7189
+ client_id: z.ZodOptional<z.ZodString>;
6810
7190
  }, z.core.$strict>;
6811
7191
  ProjectIdParams: z.ZodObject<{
6812
7192
  id: z.ZodString;
6813
7193
  }, z.core.$strip>;
7194
+ ProjectSourceDealRef: z.ZodObject<{
7195
+ id: z.ZodString;
7196
+ clientId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
7197
+ contactEmail: z.ZodString;
7198
+ stageKey: z.ZodNullable<z.ZodString>;
7199
+ stateKey: z.ZodNullable<z.ZodString>;
7200
+ sourceListId: z.ZodNullable<z.ZodString>;
7201
+ updatedAt: z.ZodString;
7202
+ }, z.core.$strip>;
7203
+ ProjectClientRef: z.ZodObject<{
7204
+ id: z.ZodString;
7205
+ name: z.ZodString;
7206
+ status: z.ZodString;
7207
+ }, z.core.$strip>;
6814
7208
  CreateMilestoneRequest: z.ZodObject<{
6815
7209
  name: z.ZodString;
6816
7210
  status: z.ZodOptional<z.ZodEnum<{
@@ -8270,6 +8664,48 @@ interface Tool {
8270
8664
  */
8271
8665
  type IntegrationType = 'gmail' | 'google-sheets' | 'slack' | 'github' | 'linear' | 'attio' | 'airtable' | 'salesforce' | 'hubspot' | 'stripe' | 'twilio' | 'sendgrid' | 'mailgun' | 'zapier' | 'webhook' | 'apify' | 'instantly' | 'resend' | 'signature-api' | 'dropbox' | 'anymailfinder' | 'tomba' | 'millionverifier';
8272
8666
 
8667
+ declare const SystemEntrySchema: z.ZodObject<{
8668
+ id: z.ZodString;
8669
+ title: z.ZodString;
8670
+ description: z.ZodString;
8671
+ kind: z.ZodEnum<{
8672
+ platform: "platform";
8673
+ product: "product";
8674
+ operational: "operational";
8675
+ diagnostic: "diagnostic";
8676
+ }>;
8677
+ responsibleRoleId: z.ZodOptional<z.ZodString>;
8678
+ governedByKnowledge: z.ZodDefault<z.ZodArray<z.ZodString>>;
8679
+ drivesGoals: z.ZodDefault<z.ZodArray<z.ZodString>>;
8680
+ status: z.ZodEnum<{
8681
+ active: "active";
8682
+ deprecated: "deprecated";
8683
+ archived: "archived";
8684
+ }>;
8685
+ }, z.core.$strip>;
8686
+ declare const SystemsDomainSchema: z.ZodObject<{
8687
+ systems: z.ZodDefault<z.ZodArray<z.ZodObject<{
8688
+ id: z.ZodString;
8689
+ title: z.ZodString;
8690
+ description: z.ZodString;
8691
+ kind: z.ZodEnum<{
8692
+ platform: "platform";
8693
+ product: "product";
8694
+ operational: "operational";
8695
+ diagnostic: "diagnostic";
8696
+ }>;
8697
+ responsibleRoleId: z.ZodOptional<z.ZodString>;
8698
+ governedByKnowledge: z.ZodDefault<z.ZodArray<z.ZodString>>;
8699
+ drivesGoals: z.ZodDefault<z.ZodArray<z.ZodString>>;
8700
+ status: z.ZodEnum<{
8701
+ active: "active";
8702
+ deprecated: "deprecated";
8703
+ archived: "archived";
8704
+ }>;
8705
+ }, z.core.$strip>>>;
8706
+ }, z.core.$strip>;
8707
+ type SystemEntry = z.infer<typeof SystemEntrySchema>;
8708
+
8273
8709
  /**
8274
8710
  * Resource Registry type definitions
8275
8711
  */
@@ -8283,6 +8719,7 @@ type ResourceStatus = 'dev' | 'prod';
8283
8719
  * Used as the discriminator field in ResourceDefinition
8284
8720
  */
8285
8721
  type ResourceType = 'agent' | 'workflow' | 'trigger' | 'integration' | 'external' | 'human';
8722
+ type ResourceSystemSummary = Pick<SystemEntry, 'id' | 'title' | 'description' | 'kind' | 'status'>;
8286
8723
  /**
8287
8724
  * Base interface for ALL platform resources
8288
8725
  * Shared by both executable (agents, workflows) and non-executable (triggers, integrations, etc.) resources
@@ -8308,6 +8745,12 @@ interface ResourceDefinition {
8308
8745
  sessionCapable?: boolean;
8309
8746
  /** Whether the resource is local (monorepo) or remote (externally deployed) */
8310
8747
  origin?: 'local' | 'remote';
8748
+ /** OM System membership, when backed by a Resource descriptor */
8749
+ systemId?: string;
8750
+ /** Display metadata for the owning OM System */
8751
+ system?: ResourceSystemSummary;
8752
+ /** Governance lifecycle status from the OM Resource descriptor */
8753
+ governanceStatus?: ResourceGovernanceStatus;
8311
8754
  /** Whether this resource is archived and should be excluded from registration and deployment */
8312
8755
  archived?: boolean;
8313
8756
  }
@@ -8413,6 +8856,10 @@ interface TriggerDefinition extends ResourceDefinition {
8413
8856
  interface IntegrationDefinition extends ResourceDefinition {
8414
8857
  /** Resource type discriminator (narrowed from base union) */
8415
8858
  type: 'integration';
8859
+ /** OM descriptor that owns canonical identity and governance metadata. */
8860
+ resource?: Extract<ResourceEntry, {
8861
+ kind: 'integration';
8862
+ }>;
8416
8863
  /** Integration provider type */
8417
8864
  provider: IntegrationType;
8418
8865
  /** References credentials table (e.g., 'shopify-prod', 'zendesk-api') */
@@ -8558,6 +9005,9 @@ interface HumanCheckpointDefinition extends ResourceDefinition {
8558
9005
  };
8559
9006
  }
8560
9007
 
9008
+ type OrganizationModelSystems = z.infer<typeof SystemsDomainSchema>;
9009
+ type OrganizationModelResources = z.infer<typeof ResourcesDomainSchema>;
9010
+
8561
9011
  declare const LinkSchema: z.ZodObject<{
8562
9012
  nodeId: z.ZodString;
8563
9013
  kind: z.ZodEnum<{
@@ -8573,8 +9023,8 @@ declare const LinkSchema: z.ZodObject<{
8573
9023
  type Link = z.infer<typeof LinkSchema>;
8574
9024
 
8575
9025
  declare const ResourceCategorySchema: z.ZodEnum<{
8576
- production: "production";
8577
9026
  diagnostic: "diagnostic";
9027
+ production: "production";
8578
9028
  internal: "internal";
8579
9029
  testing: "testing";
8580
9030
  }>;
@@ -8601,6 +9051,11 @@ type ResourceLink = Link;
8601
9051
  interface DeploymentSpec {
8602
9052
  /** Deployment version (semver) */
8603
9053
  version: string;
9054
+ /** Optional Organization Model governance catalog used for OM-code validation */
9055
+ organizationModel?: {
9056
+ systems?: OrganizationModelSystems;
9057
+ resources?: OrganizationModelResources;
9058
+ };
8604
9059
  /** Workflow definitions */
8605
9060
  workflows?: WorkflowDefinition[];
8606
9061
  /** Agent definitions */