@indexnetwork/protocol 3.7.0-rc.276.1 → 3.7.1-rc.278.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 (95) hide show
  1. package/dist/agent/agent.tools.js +1 -1
  2. package/dist/agent/agent.tools.js.map +1 -1
  3. package/dist/chat/chat.agent.d.ts +6 -6
  4. package/dist/chat/chat.agent.d.ts.map +1 -1
  5. package/dist/chat/chat.agent.js +9 -9
  6. package/dist/chat/chat.agent.js.map +1 -1
  7. package/dist/chat/chat.graph.d.ts.map +1 -1
  8. package/dist/chat/chat.graph.js +3 -12
  9. package/dist/chat/chat.graph.js.map +1 -1
  10. package/dist/chat/chat.interrupt.classifier.d.ts.map +1 -1
  11. package/dist/chat/chat.interrupt.classifier.js +1 -3
  12. package/dist/chat/chat.interrupt.classifier.js.map +1 -1
  13. package/dist/chat/chat.suggester.js.map +1 -1
  14. package/dist/contact/contact.tools.d.ts.map +1 -1
  15. package/dist/contact/contact.tools.js +17 -5
  16. package/dist/contact/contact.tools.js.map +1 -1
  17. package/dist/context/context.generator.d.ts +2 -0
  18. package/dist/context/context.generator.d.ts.map +1 -1
  19. package/dist/context/context.generator.js +8 -6
  20. package/dist/context/context.generator.js.map +1 -1
  21. package/dist/integration/integration.tools.d.ts.map +1 -1
  22. package/dist/integration/integration.tools.js +6 -0
  23. package/dist/integration/integration.tools.js.map +1 -1
  24. package/dist/intent/intent.clarifier.d.ts +2 -0
  25. package/dist/intent/intent.clarifier.d.ts.map +1 -1
  26. package/dist/intent/intent.clarifier.js +9 -23
  27. package/dist/intent/intent.clarifier.js.map +1 -1
  28. package/dist/intent/intent.graph.d.ts.map +1 -1
  29. package/dist/intent/intent.graph.js +29 -26
  30. package/dist/intent/intent.graph.js.map +1 -1
  31. package/dist/intent/intent.tools.d.ts.map +1 -1
  32. package/dist/intent/intent.tools.js +18 -48
  33. package/dist/intent/intent.tools.js.map +1 -1
  34. package/dist/maintenance/maintenance.graph.d.ts.map +1 -1
  35. package/dist/maintenance/maintenance.graph.js +1 -2
  36. package/dist/maintenance/maintenance.graph.js.map +1 -1
  37. package/dist/mcp/mcp.server.d.ts.map +1 -1
  38. package/dist/mcp/mcp.server.js +2 -4
  39. package/dist/mcp/mcp.server.js.map +1 -1
  40. package/dist/negotiation/negotiation.graph.d.ts.map +1 -1
  41. package/dist/negotiation/negotiation.graph.js +13 -20
  42. package/dist/negotiation/negotiation.graph.js.map +1 -1
  43. package/dist/negotiation/negotiation.tools.d.ts.map +1 -1
  44. package/dist/negotiation/negotiation.tools.js +12 -12
  45. package/dist/negotiation/negotiation.tools.js.map +1 -1
  46. package/dist/network/indexer/indexer.graph.d.ts +9 -9
  47. package/dist/network/indexer/indexer.graph.d.ts.map +1 -1
  48. package/dist/network/indexer/indexer.graph.js.map +1 -1
  49. package/dist/network/network.graph.d.ts.map +1 -1
  50. package/dist/network/network.graph.js +19 -25
  51. package/dist/network/network.graph.js.map +1 -1
  52. package/dist/opportunity/feed/feed.categorizer.d.ts.map +1 -1
  53. package/dist/opportunity/feed/feed.categorizer.js +15 -20
  54. package/dist/opportunity/feed/feed.categorizer.js.map +1 -1
  55. package/dist/opportunity/feed/feed.graph.d.ts.map +1 -1
  56. package/dist/opportunity/feed/feed.graph.js +8 -10
  57. package/dist/opportunity/feed/feed.graph.js.map +1 -1
  58. package/dist/opportunity/opportunity.introducer.d.ts.map +1 -1
  59. package/dist/opportunity/opportunity.introducer.js +1 -2
  60. package/dist/opportunity/opportunity.introducer.js.map +1 -1
  61. package/dist/opportunity/opportunity.tools.d.ts.map +1 -1
  62. package/dist/opportunity/opportunity.tools.js +3 -2
  63. package/dist/opportunity/opportunity.tools.js.map +1 -1
  64. package/dist/profile/profile.enricher.d.ts +5 -7
  65. package/dist/profile/profile.enricher.d.ts.map +1 -1
  66. package/dist/profile/profile.enricher.js +8 -10
  67. package/dist/profile/profile.enricher.js.map +1 -1
  68. package/dist/profile/profile.generator.d.ts.map +1 -1
  69. package/dist/profile/profile.generator.js +1 -2
  70. package/dist/profile/profile.generator.js.map +1 -1
  71. package/dist/profile/profile.tools.js +1 -1
  72. package/dist/profile/profile.tools.js.map +1 -1
  73. package/dist/questioner/questioner.presets.d.ts.map +1 -1
  74. package/dist/questioner/questioner.presets.js +24 -38
  75. package/dist/questioner/questioner.presets.js.map +1 -1
  76. package/dist/shared/agent/tool.factory.d.ts.map +1 -1
  77. package/dist/shared/agent/tool.factory.js +2 -2
  78. package/dist/shared/agent/tool.factory.js.map +1 -1
  79. package/dist/shared/agent/tool.helpers.d.ts +14 -0
  80. package/dist/shared/agent/tool.helpers.d.ts.map +1 -1
  81. package/dist/shared/agent/tool.helpers.js.map +1 -1
  82. package/dist/shared/agent/tool.runtime.d.ts.map +1 -1
  83. package/dist/shared/agent/tool.runtime.js +20 -13
  84. package/dist/shared/agent/tool.runtime.js.map +1 -1
  85. package/dist/shared/hyde/hyde.graph.d.ts.map +1 -1
  86. package/dist/shared/hyde/hyde.graph.js +3 -2
  87. package/dist/shared/hyde/hyde.graph.js.map +1 -1
  88. package/dist/shared/hyde/hyde.strategies.d.ts +2 -1
  89. package/dist/shared/hyde/hyde.strategies.d.ts.map +1 -1
  90. package/dist/shared/hyde/hyde.strategies.js.map +1 -1
  91. package/dist/shared/observability/trace.d.ts +3 -3
  92. package/dist/shared/observability/trace.d.ts.map +1 -1
  93. package/dist/shared/observability/trace.js +19 -33
  94. package/dist/shared/observability/trace.js.map +1 -1
  95. package/package.json +1 -1
