@indexnetwork/protocol 6.13.22-rc.405.1 → 6.15.0-rc.407.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 CHANGED
@@ -12,6 +12,20 @@ See [STABILITY.md](./STABILITY.md) for the public-contract and tier definitions.
12
12
 
13
13
  ## [Unreleased]
14
14
 
15
+ ### Added
16
+ - Add the injected `IntentProposalStore` host boundary so web proposal cards are
17
+ emitted only after the normalized description, optional network scope, and
18
+ complete verifier output have been durably bound to their owner.
19
+
20
+ ## [6.14.0] — 2026-07-25
21
+
22
+ ### Added
23
+ - Add `NEGOTIATION_INCLUDE_OTHER_INTENTS` (IND-571), a strict boolean
24
+ deployment policy for autonomous opportunity negotiation. The default
25
+ preserves exact-first bounded active-intent context; `false` isolates each
26
+ participant to its exact opportunity-bound intent across fresh and
27
+ continuation negotiation contexts.
28
+
15
29
  ## [6.13.22] — 2026-07-25
16
30
 
17
31
  ### Added
@@ -1,5 +1,5 @@
1
1
  import type { ToolRegistryCompositionDeps } from "../shared/agent/tool.helpers.js";
2
2
  /** Host capabilities consumed by signal and intent tools. */
