@indexnetwork/protocol 3.7.1 → 3.9.0-rc.284.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.
Files changed (33) hide show
  1. package/dist/context/context.generator.d.ts +36 -3
  2. package/dist/context/context.generator.d.ts.map +1 -1
  3. package/dist/context/context.generator.js +43 -3
  4. package/dist/context/context.generator.js.map +1 -1
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js.map +1 -1
  8. package/dist/negotiation/negotiation.tools.d.ts.map +1 -1
  9. package/dist/negotiation/negotiation.tools.js +37 -2
  10. package/dist/negotiation/negotiation.tools.js.map +1 -1
  11. package/dist/opportunity/opportunity.graph.d.ts.map +1 -1
  12. package/dist/opportunity/opportunity.graph.js +3 -1
  13. package/dist/opportunity/opportunity.graph.js.map +1 -1
  14. package/dist/premise/premise.decomposer.d.ts +8 -0
  15. package/dist/premise/premise.decomposer.d.ts.map +1 -1
  16. package/dist/premise/premise.decomposer.js +26 -14
  17. package/dist/premise/premise.decomposer.js.map +1 -1
  18. package/dist/premise/premise.graph.d.ts +50 -1
  19. package/dist/premise/premise.graph.d.ts.map +1 -1
  20. package/dist/premise/premise.graph.js +67 -2
  21. package/dist/premise/premise.graph.js.map +1 -1
  22. package/dist/premise/premise.state.d.ts +13 -0
  23. package/dist/premise/premise.state.d.ts.map +1 -1
  24. package/dist/premise/premise.state.js +7 -0
  25. package/dist/premise/premise.state.js.map +1 -1
  26. package/dist/profile/profile.graph.d.ts +10 -0
  27. package/dist/profile/profile.graph.d.ts.map +1 -1
  28. package/dist/profile/profile.graph.js +13 -1
  29. package/dist/profile/profile.graph.js.map +1 -1
  30. package/dist/shared/interfaces/database.interface.d.ts +27 -7
  31. package/dist/shared/interfaces/database.interface.d.ts.map +1 -1
  32. package/dist/shared/interfaces/database.interface.js.map +1 -1
  33. package/package.json +1 -1
@@ -1,10 +1,14 @@
1
1
  /**
2
2
  * User Context Generator
3
3
  *
4
- * Synthesizes network-scoped context paragraphs from user premises.
5
- * Two modes: cold-start (all premises at once) and incremental
4
+ * Synthesizes context paragraphs from user premises for storage in the
5
+ * user_contexts table. Two scopes:
6
+ * - network-scoped: who the person is through the lens of a given network
7
+ * - global (networkId = null): a cohesive, network-agnostic identity paragraph
8
+ * that replaces the legacy synthesized user_profile projection.
9
+ * Each scope supports cold-start (all premises at once) and incremental
6
10
  * (single premise change applied to an existing context).
7
- * Returns { text, embedding } for storage in the user_contexts table.
11
+ * Returns { text, embedding } for storage.
8
12
  */
9
13
  import type { EmbeddingGenerator } from "../shared/interfaces/embedder.interface.js";
10
14
  /** Input for cold-start context generation from a full set of premises. */
@@ -24,6 +28,19 @@ export interface IncrementalContextInput {
24
28
  networkPrompt: string | null;
25
29
  networkTitle: string;
26
30
  }
31
+ /** Input for cold-start global (network-agnostic) context generation. */
32
+ export interface GlobalContextInput {
33
+ premises: Array<{
34
+ text: string;
35
+ }>;
36
+ }
37
+ /** Input for incremental global context update from a single premise change. */
38
+ export interface GlobalIncrementalContextInput {
39
+ currentContext: string;
40
+ changeType: 'added' | 'updated' | 'retracted' | 'expired';
41
+ premiseText: string;
42
+ previousPremiseText?: string;
43
+ }
27
44
  /** Generated context paragraph with its embedding vector. */