@@ -1,18 +1,16 @@
1
+ /**
2
+ * Returns true when the enriched name is meaningfully better than the email local-part.
3
+ * A name that is empty, contains '@', or case-insensitively matches the prefix is NOT meaningful.
4
+ */
5
+ export declare function isEnrichedNameMeaningful(email: string, enrichedName: string): boolean;
1
6
  /**
2
7
  * Decides whether to set {@link users.name} from Parallel `enrichment.identity.name` for ghost users.
3
8
  * @remarks Real users (Google login, etc.) are never touched. Ghost users always get
4
9
  * their name enriched when Parallel returns a non-empty name that isn't an email.
5
- */
6
- /**
7
10
  * @param user - Current user row (must include `email`, `name`, `isGhost`)
8
11
  * @param enrichedName - `enrichment.identity.name` from Parallel (may be untrimmed)
9
12
  * @returns True if `users.name` should be updated to the enriched full name
10
13
  */
11
- /**
12
- * Returns true when the enriched name is meaningfully better than the email local-part.
13
- * A name that is empty, contains '@', or case-insensitively matches the prefix is NOT meaningful.
14
- */
15
- export declare function isEnrichedNameMeaningful(email: string, enrichedName: string): boolean;
16
14
  export declare function shouldEnrichGhostDisplayNameFromParallel(user: {
17
15
  name: string;
18
16
  email: string;
@@ -1 +1 @@
1
- {"version":3,"file":"profile.enricher.d.ts","sourceRoot":"/","sources":["profile/profile.enricher.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAKrF;AAED,wBAAgB,wCAAwC,CACtD,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,EAC/D,YAAY,EAAE,MAAM,GACnB,OAAO,CAST"}
1
+ {"version":3,"file":"profile.enricher.d.ts","sourceRoot":"/","sources":["profile/profile.enricher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAKrF;AAED;;;;;;;GAOG;AACH,wBAAgB,wCAAwC,CACtD,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CAAE,EAC/D,YAAY,EAAE,MAAM,GACnB,OAAO,CAST"}
@@ -1,13 +1,3 @@
1
- /**
2
- * Decides whether to set {@link users.name} from Parallel `enrichment.identity.name` for ghost users.
3
- * @remarks Real users (Google login, etc.) are never touched. Ghost users always get
4
- * their name enriched when Parallel returns a non-empty name that isn't an email.
5
- */
6
- /**
7
- * @param user - Current user row (must include `email`, `name`, `isGhost`)
8
- * @param enrichedName - `enrichment.identity.name` from Parallel (may be untrimmed)
9
- * @returns True if `users.name` should be updated to the enriched full name
10
- */
11
1
  /**
12
2
  * Returns true when the enriched name is meaningfully better than the email local-part.
13
3
  * A name that is empty, contains '@', or case-insensitively matches the prefix is NOT meaningful.
@@ -19,6 +9,14 @@ export function isEnrichedNameMeaningful(email, enrichedName) {
19
9
  const localPart = email.split('@')[0].toLowerCase();
20
10
  return trimmed.toLowerCase() !== localPart;
21
11
  }
12
+ /**
13
+ * Decides whether to set {@link users.name} from Parallel `enrichment.identity.name` for ghost users.
14
+ * @remarks Real users (Google login, etc.) are never touched. Ghost users always get
15
+ * their name enriched when Parallel returns a non-empty name that isn't an email.
16
+ * @param user - Current user row (must include `email`, `name`, `isGhost`)
17
+ * @param enrichedName - `enrichment.identity.name` from Parallel (may be untrimmed)
18
+ * @returns True if `users.name` should be updated to the enriched full name
19
+ */
22
20
  export function shouldEnrichGhostDisplayNameFromParallel(user, enrichedName) {
23
21
  if (!user.isGhost)
24
22
  return false;
@@ -1 +1 @@
1
- {"version":3,"file":"profile.enricher.js","sourceRoot":"/","sources":["profile/profile.enricher.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;GAIG;AACH;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAa,EAAE,YAAoB;IAC1E,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC;IACpC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACpD,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACpD,OAAO,OAAO,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,wCAAwC,CACtD,IAA+D,EAC/D,YAAoB;IAEpB,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAChC,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC;IACpC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAEpD,iDAAiD;IACjD,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAE/C,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/**\n * Decides whether to set {@link users.name} from Parallel `enrichment.identity.name` for ghost users.\n * @remarks Real users (Google login, etc.) are never touched. Ghost users always get\n * their name enriched when Parallel returns a non-empty name that isn't an email.\n */\n\n/**\n * @param user - Current user row (must include `email`, `name`, `isGhost`)\n * @param enrichedName - `enrichment.identity.name` from Parallel (may be untrimmed)\n * @returns True if `users.name` should be updated to the enriched full name\n */\n/**\n * Returns true when the enriched name is meaningfully better than the email local-part.\n * A name that is empty, contains '@', or case-insensitively matches the prefix is NOT meaningful.\n */\nexport function isEnrichedNameMeaningful(email: string, enrichedName: string): boolean {\n const trimmed = enrichedName.trim();\n if (!trimmed || trimmed.includes('@')) return false;\n const localPart = email.split('@')[0].toLowerCase();\n return trimmed.toLowerCase() !== localPart;\n}\n\nexport function shouldEnrichGhostDisplayNameFromParallel(\n user: { name: string; email: string; isGhost?: boolean | null },\n enrichedName: string,\n): boolean {\n if (!user.isGhost) return false;\n const trimmed = enrichedName.trim();\n if (!trimmed || trimmed.includes(\"@\")) return false;\n\n // Skip only if exactly the same (case-sensitive)\n if (user.name.trim() === trimmed) return false;\n\n return true;\n}\n"]}
1
+ {"version":3,"file":"profile.enricher.js","sourceRoot":"/","sources":["profile/profile.enricher.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAa,EAAE,YAAoB;IAC1E,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC;IACpC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACpD,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;IACpD,OAAO,OAAO,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC;AAC7C,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wCAAwC,CACtD,IAA+D,EAC/D,YAAoB;IAEpB,IAAI,CAAC,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAChC,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,EAAE,CAAC;IACpC,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAEpD,iDAAiD;IACjD,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAE/C,OAAO,IAAI,CAAC;AACd,CAAC","sourcesContent":["/**\n * Returns true when the enriched name is meaningfully better than the email local-part.\n * A name that is empty, contains '@', or case-insensitively matches the prefix is NOT meaningful.\n */\nexport function isEnrichedNameMeaningful(email: string, enrichedName: string): boolean {\n const trimmed = enrichedName.trim();\n if (!trimmed || trimmed.includes('@')) return false;\n const localPart = email.split('@')[0].toLowerCase();\n return trimmed.toLowerCase() !== localPart;\n}\n\n/**\n * Decides whether to set {@link users.name} from Parallel `enrichment.identity.name` for ghost users.\n * @remarks Real users (Google login, etc.) are never touched. Ghost users always get\n * their name enriched when Parallel returns a non-empty name that isn't an email.\n * @param user - Current user row (must include `email`, `name`, `isGhost`)\n * @param enrichedName - `enrichment.identity.name` from Parallel (may be untrimmed)\n * @returns True if `users.name` should be updated to the enriched full name\n */\nexport function shouldEnrichGhostDisplayNameFromParallel(\n user: { name: string; email: string; isGhost?: boolean | null },\n enrichedName: string,\n): boolean {\n if (!user.isGhost) return false;\n const trimmed = enrichedName.trim();\n if (!trimmed || trimmed.includes(\"@\")) return false;\n\n // Skip only if exactly the same (case-sensitive)\n if (user.name.trim() === trimmed) return false;\n\n return true;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"profile.generator.d.ts","sourceRoot":"/","sources":["profile/profile.generator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAkB3B,QAAA,MAAM,cAAc;;;;;;;;;;;;;iBAalB,CAAC;AAEH,KAAK,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9C,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,SAAS,CAA6C;IACrE,OAAO,CAAC,KAAK,CAAkF;;IAS/F,OAAO,CAAC,QAAQ;IAiBH,MAAM,CAAC,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;WAgBnB,MAAM;;;;;;;;;;;;;;;;;;;;;;;CAerB"}
1
+ {"version":3,"file":"profile.generator.d.ts","sourceRoot":"/","sources":["profile/profile.generator.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAkB3B,QAAA,MAAM,cAAc;;;;;;;;;;;;;iBAalB,CAAC;AAEH,KAAK,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9C,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3D,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAC,SAAS,CAA6C;IACrE,OAAO,CAAC,KAAK,CAAkF;;IAS/F,OAAO,CAAC,QAAQ;IAeH,MAAM,CAAC,KAAK,EAAE,MAAM;;;;;;;;;;;;;;;;;WAgBnB,MAAM;;;;;;;;;;;;;;;;;;;;;;;CAerB"}
@@ -46,7 +46,7 @@ export class ProfileGenerator {
46
46
  });
47
47
  }
48
48
  toString(profile) {
49
- const textToEmbed = [
49
+ return [
50
50
  '# Identity',
51
51
  '## Name', profile.identity.name,
52
52
  '## Bio', profile.identity.bio,
@@ -57,7 +57,6 @@ export class ProfileGenerator {
57
57
  '## Interests', profile.attributes.interests.join(', '),
58
58
  '## Skills', profile.attributes.skills.join(', ')
59
59
  ].join('\n');
60
- return textToEmbed;
61
60
  }
62
61
  async invoke(input) {
63
62
  logger.verbose("Received input", { inputLength: input?.length });
@@ -1 +1 @@
1
- {"version":3,"file":"profile.generator.js","sourceRoot":"/","sources":["profile/profile.generator.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,MAAM,GAAG,cAAc,CAAC,kBAAkB,CAAC,CAAC;AAElD,MAAM,YAAY,GAAG;;;;;;;;CAQpB,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9B,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,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AK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;aAC9E,CAAC;SACH,CACF,CAAC;IACJ,CAAC;CACF;AA/Bc;IADZ,KAAK,EAAE;;;;8CAeP","sourcesContent":["import { HumanMessage, SystemMessage } from \"@langchain/core/messages\";\nimport { tool } from \"@langchain/core/tools\";\nimport { z } from \"zod/v4\";\nimport { protocolLogger } from \"../shared/observability/protocol.logger.js\";\nimport { Timed } from \"../shared/observability/performance.js\";\nimport { createModel } from \"../shared/agent/model.config.js\";\nimport { invokeWithAbortSignal } from \"../shared/agent/model-signal.js\";\n\nconst logger = protocolLogger(\"ProfileGenerator\");\n\nconst systemPrompt = `\n You are an expert profiler. Your task is to synthesize a structured User Profile from raw data or user requests.\n\n When given EXISTING PROFILE + USER REQUEST: Apply the request to the existing profile. Add, update, or remove skills and interests as the user asks. Preserve everything else. Output the full updated profile.\n\n When given raw data only: Infer name, bio, location, narrative.context, and extract skills and interests.\n\n PRIVACY: identity.bio and narrative.context are public-facing. Never include email addresses, phone numbers, physical addresses, government IDs, or other contact identifiers — even if they appear in the raw data. Describe the person professionally; do not embed ways to contact them.\n`;\n\nconst responseFormat = z.object({\n identity: z.object({\n name: z.string().describe(\"The user's full name\"),\n bio: z.string().describe(\"Professional summary (2-3 sentences) only; no email, phone, physical address, government ID, or other contact identifiers\"),\n location: z.string().describe(\"Inferred location (City, Country) or 'Remote'\"),\n }),\n narrative: z.object({\n context: z.string().describe(\"Rich narrative without email, phone, physical address, government ID, or other contact identifiers\"),\n }),\n attributes: z.object({\n interests: z.array(z.string()).describe(\"Inferred or explicit interests\"),\n skills: z.array(z.string()).describe(\"Professional skills\"),\n }),\n});\n\ntype Profile = z.infer<typeof responseFormat>;\nexport type ProfileDocument = Profile & { userId: string };\n\nexport class ProfileGenerator {\n private static baseModel: ReturnType<typeof createModel> | undefined;\n private model: { invoke(input: unknown, config?: { signal?: AbortSignal }): Promise<unknown> };\n\n constructor() {\n const baseModel = ProfileGenerator.baseModel ??= createModel(\"profileGenerator\");\n this.model = baseModel.withStructuredOutput(responseFormat, {\n name: \"profile_generator\"\n });\n }\n\n private toString(profile: Profile): string {\n const textToEmbed = [\n '# Identity',\n '## Name', profile.identity.name,\n '## Bio', profile.identity.bio,\n '## Location', profile.identity.location,\n '# Narrative',\n '## Context', profile.narrative.context,\n '# Attributes',\n '## Interests', profile.attributes.interests.join(', '),\n '## Skills', profile.attributes.skills.join(', ')\n ].join('\\n');\n\n return textToEmbed;\n }\n\n @Timed()\n public async invoke(input: string) {\n logger.verbose(\"Received input\", { inputLength: input?.length });\n const messages = [\n new SystemMessage(systemPrompt),\n new HumanMessage(`Here is the raw data:\\n${input}`)\n ];\n const result = await invokeWithAbortSignal(this.model, messages);\n const output = responseFormat.parse(result);\n const textToEmbed = this.toString(output);\n logger.verbose(\"Generated profile\", {\n skillsCount: output.attributes.skills.length,\n interestsCount: output.attributes.interests.length\n });\n return { output, textToEmbed };\n }\n\n public static asTool() {\n return tool(\n async (args: { input: string }) => {\n const profileGenerator = new ProfileGenerator();\n return await profileGenerator.invoke(args.input);\n },\n {\n name: 'profileGenerator',\n description: 'Profile Generator',\n schema: z.object({\n input: z.string().describe('Raw data scraped from the web (via Parallel.ai)'),\n })\n }\n );\n }\n}"]}
1
+ {"version":3,"file":"profile.generator.js","sourceRoot":"/","sources":["profile/profile.generator.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAC;AAC3B,OAAO,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EA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G,IAAI,gBAAgB,EAAE,CAAC;YAChD,OAAO,MAAM,gBAAgB,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnD,CAAC,EACD;YACE,IAAI,EAAE,kBAAkB;YACxB,WAAW,EAAE,mBAAmB;YAChC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;gBACf,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,iDAAiD,CAAC;aAC9E,CAAC;SACH,CACF,CAAC;IACJ,CAAC;CACF;AA/Bc;IADZ,KAAK,EAAE;;;;8CAeP","sourcesContent":["import { HumanMessage, SystemMessage } from \"@langchain/core/messages\";\nimport { tool } from \"@langchain/core/tools\";\nimport { z } from \"zod/v4\";\nimport { protocolLogger } from \"../shared/observability/protocol.logger.js\";\nimport { Timed } from \"../shared/observability/performance.js\";\nimport { createModel } from \"../shared/agent/model.config.js\";\nimport { invokeWithAbortSignal } from \"../shared/agent/model-signal.js\";\n\nconst logger = protocolLogger(\"ProfileGenerator\");\n\nconst systemPrompt = `\n You are an expert profiler. Your task is to synthesize a structured User Profile from raw data or user requests.\n\n When given EXISTING PROFILE + USER REQUEST: Apply the request to the existing profile. Add, update, or remove skills and interests as the user asks. Preserve everything else. Output the full updated profile.\n\n When given raw data only: Infer name, bio, location, narrative.context, and extract skills and interests.\n\n PRIVACY: identity.bio and narrative.context are public-facing. Never include email addresses, phone numbers, physical addresses, government IDs, or other contact identifiers — even if they appear in the raw data. Describe the person professionally; do not embed ways to contact them.\n`;\n\nconst responseFormat = z.object({\n identity: z.object({\n name: z.string().describe(\"The user's full name\"),\n bio: z.string().describe(\"Professional summary (2-3 sentences) only; no email, phone, physical address, government ID, or other contact identifiers\"),\n location: z.string().describe(\"Inferred location (City, Country) or 'Remote'\"),\n }),\n narrative: z.object({\n context: z.string().describe(\"Rich narrative without email, phone, physical address, government ID, or other contact identifiers\"),\n }),\n attributes: z.object({\n interests: z.array(z.string()).describe(\"Inferred or explicit interests\"),\n skills: z.array(z.string()).describe(\"Professional skills\"),\n }),\n});\n\ntype Profile = z.infer<typeof responseFormat>;\nexport type ProfileDocument = Profile & { userId: string };\n\nexport class ProfileGenerator {\n private static baseModel: ReturnType<typeof createModel> | undefined;\n private model: { invoke(input: unknown, config?: { signal?: AbortSignal }): Promise<unknown> };\n\n constructor() {\n const baseModel = ProfileGenerator.baseModel ??= createModel(\"profileGenerator\");\n this.model = baseModel.withStructuredOutput(responseFormat, {\n name: \"profile_generator\"\n });\n }\n\n private toString(profile: Profile): string {\n return [\n '# Identity',\n '## Name', profile.identity.name,\n '## Bio', profile.identity.bio,\n '## Location', profile.identity.location,\n '# Narrative',\n '## Context', profile.narrative.context,\n '# Attributes',\n '## Interests', profile.attributes.interests.join(', '),\n '## Skills', profile.attributes.skills.join(', ')\n ].join('\\n');\n }\n\n @Timed()\n public async invoke(input: string) {\n logger.verbose(\"Received input\", { inputLength: input?.length });\n const messages = [\n new SystemMessage(systemPrompt),\n new HumanMessage(`Here is the raw data:\\n${input}`)\n ];\n const result = await invokeWithAbortSignal(this.model, messages);\n const output = responseFormat.parse(result);\n const textToEmbed = this.toString(output);\n logger.verbose(\"Generated profile\", {\n skillsCount: output.attributes.skills.length,\n interestsCount: output.attributes.interests.length\n });\n return { output, textToEmbed };\n }\n\n public static asTool() {\n return tool(\n async (args: { input: string }) => {\n const profileGenerator = new ProfileGenerator();\n return await profileGenerator.invoke(args.input);\n },\n {\n name: 'profileGenerator',\n description: 'Profile Generator',\n schema: z.object({\n input: z.string().describe('Raw data scraped from the web (via Parallel.ai)'),\n })\n }\n );\n }\n}"]}
@@ -726,7 +726,7 @@ export function createProfileTools(defineTool, deps) {
726
726
  newSocials.push({ label: 'twitter', value: twitterUrl });
727
727
  if (websites?.length) {
728
728
  for (const w of websites)
729
- newSocials.push({ label: detectSocialLabel(w) === 'custom' ? 'custom' : detectSocialLabel(w), value: w });
729
+ newSocials.push({ label: detectSocialLabel(w), value: w });
730
730
  }
731
731
  await mergeUserSocials(newSocials);
732
732
  }