@singi-labs/sifa-sdk 0.19.13 → 0.19.15

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
@@ -1591,6 +1591,17 @@ interface ActivityItem {
1591
1591
  * a `StreamCardVM` too.
1592
1592
  */
1593
1593
  subject?: ActivityItem;
1594
+ /**
1595
+ * Resolved title of the record this one references (the commented-on document,
1596
+ * the replied-to post), set by sifa-api. Shown on the two-tier line as the
1597
+ * subject clause ("Commented on {subjectTitle}").
1598
+ */
1599
+ subjectTitle?: string;
1600
+ /**
1601
+ * Canonical http(s) URL of the referenced record, set by sifa-api, so the
1602
+ * subject clause links out to what was acted on (the blog post, the event).
1603
+ */
1604
+ subjectUrl?: string;
1594
1605
  /**
1595
1606
  * Hypercert claim enrichment, set by sifa-api. Absent for non-hypercert
1596
1607
  * items, for claims with neither contributors nor attachments, and for
@@ -1610,19 +1621,25 @@ interface ActivityItem {
1610
1621
  * standard-site; "posted" spans Bluesky and Picosky) so a day-grouped feed
1611
1622
  * reads like sentences.
1612
1623
  */
1613
- declare const STREAM_VERBS: readonly ["posted", "reposted", "published", "presented", "endorsed", "joined", "shipped", "reviewed", "created"];
1624
+ declare const STREAM_VERBS: readonly ["posted", "reposted", "published", "presented", "endorsed", "joined", "shipped", "reviewed", "created", "commented", "replied", "rsvped", "liked", "followed", "bookmarked"];
1614
1625
  type StreamVerb = (typeof STREAM_VERBS)[number];
1615
1626
  /** Zod enum for a {@link StreamVerb}, shared with the view-model schema. */
1616
1627
  declare const streamVerbSchema: z.ZodEnum<{
1617
1628
  created: "created";
1629
+ joined: "joined";
1630
+ replied: "replied";
1618
1631
  posted: "posted";
1619
- reviewed: "reviewed";
1620
1632
  reposted: "reposted";
1633
+ shipped: "shipped";
1634
+ bookmarked: "bookmarked";
1635
+ followed: "followed";
1636
+ reviewed: "reviewed";
1621
1637
  published: "published";
1622
- presented: "presented";
1638
+ rsvped: "rsvped";
1639
+ commented: "commented";
1623
1640
  endorsed: "endorsed";
1624
- shipped: "shipped";
1625
- joined: "joined";
1641
+ presented: "presented";
1642
+ liked: "liked";
1626
1643
  }>;
1627
1644
  interface ActivityVerbMap {
1628
1645
  version: string;
@@ -1882,6 +1899,7 @@ type StreamCardSubject = {
1882
1899
  kind: 'record';
1883
1900
  uri: string;
1884
1901
  title?: string;
1902
+ url?: string;
1885
1903
  };
1886
1904
  /**
1887
1905
  * Presentation-ready, framework-free, serializable view-model for one activity
package/dist/index.d.ts CHANGED
@@ -1591,6 +1591,17 @@ interface ActivityItem {
1591
1591
  * a `StreamCardVM` too.
1592
1592
  */
1593
1593
  subject?: ActivityItem;
1594
+ /**
1595
+ * Resolved title of the record this one references (the commented-on document,
1596
+ * the replied-to post), set by sifa-api. Shown on the two-tier line as the
1597
+ * subject clause ("Commented on {subjectTitle}").
1598
+ */
1599
+ subjectTitle?: string;
1600
+ /**
1601
+ * Canonical http(s) URL of the referenced record, set by sifa-api, so the
1602
+ * subject clause links out to what was acted on (the blog post, the event).
1603
+ */
1604
+ subjectUrl?: string;
1594
1605
  /**
1595
1606
  * Hypercert claim enrichment, set by sifa-api. Absent for non-hypercert
1596
1607
  * items, for claims with neither contributors nor attachments, and for
@@ -1610,19 +1621,25 @@ interface ActivityItem {
1610
1621
  * standard-site; "posted" spans Bluesky and Picosky) so a day-grouped feed
1611
1622
  * reads like sentences.
1612
1623
  */
1613
- declare const STREAM_VERBS: readonly ["posted", "reposted", "published", "presented", "endorsed", "joined", "shipped", "reviewed", "created"];
1624
+ declare const STREAM_VERBS: readonly ["posted", "reposted", "published", "presented", "endorsed", "joined", "shipped", "reviewed", "created", "commented", "replied", "rsvped", "liked", "followed", "bookmarked"];
1614
1625
  type StreamVerb = (typeof STREAM_VERBS)[number];
1615
1626
  /** Zod enum for a {@link StreamVerb}, shared with the view-model schema. */
1616
1627
  declare const streamVerbSchema: z.ZodEnum<{
1617
1628
  created: "created";
1629
+ joined: "joined";
1630
+ replied: "replied";
1618
1631
  posted: "posted";
1619
- reviewed: "reviewed";
1620
1632
  reposted: "reposted";
1633
+ shipped: "shipped";
1634
+ bookmarked: "bookmarked";
1635
+ followed: "followed";
1636
+ reviewed: "reviewed";
1621
1637
  published: "published";
1622
- presented: "presented";
1638
+ rsvped: "rsvped";
1639
+ commented: "commented";
1623
1640
  endorsed: "endorsed";
1624
- shipped: "shipped";
1625
- joined: "joined";
1641
+ presented: "presented";
1642
+ liked: "liked";
1626
1643
  }>;
1627
1644
  interface ActivityVerbMap {
1628
1645
  version: string;
@@ -1882,6 +1899,7 @@ type StreamCardSubject = {
1882
1899
  kind: 'record';
1883
1900
  uri: string;
1884
1901
  title?: string;
1902
+ url?: string;
1885
1903
  };
1886
1904
  /**
1887
1905
  * Presentation-ready, framework-free, serializable view-model for one activity
package/dist/index.js CHANGED
@@ -4012,37 +4012,48 @@ function getPublisherFromSiteUrl(siteUrl) {
4012
4012
  // src/stream/verbs.json
4013
4013
  var verbs_default = {
4014
4014
  $schema: "https://sifa.id/schemas/activity-verbs/v1.json",
4015
- version: "1.1.0",
4016
- updated: "2026-07-19",
4015
+ version: "1.2.0",
4016
+ updated: "2026-09-18",
4017
4017
  defaultVerb: "created",
4018
4018
  verbs: {
4019
+ "agency.portable.membership": "joined",
4020
+ "app.atmobb.discussion.reply": "replied",
4019
4021
  "app.bsky.feed.post": "posted",
4022
+ "app.bsky.feed.repost": "reposted",
4023
+ "app.sidetrail.trail": "shipped",
4024
+ "app.sidetrail.walk": "shipped",
4025
+ "app.userinput.reply": "replied",
4026
+ "at.margin.bookmark": "bookmarked",
4027
+ "at.youandme.connection": "followed",
4020
4028
  "blue.flashes.feed.post": "posted",
4021
- "social.psky.feed.post": "posted",
4022
- "social.popfeed.feed.post": "posted",
4023
- "social.popfeed.feed.note": "posted",
4024
- "social.popfeed.feed.review": "reviewed",
4025
4029
  "buzz.bookhive.book": "reviewed",
4026
- "fyi.unravel.frontpage.post": "posted",
4027
- "forum.barazo.post": "posted",
4028
- "app.bsky.feed.repost": "reposted",
4029
4030
  "com.whtwnd.blog.entry": "published",
4030
- "site.standard.document": "published",
4031
+ "community.lexicon.calendar.rsvp": "rsvped",
4032
+ "community.nooki.comments": "commented",
4033
+ "community.nooki.membership": "joined",
4034
+ "community.opensocial.membership": "joined",
4031
4035
  "computer.aetheros.page": "published",
4032
- "link.pastesphere.snippet": "published",
4033
- "pub.leaflet.comment": "published",
4036
+ "eu.atcommons.member": "joined",
4037
+ "fm.plyr.comment": "commented",
4038
+ "forum.barazo.post": "posted",
4039
+ "fyi.unravel.frontpage.post": "posted",
4040
+ "id.sifa.endorsement": "endorsed",
4041
+ "id.sifa.graph.connection": "joined",
4034
4042
  "id.sifa.profile.presentation": "presented",
4035
4043
  "id.sifa.profile.presentationDelivery": "presented",
4036
- "id.sifa.endorsement": "endorsed",
4044
+ "link.pastesphere.snippet": "published",
4045
+ "org.impactindexer.review.comment": "commented",
4046
+ "pub.leaflet.comment": "commented",
4037
4047
  "sh.tangled.repo": "shipped",
4038
4048
  "sh.tangled.repo.issue": "shipped",
4039
4049
  "sh.tangled.repo.pull": "shipped",
4040
- "app.sidetrail.trail": "shipped",
4041
- "app.sidetrail.walk": "shipped",
4050
+ "site.standard.document": "published",
4042
4051
  "social.colibri.membership": "joined",
4043
- "community.lexicon.calendar.rsvp": "joined",
4044
- "at.youandme.connection": "joined",
4045
- "id.sifa.graph.connection": "joined"
4052
+ "social.kut.community.membership": "joined",
4053
+ "social.popfeed.feed.note": "posted",
4054
+ "social.popfeed.feed.post": "posted",
4055
+ "social.popfeed.feed.review": "reviewed",
4056
+ "social.psky.feed.post": "posted"
4046
4057
  }
4047
4058
  };
4048
4059
 
@@ -4056,7 +4067,16 @@ var STREAM_VERBS = [
4056
4067
  "joined",
4057
4068
  "shipped",
4058
4069
  "reviewed",
4059
- "created"
4070
+ "created",
4071
+ // Relational verbs: a reaction or reference to someone else's thing. These
4072
+ // read with the subject the two-tier line renders after them ("Commented on
4073
+ // {doc}", "Followed {person}").
4074
+ "commented",
4075
+ "replied",
4076
+ "rsvped",
4077
+ "liked",
4078
+ "followed",
4079
+ "bookmarked"
4060
4080
  ];
4061
4081
  var streamVerbSchema = z.enum(STREAM_VERBS);
4062
4082
  var verbMapSchema = z.object({
@@ -4268,7 +4288,8 @@ var streamCardSubjectSchema = z.discriminatedUnion("kind", [
4268
4288
  z.object({
4269
4289
  kind: z.literal("record"),
4270
4290
  uri: z.string(),
4271
- title: z.string().optional()
4291
+ title: z.string().optional(),
4292
+ url: z.string().optional()
4272
4293
  })
4273
4294
  ]);
4274
4295
  var hypercertDetailsSchema = z.object({
@@ -4505,10 +4526,33 @@ var TITLE_BY_VERB = {
4505
4526
  joined: (label) => `Joined ${label}`,
4506
4527
  shipped: (label) => `Shipped on ${label}`,
4507
4528
  reviewed: (label) => `Reviewed on ${label}`,
4508
- created: (label) => `Shared on ${label}`
4529
+ created: (label) => `Shared on ${label}`,
4530
+ commented: (_label, hasSubject) => hasSubject ? "Commented on" : "Commented",
4531
+ replied: (_label, hasSubject) => hasSubject ? "Replied to" : "Replied",
4532
+ rsvped: (_label, hasSubject) => hasSubject ? "RSVP'd to" : "RSVP'd",
4533
+ liked: () => "Liked",
4534
+ followed: () => "Followed",
4535
+ bookmarked: () => "Bookmarked"
4509
4536
  };
4510
- function buildTitle(verb, label) {
4511
- return TITLE_BY_VERB[verb](label);
4537
+ function buildTitle(verb, label, hasSubject) {
4538
+ return TITLE_BY_VERB[verb](label, hasSubject);
4539
+ }
4540
+ function recordHasSubjectRef(record) {
4541
+ if (!record) return false;
4542
+ const subject = record.subject;
4543
+ if (typeof subject === "string" && subject.startsWith("at://")) return true;
4544
+ if (subject && typeof subject === "object") {
4545
+ const uri = subject.uri;
4546
+ if (typeof uri === "string" && uri.length > 0) return true;
4547
+ }
4548
+ const reply = record.reply;
4549
+ if (reply && typeof reply === "object") {
4550
+ for (const key of ["parent", "root"]) {
4551
+ const ref = reply[key];
4552
+ if (ref && typeof ref === "object" && typeof ref.uri === "string") return true;
4553
+ }
4554
+ }
4555
+ return false;
4512
4556
  }
4513
4557
  function resolveSourceUrl(item, record) {
4514
4558
  const authorDid = didFromUri(item.uri);
@@ -4721,6 +4765,14 @@ function applyEventRsvp(vm, record) {
4721
4765
  if (locationCountry) body.locationCountry = locationCountry;
4722
4766
  }
4723
4767
  vm.body = body;
4768
+ const eventUri = nonBlankString(asRecord(record.subject)?.uri);
4769
+ if (eventUri) {
4770
+ vm.subject = {
4771
+ kind: "record",
4772
+ uri: eventUri,
4773
+ ...body.eventName ? { title: body.eventName } : {}
4774
+ };
4775
+ }
4724
4776
  return vm;
4725
4777
  }
4726
4778
  function applyKeytraceVerification(vm, record) {
@@ -4929,8 +4981,16 @@ function genericSubject(record) {
4929
4981
  }
4930
4982
  const uri = nonBlankString(asRecord(subject)?.uri);
4931
4983
  if (uri && uri.startsWith("at://")) return { kind: "record", uri };
4984
+ const parentUri = nonBlankString(asRecord(asRecord(record.reply)?.parent)?.uri);
4985
+ if (parentUri && parentUri.startsWith("at://")) return { kind: "record", uri: parentUri };
4932
4986
  return void 0;
4933
4987
  }
4988
+ function withResolvedSubjectMeta(subject, item) {
4989
+ if (subject.kind !== "record") return subject;
4990
+ const title = nonBlankString(item.subjectTitle) ?? subject.title;
4991
+ const url = nonBlankString(item.subjectUrl);
4992
+ return { ...subject, ...title ? { title } : {}, ...url ? { url } : {} };
4993
+ }
4934
4994
  function parseFacetFeature(features) {
4935
4995
  for (const raw of features) {
4936
4996
  const feat = asRecord(raw);
@@ -5003,7 +5063,7 @@ function applyGeneric(vm, item, record) {
5003
5063
  if (externalLink) vm.externalLink = externalLink;
5004
5064
  if (!vm.subject) {
5005
5065
  const subject = genericSubject(record);
5006
- if (subject) vm.subject = subject;
5066
+ if (subject) vm.subject = withResolvedSubjectMeta(subject, item);
5007
5067
  }
5008
5068
  let body;
5009
5069
  if (text) {
@@ -5036,7 +5096,7 @@ function toStreamCardVM(item, options = {}) {
5036
5096
  source,
5037
5097
  tier: getActivityTier(item.collection),
5038
5098
  timestamp,
5039
- title: buildTitle(verb, source.label)
5099
+ title: buildTitle(verb, source.label, recordHasSubjectRef(record))
5040
5100
  };
5041
5101
  const author = buildAuthor(item);
5042
5102
  if (author) vm.author = author;
@@ -6523,7 +6583,7 @@ function describeSifaRecord(collection, value) {
6523
6583
  }
6524
6584
 
6525
6585
  // src/index.ts
6526
- var SIFA_SDK_VERSION = "0.19.13";
6586
+ var SIFA_SDK_VERSION = "0.19.15";
6527
6587
 
6528
6588
  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, DIMENSIONS_MAX_SCORE, EMPLOYMENT_TYPE_GROUPS, EMPLOYMENT_TYPE_LABELS, ENTITY_REF_ANCHORS, EndorsementConfirmationRecordSchema, EndorsementRecordSchema, EntityImportSearchResponseSchema, EntityMintDomainResponseSchema, EntityResolveDomainRequestSchema, EntityResolveDomainResponseSchema, EntitySearchResponseSchema, EntitySearchResultSchema, EntitySelectRequestSchema, EntitySelectResponseSchema, FEATURE_FLAGS, FeatureAllowlistEntrySchema, FeedActorSchema, FollowFeedItemSchema, FollowFeedPageSchema, FollowProfilePageSchema, FollowProfileSchema, GraphFollowRecordSchema, 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_OPTIONS, OPEN_TO_TOKENS, 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, 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, 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, formatLocation, formatPresentationDuration, formatRelationship, formatRelativeTime, formatSingleDate, formatSpanDate, formatTimelineDate, getActivityTaxonomyVersion, getActivityTier, getActivityVerbsVersion, getAppCategoryIcon, getAppIdForCollection, getArtifactLinkKindLabel, getCalendarEventModeLabel, getCalendarEventStatusLabel, getContinent, getDisplayLabel, getEmploymentTypeLabel, getFaviconUrl, getFilledDimensionsMap, getHandleStem, getIndustryLabelKey, getInvestmentRoleLabel, getInvestmentStageLabel, getInvestmentStatusLabel, getInvolvementKindHeading, getInvolvementKindLabel, getLexiconEntry, getOpenToLabelKey, getPdsDisplayName, getPlatformLabel, getPresentationLinkTypeLabel, getPresentationRoleLabel, getPublicationTypeLabel, getPublisherByHost, getPublisherById, getPublisherFromSiteUrl, getTierMeta, getVerificationProvider, getVisibleSectionIds, getWorkplaceTypeLabel, groupInvolvementByHeading, groupSkillsByCategory, groupSkillsBySubCategory, groupSkillsForDisplay, hasAdultContent, hasPersonalProfileContent, hoistPrimary, isAppCategory, isCompanyPageIndexable, isCompanyRequired, isKnownAppId, isKnownPlatform, isKnownVerificationProvider, isLinked, isOnBehalfOfApplicable, isPseudoEmployer, isRegistrableDomainHandle, isRelationalActivity, isRoleLineRedundant, isSectionPopulated, isSelfAuthoredRich, 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, 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, streamAddressSchema, streamAuthorSchema, streamCardBodySchema, streamCardSubjectSchema, streamCardVMSchema, streamExternalLinkSchema, streamGeoSchema, streamMediaSchema, streamRichSegmentSchema, streamSourceSchema, streamThemeSchema, streamVerbSchema, stripHtmlToText, strongRefSchema, summarizePresentationDeliveries, summarizeProfileView, toStreamCardVM, toStreamCardVMs, truncateGraphemes, uriSchema, verbForCollection, visibleItems, youtubeThumbnailUrl, youtubeVideoId };
6529
6589
  //# sourceMappingURL=index.js.map