@indexnetwork/protocol 14.2.3-rc.474.1 → 14.3.0-rc.475.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 (37) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/dist/contexts/application/index.d.ts +9 -9
  3. package/dist/contexts/application/index.js +9 -9
  4. package/dist/contexts/domain/index.d.ts +2 -2
  5. package/dist/contexts/domain/index.js +2 -2
  6. package/dist/contexts/index.d.ts +1 -1
  7. package/dist/contexts/index.js +1 -3
  8. package/dist/{shared/hyde → discovery}/hyde.documents.d.ts +1 -1
  9. package/dist/{shared/hyde → discovery}/hyde.generator.js +4 -4
  10. package/dist/{shared/hyde → discovery}/hyde.graph.d.ts +8 -8
  11. package/dist/{shared/hyde → discovery}/hyde.graph.js +4 -4
  12. package/dist/{shared/hyde → discovery}/hyde.state.d.ts +2 -2
  13. package/dist/{shared/hyde → discovery}/hyde.validator.js +2 -2
  14. package/dist/discovery/index.d.ts +26 -0
  15. package/dist/discovery/index.js +19 -0
  16. package/dist/{shared/hyde → discovery}/lens.inferrer.js +4 -4
  17. package/dist/index.d.ts +3 -3
  18. package/dist/index.js +3 -3
  19. package/dist/opportunities/application/opportunity.evaluator.d.ts +1 -1
  20. package/dist/opportunities/application/opportunity.graph.d.ts +2 -2
  21. package/dist/opportunities/application/opportunity.graph.js +2 -2
  22. package/dist/opportunities/domain/opportunity.utils.d.ts +1 -1
  23. package/dist/premises/premise.graph.d.ts +1 -1
  24. package/dist/shared/agent/tool.factory.js +3 -3
  25. package/dist/shared/interfaces/embedder.interface.d.ts +1 -1
  26. package/package.json +1 -1
  27. /package/dist/{shared/hyde → discovery}/hyde.documents.js +0 -0
  28. /package/dist/{shared/hyde → discovery}/hyde.env.d.ts +0 -0
  29. /package/dist/{shared/hyde → discovery}/hyde.env.js +0 -0
  30. /package/dist/{shared/hyde → discovery}/hyde.frame.d.ts +0 -0
  31. /package/dist/{shared/hyde → discovery}/hyde.frame.js +0 -0
  32. /package/dist/{shared/hyde → discovery}/hyde.generator.d.ts +0 -0
  33. /package/dist/{shared/hyde → discovery}/hyde.state.js +0 -0
  34. /package/dist/{shared/hyde → discovery}/hyde.strategies.d.ts +0 -0
  35. /package/dist/{shared/hyde → discovery}/hyde.strategies.js +0 -0
  36. /package/dist/{shared/hyde → discovery}/hyde.validator.d.ts +0 -0
  37. /package/dist/{shared/hyde → discovery}/lens.inferrer.d.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -20,6 +20,50 @@ went 6.7.1 → 8.0.2 with no 7.x in between because the whole 7.x line shipped a
20
20
  prereleases between the two promotions. To track every change, read `rc`; to
21
21
  pin a supported release, use `latest`.
22
22
 
23
+ ## 14.3.0 - 2026-08-16
24
+
25
+ No public API change: all 443 exported symbols are byte-identical to 14.2.2.
26
+
27
+ ### Changed
28
+
29
+ - Promoted `shared/hyde/` to a `discovery/` capability — 9 source files and 7
30
+ specs. HyDE owns a graph, a generator, a lens inferrer, and a validator; that
31
+ is discovery machinery, not shared infrastructure. It lived under `shared/`
32
+ because two capabilities needed it, which had made `shared/` the default home
33
+ for anything with more than one consumer.
34
+
35
+ `discovery/index.ts` is its sole cross-capability surface, carrying the 41
36
+ symbols that actually cross the boundary. `contexts` and `opportunities` now
37
+ reach it through that barrel; the tool composition root keeps its direct leaf
38
+ imports, as it is exempt by design and as a barrel import there is what caused
39
+ the runtime cycle in 14.2.0.
40
+
41
+ - `HydeGraphFactory`, `HydeGenerator`, and `LensInferrer` are re-exported from
42
+ the root barrel via `discovery/index.js` rather than `contexts/index.js`, and
43
+ the `contexts` barrel no longer carries them. The exported names are
44
+ unchanged; only the internal path moved.
45
+
46
+ - Declared the directions this makes explicit: `contexts → discovery`,
47
+ `opportunities → discovery`, and `discovery → agents` (HyDE stamps a
48
+ debug-metadata type onto its graph state). 25 named directions became 29.
49
+
50
+ ### Note
51
+
52
+ The rest of the `shared/` rehoming was considered and rejected on evidence.
53
+ `shared/assignment/` is used by `networks` *and* `premises`, and
54
+ `shared/network/metadata.renderer` by `networks` *and* `opportunities` — so
55
+ moving either into `networks/` would create `contexts → networks` and
56
+ `opportunities → networks`, neither of which is an allowed direction. They are
57
+ in `shared/` precisely because two capabilities need them and neither owns them;
58
+ moving them would add edges to the capability graph rather than remove them.
59
+
60
+ `shared/agent/` mixes the composition root with model primitives and is a
61
+ genuine split candidate, but it has 140 importers across 15 capabilities and
62
+ `tool.factory` is the module that produced the 14.2.0 cycle. Left alone
63
+ deliberately. What remains under `shared/` — `interfaces/`, `observability/`,
64
+ `schemas/`, `utils/`, and `agent/` — spans 5 to 15 capabilities each and is
65
+ correctly neutral.
66
+
23
67
  ## 14.2.2 - 2026-08-16
