@elevasis/sdk 1.36.4 → 1.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -6750,12 +6750,13 @@ declare const SystemApiInterfaceSchema: z.ZodObject<{
6750
6750
  archived: "archived";
6751
6751
  disabled: "disabled";
6752
6752
  }>>;
6753
- readinessProfile: z.ZodOptional<z.ZodEnum<{
6754
- "sales.lead-gen.api": "sales.lead-gen.api";
6755
- "sales.crm.api": "sales.crm.api";
6756
- "sales.lead-gen.crm-handoff": "sales.lead-gen.crm-handoff";
6757
- }>>;
6753
+ readinessProfile: z.ZodOptional<z.ZodString>;
6758
6754
  resourceIds: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
6755
+ readinessContract: z.ZodOptional<z.ZodObject<{
6756
+ requiredObjects: z.ZodDefault<z.ZodArray<z.ZodString>>;
6757
+ requiredCatalogs: z.ZodDefault<z.ZodArray<z.ZodString>>;
6758
+ requiredKinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
6759
+ }, z.core.$strict>>;
6759
6760
  }, z.core.$strict>;
6760
6761
  type JsonPrimitive = string | number | boolean | null;
6761
6762
  type JsonValue = JsonPrimitive | JsonValue[] | {
@@ -12274,6 +12275,91 @@ declare class ToolingError extends ExecutionError {
12274
12275
  constructor(errorType: string, message: string, details?: unknown);
12275
12276
  }
12276
12277
 
12278
+ /**
12279
+ * Tenant-authorable readiness requirements for a system's API interface.
12280
+ *
12281
+ * Built-in profiles (`sales.lead-gen.api`, `sales.crm.api`,
12282
+ * `sales.lead-gen.crm-handoff`) derive their requirements from platform code
12283
+ * and do not need a `readinessContract`. Custom systems (any profile id not in
12284
+ * the built-in registry) MUST declare a contract so structural readiness
12285
+ * validation can proceed without platform hardcoding.
12286
+ *
12287
+ * Each field is an array of ontology IDs that this system must satisfy:
12288
+ * - `requiredObjects` – ontology object types the interface depends on
12289
+ * - `requiredCatalogs` – catalog types the interface requires (non-empty)
12290
+ * - `requiredKinds` – (optional) ontology kind filters for future use
12291
+ */
12292
+ declare const SystemApiInterfaceReadinessContractSchema = z
12293
+ .object({
12294
+ /** Ontology IDs of object types the interface depends on. */
12295
+ requiredObjects: z.array(z.string().trim().min(1)).default([]),
12296
+ /** Ontology IDs of catalog types the interface requires (must be non-empty). */
12297
+ requiredCatalogs: z.array(z.string().trim().min(1)).default([]),
12298
+ /** Optional ontology kind filters (reserved for future profile extensions). */
12299
+ requiredKinds: z.array(z.string().trim().min(1)).optional()
12300
+ })
12301
+ .strict()
12302
+
12303
+ // ---------------------------------------------------------------------------
12304
+ // Profile registry
12305
+ //
12306
+ // Maps a readiness profile id to a lookup result. Built-in presets are
12307
+ // registered at module load; callers may register additional presets via
12308
+ // `registerReadinessProfile`. Unknown ids resolve to `undefined` — validated
12309
+ // structurally through the system's declared `readinessContract`.
12310
+ // ---------------------------------------------------------------------------
12311
+
12312
+ type ReadinessProfileKind = 'built-in' | 'custom'
12313
+
12314
+ interface ReadinessProfileEntry {
12315
+ readonly profileId: string
12316
+ readonly kind: ReadinessProfileKind
12317
+ }
12318
+
12319
+ /**
12320
+ * Look up a readiness profile entry by id.
12321
+ *
12322
+ * Returns `undefined` for unknown ids (not in the built-in list and not
12323
+ * registered via `registerReadinessProfile`). Unknown profiles are validated
12324
+ * structurally through the system's `readinessContract` — unknown-profile is
12325
+ * NOT a schema-layer rejection.
12326
+ */
12327
+ declare function lookupReadinessProfile(profileId: string): ReadinessProfileEntry | undefined {
12328
+ return _profileRegistry.get(profileId)
12329
+ }
12330
+
12331
+ /**
12332
+ * Register a custom readiness profile preset.
12333
+ *
12334
+ * Tenant tooling or SDK extensions may call this during startup to register
12335
+ * named presets. Registered presets are then resolvable via `lookupReadinessProfile`.
12336
+ * Built-in profile ids cannot be overwritten.
12337
+ */
12338
+ declare function registerReadinessProfile(profileId: string): ReadinessProfileEntry {
12339
+ const existing = _profileRegistry.get(profileId)
12340
+ if (existing !== undefined) return existing
12341
+ const entry: ReadinessProfileEntry = { profileId, kind: 'custom' }
12342
+ _profileRegistry.set(profileId, entry)
12343
+ return entry
12344
+ }
12345
+
12346
+ /**
12347
+ * Return the effective readiness profile id for a system interface.
12348
+ * Falls back to `systemPath.interfaceKey` when `readinessProfile` is omitted.
12349
+ * This is the canonical profile-resolution function used by validation code.
12350
+ */
12351
+ declare function profileForInterface(systemPath: string, interfaceKey: string, readinessProfile?: string): string {
12352
+ return readinessProfile ?? `${systemPath}.${interfaceKey}`
12353
+ }
12354
+
12355
+ /**
12356
+ * Return true if the given profile id is a built-in platform preset.
12357
+ */
12358
+ declare function isBuiltInReadinessProfile(profileId: string): boolean {
12359
+ return _profileRegistry.get(profileId)?.kind === 'built-in'
12360
+ }
12361
+ type SystemApiInterfaceReadinessContract = z.infer<typeof SystemApiInterfaceReadinessContractSchema>
12362
+
12277
12363
  declare const ResourceOntologyBindingSchema = z
12278
12364
  .object({
12279
12365
  actions: z.array(OntologyIdSchema).optional(),
@@ -12625,5 +12711,5 @@ declare function defineWorkflowConfig<const TResourceId extends string>(resource
12625
12711
  declare const ListBuilderStageKeySchema: z.ZodString;
12626
12712
  type ListBuilderStageKey = z.infer<typeof ListBuilderStageKeySchema>;
12627
12713
 
12628
- export { ActivityEventSchema, BuildPlanSnapshotStepSchema, ProspectingBuildTemplateSchema as BuildTemplateSchema, ContractRefResolutionError, CrmStageKeySchema, CrmStateKeySchema, EmailSchema, ExecutionError, ListBuilderStageKeySchema, ProcessingStageStatusSchema, RegistryValidationError, ResourceRegistry, StepType, ToolingError, bindResourceDescriptor, compileBusinessOntologyValidationIndex, concurrentPool, createLeadGenStageValidators, defineContract, defineResource, defineResourceOntology, defineResources, defineStep, defineTopology, defineTopologyRelationship, defineWorkflow, defineWorkflowConfig, deriveActions, diagnosticOutput, integrationInput, isZodType, parseTopologyNodeRef, projectDeploymentSpec, projectTopologyRelationships, resolveContractRef, runDiagnostic, splitName, toSdkResourceDescriptor, topologyRef, topologyRelationship, validateDeclaredSystemInterfaceReadiness, validateResourceGovernance, withPlatformAgentResourceDescriptor, withPlatformAgentResourceDescriptors, withPlatformIntegrationResourceDescriptor, withPlatformIntegrationResourceDescriptors, withPlatformResourceDescriptor, withPlatformResourceDescriptors };
12629
- export type { AbsoluteScheduleConfig, AcqCompany, AcqContact, AcqDeal, AcqDealRow, AcqList, Action$1 as Action, ActionDef, ActivityEvent, AddToCampaignLead, AddToCampaignParams, AddToCampaignResult, AgentConfig, AgentConstraints, AgentDefinition, AgentMemory, AgentResourceDescriptorResolver, FindCompanyEmailParams as AnymailfinderFindCompanyEmailParams, FindCompanyEmailResult as AnymailfinderFindCompanyEmailResult, FindDecisionMakerEmailParams as AnymailfinderFindDecisionMakerEmailParams, FindDecisionMakerEmailResult as AnymailfinderFindDecisionMakerEmailResult, FindPersonEmailParams as AnymailfinderFindPersonEmailParams, FindPersonEmailResult as AnymailfinderFindPersonEmailResult, AnymailfinderToolMap, VerifyEmailParams as AnymailfinderVerifyEmailParams, VerifyEmailResult as AnymailfinderVerifyEmailResult, ApifyToolMap, ApifyWebhookConfig, AppendRowsParams, AppendRowsResult, ApprovalToolMap, AttioToolMap, BatchUpdateParams, BatchUpdateResult, BuildPlanSnapshotStep, BulkDeleteLeadsParams, BulkDeleteLeadsResult, BulkImportParams, BulkImportResult, BusinessOntologyValidationIndex, CancelHitlByDealIdParams, CancelSchedulesAndHitlByEmailParams, ClearDealFieldsParams, ClearRangeParams, ClearRangeResult, ClickUpToolMap, CompanyFilters, ConcurrentPoolOptions, ConcurrentPoolResult, ConditionalNext, ContactFilters, Contract, ContractRefResolutionErrorCode, ContractRegistry, CreateAttributeParams, CreateAttributeResult, CreateAutoPaymentLinkParams, CreateAutoPaymentLinkResult, CreateCheckoutSessionParams, CreateCheckoutSessionResult, CreateCompanyParams, CreateContactParams, CreateEnvelopeParams, CreateEnvelopeResult, CreateFolderParams, CreateFolderResult, CreateListParams, CreateNoteParams, CreateNoteResult, CreatePaymentLinkParams, CreatePaymentLinkResult, CreateRecordParams, CreateRecordResult, CreateScheduleInput, CrmStageKey, CrmStateKey, CrmToolMap, DeleteDealParams, DeleteNoteParams, DeleteNoteResult, DeleteRecordParams, DeleteRecordResult, DeleteRowByValueParams, DeleteRowByValueResult, DeploymentSpec, DiagnosticOutput, DownloadDocumentParams, DownloadDocumentResult, DropboxToolMap, ElevasConfig, EmailToolMap, EnvelopeDocument, EventTriggerConfig, ExecutionContext, ExecutionInterface, ExecutionMetadata, ExecutionToolMap, FilterExpression, FilterRowsParams, FilterRowsResult, FormField, FormFieldType, FormSchema, GetDailyCampaignAnalyticsParams, GetDailyCampaignAnalyticsResult, GetEmailsParams, GetEmailsResult, GetEnvelopeParams, GetEnvelopeResult, GetHeadersParams, GetHeadersResult, GetLastRowParams, GetLastRowResult, GetPaymentLinkParams, GetPaymentLinkResult, GetRecordParams, GetRecordResult, GetRowByValueParams, GetRowByValueResult, GetSpreadsheetMetadataParams, GetSpreadsheetMetadataResult, GmailSendEmailParams, GmailSendEmailResult, GmailToolMap, GoogleSheetsToolMap, HumanCheckpointDefinition, InstantlyToolMap, IntegrationDefinition, IntegrationResourceDescriptorResolver, LLMAdapterFactory, LLMGenerateRequest, LLMGenerateResponse, LLMMessage, LLMModel, LeadGenStageValidators, LeadToolMap, LinearNext, ListAttributesParams, ListAttributesResult, ListBuilderStageKey, ListBuilderStep, ListLeadsParams, ListLeadsResult, ListNotesParams, ListNotesResult, ListObjectsResult, ListPaymentLinksParams, ListPaymentLinksResult, ListToolMap, MarkProposalReviewedParams, MarkProposalSentParams, MethodEntry, MillionVerifierToolMap, ModelConfig, NextConfig, NotificationSDKInput, NotificationToolMap, OrganizationModelAgentResourceEntry, OrganizationModelIntegrationResourceEntry, OrganizationModelResourceEntry, OrganizationModelResourceOntologyBinding, OrganizationModelTopology, OrganizationModelTopologyNodeRef, OrganizationModelTopologyRelationship, OrganizationModelWorkflowResourceEntry, PaginatedResult, PaginationParams, PdfToolMap, ProcessingStageStatus, ProjectDeploymentSpecOptions, ProjectsToolMap, QueryRecordsParams, QueryRecordsResult, ReadSheetParams, ReadSheetResult, Recipient, RecurringScheduleConfig, RelationshipDeclaration, RelativeScheduleConfig, RemoveFromSubsequenceParams, RemoveFromSubsequenceResult, ResendGetEmailParams, ResendGetEmailResult, ResendSendEmailParams, ResendSendEmailResult, ResendToolMap, ResolvedContractRef, ResourceCategory, ResourceDefinition, ResourceLink, ResourceMetricsConfig, ResourceOntologyBindingResolver, ResourceRelationships, ResourceStatus$1 as ResourceStatus, ResourceType, RunActorParams, RunActorResult, SDKLLMGenerateParams, ScheduleOriginTracking, ScheduleTarget, ScheduleTriggerConfig, SchedulerToolMap, SendReplyParams, SendReplyResult, SetContactNurtureParams, SheetInfo, SignatureApiFieldType, SignatureApiToolMap, SigningPlace, SortCriteria, StartActorParams, StartActorResult, StepHandler, StorageDeleteInput, StorageDeleteOutput, StorageDownloadInput, StorageDownloadOutput, StorageListInput, StorageListOutput, StorageSignedUrlInput, StorageSignedUrlOutput, StorageToolMap, StorageUploadInput, StorageUploadOutput, StripeToolMap, TaskSchedule, TaskScheduleConfig, TombaToolMap, Tool, ToolExecutionOptions, ToolMethodMap, ToolingErrorType, TransitionItemParams, TriggerConfig, TriggerDefinition, UpdateAttributeParams, UpdateAttributeResult, UpdateCloseLostReasonParams, UpdateCompanyParams, UpdateContactParams, UpdateDiscoveryDataParams, UpdateFeesParams, UpdateInterestStatusParams, UpdateInterestStatusResult, UpdateListParams, UpdatePaymentLinkParams, UpdatePaymentLinkResult, UpdateProposalDataParams, UpdateRecordParams, UpdateRecordResult, UpdateRowByValueParams, UpdateRowByValueResult, UploadFileParams, UploadFileResult, UpsertCompanyParams, UpsertContactParams, UpsertDealParams, UpsertRowParams, UpsertRowResult, VoidEnvelopeParams, VoidEnvelopeResult, WebhookProviderType, WebhookTriggerConfig, WorkflowConfig, WorkflowConfigActionRegistry, WorkflowDefinition, WorkflowLogger, WorkflowResourceDescriptorMap, WorkflowResourceDescriptorResolver, WorkflowStep, WriteSheetParams, WriteSheetResult };
12714
+ export { ActivityEventSchema, BuildPlanSnapshotStepSchema, ProspectingBuildTemplateSchema as BuildTemplateSchema, ContractRefResolutionError, CrmStageKeySchema, CrmStateKeySchema, EmailSchema, ExecutionError, ListBuilderStageKeySchema, ProcessingStageStatusSchema, RegistryValidationError, ResourceRegistry, StepType, ToolingError, bindResourceDescriptor, compileBusinessOntologyValidationIndex, concurrentPool, createLeadGenStageValidators, defineContract, defineResource, defineResourceOntology, defineResources, defineStep, defineTopology, defineTopologyRelationship, defineWorkflow, defineWorkflowConfig, deriveActions, diagnosticOutput, integrationInput, isBuiltInReadinessProfile, isZodType, lookupReadinessProfile, parseTopologyNodeRef, profileForInterface, projectDeploymentSpec, projectTopologyRelationships, registerReadinessProfile, resolveContractRef, runDiagnostic, splitName, toSdkResourceDescriptor, topologyRef, topologyRelationship, validateDeclaredSystemInterfaceReadiness, validateResourceGovernance, withPlatformAgentResourceDescriptor, withPlatformAgentResourceDescriptors, withPlatformIntegrationResourceDescriptor, withPlatformIntegrationResourceDescriptors, withPlatformResourceDescriptor, withPlatformResourceDescriptors };
12715
+ export type { AbsoluteScheduleConfig, AcqCompany, AcqContact, AcqDeal, AcqDealRow, AcqList, Action$1 as Action, ActionDef, ActivityEvent, AddToCampaignLead, AddToCampaignParams, AddToCampaignResult, AgentConfig, AgentConstraints, AgentDefinition, AgentMemory, AgentResourceDescriptorResolver, FindCompanyEmailParams as AnymailfinderFindCompanyEmailParams, FindCompanyEmailResult as AnymailfinderFindCompanyEmailResult, FindDecisionMakerEmailParams as AnymailfinderFindDecisionMakerEmailParams, FindDecisionMakerEmailResult as AnymailfinderFindDecisionMakerEmailResult, FindPersonEmailParams as AnymailfinderFindPersonEmailParams, FindPersonEmailResult as AnymailfinderFindPersonEmailResult, AnymailfinderToolMap, VerifyEmailParams as AnymailfinderVerifyEmailParams, VerifyEmailResult as AnymailfinderVerifyEmailResult, ApifyToolMap, ApifyWebhookConfig, AppendRowsParams, AppendRowsResult, ApprovalToolMap, AttioToolMap, BatchUpdateParams, BatchUpdateResult, BuildPlanSnapshotStep, BulkDeleteLeadsParams, BulkDeleteLeadsResult, BulkImportParams, BulkImportResult, BusinessOntologyValidationIndex, CancelHitlByDealIdParams, CancelSchedulesAndHitlByEmailParams, ClearDealFieldsParams, ClearRangeParams, ClearRangeResult, ClickUpToolMap, CompanyFilters, ConcurrentPoolOptions, ConcurrentPoolResult, ConditionalNext, ContactFilters, Contract, ContractRefResolutionErrorCode, ContractRegistry, CreateAttributeParams, CreateAttributeResult, CreateAutoPaymentLinkParams, CreateAutoPaymentLinkResult, CreateCheckoutSessionParams, CreateCheckoutSessionResult, CreateCompanyParams, CreateContactParams, CreateEnvelopeParams, CreateEnvelopeResult, CreateFolderParams, CreateFolderResult, CreateListParams, CreateNoteParams, CreateNoteResult, CreatePaymentLinkParams, CreatePaymentLinkResult, CreateRecordParams, CreateRecordResult, CreateScheduleInput, CrmStageKey, CrmStateKey, CrmToolMap, DeleteDealParams, DeleteNoteParams, DeleteNoteResult, DeleteRecordParams, DeleteRecordResult, DeleteRowByValueParams, DeleteRowByValueResult, DeploymentSpec, DiagnosticOutput, DownloadDocumentParams, DownloadDocumentResult, DropboxToolMap, ElevasConfig, EmailToolMap, EnvelopeDocument, EventTriggerConfig, ExecutionContext, ExecutionInterface, ExecutionMetadata, ExecutionToolMap, FilterExpression, FilterRowsParams, FilterRowsResult, FormField, FormFieldType, FormSchema, GetDailyCampaignAnalyticsParams, GetDailyCampaignAnalyticsResult, GetEmailsParams, GetEmailsResult, GetEnvelopeParams, GetEnvelopeResult, GetHeadersParams, GetHeadersResult, GetLastRowParams, GetLastRowResult, GetPaymentLinkParams, GetPaymentLinkResult, GetRecordParams, GetRecordResult, GetRowByValueParams, GetRowByValueResult, GetSpreadsheetMetadataParams, GetSpreadsheetMetadataResult, GmailSendEmailParams, GmailSendEmailResult, GmailToolMap, GoogleSheetsToolMap, HumanCheckpointDefinition, InstantlyToolMap, IntegrationDefinition, IntegrationResourceDescriptorResolver, LLMAdapterFactory, LLMGenerateRequest, LLMGenerateResponse, LLMMessage, LLMModel, LeadGenStageValidators, LeadToolMap, LinearNext, ListAttributesParams, ListAttributesResult, ListBuilderStageKey, ListBuilderStep, ListLeadsParams, ListLeadsResult, ListNotesParams, ListNotesResult, ListObjectsResult, ListPaymentLinksParams, ListPaymentLinksResult, ListToolMap, MarkProposalReviewedParams, MarkProposalSentParams, MethodEntry, MillionVerifierToolMap, ModelConfig, NextConfig, NotificationSDKInput, NotificationToolMap, OrganizationModelAgentResourceEntry, OrganizationModelIntegrationResourceEntry, OrganizationModelResourceEntry, OrganizationModelResourceOntologyBinding, OrganizationModelTopology, OrganizationModelTopologyNodeRef, OrganizationModelTopologyRelationship, OrganizationModelWorkflowResourceEntry, PaginatedResult, PaginationParams, PdfToolMap, ProcessingStageStatus, ProjectDeploymentSpecOptions, ProjectsToolMap, QueryRecordsParams, QueryRecordsResult, ReadSheetParams, ReadSheetResult, ReadinessProfileEntry, ReadinessProfileKind, Recipient, RecurringScheduleConfig, RelationshipDeclaration, RelativeScheduleConfig, RemoveFromSubsequenceParams, RemoveFromSubsequenceResult, ResendGetEmailParams, ResendGetEmailResult, ResendSendEmailParams, ResendSendEmailResult, ResendToolMap, ResolvedContractRef, ResourceCategory, ResourceDefinition, ResourceLink, ResourceMetricsConfig, ResourceOntologyBindingResolver, ResourceRelationships, ResourceStatus$1 as ResourceStatus, ResourceType, RunActorParams, RunActorResult, SDKLLMGenerateParams, ScheduleOriginTracking, ScheduleTarget, ScheduleTriggerConfig, SchedulerToolMap, SendReplyParams, SendReplyResult, SetContactNurtureParams, SheetInfo, SignatureApiFieldType, SignatureApiToolMap, SigningPlace, SortCriteria, StartActorParams, StartActorResult, StepHandler, StorageDeleteInput, StorageDeleteOutput, StorageDownloadInput, StorageDownloadOutput, StorageListInput, StorageListOutput, StorageSignedUrlInput, StorageSignedUrlOutput, StorageToolMap, StorageUploadInput, StorageUploadOutput, StripeToolMap, SystemApiInterfaceReadinessContract, TaskSchedule, TaskScheduleConfig, TombaToolMap, Tool, ToolExecutionOptions, ToolMethodMap, ToolingErrorType, TransitionItemParams, TriggerConfig, TriggerDefinition, UpdateAttributeParams, UpdateAttributeResult, UpdateCloseLostReasonParams, UpdateCompanyParams, UpdateContactParams, UpdateDiscoveryDataParams, UpdateFeesParams, UpdateInterestStatusParams, UpdateInterestStatusResult, UpdateListParams, UpdatePaymentLinkParams, UpdatePaymentLinkResult, UpdateProposalDataParams, UpdateRecordParams, UpdateRecordResult, UpdateRowByValueParams, UpdateRowByValueResult, UploadFileParams, UploadFileResult, UpsertCompanyParams, UpsertContactParams, UpsertDealParams, UpsertRowParams, UpsertRowResult, VoidEnvelopeParams, VoidEnvelopeResult, WebhookProviderType, WebhookTriggerConfig, WorkflowConfig, WorkflowConfigActionRegistry, WorkflowDefinition, WorkflowLogger, WorkflowResourceDescriptorMap, WorkflowResourceDescriptorResolver, WorkflowStep, WriteSheetParams, WriteSheetResult };
package/dist/index.js CHANGED
@@ -618,17 +618,58 @@ var SYSTEM_INTERFACE_PROFILES = [
618
618
  var SYSTEM_INTERFACE_READINESS_PROFILES = SYSTEM_INTERFACE_PROFILES.map(
619
619
  (profile) => profile.readinessProfile
620
620
  );
621
- var SystemInterfaceReadinessProfileSchema = z.enum(SYSTEM_INTERFACE_READINESS_PROFILES);
621
+ var SystemInterfaceReadinessProfileSchema = z.string().trim().min(1);
622
622
  var SystemInterfaceResourceScopeSchema = z.array(ModelIdSchema).default([]);
623
+ var SystemApiInterfaceReadinessContractSchema = z.object({
624
+ /** Ontology IDs of object types the interface depends on. */
625
+ requiredObjects: z.array(z.string().trim().min(1)).default([]),
626
+ /** Ontology IDs of catalog types the interface requires (must be non-empty). */
627
+ requiredCatalogs: z.array(z.string().trim().min(1)).default([]),
628
+ /** Optional ontology kind filters (reserved for future profile extensions). */
629
+ requiredKinds: z.array(z.string().trim().min(1)).optional()
630
+ }).strict();
623
631
  var SystemApiInterfaceSchema = z.object({
624
632
  lifecycle: SystemInterfaceLifecycleSchema.default("active"),
633
+ /**
634
+ * Open-string profile id. Built-in platform presets are looked up through
635
+ * the profile registry; custom ids are validated structurally via
636
+ * `readinessContract`. Optional — `profileForInterface` provides a default.
637
+ */
625
638
  readinessProfile: SystemInterfaceReadinessProfileSchema.optional(),
626
639
  /**
627
640
  * Resource ids that participate in this API interface. This scopes readiness
628
641
  * derivation without duplicating authored required/provided contract refs.
629
642
  */
630
- resourceIds: SystemInterfaceResourceScopeSchema.optional()
643
+ resourceIds: SystemInterfaceResourceScopeSchema.optional(),
644
+ /**
645
+ * Tenant-authorable readiness declaration. Required for custom
646
+ * (non-built-in) profile ids so structural validation can proceed. Built-in
647
+ * profiles ignore this field (requirements are derived from platform code).
648
+ */
649
+ readinessContract: SystemApiInterfaceReadinessContractSchema.optional()
631
650
  }).strict();
651
+ var _profileRegistry = new Map(
652
+ SYSTEM_INTERFACE_READINESS_PROFILES.map((profileId) => [
653
+ profileId,
654
+ { profileId, kind: "built-in" }
655
+ ])
656
+ );
657
+ function lookupReadinessProfile(profileId) {
658
+ return _profileRegistry.get(profileId);
659
+ }
660
+ function registerReadinessProfile(profileId) {
661
+ const existing = _profileRegistry.get(profileId);
662
+ if (existing !== void 0) return existing;
663
+ const entry = { profileId, kind: "custom" };
664
+ _profileRegistry.set(profileId, entry);
665
+ return entry;
666
+ }
667
+ function profileForInterface(systemPath, interfaceKey, readinessProfile) {
668
+ return readinessProfile ?? `${systemPath}.${interfaceKey}`;
669
+ }
670
+ function isBuiltInReadinessProfile(profileId) {
671
+ return _profileRegistry.get(profileId)?.kind === "built-in";
672
+ }
632
673
  var SystemInterfaceRefSchema = z.object({
633
674
  systemPath: SystemPathSchema,
634
675
  interfaceKey: SystemInterfaceKeySchema
@@ -1757,9 +1798,6 @@ function addReadinessIssue(issues, family, code, message, details = {}) {
1757
1798
  function formatInterfaceIdentity(systemPath, interfaceKey) {
1758
1799
  return `${systemPath}/${interfaceKey}`;
1759
1800
  }
1760
- function profileForInterface(systemPath, interfaceKey, readinessProfile) {
1761
- return readinessProfile ?? `${systemPath}.${interfaceKey}`;
1762
- }
1763
1801
  function readinessMarkerPath(context) {
1764
1802
  return context.interfaceKey === "api" ? `systems.${context.systemPath}.apiInterface` : `systems.${context.systemPath}.derivedCrmHandoffReadiness`;
1765
1803
  }
@@ -1769,7 +1807,7 @@ function formatInterfaceReadinessFailure(result) {
1769
1807
  return `${identity} readiness failed${result.readinessProfile ? ` (${result.readinessProfile})` : ""}: ${issueSummary}`;
1770
1808
  }
1771
1809
  function formatSupportedReadinessProfiles() {
1772
- return SYSTEM_INTERFACE_READINESS_PROFILES.map((profile) => `"${profile}"`).join(", ");
1810
+ return SYSTEM_INTERFACE_PROFILES.map((p) => `"${p.readinessProfile}"`).join(", ");
1773
1811
  }
1774
1812
  function throwIfInterfaceNotReady(result) {
1775
1813
  if (result.ready) return;
@@ -1965,9 +2003,6 @@ function getLeadGenCrmHandoffResourceIds(model) {
1965
2003
  function getSystemInterfaceReadinessMarker(model, request) {
1966
2004
  const system = getSystem(model, request.systemPath);
1967
2005
  if (system === void 0) return void 0;
1968
- if (request.interfaceKey === LEAD_GEN_API_INTERFACE.interfaceKey) {
1969
- return system.apiInterface;
1970
- }
1971
2006
  if (request.systemPath === LEAD_GEN_CRM_HANDOFF_INTERFACE.systemPath && request.interfaceKey === LEAD_GEN_CRM_HANDOFF_INTERFACE.interfaceKey) {
1972
2007
  return {
1973
2008
  lifecycle: "active",
@@ -1975,6 +2010,9 @@ function getSystemInterfaceReadinessMarker(model, request) {
1975
2010
  resourceIds: getLeadGenCrmHandoffResourceIds(model)
1976
2011
  };
1977
2012
  }
2013
+ if (request.interfaceKey === "api" && system.apiInterface !== void 0) {
2014
+ return system.apiInterface;
2015
+ }
1978
2016
  return void 0;
1979
2017
  }
1980
2018
  function mergeLeadGenDerivedCatalogs(model) {
@@ -2019,6 +2057,18 @@ function tryCompileBusinessOntology(model, readinessProfile, issues) {
2019
2057
  return void 0;
2020
2058
  }
2021
2059
  }
2060
+ function requireContractReadiness(issues, index, resources, contract, context) {
2061
+ const reads = resourceBindingIds(resources, "reads");
2062
+ const catalogs = resourceBindingIds(resources, "usesCatalogs");
2063
+ for (const objectId of contract.requiredObjects) {
2064
+ requireObjectReadiness(issues, index, objectId, context);
2065
+ requireScopedBinding(issues, reads, "reads", objectId, context);
2066
+ }
2067
+ for (const catalogId of contract.requiredCatalogs) {
2068
+ requireCatalogReadiness(issues, index, catalogId, context);
2069
+ requireScopedBinding(issues, catalogs, "usesCatalogs", catalogId, context);
2070
+ }
2071
+ }
2022
2072
  function computeInterfaceReadiness(model, request) {
2023
2073
  const issues = [];
2024
2074
  const system = getSystem(model, request.systemPath);
@@ -2066,20 +2116,22 @@ function computeInterfaceReadiness(model, request) {
2066
2116
  { path: `${readinessMarkerPath(request)}.lifecycle` }
2067
2117
  );
2068
2118
  }
2069
- const supportedProfile = readinessProfile !== void 0 && SYSTEM_INTERFACE_PROFILES.some((profile) => profile.readinessProfile === readinessProfile);
2070
- if (!supportedProfile) {
2119
+ const checkedReadinessProfile = readinessProfile ?? profileForInterface(request.systemPath, request.interfaceKey);
2120
+ const isBuiltIn = isBuiltInReadinessProfile(checkedReadinessProfile);
2121
+ const readinessContract = systemInterface.readinessContract;
2122
+ if (!isBuiltIn && readinessContract === void 0) {
2071
2123
  addReadinessIssue(
2072
2124
  issues,
2073
2125
  "SYSTEM_INTERFACE_INVALID",
2074
- "unknown-readiness-profile",
2075
- `System Interface "${formatInterfaceIdentity(request.systemPath, request.interfaceKey)}" references unknown readiness profile "${readinessProfile}". Supported profiles: ${formatSupportedReadinessProfiles()}. Custom Systems should not declare apiInterface; route custom behavior through workflows/operations plus ontology, resources, and topology.`,
2076
- { path: `${readinessMarkerPath(request)}.readinessProfile`, ref: readinessProfile }
2126
+ "missing-readiness-contract",
2127
+ `System Interface "${formatInterfaceIdentity(request.systemPath, request.interfaceKey)}" uses custom readiness profile "${checkedReadinessProfile}" but declares no readinessContract. Built-in profiles: ${formatSupportedReadinessProfiles()}.`,
2128
+ { path: `${readinessMarkerPath(request)}.readinessContract`, ref: checkedReadinessProfile }
2077
2129
  );
2078
2130
  return {
2079
2131
  ready: false,
2080
2132
  systemPath: request.systemPath,
2081
2133
  interfaceKey: request.interfaceKey,
2082
- readinessProfile,
2134
+ readinessProfile: checkedReadinessProfile,
2083
2135
  scopedResourceIds,
2084
2136
  issues
2085
2137
  };
@@ -2093,10 +2145,6 @@ function computeInterfaceReadiness(model, request) {
2093
2145
  { path: `${readinessMarkerPath(request)}.resourceIds` }
2094
2146
  );
2095
2147
  }
2096
- const checkedReadinessProfile = readinessProfile;
2097
- if (checkedReadinessProfile === void 0) {
2098
- throw new Error("Supported readiness profile unexpectedly resolved to undefined");
2099
- }
2100
2148
  const resources = getActiveScopedResources(model, scopedResourceIds, issues, request);
2101
2149
  const index = tryCompileBusinessOntology(model, checkedReadinessProfile, issues);
2102
2150
  if (index !== void 0) {
@@ -2108,13 +2156,15 @@ function computeInterfaceReadiness(model, request) {
2108
2156
  requireLeadGenInterfaceReadiness(issues, index, resources, request);
2109
2157
  requireCrmInterfaceReadiness(issues, index, resources, { ...request, allowForeignOwner: true });
2110
2158
  requireHandoffBridgeReadiness(issues, model, request);
2159
+ } else if (readinessContract !== void 0) {
2160
+ requireContractReadiness(issues, index, resources, readinessContract, request);
2111
2161
  }
2112
2162
  }
2113
2163
  return {
2114
2164
  ready: issues.length === 0,
2115
2165
  systemPath: request.systemPath,
2116
2166
  interfaceKey: request.interfaceKey,
2117
- readinessProfile,
2167
+ readinessProfile: checkedReadinessProfile,
2118
2168
  scopedResourceIds,
2119
2169
  issues
2120
2170
  };
@@ -6337,17 +6387,13 @@ var AcqListMetadataSchema = z.object({
6337
6387
  }).catchall(z.unknown());
6338
6388
  var ProspectingBuildTemplateIdSchema = z.string().trim().min(1).max(100);
6339
6389
  var ListStageCountsSchema = z.object({
6340
- // Attempted counts by canonical lead-gen stage. The detailed status
6341
- // distribution lives on ListProgress; telemetry keeps the overview payload small.
6342
- stageCounts: z.object({
6343
- populated: z.number().int(),
6344
- extracted: z.number().int(),
6345
- qualified: z.number().int(),
6346
- discovered: z.number().int(),
6347
- verified: z.number().int(),
6348
- personalized: z.number().int(),
6349
- uploaded: z.number().int()
6350
- }),
6390
+ // Attempted counts keyed by the tenant's declared lead-gen stage catalog IDs.
6391
+ // The catalog is tenant-owned and OM-derived at compute time; the schema
6392
+ // validates the transport shape (string keys → integer values) rather than
6393
+ // a fixed key set, so tenants with custom stages receive complete telemetry.
6394
+ // Canonical Elevasis stages (populated, extracted, qualified, discovered,
6395
+ // verified, personalized, uploaded) are included when declared in the catalog.
6396
+ stageCounts: z.record(z.string().min(1), z.number().int()),
6351
6397
  deliverability: z.object({
6352
6398
  valid: z.number().int(),
6353
6399
  risky: z.number().int(),
@@ -7069,4 +7115,4 @@ function defineWorkflowConfig(resourceId, descriptors, actionRegistry = []) {
7069
7115
  }
7070
7116
  var ListBuilderStageKeySchema = z.string().min(1);
7071
7117
 
7072
- export { ActivityEventSchema, BuildPlanSnapshotStepSchema, ProspectingBuildTemplateSchema as BuildTemplateSchema, ContractRefResolutionError, CrmStageKeySchema, CrmStateKeySchema, EmailSchema, ExecutionError, ListBuilderStageKeySchema, ProcessingStageStatusSchema, RegistryValidationError, ResourceRegistry, StepType, ToolingError, bindResourceDescriptor, compileBusinessOntologyValidationIndex, concurrentPool, createLeadGenStageValidators, defineContract, defineResource, defineResourceOntology, defineResources, defineStep, defineTopology, defineTopologyRelationship, defineWorkflow, defineWorkflowConfig, deriveActions, diagnosticOutput, integrationInput, isZodType, parseTopologyNodeRef, projectDeploymentSpec, projectTopologyRelationships, resolveContractRef, runDiagnostic, splitName, toSdkResourceDescriptor, topologyRef, topologyRelationship, validateDeclaredSystemInterfaceReadiness, validateResourceGovernance, withPlatformAgentResourceDescriptor, withPlatformAgentResourceDescriptors, withPlatformIntegrationResourceDescriptor, withPlatformIntegrationResourceDescriptors, withPlatformResourceDescriptor, withPlatformResourceDescriptors };
7118
+ export { ActivityEventSchema, BuildPlanSnapshotStepSchema, ProspectingBuildTemplateSchema as BuildTemplateSchema, ContractRefResolutionError, CrmStageKeySchema, CrmStateKeySchema, EmailSchema, ExecutionError, ListBuilderStageKeySchema, ProcessingStageStatusSchema, RegistryValidationError, ResourceRegistry, StepType, ToolingError, bindResourceDescriptor, compileBusinessOntologyValidationIndex, concurrentPool, createLeadGenStageValidators, defineContract, defineResource, defineResourceOntology, defineResources, defineStep, defineTopology, defineTopologyRelationship, defineWorkflow, defineWorkflowConfig, deriveActions, diagnosticOutput, integrationInput, isBuiltInReadinessProfile, isZodType, lookupReadinessProfile, parseTopologyNodeRef, profileForInterface, projectDeploymentSpec, projectTopologyRelationships, registerReadinessProfile, resolveContractRef, runDiagnostic, splitName, toSdkResourceDescriptor, topologyRef, topologyRelationship, validateDeclaredSystemInterfaceReadiness, validateResourceGovernance, withPlatformAgentResourceDescriptor, withPlatformAgentResourceDescriptors, withPlatformIntegrationResourceDescriptor, withPlatformIntegrationResourceDescriptors, withPlatformResourceDescriptor, withPlatformResourceDescriptors };
@@ -1396,12 +1396,13 @@ declare const SystemApiInterfaceSchema: z.ZodObject<{
1396
1396
  archived: "archived";
1397
1397
  disabled: "disabled";
1398
1398
  }>>;
1399
- readinessProfile: z.ZodOptional<z.ZodEnum<{
1400
- "sales.lead-gen.api": "sales.lead-gen.api";
1401
- "sales.crm.api": "sales.crm.api";
1402
- "sales.lead-gen.crm-handoff": "sales.lead-gen.crm-handoff";
1403
- }>>;
1399
+ readinessProfile: z.ZodOptional<z.ZodString>;
1404
1400
  resourceIds: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
1401
+ readinessContract: z.ZodOptional<z.ZodObject<{
1402
+ requiredObjects: z.ZodDefault<z.ZodArray<z.ZodString>>;
1403
+ requiredCatalogs: z.ZodDefault<z.ZodArray<z.ZodString>>;
1404
+ requiredKinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
1405
+ }, z.core.$strict>>;
1405
1406
  }, z.core.$strict>;
1406
1407
  type JsonPrimitive = string | number | boolean | null;
1407
1408
  type JsonValue = JsonPrimitive | JsonValue[] | {
@@ -5945,12 +5945,13 @@ declare const SystemApiInterfaceSchema: z.ZodObject<{
5945
5945
  archived: "archived";
5946
5946
  disabled: "disabled";
5947
5947
  }>>;
5948
- readinessProfile: z.ZodOptional<z.ZodEnum<{
5949
- "sales.lead-gen.api": "sales.lead-gen.api";
5950
- "sales.crm.api": "sales.crm.api";
5951
- "sales.lead-gen.crm-handoff": "sales.lead-gen.crm-handoff";
5952
- }>>;
5948
+ readinessProfile: z.ZodOptional<z.ZodString>;
5953
5949
  resourceIds: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString>>>;
5950
+ readinessContract: z.ZodOptional<z.ZodObject<{
5951
+ requiredObjects: z.ZodDefault<z.ZodArray<z.ZodString>>;
5952
+ requiredCatalogs: z.ZodDefault<z.ZodArray<z.ZodString>>;
5953
+ requiredKinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
5954
+ }, z.core.$strict>>;
5954
5955
  }, z.core.$strict>;
5955
5956
  type JsonPrimitive = string | number | boolean | null;
5956
5957
  type JsonValue = JsonPrimitive | JsonValue[] | {
@@ -7561,17 +7561,13 @@ var AcqListMetadataSchema = z.object({
7561
7561
  }).catchall(z.unknown());
7562
7562
  var ProspectingBuildTemplateIdSchema = z.string().trim().min(1).max(100);
7563
7563
  var ListStageCountsSchema = z.object({
7564
- // Attempted counts by canonical lead-gen stage. The detailed status
7565
- // distribution lives on ListProgress; telemetry keeps the overview payload small.
7566
- stageCounts: z.object({
7567
- populated: z.number().int(),
7568
- extracted: z.number().int(),
7569
- qualified: z.number().int(),
7570
- discovered: z.number().int(),
7571
- verified: z.number().int(),
7572
- personalized: z.number().int(),
7573
- uploaded: z.number().int()
7574
- }),
7564
+ // Attempted counts keyed by the tenant's declared lead-gen stage catalog IDs.
7565
+ // The catalog is tenant-owned and OM-derived at compute time; the schema
7566
+ // validates the transport shape (string keys → integer values) rather than
7567
+ // a fixed key set, so tenants with custom stages receive complete telemetry.
7568
+ // Canonical Elevasis stages (populated, extracted, qualified, discovered,
7569
+ // verified, personalized, uploaded) are included when declared in the catalog.
7570
+ stageCounts: z.record(z.string().min(1), z.number().int()),
7575
7571
  deliverability: z.object({
7576
7572
  valid: z.number().int(),
7577
7573
  risky: z.number().int(),
@@ -8775,17 +8771,48 @@ var SYSTEM_INTERFACE_PROFILES = [
8775
8771
  var SYSTEM_INTERFACE_READINESS_PROFILES = SYSTEM_INTERFACE_PROFILES.map(
8776
8772
  (profile) => profile.readinessProfile
8777
8773
  );
8778
- var SystemInterfaceReadinessProfileSchema = z.enum(SYSTEM_INTERFACE_READINESS_PROFILES);
8774
+ var SystemInterfaceReadinessProfileSchema = z.string().trim().min(1);
8779
8775
  var SystemInterfaceResourceScopeSchema = z.array(ModelIdSchema).default([]);
8776
+ var SystemApiInterfaceReadinessContractSchema = z.object({
8777
+ /** Ontology IDs of object types the interface depends on. */
8778
+ requiredObjects: z.array(z.string().trim().min(1)).default([]),
8779
+ /** Ontology IDs of catalog types the interface requires (must be non-empty). */
8780
+ requiredCatalogs: z.array(z.string().trim().min(1)).default([]),
8781
+ /** Optional ontology kind filters (reserved for future profile extensions). */
8782
+ requiredKinds: z.array(z.string().trim().min(1)).optional()
8783
+ }).strict();
8780
8784
  var SystemApiInterfaceSchema = z.object({
8781
8785
  lifecycle: SystemInterfaceLifecycleSchema.default("active"),
8786
+ /**
8787
+ * Open-string profile id. Built-in platform presets are looked up through
8788
+ * the profile registry; custom ids are validated structurally via
8789
+ * `readinessContract`. Optional — `profileForInterface` provides a default.
8790
+ */
8782
8791
  readinessProfile: SystemInterfaceReadinessProfileSchema.optional(),
8783
8792
  /**
8784
8793
  * Resource ids that participate in this API interface. This scopes readiness
8785
8794
  * derivation without duplicating authored required/provided contract refs.
8786
8795
  */
8787
- resourceIds: SystemInterfaceResourceScopeSchema.optional()
8796
+ resourceIds: SystemInterfaceResourceScopeSchema.optional(),
8797
+ /**
8798
+ * Tenant-authorable readiness declaration. Required for custom
8799
+ * (non-built-in) profile ids so structural validation can proceed. Built-in
8800
+ * profiles ignore this field (requirements are derived from platform code).
8801
+ */
8802
+ readinessContract: SystemApiInterfaceReadinessContractSchema.optional()
8788
8803
  }).strict();
8804
+ var _profileRegistry = new Map(
8805
+ SYSTEM_INTERFACE_READINESS_PROFILES.map((profileId) => [
8806
+ profileId,
8807
+ { profileId, kind: "built-in" }
8808
+ ])
8809
+ );
8810
+ function profileForInterface(systemPath, interfaceKey, readinessProfile) {
8811
+ return readinessProfile ?? `${systemPath}.${interfaceKey}`;
8812
+ }
8813
+ function isBuiltInReadinessProfile(profileId) {
8814
+ return _profileRegistry.get(profileId)?.kind === "built-in";
8815
+ }
8789
8816
  z.object({
8790
8817
  systemPath: SystemPathSchema,
8791
8818
  interfaceKey: SystemInterfaceKeySchema
@@ -9032,14 +9059,11 @@ function addReadinessIssue(issues, family, code, message, details = {}) {
9032
9059
  function formatInterfaceIdentity(systemPath, interfaceKey) {
9033
9060
  return `${systemPath}/${interfaceKey}`;
9034
9061
  }
9035
- function profileForInterface(systemPath, interfaceKey, readinessProfile) {
9036
- return readinessProfile ?? `${systemPath}.${interfaceKey}`;
9037
- }
9038
9062
  function readinessMarkerPath(context) {
9039
9063
  return context.interfaceKey === "api" ? `systems.${context.systemPath}.apiInterface` : `systems.${context.systemPath}.derivedCrmHandoffReadiness`;
9040
9064
  }
9041
9065
  function formatSupportedReadinessProfiles() {
9042
- return SYSTEM_INTERFACE_READINESS_PROFILES.map((profile) => `"${profile}"`).join(", ");
9066
+ return SYSTEM_INTERFACE_PROFILES.map((p3) => `"${p3.readinessProfile}"`).join(", ");
9043
9067
  }
9044
9068
  function getActiveScopedResources(model, resourceIds, issues, context) {
9045
9069
  const resources = [];
@@ -9231,9 +9255,6 @@ function getLeadGenCrmHandoffResourceIds(model) {
9231
9255
  function getSystemInterfaceReadinessMarker(model, request) {
9232
9256
  const system = getSystem(model, request.systemPath);
9233
9257
  if (system === void 0) return void 0;
9234
- if (request.interfaceKey === LEAD_GEN_API_INTERFACE.interfaceKey) {
9235
- return system.apiInterface;
9236
- }
9237
9258
  if (request.systemPath === LEAD_GEN_CRM_HANDOFF_INTERFACE.systemPath && request.interfaceKey === LEAD_GEN_CRM_HANDOFF_INTERFACE.interfaceKey) {
9238
9259
  return {
9239
9260
  lifecycle: "active",
@@ -9241,6 +9262,9 @@ function getSystemInterfaceReadinessMarker(model, request) {
9241
9262
  resourceIds: getLeadGenCrmHandoffResourceIds(model)
9242
9263
  };
9243
9264
  }
9265
+ if (request.interfaceKey === "api" && system.apiInterface !== void 0) {
9266
+ return system.apiInterface;
9267
+ }
9244
9268
  return void 0;
9245
9269
  }
9246
9270
  function mergeLeadGenDerivedCatalogs(model) {
@@ -9285,6 +9309,18 @@ function tryCompileBusinessOntology(model, readinessProfile, issues) {
9285
9309
  return void 0;
9286
9310
  }
9287
9311
  }
9312
+ function requireContractReadiness(issues, index2, resources, contract, context) {
9313
+ const reads = resourceBindingIds(resources, "reads");
9314
+ const catalogs = resourceBindingIds(resources, "usesCatalogs");
9315
+ for (const objectId of contract.requiredObjects) {
9316
+ requireObjectReadiness(issues, index2, objectId, context);
9317
+ requireScopedBinding(issues, reads, "reads", objectId, context);
9318
+ }
9319
+ for (const catalogId of contract.requiredCatalogs) {
9320
+ requireCatalogReadiness(issues, index2, catalogId, context);
9321
+ requireScopedBinding(issues, catalogs, "usesCatalogs", catalogId, context);
9322
+ }
9323
+ }
9288
9324
  function computeInterfaceReadiness(model, request) {
9289
9325
  const issues = [];
9290
9326
  const system = getSystem(model, request.systemPath);
@@ -9332,20 +9368,22 @@ function computeInterfaceReadiness(model, request) {
9332
9368
  { path: `${readinessMarkerPath(request)}.lifecycle` }
9333
9369
  );
9334
9370
  }
9335
- const supportedProfile = readinessProfile !== void 0 && SYSTEM_INTERFACE_PROFILES.some((profile) => profile.readinessProfile === readinessProfile);
9336
- if (!supportedProfile) {
9371
+ const checkedReadinessProfile = readinessProfile ?? profileForInterface(request.systemPath, request.interfaceKey);
9372
+ const isBuiltIn = isBuiltInReadinessProfile(checkedReadinessProfile);
9373
+ const readinessContract = systemInterface.readinessContract;
9374
+ if (!isBuiltIn && readinessContract === void 0) {
9337
9375
  addReadinessIssue(
9338
9376
  issues,
9339
9377
  "SYSTEM_INTERFACE_INVALID",
9340
- "unknown-readiness-profile",
9341
- `System Interface "${formatInterfaceIdentity(request.systemPath, request.interfaceKey)}" references unknown readiness profile "${readinessProfile}". Supported profiles: ${formatSupportedReadinessProfiles()}. Custom Systems should not declare apiInterface; route custom behavior through workflows/operations plus ontology, resources, and topology.`,
9342
- { path: `${readinessMarkerPath(request)}.readinessProfile`, ref: readinessProfile }
9378
+ "missing-readiness-contract",
9379
+ `System Interface "${formatInterfaceIdentity(request.systemPath, request.interfaceKey)}" uses custom readiness profile "${checkedReadinessProfile}" but declares no readinessContract. Built-in profiles: ${formatSupportedReadinessProfiles()}.`,
9380
+ { path: `${readinessMarkerPath(request)}.readinessContract`, ref: checkedReadinessProfile }
9343
9381
  );
9344
9382
  return {
9345
9383
  ready: false,
9346
9384
  systemPath: request.systemPath,
9347
9385
  interfaceKey: request.interfaceKey,
9348
- readinessProfile,
9386
+ readinessProfile: checkedReadinessProfile,
9349
9387
  scopedResourceIds,
9350
9388
  issues
9351
9389
  };
@@ -9359,10 +9397,6 @@ function computeInterfaceReadiness(model, request) {
9359
9397
  { path: `${readinessMarkerPath(request)}.resourceIds` }
9360
9398
  );
9361
9399
  }
9362
- const checkedReadinessProfile = readinessProfile;
9363
- if (checkedReadinessProfile === void 0) {
9364
- throw new Error("Supported readiness profile unexpectedly resolved to undefined");
9365
- }
9366
9400
  const resources = getActiveScopedResources(model, scopedResourceIds, issues, request);
9367
9401
  const index2 = tryCompileBusinessOntology(model, checkedReadinessProfile, issues);
9368
9402
  if (index2 !== void 0) {
@@ -9374,13 +9408,15 @@ function computeInterfaceReadiness(model, request) {
9374
9408
  requireLeadGenInterfaceReadiness(issues, index2, resources, request);
9375
9409
  requireCrmInterfaceReadiness(issues, index2, resources, { ...request, allowForeignOwner: true });
9376
9410
  requireHandoffBridgeReadiness(issues, model, request);
9411
+ } else if (readinessContract !== void 0) {
9412
+ requireContractReadiness(issues, index2, resources, readinessContract, request);
9377
9413
  }
9378
9414
  }
9379
9415
  return {
9380
9416
  ready: issues.length === 0,
9381
9417
  systemPath: request.systemPath,
9382
9418
  interfaceKey: request.interfaceKey,
9383
- readinessProfile,
9419
+ readinessProfile: checkedReadinessProfile,
9384
9420
  scopedResourceIds,
9385
9421
  issues
9386
9422
  };
@@ -5537,17 +5537,13 @@ var AcqListMetadataSchema = z.object({
5537
5537
  }).catchall(z.unknown());
5538
5538
  var ProspectingBuildTemplateIdSchema = z.string().trim().min(1).max(100);
5539
5539
  var ListStageCountsSchema = z.object({
5540
- // Attempted counts by canonical lead-gen stage. The detailed status
5541
- // distribution lives on ListProgress; telemetry keeps the overview payload small.
5542
- stageCounts: z.object({
5543
- populated: z.number().int(),
5544
- extracted: z.number().int(),
5545
- qualified: z.number().int(),
5546
- discovered: z.number().int(),
5547
- verified: z.number().int(),
5548
- personalized: z.number().int(),
5549
- uploaded: z.number().int()
5550
- }),
5540
+ // Attempted counts keyed by the tenant's declared lead-gen stage catalog IDs.
5541
+ // The catalog is tenant-owned and OM-derived at compute time; the schema
5542
+ // validates the transport shape (string keys → integer values) rather than
5543
+ // a fixed key set, so tenants with custom stages receive complete telemetry.
5544
+ // Canonical Elevasis stages (populated, extracted, qualified, discovered,
5545
+ // verified, personalized, uploaded) are included when declared in the catalog.
5546
+ stageCounts: z.record(z.string().min(1), z.number().int()),
5551
5547
  deliverability: z.object({
5552
5548
  valid: z.number().int(),
5553
5549
  risky: z.number().int(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/sdk",
3
- "version": "1.36.4",
3
+ "version": "1.37.0",
4
4
  "description": "SDK for building Elevasis organization resources",
5
5
  "type": "module",
6
6
  "bin": {
@@ -58,7 +58,7 @@
58
58
  "tsup": "^8.0.0",
59
59
  "typescript": "5.9.2",
60
60
  "zod": "^4.1.0",
61
- "@repo/core": "0.50.0",
61
+ "@repo/core": "0.53.0",
62
62
  "@repo/eslint-config": "0.0.0",
63
63
  "@repo/typescript-config": "0.0.0"
64
64
  },