@indexnetwork/protocol 4.16.0-rc.358.1 → 4.17.0-rc.360.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 +8 -1
- package/dist/contact/contact.inviter.d.ts.map +1 -1
- package/dist/contact/contact.inviter.js +12 -5
- package/dist/contact/contact.inviter.js.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/opportunity/delivery-card.cache.d.ts.map +1 -1
- package/dist/opportunity/delivery-card.cache.js +7 -3
- package/dist/opportunity/delivery-card.cache.js.map +1 -1
- package/dist/opportunity/discriminator/discriminator.adjustments.d.ts +22 -15
- package/dist/opportunity/discriminator/discriminator.adjustments.d.ts.map +1 -1
- package/dist/opportunity/discriminator/discriminator.adjustments.js +39 -20
- package/dist/opportunity/discriminator/discriminator.adjustments.js.map +1 -1
- package/dist/opportunity/feed/feed.categorizer.d.ts.map +1 -1
- package/dist/opportunity/feed/feed.categorizer.js +6 -0
- package/dist/opportunity/feed/feed.categorizer.js.map +1 -1
- package/dist/opportunity/feed/feed.graph.d.ts +2 -0
- package/dist/opportunity/feed/feed.graph.d.ts.map +1 -1
- package/dist/opportunity/feed/feed.graph.js +53 -28
- package/dist/opportunity/feed/feed.graph.js.map +1 -1
- package/dist/opportunity/feed/feed.state.d.ts +3 -1
- package/dist/opportunity/feed/feed.state.d.ts.map +1 -1
- package/dist/opportunity/feed/feed.state.js.map +1 -1
- package/dist/opportunity/opportunity.claim-safety.d.ts +25 -0
- package/dist/opportunity/opportunity.claim-safety.d.ts.map +1 -0
- package/dist/opportunity/opportunity.claim-safety.js +89 -0
- package/dist/opportunity/opportunity.claim-safety.js.map +1 -0
- package/dist/opportunity/opportunity.discover.d.ts.map +1 -1
- package/dist/opportunity/opportunity.discover.js +6 -1
- package/dist/opportunity/opportunity.discover.js.map +1 -1
- package/dist/opportunity/opportunity.evaluator.d.ts.map +1 -1
- package/dist/opportunity/opportunity.evaluator.js +13 -8
- package/dist/opportunity/opportunity.evaluator.js.map +1 -1
- package/dist/opportunity/opportunity.graph.d.ts +23 -0
- package/dist/opportunity/opportunity.graph.d.ts.map +1 -1
- package/dist/opportunity/opportunity.graph.js +172 -17
- package/dist/opportunity/opportunity.graph.js.map +1 -1
- package/dist/opportunity/opportunity.persist.d.ts +8 -1
- package/dist/opportunity/opportunity.persist.d.ts.map +1 -1
- package/dist/opportunity/opportunity.persist.js +23 -2
- package/dist/opportunity/opportunity.persist.js.map +1 -1
- package/dist/opportunity/opportunity.presentation-cache.d.ts +7 -0
- package/dist/opportunity/opportunity.presentation-cache.d.ts.map +1 -0
- package/dist/opportunity/opportunity.presentation-cache.js +15 -0
- package/dist/opportunity/opportunity.presentation-cache.js.map +1 -0
- package/dist/opportunity/opportunity.presentation.d.ts.map +1 -1
- package/dist/opportunity/opportunity.presentation.js +8 -5
- package/dist/opportunity/opportunity.presentation.js.map +1 -1
- package/dist/opportunity/opportunity.presenter.d.ts +4 -4
- package/dist/opportunity/opportunity.presenter.d.ts.map +1 -1
- package/dist/opportunity/opportunity.presenter.js +55 -14
- package/dist/opportunity/opportunity.presenter.js.map +1 -1
- package/dist/opportunity/opportunity.safe-presentation.d.ts +1 -1
- package/dist/opportunity/opportunity.safe-presentation.d.ts.map +1 -1
- package/dist/opportunity/opportunity.safe-presentation.js +22 -9
- package/dist/opportunity/opportunity.safe-presentation.js.map +1 -1
- package/dist/opportunity/opportunity.tools.d.ts +1 -17
- package/dist/opportunity/opportunity.tools.d.ts.map +1 -1
- package/dist/opportunity/opportunity.tools.js +32 -2
- package/dist/opportunity/opportunity.tools.js.map +1 -1
- package/dist/shared/interfaces/database.interface.d.ts +46 -2
- package/dist/shared/interfaces/database.interface.d.ts.map +1 -1
- package/dist/shared/interfaces/database.interface.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opportunity.tools.d.ts","sourceRoot":"/","sources":["opportunity/opportunity.tools.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"opportunity.tools.d.ts","sourceRoot":"/","sources":["opportunity/opportunity.tools.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAkC5E,OAAO,KAAK,EAAE,WAAW,EAAqB,MAAM,4CAA4C,CAAC;AAGjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gDAAgD,CAAC;AAQtF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC/C,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B,GAAG,eAAe,GAAG,IAAI,CAezB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAC7B,iBAAiB,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,MAAM,GAAG,SAAS,CAQpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,WAAW,EAAE,MAAM,GAAG,SAAS,GAC9B,MAAM,GAAG,SAAS,CAIpB;AAED;;;;;;;GAOG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,EACD,IAAI,EAAE;IACJ,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,O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AO,CAAC;CAChC,GACA,MAAM,CA4DR;AAuDD;;;;;;;;;GASG;AACH,MAAM,MAAM,wBAAwB,GAChC,iBAAiB,GACjB,oBAAoB,GACpB,wBAAwB,GACxB,uBAAuB,GACvB,gBAAgB,GAChB,gBAAgB,CAAC;AAUrB,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,2CAs8D5E"}
|
|
@@ -5,6 +5,7 @@ import { deriveDiscoveryNetworkIds, focusedIntentId, focusedNetworkId, focusedNe
|
|
|
5
5
|
import { MINIMAL_MAIN_TEXT_MAX_CHARS, getPrimaryActionLabel, SECONDARY_ACTION_LABEL } from "./opportunity.labels.js";
|
|
6
6
|
import { narratorRemarkFromReasoning, stripUuids } from "./opportunity.presentation.js";
|
|
7
7
|
import { safeFallbackSummary, getSafePresentationOrSkip } from "./opportunity.safe-presentation.js";
|
|
8
|
+
import { stripUnsupportedOpportunityClaims } from "./opportunity.claim-safety.js";
|
|
8
9
|
import { runDiscoverFromQuery, continueDiscovery } from "./opportunity.discover.js";
|
|
9
10
|
import { isDiscoveryQuestionsEnabled, isUptakeGuardEnabled } from "../questioner/questioner.env.js";
|
|
10
11
|
import { OpportunityPresenter, gatherPresenterContext } from "./opportunity.presenter.js";
|
|
@@ -325,7 +326,30 @@ export function buildMinimalOpportunityCard(opp, viewerId, counterpartUserId, co
|
|
|
325
326
|
* fabricate URLs for cards that don't have them. MCP clients have no card
|
|
326
327
|
* renderer, so code fences would surface as raw JSON to end users.
|
|
327
328
|
*/
|
|
328
|
-
|
|
329
|
+
function sanitizeOpportunityCardProse(card) {
|
|
330
|
+
const sanitized = { ...card };
|
|
331
|
+
for (const key of ['mainText', 'digestSummary', 'headline', 'cta', 'mutualIntentsLabel']) {
|
|
332
|
+
const value = card[key];
|
|
333
|
+
if (typeof value === 'string') {
|
|
334
|
+
sanitized[key] =
|
|
335
|
+
stripUnsupportedOpportunityClaims(stripUuids(value)) || 'A suggested connection.';
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
const narratorChip = card.narratorChip;
|
|
339
|
+
if (narratorChip && typeof narratorChip === 'object' && !Array.isArray(narratorChip)) {
|
|
340
|
+
const narrator = narratorChip;
|
|
341
|
+
if (typeof narrator.text === 'string') {
|
|
342
|
+
sanitized.narratorChip = {
|
|
343
|
+
...narrator,
|
|
344
|
+
text: stripUnsupportedOpportunityClaims(stripUuids(narrator.text)) ||
|
|
345
|
+
'A potential connection worth exploring.',
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return sanitized;
|
|
350
|
+
}
|
|
351
|
+
export function buildOpportunityPresentation(inputCards, opts) {
|
|
352
|
+
const cards = inputCards.map(sanitizeOpportunityCardProse);
|
|
329
353
|
if (cards.length === 0)
|
|
330
354
|
return opts.leadIn;
|
|
331
355
|
if (opts.isMcp) {
|
|
@@ -824,6 +848,12 @@ export function createOpportunityTools(defineTool, deps) {
|
|
|
824
848
|
const viewerRole = viewerIsParty ? "party" : "introducer";
|
|
825
849
|
const isCounterpartGhost = counterpartUser?.isGhost ?? false;
|
|
826
850
|
const primaryActionLabel = getPrimaryActionLabel(viewerRole);
|
|
851
|
+
const publicMatchReason = safeFallbackSummary(reasoning, {
|
|
852
|
+
counterpartName,
|
|
853
|
+
introducerName: introducerUser?.name ?? undefined,
|
|
854
|
+
maxChars: MINIMAL_MAIN_TEXT_MAX_CHARS,
|
|
855
|
+
emptyText: "A suggested connection.",
|
|
856
|
+
});
|
|
827
857
|
const narratorText = narratorRemarkFromReasoning(reasoning, counterpartName, introducerUser?.name ?? undefined);
|
|
828
858
|
const narratorChip = viewerIsParty
|
|
829
859
|
? {
|
|
@@ -895,7 +925,7 @@ export function createOpportunityTools(defineTool, deps) {
|
|
|
895
925
|
opportunities: [
|
|
896
926
|
{
|
|
897
927
|
opportunityId: created.id,
|
|
898
|
-
matchReason:
|
|
928
|
+
matchReason: publicMatchReason,
|
|
899
929
|
score: confidence,
|
|
900
930
|
status: created.status ?? "draft",
|
|
901
931
|
},
|