24
68
 
25
69
  No public API change: all 443 exported symbols are byte-identical to 14.2.1.
@@ -51,7 +51,7 @@
51
51
  * prompt-injection and out-of-scope risks.
52
52
  *
53
53
  * IND-545: canonical application home for participant-context orchestrators
54
- * previously spread across premises/, contexts/, enrichment/, and shared/hyde/.
54
+ * previously spread across premises/, contexts/, enrichment/, and discovery/.
55
55
  */
56
56
  export { PremiseGraphFactory } from "../../premises/premise.graph.js";
57
57
  export { PremiseDecomposer, type PremiseDecomposerOutput, type DecomposedPremise, type ExistingPremiseRef, } from "../../premises/premise.decomposer.js";
@@ -63,11 +63,11 @@ export { shouldEnrichGhostDisplayNameFromParallel, isEnrichedNameMeaningful, } f
63
63
  export { createEnrichmentTools } from "../../enrichment/enrichment.tools.js";
64
64
  export { createPremiseTools } from "../../premises/premise.tools.js";
65
65
  export { UserContextGenerator } from "../../contexts/context.generator.js";
66
- export { HydeGraphFactory, type HydeLensInferrerLike, type HydeGeneratorLike, type HydeValidatorLike, type HydeGraphOptions, } from "../../shared/hyde/hyde.graph.js";
67
- export { HydeGenerator, type HydeGeneratorOutput, type HydeGenerateInput, } from "../../shared/hyde/hyde.generator.js";
68
- export { LensInferrer, type LensInferenceInput, type LensInferenceOutput, FRAME_SYSTEM_PROMPT, FrameResponseSchema, } from "../../shared/hyde/lens.inferrer.js";
69
- export { HydeValidator, type HydeValidationDocument, type HydeValidationInput, type HydeValidationVerdict, type HydeValidationOutput, HydeValidationResponseSchema, buildHydeValidationPrompt, } from "../../shared/hyde/hyde.validator.js";
70
- export { computeHydeSourceTextHash, selectHydeDocumentsForGeneration } from "../../shared/hyde/hyde.documents.js";
71
- export { getHydeGenerationMode, type HydeGenerationMode, HYDE_FRAME_GENERATION_VERSION, } from "../../shared/hyde/hyde.env.js";
72
- export { HYDE_DEFAULT_CACHE_TTL, HYDE_CORPUS_PROMPTS, } from "../../shared/hyde/hyde.strategies.js";
73
- export { type HydeSourceFrame, HydeSourceFrameSchema, type HydeFrameRole, type HydeFrameHardConstraint, type HydeFrameNamedEntity, type HydeFrameVocabulary, HYDE_HARD_CONSTRAINT_TYPES, HYDE_NAMED_ENTITY_TYPES, } from "../../shared/hyde/hyde.frame.js";
66
+ export { HydeGraphFactory, type HydeLensInferrerLike, type HydeGeneratorLike, type HydeValidatorLike, type HydeGraphOptions, } from "../../discovery/index.js";
67
+ export { HydeGenerator, type HydeGeneratorOutput, type HydeGenerateInput, } from "../../discovery/index.js";
68
+ export { LensInferrer, type LensInferenceInput, type LensInferenceOutput, FRAME_SYSTEM_PROMPT, FrameResponseSchema, } from "../../discovery/index.js";
69
+ export { HydeValidator, type HydeValidationDocument, type HydeValidationInput, type HydeValidationVerdict, type HydeValidationOutput, HydeValidationResponseSchema, buildHydeValidationPrompt, } from "../../discovery/index.js";
70
+ export { computeHydeSourceTextHash, selectHydeDocumentsForGeneration } from "../../discovery/index.js";
71
+ export { getHydeGenerationMode, type HydeGenerationMode, HYDE_FRAME_GENERATION_VERSION, } from "../../discovery/index.js";
72
+ export { HYDE_DEFAULT_CACHE_TTL, HYDE_CORPUS_PROMPTS, } from "../../discovery/index.js";
73
+ export { type HydeSourceFrame, HydeSourceFrameSchema, type HydeFrameRole, type HydeFrameHardConstraint, type HydeFrameNamedEntity, type HydeFrameVocabulary, HYDE_HARD_CONSTRAINT_TYPES, HYDE_NAMED_ENTITY_TYPES, } from "../../discovery/index.js";
@@ -51,7 +51,7 @@
51
51
  * prompt-injection and out-of-scope risks.
52
52
  *
53
53
  * IND-545: canonical application home for participant-context orchestrators
54
- * previously spread across premises/, contexts/, enrichment/, and shared/hyde/.
54
+ * previously spread across premises/, contexts/, enrichment/, and discovery/.
55
55
  */
56
56
  // ── Premise graph ─────────────────────────────────────────────────────────────
57
57
  export { PremiseGraphFactory } from "../../premises/premise.graph.js";
@@ -72,12 +72,12 @@ export { createPremiseTools } from "../../premises/premise.tools.js";
72
72
  // ── Context synthesis ─────────────────────────────────────────────────────────
73
73
  export { UserContextGenerator } from "../../contexts/context.generator.js";