3
- export type IntentToolDeps = Pick<ToolRegistryCompositionDeps, "userDb" | "systemDb"> & {
3
+ export type IntentToolDeps = Pick<ToolRegistryCompositionDeps, "userDb" | "systemDb"> & Pick<ToolRegistryCompositionDeps, "intentProposalStore"> & {
4
4
  graphs: Pick<ToolRegistryCompositionDeps["graphs"], "intent" | "intentIndex" | "profile">;
5
5
  };
@@ -593,6 +593,8 @@ export interface NegotiationCandidate {
593
593
  /** Exact opportunity-bound source and candidate intent IDs. */
594
594
  sourceIntentId?: string;
595
595
  candidateIntentId?: string;
596
+ /** Per-opportunity source context when its exact actor intent differs across a fan-out. */
597
+ sourceUser?: UserNegotiationContext;
596
598
  reasoning: string;
597
599
  valencyRole: string;
598
600
  networkId?: string;
@@ -1249,15 +1249,16 @@ export async function negotiateCandidates(negotiationGraph, sourceUser, candidat
1249
1249
  const emitWide = (event) => traceEmitter?.(event);
1250
1250
  const results = await Promise.all(candidates.map(async (candidate) => {
1251
1251
  const start = Date.now();
1252
+ const candidateSourceUser = candidate.sourceUser ?? sourceUser;
1252
1253
  if (candidate.opportunityId) {
1253
1254
  const candidateName = candidate.candidateUser?.profile?.name;
1254
1255
  emitWide({
1255
1256
  type: "negotiation_session_start",
1256
1257
  opportunityId: candidate.opportunityId,
1257
1258
  negotiationConversationId: "", // filled in on session_end
1258
- sourceUserId: sourceUser.id,
1259
+ sourceUserId: candidateSourceUser.id,
1259
1260
  candidateUserId: candidate.userId,
1260
- initiatorUserId: initiatorUserId ?? sourceUser.id,
1261
+ initiatorUserId: initiatorUserId ?? candidateSourceUser.id,
1261
1262
  ...(candidateName && { candidateName }),
1262
1263
  trigger: trigger ?? "ambient",
1263
1264
  startedAt: start,
@@ -1269,7 +1270,7 @@ export async function negotiateCandidates(negotiationGraph, sourceUser, candidat
1269
1270
  ? { networkId: candidate.networkId, prompt: indexContextOverrides?.get(candidate.networkId) ?? '' }
1270
1271
  : indexContext;
1271
1272
  const result = await invokeWithAbortSignal(negotiationGraph, {
1272
- sourceUser,
1273
+ sourceUser: candidateSourceUser,
1273
1274
  candidateUser: candidate.candidateUser,
1274
1275
  ...(candidate.sourceIntentId && { sourceIntentId: candidate.sourceIntentId }),
1275
1276
  ...(candidate.candidateIntentId && { candidateIntentId: candidate.candidateIntentId }),
@@ -1,5 +1,7 @@
1
1
  import type { NegotiationContinuationExecution, NegotiationContinuationReceipt, Opportunity, OpportunityGraphDatabase } from '../../shared/interfaces/database.interface.js';
2
2
  import type { QueueOpportunityNotificationFn } from './opportunity.lifecycle.js';
3
+ /** Default-compatible deployment policy for autonomous opportunity negotiation. */
4
+ export declare function negotiationIncludesOtherIntents(): boolean;
3
5
  interface NegotiationIntentSource {
4
6
  id?: string | null;
5
7
  summary?: string | null;
@@ -34,7 +36,7 @@ interface ExistingOpportunityNegotiationCandidate {
34
36
  candidateUser: ExistingOpportunityNegotiationUser;
35
37
  }
36
38
  /** Put an opportunity actor's exact intent first, then fill the bounded context without duplicates. */
37
- export declare function buildPrioritizedNegotiationIntents(activeIntents: readonly NegotiationIntentSource[], exactIntentId?: string | null, fallbackIntent?: NegotiationIntentSource | null): ExistingOpportunityNegotiationUser['intents'];
39
+ export declare function buildPrioritizedNegotiationIntents(activeIntents: readonly NegotiationIntentSource[], exactIntentId?: string | null, fallbackIntent?: NegotiationIntentSource | null, includeOtherIntents?: boolean): ExistingOpportunityNegotiationUser['intents'];
38
40
  /** Narrow port for translating one persisted opportunity into a negotiation invocation. */
39
41
  export type ExistingOpportunityNegotiationPort = Pick<OpportunityGraphDatabase, 'getActiveIntents' | 'getIntent' | 'getNetworkMemberContext' | 'getOpportunity' | 'getProfile' | 'getUser'>;
40
42
  export interface ExistingOpportunityNegotiationInput {
@@ -1,13 +1,17 @@
1
1
  import { resolveOpportunityActorIntent } from '../domain/opportunity.actor.js';
2
2
  const NEGOTIATION_INTENT_LIMIT = 5;
3
+ /** Default-compatible deployment policy for autonomous opportunity negotiation. */
4
+ export function negotiationIncludesOtherIntents() {
5
+ return process.env.NEGOTIATION_INCLUDE_OTHER_INTENTS !== 'false';
6
+ }
3
7
  /** Put an opportunity actor's exact intent first, then fill the bounded context without duplicates. */
4
- export function buildPrioritizedNegotiationIntents(activeIntents, exactIntentId, fallbackIntent) {
8
+ export function buildPrioritizedNegotiationIntents(activeIntents, exactIntentId, fallbackIntent, includeOtherIntents = true) {
5
9
  const exactId = typeof exactIntentId === 'string' && exactIntentId.trim().length > 0 ? exactIntentId : null;
6
10
  const exactActive = exactId ? activeIntents.find((intent) => intent.id === exactId) : undefined;
7
11
  const ordered = [
8
12
  ...(exactActive ? [exactActive] : []),
9
13
  ...(!exactActive && fallbackIntent?.id === exactId ? [fallbackIntent] : []),
10
- ...activeIntents,
14
+ ...(includeOtherIntents ? activeIntents : []),
11
15
  ];
12
16
  const seen = new Set();
13
17
  const intents = [];
@@ -51,13 +55,18 @@ export async function negotiateExistingOpportunity(database, executeNegotiation,
51
55
  return { kind: 'skipped', reason: 'no_candidate_actor' };
52
56
  const sourceIntentId = resolveOpportunityActorIntent(sourceActor);
53
57
  const candidateIntentId = resolveOpportunityActorIntent(candidateActor);
58
+ const includeOtherIntents = negotiationIncludesOtherIntents();
54
59
  const [sourceAccount, sourceProfile, sourceIntents, candidateAccount, candidateProfile, candidateIntents] = await Promise.all([
55
60
  database.getUser(sourceActor.userId).catch(() => null),
56
61
  database.getProfile(sourceActor.userId).catch(() => null),
57
- database.getActiveIntents(sourceActor.userId).catch(() => []),
62
+ includeOtherIntents
63
+ ? database.getActiveIntents(sourceActor.userId).catch(() => [])
64
+ : Promise.resolve([]),
58
65
  database.getUser(candidateActor.userId).catch(() => null),
59
66
  database.getProfile(candidateActor.userId).catch(() => null),
60
- database.getActiveIntents(candidateActor.userId).catch(() => []),
67
+ includeOtherIntents
68
+ ? database.getActiveIntents(candidateActor.userId).catch(() => [])
69
+ : Promise.resolve([]),
61
70
  ]);
62
71
  const [sourceFallbackIntent, candidateFallbackIntent] = await Promise.all([
63
72
  sourceIntentId && !sourceIntents.some((intent) => intent.id === sourceIntentId) ? database.getIntent(sourceIntentId).catch(() => null) : null,
@@ -65,7 +74,7 @@ export async function negotiateExistingOpportunity(database, executeNegotiation,
65
74
  ]);
66
75
  const sourceUser = {
67
76
  id: sourceActor.userId,
68
- intents: buildPrioritizedNegotiationIntents(sourceIntents, sourceIntentId, sourceFallbackIntent?.userId === sourceActor.userId ? sourceFallbackIntent : null),
77
+ intents: buildPrioritizedNegotiationIntents(sourceIntents, sourceIntentId, sourceFallbackIntent?.userId === sourceActor.userId ? sourceFallbackIntent : null, includeOtherIntents),
69
78
  profile: {
70
79
  name: sourceProfile?.identity?.name ?? sourceAccount?.name,
71
80
  bio: sourceProfile?.identity?.bio ?? sourceAccount?.intro ?? undefined,
@@ -84,7 +93,7 @@ export async function negotiateExistingOpportunity(database, executeNegotiation,
84
93
  networkId: candidateActor.networkId,
85
94
  candidateUser: {
86
95
  id: candidateActor.userId,
87
- intents: buildPrioritizedNegotiationIntents(candidateIntents, candidateIntentId, candidateFallbackIntent?.userId === candidateActor.userId ? candidateFallbackIntent : null),
96
+ intents: buildPrioritizedNegotiationIntents(candidateIntents, candidateIntentId, candidateFallbackIntent?.userId === candidateActor.userId ? candidateFallbackIntent : null, includeOtherIntents),
88
97
  profile: {
89
98
  name: candidateProfile?.identity?.name ?? candidateAccount?.name,
90
99
  bio: candidateProfile?.identity?.bio ?? candidateAccount?.intro ?? undefined,
@@ -34,7 +34,7 @@ import { mergeOpportunityEvidence, withCandidateEvidence, withMatchedStrategies
34
34
  import { normalizeOpportunityActorIntent, resolveOpportunityActorIntent } from '../domain/opportunity.actor.js';
35
35
  import { approveOpportunityIntroduction, deleteOpportunityLifecycle, sendOpportunityLifecycle, updateOpportunityLifecycle } from './opportunity.lifecycle.js';
36
36
  import { stampEligibleNewbornOpportunities } from './opportunity.newborn-stamping.js';
37
- import { buildPrioritizedNegotiationIntents, negotiateExistingOpportunity } from './opportunity.existing-negotiation.js';
37
+ import { buildPrioritizedNegotiationIntents, negotiateExistingOpportunity, negotiationIncludesOtherIntents } from './opportunity.existing-negotiation.js';
38
38
  import { admitOpportunityPersistence, createEligibleOpportunityStatusUpdater } from './opportunity.persistence-admission.js';
39
39
  export { buildPrioritizedNegotiationIntents } from './opportunity.existing-negotiation.js';
40
40
  const logger = protocolLogger('OpportunityGraph');
@@ -1878,6 +1878,7 @@ export class OpportunityGraphFactory {
1878
1878
  try {
1879
1879
  // Use the same discoveryUserId pattern as evaluationNode
1880
1880
  const discoveryUserId = (state.onBehalfOfUserId ?? state.userId);
1881
+ const includeOtherIntents = negotiationIncludesOtherIntents();
1881
1882
  const sourceAccount = await this.database.getUser(discoveryUserId).catch(() => null);
1882
1883
  const sourceIntentInputs = (state.indexedIntents ?? []).map((intent) => ({
1883
1884
  id: intent.intentId,
@@ -1893,7 +1894,7 @@ export class OpportunityGraphFactory {
1893
1894
  : null;
1894
1895
  const sourceUser = {
1895
1896
  id: discoveryUserId,
1896
- intents: buildPrioritizedNegotiationIntents(sourceIntentInputs, state.triggerIntentId, ownedSourceFallback),
1897
+ intents: buildPrioritizedNegotiationIntents(sourceIntentInputs, state.triggerIntentId, ownedSourceFallback, includeOtherIntents),
1897
1898
  profile: {
1898
1899
  name: state.sourceProfile?.identity?.name ?? sourceAccount?.name,
1899
1900
  bio: state.sourceProfile?.identity?.bio ?? sourceAccount?.intro ?? undefined,
@@ -1945,20 +1946,33 @@ export class OpportunityGraphFactory {
1945
1946
  const userId = candidateActor.userId;
1946
1947
  const sourceIntentId = resolveOpportunityActorIntent(sourceActor);
1947
1948
  const candidateIntentId = resolveOpportunityActorIntent(candidateActor);
1948
- const [profile, user, activeIntents, intent] = await Promise.all([
1949
+ const sourceExactActive = sourceIntentId
1950
+ ? sourceIntentInputs.find((sourceIntent) => sourceIntent.id === sourceIntentId)
1951
+ : undefined;
1952
+ const [profile, user, activeIntents, intent, sourceIntent] = await Promise.all([
1949
1953
  this.database.getProfile(userId).catch(() => null),
1950
1954
  this.database.getUser(userId).catch(() => null),
1951
- this.database.getActiveIntents(userId).catch(() => []),
1955
+ includeOtherIntents
1956
+ ? this.database.getActiveIntents(userId).catch(() => [])
1957
+ : Promise.resolve([]),
1952
1958
  candidateIntentId
1953
1959
  ? this.database.getIntent(candidateIntentId).catch(() => null)
1954
1960
  : null,
1961
+ sourceIntentId && !sourceExactActive
1962
+ ? this.database.getIntent(sourceIntentId).catch(() => null)
1963
+ : null,
1955
1964
  ]);
1956
1965
  const ownedFallbackIntent = intent?.userId === userId ? intent : null;
1957
- const candidateIntents = buildPrioritizedNegotiationIntents(activeIntents, candidateIntentId, ownedFallbackIntent);
1966
+ const ownedSourceIntent = sourceIntent?.userId === discoveryUserId ? sourceIntent : null;
1967
+ const candidateIntents = buildPrioritizedNegotiationIntents(activeIntents, candidateIntentId, ownedFallbackIntent, includeOtherIntents);
1958
1968
  return {
1959
1969
  userId,
1960
1970
  ...(sourceIntentId ? { sourceIntentId } : {}),
1961
1971
  ...(candidateIntentId ? { candidateIntentId } : {}),
1972
+ sourceUser: {
1973
+ ...sourceUser,
1974
+ intents: buildPrioritizedNegotiationIntents(sourceIntentInputs, sourceIntentId, ownedSourceIntent, includeOtherIntents),
1975
+ },
1962
1976
  opportunityId: opp.id,
1963
1977
  opportunityStatus: opp.status,
1964
1978
  opportunityUpdatedAt: opp.updatedAt,
@@ -172,6 +172,7 @@ export async function createChatTools(deps, preResolvedContext) {
172
172
  ...(deps.chatQuestions && { chatQuestions: deps.chatQuestions }),
173
173
  ...(deps.chatSession && { chatSession: deps.chatSession }),
174
174
  ...(deps.getUserContextText && { getUserContextText: deps.getUserContextText }),
175
+ ...(deps.intentProposalStore && { intentProposalStore: deps.intentProposalStore }),
175
176
  graphs: {
176
177
  profile: profileGraph,
177
178
  intent: intentGraph,
@@ -207,6 +207,8 @@ interface ToolContextBindings {
207
207
  chatQuestions?: ChatQuestionsHost;
208
208
  /** Optional durable persistence for reporter cleanup-action proposals. */
209
209
  actionProposalStore?: import('../../chat/reporter.action.contracts.js').AgentActionProposalStore;
210
+ /** Durable host persistence for verified intent proposals shown in chat. */
211
+ intentProposalStore?: import('../../signals/domain/intent.proposal.js').IntentProposalStore;
210
212
  /**
211
213
  * Host bridge for the negotiator persona's `remember`/`forget` memory
212
214
  * tools (P5.4). Injected by the composition root only when negotiator
@@ -384,6 +386,8 @@ interface ToolDepsBindings {
384
386
  userDb: UserDatabase;
385
387
  /** Context-bound database for LLM/system operations on cross-user resources within shared networks. */
386
388
  systemDb: SystemDatabase;
389
+ /** Durable host persistence for verified intent proposals shown in chat. */
390
+ intentProposalStore?: import('../../signals/domain/intent.proposal.js').IntentProposalStore;
387
391
  scraper: Scraper;
388
392
  embedder: import('../interfaces/embedder.interface.js').Embedder;
389
393
  cache: Cache;
@@ -3,6 +3,7 @@ import { IntentGraphState } from "../domain/intent.state.js";
3
3
  import { ExplicitIntentInferrer } from "./intent.inferrer.js";
4
4
  import { SemanticVerifier } from "./intent.verifier.js";
5
5
  import { DEFAULT_SPECIFICITY_WARNING } from "../domain/signal.specificity.js";
6
+ import { normalizeIntentDescription } from "../domain/intent.proposal.js";
6
7
  import { IntentReconciler } from "./intent.reconciler.js";
7
8
  import { getAbortSignalConfig } from "../../shared/agent/model-signal.js";
8
9
  import { protocolLogger } from "../../shared/observability/protocol.logger.js";
@@ -497,18 +498,6 @@ export class IntentGraphFactory {
497
498
  };
498
499
  });
499
500
  };
500
- /** Strip URLs and "More details at [url]" from intent payloads before persisting. */
501
- const sanitizePayload = (payload) => {
502
- if (!payload || typeof payload !== "string")
503
- return payload;
504
- const out = payload
505
- .replace(/\s*More details at\s*:?\s*https?:\/\/[^\s"'<>)\]]+/gi, "")
506
- .replace(/\s*See\s+https?:\/\/[^\s"'<>)\]]+\s+for\s+more[^.]*\.?/gi, "")
507
- .replace(/https?:\/\/[^\s"'<>)\]]+/g, "")
508
- .replace(/\s{2,}/g, " ")
509
- .trim();
510
- return out.replace(/[.,;]\s*$/, "").trim() || payload;
511
- };
512
501
  /**
513
502
  * Generate a flat embedding for an intent payload, swallowing failures so
514
503
  * persistence can continue without an embedding. `intentId` is logging-only
@@ -554,14 +543,14 @@ export class IntentGraphFactory {
554
543
  const verifiedIntentByPayload = new Map();
555
544
  for (const verifiedIntent of state.verifiedIntents) {
556
545
  verifiedIntentByPayload.set(verifiedIntent.description, verifiedIntent);
557
- verifiedIntentByPayload.set(sanitizePayload(verifiedIntent.description), verifiedIntent);
546
+ verifiedIntentByPayload.set(normalizeIntentDescription(verifiedIntent.description), verifiedIntent);
558
547
  }
559
548
  for (const action of actions) {
560
549
  const actionType = action.type.toLowerCase();
561
550
  try {
562
551
  if (actionType === 'create') {
563
552
  const createAction = action;
564
- const sanitizedPayload = sanitizePayload(createAction.payload);
553
+ const sanitizedPayload = normalizeIntentDescription(createAction.payload);
565
554
  const matchedVerifiedIntent = verifiedIntentByPayload.get(createAction.payload) ||
566
555
  verifiedIntentByPayload.get(sanitizedPayload);
567
556
  // Generate embedding for the intent payload
@@ -610,7 +599,7 @@ export class IntentGraphFactory {
610
599
  }
611
600
  else if (actionType === 'update') {
612
601
  const updateAction = action;
613
- const sanitizedPayload = sanitizePayload(updateAction.payload);
602
+ const sanitizedPayload = normalizeIntentDescription(updateAction.payload);
614
603
  const matchedVerifiedIntent = verifiedIntentByPayload.get(updateAction.payload) ||
615
604
  verifiedIntentByPayload.get(sanitizedPayload);
616
605
  // Regenerate embedding for the updated payload
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  import { IntentClarifier } from "./intent.clarifier.js";
3
3
  import { DEFAULT_SPECIFICITY_WARNING } from "../domain/signal.specificity.js";
4
+ import { normalizeIntentDescription } from "../domain/intent.proposal.js";
4
5
  import { protocolLogger } from "../../shared/observability/protocol.logger.js";
5
6
  import { traceGraph } from "../../shared/observability/trace.js";
6
7
  import { success, error, UUID_REGEX } from "../../shared/agent/tool.helpers.js";
@@ -265,7 +266,7 @@ export function createIntentTools(defineTool, deps) {
265
266
  "**What to pass:** A clear, concept-based description of what the user is looking for (e.g. 'Looking for an AI/ML co-founder in Berlin', " +
266
267
  "'Need a designer for a mobile app project'). If the user provided a URL, scrape it with scrape_url first and synthesize the content into a description.\n\n" +
267
268
  "**What happens:** The system runs inference (extracting structured intents), verification (checking specificity and speech-act type), " +
268
- "and returns a proposal widget. The proposal is NOT yet persisted — the user must approve it first.\n\n" +
269
+ "and durably stores an owner-scoped proposal containing the exact normalized description, optional network scope, and complete verifier output before returning a proposal widget. The intent itself is NOT yet persisted — the user must approve the proposal first.\n\n" +
269
270
  "**Returns:** An intent_proposal code block that MUST be included verbatim in the response. The frontend renders it as an interactive " +
270
271
  "card the user can approve or skip. On approval, the intent is persisted, indexed, and discovery begins.\n\n" +
271
272
  "**Next steps after approval:** The intent is automatically linked to relevant indexes. Call discover_opportunities(searchQuery) to explicitly trigger discovery, " +
@@ -419,13 +420,32 @@ export function createIntentTools(defineTool, deps) {
419
420
  });
420
421
  }
421
422
  // ── Proposal path (for web chat with interactive cards) ──
422
- // Build intent_proposal code fences for each verified intent
423
- const proposalBlocks = verified.map((v) => {
423
+ // Persist complete verifier output before emitting any usable card.
424
+ if (!deps.intentProposalStore) {
425
+ return error("Verified intent proposals are unavailable because durable proposal storage is not configured.");
426
+ }
427
+ const proposals = [];
428
+ const proposalBlocks = [];
429
+ for (const v of verified) {
430
+ if (!v.verification) {
431
+ return error("Intent verification produced no authoritative analysis; no proposal was created.", debugSteps);
432
+ }
424
433
  const proposalId = crypto.randomUUID();
434
+ const normalizedDescription = normalizeIntentDescription(v.description);
425
435
  const isBroad = isBroadAttributiveIntent(v);
436
+ proposals.push({
437
+ proposalId,
438
+ userId: context.userId,
439
+ description: normalizedDescription,
440
+ ...(effectiveIndexId ? { networkId: effectiveIndexId } : {}),
441
+ analysis: {
442
+ verifierOutput: v.verification,
443
+ combinedScore: v.score ?? null,
444
+ },
445
+ });
426
446
  const data = {
427
447
  proposalId,
428
- description: v.description,
448
+ description: normalizedDescription,
429
449
  ...(effectiveIndexId ? { networkId: effectiveIndexId } : {}),
430
450
  confidence: v.score != null ? Math.round(v.score * 100) / 100 : null,
431
451
  speechActType: v.verification?.classification ?? null,
@@ -434,10 +454,11 @@ export function createIntentTools(defineTool, deps) {
434
454
  missingSelectionalConstraints: v.verification?.missing_selectional_constraints ?? [],
435
455
  specificityWarning: isBroad ? specificityWarningFor(v) : normalizeSpecificityWarning(v.verification?.specificity_warning),
436
456
  };
437
- return ("```intent_proposal\n" +
457
+ proposalBlocks.push("```intent_proposal\n" +
438
458
  sanitizeJsonForCodeFence(JSON.stringify(data)) +
439
459
  "\n```");
440
- });
460
+ }
461
+ await deps.intentProposalStore.createProposals(proposals);
441
462
  const blocksText = proposalBlocks.join("\n\n");
442
463
  return success({
443
464
  proposed: true,
@@ -0,0 +1,35 @@
1
+ /** Verifier output retained verbatim across the host persistence boundary. */
2
+ export interface IntentProposalVerifierOutput {
3
+ reasoning: string;
4
+ classification: "COMMISSIVE" | "DIRECTIVE" | "ASSERTIVE" | "EXPRESSIVE" | "DECLARATION" | "UNKNOWN";
5
+ felicity_scores: {
6
+ clarity: number;
7
+ authority: number;
8
+ sincerity: number;
9
+ };
10
+ semantic_entropy: number;
11
+ referential_anchor: string | null;
12
+ referential_breadth: "narrow" | "moderate" | "broad";
13
+ missing_selectional_constraints: Array<"role" | "outcome" | "location" | "timeframe" | "domain" | "concrete_need">;
14
+ specificity_warning: string | null;
15
+ flags: string[];
16
+ }
17
+ /** Complete server-authoritative analysis captured for a verified intent proposal. */
18
+ export interface IntentProposalAnalysis {
19
+ verifierOutput: IntentProposalVerifierOutput;
20
+ combinedScore: number | null;
21
+ }
22
+ /** One proposal persisted by the host before its display card is emitted. */
23
+ export interface PersistableIntentProposal {
24
+ proposalId: string;
25
+ userId: string;
26
+ description: string;
27
+ networkId?: string;
28
+ analysis: IntentProposalAnalysis;
29
+ }
30
+ /** Host persistence boundary for durable, owner-scoped intent proposals. */
31
+ export interface IntentProposalStore {
32
+ createProposals(proposals: PersistableIntentProposal[]): Promise<void>;
33
+ }
34
+ /** Normalize intent text exactly as the direct graph write path does. */
35
+ export declare function normalizeIntentDescription(description: string): string;
@@ -0,0 +1,12 @@
1
+ /** Normalize intent text exactly as the direct graph write path does. */
2
+ export function normalizeIntentDescription(description) {
3
+ if (!description || typeof description !== "string")
4
+ return description;
5
+ const normalized = description
6
+ .replace(/\s*More details at\s*:?\s*https?:\/\/[^\s"'<>)\]]+/gi, "")
7
+ .replace(/\s*See\s+https?:\/\/[^\s"'<>)\]]+\s+for\s+more[^.]*\.?/gi, "")
8
+ .replace(/https?:\/\/[^\s"'<>)\]]+/g, "")
9
+ .replace(/\s{2,}/g, " ")
10
+ .trim();
11
+ return normalized.replace(/[.,;]\s*$/, "").trim() || description;
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indexnetwork/protocol",
3
- "version": "6.13.22-rc.405.1",
3
+ "version": "6.15.0-rc.407.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",