@singi-labs/sifa-sdk 0.19.41 → 0.19.42

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.cts CHANGED
@@ -967,6 +967,12 @@ declare function formatTimelineDate(dateStr: string): string;
967
967
  * and ongoing entries (showPresent defaults to true).
968
968
  */
969
969
  declare function formatDateRange(start?: string, end?: string, showPresent?: boolean): string;
970
+ /**
971
+ * Format a position's dates. A role whose start month has not arrived yet (an
972
+ * accepted offer) reads "Starts Jan 2027" rather than "Jan 2027 - Present",
973
+ * which would claim it is already under way (sifa-workspace#581).
974
+ */
975
+ declare function formatPositionDateRange(start?: string, end?: string, now?: Date): string;
970
976
 
971
977
  /** A long contributor list reduced to what the collapsed view shows. */
972
978
  interface CollapsedContributors<T> {
@@ -2295,6 +2301,9 @@ declare function countFilledDimensions(input: ProfileDimensionInputs | Profile):
2295
2301
  * It is never surfaced as the featured role — hidden wins over `primary`, so a
2296
2302
  * role flagged both hidden and primary is excluded rather than featured.
2297
2303
  *
2304
+ * A position whose start month has not arrived yet (an accepted offer) is not
2305
+ * active: it is nobody's current role until it starts (sifa-workspace#581).
2306
+ *
2298
2307
  * Rules (in order):
2299
2308
  * 1. A position the user explicitly flagged `primary` AND that is still active AND not hidden.
2300
2309
  * 2. Otherwise, the active, non-hidden position with the most recent `startedAt`.
@@ -2306,7 +2315,45 @@ interface PrimaryPositionCandidate {
2306
2315
  primary?: boolean;
2307
2316
  hidden?: boolean;
2308
2317
  }
2309
- declare function pickPrimaryPosition<T extends PrimaryPositionCandidate>(positions: readonly T[] | undefined): T | undefined;
2318
+ declare function pickPrimaryPosition<T extends PrimaryPositionCandidate>(positions: readonly T[] | undefined, now?: Date): T | undefined;
2319
+
2320
+ /**
2321
+ * How far ahead a profile date may lie, per kind of date (sifa-workspace#581).
2322
+ *
2323
+ * A date that records something which already happened (a credential being
2324
+ * issued, an award, the end of a finished role) cannot be in the future. Some
2325
+ * dates are naturally a little ahead: an accepted job or a forthcoming paper,
2326
+ * a booked talk, an expected graduation. A credential's expiry has no cap.
2327
+ *
2328
+ * One table, so the editors on every client apply the same limits.
2329
+ */
2330
+ declare const DATE_LOOKAHEAD_MONTHS: {
2331
+ readonly credentialIssue: 0;
2332
+ readonly award: 0;
2333
+ readonly course: 0;
2334
+ readonly involvementStart: 0;
2335
+ readonly investmentStart: 0;
2336
+ /** The end date of any finished (not ongoing) range. */
2337
+ readonly completedRangeEnd: 0;
2338
+ readonly careerStart: 12;
2339
+ readonly projectStart: 12;
2340
+ readonly publication: 12;
2341
+ readonly talk: 24;
2342
+ readonly educationEnd: 96;
2343
+ };
2344
+ type DateLookaheadKind = keyof typeof DATE_LOOKAHEAD_MONTHS;
2345
+ /**
2346
+ * Is a partial date (`YYYY`, `YYYY-MM`, or `YYYY-MM-DD`) more than `months`
2347
+ * months after the current month? Compared at year-month resolution. A bare
2348
+ * year counts from its first month, so the current year always passes. A
2349
+ * malformed or empty value is never "beyond" (other validation handles it).
2350
+ */
2351
+ declare function isBeyondLookahead(value: string, months: number, now?: Date): boolean;
2352
+ /**
2353
+ * Has a start date not arrived yet? A role that starts next month is shown as
2354
+ * upcoming, and is not anyone's current role until its start month.
2355
+ */
2356
+ declare function isUpcomingStart(startedAt: string | undefined, now?: Date): boolean;
2310
2357
 
2311
2358
  /**
2312
2359
  * Shared "which item did the user flag as primary?" rule for the profile
@@ -3041,4 +3088,4 @@ declare function roadmapIssueUrl(issue: number): string;
3041
3088
  */
3042
3089
  declare const SIFA_SDK_VERSION: string;
3043
3090
 
3044
- export { ACTIVITY_TIERS, ACTIVITY_VERBS, ACTIVITY_VISIBILITY_RULES, ALL_SECTIONS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, ARTIFACT_LINK_KIND_LABELS, ARTIFACT_LINK_KIND_OPTIONS, AccountFacetMode, type AccountVerification, type ActivityItem, type ActivityItemForUrl, type ActivityTaxonomy, type ActivityTier, type ActivityVerbMap, AgentRef, type AgentRefFlat, type AppCategoryId, type AppUrlPatterns, type AppWithId, type ArtifactLinkKindOption, type BuildProfileHighlightsOptions, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPANY_PAGE_MIN_FIRMOGRAPHIC_FIELDS, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, COURSE_ROLE_LABELS, COURSE_ROLE_OPTIONS, COURSE_ROLE_TAKEN, COURSE_ROLE_TAUGHT, COURSE_ROLE_TEACHING_ASSISTANT, type CardHealth, type CardHealthStrategy, type CollapseContributorsOptions, type CollapsedContributors, type CompanyFirmographics, type ContinentCode, type CourseRoleOption, type CsvRow, DIMENSIONS_MAX_SCORE, type DailyActivityCount, type DimensionKey, type DimensionMap, type DisambiguationFields, type DisplayUrl, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, EQF_LEVEL_LABELS, EQF_LEVEL_OPTIONS, type EmbedResult, type EmploymentTypeGroup, type EmploymentTypeOption, type EntityRefAnchor, EntitySearchResult, type EqfLevel, type EqfLevelOption, type FormatDisplayUrlOptions, type GroupPublicationVersionsOptions, INDUSTRY_LABELS, INDUSTRY_OPTIONS, INVESTMENT_ROLE_LABELS, INVESTMENT_ROLE_OPTIONS, INVESTMENT_STAGE_LABELS, INVESTMENT_STAGE_OPTIONS, INVESTMENT_STATUS_LABELS, INVESTMENT_STATUS_OPTIONS, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, type IndustryOption, type InvestmentOption, type InvolvementGroup, type InvolvementKindOption, type KnownAppId, type LexiconEntry, type LocationSegment, type LocationSegmentKind, type LocationSegmentsOptions, LocationValue, MIN_SKILLS, type MergedProfileSkill, ON_BEHALF_OF_EMPLOYMENT_TYPES, OPEN_TO_GROUP_LABELS, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_LABELS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, type OpenToGroup, type OpenToOption, OrgProfileRecord, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PUBLICATION_TYPE_LABELS, PUBLICATION_TYPE_OPTIONS, PUBLISHERS, type ParsedDelivery, type ParsedEndorsementComment, type ParsedPresentation, type PdsProvider, PdsProviderInfo, type PersonalFacetContent, type PlatformId, type PresentationDeliverySummary, PresentationDuration, type PresentationLinkTypeOption, type PresentationRoleOption, type PrimaryFlagCandidate, type PrimaryPositionCandidate, Profile, ProfileCertification, type ProfileCompletion, type ProfileDimensionInputs, ProfileEducation, type ProfileHighlightSection, type ProfileHighlightStatus, type ProfileHighlightTile, type ProfileHighlightsInput, ProfileHonor, ProfileInvolvement, ProfileLanguage, ProfilePosition, ProfilePresentationDelivery, ProfilePresentationDeliveryRecord, ProfilePresentationRecord, ProfileProject, ProfilePublication, ProfileSkill, type PublicationTypeOption, type PublicationVersionGroup, type Publisher, ROADMAP_ISSUES_REPO, ROADMAP_ITEM_META, RelatedIdentifier, type RgbColor, type RoadmapItemMeta, SEARCH_FILTER_DEFS, SECTION_GROUPS, SECTION_LABELS, SELF_APP_ID, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, STREAM_VERBS, type SearchFilterControl, type SearchFilterDef, type SearchFilterOptionSource, type SectionGroupId, type SectionId, type SkillCategory, type StreamAddress, type StreamAuthor, type StreamCardBody, type StreamCardSubject, type StreamCardVM, type StreamExternalLink, type StreamGeo, type StreamMedia, type StreamMediaBase, type StreamMediaBlob, type StreamMediaResolved, type StreamRichSegment, type StreamSource, type StreamTheme, type StreamVerb, type TierMeta, type ToStreamCardVMOptions, type UrlPathPolicy, VERIFICATION_PROVIDERS, type VerificationProvider, type VerificationProviderId, type VerificationSource, type VersionablePublication, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, type WorkplaceTypeOption, actorShowsIdentity, buildMetaDescription, buildProfileHighlights, buildTalkSlug, categoryForApp, certDateExtractor, classifyEntityRef, collapseContributors, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countRecentActivity, countryCodeToFlag, dateRangeExtractor, dedupeSkills, detectPdsProvider, dimensionsFromInputs, durationFromMinutes, entityDisambiguationLabel, entityResultKey, excludeSelfApp, filterHidden, findIndustry, formatCompanyName, formatDateRange, formatDisplayUrl, formatDistanceToNow, formatEventDate, formatIsoTitle, formatLocation, formatPresentationDuration, formatRelationship, formatRelativeTime, formatSingleDate, formatSpanDate, formatTimelineDate, getActivityTaxonomyVersion, getActivityTier, getActivityVerbsVersion, getAppCategoryIcon, getAppIdForCollection, getArtifactLinkKindLabel, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getCourseRoleLabel, getDisplayLabel, getEmploymentTypeLabel, getEqfLevelLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabel, getIndustryLabelKey, getInvestmentRoleLabel, getInvestmentStageLabel, getInvestmentStatusLabel, getInvolvementKindHeading, getInvolvementKindLabel, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublicationTypeLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getVerificationProvider, getVisibleSectionIds, getWorkplaceTypeLabel, groupInvolvementByHeading, groupPublicationVersions, groupSkillsByCategory, groupSkillsBySubCategory, groupSkillsForDisplay, hasPersonalProfileContent, hoistPrimary, isAppCategory, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isOnBehalfOfApplicable, isPseudoEmployer, isRegistrableDomainHandle, isRelationalActivity, isRoleLineRedundant, isSectionPopulated, isSelfAuthoredRich, isTeachingCourse, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, locationSegments, looksLikeDomain, meetsContrastAA, normalizeCompanyKey, normalizeDoi, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeSkillCategory, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseEndorsementComment, parseIntendedAudiences, parseLocationString, parsePresentationDuration, parseTalkRkey, pdsProviderFromApi, pickPrimaryFlagged, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, readEqfLevel, relativeLuminance, renderAsLine, rendersCompanyProfile, rendersPersonalProfile, resolveAccountFacetMode, resolveAgentRef, resolveCardHealth, resolveCardUrl, resolveEmbed, resolveVerifierProvider, rgbToString, roadmapIssueUrl, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, shouldRenderHighlights, singleDateExtractor, slugifyTitle, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, splitCoursesByRole, streamAddressSchema, streamAuthorSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamRichSegmentSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, suggestEqfLevelFromDegree, summarizePresentationDeliveries, toStreamCardVM, toStreamCardVMs, truncateGraphemes, verbForCollection, visibleItems, youtubeThumbnailUrl, youtubeVideoId };
3091
+ export { ACTIVITY_TIERS, ACTIVITY_VERBS, ACTIVITY_VISIBILITY_RULES, ALL_SECTIONS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, ARTIFACT_LINK_KIND_LABELS, ARTIFACT_LINK_KIND_OPTIONS, AccountFacetMode, type AccountVerification, type ActivityItem, type ActivityItemForUrl, type ActivityTaxonomy, type ActivityTier, type ActivityVerbMap, AgentRef, type AgentRefFlat, type AppCategoryId, type AppUrlPatterns, type AppWithId, type ArtifactLinkKindOption, type BuildProfileHighlightsOptions, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPANY_PAGE_MIN_FIRMOGRAPHIC_FIELDS, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, COURSE_ROLE_LABELS, COURSE_ROLE_OPTIONS, COURSE_ROLE_TAKEN, COURSE_ROLE_TAUGHT, COURSE_ROLE_TEACHING_ASSISTANT, type CardHealth, type CardHealthStrategy, type CollapseContributorsOptions, type CollapsedContributors, type CompanyFirmographics, type ContinentCode, type CourseRoleOption, type CsvRow, DATE_LOOKAHEAD_MONTHS, DIMENSIONS_MAX_SCORE, type DailyActivityCount, type DateLookaheadKind, type DimensionKey, type DimensionMap, type DisambiguationFields, type DisplayUrl, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, EQF_LEVEL_LABELS, EQF_LEVEL_OPTIONS, type EmbedResult, type EmploymentTypeGroup, type EmploymentTypeOption, type EntityRefAnchor, EntitySearchResult, type EqfLevel, type EqfLevelOption, type FormatDisplayUrlOptions, type GroupPublicationVersionsOptions, INDUSTRY_LABELS, INDUSTRY_OPTIONS, INVESTMENT_ROLE_LABELS, INVESTMENT_ROLE_OPTIONS, INVESTMENT_STAGE_LABELS, INVESTMENT_STAGE_OPTIONS, INVESTMENT_STATUS_LABELS, INVESTMENT_STATUS_OPTIONS, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, type IndustryOption, type InvestmentOption, type InvolvementGroup, type InvolvementKindOption, type KnownAppId, type LexiconEntry, type LocationSegment, type LocationSegmentKind, type LocationSegmentsOptions, LocationValue, MIN_SKILLS, type MergedProfileSkill, ON_BEHALF_OF_EMPLOYMENT_TYPES, OPEN_TO_GROUP_LABELS, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_LABELS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, type OpenToGroup, type OpenToOption, OrgProfileRecord, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PUBLICATION_TYPE_LABELS, PUBLICATION_TYPE_OPTIONS, PUBLISHERS, type ParsedDelivery, type ParsedEndorsementComment, type ParsedPresentation, type PdsProvider, PdsProviderInfo, type PersonalFacetContent, type PlatformId, type PresentationDeliverySummary, PresentationDuration, type PresentationLinkTypeOption, type PresentationRoleOption, type PrimaryFlagCandidate, type PrimaryPositionCandidate, Profile, ProfileCertification, type ProfileCompletion, type ProfileDimensionInputs, ProfileEducation, type ProfileHighlightSection, type ProfileHighlightStatus, type ProfileHighlightTile, type ProfileHighlightsInput, ProfileHonor, ProfileInvolvement, ProfileLanguage, ProfilePosition, ProfilePresentationDelivery, ProfilePresentationDeliveryRecord, ProfilePresentationRecord, ProfileProject, ProfilePublication, ProfileSkill, type PublicationTypeOption, type PublicationVersionGroup, type Publisher, ROADMAP_ISSUES_REPO, ROADMAP_ITEM_META, RelatedIdentifier, type RgbColor, type RoadmapItemMeta, SEARCH_FILTER_DEFS, SECTION_GROUPS, SECTION_LABELS, SELF_APP_ID, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, STREAM_VERBS, type SearchFilterControl, type SearchFilterDef, type SearchFilterOptionSource, type SectionGroupId, type SectionId, type SkillCategory, type StreamAddress, type StreamAuthor, type StreamCardBody, type StreamCardSubject, type StreamCardVM, type StreamExternalLink, type StreamGeo, type StreamMedia, type StreamMediaBase, type StreamMediaBlob, type StreamMediaResolved, type StreamRichSegment, type StreamSource, type StreamTheme, type StreamVerb, type TierMeta, type ToStreamCardVMOptions, type UrlPathPolicy, VERIFICATION_PROVIDERS, type VerificationProvider, type VerificationProviderId, type VerificationSource, type VersionablePublication, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, type WorkplaceTypeOption, actorShowsIdentity, buildMetaDescription, buildProfileHighlights, buildTalkSlug, categoryForApp, certDateExtractor, classifyEntityRef, collapseContributors, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countRecentActivity, countryCodeToFlag, dateRangeExtractor, dedupeSkills, detectPdsProvider, dimensionsFromInputs, durationFromMinutes, entityDisambiguationLabel, entityResultKey, excludeSelfApp, filterHidden, findIndustry, formatCompanyName, formatDateRange, formatDisplayUrl, formatDistanceToNow, formatEventDate, formatIsoTitle, formatLocation, formatPositionDateRange, formatPresentationDuration, formatRelationship, formatRelativeTime, formatSingleDate, formatSpanDate, formatTimelineDate, getActivityTaxonomyVersion, getActivityTier, getActivityVerbsVersion, getAppCategoryIcon, getAppIdForCollection, getArtifactLinkKindLabel, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getCourseRoleLabel, getDisplayLabel, getEmploymentTypeLabel, getEqfLevelLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabel, getIndustryLabelKey, getInvestmentRoleLabel, getInvestmentStageLabel, getInvestmentStatusLabel, getInvolvementKindHeading, getInvolvementKindLabel, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublicationTypeLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getVerificationProvider, getVisibleSectionIds, getWorkplaceTypeLabel, groupInvolvementByHeading, groupPublicationVersions, groupSkillsByCategory, groupSkillsBySubCategory, groupSkillsForDisplay, hasPersonalProfileContent, hoistPrimary, isAppCategory, isBeyondLookahead, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isOnBehalfOfApplicable, isPseudoEmployer, isRegistrableDomainHandle, isRelationalActivity, isRoleLineRedundant, isSectionPopulated, isSelfAuthoredRich, isTeachingCourse, isUpcomingStart, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, locationSegments, looksLikeDomain, meetsContrastAA, normalizeCompanyKey, normalizeDoi, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeSkillCategory, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseEndorsementComment, parseIntendedAudiences, parseLocationString, parsePresentationDuration, parseTalkRkey, pdsProviderFromApi, pickPrimaryFlagged, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, readEqfLevel, relativeLuminance, renderAsLine, rendersCompanyProfile, rendersPersonalProfile, resolveAccountFacetMode, resolveAgentRef, resolveCardHealth, resolveCardUrl, resolveEmbed, resolveVerifierProvider, rgbToString, roadmapIssueUrl, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, shouldRenderHighlights, singleDateExtractor, slugifyTitle, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, splitCoursesByRole, streamAddressSchema, streamAuthorSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamRichSegmentSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, suggestEqfLevelFromDegree, summarizePresentationDeliveries, toStreamCardVM, toStreamCardVMs, truncateGraphemes, verbForCollection, visibleItems, youtubeThumbnailUrl, youtubeVideoId };
package/dist/index.d.ts CHANGED
@@ -967,6 +967,12 @@ declare function formatTimelineDate(dateStr: string): string;
967
967
  * and ongoing entries (showPresent defaults to true).
968
968
  */
969
969
  declare function formatDateRange(start?: string, end?: string, showPresent?: boolean): string;
970
+ /**
971
+ * Format a position's dates. A role whose start month has not arrived yet (an
972
+ * accepted offer) reads "Starts Jan 2027" rather than "Jan 2027 - Present",
973
+ * which would claim it is already under way (sifa-workspace#581).
974
+ */
975
+ declare function formatPositionDateRange(start?: string, end?: string, now?: Date): string;
970
976
 
971
977
  /** A long contributor list reduced to what the collapsed view shows. */
972
978
  interface CollapsedContributors<T> {
@@ -2295,6 +2301,9 @@ declare function countFilledDimensions(input: ProfileDimensionInputs | Profile):
2295
2301
  * It is never surfaced as the featured role — hidden wins over `primary`, so a
2296
2302
  * role flagged both hidden and primary is excluded rather than featured.
2297
2303
  *
2304
+ * A position whose start month has not arrived yet (an accepted offer) is not
2305
+ * active: it is nobody's current role until it starts (sifa-workspace#581).
2306
+ *
2298
2307
  * Rules (in order):
2299
2308
  * 1. A position the user explicitly flagged `primary` AND that is still active AND not hidden.
2300
2309
  * 2. Otherwise, the active, non-hidden position with the most recent `startedAt`.
@@ -2306,7 +2315,45 @@ interface PrimaryPositionCandidate {
2306
2315
  primary?: boolean;
2307
2316
  hidden?: boolean;
2308
2317
  }
2309
- declare function pickPrimaryPosition<T extends PrimaryPositionCandidate>(positions: readonly T[] | undefined): T | undefined;
2318
+ declare function pickPrimaryPosition<T extends PrimaryPositionCandidate>(positions: readonly T[] | undefined, now?: Date): T | undefined;
2319
+
2320
+ /**
2321
+ * How far ahead a profile date may lie, per kind of date (sifa-workspace#581).
2322
+ *
2323
+ * A date that records something which already happened (a credential being
2324
+ * issued, an award, the end of a finished role) cannot be in the future. Some
2325
+ * dates are naturally a little ahead: an accepted job or a forthcoming paper,
2326
+ * a booked talk, an expected graduation. A credential's expiry has no cap.
2327
+ *
2328
+ * One table, so the editors on every client apply the same limits.
2329
+ */
2330
+ declare const DATE_LOOKAHEAD_MONTHS: {
2331
+ readonly credentialIssue: 0;
2332
+ readonly award: 0;
2333
+ readonly course: 0;
2334
+ readonly involvementStart: 0;
2335
+ readonly investmentStart: 0;
2336
+ /** The end date of any finished (not ongoing) range. */
2337
+ readonly completedRangeEnd: 0;
2338
+ readonly careerStart: 12;
2339
+ readonly projectStart: 12;
2340
+ readonly publication: 12;
2341
+ readonly talk: 24;
2342
+ readonly educationEnd: 96;
2343
+ };
2344
+ type DateLookaheadKind = keyof typeof DATE_LOOKAHEAD_MONTHS;
2345
+ /**
2346
+ * Is a partial date (`YYYY`, `YYYY-MM`, or `YYYY-MM-DD`) more than `months`
2347
+ * months after the current month? Compared at year-month resolution. A bare
2348
+ * year counts from its first month, so the current year always passes. A
2349
+ * malformed or empty value is never "beyond" (other validation handles it).
2350
+ */
2351
+ declare function isBeyondLookahead(value: string, months: number, now?: Date): boolean;
2352
+ /**
2353
+ * Has a start date not arrived yet? A role that starts next month is shown as
2354
+ * upcoming, and is not anyone's current role until its start month.
2355
+ */
2356
+ declare function isUpcomingStart(startedAt: string | undefined, now?: Date): boolean;
2310
2357
 
2311
2358
  /**
2312
2359
  * Shared "which item did the user flag as primary?" rule for the profile
@@ -3041,4 +3088,4 @@ declare function roadmapIssueUrl(issue: number): string;
3041
3088
  */
3042
3089
  declare const SIFA_SDK_VERSION: string;
3043
3090
 
3044
- export { ACTIVITY_TIERS, ACTIVITY_VERBS, ACTIVITY_VISIBILITY_RULES, ALL_SECTIONS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, ARTIFACT_LINK_KIND_LABELS, ARTIFACT_LINK_KIND_OPTIONS, AccountFacetMode, type AccountVerification, type ActivityItem, type ActivityItemForUrl, type ActivityTaxonomy, type ActivityTier, type ActivityVerbMap, AgentRef, type AgentRefFlat, type AppCategoryId, type AppUrlPatterns, type AppWithId, type ArtifactLinkKindOption, type BuildProfileHighlightsOptions, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPANY_PAGE_MIN_FIRMOGRAPHIC_FIELDS, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, COURSE_ROLE_LABELS, COURSE_ROLE_OPTIONS, COURSE_ROLE_TAKEN, COURSE_ROLE_TAUGHT, COURSE_ROLE_TEACHING_ASSISTANT, type CardHealth, type CardHealthStrategy, type CollapseContributorsOptions, type CollapsedContributors, type CompanyFirmographics, type ContinentCode, type CourseRoleOption, type CsvRow, DIMENSIONS_MAX_SCORE, type DailyActivityCount, type DimensionKey, type DimensionMap, type DisambiguationFields, type DisplayUrl, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, EQF_LEVEL_LABELS, EQF_LEVEL_OPTIONS, type EmbedResult, type EmploymentTypeGroup, type EmploymentTypeOption, type EntityRefAnchor, EntitySearchResult, type EqfLevel, type EqfLevelOption, type FormatDisplayUrlOptions, type GroupPublicationVersionsOptions, INDUSTRY_LABELS, INDUSTRY_OPTIONS, INVESTMENT_ROLE_LABELS, INVESTMENT_ROLE_OPTIONS, INVESTMENT_STAGE_LABELS, INVESTMENT_STAGE_OPTIONS, INVESTMENT_STATUS_LABELS, INVESTMENT_STATUS_OPTIONS, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, type IndustryOption, type InvestmentOption, type InvolvementGroup, type InvolvementKindOption, type KnownAppId, type LexiconEntry, type LocationSegment, type LocationSegmentKind, type LocationSegmentsOptions, LocationValue, MIN_SKILLS, type MergedProfileSkill, ON_BEHALF_OF_EMPLOYMENT_TYPES, OPEN_TO_GROUP_LABELS, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_LABELS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, type OpenToGroup, type OpenToOption, OrgProfileRecord, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PUBLICATION_TYPE_LABELS, PUBLICATION_TYPE_OPTIONS, PUBLISHERS, type ParsedDelivery, type ParsedEndorsementComment, type ParsedPresentation, type PdsProvider, PdsProviderInfo, type PersonalFacetContent, type PlatformId, type PresentationDeliverySummary, PresentationDuration, type PresentationLinkTypeOption, type PresentationRoleOption, type PrimaryFlagCandidate, type PrimaryPositionCandidate, Profile, ProfileCertification, type ProfileCompletion, type ProfileDimensionInputs, ProfileEducation, type ProfileHighlightSection, type ProfileHighlightStatus, type ProfileHighlightTile, type ProfileHighlightsInput, ProfileHonor, ProfileInvolvement, ProfileLanguage, ProfilePosition, ProfilePresentationDelivery, ProfilePresentationDeliveryRecord, ProfilePresentationRecord, ProfileProject, ProfilePublication, ProfileSkill, type PublicationTypeOption, type PublicationVersionGroup, type Publisher, ROADMAP_ISSUES_REPO, ROADMAP_ITEM_META, RelatedIdentifier, type RgbColor, type RoadmapItemMeta, SEARCH_FILTER_DEFS, SECTION_GROUPS, SECTION_LABELS, SELF_APP_ID, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, STREAM_VERBS, type SearchFilterControl, type SearchFilterDef, type SearchFilterOptionSource, type SectionGroupId, type SectionId, type SkillCategory, type StreamAddress, type StreamAuthor, type StreamCardBody, type StreamCardSubject, type StreamCardVM, type StreamExternalLink, type StreamGeo, type StreamMedia, type StreamMediaBase, type StreamMediaBlob, type StreamMediaResolved, type StreamRichSegment, type StreamSource, type StreamTheme, type StreamVerb, type TierMeta, type ToStreamCardVMOptions, type UrlPathPolicy, VERIFICATION_PROVIDERS, type VerificationProvider, type VerificationProviderId, type VerificationSource, type VersionablePublication, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, type WorkplaceTypeOption, actorShowsIdentity, buildMetaDescription, buildProfileHighlights, buildTalkSlug, categoryForApp, certDateExtractor, classifyEntityRef, collapseContributors, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countRecentActivity, countryCodeToFlag, dateRangeExtractor, dedupeSkills, detectPdsProvider, dimensionsFromInputs, durationFromMinutes, entityDisambiguationLabel, entityResultKey, excludeSelfApp, filterHidden, findIndustry, formatCompanyName, formatDateRange, formatDisplayUrl, formatDistanceToNow, formatEventDate, formatIsoTitle, formatLocation, formatPresentationDuration, formatRelationship, formatRelativeTime, formatSingleDate, formatSpanDate, formatTimelineDate, getActivityTaxonomyVersion, getActivityTier, getActivityVerbsVersion, getAppCategoryIcon, getAppIdForCollection, getArtifactLinkKindLabel, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getCourseRoleLabel, getDisplayLabel, getEmploymentTypeLabel, getEqfLevelLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabel, getIndustryLabelKey, getInvestmentRoleLabel, getInvestmentStageLabel, getInvestmentStatusLabel, getInvolvementKindHeading, getInvolvementKindLabel, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublicationTypeLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getVerificationProvider, getVisibleSectionIds, getWorkplaceTypeLabel, groupInvolvementByHeading, groupPublicationVersions, groupSkillsByCategory, groupSkillsBySubCategory, groupSkillsForDisplay, hasPersonalProfileContent, hoistPrimary, isAppCategory, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isOnBehalfOfApplicable, isPseudoEmployer, isRegistrableDomainHandle, isRelationalActivity, isRoleLineRedundant, isSectionPopulated, isSelfAuthoredRich, isTeachingCourse, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, locationSegments, looksLikeDomain, meetsContrastAA, normalizeCompanyKey, normalizeDoi, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeSkillCategory, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseEndorsementComment, parseIntendedAudiences, parseLocationString, parsePresentationDuration, parseTalkRkey, pdsProviderFromApi, pickPrimaryFlagged, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, readEqfLevel, relativeLuminance, renderAsLine, rendersCompanyProfile, rendersPersonalProfile, resolveAccountFacetMode, resolveAgentRef, resolveCardHealth, resolveCardUrl, resolveEmbed, resolveVerifierProvider, rgbToString, roadmapIssueUrl, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, shouldRenderHighlights, singleDateExtractor, slugifyTitle, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, splitCoursesByRole, streamAddressSchema, streamAuthorSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamRichSegmentSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, suggestEqfLevelFromDegree, summarizePresentationDeliveries, toStreamCardVM, toStreamCardVMs, truncateGraphemes, verbForCollection, visibleItems, youtubeThumbnailUrl, youtubeVideoId };
3091
+ export { ACTIVITY_TIERS, ACTIVITY_VERBS, ACTIVITY_VISIBILITY_RULES, ALL_SECTIONS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, ARTIFACT_LINK_KIND_LABELS, ARTIFACT_LINK_KIND_OPTIONS, AccountFacetMode, type AccountVerification, type ActivityItem, type ActivityItemForUrl, type ActivityTaxonomy, type ActivityTier, type ActivityVerbMap, AgentRef, type AgentRefFlat, type AppCategoryId, type AppUrlPatterns, type AppWithId, type ArtifactLinkKindOption, type BuildProfileHighlightsOptions, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPANY_PAGE_MIN_FIRMOGRAPHIC_FIELDS, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, COURSE_ROLE_LABELS, COURSE_ROLE_OPTIONS, COURSE_ROLE_TAKEN, COURSE_ROLE_TAUGHT, COURSE_ROLE_TEACHING_ASSISTANT, type CardHealth, type CardHealthStrategy, type CollapseContributorsOptions, type CollapsedContributors, type CompanyFirmographics, type ContinentCode, type CourseRoleOption, type CsvRow, DATE_LOOKAHEAD_MONTHS, DIMENSIONS_MAX_SCORE, type DailyActivityCount, type DateLookaheadKind, type DimensionKey, type DimensionMap, type DisambiguationFields, type DisplayUrl, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, EQF_LEVEL_LABELS, EQF_LEVEL_OPTIONS, type EmbedResult, type EmploymentTypeGroup, type EmploymentTypeOption, type EntityRefAnchor, EntitySearchResult, type EqfLevel, type EqfLevelOption, type FormatDisplayUrlOptions, type GroupPublicationVersionsOptions, INDUSTRY_LABELS, INDUSTRY_OPTIONS, INVESTMENT_ROLE_LABELS, INVESTMENT_ROLE_OPTIONS, INVESTMENT_STAGE_LABELS, INVESTMENT_STAGE_OPTIONS, INVESTMENT_STATUS_LABELS, INVESTMENT_STATUS_OPTIONS, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, type IndustryOption, type InvestmentOption, type InvolvementGroup, type InvolvementKindOption, type KnownAppId, type LexiconEntry, type LocationSegment, type LocationSegmentKind, type LocationSegmentsOptions, LocationValue, MIN_SKILLS, type MergedProfileSkill, ON_BEHALF_OF_EMPLOYMENT_TYPES, OPEN_TO_GROUP_LABELS, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_LABELS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, type OpenToGroup, type OpenToOption, OrgProfileRecord, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PUBLICATION_TYPE_LABELS, PUBLICATION_TYPE_OPTIONS, PUBLISHERS, type ParsedDelivery, type ParsedEndorsementComment, type ParsedPresentation, type PdsProvider, PdsProviderInfo, type PersonalFacetContent, type PlatformId, type PresentationDeliverySummary, PresentationDuration, type PresentationLinkTypeOption, type PresentationRoleOption, type PrimaryFlagCandidate, type PrimaryPositionCandidate, Profile, ProfileCertification, type ProfileCompletion, type ProfileDimensionInputs, ProfileEducation, type ProfileHighlightSection, type ProfileHighlightStatus, type ProfileHighlightTile, type ProfileHighlightsInput, ProfileHonor, ProfileInvolvement, ProfileLanguage, ProfilePosition, ProfilePresentationDelivery, ProfilePresentationDeliveryRecord, ProfilePresentationRecord, ProfileProject, ProfilePublication, ProfileSkill, type PublicationTypeOption, type PublicationVersionGroup, type Publisher, ROADMAP_ISSUES_REPO, ROADMAP_ITEM_META, RelatedIdentifier, type RgbColor, type RoadmapItemMeta, SEARCH_FILTER_DEFS, SECTION_GROUPS, SECTION_LABELS, SELF_APP_ID, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, STREAM_VERBS, type SearchFilterControl, type SearchFilterDef, type SearchFilterOptionSource, type SectionGroupId, type SectionId, type SkillCategory, type StreamAddress, type StreamAuthor, type StreamCardBody, type StreamCardSubject, type StreamCardVM, type StreamExternalLink, type StreamGeo, type StreamMedia, type StreamMediaBase, type StreamMediaBlob, type StreamMediaResolved, type StreamRichSegment, type StreamSource, type StreamTheme, type StreamVerb, type TierMeta, type ToStreamCardVMOptions, type UrlPathPolicy, VERIFICATION_PROVIDERS, type VerificationProvider, type VerificationProviderId, type VerificationSource, type VersionablePublication, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, type WorkplaceTypeOption, actorShowsIdentity, buildMetaDescription, buildProfileHighlights, buildTalkSlug, categoryForApp, certDateExtractor, classifyEntityRef, collapseContributors, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countRecentActivity, countryCodeToFlag, dateRangeExtractor, dedupeSkills, detectPdsProvider, dimensionsFromInputs, durationFromMinutes, entityDisambiguationLabel, entityResultKey, excludeSelfApp, filterHidden, findIndustry, formatCompanyName, formatDateRange, formatDisplayUrl, formatDistanceToNow, formatEventDate, formatIsoTitle, formatLocation, formatPositionDateRange, formatPresentationDuration, formatRelationship, formatRelativeTime, formatSingleDate, formatSpanDate, formatTimelineDate, getActivityTaxonomyVersion, getActivityTier, getActivityVerbsVersion, getAppCategoryIcon, getAppIdForCollection, getArtifactLinkKindLabel, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getCourseRoleLabel, getDisplayLabel, getEmploymentTypeLabel, getEqfLevelLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabel, getIndustryLabelKey, getInvestmentRoleLabel, getInvestmentStageLabel, getInvestmentStatusLabel, getInvolvementKindHeading, getInvolvementKindLabel, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublicationTypeLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getVerificationProvider, getVisibleSectionIds, getWorkplaceTypeLabel, groupInvolvementByHeading, groupPublicationVersions, groupSkillsByCategory, groupSkillsBySubCategory, groupSkillsForDisplay, hasPersonalProfileContent, hoistPrimary, isAppCategory, isBeyondLookahead, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isOnBehalfOfApplicable, isPseudoEmployer, isRegistrableDomainHandle, isRelationalActivity, isRoleLineRedundant, isSectionPopulated, isSelfAuthoredRich, isTeachingCourse, isUpcomingStart, isValidRgbColor, isVisibleActivityItem, lexiconDateExtractor, limitCombiningMarks, locationSegments, looksLikeDomain, meetsContrastAA, normalizeCompanyKey, normalizeDoi, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeSkillCategory, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseEndorsementComment, parseIntendedAudiences, parseLocationString, parsePresentationDuration, parseTalkRkey, pdsProviderFromApi, pickPrimaryFlagged, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, readEqfLevel, relativeLuminance, renderAsLine, rendersCompanyProfile, rendersPersonalProfile, resolveAccountFacetMode, resolveAgentRef, resolveCardHealth, resolveCardUrl, resolveEmbed, resolveVerifierProvider, rgbToString, roadmapIssueUrl, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, shouldRenderHighlights, singleDateExtractor, slugifyTitle, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, splitCoursesByRole, streamAddressSchema, streamAuthorSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamRichSegmentSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, suggestEqfLevelFromDegree, summarizePresentationDeliveries, toStreamCardVM, toStreamCardVMs, truncateGraphemes, verbForCollection, visibleItems, youtubeThumbnailUrl, youtubeVideoId };
package/dist/index.js CHANGED
@@ -2803,6 +2803,32 @@ function formatPresentationDuration(duration) {
2803
2803
  return `${minMinutes} min`;
2804
2804
  }
2805
2805
 
2806
+ // src/logic/date-lookahead.ts
2807
+ var DATE_LOOKAHEAD_MONTHS = {
2808
+ credentialIssue: 0,
2809
+ award: 0,
2810
+ course: 0,
2811
+ involvementStart: 0,
2812
+ investmentStart: 0,
2813
+ /** The end date of any finished (not ongoing) range. */
2814
+ completedRangeEnd: 0,
2815
+ careerStart: 12,
2816
+ projectStart: 12,
2817
+ publication: 12,
2818
+ talk: 24,
2819
+ educationEnd: 96
2820
+ };
2821
+ function isBeyondLookahead(value, months, now = /* @__PURE__ */ new Date()) {
2822
+ const match = /^(\d{4})(?:-(\d{2}))?/.exec(value);
2823
+ if (!match) return false;
2824
+ const index = Number(match[1]) * 12 + (match[2] ? Number(match[2]) : 1);
2825
+ const limit = now.getFullYear() * 12 + now.getMonth() + 1 + months;
2826
+ return index > limit;
2827
+ }
2828
+ function isUpcomingStart(startedAt, now = /* @__PURE__ */ new Date()) {
2829
+ return !!startedAt && isBeyondLookahead(startedAt, 0, now);
2830
+ }
2831
+
2806
2832
  // src/format/timeline.ts
2807
2833
  var MONTHS = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
2808
2834
  function formatTimelineDate(dateStr) {
@@ -2821,6 +2847,10 @@ function formatDateRange(start, end, showPresent = true) {
2821
2847
  if (formattedStart === formattedEnd) return formattedStart;
2822
2848
  return `${formattedStart} - ${formattedEnd}`;
2823
2849
  }
2850
+ function formatPositionDateRange(start, end, now = /* @__PURE__ */ new Date()) {
2851
+ if (start && !end && isUpcomingStart(start, now)) return `Starts ${formatTimelineDate(start)}`;
2852
+ return formatDateRange(start, end);
2853
+ }
2824
2854
 
2825
2855
  // src/format/collapse-contributors.ts
2826
2856
  function collapseContributors(contributors, options = {}) {
@@ -3221,9 +3251,11 @@ function parseTalkRkey(segment) {
3221
3251
  }
3222
3252
 
3223
3253
  // src/logic/primary-position.ts
3224
- function pickPrimaryPosition(positions) {
3254
+ function pickPrimaryPosition(positions, now = /* @__PURE__ */ new Date()) {
3225
3255
  if (!positions || positions.length === 0) return void 0;
3226
- const active = positions.filter((p) => !p.endedAt && !p.hidden);
3256
+ const active = positions.filter(
3257
+ (p) => !p.endedAt && !p.hidden && !isUpcomingStart(p.startedAt, now)
3258
+ );
3227
3259
  if (active.length === 0) return void 0;
3228
3260
  const flagged = active.find((p) => p.primary === true);
3229
3261
  if (flagged) return flagged;
@@ -7044,8 +7076,8 @@ function describeSifaRecord(collection, value) {
7044
7076
  }
7045
7077
 
7046
7078
  // src/index.ts
7047
- var SIFA_SDK_VERSION = "0.19.41";
7079
+ var SIFA_SDK_VERSION = "0.19.42";
7048
7080
 
7049
- export { ACTIVITY_TIERS, ACTIVITY_VERBS, ACTIVITY_VISIBILITY_RULES, ADULT_CONTENT_LABELS, ALL_SECTIONS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, ARTIFACT_LINK_KIND_LABELS, ARTIFACT_LINK_KIND_OPTIONS, ArtifactLinkSchema, AtmosphereFeedItemSchema, BlobRefSchema, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPANY_PAGE_MIN_FIRMOGRAPHIC_FIELDS, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, COURSE_ROLE_LABELS, COURSE_ROLE_OPTIONS, COURSE_ROLE_TAKEN, COURSE_ROLE_TAUGHT, COURSE_ROLE_TEACHING_ASSISTANT, DIMENSIONS_MAX_SCORE, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, EQF_LEVEL_LABELS, EQF_LEVEL_OPTIONS, EndorsementConfirmationRecordSchema, EndorsementRecordSchema, EntityImportSearchResponseSchema, EntityMintDomainResponseSchema, EntityResolveDomainRequestSchema, EntityResolveDomainResponseSchema, EntitySearchResponseSchema, EntitySearchResultSchema, EntitySelectRequestSchema, EntitySelectResponseSchema, FEATURE_FLAGS, FeatureAllowlistEntrySchema, FeedActorSchema, FollowFeedItemSchema, FollowFeedPageSchema, FollowProfilePageSchema, FollowProfileSchema, GraphFollowRecordSchema, INDUSTRY_LABELS, INDUSTRY_OPTIONS, INVESTMENT_ROLE_LABELS, INVESTMENT_ROLE_OPTIONS, INVESTMENT_STAGE_LABELS, INVESTMENT_STAGE_OPTIONS, INVESTMENT_STATUS_LABELS, INVESTMENT_STATUS_OPTIONS, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, InvestmentAmountSchema, MIN_SKILLS, ON_BEHALF_OF_EMPLOYMENT_TYPES, OPEN_TO_GROUP_LABELS, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_LABELS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, OrgEmploymentAttestationRecordSchema, OrgProfileRecordSchema, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PROFILE_INVESTMENT_NSID, PROFILE_INVOLVEMENT_NSID, PROJECT_ROLES, PUBLICATION_TYPE_LABELS, PUBLICATION_TYPE_OPTIONS, PUBLISHERS, PresentationDurationSchema, PresentationLinkSchema, ProfileCertificationRecordSchema, ProfileCourseRecordSchema, ProfileEducationRecordSchema, ProfileExternalAccountRecordSchema, ProfileHonorRecordSchema, ProfileInvestmentRecordSchema, ProfileInvolvementRecordSchema, ProfileLanguageRecordSchema, ProfilePositionRecordSchema, ProfilePresentationDeliveryRecordSchema, ProfilePresentationRecordSchema, ProfileProjectRecordSchema, ProfilePublicationRecordSchema, ProfileSelfRecordSchema, ProfileSkillRecordSchema, ProfileVolunteeringRecordSchema, PublicationAuthorSchema, ROADMAP_ISSUES_REPO, ROADMAP_ITEM_META, RelatedIdentifierSchema, SEARCH_FILTER_DEFS, SECTION_GROUPS, SECTION_LABELS, SELF_APP_ID, SIFA_REPO_GROUPS, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, STREAM_VERBS, SifaFeedItemSchema, VERIFICATION_PROVIDERS, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, actorShowsIdentity, agentRefSchema, atUriSchema, buildMetaDescription, buildProfileHighlights, buildTalkSlug, categoryForApp, certDateExtractor, cidSchema, classifyEntityRef, collapseContributors, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countRecentActivity, countryCodeToFlag, dateRangeExtractor, datetimeSchema, decodeFeedCursor, dedupeSkills, describeSifaRecord, detectPdsProvider, didSchema, dimensionsFromInputs, durationFromMinutes, encodeFeedCursor, entityDisambiguationLabel, entityResultKey, excludeSelfApp, externalRecordRefSchema, filterHidden, findIndustry, formatCompanyName, formatDateRange, formatDisplayUrl, formatDistanceToNow, formatEventDate, formatIsoTitle, formatLocation, formatPresentationDuration, formatRelationship, formatRelativeTime, formatSingleDate, formatSpanDate, formatTimelineDate, getActivityTaxonomyVersion, getActivityTier, getActivityVerbsVersion, getAppCategoryIcon, getAppIdForCollection, getArtifactLinkKindLabel, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getCourseRoleLabel, getDisplayLabel, getEmploymentTypeLabel, getEqfLevelLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabel, getIndustryLabelKey, getInvestmentRoleLabel, getInvestmentStageLabel, getInvestmentStatusLabel, getInvolvementKindHeading, getInvolvementKindLabel, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublicationTypeLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getVerificationProvider, getVisibleSectionIds, getWorkplaceTypeLabel, groupInvolvementByHeading, groupPublicationVersions, groupSkillsByCategory, groupSkillsBySubCategory, groupSkillsForDisplay, hasAdultContent, hasPersonalProfileContent, hoistPrimary, isAppCategory, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isOnBehalfOfApplicable, isPseudoEmployer, isRegistrableDomainHandle, isRelationalActivity, isRoleLineRedundant, isSectionPopulated, isSelfAuthoredRich, isTeachingCourse, isValidRgbColor, isVisibleActivityItem, languageTagSchema, lexiconDateExtractor, limitCombiningMarks, locationSegments, looksLikeDomain, makeGraphFollowRecordSchema, maxGraphemes, meetsContrastAA, normalizeCompanyKey, normalizeDoi, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeSkillCategory, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseEndorsementComment, parseIntendedAudiences, parseLocationString, parsePresentationDuration, parseTalkRkey, partialDateSchema, pdsProviderFromApi, pickPrimaryFlagged, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, readEqfLevel, relativeLuminance, renderAsLine, rendersCompanyProfile, rendersPersonalProfile, repoGroupForCollection, resolveAccountFacetMode, resolveAgentRef, resolveCardHealth, resolveCardUrl, resolveEmbed, resolveVerifierProvider, rgbToString, roadmapIssueUrl, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, selfLabelsSchema, shouldRenderHighlights, singleDateExtractor, skillRefSchema, slugifyTitle, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, splitCoursesByRole, streamAddressSchema, streamAuthorSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamRichSegmentSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, strongRefSchema, suggestEqfLevelFromDegree, summarizePresentationDeliveries, summarizeProfileView, toStreamCardVM, toStreamCardVMs, truncateGraphemes, uriSchema, verbForCollection, visibleItems, youtubeThumbnailUrl, youtubeVideoId };
7081
+ export { ACTIVITY_TIERS, ACTIVITY_VERBS, ACTIVITY_VISIBILITY_RULES, ADULT_CONTENT_LABELS, ALL_SECTIONS, APP_CATEGORIES, APP_CATEGORY_IDS, APP_CATEGORY_MAP, APP_URL_PATTERNS, ARTIFACT_LINK_KIND_LABELS, ARTIFACT_LINK_KIND_OPTIONS, ArtifactLinkSchema, AtmosphereFeedItemSchema, BlobRefSchema, CALENDAR_EVENT_MODE_LABELS, CALENDAR_EVENT_STATUS_LABELS, CATEGORY_LABELS, CATEGORY_ORDER, COLLECTION_TO_APP, COMPANY_OPTIONAL_EMPLOYMENT_TYPES, COMPANY_PAGE_MIN_FIRMOGRAPHIC_FIELDS, COMPLETENESS_MAX_SCORE, CONTINENTS, COUNTRIES, COURSE_ROLE_LABELS, COURSE_ROLE_OPTIONS, COURSE_ROLE_TAKEN, COURSE_ROLE_TAUGHT, COURSE_ROLE_TEACHING_ASSISTANT, DATE_LOOKAHEAD_MONTHS, DIMENSIONS_MAX_SCORE, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, EQF_LEVEL_LABELS, EQF_LEVEL_OPTIONS, EndorsementConfirmationRecordSchema, EndorsementRecordSchema, EntityImportSearchResponseSchema, EntityMintDomainResponseSchema, EntityResolveDomainRequestSchema, EntityResolveDomainResponseSchema, EntitySearchResponseSchema, EntitySearchResultSchema, EntitySelectRequestSchema, EntitySelectResponseSchema, FEATURE_FLAGS, FeatureAllowlistEntrySchema, FeedActorSchema, FollowFeedItemSchema, FollowFeedPageSchema, FollowProfilePageSchema, FollowProfileSchema, GraphFollowRecordSchema, INDUSTRY_LABELS, INDUSTRY_OPTIONS, INVESTMENT_ROLE_LABELS, INVESTMENT_ROLE_OPTIONS, INVESTMENT_STAGE_LABELS, INVESTMENT_STAGE_OPTIONS, INVESTMENT_STATUS_LABELS, INVESTMENT_STATUS_OPTIONS, INVOLVEMENT_HEADING_ORDER, INVOLVEMENT_KIND_HEADINGS, INVOLVEMENT_KIND_LABELS, INVOLVEMENT_KIND_OPTIONS, InvestmentAmountSchema, MIN_SKILLS, ON_BEHALF_OF_EMPLOYMENT_TYPES, OPEN_TO_GROUP_LABELS, OPEN_TO_OPTIONS, OPEN_TO_TOKENS, OPEN_TO_TOKEN_LABELS, OPEN_TO_TOKEN_TO_VALUE, OPEN_TO_VALUE_TO_TOKEN, OrgEmploymentAttestationRecordSchema, OrgProfileRecordSchema, PLATFORM_LABELS, PLATFORM_OPTIONS, PRESENTATION_LINK_TYPE_LABELS, PRESENTATION_LINK_TYPE_OPTIONS, PRESENTATION_ROLE_LABELS, PRESENTATION_ROLE_OPTIONS, PROFILE_INVESTMENT_NSID, PROFILE_INVOLVEMENT_NSID, PROJECT_ROLES, PUBLICATION_TYPE_LABELS, PUBLICATION_TYPE_OPTIONS, PUBLISHERS, PresentationDurationSchema, PresentationLinkSchema, ProfileCertificationRecordSchema, ProfileCourseRecordSchema, ProfileEducationRecordSchema, ProfileExternalAccountRecordSchema, ProfileHonorRecordSchema, ProfileInvestmentRecordSchema, ProfileInvolvementRecordSchema, ProfileLanguageRecordSchema, ProfilePositionRecordSchema, ProfilePresentationDeliveryRecordSchema, ProfilePresentationRecordSchema, ProfileProjectRecordSchema, ProfilePublicationRecordSchema, ProfileSelfRecordSchema, ProfileSkillRecordSchema, ProfileVolunteeringRecordSchema, PublicationAuthorSchema, ROADMAP_ISSUES_REPO, ROADMAP_ITEM_META, RelatedIdentifierSchema, SEARCH_FILTER_DEFS, SECTION_GROUPS, SECTION_LABELS, SELF_APP_ID, SIFA_REPO_GROUPS, SIFA_SDK_VERSION, SKILL_CATEGORIES, STANDARD_PUBLISHER_ID, STREAM_VERBS, SifaFeedItemSchema, VERIFICATION_PROVIDERS, WORKPLACE_TYPE_LABELS, WORKPLACE_TYPE_OPTIONS, actorShowsIdentity, agentRefSchema, atUriSchema, buildMetaDescription, buildProfileHighlights, buildTalkSlug, categoryForApp, certDateExtractor, cidSchema, classifyEntityRef, collapseContributors, completenessPercent, completenessScore, contrastRatio, countFilledDimensions, countRecentActivity, countryCodeToFlag, dateRangeExtractor, datetimeSchema, decodeFeedCursor, dedupeSkills, describeSifaRecord, detectPdsProvider, didSchema, dimensionsFromInputs, durationFromMinutes, encodeFeedCursor, entityDisambiguationLabel, entityResultKey, excludeSelfApp, externalRecordRefSchema, filterHidden, findIndustry, formatCompanyName, formatDateRange, formatDisplayUrl, formatDistanceToNow, formatEventDate, formatIsoTitle, formatLocation, formatPositionDateRange, formatPresentationDuration, formatRelationship, formatRelativeTime, formatSingleDate, formatSpanDate, formatTimelineDate, getActivityTaxonomyVersion, getActivityTier, getActivityVerbsVersion, getAppCategoryIcon, getAppIdForCollection, getArtifactLinkKindLabel, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getCourseRoleLabel, getDisplayLabel, getEmploymentTypeLabel, getEqfLevelLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabel, getIndustryLabelKey, getInvestmentRoleLabel, getInvestmentStageLabel, getInvestmentStatusLabel, getInvolvementKindHeading, getInvolvementKindLabel, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublicationTypeLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getVerificationProvider, getVisibleSectionIds, getWorkplaceTypeLabel, groupInvolvementByHeading, groupPublicationVersions, groupSkillsByCategory, groupSkillsBySubCategory, groupSkillsForDisplay, hasAdultContent, hasPersonalProfileContent, hoistPrimary, isAppCategory, isBeyondLookahead, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isOnBehalfOfApplicable, isPseudoEmployer, isRegistrableDomainHandle, isRelationalActivity, isRoleLineRedundant, isSectionPopulated, isSelfAuthoredRich, isTeachingCourse, isUpcomingStart, isValidRgbColor, isVisibleActivityItem, languageTagSchema, lexiconDateExtractor, limitCombiningMarks, locationSegments, looksLikeDomain, makeGraphFollowRecordSchema, maxGraphemes, meetsContrastAA, normalizeCompanyKey, normalizeDoi, normalizeLegalForm, normalizeOpenTo, normalizePlatformId, normalizePresentationMode, normalizePresentationRole, normalizeSkillCategory, normalizeWorkplaceTypes, openToTokenToValue, openToValueToToken, parseEndorsementComment, parseIntendedAudiences, parseLocationString, parsePresentationDuration, parseTalkRkey, partialDateSchema, pdsProviderFromApi, pickPrimaryFlagged, pickPrimaryPosition, presentationCsvRowToRecord, presentationDeliveryCsvRowToRecord, primaryVerification, profileToDimensionInputs, qualifiesAsOrg, readEqfLevel, relativeLuminance, renderAsLine, rendersCompanyProfile, rendersPersonalProfile, repoGroupForCollection, resolveAccountFacetMode, resolveAgentRef, resolveCardHealth, resolveCardUrl, resolveEmbed, resolveVerifierProvider, rgbToString, roadmapIssueUrl, sanitizeDisplayText, sanitizeHandleInput, searchResultDisambiguation, selfLabelsSchema, shouldRenderHighlights, singleDateExtractor, skillRefSchema, slugifyTitle, sortByActiveDateRange, sortByDateDesc, sortCertifications, sortEducation, sortHonors, sortLanguages, sortLanguagesByProficiency, sortPositions, sortProjects, sortPublications, splitCoursesByRole, streamAddressSchema, streamAuthorSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamRichSegmentSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, strongRefSchema, suggestEqfLevelFromDegree, summarizePresentationDeliveries, summarizeProfileView, toStreamCardVM, toStreamCardVMs, truncateGraphemes, uriSchema, verbForCollection, visibleItems, youtubeThumbnailUrl, youtubeVideoId };
7050
7082
  //# sourceMappingURL=index.js.map
7051
7083
  //# sourceMappingURL=index.js.map