74
74
  // ── HyDE graph + service classes ─────────────────────────────────────────────
75
- export { HydeGraphFactory, } from "../../shared/hyde/hyde.graph.js";
76
- export { HydeGenerator, } from "../../shared/hyde/hyde.generator.js";
77
- export { LensInferrer, FRAME_SYSTEM_PROMPT, FrameResponseSchema, } from "../../shared/hyde/lens.inferrer.js";
78
- export { HydeValidator, HydeValidationResponseSchema, buildHydeValidationPrompt, } from "../../shared/hyde/hyde.validator.js";
75
+ export { HydeGraphFactory, } from "../../discovery/index.js";
76
+ export { HydeGenerator, } from "../../discovery/index.js";
77
+ export { LensInferrer, FRAME_SYSTEM_PROMPT, FrameResponseSchema, } from "../../discovery/index.js";
78
+ export { HydeValidator, HydeValidationResponseSchema, buildHydeValidationPrompt, } from "../../discovery/index.js";
79
79
  // ── HyDE utilities ────────────────────────────────────────────────────────────
80
- export { computeHydeSourceTextHash, selectHydeDocumentsForGeneration } from "../../shared/hyde/hyde.documents.js";
81
- export { getHydeGenerationMode, HYDE_FRAME_GENERATION_VERSION, } from "../../shared/hyde/hyde.env.js";
82
- export { HYDE_DEFAULT_CACHE_TTL, HYDE_CORPUS_PROMPTS, } from "../../shared/hyde/hyde.strategies.js";
83
- export { HydeSourceFrameSchema, HYDE_HARD_CONSTRAINT_TYPES, HYDE_NAMED_ENTITY_TYPES, } from "../../shared/hyde/hyde.frame.js";
80
+ export { computeHydeSourceTextHash, selectHydeDocumentsForGeneration } from "../../discovery/index.js";
81
+ export { getHydeGenerationMode, HYDE_FRAME_GENERATION_VERSION, } from "../../discovery/index.js";
82
+ export { HYDE_DEFAULT_CACHE_TTL, HYDE_CORPUS_PROMPTS, } from "../../discovery/index.js";
83
+ export { HydeSourceFrameSchema, HYDE_HARD_CONSTRAINT_TYPES, HYDE_NAMED_ENTITY_TYPES, } from "../../discovery/index.js";
@@ -57,11 +57,11 @@
57
57
  * in shared/agent and shared/hyde.
58
58
  *
59
59
  * IND-545: canonical home for participant-context domain contracts previously
60
- * spread across premises/, contexts/, enrichment/, and shared/hyde/.
60
+ * spread across premises/, contexts/, enrichment/, and discovery/.
61
61
  * Legacy paths remain as compatibility re-exports pointing here.
62
62
  */
63
63
  export { PremiseGraphState } from "../../premises/premise.state.js";
64
64
  export { EnrichmentGraphState } from "../../enrichment/enrichment.state.js";
65
- export { HydeGraphState, type HydeDocumentState, type HydeDocumentOrigin, type HydeValidationStatus, } from "../../shared/hyde/hyde.state.js";
65
+ export { HydeGraphState, type HydeDocumentState, type HydeDocumentOrigin, type HydeValidationStatus, } from "../../discovery/index.js";
66
66
  export type { UserContextInput, IncrementalContextInput, GlobalContextInput, GlobalIncrementalContextInput, UserContextResult, } from "../../contexts/context.generator.js";
67
67
  export type { PremiseAssertion, PremiseProvenance, PremiseAnalysis, PremiseValidity, PremiseRecord, } from "../../shared/interfaces/database.interface.js";
@@ -57,7 +57,7 @@
57
57
  * in shared/agent and shared/hyde.
58
58
  *
59
59
  * IND-545: canonical home for participant-context domain contracts previously
60
- * spread across premises/, contexts/, enrichment/, and shared/hyde/.
60
+ * spread across premises/, contexts/, enrichment/, and discovery/.
61
61
  * Legacy paths remain as compatibility re-exports pointing here.
62
62
  */
63
63
  // ── Premise graph state ───────────────────────────────────────────────────────
@@ -65,4 +65,4 @@ export { PremiseGraphState } from "../../premises/premise.state.js";
65
65
  // ── Enrichment graph state ────────────────────────────────────────────────────
66
66
  export { EnrichmentGraphState } from "../../enrichment/enrichment.state.js";
67
67
  // ── HyDE graph state and document types ──────────────────────────────────────
68
- export { HydeGraphState, } from "../../shared/hyde/hyde.state.js";
68
+ export { HydeGraphState, } from "../../discovery/index.js";
@@ -9,5 +9,5 @@
9
9
  * Supersedes the capabilities/participant-context.facade.ts + public/ pair; the
10
10
  * export list is the union of the facades it replaces, so the contract is unchanged.
11
11
  */
12
- export { createEnrichmentTools, createPremiseTools, EnrichmentGraphFactory, PremiseGraphFactory, UserContextGenerator, HydeGraphFactory, HydeGenerator, LensInferrer, } from "./application/index.js";
12
+ export { createEnrichmentTools, createPremiseTools, EnrichmentGraphFactory, PremiseGraphFactory, UserContextGenerator, } from "./application/index.js";
13
13
  export type { EnrichmentToolDeps, PremiseToolDeps, } from "./ports/participant-context.tools.port.js";
