@singi-labs/sifa-sdk 0.9.4 → 0.9.6

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/README.md CHANGED
@@ -35,7 +35,7 @@ Published publicly so third-party developers can build their own AT Protocol cli
35
35
  | ATproto | Wrapper around `@atproto/api` that accepts an authenticated agent |
36
36
  | Format | Pure formatters for dates, locations, profile completeness |
37
37
  | Logic | Business-logic predicates (display-only; server-side trust logic lives in `sifa-api`) |
38
- | Taxonomy | Constants and enums (continents, industries, skill categories, etc.) |
38
+ | Taxonomy | Constants and enums (continents, industries, skill categories, activity tiers) |
39
39
  | Tokens | Sifa-brand design tokens, exported via `@singi-labs/sifa-sdk/tokens` (optional) |
40
40
 
41
41
  ---
@@ -58,6 +58,17 @@ Optional design tokens (skip if you have your own brand):
58
58
  import { colors, spacing } from '@singi-labs/sifa-sdk/tokens';
59
59
  ```
60
60
 
61
+ Classify an AT Protocol NSID into one of three activity tiers (`creation`,
62
+ `action`, `filtered`). Unknown NSIDs default to `filtered`:
63
+
64
+ ```ts
65
+ import { getActivityTier, getTierMeta } from '@singi-labs/sifa-sdk';
66
+
67
+ getActivityTier('app.bsky.feed.post'); // 'creation'
68
+ getActivityTier('app.bsky.feed.like'); // 'action'
69
+ getTierMeta('creation'); // { label: 'Made', shownOnPublicProfile: true, ... }
70
+ ```
71
+
61
72
  ---
62
73
 
63
74
  ## For third-party developers
package/dist/index.cjs CHANGED
@@ -796,6 +796,350 @@ function groupSkillsByCategory(skills) {
796
796
  return ordered;
797
797
  }
798
798
 
799
+ // src/taxonomy/activity-tiers.json
800
+ var activity_tiers_default = {
801
+ $schema: "https://sifa.id/schemas/activity-tiers/v1.json",
802
+ version: "1.0.0",
803
+ updated: "2026-05-28",
804
+ tiers: {
805
+ creation: {
806
+ label: "Made",
807
+ description: "Substantive records the actor authored: posts, articles, repos, galleries, livestreams, RSVPs, CV entries. Surfaced on the public profile and in the network timeline.",
808
+ shownOnPublicProfile: true
809
+ },
810
+ action: {
811
+ label: "Did",
812
+ description: "Engagement records (likes, reposts, follows, votes, stars, reactions). Visible to the actor on the 'What is public about me' page and on the originating app, but not surfaced on the Sifa public profile.",
813
+ shownOnPublicProfile: false
814
+ },
815
+ filtered: {
816
+ label: null,
817
+ description: "Configuration, infrastructure, moderation, game state, ephemeral consumption signals (bookmarks, highlights), and other records Sifa does not display anywhere. The records remain public on the actor's PDS regardless.",
818
+ shownOnPublicProfile: false
819
+ }
820
+ },
821
+ lexicons: {
822
+ "app.bsky.feed.post": {
823
+ tier: "creation",
824
+ app: "bluesky",
825
+ notes: "Ambiguous: many posts are casual, but the lexicon also carries long-form posts and threads. Treated as creation; empty quote-posts (no text + record embed) are filtered at the consumer layer, not here."
826
+ },
827
+ "app.bsky.feed.like": { tier: "action", app: "bluesky" },
828
+ "app.bsky.feed.repost": { tier: "action", app: "bluesky" },
829
+ "app.bsky.feed.generator": {
830
+ tier: "filtered",
831
+ app: "bluesky",
832
+ notes: "Feed generator definition record, not personal activity."
833
+ },
834
+ "app.bsky.graph.follow": { tier: "action", app: "bluesky" },
835
+ "app.bsky.graph.block": { tier: "filtered", app: "bluesky", notes: "Moderation record." },
836
+ "app.bsky.graph.mute": { tier: "filtered", app: "bluesky", notes: "Moderation record." },
837
+ "app.bsky.graph.listblock": {
838
+ tier: "filtered",
839
+ app: "bluesky",
840
+ notes: "Moderation record."
841
+ },
842
+ "app.bsky.graph.listitem": {
843
+ tier: "filtered",
844
+ app: "bluesky",
845
+ notes: "List membership; rendered via the parent list, not as standalone activity."
846
+ },
847
+ "app.bsky.graph.list": {
848
+ tier: "filtered",
849
+ app: "bluesky",
850
+ notes: "User-curated list metadata; not surfaced as profile activity."
851
+ },
852
+ "app.bsky.graph.starterpack": { tier: "filtered", app: "bluesky" },
853
+ "app.bsky.actor.profile": {
854
+ tier: "filtered",
855
+ app: "bluesky",
856
+ notes: "Profile metadata record."
857
+ },
858
+ "sh.tangled.repo": { tier: "creation", app: "tangled" },
859
+ "sh.tangled.repo.issue": { tier: "creation", app: "tangled" },
860
+ "sh.tangled.repo.pull": { tier: "creation", app: "tangled" },
861
+ "sh.tangled.feed.star": { tier: "action", app: "tangled" },
862
+ "sh.tangled.graph.follow": { tier: "action", app: "tangled" },
863
+ "sh.tangled.actor.profile": {
864
+ tier: "filtered",
865
+ app: "tangled",
866
+ notes: "Profile metadata record."
867
+ },
868
+ "community.lexicon.calendar.rsvp": {
869
+ tier: "creation",
870
+ app: "smokesignal",
871
+ notes: "Ambiguous: RSVPs are reactions to events, but they are public commitments and the only Smoke Signal record Sifa scans today. Classified as creation."
872
+ },
873
+ "events.smokesignal.profile": {
874
+ tier: "filtered",
875
+ app: "smokesignal",
876
+ notes: "Profile metadata record."
877
+ },
878
+ "blue.flashes.feed.post": { tier: "creation", app: "flashes" },
879
+ "social.grain.gallery": { tier: "creation", app: "grain" },
880
+ "social.grain.gallery.item": {
881
+ tier: "filtered",
882
+ app: "grain",
883
+ notes: "Item-within-gallery; rendered via parent gallery."
884
+ },
885
+ "social.grain.photo": {
886
+ tier: "filtered",
887
+ app: "grain",
888
+ notes: "Raw photo asset; surfaced via the gallery that references it."
889
+ },
890
+ "social.grain.photo.exif": {
891
+ tier: "filtered",
892
+ app: "grain",
893
+ notes: "EXIF metadata for a photo."
894
+ },
895
+ "social.grain.story": {
896
+ tier: "filtered",
897
+ app: "grain",
898
+ notes: "Ephemeral story format."
899
+ },
900
+ "com.whtwnd.blog.entry": { tier: "creation", app: "whitewind" },
901
+ "fyi.unravel.frontpage.post": { tier: "creation", app: "frontpage" },
902
+ "fyi.unravel.frontpage.vote": { tier: "action", app: "frontpage" },
903
+ "social.psky.feed.post": { tier: "creation", app: "picosky" },
904
+ "link.pastesphere.snippet": { tier: "creation", app: "pastesphere" },
905
+ "site.standard.document": { tier: "creation", app: "standard" },
906
+ "computer.aetheros.page": { tier: "creation", app: "aetheros" },
907
+ "space.roomy.space.personal": { tier: "creation", app: "roomy" },
908
+ "dev.keytrace.claim": { tier: "creation", app: "keytrace" },
909
+ "social.popfeed.feed.review": { tier: "creation", app: "popfeed" },
910
+ "social.popfeed.feed.post": { tier: "creation", app: "popfeed" },
911
+ "social.popfeed.feed.note": { tier: "creation", app: "popfeed" },
912
+ "social.popfeed.feed.like": { tier: "action", app: "popfeed" },
913
+ "social.popfeed.challenge.participation": {
914
+ tier: "filtered",
915
+ app: "popfeed",
916
+ notes: "Challenge participation tracking."
917
+ },
918
+ "social.popfeed.actor.profile": {
919
+ tier: "filtered",
920
+ app: "popfeed",
921
+ notes: "Profile metadata record."
922
+ },
923
+ "place.stream.livestream": { tier: "creation", app: "streamplace" },
924
+ "place.stream.broadcast.origin": {
925
+ tier: "filtered",
926
+ app: "streamplace",
927
+ notes: "Broadcast origin/infrastructure record."
928
+ },
929
+ "place.stream.key": {
930
+ tier: "filtered",
931
+ app: "streamplace",
932
+ notes: "Stream key \u2014 sensitive infrastructure record."
933
+ },
934
+ "place.stream.metadata.configuration": {
935
+ tier: "filtered",
936
+ app: "streamplace",
937
+ notes: "Stream configuration metadata."
938
+ },
939
+ "place.stream.chat.message": {
940
+ tier: "filtered",
941
+ app: "streamplace",
942
+ notes: "Ephemeral chat message."
943
+ },
944
+ "place.stream.chat.profile": {
945
+ tier: "filtered",
946
+ app: "streamplace",
947
+ notes: "Chat profile metadata."
948
+ },
949
+ "app.sidetrail.trail": { tier: "creation", app: "semble" },
950
+ "app.sidetrail.walk": { tier: "creation", app: "semble" },
951
+ "at.youandme.connection": { tier: "creation", app: "youandme" },
952
+ "pub.leaflet.comment": { tier: "creation", app: "leaflet" },
953
+ "pub.leaflet.interactions.recommend": { tier: "action", app: "leaflet" },
954
+ "pub.leaflet.authFullPermissions": {
955
+ tier: "filtered",
956
+ app: "leaflet",
957
+ notes: "OAuth permission record."
958
+ },
959
+ "social.colibri.membership": { tier: "creation", app: "colibri" },
960
+ "social.colibri.message": {
961
+ tier: "filtered",
962
+ app: "colibri",
963
+ notes: "Chat message \u2014 high-volume conversational signal, not portfolio."
964
+ },
965
+ "social.colibri.reaction": { tier: "filtered", app: "colibri", notes: "Chat reaction." },
966
+ "social.colibri.channel": {
967
+ tier: "filtered",
968
+ app: "colibri",
969
+ notes: "Channel definition."
970
+ },
971
+ "social.colibri.community": {
972
+ tier: "filtered",
973
+ app: "colibri",
974
+ notes: "Community definition."
975
+ },
976
+ "social.colibri.approval": {
977
+ tier: "filtered",
978
+ app: "colibri",
979
+ notes: "Moderation approval record."
980
+ },
981
+ "social.colibri.category": {
982
+ tier: "filtered",
983
+ app: "colibri",
984
+ notes: "Category metadata."
985
+ },
986
+ "social.colibri.channel.read": {
987
+ tier: "filtered",
988
+ app: "colibri",
989
+ notes: "Read-state marker."
990
+ },
991
+ "social.colibri.actor.data": {
992
+ tier: "filtered",
993
+ app: "colibri",
994
+ notes: "Actor metadata."
995
+ },
996
+ "social.colibri.richtext.facet": {
997
+ tier: "filtered",
998
+ app: "colibri",
999
+ notes: "Richtext facet sub-record."
1000
+ },
1001
+ "app.collectivesocial.feed.list": {
1002
+ tier: "creation",
1003
+ app: "collectivesocial",
1004
+ notes: "Auto-created default Inbox lists are filtered at the consumer layer via isDefault=true predicate."
1005
+ },
1006
+ "net.alternativeproto.vote": {
1007
+ tier: "action",
1008
+ notes: "Vote record on a third-party protocol."
1009
+ },
1010
+ "network.cosmik.collection": {
1011
+ tier: "filtered",
1012
+ notes: "Stale registry id \u2014 Cosmik formerly in app registry."
1013
+ },
1014
+ "network.cosmik.collectionLink": { tier: "filtered" },
1015
+ "network.cosmik.connection": { tier: "filtered" },
1016
+ "network.cosmik.follow": { tier: "filtered" },
1017
+ "network.cosmik.card": { tier: "filtered", notes: "Link-in-bio card; consumption signal." },
1018
+ "social.pinksky.app.preference": {
1019
+ tier: "filtered",
1020
+ app: "bluesky",
1021
+ notes: "Pinkleap (Bluesky client) app preferences."
1022
+ },
1023
+ "at.margin.bookmark": {
1024
+ tier: "filtered",
1025
+ notes: "Bookmark \u2014 consumption signal, not creation."
1026
+ },
1027
+ "at.margin.highlight": {
1028
+ tier: "filtered",
1029
+ notes: "Highlight \u2014 consumption signal, not creation."
1030
+ },
1031
+ "community.lexicon.bookmarks.bookmark": {
1032
+ tier: "filtered",
1033
+ notes: "Bookmark \u2014 consumption signal."
1034
+ },
1035
+ "blue.linkat.board": { tier: "filtered", notes: "Link-in-bio board; consumption signal." },
1036
+ "dev.skyboard.board": { tier: "filtered", notes: "Skyboard task-board metadata." },
1037
+ "dev.skyboard.op": { tier: "filtered", notes: "Skyboard operation log." },
1038
+ "dev.skyboard.task": { tier: "filtered", notes: "Skyboard task record." },
1039
+ "net.anisota.player.state": { tier: "filtered", notes: "Anisota game player state." },
1040
+ "xyz.statusphere.status": {
1041
+ tier: "filtered",
1042
+ notes: "Statusphere emoji status \u2014 leisure signal."
1043
+ },
1044
+ "id.sifa.profile.self": {
1045
+ tier: "creation",
1046
+ app: "sifa",
1047
+ notes: "Sifa professional profile root."
1048
+ },
1049
+ "id.sifa.profile.position": { tier: "creation", app: "sifa" },
1050
+ "id.sifa.profile.education": { tier: "creation", app: "sifa" },
1051
+ "id.sifa.profile.skill": { tier: "creation", app: "sifa" },
1052
+ "id.sifa.profile.certification": { tier: "creation", app: "sifa" },
1053
+ "id.sifa.profile.project": { tier: "creation", app: "sifa" },
1054
+ "id.sifa.profile.volunteering": { tier: "creation", app: "sifa" },
1055
+ "id.sifa.profile.publication": { tier: "creation", app: "sifa" },
1056
+ "id.sifa.profile.course": { tier: "creation", app: "sifa" },
1057
+ "id.sifa.profile.honor": { tier: "creation", app: "sifa" },
1058
+ "id.sifa.profile.language": { tier: "creation", app: "sifa" },
1059
+ "id.sifa.profile.externalAccount": { tier: "creation", app: "sifa" },
1060
+ "id.sifa.profile.location": { tier: "creation", app: "sifa" },
1061
+ "id.sifa.endorsement": {
1062
+ tier: "creation",
1063
+ app: "sifa",
1064
+ notes: "Endorsement authored by the actor about another profile."
1065
+ },
1066
+ "id.sifa.endorsement.confirmation": {
1067
+ tier: "action",
1068
+ app: "sifa",
1069
+ notes: "Confirmation/acceptance of an endorsement received."
1070
+ },
1071
+ "id.sifa.graph.follow": { tier: "action", app: "sifa" },
1072
+ "id.sifa.graph.connection": {
1073
+ tier: "creation",
1074
+ app: "sifa",
1075
+ notes: "Mutual professional connection record."
1076
+ },
1077
+ "id.sifa.project.self": { tier: "creation", app: "sifa" },
1078
+ "id.sifa.project.member": { tier: "creation", app: "sifa" },
1079
+ "id.sifa.project.membership": { tier: "creation", app: "sifa" },
1080
+ "id.sifa.meeting": { tier: "creation", app: "sifa" },
1081
+ "id.sifa.authProfile": { tier: "filtered", app: "sifa", notes: "OAuth scope record." },
1082
+ "id.sifa.authProfileAccess": {
1083
+ tier: "filtered",
1084
+ app: "sifa",
1085
+ notes: "OAuth profile-access record."
1086
+ },
1087
+ "id.sifa.authProject": { tier: "filtered", app: "sifa", notes: "OAuth scope record." },
1088
+ "id.sifa.authConnection": { tier: "filtered", app: "sifa", notes: "OAuth scope record." },
1089
+ "id.sifa.authMeet": { tier: "filtered", app: "sifa", notes: "OAuth scope record." },
1090
+ "forum.barazo.post": { tier: "creation", app: "barazo" },
1091
+ "forum.barazo.community.member": { tier: "creation", app: "barazo" },
1092
+ "forum.barazo.reputation.event": { tier: "creation", app: "barazo" },
1093
+ "forum.barazo.reaction": { tier: "action", app: "barazo" },
1094
+ "forum.barazo.reply": {
1095
+ tier: "action",
1096
+ app: "barazo",
1097
+ notes: "Short conversational reply \u2014 engagement signal."
1098
+ },
1099
+ "forum.barazo.flag": { tier: "filtered", app: "barazo", notes: "Moderation flag." }
1100
+ }
1101
+ };
1102
+
1103
+ // src/taxonomy/activity-tiers.ts
1104
+ var tierMetaSchema = zod.z.object({
1105
+ label: zod.z.string().nullable(),
1106
+ description: zod.z.string(),
1107
+ shownOnPublicProfile: zod.z.boolean()
1108
+ });
1109
+ var lexiconEntrySchema = zod.z.object({
1110
+ tier: zod.z.enum(["creation", "action", "filtered"]),
1111
+ app: zod.z.string().optional(),
1112
+ notes: zod.z.string().optional()
1113
+ });
1114
+ var taxonomySchema = zod.z.object({
1115
+ version: zod.z.string(),
1116
+ updated: zod.z.string(),
1117
+ tiers: zod.z.object({
1118
+ creation: tierMetaSchema,
1119
+ action: tierMetaSchema,
1120
+ filtered: tierMetaSchema
1121
+ }),
1122
+ lexicons: zod.z.record(zod.z.string(), lexiconEntrySchema)
1123
+ });
1124
+ var parsed = taxonomySchema.parse(activity_tiers_default);
1125
+ var ACTIVITY_TIERS = Object.freeze(parsed);
1126
+ function getActivityTier(nsid) {
1127
+ if (!nsid) return "filtered";
1128
+ const entry = ACTIVITY_TIERS.lexicons[nsid];
1129
+ return entry ? entry.tier : "filtered";
1130
+ }
1131
+ function getLexiconEntry(nsid) {
1132
+ if (!nsid) return null;
1133
+ const entry = ACTIVITY_TIERS.lexicons[nsid];
1134
+ return entry ?? null;
1135
+ }
1136
+ function getTierMeta(tier) {
1137
+ return ACTIVITY_TIERS.tiers[tier];
1138
+ }
1139
+ function getActivityTaxonomyVersion() {
1140
+ return { version: ACTIVITY_TIERS.version, updated: ACTIVITY_TIERS.updated };
1141
+ }
1142
+
799
1143
  // src/format/format-time.ts
800
1144
  function formatRelativeTime(dateString) {
801
1145
  const date = new Date(dateString);
@@ -1040,6 +1384,208 @@ function meetsContrastAA(foreground, background) {
1040
1384
  return contrastRatio(foreground, background) >= 4.5;
1041
1385
  }
1042
1386
 
1387
+ // src/cards/app-url-patterns.ts
1388
+ var APP_URL_PATTERNS = Object.freeze({
1389
+ bluesky: {
1390
+ urlPattern: "https://bsky.app/profile/{handle}/post/{rkey}",
1391
+ profileUrlPattern: "https://bsky.app/profile/{handle}"
1392
+ },
1393
+ tangled: {
1394
+ profileUrlPattern: "https://tangled.sh/{handle}"
1395
+ },
1396
+ smokesignal: {
1397
+ urlPattern: "https://smokesignal.events/{did}/{rkey}",
1398
+ profileUrlPattern: "https://smokesignal.events/{did}"
1399
+ },
1400
+ whitewind: {
1401
+ urlPattern: "https://whtwnd.com/{handle}/{rkey}",
1402
+ profileUrlPattern: "https://whtwnd.com/{handle}"
1403
+ },
1404
+ frontpage: {
1405
+ urlPattern: "https://frontpage.fyi/post/{did}/{rkey}",
1406
+ profileUrlPattern: "https://frontpage.fyi/profile/{did}"
1407
+ },
1408
+ linkat: {
1409
+ profileUrlPattern: "https://linkat.blue/{handle}"
1410
+ },
1411
+ pastesphere: {
1412
+ urlPattern: "https://pastesphere.link/user/{handle}/snippet/{rkey}",
1413
+ profileUrlPattern: "https://pastesphere.link/user/{handle}"
1414
+ },
1415
+ kipclip: {
1416
+ profileUrlPattern: "https://kipclip.com/{handle}"
1417
+ },
1418
+ keytrace: {
1419
+ profileUrlPattern: "https://keytrace.dev/@{handle}"
1420
+ },
1421
+ sifa: {
1422
+ profileUrlPattern: "https://sifa.id/p/{handle}"
1423
+ },
1424
+ popfeed: {
1425
+ urlPattern: "https://popfeed.social/profile/{handle}",
1426
+ profileUrlPattern: "https://popfeed.social/profile/{handle}"
1427
+ },
1428
+ streamplace: {
1429
+ profileUrlPattern: "https://stream.place/{handle}"
1430
+ },
1431
+ semble: {
1432
+ profileUrlPattern: "https://semble.so/profile/{handle}"
1433
+ },
1434
+ grain: {
1435
+ urlPattern: "https://grain.social/profile/{did}/gallery/{rkey}",
1436
+ profileUrlPattern: "https://grain.social/profile/{did}"
1437
+ },
1438
+ youandme: { profileUrlPattern: "https://youandme.at" },
1439
+ anisota: { profileUrlPattern: "https://anisota.net" },
1440
+ margin: { profileUrlPattern: "https://margin.at" },
1441
+ beaconbits: { profileUrlPattern: "https://beaconbits.app" },
1442
+ bookhive: { profileUrlPattern: "https://bookhive.buzz/profile/{handle}" },
1443
+ colibri: { profileUrlPattern: "https://colibri.social" },
1444
+ collectivesocial: { profileUrlPattern: "https://app.collectivesocial.app" },
1445
+ github: {}
1446
+ });
1447
+ var COLLECTION_TO_APP = [
1448
+ ["app.bsky.", "bluesky"],
1449
+ ["sh.tangled.", "tangled"],
1450
+ ["events.smokesignal.", "smokesignal"],
1451
+ ["community.lexicon.calendar.", "smokesignal"],
1452
+ ["community.lexicon.bookmarks.", "kipclip"],
1453
+ ["com.kipclip.", "kipclip"],
1454
+ ["blue.flashes.", "flashes"],
1455
+ ["social.grain.", "grain"],
1456
+ ["com.whtwnd.", "whitewind"],
1457
+ ["fyi.unravel.frontpage.", "frontpage"],
1458
+ ["social.psky.", "picosky"],
1459
+ ["blue.linkat.", "linkat"],
1460
+ ["link.pastesphere.", "pastesphere"],
1461
+ ["site.standard.", "standard"],
1462
+ ["computer.aetheros.", "aetheros"],
1463
+ ["space.roomy.", "roomy"],
1464
+ ["dev.keytrace.", "keytrace"],
1465
+ ["social.popfeed.", "popfeed"],
1466
+ ["app.popsky.", "popfeed"],
1467
+ ["place.stream.", "streamplace"],
1468
+ ["app.sidetrail.", "semble"],
1469
+ ["network.cosmik.", "cosmik"],
1470
+ ["id.sifa.", "sifa"],
1471
+ ["forum.barazo.", "barazo"],
1472
+ ["xyz.statusphere.", "statusphere"],
1473
+ ["at.youandme.", "youandme"],
1474
+ ["net.anisota.", "anisota"],
1475
+ ["at.margin.", "margin"],
1476
+ ["app.beaconbits.", "beaconbits"],
1477
+ ["buzz.bookhive.", "bookhive"],
1478
+ ["social.colibri.", "colibri"]
1479
+ ];
1480
+
1481
+ // src/cards/resolve-card-url.ts
1482
+ function getAppIdForCollection(collection) {
1483
+ for (const [prefix, appId] of COLLECTION_TO_APP) {
1484
+ if (collection.startsWith(prefix)) return appId;
1485
+ }
1486
+ const parts = collection.split(".");
1487
+ if (parts.length >= 2) return `${parts[0]}.${parts[1]}`;
1488
+ return collection;
1489
+ }
1490
+ function interpolate(pattern, vars) {
1491
+ let result = pattern;
1492
+ for (const [key, value] of Object.entries(vars)) {
1493
+ if (result.includes(`{${key}}`)) {
1494
+ if (!value) return null;
1495
+ result = result.replaceAll(`{${key}}`, encodeURIComponent(value));
1496
+ }
1497
+ }
1498
+ return result;
1499
+ }
1500
+ function shouldUseItemPattern(appId, collection) {
1501
+ if (appId === "bluesky") {
1502
+ return collection === "app.bsky.feed.post";
1503
+ }
1504
+ return true;
1505
+ }
1506
+ function patternUrl(appId, vars, collection) {
1507
+ const patterns = APP_URL_PATTERNS[appId];
1508
+ if (!patterns) return null;
1509
+ if (patterns.urlPattern && shouldUseItemPattern(appId, collection)) {
1510
+ const url = interpolate(patterns.urlPattern, vars);
1511
+ if (url) return url;
1512
+ }
1513
+ if (patterns.profileUrlPattern) {
1514
+ const url = interpolate(patterns.profileUrlPattern, vars);
1515
+ if (url) return url;
1516
+ }
1517
+ return null;
1518
+ }
1519
+ var TANGLED_REPO_SLUG = /^[a-zA-Z0-9._-]+$/;
1520
+ function stringOrNull(value) {
1521
+ if (typeof value !== "string") return null;
1522
+ const trimmed = value.trim();
1523
+ return trimmed.length > 0 ? trimmed : null;
1524
+ }
1525
+ function parseAtUri(atUri) {
1526
+ const match = atUri.match(/^at:\/\/(did:[^/]+)\/[^/]+\/(.+)$/);
1527
+ if (!match || !match[1] || !match[2]) return null;
1528
+ return { did: match[1], rkey: match[2] };
1529
+ }
1530
+ function resolveCardUrl(item) {
1531
+ const { collection, record, uri, rkey, authorDid, authorHandle } = item;
1532
+ const appId = getAppIdForCollection(collection);
1533
+ if (collection.startsWith("sh.tangled.")) {
1534
+ const repoName = stringOrNull(record.name);
1535
+ if (repoName && authorHandle && TANGLED_REPO_SLUG.test(repoName)) {
1536
+ return `https://tangled.sh/${authorHandle}/${repoName}`;
1537
+ }
1538
+ return patternUrl("tangled", { handle: authorHandle, did: authorDid, rkey }, collection);
1539
+ }
1540
+ if (collection.startsWith("com.kipclip.") || collection.startsWith("community.lexicon.bookmarks.")) {
1541
+ const subject = stringOrNull(record.subject);
1542
+ if (subject) return subject;
1543
+ return patternUrl("kipclip", { handle: authorHandle, did: authorDid, rkey });
1544
+ }
1545
+ if (collection === "at.margin.bookmark") {
1546
+ const source = stringOrNull(record.source);
1547
+ if (source) return source;
1548
+ return null;
1549
+ }
1550
+ if (collection === "at.margin.annotation") {
1551
+ const target = record.target;
1552
+ if (target != null && typeof target === "object") {
1553
+ const source = stringOrNull(target.source);
1554
+ if (source) return source;
1555
+ }
1556
+ return APP_URL_PATTERNS.margin?.profileUrlPattern ?? null;
1557
+ }
1558
+ if (collection === "community.lexicon.calendar.rsvp") {
1559
+ const subject = record.subject;
1560
+ if (subject != null && typeof subject === "object") {
1561
+ const subjectUri = stringOrNull(subject.uri);
1562
+ if (subjectUri) {
1563
+ const parsed2 = parseAtUri(subjectUri);
1564
+ if (parsed2) {
1565
+ return `https://smokesignal.events/${parsed2.did}/${parsed2.rkey}`;
1566
+ }
1567
+ }
1568
+ }
1569
+ return null;
1570
+ }
1571
+ if (collection === "community.lexicon.calendar.event") {
1572
+ const parsed2 = parseAtUri(uri);
1573
+ if (parsed2) {
1574
+ return `https://smokesignal.events/${parsed2.did}/${parsed2.rkey}`;
1575
+ }
1576
+ return null;
1577
+ }
1578
+ if (collection.startsWith("site.standard.")) {
1579
+ const siteUrl = stringOrNull(record.siteUrl);
1580
+ const path = stringOrNull(record.path);
1581
+ if (siteUrl && path) return `${siteUrl}${path}`;
1582
+ if (siteUrl) return siteUrl;
1583
+ }
1584
+ const recordUrl = stringOrNull(record.url);
1585
+ if (recordUrl) return recordUrl;
1586
+ return patternUrl(appId, { handle: authorHandle, did: authorDid, rkey }, collection);
1587
+ }
1588
+
1043
1589
  // src/logic/profile-completeness.ts
