@indexnetwork/protocol 66.0.0-rc.659.1 → 66.0.0-rc.663.1
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/CHANGELOG.md +1 -0
- package/dist/internal/opportunities/opportunity.cards.d.ts +2 -0
- package/dist/internal/opportunities/opportunity.cards.js +2 -1
- package/dist/internal/shared/utils/social-label.d.ts +2 -1
- package/dist/internal/shared/utils/social-label.js +6 -1
- package/dist/platform/enrichment/ports.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
### Added
|
|
12
12
|
|
|
13
|
+
- `OpportunityCard` gains `updatedAt`, when the opportunity last changed. It is stamped live on every read, so a cached card never carries a stale time.
|
|
13
14
|
- `decideNegotiationResume(state, userId)` lets a seat take the first turn of a new round on a negotiation paused with nobody to move, refusing with `not_paused` while a seat has the turn; `Negotiations.resume` applies it. Nothing resumes on its own: a seat resumes when its owner's new context bears on the pair.
|
|
14
15
|
- `currentRound(turns)` returns the turns of the round in progress, and `observeNegotiation` returns `remainingTurns` for it.
|
|
15
16
|
- `OpportunityCard` gains `priorOpportunity` (an earlier accepted opportunity, or a pending one the viewer already said yes to) and `peerChat` (the viewer's existing direct chat with the counterpart), two separate facts. The card presenter gets the prior opportunity and no longer words a known contact as new. Types `PriorOpportunity` and `PeerChat` are exported.
|
|
@@ -10,6 +10,8 @@ import { OpportunityPresenter } from './opportunity.presentation.js';
|
|
|
10
10
|
export interface OpportunityCard {
|
|
11
11
|
opportunityId: string;
|
|
12
12
|
createdAt?: string;
|
|
13
|
+
/** When the opportunity last changed: arrived, committed, accepted, or closed. Stamped live on every read. */
|
|
14
|
+
updatedAt?: string;
|
|
13
15
|
/** Lifecycle status of the underlying opportunity at render time. */
|
|
14
16
|
status?: OpportunityStatus;
|
|
15
17
|
userId: string;
|
|
@@ -95,7 +95,7 @@ export async function presentOpportunityCard(deps, opportunity, viewerId, option
|
|
|
95
95
|
try {
|
|
96
96
|
const hit = await deps.cache.get(cacheKey);
|
|
97
97
|
if (hit && (hit.presentedPrior ?? null) === priorKey(peerContext.priorOpportunity)) {
|
|
98
|
-
return stampPeerContext(stampViewerCommitted({ ...hit, status: opportunity.status }, viewerCommitted), peerContext);
|
|
98
|
+
return stampPeerContext(stampViewerCommitted({ ...hit, status: opportunity.status, updatedAt: opportunity.updatedAt.toISOString() }, viewerCommitted), peerContext);
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
catch (error) {
|
|
@@ -113,6 +113,7 @@ export async function presentOpportunityCard(deps, opportunity, viewerId, option
|
|
|
113
113
|
const identity = {
|
|
114
114
|
opportunityId: opportunity.id,
|
|
115
115
|
createdAt: opportunity.createdAt.toISOString(),
|
|
116
|
+
updatedAt: opportunity.updatedAt.toISOString(),
|
|
116
117
|
status: opportunity.status,
|
|
117
118
|
userId: counterpart.userId,
|
|
118
119
|
name,
|
|
@@ -3,7 +3,7 @@ import type { UserSocial } from '../../../platform/database.js';
|
|
|
3
3
|
* Infers a canonical social label from a URL or handle string.
|
|
4
4
|
*
|
|
5
5
|
* @param value - A URL or plain handle string.
|
|
6
|
-
* @returns One of `'linkedin' | 'twitter' | 'github' | 'telegram' | 'custom'`.
|
|
6
|
+
* @returns One of `'linkedin' | 'twitter' | 'github' | 'telegram' | 'bluesky' | 'custom'`.
|
|
7
7
|
*/
|
|
8
8
|
export declare function detectSocialLabel(value: string): string;
|
|
9
9
|
/** Flat enrichment request shape produced from a UserSocial array. */
|
|
@@ -12,6 +12,7 @@ export interface EnrichmentRequest {
|
|
|
12
12
|
twitter?: string;
|
|
13
13
|
github?: string;
|
|
14
14
|
telegram?: string;
|
|
15
|
+
bluesky?: string;
|
|
15
16
|
websites?: string[];
|
|
16
17
|
}
|
|
17
18
|
/**
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
* Infers a canonical social label from a URL or handle string.
|
|
3
3
|
*
|
|
4
4
|
* @param value - A URL or plain handle string.
|
|
5
|
-
* @returns One of `'linkedin' | 'twitter' | 'github' | 'telegram' | 'custom'`.
|
|
5
|
+
* @returns One of `'linkedin' | 'twitter' | 'github' | 'telegram' | 'bluesky' | 'custom'`.
|
|
6
6
|
*/
|
|
7
7
|
export function detectSocialLabel(value) {
|
|
8
8
|
const lower = value.toLowerCase();
|
|
9
|
+
if (/^(?:https?:\/\/)?(?:www\.)?bsky\.app\/profile\//.test(lower))
|
|
10
|
+
return 'bluesky';
|
|
9
11
|
if (lower.includes('linkedin.com'))
|
|
10
12
|
return 'linkedin';
|
|
11
13
|
if (lower.includes('x.com') || lower.includes('twitter.com'))
|
|
@@ -36,6 +38,9 @@ export function socialsToEnrichmentRequest(socials) {
|
|
|
36
38
|
case 'github':
|
|
37
39
|
result.github = s.value;
|
|
38
40
|
break;
|
|
41
|
+
case 'bluesky':
|
|
42
|
+
result.bluesky = s.value;
|
|
43
|
+
break;
|
|
39
44
|
case 'telegram':
|
|
40
45
|
result.telegram = s.value;
|
|
41
46
|
break;
|
|
@@ -6,6 +6,7 @@ export interface EnrichmentRequest {
|
|
|
6
6
|
twitter?: string;
|
|
7
7
|
github?: string;
|
|
8
8
|
telegram?: string;
|
|
9
|
+
bluesky?: string;
|
|
9
10
|
websites?: string[];
|
|
10
11
|
}
|
|
11
12
|
/** Structured profile enrichment result. */
|
|
@@ -27,6 +28,7 @@ export interface EnrichmentResult {
|
|
|
27
28
|
twitter?: string;
|
|
28
29
|
github?: string;
|
|
29
30
|
telegram?: string;
|
|
31
|
+
bluesky?: string;
|
|
30
32
|
websites?: string[];
|
|
31
33
|
};
|
|
32
34
|
confidentMatch: boolean;
|