@@ -9,6 +9,4 @@
9
9
  * Supersedes the capabilities/participant-context.facade.ts + public/ pair; the
10
10
  * export list is the union of the facades it replaces, so the contract is unchanged.
11
11
  */
12
- export { createEnrichmentTools, createPremiseTools, EnrichmentGraphFactory, PremiseGraphFactory, UserContextGenerator,
13
- // HyDE — participant-context technology binding
14
- HydeGraphFactory, HydeGenerator, LensInferrer, } from "./application/index.js";
12
+ export { createEnrichmentTools, createPremiseTools, EnrichmentGraphFactory, PremiseGraphFactory, UserContextGenerator, } from "./application/index.js";
@@ -1,4 +1,4 @@
1
- import type { HydeDocument } from '../interfaces/database.interface.js';
1
+ import type { HydeDocument } from '../shared/interfaces/database.interface.js';
2
2
  import { type HydeGenerationMode } from './hyde.env.js';
3
3
  /** Hash source text without persisting the source itself in frame metadata. */
4
4
  export declare function computeHydeSourceTextHash(sourceText: string): string;
@@ -9,10 +9,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { HumanMessage, SystemMessage } from '@langchain/core/messages';
11
11
  import { z } from 'zod';
12
- import { createStructuredModel } from "../agent/model.config.js";
13
- import { invokeWithAbortSignal } from "../agent/model-signal.js";
14
- import { protocolLogger } from '../observability/protocol.logger.js';
15
- import { Timed } from "../observability/performance.js";
12
+ import { createStructuredModel } from "../shared/agent/model.config.js";
13
+ import { invokeWithAbortSignal } from "../shared/agent/model-signal.js";
14
+ import { protocolLogger } from '../shared/observability/protocol.logger.js';
15
+ import { Timed } from "../shared/observability/performance.js";
16
16
  import { HYDE_CORPUS_PROMPTS } from './hyde.strategies.js';
17
17
  const logger = protocolLogger("HydeGenerator");