1044
1590
  var COMPLETENESS_MAX_SCORE = 6;
1045
1591
  function completenessScore(c) {
@@ -1260,10 +1806,13 @@ var ProfileVolunteeringRecordSchema = zod.z.object({
1260
1806
  });
1261
1807
 
1262
1808
  // src/index.ts
1263
- var SIFA_SDK_VERSION = "0.9.4";
1809
+ var SIFA_SDK_VERSION = "0.9.6";
1264
1810
 
1811
+ exports.ACTIVITY_TIERS = ACTIVITY_TIERS;
1812
+ exports.APP_URL_PATTERNS = APP_URL_PATTERNS;
1265
1813
  exports.CATEGORY_LABELS = CATEGORY_LABELS;
1266
1814
  exports.CATEGORY_ORDER = CATEGORY_ORDER;
1815
+ exports.COLLECTION_TO_APP = COLLECTION_TO_APP;
1267
1816
  exports.COMPLETENESS_MAX_SCORE = COMPLETENESS_MAX_SCORE;
1268
1817
  exports.CONTINENTS = CONTINENTS;
1269
1818
  exports.COUNTRIES = COUNTRIES;
@@ -1313,6 +1862,9 @@ exports.findIndustry = findIndustry;
1313
1862
  exports.formatDistanceToNow = formatDistanceToNow;
1314
1863
  exports.formatLocation = formatLocation;
1315
1864
  exports.formatRelativeTime = formatRelativeTime;
1865
+ exports.getActivityTaxonomyVersion = getActivityTaxonomyVersion;
1866
+ exports.getActivityTier = getActivityTier;
1867
+ exports.getAppIdForCollection = getAppIdForCollection;
1316
1868
  exports.getContinent = getContinent;
1317
1869
  exports.getDisplayLabel = getDisplayLabel;
1318
1870
  exports.getEmploymentTypeLabel = getEmploymentTypeLabel;
@@ -1320,9 +1872,11 @@ exports.getFaviconUrl = getFaviconUrl;
1320
1872
  exports.getFilledDimensionsMap = getFilledDimensionsMap;
1321
1873
  exports.getHandleStem = getHandleStem;
1322
1874
  exports.getIndustryLabelKey = getIndustryLabelKey;
1875
+ exports.getLexiconEntry = getLexiconEntry;
1323
1876
  exports.getOpenToLabelKey = getOpenToLabelKey;
1324
1877
  exports.getPdsDisplayName = getPdsDisplayName;
1325
1878
  exports.getPlatformLabel = getPlatformLabel;
1879
+ exports.getTierMeta = getTierMeta;
1326
1880
  exports.getWorkplaceTypeLabel = getWorkplaceTypeLabel;
1327
1881
  exports.groupSkillsByCategory = groupSkillsByCategory;
1328
1882
  exports.isKnownPlatform = isKnownPlatform;
@@ -1336,6 +1890,7 @@ exports.parseLocationString = parseLocationString;
1336
1890
  exports.pdsProviderFromApi = pdsProviderFromApi;
1337
1891
  exports.profileToDimensionInputs = profileToDimensionInputs;
1338
1892
  exports.relativeLuminance = relativeLuminance;
1893
+ exports.resolveCardUrl = resolveCardUrl;
1339
1894
  exports.rgbToString = rgbToString;
1340
1895
  exports.sanitizeDisplayText = sanitizeDisplayText;
1341
1896
  exports.sanitizeHandleInput = sanitizeHandleInput;