CdpDataStreams:'Data Streams are unavailable for this org/user. Review Data Cloud Setup provisioning, ingestion-related feature availability, and source connector permissions before using preparing-datacloud.',
CdpIdentityResolution:'Identity Resolution is unavailable for this org/user. Review Data Cloud harmonization/identity-resolution entitlements and the user\'s Data Cloud permissions before using harmonizing-datacloud for IR work.',
CdpActivationTarget:'Activation Targets are unavailable for this org/user. Review activation permissions, destination setup, and any org-specific activation enablement before using activating-datacloud.',
CdpActivationExternalPlatform:'Activation destination platforms are unavailable for this org/user. Review Activation Targets setup, destination auth/configuration, and any feature toggles exposed in Data Cloud Setup → Feature Manager.',
CdpDataSpace:'Data Spaces are unavailable for this org/user. Review core Data Cloud provisioning and user permissions in Data Cloud Setup before assuming downstream phases can work.',
};
constCAVEATS=[
'sf data360 doctor is advisory only: the current upstream command checks the search-index endpoint, not every Data Cloud module.',
'Do not use query describe as a universal tenant probe. Run it only after confirming broader readiness and only against a known DMO or DLO table.',
'Core Data Cloud provisioning, tenant creation, and license assignment are not reliably exposed as a full CLI enablement flow. Use CLI detection plus Setup guidance instead of promising fully programmatic enablement.',
reason:'The query service could not resolve a CDP tenant for this org context. Confirm broader readiness with data-space, DMO, or doctor probes before declaring Data Cloud fully disabled.',
};
}
if(text.includes('This feature is not currently enabled for this user type or org')){
reason:FEATURE_GUIDANCE[featureCode]??'This capability is gated for the current org or user. Review provisioning, permissions, and any relevant setup toggles before proceeding.',
};
}
if(text.includes('NOT_FOUND: DataModelEntity')){
return{
state:'table_not_found',
code:'DATA_MODEL_ENTITY_NOT_FOUND',
reason:'The specified DMO or DLO table name is not queryable in this org. Pick a real table from dmo list / dlo list or use dmo get first.',
};
}
if(text.includes('Request failed')){
return{
state:'request_failed',
code:'REQUEST_FAILED',
reason:'The endpoint returned a generic request failure. Treat this as inconclusive and confirm readiness with adjacent read-only probes.',
};
}
if(text.includes('is not a sf command')||text.includes('not installed or not on PATH')){
return{
state:'runtime_missing',
code:'RUNTIME_MISSING',
reason:'The sf data360 runtime is not available. Install or relink the community plugin first.',
};
}
if(text.includes('Timed out after')){
return{
state:'timeout',
code:'TIMEOUT',
reason:'The probe timed out. Retry, reduce the scope, or fall back to a smaller read-only command family.',
};
}
return{
state:'unknown_error',
code:'UNKNOWN_ERROR',
reason:'The probe failed for an unclassified reason. Inspect the raw message and confirm readiness with neighboring probes.',
`${scope}: query-specific tenant lookup failed. Do not treat this as a global Data Cloud outage by itself. Re-check core probes such as data-space list, dmo list, and doctor, then use a known table name if you retry query describe.`,
];
}
if(probe.state==='feature_gated'){
return[`${scope}: ${probe.reason}`];
}
if(probe.state==='table_not_found'){
return[`${scope}: ${probe.reason}`];
}
if(probe.state==='request_failed'){
return[
`${scope}: ${probe.reason}`,
'If doctor is the failing probe, remember that it only checks search indexes; use adjacent read-only probes before deciding the whole org is blocked.',
:{...classifyError(runtimeCheck.stderr||runtimeCheck.stdout||runtimeCheck.errorMessage||'sf data360 runtime is unavailable'),command:runtimeCheck.command};
uniqueGuidance.add('At least one core Data Cloud probe succeeded. Treat individual query or feature-gate failures as scoped issues, not automatic proof that the whole product is disabled.');
}
uniqueGuidance.add('For core provisioning, tenant creation, or license assignment gaps, use Setup → Data Cloud Setup and the current standard Data Cloud permission sets. Feature Manager can expose some org-specific toggles, but it is not the source of truth for every missing capability.');