18
18
  const SYSTEM_PROMPT = `You are a Hypothetical Document Generator for semantic search.
@@ -1,7 +1,7 @@
1
- import type { DebugMetaAgent } from '../../chat/chat-streaming.types.js';
2
- import type { HydeCache } from '../interfaces/cache.interface.js';
3
- import type { HydeGraphDatabase } from '../interfaces/database.interface.js';
4
- import type { EmbeddingGenerator } from '../interfaces/embedder.interface.js';
1
+ import type { DebugMetaAgent } from '../agents/index.js';
2
+ import type { HydeCache } from '../shared/interfaces/cache.interface.js';
3
+ import type { HydeGraphDatabase } from '../shared/interfaces/database.interface.js';
4
+ import type { EmbeddingGenerator } from '../shared/interfaces/embedder.interface.js';
5
5
  import { type HydeGenerationMode } from './hyde.env.js';
6
6
  import { type HydeSourceFrame } from './hyde.frame.js';
7
7
  import type { HydeGenerateInput, HydeGeneratorOutput } from './hyde.generator.js';
@@ -36,7 +36,7 @@ export declare class HydeGraphFactory {
36
36
  constructor(database: HydeGraphDatabase, embedder: EmbeddingGenerator, cache: HydeCache, inferrer: HydeLensInferrerLike, generator: HydeGeneratorLike, options?: HydeGraphOptions);
37
37
  createGraph(): import("@langchain/langgraph").CompiledStateGraph<{
38
38
  sourceType: "intent" | "context" | "query";
39
- sourceId: import("../interfaces/database.interface.js").Id<"users"> | import("../interfaces/database.interface.js").Id<"intents"> | undefined;
39
+ sourceId: import("../shared/interfaces/database.interface.js").Id<"users"> | import("../shared/interfaces/database.interface.js").Id<"intents"> | undefined;
40
40
  sourceText: string;
41
41
  profileContext: string | undefined;
42
42
  maxLenses: number;
@@ -52,7 +52,7 @@ export declare class HydeGraphFactory {
52
52
  agentTimings: DebugMetaAgent[];
53
53
  }, {
54
54
  sourceType?: "intent" | "context" | "query" | undefined;
55
- sourceId?: import("../interfaces/database.interface.js").Id<"users"> | import("../interfaces/database.interface.js").Id<"intents"> | import("@langchain/langgraph").OverwriteValue<import("../interfaces/database.interface.js").Id<"users"> | import("../interfaces/database.interface.js").Id<"intents"> | undefined> | undefined;
55
+ sourceId?: import("../shared/interfaces/database.interface.js").Id<"users"> | import("../shared/interfaces/database.interface.js").Id<"intents"> | import("@langchain/langgraph").OverwriteValue<import("../shared/interfaces/database.interface.js").Id<"users"> | import("../shared/interfaces/database.interface.js").Id<"intents"> | undefined> | undefined;
56
56
  sourceText?: string | undefined;
57
57
  profileContext?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
58
58
  maxLenses?: number | import("@langchain/langgraph").OverwriteValue<number> | undefined;
@@ -72,7 +72,7 @@ export declare class HydeGraphFactory {
72
72
  (): import("@langchain/langgraph").LastValue<"intent" | "context" | "query">;
73
73
  Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
74
74
  };
75
- sourceId: import("@langchain/langgraph").BaseChannel<import("../interfaces/database.interface.js").Id<"users"> | import("../interfaces/database.interface.js").Id<"intents"> | undefined, import("../interfaces/database.interface.js").Id<"users"> | import("../interfaces/database.interface.js").Id<"intents"> | import("@langchain/langgraph").OverwriteValue<import("../interfaces/database.interface.js").Id<"users"> | import("../interfaces/database.interface.js").Id<"intents"> | undefined> | undefined, unknown>;
75
+ sourceId: import("@langchain/langgraph").BaseChannel<import("../shared/interfaces/database.interface.js").Id<"users"> | import("../shared/interfaces/database.interface.js").Id<"intents"> | undefined, import("../shared/interfaces/database.interface.js").Id<"users"> | import("../shared/interfaces/database.interface.js").Id<"intents"> | import("@langchain/langgraph").OverwriteValue<import("../shared/interfaces/database.interface.js").Id<"users"> | import("../shared/interfaces/database.interface.js").Id<"intents"> | undefined> | undefined, unknown>;
76
76
  sourceText: {
77
77
  (annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BaseChannel<string, string | import("@langchain/langgraph").OverwriteValue<string>, unknown>;
78
78
  (): import("@langchain/langgraph").LastValue<string>;
@@ -96,7 +96,7 @@ export declare class HydeGraphFactory {
96
96
  (): import("@langchain/langgraph").LastValue<"intent" | "context" | "query">;
97
97
  Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
98
98
  };
99
- sourceId: import("@langchain/langgraph").BaseChannel<import("../interfaces/database.interface.js").Id<"users"> | import("../interfaces/database.interface.js").Id<"intents"> | undefined, import("../interfaces/database.interface.js").Id<"users"> | import("../interfaces/database.interface.js").Id<"intents"> | import("@langchain/langgraph").OverwriteValue<import("../interfaces/database.interface.js").Id<"users"> | import("../interfaces/database.interface.js").Id<"intents"> | undefined> | undefined, unknown>;
99
+ sourceId: import("@langchain/langgraph").BaseChannel<import("../shared/interfaces/database.interface.js").Id<"users"> | import("../shared/interfaces/database.interface.js").Id<"intents"> | undefined, import("../shared/interfaces/database.interface.js").Id<"users"> | import("../shared/interfaces/database.interface.js").Id<"intents"> | import("@langchain/langgraph").OverwriteValue<import("../shared/interfaces/database.interface.js").Id<"users"> | import("../shared/interfaces/database.interface.js").Id<"intents"> | undefined> | undefined, unknown>;
100
100
  sourceText: {
101
101
  (annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BaseChannel<string, string | import("@langchain/langgraph").OverwriteValue<string>, unknown>;
102
102
  (): import("@langchain/langgraph").LastValue<string>;
@@ -6,10 +6,10 @@
6
6
  */
7
7
  import { createHash } from 'crypto';
8
8
  import { END, START, StateGraph } from '@langchain/langgraph';
9
- import { getAbortSignalConfig } from '../agent/model-signal.js';
10
- import { protocolLogger } from '../observability/protocol.logger.js';
11
- import { timed } from '../observability/performance.js';
12
- import { requestContext } from "../observability/request-context.js";
9
+ import { getAbortSignalConfig } from '../shared/agent/model-signal.js';
10
+ import { protocolLogger } from '../shared/observability/protocol.logger.js';
11
+ import { timed } from '../shared/observability/performance.js';
12
+ import { requestContext } from "../shared/observability/request-context.js";
13
13
  import { computeHydeSourceTextHash } from './hyde.documents.js';
14
14
  import { getHydeGenerationMode, HYDE_FRAME_GENERATION_VERSION } from './hyde.env.js';
15
15
  import { sanitizeHydeSourceFrame } from './hyde.frame.js';
@@ -2,10 +2,10 @@
2
2
  * HyDE Graph state: cache-aware hypothetical document generation.
3
3
  * Used by the HyDE graph for infer_lenses → check_cache → generate_missing → embed → cache_results.
4
4
  */
5
- import type { Id } from '../interfaces/database.interface.js';
5
+ import type { Id } from '../shared/interfaces/database.interface.js';
6
6
  import type { Lens, HydeTargetCorpus } from './lens.inferrer.js';
7
7
  import type { HydeSourceFrame } from './hyde.frame.js';
8
- import type { DebugMetaAgent } from '../../chat/chat-streaming.types.js';
8
+ import type { DebugMetaAgent } from '../agents/index.js';
9
9
  export type HydeDocumentOrigin = 'cache' | 'db' | 'generated';
10
10
  export type HydeValidationStatus = 'valid' | 'invalid' | 'failed_open';
11
11
  /** Single HyDE document (text + embedding) for one lens. */
@@ -1,7 +1,7 @@
1
1
  import { HumanMessage, SystemMessage } from '@langchain/core/messages';
2
2
  import { z } from 'zod';
3
- import { createStructuredModel } from '../agent/model.config.js';
4
- import { invokeWithAbortSignal } from '../agent/model-signal.js';
3
+ import { createStructuredModel } from '../shared/agent/model.config.js';
4
+ import { invokeWithAbortSignal } from '../shared/agent/model-signal.js';
5
5
  /** Structured-output schema for a single batch validation response. */
6
6
  export const HydeValidationResponseSchema = z.object({
7
7
  verdicts: z.array(z.object({
@@ -0,0 +1,26 @@
1
+ /**
2
+ * discovery — the capability's sole cross-capability surface.
3
+ *
4
+ * HyDE (Hypothetical Document Embeddings) is discovery machinery, not shared
5
+ * infrastructure: it owns a graph, a generator, a lens inferrer, and a
6
+ * validator. It lived under shared/ because two capabilities needed it, which
7
+ * made shared/ the default home for anything with more than one consumer.
8
+ *
9
+ * Anything outside this capability imports from here and nowhere else.
10
+ */
11
+ export { computeHydeSourceTextHash, selectHydeDocumentsForGeneration, } from "./hyde.documents.js";
12
+ export { HYDE_FRAME_GENERATION_VERSION, getHydeGenerationMode, } from "./hyde.env.js";
13
+ export type { HydeGenerationMode, } from "./hyde.env.js";
14
+ export { HYDE_HARD_CONSTRAINT_TYPES, HYDE_NAMED_ENTITY_TYPES, HydeSourceFrameSchema, } from "./hyde.frame.js";
15
+ export type { HydeFrameHardConstraint, HydeFrameNamedEntity, HydeFrameRole, HydeFrameVocabulary, HydeSourceFrame, } from "./hyde.frame.js";
16
+ export { HydeGenerator, } from "./hyde.generator.js";
17
+ export type { HydeGenerateInput, HydeGeneratorOutput, } from "./hyde.generator.js";
18
+ export { HydeGraphFactory, } from "./hyde.graph.js";
19
+ export type { HydeGeneratorLike, HydeGraphOptions, HydeLensInferrerLike, HydeValidatorLike, } from "./hyde.graph.js";
20
+ export { HydeGraphState, } from "./hyde.state.js";
21
+ export type { HydeDocumentOrigin, HydeDocumentState, HydeValidationStatus, } from "./hyde.state.js";
22
+ export { HYDE_CORPUS_PROMPTS, HYDE_DEFAULT_CACHE_TTL, } from "./hyde.strategies.js";
23
+ export { HydeValidationResponseSchema, HydeValidator, buildHydeValidationPrompt, } from "./hyde.validator.js";
24
+ export type { HydeValidationDocument, HydeValidationInput, HydeValidationOutput, HydeValidationVerdict, } from "./hyde.validator.js";
25
+ export { FRAME_SYSTEM_PROMPT, FrameResponseSchema, LensInferrer, } from "./lens.inferrer.js";
26
+ export type { HydeTargetCorpus, Lens, LensInferenceInput, LensInferenceOutput, } from "./lens.inferrer.js";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * discovery — the capability's sole cross-capability surface.
3
+ *
4
+ * HyDE (Hypothetical Document Embeddings) is discovery machinery, not shared
5
+ * infrastructure: it owns a graph, a generator, a lens inferrer, and a
6
+ * validator. It lived under shared/ because two capabilities needed it, which
7
+ * made shared/ the default home for anything with more than one consumer.
8
+ *
9
+ * Anything outside this capability imports from here and nowhere else.
10
+ */
11
+ export { computeHydeSourceTextHash, selectHydeDocumentsForGeneration, } from "./hyde.documents.js";
12
+ export { HYDE_FRAME_GENERATION_VERSION, getHydeGenerationMode, } from "./hyde.env.js";
13
+ export { HYDE_HARD_CONSTRAINT_TYPES, HYDE_NAMED_ENTITY_TYPES, HydeSourceFrameSchema, } from "./hyde.frame.js";
14
+ export { HydeGenerator, } from "./hyde.generator.js";
15
+ export { HydeGraphFactory, } from "./hyde.graph.js";
16
+ export { HydeGraphState, } from "./hyde.state.js";
17
+ export { HYDE_CORPUS_PROMPTS, HYDE_DEFAULT_CACHE_TTL, } from "./hyde.strategies.js";
18
+ export { HydeValidationResponseSchema, HydeValidator, buildHydeValidationPrompt, } from "./hyde.validator.js";
19
+ export { FRAME_SYSTEM_PROMPT, FrameResponseSchema, LensInferrer, } from "./lens.inferrer.js";
@@ -9,10 +9,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  };
10
10
  import { HumanMessage, SystemMessage } from '@langchain/core/messages';
11
11
  import { z } from 'zod';
12
- import { createStructuredModel } from "../agent/model.config.js";
13
- import { invokeWithAbortSignal } from "../agent/model-signal.js";
14
- import { protocolLogger } from '../observability/protocol.logger.js';
15
- import { Timed } from "../observability/performance.js";
12
+ import { createStructuredModel } from "../shared/agent/model.config.js";
13
+ import { invokeWithAbortSignal } from "../shared/agent/model-signal.js";
14
+ import { protocolLogger } from '../shared/observability/protocol.logger.js';
15
+ import { Timed } from "../shared/observability/performance.js";
16
16
  import { HydeSourceFrameSchema, sanitizeHydeSourceFrame } from './hyde.frame.js';
17
17
  const SYSTEM_PROMPT = `You analyze goals and search queries to identify the most relevant perspectives for finding matching people in a professional network.