28
45
  export interface UserContextResult {
29
46
  text: string;
@@ -51,6 +68,22 @@ export declare class UserContextGenerator {
51
68
  * @returns Updated context text with embedding vector
52
69
  */
53
70
  generateIncremental(input: IncrementalContextInput): Promise<UserContextResult>;
71
+ /**
72
+ * Generate a global (network-agnostic) identity paragraph from the full set
73
+ * of premises (cold-start). This is the profile-replacing projection stored
74
+ * as the user's global user_context row (networkId = null).
75
+ *
76
+ * @param input - The user's active premises
77
+ * @returns Synthesized global identity text with embedding vector
78
+ */
79
+ generateGlobalColdStart(input: GlobalContextInput): Promise<UserContextResult>;
80
+ /**
81
+ * Update the global identity paragraph after a single premise change.
82
+ *
83
+ * @param input - Current global context and change details
84
+ * @returns Updated global identity text with embedding vector
85
+ */
86
+ generateGlobalIncremental(input: GlobalIncrementalContextInput): Promise<UserContextResult>;
54
87
  /** Normalize an LLM message content into a plain string. */
55
88
  private extractText;
56
89
  /** Format the network context header for LLM prompts. */
@@ -1 +1 @@
1
- {"version":3,"file":"context.generator.d.ts","sourceRoot":"/","sources":["context/context.generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAErF,2EAA2E;AAC3E,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,yEAAyE;AACzE,MAAM,WAAW,uBAAuB;IACtC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAAC;IAC1D,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,6DAA6D;AAC7D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAMD;;;GAGG;AACH,qBAAa,oBAAoB;IAGnB,OAAO,CAAC,kBAAkB;IAFtC,OAAO,CAAC,KAAK,CAAuC;gBAEhC,kBAAkB,EAAE,kBAAkB;IAE1D;;;;;OAKG;IACG,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAiB5E;;;;;OAKG;IACG,mBAAmB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAiBrF,4DAA4D;IAC5D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;AAUD;;;GAGG;AACH,qBAAa,oBAAoB;IAGnB,OAAO,CAAC,kBAAkB;IAFtC,OAAO,CAAC,KAAK,CAAuC;gBAEhC,kBAAkB,EAAE,kBAAkB;IAE1D;;;;;OAKG;IACG,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAiB5E;;;;;OAKG;IACG,mBAAmB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAiBrF;;;;;;;OAOG;IACG,uBAAuB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAgBpF;;;;;OAKG;IACG,yBAAyB,CAAC,KAAK,EAAE,6BAA6B,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAgBjG,4DAA4D;IAC5D,OAAO,CAAC,WAAW;IAMnB,yDAAyD;IACzD,OAAO,CAAC,oBAAoB;IAM5B,8DAA8D;IAC9D,OAAO,CAAC,cAAc;IAatB,iEAAiE;YACnD,KAAK;CAIpB"}
@@ -1,16 +1,22 @@
1
1
  /**
2
2
  * User Context Generator
3
3
  *
4
- * Synthesizes network-scoped context paragraphs from user premises.
5
- * Two modes: cold-start (all premises at once) and incremental
4
+ * Synthesizes context paragraphs from user premises for storage in the
5
+ * user_contexts table. Two scopes:
6
+ * - network-scoped: who the person is through the lens of a given network
7
+ * - global (networkId = null): a cohesive, network-agnostic identity paragraph
8
+ * that replaces the legacy synthesized user_profile projection.
9
+ * Each scope supports cold-start (all premises at once) and incremental
6
10
  * (single premise change applied to an existing context).
7
- * Returns { text, embedding } for storage in the user_contexts table.
11
+ * Returns { text, embedding } for storage.
8
12
  */
9
13
  import { HumanMessage, SystemMessage } from "@langchain/core/messages";
10
14
  import { createModel } from "../shared/agent/model.config.js";
11
15
  import { getAbortSignalConfig, invokeWithAbortSignal } from "../shared/agent/model-signal.js";
12
16
  const COLD_START_SYSTEM_PROMPT = `You synthesize user context paragraphs for community matching. Given a list of premises (atomic facts about a person) and a network description, write a focused paragraph (3-6 sentences) that captures who this person is through the lens of that network's purpose. Highlight what is most relevant to the network. Write in third person. Be specific and concrete, not generic.`;
13
17
  const INCREMENTAL_SYSTEM_PROMPT = `You maintain user context paragraphs for community matching. You will receive the current context paragraph, a change that occurred, and the network description. Update the context paragraph to reflect the change while preserving all other information. Keep the same style: 3-6 sentences, third person, specific and concrete. For retractions/expirations, remove the relevant information. For additions/updates, integrate the new information naturally.`;
18
+ const GLOBAL_COLD_START_SYSTEM_PROMPT = `You synthesize a person's global identity profile from premises (atomic facts about them). Write a cohesive paragraph (4-8 sentences) capturing who this person is overall — their identity, work, expertise, and interests — independent of any single community or network. This is their canonical self-description, not lensed toward any particular purpose. Write in third person. Be specific and concrete, not generic. Do not invent facts beyond the premises.`;
19
+ const GLOBAL_INCREMENTAL_SYSTEM_PROMPT = `You maintain a person's global identity profile. You will receive the current profile paragraph and a change that occurred. Update the paragraph to reflect the change while preserving all other information. Keep the same style: 4-8 sentences, third person, specific and concrete, network-agnostic. For retractions/expirations, remove the relevant information. For additions/updates, integrate the new information naturally.`;
14
20
  /**
15
21
  * Generates network-scoped context paragraphs from user premises.
16
22
  * Uses LLM synthesis to produce focused context and an embedding vector.
@@ -54,6 +60,40 @@ export class UserContextGenerator {
54
60
  const embedding = await this.embed(text);
55
61
  return { text, embedding };
56
62
  }
63
+ /**
64
+ * Generate a global (network-agnostic) identity paragraph from the full set
65
+ * of premises (cold-start). This is the profile-replacing projection stored
66
+ * as the user's global user_context row (networkId = null).
67
+ *
68
+ * @param input - The user's active premises
69
+ * @returns Synthesized global identity text with embedding vector
70
+ */
71
+ async generateGlobalColdStart(input) {
72
+ const premiseBlock = input.premises.map(p => `- ${p.text}`).join('\n');
73
+ const response = await invokeWithAbortSignal(this.model, [
74
+ new SystemMessage(GLOBAL_COLD_START_SYSTEM_PROMPT),
75
+ new HumanMessage(`Premises:\n${premiseBlock}\n\nWrite a cohesive global identity paragraph for this person.`),
76
+ ]);
77
+ const text = this.extractText(response.content);
78
+ const embedding = await this.embed(text);
79
+ return { text, embedding };
80
+ }
81
+ /**
82
+ * Update the global identity paragraph after a single premise change.
83
+ *
84
+ * @param input - Current global context and change details
85
+ * @returns Updated global identity text with embedding vector
86
+ */
87
+ async generateGlobalIncremental(input) {
88
+ const changeDescription = this.describeChange(input);
89
+ const response = await invokeWithAbortSignal(this.model, [
90
+ new SystemMessage(GLOBAL_INCREMENTAL_SYSTEM_PROMPT),
91
+ new HumanMessage(`Current profile:\n${input.currentContext}\n\nChange:\n${changeDescription}\n\nWrite the updated global identity paragraph.`),
92
+ ]);
93
+ const text = this.extractText(response.content);
94
+ const embedding = await this.embed(text);
95
+ return { text, embedding };
96
+ }
57
97
  /** Normalize an LLM message content into a plain string. */
58
98
  extractText(content) {
59
99
  return typeof content === 'string'
@@ -1 +1 @@
1
- {"version":3,"file":"context.generator.js","sourceRoot":"/","sources":["context/context.generator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAEvE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AA0B9F,MAAM,wBAAwB,GAAG,uXAAuX,CAAC;AAEzZ,MAAM,yBAAyB,GAAG,qcAAqc,CAAC;AAExe;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAG/B,YAAoB,kBAAsC;QAAtC,uBAAkB,GAAlB,kBAAkB,CAAoB;QAFlD,UAAK,GAAG,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAES,CAAC;IAE9D;;;;;OAKG;IACH,KAAK,CAAC,iBAAiB,CAAC,KAAuB;QAC7C,MAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,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W,CAAC,OAAgB;QAClC,OAAO,OAAO,OAAO,KAAK,QAAQ;YAChC,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACnC,CAAC;IAED,yDAAyD;IACjD,oBAAoB,CAAC,MAAqB,EAAE,KAAa;QAC/D,OAAO,MAAM;YACX,CAAC,CAAC,YAAY,KAAK,MAAM,MAAM,EAAE;YACjC,CAAC,CAAC,YAAY,KAAK,EAAE,CAAC;IAC1B,CAAC;IAED,8DAA8D;IACtD,cAAc,CAAC,KAA8B;QACnD,QAAQ,KAAK,CAAC,UAAU,EAAE,CAAC;YACzB,KAAK,OAAO;gBACV,OAAO,+CAA+C,KAAK,CAAC,WAAW,GAAG,CAAC;YAC7E,KAAK,SAAS;gBACZ,OAAO,8BAA8B,KAAK,CAAC,mBAAmB,YAAY,KAAK,CAAC,WAAW,GAAG,CAAC;YACjG,KAAK,WAAW;gBACd,OAAO,4CAA4C,KAAK,CAAC,WAAW,GAAG,CAAC;YAC1E,KAAK,SAAS;gBACZ,OAAO,yDAAyD,KAAK,CAAC,WAAW,GAAG,CAAC;QACzF,CAAC;IACH,CAAC;IAED,iEAAiE;IACzD,KAAK,CAAC,KAAK,CAAC,IAAY;QAC9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC,CAAC;QAC/F,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAa,CAAC,CAAC,CAAC,MAAkB,CAAC;IAC/E,CAAC;CACF","sourcesContent":["/**\n * User Context Generator\n *\n * Synthesizes network-scoped context paragraphs from user premises.\n * Two modes: cold-start (all premises at once) and incremental\n * (single premise change applied to an existing context).\n * Returns { text, embedding } for storage in the user_contexts table.\n */\n\nimport { HumanMessage, SystemMessage } from \"@langchain/core/messages\";\n\nimport { createModel } from \"../shared/agent/model.config.js\";\nimport { getAbortSignalConfig, invokeWithAbortSignal } from \"../shared/agent/model-signal.js\";\nimport type { EmbeddingGenerator } from \"../shared/interfaces/embedder.interface.js\";\n\n/** Input for cold-start context generation from a full set of premises. */\nexport interface UserContextInput {\n premises: Array<{ text: string }>;\n networkPrompt: string | null;\n networkTitle: string;\n}\n\n/** Input for incremental context update from a single premise change. */\nexport interface IncrementalContextInput {\n currentContext: string;\n changeType: 'added' | 'updated' | 'retracted' | 'expired';\n premiseText: string;\n previousPremiseText?: string;\n networkPrompt: string | null;\n networkTitle: string;\n}\n\n/** Generated context paragraph with its embedding vector. */\nexport interface UserContextResult {\n text: string;\n embedding: number[];\n}\n\nconst COLD_START_SYSTEM_PROMPT = `You synthesize user context paragraphs for community matching. Given a list of premises (atomic facts about a person) and a network description, write a focused paragraph (3-6 sentences) that captures who this person is through the lens of that network's purpose. Highlight what is most relevant to the network. Write in third person. Be specific and concrete, not generic.`;\n\nconst INCREMENTAL_SYSTEM_PROMPT = `You maintain user context paragraphs for community matching. You will receive the current context paragraph, a change that occurred, and the network description. Update the context paragraph to reflect the change while preserving all other information. Keep the same style: 3-6 sentences, third person, specific and concrete. For retractions/expirations, remove the relevant information. For additions/updates, integrate the new information naturally.`;\n\n/**\n * Generates network-scoped context paragraphs from user premises.\n * Uses LLM synthesis to produce focused context and an embedding vector.\n */\nexport class UserContextGenerator {\n private model = createModel('userContextGenerator');\n\n constructor(private embeddingGenerator: EmbeddingGenerator) {}\n\n /**\n * Generate a context paragraph from the full set of premises (cold-start).\n *\n * @param input - Premises, network prompt, and network title\n * @returns Synthesized context text with embedding vector\n */\n async generateColdStart(input: UserContextInput): Promise<UserContextResult> {\n const premiseBlock = input.premises.map(p => `- ${p.text}`).join('\\n');\n const networkContext = this.formatNetworkContext(input.networkPrompt, input.networkTitle);\n\n const response = await invokeWithAbortSignal(this.model, [\n new SystemMessage(COLD_START_SYSTEM_PROMPT),\n new HumanMessage(\n `${networkContext}\\n\\nPremises:\\n${premiseBlock}\\n\\nWrite a focused context paragraph for this person in this network.`,\n ),\n ]);\n\n const text = this.extractText(response.content);\n\n const embedding = await this.embed(text);\n return { text, embedding };\n }\n\n /**\n * Update an existing context paragraph after a single premise change.\n *\n * @param input - Current context, change details, network metadata\n * @returns Updated context text with embedding vector\n */\n async generateIncremental(input: IncrementalContextInput): Promise<UserContextResult> {\n const networkContext = this.formatNetworkContext(input.networkPrompt, input.networkTitle);\n const changeDescription = this.describeChange(input);\n\n const response = await invokeWithAbortSignal(this.model, [\n new SystemMessage(INCREMENTAL_SYSTEM_PROMPT),\n new HumanMessage(\n `${networkContext}\\n\\nCurrent context:\\n${input.currentContext}\\n\\nChange:\\n${changeDescription}\\n\\nWrite the updated context paragraph.`,\n ),\n ]);\n\n const text = this.extractText(response.content);\n\n const embedding = await this.embed(text);\n return { text, embedding };\n }\n\n /** Normalize an LLM message content into a plain string. */\n private extractText(content: unknown): string {\n return typeof content === 'string'\n ? content\n : String(content ?? '').trim();\n }\n\n /** Format the network context header for LLM prompts. */\n private formatNetworkContext(prompt: string | null, title: string): string {\n return prompt\n ? `Network \"${title}\": ${prompt}`\n : `Network: ${title}`;\n }\n\n /** Describe the premise change for the incremental prompt. */\n private describeChange(input: IncrementalContextInput): string {\n switch (input.changeType) {\n case 'added':\n return `A new fact was learned about this person:\\n\"${input.premiseText}\"`;\n case 'updated':\n return `A fact was updated.\\nOld: \"${input.previousPremiseText}\"\\nNew: \"${input.premiseText}\"`;\n case 'retracted':\n return `A fact was retracted (no longer true):\\n\"${input.premiseText}\"`;\n case 'expired':\n return `A fact has expired (time-bound, no longer current):\\n\"${input.premiseText}\"`;\n }\n }\n\n /** Generate embedding from text, normalizing the return type. */\n private async embed(text: string): Promise<number[]> {\n const result = await this.embeddingGenerator.generate(text, undefined, getAbortSignalConfig());\n return Array.isArray(result[0]) ? result[0] as number[] : result as number[];\n }\n}\n"]}
1
+ {"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AK,CAAC,mBAAmB,YAAY,KAAK,CAAC,WAAW,GAAG,CAAC;YACjG,KAAK,WAAW;gBACd,OAAO,4CAA4C,KAAK,CAAC,WAAW,GAAG,CAAC;YAC1E,KAAK,SAAS;gBACZ,OAAO,yDAAyD,KAAK,CAAC,WAAW,GAAG,CAAC;QACzF,CAAC;IACH,CAAC;IAED,iEAAiE;IACzD,KAAK,CAAC,KAAK,CAAC,IAAY;QAC9B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,EAAE,oBAAoB,EAAE,CAAC,CAAC;QAC/F,OAAO,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAa,CAAC,CAAC,CAAC,MAAkB,CAAC;IAC/E,CAAC;CACF","sourcesContent":["/**\n * User Context Generator\n *\n * Synthesizes context paragraphs from user premises for storage in the\n * user_contexts table. Two scopes:\n * - network-scoped: who the person is through the lens of a given network\n * - global (networkId = null): a cohesive, network-agnostic identity paragraph\n * that replaces the legacy synthesized user_profile projection.\n * Each scope supports cold-start (all premises at once) and incremental\n * (single premise change applied to an existing context).\n * Returns { text, embedding } for storage.\n */\n\nimport { HumanMessage, SystemMessage } from \"@langchain/core/messages\";\n\nimport { createModel } from \"../shared/agent/model.config.js\";\nimport { getAbortSignalConfig, invokeWithAbortSignal } from \"../shared/agent/model-signal.js\";\nimport type { EmbeddingGenerator } from \"../shared/interfaces/embedder.interface.js\";\n\n/** Input for cold-start context generation from a full set of premises. */\nexport interface UserContextInput {\n premises: Array<{ text: string }>;\n networkPrompt: string | null;\n networkTitle: string;\n}\n\n/** Input for incremental context update from a single premise change. */\nexport interface IncrementalContextInput {\n currentContext: string;\n changeType: 'added' | 'updated' | 'retracted' | 'expired';\n premiseText: string;\n previousPremiseText?: string;\n networkPrompt: string | null;\n networkTitle: string;\n}\n\n/** Input for cold-start global (network-agnostic) context generation. */\nexport interface GlobalContextInput {\n premises: Array<{ text: string }>;\n}\n\n/** Input for incremental global context update from a single premise change. */\nexport interface GlobalIncrementalContextInput {\n currentContext: string;\n changeType: 'added' | 'updated' | 'retracted' | 'expired';\n premiseText: string;\n previousPremiseText?: string;\n}\n\n/** Generated context paragraph with its embedding vector. */\nexport interface UserContextResult {\n text: string;\n embedding: number[];\n}\n\nconst COLD_START_SYSTEM_PROMPT = `You synthesize user context paragraphs for community matching. Given a list of premises (atomic facts about a person) and a network description, write a focused paragraph (3-6 sentences) that captures who this person is through the lens of that network's purpose. Highlight what is most relevant to the network. Write in third person. Be specific and concrete, not generic.`;\n\nconst INCREMENTAL_SYSTEM_PROMPT = `You maintain user context paragraphs for community matching. You will receive the current context paragraph, a change that occurred, and the network description. Update the context paragraph to reflect the change while preserving all other information. Keep the same style: 3-6 sentences, third person, specific and concrete. For retractions/expirations, remove the relevant information. For additions/updates, integrate the new information naturally.`;\n\nconst GLOBAL_COLD_START_SYSTEM_PROMPT = `You synthesize a person's global identity profile from premises (atomic facts about them). Write a cohesive paragraph (4-8 sentences) capturing who this person is overall — their identity, work, expertise, and interests — independent of any single community or network. This is their canonical self-description, not lensed toward any particular purpose. Write in third person. Be specific and concrete, not generic. Do not invent facts beyond the premises.`;\n\nconst GLOBAL_INCREMENTAL_SYSTEM_PROMPT = `You maintain a person's global identity profile. You will receive the current profile paragraph and a change that occurred. Update the paragraph to reflect the change while preserving all other information. Keep the same style: 4-8 sentences, third person, specific and concrete, network-agnostic. For retractions/expirations, remove the relevant information. For additions/updates, integrate the new information naturally.`;\n\n/**\n * Generates network-scoped context paragraphs from user premises.\n * Uses LLM synthesis to produce focused context and an embedding vector.\n */\nexport class UserContextGenerator {\n private model = createModel('userContextGenerator');\n\n constructor(private embeddingGenerator: EmbeddingGenerator) {}\n\n /**\n * Generate a context paragraph from the full set of premises (cold-start).\n *\n * @param input - Premises, network prompt, and network title\n * @returns Synthesized context text with embedding vector\n */\n async generateColdStart(input: UserContextInput): Promise<UserContextResult> {\n const premiseBlock = input.premises.map(p => `- ${p.text}`).join('\\n');\n const networkContext = this.formatNetworkContext(input.networkPrompt, input.networkTitle);\n\n const response = await invokeWithAbortSignal(this.model, [\n new SystemMessage(COLD_START_SYSTEM_PROMPT),\n new HumanMessage(\n `${networkContext}\\n\\nPremises:\\n${premiseBlock}\\n\\nWrite a focused context paragraph for this person in this network.`,\n ),\n ]);\n\n const text = this.extractText(response.content);\n\n const embedding = await this.embed(text);\n return { text, embedding };\n }\n\n /**\n * Update an existing context paragraph after a single premise change.\n *\n * @param input - Current context, change details, network metadata\n * @returns Updated context text with embedding vector\n */\n async generateIncremental(input: IncrementalContextInput): Promise<UserContextResult> {\n const networkContext = this.formatNetworkContext(input.networkPrompt, input.networkTitle);\n const changeDescription = this.describeChange(input);\n\n const response = await invokeWithAbortSignal(this.model, [\n new SystemMessage(INCREMENTAL_SYSTEM_PROMPT),\n new HumanMessage(\n `${networkContext}\\n\\nCurrent context:\\n${input.currentContext}\\n\\nChange:\\n${changeDescription}\\n\\nWrite the updated context paragraph.`,\n ),\n ]);\n\n const text = this.extractText(response.content);\n\n const embedding = await this.embed(text);\n return { text, embedding };\n }\n\n /**\n * Generate a global (network-agnostic) identity paragraph from the full set\n * of premises (cold-start). This is the profile-replacing projection stored\n * as the user's global user_context row (networkId = null).\n *\n * @param input - The user's active premises\n * @returns Synthesized global identity text with embedding vector\n */\n async generateGlobalColdStart(input: GlobalContextInput): Promise<UserContextResult> {\n const premiseBlock = input.premises.map(p => `- ${p.text}`).join('\\n');\n\n const response = await invokeWithAbortSignal(this.model, [\n new SystemMessage(GLOBAL_COLD_START_SYSTEM_PROMPT),\n new HumanMessage(\n `Premises:\\n${premiseBlock}\\n\\nWrite a cohesive global identity paragraph for this person.`,\n ),\n ]);\n\n const text = this.extractText(response.content);\n\n const embedding = await this.embed(text);\n return { text, embedding };\n }\n\n /**\n * Update the global identity paragraph after a single premise change.\n *\n * @param input - Current global context and change details\n * @returns Updated global identity text with embedding vector\n */\n async generateGlobalIncremental(input: GlobalIncrementalContextInput): Promise<UserContextResult> {\n const changeDescription = this.describeChange(input);\n\n const response = await invokeWithAbortSignal(this.model, [\n new SystemMessage(GLOBAL_INCREMENTAL_SYSTEM_PROMPT),\n new HumanMessage(\n `Current profile:\\n${input.currentContext}\\n\\nChange:\\n${changeDescription}\\n\\nWrite the updated global identity paragraph.`,\n ),\n ]);\n\n const text = this.extractText(response.content);\n\n const embedding = await this.embed(text);\n return { text, embedding };\n }\n\n /** Normalize an LLM message content into a plain string. */\n private extractText(content: unknown): string {\n return typeof content === 'string'\n ? content\n : String(content ?? '').trim();\n }\n\n /** Format the network context header for LLM prompts. */\n private formatNetworkContext(prompt: string | null, title: string): string {\n return prompt\n ? `Network \"${title}\": ${prompt}`\n : `Network: ${title}`;\n }\n\n /** Describe the premise change for the incremental prompt. */\n private describeChange(input: IncrementalContextInput | GlobalIncrementalContextInput): string {\n switch (input.changeType) {\n case 'added':\n return `A new fact was learned about this person:\\n\"${input.premiseText}\"`;\n case 'updated':\n return `A fact was updated.\\nOld: \"${input.previousPremiseText}\"\\nNew: \"${input.premiseText}\"`;\n case 'retracted':\n return `A fact was retracted (no longer true):\\n\"${input.premiseText}\"`;\n case 'expired':\n return `A fact has expired (time-bound, no longer current):\\n\"${input.premiseText}\"`;\n }\n }\n\n /** Generate embedding from text, normalizing the return type. */\n private async embed(text: string): Promise<number[]> {\n const result = await this.embeddingGenerator.generate(text, undefined, getAbortSignalConfig());\n return Array.isArray(result[0]) ? result[0] as number[] : result as number[];\n }\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -60,7 +60,7 @@ export { OpportunityGraphFactory } from "./opportunity/opportunity.graph.js";
60
60
  export { ProfileGraphFactory } from "./profile/profile.graph.js";
61
61
  export { PremiseGraphFactory } from "./premise/premise.graph.js";
62
62
  export { UserContextGenerator } from "./context/context.generator.js";
63
- export type { UserContextInput, IncrementalContextInput, UserContextResult } from "./context/context.generator.js";
63
+ export type { UserContextInput, IncrementalContextInput, UserContextResult, GlobalContextInput, GlobalIncrementalContextInput } from "./context/context.generator.js";
64
64
  export { ChatTitleGenerator } from "./chat/chat.title.generator.js";
65
65
  export { ChatInterruptClassifier } from "./chat/chat.interrupt.classifier.js";
66
66
  export type { ClassifyInterruptInput } from "./chat/chat.interrupt.classifier.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,YAAY,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAChE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACjF,YAAY,EAAE,WAAW,EAAE,mBAAmB,EAAE,QAAQ,EAAE,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACjJ,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAC5F,OAAO,EAAE,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AACrI,YAAY,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAIhH,mBAAmB,uCAAuC,CAAC;AAC3D,mBAAmB,wCAAwC,CAAC;AAC5D,mBAAmB,+CAA+C,CAAC;AACnE,YAAY,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AACvF,YAAY,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AAC9F,YAAY,EAAE,uBAAuB,EAAE,MAAM,qDAAqD,CAAC;AACnG,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cesContent":["// ─── Public API (recommended for external consumers) ──────────────────────────\n\nexport { createChatTools } from \"./shared/agent/tool.factory.js\";\nexport { getModelName } from \"./shared/agent/model.config.js\";\nexport type { ChatTools } from \"./shared/agent/tool.factory.js\";\nexport type { ModelConfig, ModelSettings } from \"./shared/agent/model.config.js\";\nexport type { ToolContext, ResolvedToolContext, ToolDeps, ProtocolDeps, RawToolDefinition, CompiledGraph } from \"./shared/agent/tool.helpers.js\";\nexport { ChatContextAccessError, resolveChatContext } from \"./shared/agent/tool.helpers.js\";\nexport { requestContext } from \"./shared/observability/request-context.js\";\nexport { setTimingWrapper } from \"./shared/observability/performance.js\";\nexport { ToolRuntimeError, getToolTimeoutPolicy, invokeToolRuntime, toolRuntimeErrorToResult } from \"./shared/agent/tool.runtime.js\";\nexport type { ToolRuntimeErrorCode, ToolTimeoutClass, ToolTimeoutPolicy } from \"./shared/agent/tool.runtime.js\";\n\n// ─── Interfaces (implement these to wire up your infrastructure) ───────────────\n\nexport type * from \"./shared/interfaces/auth.interface.js\";\nexport type * from \"./shared/interfaces/cache.interface.js\";\nexport type * from \"./shared/interfaces/chat-session.interface.js\";\nexport type { ChatSummaryReader } from \"./shared/interfaces/chat-summary.interface.js\";\nexport type { ChatMessageWriter } from \"./shared/interfaces/chat-message-writer.interface.js\";\nexport type { QuestionGeneratorReader } from \"./shared/interfaces/question-generator.interface.js\";\nexport type { QuestionerDatabase, PersistableQuestion, PersistedQuestion, QuestionFilters } from \"./shared/interfaces/questioner.interface.js\";\nexport type { NegotiationSummaryReader } from \"./shared/interfaces/negotiation-summary.interface.js\";\nexport type { DiscoveryNegotiationDigest } from \"./shared/schemas/negotiation-digest.schema.js\";\nexport { NegotiationSummarizer, buildFallbackDigest } from \"./negotiation/negotiation.summarizer.js\";\nexport type * from \"./shared/interfaces/contact.interface.js\";\nexport type * from \"./shared/interfaces/database.interface.js\";\nexport type * from \"./shared/interfaces/embedder.interface.js\";\nexport type * from \"./shared/interfaces/enrichment.interface.js\";\nexport type * from \"./shared/interfaces/integration.interface.js\";\nexport type * from \"./shared/interfaces/queue.interface.js\";\nexport type * from \"./shared/interfaces/scraper.interface.js\";\nexport type * from \"./shared/interfaces/storage.interface.js\";\nexport type * from \"./shared/interfaces/delivery-ledger.interface.js\";\nexport type * from \"./shared/interfaces/connect-link.interface.js\";\nexport type * from \"./shared/interfaces/discovery-run.interface.js\";\nexport type * from \"./shared/interfaces/profile-run.interface.js\";\nexport type * from \"./shared/interfaces/negotiation-events.interface.js\";\nexport type { AgentDispatcher, AgentDispatchResult, NegotiationTurnPayload } from \"./shared/interfaces/agent-dispatcher.interface.js\";\nexport type { AgentRecord, AgentTransportRecord, AgentPermissionRecord, AgentWithRelations, CreateAgentInput, CreateTransportInput, GrantPermissionInput, AgentDatabase } from './shared/interfaces/agent.interface.js';\nexport { SYSTEM_AGENT_IDS } from './shared/interfaces/agent.interface.js';\n\n// ─── Shared schemas ───────────────────────────────────────────────────────────\n\nexport { ChatContextDigestSchema, type ChatContextDigest } from \"./shared/schemas/chat-context.schema.js\";\nexport { QuestionOptionSchema, QuestionSchema, QuestionStrategySchema, QuestionWithStrategySchema, QuestionGeneratorResponseSchema, QuestionModeSchema, QuestionDetectionSchema, QuestionActorSchema, QuestionAnswerSchema, type Question, type QuestionOption, type QuestionStrategy, type QuestionWithStrategy, type QuestionGeneratorResponse, type QuestionGenerationResult, type QuestionMode, type QuestionDetection, type QuestionActor, type QuestionAnswer } from \"./shared/schemas/question.schema.js\";\nexport type { PendingQuestionSummary } from \"./shared/schemas/pending-question.schema.js\";\nexport type { McpAuthInput } from \"./shared/schemas/mcp-auth.schema.js\";\nexport { ProfileIdentitySchema, ProfileNarrativeSchema, ProfileAttributesSchema, ProfileDocumentSchema, type ProfileDocument } from \"./shared/schemas/profile.schema.js\";\nexport type { DiscoverySourceProfile, DiscoverySummary, DiscoveryNegotiation, DiscoveryTurn, DiscoveryOutcome, DiscoveryQuestionInput, NegotiationRole } from \"./shared/schemas/discovery-question.schema.js\";\nexport { NetworkAssignmentResourceTypeSchema, NetworkAssignmentModeSchema, NetworkAssignmentScopeSchema, NetworkAssignmentPromptPresenceSchema, NetworkAssignmentPolicySchema, NetworkAssignmentRawScoresSchema, NetworkAssignmentMetadataSchema, OpportunityEvidenceKindSchema, OpportunityEvidenceSchema } from \"./shared/schemas/network-assignment.schema.js\";\nexport type { NetworkAssignmentResourceType, NetworkAssignmentMode, NetworkAssignmentScope, NetworkAssignmentPromptPresence, NetworkAssignmentPolicy, NetworkAssignmentRawScores, NetworkAssignmentMetadata, OpportunityEvidenceKind, OpportunityEvidence } from \"./shared/schemas/network-assignment.schema.js\";\nexport { DEFAULT_NETWORK_ASSIGNMENT_THRESHOLD, classifyPromptPresence, resolveAssignmentNetworkScope, buildNetworkAssignmentDecision, combineAssignmentScores } from \"./shared/assignment/network-assignment.policy.js\";\nexport type { PromptPresenceInput, ResolveAssignmentNetworkScopeArgs, BuildNetworkAssignmentDecisionArgs, NetworkAssignmentDecision } from \"./shared/assignment/network-assignment.policy.js\";\nexport { buildCandidateEvidence, withCandidateEvidence, mergeOpportunityEvidence, withMatchedStrategies, renderOpportunityEvidenceForPrompt } from \"./opportunity/opportunity.evidence.js\";\nexport type { EvidenceCandidateInput } from \"./opportunity/opportunity.evidence.js\";\n\n// ─── Graph factories ──────────────────────────────────────────────────────────\n\nexport { ChatGraphFactory } from \"./chat/chat.graph.js\";\nexport { HomeGraphFactory } from \"./opportunity/feed/feed.graph.js\";\nexport { HydeGraphFactory } from \"./shared/hyde/hyde.graph.js\";\nexport { NetworkGraphFactory } from \"./network/network.graph.js\";\nexport { NetworkMembershipGraphFactory } from \"./network/membership/membership.graph.js\";\nexport { IntentGraphFactory } from \"./intent/intent.graph.js\";\nexport { IntentNetworkGraphFactory } from \"./network/indexer/indexer.graph.js\";\nexport { MaintenanceGraphFactory } from \"./maintenance/maintenance.graph.js\";\nexport type { MaintenanceGraphDatabase, MaintenanceGraphCache, MaintenanceGraphQueue } from \"./maintenance/maintenance.graph.js\";\nexport { NegotiationGraphFactory, createDefaultNegotiationGraph, negotiateCandidates } from \"./negotiation/negotiation.graph.js\";\nexport { OpportunityGraphFactory } from \"./opportunity/opportunity.graph.js\";\nexport { ProfileGraphFactory } from \"./profile/profile.graph.js\";\nexport { PremiseGraphFactory } from \"./premise/premise.graph.js\";\n\n// ─── Agents ───────────────────────────────────────────────────────────────────\n\nexport { UserContextGenerator } from \"./context/context.generator.js\";\nexport type { UserContextInput, IncrementalContextInput, UserContextResult } from \"./context/context.generator.js\";\nexport { ChatTitleGenerator } from \"./chat/chat.title.generator.js\";\nexport { ChatInterruptClassifier } from \"./chat/chat.interrupt.classifier.js\";\nexport type { ClassifyInterruptInput } from \"./chat/chat.interrupt.classifier.js\";\nexport { ChatSummarizer } from \"./chat/chat.summarizer.js\";\nexport type { ChatSummarizerInput, ChatSummarizerMessage } from \"./chat/chat.summarizer.js\";\nexport { HydeGenerator } from \"./shared/hyde/hyde.generator.js\";\nexport { SuggestionGenerator } from \"./chat/chat.suggester.js\";\nexport type { SuggestionGeneratorInput } from \"./chat/chat.suggester.js\";\nexport { generateInviteMessage } from \"./contact/contact.inviter.js\";\nexport type { InviteInput, InviteOutput } from \"./contact/contact.inviter.js\";\nexport { IntentIndexer } from \"./intent/intent.indexer.js\";\nexport type { IntentIndexerOutput } from \"./intent/intent.indexer.js\";\nexport { PremiseAnalyzer } from \"./premise/premise.analyzer.js\";\nexport type { PremiseAnalyzerOutput } from \"./premise/premise.analyzer.js\";\nexport { PremiseDecomposer } from \"./premise/premise.decomposer.js\";\nexport type { PremiseDecomposerOutput, DecomposedPremise } from \"./premise/premise.decomposer.js\";\nexport { PremiseIndexer } from \"./premise/premise.indexer.js\";\nexport type { PremiseIndexerOutput } from \"./premise/premise.indexer.js\";\nexport { LensInferrer } from \"./shared/hyde/lens.inferrer.js\";\nexport { NegotiationInsightsGenerator } from \"./negotiation/insight.generator.js\";\nexport type { NegotiationDigest } from \"./negotiation/insight.generator.js\";\nexport { IndexNegotiator } from \"./negotiation/negotiation.agent.js\";\nexport type { NegotiationAgentInput } from \"./negotiation/negotiation.agent.js\";\nexport { QuestionerAgent } from \"./questioner/questioner.agent.js\";\nexport type { QuestionerAgentConfig } from \"./questioner/questioner.agent.js\";\nexport type { QuestionerInput, QuestionerContext, QuestionerEnqueuePayload, QuestionerEnqueueFn, DiscoveryContext, IntentContext, ProfileContext, NegotiationContext } from \"./questioner/questioner.types.js\";\nexport { getPreset } from \"./questioner/questioner.presets.js\";\nexport type { QuestionerPreset } from \"./questioner/questioner.presets.js\";\nexport { OpportunityEvaluator } from \"./opportunity/opportunity.evaluator.js\";\nexport type { EvaluatorInput, OpportunityEvaluatorOptionsConstructor } from \"./opportunity/opportunity.evaluator.js\";\nexport { OpportunityPresenter, gatherPresenterContext } from \"./opportunity/opportunity.presenter.js\";\nexport { createOpportunityTools } from \"./opportunity/opportunity.tools.js\";\nexport { createProfileTools } from \"./profile/profile.tools.js\";\nexport type { PresenterDatabase } from \"./opportunity/opportunity.presenter.js\";\nexport { QuestionGenerator } from \"./opportunity/question.generator.js\";\n\n// ─── Support utilities ────────────────────────────────────────────────────────\n\nexport { renderNetworkContext } from './shared/network/metadata.renderer.js';\nexport { canUserSeeOpportunity, isActionableForViewer, validateOpportunityActors, classifyOpportunity, selectByComposition, selectDigestCandidates, DIGEST_REDELIVERY_COOLDOWN_DAYS, FEED_SOFT_TARGETS } from \"./opportunity/opportunity.utils.js\";\nexport type { DigestDeliveredRow } from \"./opportunity/opportunity.utils.js\";\nexport { getPrimaryActionLabel } from \"./opportunity/opportunity.labels.js\";\nexport { computeFeedHealth } from \"./opportunity/feed/feed.health.js\";\nexport type { FeedHealthInput, FeedHealthResult } from \"./opportunity/feed/feed.health.js\";\nexport { selectContactsForDiscovery, shouldRunIntroducerDiscovery, runIntroducerDiscovery, MAX_CONTACTS_PER_CYCLE, MAX_CANDIDATES_PER_CONTACT, INTRODUCER_DISCOVERY_SOURCE } from \"./opportunity/opportunity.introducer.js\";\nexport type { IntroducerDiscoveryDatabase, IntroducerDiscoveryQueue, ContactWithIntents } from \"./opportunity/opportunity.introducer.js\";\nexport { persistOpportunities } from \"./opportunity/opportunity.persist.js\";\nexport { presentOpportunity } from \"./opportunity/opportunity.presentation.js\";\nexport type { UserInfo } from \"./opportunity/opportunity.presentation.js\";\nexport { stripUuids, stripIntroducerMentions } from \"./opportunity/opportunity.presentation.js\";\nexport { getOrCreateDeliveryCardBatch, DELIVERY_CARD_CACHE_TTL, type CachedDeliveryCard, type OpportunityWithContext } from \"./opportunity/delivery-card.cache.js\";\n\n// ─── Tools ────────────────────────────────────────────────────────────────────\n\nexport { createToolRegistry } from \"./shared/agent/tool.registry.js\";\nexport { createAgentTools } from './agent/agent.tools.js';\nexport { AMBIENT_PARK_WINDOW_MS } from './negotiation/negotiation.tools.js';\nexport { normalizeTelegramHandle } from './shared/utils/telegram-handle.js';\n\n// ─── MCP ──────────────────────────────────────────────────────────────────────\n\nexport { createMcpServer, computeAgentIndexScope, buildMcpOnboardingMessage, ONBOARDING_ALLOWED } from \"./mcp/mcp.server.js\";\nexport type { ScopedDepsFactory } from \"./mcp/mcp.server.js\";\nexport { buildElicitationCreate, flattenChoice } from \"./mcp/elicitation.builder.js\";\nexport { dispatchElicitations } from \"./mcp/elicitation.dispatcher.js\";\nexport type { ElicitResultLike, ElicitInputFn, DispatchElicitationsParams } from \"./mcp/elicitation.dispatcher.js\";\n\n// ─── States (for advanced graph consumers) ────────────────────────────────────\n\nexport type { UserNegotiationContext, NegotiationTurn, NegotiationOutcome, SeedAssessment } from \"./shared/schemas/negotiation-state.schema.js\";\nexport type { NegotiationGraphLike } from \"./negotiation/negotiation.state.js\";\n\n// ─── Streamers ────────────────────────────────────────────────────────────────\n\nexport { ChatStreamer } from \"./chat/chat.streamer.js\";\nexport { ResponseStreamer } from \"./shared/agent/response.streamer.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":"AAAA,iFAA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AO,EAAE,4BAA4B,EAAE,uBAAuB,EAAwD,MAAM,sCAAsC,CAAC;AAEnK,iFAAiF;AAEjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,iFAAiF;AAEjF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAE7H,OAAO,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAQvE,iFAAiF;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC","sourcesContent":["// ─── Public API (recommended for external consumers) ──────────────────────────\n\nexport { createChatTools } from \"./shared/agent/tool.factory.js\";\nexport { getModelName } from \"./shared/agent/model.config.js\";\nexport type { ChatTools } from \"./shared/agent/tool.factory.js\";\nexport type { ModelConfig, ModelSettings } from \"./shared/agent/model.config.js\";\nexport type { ToolContext, ResolvedToolContext, ToolDeps, ProtocolDeps, RawToolDefinition, CompiledGraph } from \"./shared/agent/tool.helpers.js\";\nexport { ChatContextAccessError, resolveChatContext } from \"./shared/agent/tool.helpers.js\";\nexport { requestContext } from \"./shared/observability/request-context.js\";\nexport { setTimingWrapper } from \"./shared/observability/performance.js\";\nexport { ToolRuntimeError, getToolTimeoutPolicy, invokeToolRuntime, toolRuntimeErrorToResult } from \"./shared/agent/tool.runtime.js\";\nexport type { ToolRuntimeErrorCode, ToolTimeoutClass, ToolTimeoutPolicy } from \"./shared/agent/tool.runtime.js\";\n\n// ─── Interfaces (implement these to wire up your infrastructure) ───────────────\n\nexport type * from \"./shared/interfaces/auth.interface.js\";\nexport type * from \"./shared/interfaces/cache.interface.js\";\nexport type * from \"./shared/interfaces/chat-session.interface.js\";\nexport type { ChatSummaryReader } from \"./shared/interfaces/chat-summary.interface.js\";\nexport type { ChatMessageWriter } from \"./shared/interfaces/chat-message-writer.interface.js\";\nexport type { QuestionGeneratorReader } from \"./shared/interfaces/question-generator.interface.js\";\nexport type { QuestionerDatabase, PersistableQuestion, PersistedQuestion, QuestionFilters } from \"./shared/interfaces/questioner.interface.js\";\nexport type { NegotiationSummaryReader } from \"./shared/interfaces/negotiation-summary.interface.js\";\nexport type { DiscoveryNegotiationDigest } from \"./shared/schemas/negotiation-digest.schema.js\";\nexport { NegotiationSummarizer, buildFallbackDigest } from \"./negotiation/negotiation.summarizer.js\";\nexport type * from \"./shared/interfaces/contact.interface.js\";\nexport type * from \"./shared/interfaces/database.interface.js\";\nexport type * from \"./shared/interfaces/embedder.interface.js\";\nexport type * from \"./shared/interfaces/enrichment.interface.js\";\nexport type * from \"./shared/interfaces/integration.interface.js\";\nexport type * from \"./shared/interfaces/queue.interface.js\";\nexport type * from \"./shared/interfaces/scraper.interface.js\";\nexport type * from \"./shared/interfaces/storage.interface.js\";\nexport type * from \"./shared/interfaces/delivery-ledger.interface.js\";\nexport type * from \"./shared/interfaces/connect-link.interface.js\";\nexport type * from \"./shared/interfaces/discovery-run.interface.js\";\nexport type * from \"./shared/interfaces/profile-run.interface.js\";\nexport type * from \"./shared/interfaces/negotiation-events.interface.js\";\nexport type { AgentDispatcher, AgentDispatchResult, NegotiationTurnPayload } from \"./shared/interfaces/agent-dispatcher.interface.js\";\nexport type { AgentRecord, AgentTransportRecord, AgentPermissionRecord, AgentWithRelations, CreateAgentInput, CreateTransportInput, GrantPermissionInput, AgentDatabase } from './shared/interfaces/agent.interface.js';\nexport { SYSTEM_AGENT_IDS } from './shared/interfaces/agent.interface.js';\n\n// ─── Shared schemas ───────────────────────────────────────────────────────────\n\nexport { ChatContextDigestSchema, type ChatContextDigest } from \"./shared/schemas/chat-context.schema.js\";\nexport { QuestionOptionSchema, QuestionSchema, QuestionStrategySchema, QuestionWithStrategySchema, QuestionGeneratorResponseSchema, QuestionModeSchema, QuestionDetectionSchema, QuestionActorSchema, QuestionAnswerSchema, type Question, type QuestionOption, type QuestionStrategy, type QuestionWithStrategy, type QuestionGeneratorResponse, type QuestionGenerationResult, type QuestionMode, type QuestionDetection, type QuestionActor, type QuestionAnswer } from \"./shared/schemas/question.schema.js\";\nexport type { PendingQuestionSummary } from \"./shared/schemas/pending-question.schema.js\";\nexport type { McpAuthInput } from \"./shared/schemas/mcp-auth.schema.js\";\nexport { ProfileIdentitySchema, ProfileNarrativeSchema, ProfileAttributesSchema, ProfileDocumentSchema, type ProfileDocument } from \"./shared/schemas/profile.schema.js\";\nexport type { DiscoverySourceProfile, DiscoverySummary, DiscoveryNegotiation, DiscoveryTurn, DiscoveryOutcome, DiscoveryQuestionInput, NegotiationRole } from \"./shared/schemas/discovery-question.schema.js\";\nexport { NetworkAssignmentResourceTypeSchema, NetworkAssignmentModeSchema, NetworkAssignmentScopeSchema, NetworkAssignmentPromptPresenceSchema, NetworkAssignmentPolicySchema, NetworkAssignmentRawScoresSchema, NetworkAssignmentMetadataSchema, OpportunityEvidenceKindSchema, OpportunityEvidenceSchema } from \"./shared/schemas/network-assignment.schema.js\";\nexport type { NetworkAssignmentResourceType, NetworkAssignmentMode, NetworkAssignmentScope, NetworkAssignmentPromptPresence, NetworkAssignmentPolicy, NetworkAssignmentRawScores, NetworkAssignmentMetadata, OpportunityEvidenceKind, OpportunityEvidence } from \"./shared/schemas/network-assignment.schema.js\";\nexport { DEFAULT_NETWORK_ASSIGNMENT_THRESHOLD, classifyPromptPresence, resolveAssignmentNetworkScope, buildNetworkAssignmentDecision, combineAssignmentScores } from \"./shared/assignment/network-assignment.policy.js\";\nexport type { PromptPresenceInput, ResolveAssignmentNetworkScopeArgs, BuildNetworkAssignmentDecisionArgs, NetworkAssignmentDecision } from \"./shared/assignment/network-assignment.policy.js\";\nexport { buildCandidateEvidence, withCandidateEvidence, mergeOpportunityEvidence, withMatchedStrategies, renderOpportunityEvidenceForPrompt } from \"./opportunity/opportunity.evidence.js\";\nexport type { EvidenceCandidateInput } from \"./opportunity/opportunity.evidence.js\";\n\n// ─── Graph factories ──────────────────────────────────────────────────────────\n\nexport { ChatGraphFactory } from \"./chat/chat.graph.js\";\nexport { HomeGraphFactory } from \"./opportunity/feed/feed.graph.js\";\nexport { HydeGraphFactory } from \"./shared/hyde/hyde.graph.js\";\nexport { NetworkGraphFactory } from \"./network/network.graph.js\";\nexport { NetworkMembershipGraphFactory } from \"./network/membership/membership.graph.js\";\nexport { IntentGraphFactory } from \"./intent/intent.graph.js\";\nexport { IntentNetworkGraphFactory } from \"./network/indexer/indexer.graph.js\";\nexport { MaintenanceGraphFactory } from \"./maintenance/maintenance.graph.js\";\nexport type { MaintenanceGraphDatabase, MaintenanceGraphCache, MaintenanceGraphQueue } from \"./maintenance/maintenance.graph.js\";\nexport { NegotiationGraphFactory, createDefaultNegotiationGraph, negotiateCandidates } from \"./negotiation/negotiation.graph.js\";\nexport { OpportunityGraphFactory } from \"./opportunity/opportunity.graph.js\";\nexport { ProfileGraphFactory } from \"./profile/profile.graph.js\";\nexport { PremiseGraphFactory } from \"./premise/premise.graph.js\";\n\n// ─── Agents ───────────────────────────────────────────────────────────────────\n\nexport { UserContextGenerator } from \"./context/context.generator.js\";\nexport type { UserContextInput, IncrementalContextInput, UserContextResult, GlobalContextInput, GlobalIncrementalContextInput } from \"./context/context.generator.js\";\nexport { ChatTitleGenerator } from \"./chat/chat.title.generator.js\";\nexport { ChatInterruptClassifier } from \"./chat/chat.interrupt.classifier.js\";\nexport type { ClassifyInterruptInput } from \"./chat/chat.interrupt.classifier.js\";\nexport { ChatSummarizer } from \"./chat/chat.summarizer.js\";\nexport type { ChatSummarizerInput, ChatSummarizerMessage } from \"./chat/chat.summarizer.js\";\nexport { HydeGenerator } from \"./shared/hyde/hyde.generator.js\";\nexport { SuggestionGenerator } from \"./chat/chat.suggester.js\";\nexport type { SuggestionGeneratorInput } from \"./chat/chat.suggester.js\";\nexport { generateInviteMessage } from \"./contact/contact.inviter.js\";\nexport type { InviteInput, InviteOutput } from \"./contact/contact.inviter.js\";\nexport { IntentIndexer } from \"./intent/intent.indexer.js\";\nexport type { IntentIndexerOutput } from \"./intent/intent.indexer.js\";\nexport { PremiseAnalyzer } from \"./premise/premise.analyzer.js\";\nexport type { PremiseAnalyzerOutput } from \"./premise/premise.analyzer.js\";\nexport { PremiseDecomposer } from \"./premise/premise.decomposer.js\";\nexport type { PremiseDecomposerOutput, DecomposedPremise } from \"./premise/premise.decomposer.js\";\nexport { PremiseIndexer } from \"./premise/premise.indexer.js\";\nexport type { PremiseIndexerOutput } from \"./premise/premise.indexer.js\";\nexport { LensInferrer } from \"./shared/hyde/lens.inferrer.js\";\nexport { NegotiationInsightsGenerator } from \"./negotiation/insight.generator.js\";\nexport type { NegotiationDigest } from \"./negotiation/insight.generator.js\";\nexport { IndexNegotiator } from \"./negotiation/negotiation.agent.js\";\nexport type { NegotiationAgentInput } from \"./negotiation/negotiation.agent.js\";\nexport { QuestionerAgent } from \"./questioner/questioner.agent.js\";\nexport type { QuestionerAgentConfig } from \"./questioner/questioner.agent.js\";\nexport type { QuestionerInput, QuestionerContext, QuestionerEnqueuePayload, QuestionerEnqueueFn, DiscoveryContext, IntentContext, ProfileContext, NegotiationContext } from \"./questioner/questioner.types.js\";\nexport { getPreset } from \"./questioner/questioner.presets.js\";\nexport type { QuestionerPreset } from \"./questioner/questioner.presets.js\";\nexport { OpportunityEvaluator } from \"./opportunity/opportunity.evaluator.js\";\nexport type { EvaluatorInput, OpportunityEvaluatorOptionsConstructor } from \"./opportunity/opportunity.evaluator.js\";\nexport { OpportunityPresenter, gatherPresenterContext } from \"./opportunity/opportunity.presenter.js\";\nexport { createOpportunityTools } from \"./opportunity/opportunity.tools.js\";\nexport { createProfileTools } from \"./profile/profile.tools.js\";\nexport type { PresenterDatabase } from \"./opportunity/opportunity.presenter.js\";\nexport { QuestionGenerator } from \"./opportunity/question.generator.js\";\n\n// ─── Support utilities ────────────────────────────────────────────────────────\n\nexport { renderNetworkContext } from './shared/network/metadata.renderer.js';\nexport { canUserSeeOpportunity, isActionableForViewer, validateOpportunityActors, classifyOpportunity, selectByComposition, selectDigestCandidates, DIGEST_REDELIVERY_COOLDOWN_DAYS, FEED_SOFT_TARGETS } from \"./opportunity/opportunity.utils.js\";\nexport type { DigestDeliveredRow } from \"./opportunity/opportunity.utils.js\";\nexport { getPrimaryActionLabel } from \"./opportunity/opportunity.labels.js\";\nexport { computeFeedHealth } from \"./opportunity/feed/feed.health.js\";\nexport type { FeedHealthInput, FeedHealthResult } from \"./opportunity/feed/feed.health.js\";\nexport { selectContactsForDiscovery, shouldRunIntroducerDiscovery, runIntroducerDiscovery, MAX_CONTACTS_PER_CYCLE, MAX_CANDIDATES_PER_CONTACT, INTRODUCER_DISCOVERY_SOURCE } from \"./opportunity/opportunity.introducer.js\";\nexport type { IntroducerDiscoveryDatabase, IntroducerDiscoveryQueue, ContactWithIntents } from \"./opportunity/opportunity.introducer.js\";\nexport { persistOpportunities } from \"./opportunity/opportunity.persist.js\";\nexport { presentOpportunity } from \"./opportunity/opportunity.presentation.js\";\nexport type { UserInfo } from \"./opportunity/opportunity.presentation.js\";\nexport { stripUuids, stripIntroducerMentions } from \"./opportunity/opportunity.presentation.js\";\nexport { getOrCreateDeliveryCardBatch, DELIVERY_CARD_CACHE_TTL, type CachedDeliveryCard, type OpportunityWithContext } from \"./opportunity/delivery-card.cache.js\";\n\n// ─── Tools ────────────────────────────────────────────────────────────────────\n\nexport { createToolRegistry } from \"./shared/agent/tool.registry.js\";\nexport { createAgentTools } from './agent/agent.tools.js';\nexport { AMBIENT_PARK_WINDOW_MS } from './negotiation/negotiation.tools.js';\nexport { normalizeTelegramHandle } from './shared/utils/telegram-handle.js';\n\n// ─── MCP ──────────────────────────────────────────────────────────────────────\n\nexport { createMcpServer, computeAgentIndexScope, buildMcpOnboardingMessage, ONBOARDING_ALLOWED } from \"./mcp/mcp.server.js\";\nexport type { ScopedDepsFactory } from \"./mcp/mcp.server.js\";\nexport { buildElicitationCreate, flattenChoice } from \"./mcp/elicitation.builder.js\";\nexport { dispatchElicitations } from \"./mcp/elicitation.dispatcher.js\";\nexport type { ElicitResultLike, ElicitInputFn, DispatchElicitationsParams } from \"./mcp/elicitation.dispatcher.js\";\n\n// ─── States (for advanced graph consumers) ────────────────────────────────────\n\nexport type { UserNegotiationContext, NegotiationTurn, NegotiationOutcome, SeedAssessment } from \"./shared/schemas/negotiation-state.schema.js\";\nexport type { NegotiationGraphLike } from \"./negotiation/negotiation.state.js\";\n\n// ─── Streamers ────────────────────────────────────────────────────────────────\n\nexport { ChatStreamer } from \"./chat/chat.streamer.js\";\nexport { ResponseStreamer } from \"./shared/agent/response.streamer.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"negotiation.tools.d.ts","sourceRoot":"/","sources":["negotiation/negotiation.tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAS5E;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,QAAgB,CAAC;AAiCpD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,4BAwvB5E"}
1
+ {"version":3,"file":"negotiation.tools.d.ts","sourceRoot":"/","sources":["negotiation/negotiation.tools.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAS5E;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,QAAgB,CAAC;AAiCpD;;;GAGG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,4BAkyB5E"}
@@ -67,6 +67,13 @@ export function createNegotiationTools(defineTool, deps) {
67
67
  .describe('Maximum negotiations to return per page (1-100). Omit to return all.'),
68
68
  page: z.number().int().min(1).optional()
69
69
  .describe('Page number (1-based). Only used when limit is provided. Defaults to 1.'),
70
+ detail: z.enum(['summary', 'narrative']).optional()
71
+ .describe('Response detail level. Omit or use "summary" for the default fields. ' +
72
+ 'Use "narrative" to receive additional context per negotiation suitable for ' +
73
+ 'composing a digest or field report: indexContext (the community/network prompt ' +
74
+ 'that seeded the negotiation), recentTurns (last 3 turns with action + message), ' +
75
+ 'and outcome (for completed negotiations). These fields are populated from data ' +
76
+ 'already loaded for the listing, so the extra cost is minimal.'),
70
77
  }),
71
78
  handler: async ({ context, query }) => {
72
79
  try {
@@ -92,7 +99,7 @@ export function createNegotiationTools(defineTool, deps) {
92
99
  }
93
100
  const isSource = meta.sourceUserId === context.userId;
94
101
  const counterpartyId = isSource ? meta.candidateUserId : meta.sourceUserId;
95
- // Get latest message for preview
102
+ // Get messages for preview (and turns when narrative detail requested)
96
103
  const messages = await negotiationDatabase.getMessagesForConversation(task.conversationId);
97
104
  const lastMessage = messages[messages.length - 1];
98
105
  const lastTurnData = lastMessage
@@ -108,7 +115,7 @@ export function createNegotiationTools(defineTool, deps) {
108
115
  : task.state;
109
116
  const isUsersTurn = status !== 'completed' &&
110
117
  ((isSource && currentSpeaker === 'source') || (!isSource && currentSpeaker === 'candidate'));
111
- return {
118
+ const base = {
112
119
  id: task.id,
113
120
  counterpartyId: counterpartyId ?? 'unknown',
114
121
  role: isSource ? 'source' : 'candidate',
@@ -122,6 +129,34 @@ export function createNegotiationTools(defineTool, deps) {
122
129
  createdAt: task.createdAt,
123
130
  updatedAt: task.updatedAt,
124
131
  };
132
+ if (query.detail !== 'narrative')
133
+ return base;
134
+ // ── Narrative extras (messages already loaded — no extra DB cost) ──
135
+ const RECENT_TURNS_LIMIT = 3;
136
+ const recentMessages = messages.slice(-RECENT_TURNS_LIMIT);
137
+ const recentTurns = recentMessages.map((m, sliceIdx) => {
138
+ const absoluteIdx = messages.length - recentMessages.length + sliceIdx;
139
+ const speaker = absoluteIdx % 2 === 0 ? 'source' : 'candidate';
140
+ const td = m.parts?.find(p => p.kind === 'data')?.data;
141
+ return {
142
+ turnNumber: absoluteIdx + 1,
143
+ speaker,
144
+ role: speaker === (isSource ? 'source' : 'candidate') ? 'own' : 'other',
145
+ action: td?.action ?? 'unknown',
146
+ message: td?.message ?? null,
147
+ };
148
+ });
149
+ const indexContext = meta.turnContext?.indexContext ?? null;
150
+ // Outcome artifact — only meaningful for completed negotiations
151
+ let outcome = null;
152
+ if (status === 'completed') {
153
+ const artifacts = await negotiationDatabase.getArtifactsForTask(task.id);
154
+ const outcomeArtifact = artifacts.find(a => a.name === 'negotiation-outcome');
155
+ outcome = outcomeArtifact
156
+ ? (outcomeArtifact.parts?.find(p => p.kind === 'data')?.data ?? null)
157
+ : null;
158
+ }
159
+ return { ...base, indexContext, recentTurns, outcome };
125
160
  }));
126
161
  let filtered = negotiations.filter(Boolean);
127
162
  if (query.since) {