18
18
 
package/dist/index.d.ts CHANGED
@@ -40,7 +40,7 @@ export { SIGNAL_PERSONA_ID, SIGNAL_PERSONA, SIGNAL_NEW_SIGNAL_KICKOFF, SIGNAL_TO
40
40
  export { REPORTER_PERSONA_ID, REPORTER_PERSONA, REPORTER_BRIEFING_KICKOFF, REPORTER_TOOL_NAMES, createReporterTools, filterReporterTools, narrowReporterTools, } from "./agents/index.js";
41
41
  export { ONBOARDING_PERSONA_ID, ONBOARDING_PERSONA, ONBOARDING_PROFILE_KICKOFF, ONBOARDING_TOOL_NAMES, createOnboardingTools, filterOnboardingTools, narrowOnboardingTools, } from "./agents/index.js";
42
42
  export { RadarGraphFactory } from "./opportunities/index.js";
43
- export { HydeGraphFactory } from "./contexts/index.js";
43
+ export { HydeGraphFactory } from "./discovery/index.js";
44
44
  export { NetworkGraphFactory } from "./networks/index.js";
45
45
  export { NetworkMembershipGraphFactory } from "./networks/index.js";
46
46
  export { IntentGraphFactory } from "./intents/index.js";
@@ -61,7 +61,7 @@ export { UserContextGenerator } from "./contexts/index.js";
61
61
  export { ChatTitleGenerator } from "./agents/index.js";
62
62
  export { ChatInterruptClassifier } from "./agents/index.js";
63
63
  export { ChatSummarizer } from "./agents/index.js";
64
- export { HydeGenerator } from "./contexts/index.js";
64
+ export { HydeGenerator } from "./discovery/index.js";
65
65
  export { SuggestionGenerator } from "./agents/index.js";
66
66
  export { generateInviteMessage } from "./contacts/index.js";
67
67
  export { IntentIndexer } from "./intents/index.js";
@@ -71,7 +71,7 @@ export type { IntakePack, IntakePackInput, IntakePackQuestion, IntakePackQuestio
71
71
  export { SignalIntakeOrchestrator, answerLabel, FALLBACK_WHO_QUESTION, FALLBACK_BRING_QUESTION, } from "./intents/index.js";
72
72
  export type { IntakeAnswer, IntakeRound, FollowUpPlan, FollowUpPlanInput, SynthesisInput, SynthesisResult, } from "./intents/index.js";
73
73
  export { normalizeIntentDescription } from "./intents/index.js";
74
- export { LensInferrer } from "./contexts/index.js";
74
+ export { LensInferrer } from "./discovery/index.js";
75
75
  export { NegotiationInsightsGenerator } from "./negotiations/index.js";
76
76
  export type { NegotiationDigest } from "./negotiations/index.js";
77
77
  export { IndexNegotiator } from "./negotiations/index.js";
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ export { SIGNAL_PERSONA_ID, SIGNAL_PERSONA, SIGNAL_NEW_SIGNAL_KICKOFF, SIGNAL_TO
35
35
  export { REPORTER_PERSONA_ID, REPORTER_PERSONA, REPORTER_BRIEFING_KICKOFF, REPORTER_TOOL_NAMES, createReporterTools, filterReporterTools, narrowReporterTools, } from "./agents/index.js";
36
36
  export { ONBOARDING_PERSONA_ID, ONBOARDING_PERSONA, ONBOARDING_PROFILE_KICKOFF, ONBOARDING_TOOL_NAMES, createOnboardingTools, filterOnboardingTools, narrowOnboardingTools, } from "./agents/index.js";
37
37
  export { RadarGraphFactory } from "./opportunities/index.js";
38
- export { HydeGraphFactory } from "./contexts/index.js";
38
+ export { HydeGraphFactory } from "./discovery/index.js";
39
39
  export { NetworkGraphFactory } from "./networks/index.js";
40
40
  export { NetworkMembershipGraphFactory } from "./networks/index.js";
41
41
  export { IntentGraphFactory } from "./intents/index.js";
@@ -53,14 +53,14 @@ export { UserContextGenerator } from "./contexts/index.js";
53
53
  export { ChatTitleGenerator } from "./agents/index.js";
54
54
  export { ChatInterruptClassifier } from "./agents/index.js";
55
55
  export { ChatSummarizer } from "./agents/index.js";
56
- export { HydeGenerator } from "./contexts/index.js";
56
+ export { HydeGenerator } from "./discovery/index.js";
57
57
  export { SuggestionGenerator } from "./agents/index.js";
58
58
  export { generateInviteMessage } from "./contacts/index.js";
59
59
  export { IntentIndexer } from "./intents/index.js";
60
60
  export { SignalIntakePackGenerator, normalizeIntakePack } from "./intents/index.js";
61
61
  export { SignalIntakeOrchestrator, answerLabel, FALLBACK_WHO_QUESTION, FALLBACK_BRING_QUESTION, } from "./intents/index.js";
62
62
  export { normalizeIntentDescription } from "./intents/index.js";
63
- export { LensInferrer } from "./contexts/index.js";
63
+ export { LensInferrer } from "./discovery/index.js";
64
64
  export { NegotiationInsightsGenerator } from "./negotiations/index.js";
65
65
  export { IndexNegotiator } from "./negotiations/index.js";
66
66
  export { NegotiationScreener } from "./negotiations/index.js";
@@ -1,6 +1,6 @@
1
1
  import type { Runnable } from "@langchain/core/runnables";
2
2
  import { z } from "zod";
3
- import type { Lens } from "../../shared/hyde/lens.inferrer.js";
3
+ import type { Lens } from "../../discovery/index.js";
4
4
  import type { OpportunityStatus } from "../../shared/interfaces/database.interface.js";
5
5
  import type { OpportunityEvidence } from '../../shared/schemas/network-assignment.schema.js';
6
6
  declare const OpportunitySchema: z.ZodObject<{
@@ -1153,7 +1153,7 @@ export declare class OpportunityGraphFactory {
1153
1153
  initialStatus: OpportunityStatus;
1154
1154
  negotiationContinuation?: import("../../shared/interfaces/database.interface.js").NegotiationContinuationExecution;
1155
1155
  limit?: number;
1156
- lenses?: import("../../shared/hyde/lens.inferrer.js").Lens[];
1156
+ lenses?: import("../../discovery/lens.inferrer.js").Lens[];
1157
1157
  hydeDescription?: string;
1158
1158
  existingOpportunities?: string;
1159
1159
  conversationId?: string;
@@ -1177,7 +1177,7 @@ export declare class OpportunityGraphFactory {
1177
1177
  initialStatus: OpportunityStatus;
1178
1178
  negotiationContinuation?: import("../../shared/interfaces/database.interface.js").NegotiationContinuationExecution;
1179
1179
  limit?: number;
1180
- lenses?: import("../../shared/hyde/lens.inferrer.js").Lens[];
1180
+ lenses?: import("../../discovery/lens.inferrer.js").Lens[];
1181
1181
  hydeDescription?: string;
1182
1182
  existingOpportunities?: string;
1183
1183
  conversationId?: string;
@@ -16,8 +16,8 @@ import { OpportunityGraphState } from '../domain/opportunity.state.js';
16
16
  import { OpportunityEvaluator } from './opportunity.evaluator.js';
17
17
  import { IntentIndexer } from '../../intents/index.js';
18
18
  import { getModelName } from '../../shared/agent/model.config.js';
19
- import { selectHydeDocumentsForGeneration } from '../../shared/hyde/hyde.documents.js';
20
- import { getHydeGenerationMode } from '../../shared/hyde/hyde.env.js';
19
+ import { selectHydeDocumentsForGeneration } from '../../discovery/index.js';
20
+ import { getHydeGenerationMode } from '../../discovery/index.js';
21
21
  import { validateOpportunityActors } from '../domain/opportunity.utils.js';
22
22
  import { safeFallbackSummary } from '../domain/opportunity.safe-presentation.js';
23
23
  import { hasUnsupportedOpportunityClaim } from '../../shared/utils/claim-safety.js';
@@ -5,7 +5,7 @@
5
5
  * With lens-based HyDE, strategy selection is handled automatically by the
6
6
  * LensInferrer agent. This file provides corpus-to-role mapping for opportunity actors.
7
7
  */
8
- import type { HydeTargetCorpus } from '../../shared/hyde/lens.inferrer.js';
8
+ import type { HydeTargetCorpus } from '../../discovery/index.js';
9
9
  /** Actor roles in the opportunity model (agent / patient / peer). */
10
10
  export type OpportunityActorRole = 'agent' | 'patient' | 'peer';
11
11
  /** Result of mapping a corpus to source and candidate roles. */
@@ -98,7 +98,7 @@ export declare class PremiseGraphFactory {
98
98
  message?: string;
99
99
  } | undefined> | undefined;
100
100
  agentTimings?: DebugMetaAgent[] | import("@langchain/langgraph").OverwriteValue<DebugMetaAgent[]> | undefined;
101
- }, "index" | "query" | "__start__" | "persist" | "embed" | "analyze" | "dedupe", {
101
+ }, "index" | "query" | "__start__" | "embed" | "persist" | "analyze" | "dedupe", {
102
102
  userId: {
103
103
  (annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BaseChannel<string, string | import("@langchain/langgraph").OverwriteValue<string>, unknown>;
104
104
  (): import("@langchain/langgraph").LastValue<string>;
@@ -2,9 +2,9 @@ import { tool } from "@langchain/core/tools";
2
2
  import { IntentGraphFactory } from "../../intents/application/intent.graph.js";
3
3
  import { EnrichmentGraphFactory } from "../../enrichment/enrichment.graph.js";
4
4
  import { OpportunityGraphFactory } from "../../opportunities/index.js";
5
- import { HydeGraphFactory } from "../hyde/hyde.graph.js";
6
- import { HydeGenerator } from "../hyde/hyde.generator.js";
7
- import { LensInferrer } from "../hyde/lens.inferrer.js";
5
+ import { HydeGraphFactory } from "../../discovery/hyde.graph.js";
6
+ import { HydeGenerator } from "../../discovery/hyde.generator.js";
7
+ import { LensInferrer } from "../../discovery/lens.inferrer.js";
8
8
  import { NetworkGraphFactory, NetworkMembershipGraphFactory, IntentNetworkGraphFactory } from "../../networks/index.js";
9
9
  import { IntentIndexer } from "../../intents/application/intent.indexer.js";
10
10
  import { NegotiationGraphFactory } from "../../negotiations/index.js";
@@ -1,4 +1,4 @@
1
- export type { Lens, HydeTargetCorpus } from '../hyde/lens.inferrer.js';
1
+ export type { Lens, HydeTargetCorpus } from '../../discovery/lens.inferrer.js';
2
2
  /** A single lens embedding ready for search. */
3
3
  export interface LensEmbedding {
4
4
  /** Free-text lens label (e.g. "crypto infrastructure VC"). */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indexnetwork/protocol",
3
- "version": "14.2.3-rc.474.1",
3
+ "version": "14.3.0-rc.475.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
File without changes
File without changes
File without changes
File without changes
File without changes