@indexnetwork/protocol 17.0.1-rc.480.1 → 19.0.0-rc.482.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +65 -0
- package/IMPLEMENTATION.md +46 -3
- package/STABILITY.md +5 -1
- package/dist/contacts/application/contact.tools.js +1 -3
- package/dist/contacts/domain/contact.types.d.ts +0 -2
- package/dist/contexts/application/index.d.ts +0 -1
- package/dist/contexts/application/index.js +0 -1
- package/dist/enrichment/enrichment.graph.js +1 -36
- package/dist/index.d.ts +2 -9
- package/dist/index.js +4 -6
- package/dist/intents/{application → graph}/intent.graph.d.ts +26 -26
- package/dist/intents/{application → graph}/intent.graph.execute.d.ts +1 -1
- package/dist/intents/{application → graph}/intent.graph.execute.js +1 -1
- package/dist/intents/{application → graph}/intent.graph.js +4 -4
- package/dist/intents/{application → graph}/intent.graph.reconcile.d.ts +2 -2
- package/dist/intents/{application → graph}/intent.graph.shared.d.ts +5 -5
- package/dist/intents/{application → graph}/intent.graph.shared.js +1 -1
- package/dist/intents/{domain/intent.state.d.ts → graph/intent.graph.state.d.ts} +3 -3
- package/dist/intents/{application/intent.clarifier.js → intent.clarifier.js} +5 -5
- package/dist/intents/{application/intent.indexer.js → intent.indexer.js} +4 -4
- package/dist/intents/{application/intent.inferrer.js → intent.inferrer.js} +4 -4
- package/dist/intents/intent.module.d.ts +633 -0
- package/dist/intents/intent.module.js +103 -0
- package/dist/intents/{domain/intent.proposal.d.ts → intent.proposal.d.ts} +2 -0
- package/dist/intents/{domain/intent.proposal.js → intent.proposal.js} +2 -0
- package/dist/intents/{application/intent.reconciler.js → intent.reconciler.js} +4 -4
- package/dist/intents/{application/intent.tools.d.ts → intent.tools.d.ts} +6 -3
- package/dist/intents/{application/intent.tools.js → intent.tools.js} +6 -7
- package/dist/intents/{application/intent.verifier.js → intent.verifier.js} +4 -4
- package/dist/networks/application/indexer.graph.d.ts +7 -7
- package/dist/networks/application/indexer.graph.js +2 -2
- package/dist/networks/ports/index.d.ts +4 -2
- package/dist/networks/ports/index.js +1 -5
- package/dist/opportunities/application/opportunity.graph.prep.js +3 -3
- package/dist/opportunities/application/opportunity.tools.cards.d.ts +1 -2
- package/dist/opportunities/application/opportunity.tools.cards.js +1 -2
- package/dist/opportunities/application/opportunity.tools.list.js +0 -4
- package/dist/opportunities/radar/radar.graph.js +0 -4
- package/dist/opportunities/radar/radar.state.d.ts +0 -2
- package/dist/shared/agent/tool.factory.js +10 -6
- package/dist/shared/agent/tool.helpers.d.ts +2 -2
- package/dist/shared/agent/tool.registry.js +2 -2
- package/dist/shared/agent/utility.tools.js +1 -2
- package/dist/shared/interfaces/database.capabilities.d.ts +2 -2
- package/dist/shared/interfaces/database.entities.d.ts +0 -3
- package/dist/shared/interfaces/database.identity-queries.d.ts +0 -28
- package/dist/shared/interfaces/database.member-queries.d.ts +0 -2
- package/package.json +1 -1
- package/dist/enrichment/enrichment.enricher.d.ts +0 -18
- package/dist/enrichment/enrichment.enricher.js +0 -30
- package/dist/intents/application/index.d.ts +0 -21
- package/dist/intents/application/index.js +0 -26
- package/dist/intents/domain/index.d.ts +0 -9
- package/dist/intents/domain/index.js +0 -11
- package/dist/intents/domain/signal.specificity.d.ts +0 -2
- package/dist/intents/domain/signal.specificity.js +0 -2
- package/dist/intents/index.d.ts +0 -18
- package/dist/intents/index.js +0 -14
- package/dist/intents/ports/index.d.ts +0 -15
- package/dist/intents/ports/index.js +0 -13
- package/dist/intents/ports/signals.tools.port.d.ts +0 -5
- package/dist/intents/ports/signals.tools.port.js +0 -1
- /package/dist/intents/{application → graph}/intent.graph.infer.d.ts +0 -0
- /package/dist/intents/{application → graph}/intent.graph.infer.js +0 -0
- /package/dist/intents/{application → graph}/intent.graph.reconcile.js +0 -0
- /package/dist/intents/{domain/intent.state.js → graph/intent.graph.state.js} +0 -0
- /package/dist/intents/{application → intake}/intake.orchestrator.d.ts +0 -0
- /package/dist/intents/{application → intake}/intake.orchestrator.js +0 -0
- /package/dist/intents/{application → intake}/intake.pack.generator.d.ts +0 -0
- /package/dist/intents/{application → intake}/intake.pack.generator.js +0 -0
- /package/dist/intents/{application/intent.clarifier.d.ts → intent.clarifier.d.ts} +0 -0
- /package/dist/intents/{application/intent.indexer.d.ts → intent.indexer.d.ts} +0 -0
- /package/dist/intents/{application/intent.inferrer.d.ts → intent.inferrer.d.ts} +0 -0
- /package/dist/intents/{application/intent.reconciler.d.ts → intent.reconciler.d.ts} +0 -0
- /package/dist/intents/{application/intent.verifier.d.ts → intent.verifier.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -20,6 +20,71 @@ 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
|
+
## 19.0.0 - 2026-08-17
|
|
24
|
+
|
|
25
|
+
### Removed
|
|
26
|
+
|
|
27
|
+
- **BREAKING**: Retire ghost users. `softDeleteGhost`, `mergeGhostUser` and
|
|
28
|
+
`findDuplicateUser` are gone from the database port, along with `isGhost` on
|
|
29
|
+
every entity, contact payload, member row and opportunity card.
|
|
30
|
+
- **BREAKING**: Remove `shouldEnrichGhostDisplayNameFromParallel` and
|
|
31
|
+
`isEnrichedNameMeaningful` (and the `enrichment.enricher` module). Both were
|
|
32
|
+
ghost-only: the first returned `false` for every real account.
|
|
33
|
+
- **BREAKING**: `buildMinimalOpportunityCard` loses its trailing
|
|
34
|
+
`isCounterpartGhost` parameter and the `isGhost` field on its result. The
|
|
35
|
+
primary action label was never derived from it — it reads `viewerRole` alone —
|
|
36
|
+
so labels are unchanged.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
|
|
40
|
+
- The enrichment graph no longer soft-deletes or merges on the ghost paths. A
|
|
41
|
+
non-human enrichment result still aborts with `"Non-human entity detected"`;
|
|
42
|
+
it previously also called `softDeleteGhost`, which the host implemented as a
|
|
43
|
+
no-op for any non-ghost, so behaviour for real accounts is identical.
|
|
44
|
+
- Low-confidence and failed enrichment now always fall through to basic info.
|
|
45
|
+
That was already the real-account path; only the ghost early-return is gone.
|
|
46
|
+
|
|
47
|
+
## 18.0.0 - 2026-08-17
|
|
48
|
+
|
|
49
|
+
### Changed
|
|
50
|
+
|
|
51
|
+
- **BREAKING**: The `intents` capability now ships as a single class. `Intents`
|
|
52
|
+
replaces `IntentGraphFactory`, `SemanticVerifier`, `IntentIndexer`,
|
|
53
|
+
`SignalIntakePackGenerator`, `SignalIntakeOrchestrator`,
|
|
54
|
+
`normalizeIntentDescription`, and `FALLBACK_WHO_QUESTION`, all of which are
|
|
55
|
+
no longer exported. Dependencies move from positional constructor arguments
|
|
56
|
+
to a named `IntentsDeps` bag, and every field is optional — a host that wants
|
|
57
|
+
only the model-backed helpers can call `new Intents()`.
|
|
58
|
+
|
|
59
|
+
| Removed | Replacement |
|
|
60
|
+
|---|---|
|
|
61
|
+
| `new IntentGraphFactory(db, embedder, queue, enqueue).createGraph()` | `new Intents({ database, embedder, queue, questionerEnqueue }).createGraph()` |
|
|
62
|
+
| `new SemanticVerifier().invoke(content, context)` | `new Intents().verifyIntent(content, context)` |
|
|
63
|
+
| `new IntentIndexer().invoke(...)` / `.evaluate(...)` | `new Intents().indexIntent(...)` |
|
|
64
|
+
| `new SignalIntakePackGenerator().generate(input)` | `new Intents().generateIntakePack(input)` |
|
|
65
|
+
| `new SignalIntakeOrchestrator().generateFollowUps(input)` | `new Intents().generateIntakeFollowUps(input)` |
|
|
66
|
+
| `new SignalIntakeOrchestrator().synthesize(input)` | `new Intents().synthesizeIntake(input)` |
|
|
67
|
+
| `normalizeIntentDescription(text)` | `Intents.normalizeDescription(text)` |
|
|
68
|
+
| `FALLBACK_WHO_QUESTION` | `Intents.FALLBACK_INTAKE_QUESTION` |
|
|
69
|
+
|
|
70
|
+
Collaborators are constructed on first use rather than in the constructor, so
|
|
71
|
+
an unused method costs nothing. `new Intents()` no longer touches the model
|
|
72
|
+
provider at all — code that relied on construction failing without
|
|
73
|
+
`OPENROUTER_API_KEY` now fails on the first call instead.
|
|
74
|
+
|
|
75
|
+
- **BREAKING**: `IntentNetworkGraphFactory`'s second argument is now an
|
|
76
|
+
`Intents` instance (anything with `indexIntent`) rather than an
|
|
77
|
+
`IntentIndexer`. Pass the same instance used for the intent graph.
|
|
78
|
+
|
|
79
|
+
- Reorganize `src/intents/` by function rather than by layer, with
|
|
80
|
+
`intent.module.ts` as the capability barrel in place of `index.ts`. Files are
|
|
81
|
+
named for what they do and sit flat (`intent.inferrer`, `intent.verifier`,
|
|
82
|
+
`intent.indexer`, …); only `graph/` and `intake/` — the two multi-file stages
|
|
83
|
+
— keep a directory. The layout is private; only `Intents` crosses the
|
|
84
|
+
boundary.
|
|
85
|
+
`IntentIndexerOutput`, `IntakePack*`, `Intake{Answer,Round}`, `FollowUpPlan*`,
|
|
86
|
+
`Synthesis*`, `IntentToolDeps`, and `IntentsDeps` remain exported as types.
|
|
87
|
+
|
|
23
88
|
## 17.0.1 - 2026-08-17
|
|
24
89
|
|
|
25
90
|
### Removed
|
package/IMPLEMENTATION.md
CHANGED
|
@@ -20,7 +20,10 @@ and [CHANGELOG.md](./CHANGELOG.md) for release history.
|
|
|
20
20
|
|
|
21
21
|
Internal source is domain-first: `signals`, `communities`, `questions`,
|
|
22
22
|
`participant-agents`, `contacts`, and `integrations`; opportunity and negotiation
|
|
23
|
-
place state/contracts in `domain/` and workflows/tools in `application/`.
|
|
23
|
+
place state/contracts in `domain/` and workflows/tools in `application/`. The
|
|
24
|
+
`intents` capability is instead organized by function behind a single exported
|
|
25
|
+
class, `Intents`: files sit flat and named for what they do, with `graph/` and
|
|
26
|
+
`intake/` the two multi-file stages that keep a directory.
|
|
24
27
|
|
|
25
28
|
|
|
26
29
|
## Install
|
|
@@ -140,7 +143,6 @@ For direct graph invocation (bypassing the tool layer), a `*GraphFactory` class
|
|
|
140
143
|
```typescript
|
|
141
144
|
import {
|
|
142
145
|
ChatGraphFactory,
|
|
143
|
-
IntentGraphFactory,
|
|
144
146
|
OpportunityGraphFactory,
|
|
145
147
|
EnrichmentGraphFactory,
|
|
146
148
|
PremiseGraphFactory,
|
|
@@ -157,10 +159,12 @@ import {
|
|
|
157
159
|
Each factory takes its typed dependencies in the constructor and exposes a
|
|
158
160
|
`.createGraph()` method that returns a compiled LangGraph ready for `.invoke()`.
|
|
159
161
|
|
|
162
|
+
The intent lifecycle graph is the exception: it is reached through the `Intents`
|
|
163
|
+
module rather than a factory of its own (see [Intents](#intents) below).
|
|
164
|
+
|
|
160
165
|
| Factory | Workflow |
|
|
161
166
|
|---|---|
|
|
162
167
|
| `ChatGraphFactory` | ReAct chat loop — LLM calls tools, responds to the user |
|
|
163
|
-
| `IntentGraphFactory` | Clarify, infer, verify felicity, reconcile, and persist intents |
|
|
164
168
|
| `OpportunityGraphFactory` | Background matching: search, evaluate (valency), rank, persist |
|
|
165
169
|
| `EnrichmentGraphFactory` | Enrich users (scrape + embed) and decompose into premises |
|
|
166
170
|
| `PremiseGraphFactory` | Decompose and index a user's premises |
|
|
@@ -176,6 +180,45 @@ Each factory takes its typed dependencies in the constructor and exposes a
|
|
|
176
180
|
|
|
177
181
|
`ChatGraphFactory.withPersona()` keeps the runtime neutral while selecting an exported persona configuration. `SIGNAL_PERSONA`, `REPORTER_PERSONA`, and `ONBOARDING_PERSONA` each own an exact positive tool allowlist; shared tools added later remain unavailable until reviewed. `ONBOARDING_PERSONA` reuses Signal's proposal-only, live-membership-narrowed `create_intent` contract and otherwise exposes only privacy consent, approved self-context preview/confirmation, guided questions, and validated completion. Hosts must persist the exported persona ID on session creation and treat it as authoritative on follow-ups.
|
|
178
182
|
|
|
183
|
+
## Intents
|
|
184
|
+
|
|
185
|
+
Signals are the protocol's base unit, and the whole capability ships as one
|
|
186
|
+
class. `Intents` covers the lifecycle graph, semantic verification, network
|
|
187
|
+
indexing, the guided intake interview, and the agent-facing intent tools.
|
|
188
|
+
|
|
189
|
+
```typescript
|
|
190
|
+
import { Intents } from "@indexnetwork/protocol";
|
|
191
|
+
|
|
192
|
+
const intents = new Intents({
|
|
193
|
+
database, // IntentGraphDatabase — required only by createGraph()
|
|
194
|
+
embedder, // EmbeddingGenerator
|
|
195
|
+
queue, // IntentGraphQueue
|
|
196
|
+
questionerEnqueue, // QuestionerEnqueueFn
|
|
197
|
+
});
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Every dependency is optional, so a host that only wants the model-backed
|
|
201
|
+
helpers can construct `new Intents()` with nothing. Collaborators are built on
|
|
202
|
+
first use, so an unused method costs nothing.
|
|
203
|
+
|
|
204
|
+
| Method | Purpose |
|
|
205
|
+
|---|---|
|
|
206
|
+
| `createGraph()` | Compile the lifecycle graph — prep, infer, verify, reconcile, execute. Requires `database` |
|
|
207
|
+
| `verifyIntent(content, profileContext)` | Felicity conditions, speech-act classification, semantic entropy, specificity |
|
|
208
|
+
| `indexIntent(intent, indexPrompt, memberPrompt, sourceName?, networkContext?)` | Score one signal against one network; `null` when the model call fails |
|
|
209
|
+
| `generateIntakePack(input)` | The participant's intake brief and round-1 question |
|
|
210
|
+
| `generateIntakeFollowUps(input)` | Plan and write the next follow-up questions |
|
|
211
|
+
| `synthesizeIntake(input)` | Turn answered rounds into a description and card summary |
|
|
212
|
+
| `Intents.createTools(defineTool, deps)` | Register the agent-facing intent tools |
|
|
213
|
+
| `Intents.normalizeDescription(description)` | Normalize a description to its persisted form |
|
|
214
|
+
| `Intents.FALLBACK_INTAKE_QUESTION` | The static round-1 question used when generation is unavailable |
|
|
215
|
+
|
|
216
|
+
`IntentNetworkGraphFactory` takes an `Intents` instance as its evaluator:
|
|
217
|
+
|
|
218
|
+
```typescript
|
|
219
|
+
const intentNetworkGraph = new IntentNetworkGraphFactory(database, intents).createGraph();
|
|
220
|
+
```
|
|
221
|
+
|
|
179
222
|
## MCP server
|
|
180
223
|
|
|
181
224
|
The package exports a factory that registers every chat tool over the Model Context Protocol and attaches a canonical `instructions` block (`MCP_INSTRUCTIONS`) that every connecting runtime follows. The factory takes three arguments:
|
package/STABILITY.md
CHANGED
|
@@ -18,7 +18,10 @@ change. It is the reference behind the tier annotations in `src/index.ts`.
|
|
|
18
18
|
`src/index.ts` diff, and that is what triggers the major bump below.
|
|
19
19
|
- Root exports are assembled through named capability facades. Those facades are
|
|
20
20
|
implementation seams, not package subpath entry points: consumers must still
|
|
21
|
-
import only from `@indexnetwork/protocol`.
|
|
21
|
+
import only from `@indexnetwork/protocol`. A capability may state that facade
|
|
22
|
+
as a class rather than a re-export list — `intents` does, via `Intents` in
|
|
23
|
+
`intents/intent.module.ts` — which makes the whole capability one exported
|
|
24
|
+
symbol and its internal layout free to change without a contract change.
|
|
22
25
|
|
|
23
26
|
## Stability tiers
|
|
24
27
|
|
|
@@ -34,6 +37,7 @@ Covered by SemVer below. Breaking changes require a **major** bump.
|
|
|
34
37
|
| **Interfaces** | Every `*.interface.ts` port you implement to inject infrastructure (databases, embedder, cache, scraper, queues, integration, agent dispatcher, …). |
|
|
35
38
|
| **Shared schemas** | Zod schemas + inferred types that cross the boundary (questions, identity, network-assignment, chat-context, …). |
|
|
36
39
|
| **Graph factories** | `*GraphFactory` classes (`ChatGraphFactory`, `OpportunityGraphFactory`, `NegotiationGraphFactory`, …). |
|
|
40
|
+
| **Intents** | `Intents` — the whole signal capability as one class (lifecycle graph, verification, network indexing, guided intake, tools) plus `IntentsDeps` and the intake/indexer types. Replaced the six separate intent exports in 18.0.0. |
|
|
37
41
|
| **Agents** | Structured LLM agents (`UserContextGenerator`, `IndexNegotiator`, `OpportunityEvaluator`, …). |
|
|
38
42
|
| **MCP** | `createMcpServer` plus the types needed to call it: `ScopedDepsFactory`, `McpCapabilityPolicyOptions`, `CANONICAL_MCP_CAPABILITY_POLICY_OPTIONS`, `McpAuthorizationObserver`, `McpAuthorizationDenialEvent`. The rest of `mcp.authorization-policy.ts` is package-internal as of 15.0.0. |
|
|
39
43
|
| **Capability tools** | `createEnrichmentTools` only. The other per-capability tool factories became package-internal in 15.0.0 — compose them through `createMcpServer` or `createToolRegistry`. |
|
|
@@ -43,7 +43,6 @@ export function createContactTools(defineTool, deps) {
|
|
|
43
43
|
name: c.user.name,
|
|
44
44
|
email: c.user.email,
|
|
45
45
|
avatar: c.user.avatar,
|
|
46
|
-
isGhost: c.user.isGhost,
|
|
47
46
|
})),
|
|
48
47
|
});
|
|
49
48
|
}
|
|
@@ -81,7 +80,7 @@ export function createContactTools(defineTool, deps) {
|
|
|
81
80
|
"Use when the user refers to a contact by partial name or email and you need their userId for another tool " +
|
|
82
81
|
"(e.g. read_user_contexts).\n\n" +
|
|
83
82
|
"**When to use:** Before list_contacts when the network is large — returns only matching contacts, bounded by limit.\n\n" +
|
|
84
|
-
"**Returns:** Array of matching contacts: userId, name, email, avatar
|
|
83
|
+
"**Returns:** Array of matching contacts: userId, name, email, avatar.",
|
|
85
84
|
querySchema: z.object({
|
|
86
85
|
query: z.string().trim().min(1).describe('Free-text query matched against contact name and email (case-insensitive, substring).'),
|
|
87
86
|
limit: z.number().int().positive().max(100).optional().describe('Maximum rows to return. Defaults to 25.'),
|
|
@@ -96,7 +95,6 @@ export function createContactTools(defineTool, deps) {
|
|
|
96
95
|
name: r.name,
|
|
97
96
|
email: r.email,
|
|
98
97
|
avatar: r.avatar,
|
|
99
|
-
isGhost: r.isGhost,
|
|
100
98
|
})),
|
|
101
99
|
});
|
|
102
100
|
}
|
|
@@ -13,7 +13,6 @@ export interface ContactEntry {
|
|
|
13
13
|
name: string;
|
|
14
14
|
email: string;
|
|
15
15
|
avatar: string | null;
|
|
16
|
-
isGhost: boolean;
|
|
17
16
|
};
|
|
18
17
|
}
|
|
19
18
|
/** Flat contact row returned by searchContacts. */
|
|
@@ -22,5 +21,4 @@ export interface ContactSearchResult {
|
|
|
22
21
|
name: string;
|
|
23
22
|
email: string;
|
|
24
23
|
avatar: string | null;
|
|
25
|
-
isGhost: boolean;
|
|
26
24
|
}
|
|
@@ -59,7 +59,6 @@ export { PremiseAnalyzer, type PremiseAnalyzerOutput, } from "../../premises/pre
|
|
|
59
59
|
export { PremiseIndexer, type PremiseIndexerOutput, } from "../../premises/premise.indexer.js";
|
|
60
60
|
export { EnrichmentGraphFactory, type CompiledPremiseGraph, } from "../../enrichment/enrichment.graph.js";
|
|
61
61
|
export { EnrichmentGenerator, type GeneratedProfile } from "../../enrichment/enrichment.generator.js";
|
|
62
|
-
export { shouldEnrichGhostDisplayNameFromParallel, isEnrichedNameMeaningful, } from "../../enrichment/enrichment.enricher.js";
|
|
63
62
|
export { createEnrichmentTools } from "../../enrichment/enrichment.tools.js";
|
|
64
63
|
export { createPremiseTools } from "../../premises/premise.tools.js";
|
|
65
64
|
export { UserContextGenerator } from "../../contexts/context.generator.js";
|
|
@@ -62,7 +62,6 @@ export { PremiseIndexer, } from "../../premises/premise.indexer.js";
|
|
|
62
62
|
// ── Enrichment graph + service classes ───────────────────────────────────────
|
|
63
63
|
export { EnrichmentGraphFactory, } from "../../enrichment/enrichment.graph.js";
|
|
64
64
|
export { EnrichmentGenerator } from "../../enrichment/enrichment.generator.js";
|
|
65
|
-
export { shouldEnrichGhostDisplayNameFromParallel, isEnrichedNameMeaningful, } from "../../enrichment/enrichment.enricher.js";
|
|
66
65
|
// ── Tool factories (foreground adapters) ──────────────────────────────────────
|
|
67
66
|
// These are foreground adapter entry points consumed by the tool composition root (shared/agent)
|
|
68
67
|
// composition. They accept compiled graphs and host deps through the tool-dep
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { StateGraph, START, END } from "@langchain/langgraph";
|
|
2
2
|
import { EnrichmentGraphState } from "./enrichment.state.js";
|
|
3
|
-
import { shouldEnrichGhostDisplayNameFromParallel, isEnrichedNameMeaningful } from "./enrichment.enricher.js";
|
|
4
3
|
import { socialsToEnrichmentRequest } from "../shared/utils/social-label.js";
|
|
5
4
|
import { protocolLogger } from "../shared/observability/protocol.logger.js";
|
|
6
5
|
import { timed } from "../shared/observability/performance.js";
|
|
@@ -376,8 +375,7 @@ export async function autoGenerateNode(state, deps) {
|
|
|
376
375
|
try {
|
|
377
376
|
const enrichment = await deps.enricher.enrichUserProfile(request);
|
|
378
377
|
if (enrichment && !enrichment.isHuman) {
|
|
379
|
-
logger.info("Enrichment detected non-human entity,
|
|
380
|
-
await deps.database.softDeleteGhost(state.userId);
|
|
378
|
+
logger.info("Enrichment detected non-human entity, aborting", { userId: state.userId });
|
|
381
379
|
return { error: "Non-human entity detected" };
|
|
382
380
|
}
|
|
383
381
|
const hasMeaningfulEnrichment = !!enrichment &&
|
|
@@ -387,11 +385,6 @@ export async function autoGenerateNode(state, deps) {
|
|
|
387
385
|
enrichment.attributes.skills.length > 0 ||
|
|
388
386
|
enrichment.attributes.interests.length > 0);
|
|
389
387
|
if (hasMeaningfulEnrichment) {
|
|
390
|
-
if (user.isGhost && !isEnrichedNameMeaningful(user.email || '', enrichment.identity.name || '')) {
|
|
391
|
-
logger.info("Enrichment has content but no real name for ghost, soft-deleting", { userId: state.userId });
|
|
392
|
-
await deps.database.softDeleteGhost(state.userId);
|
|
393
|
-
return { error: "No real name found for ghost user" };
|
|
394
|
-
}
|
|
395
388
|
logger.verbose("Chat API enrichment succeeded", {
|
|
396
389
|
userId: state.userId,
|
|
397
390
|
skillsCount: enrichment.attributes.skills.length,
|
|
@@ -399,11 +392,6 @@ export async function autoGenerateNode(state, deps) {
|
|
|
399
392
|
});
|
|
400
393
|
// Update user record with enriched data
|
|
401
394
|
const updatePayload = {};
|
|
402
|
-
const enrichedName = enrichment.identity.name?.trim();
|
|
403
|
-
if (enrichedName &&
|
|
404
|
-
shouldEnrichGhostDisplayNameFromParallel({ isGhost: !!user.isGhost, name: user.name ?? '', email: user.email ?? '' }, enrichedName)) {
|
|
405
|
-
updatePayload.name = enrichedName;
|
|
406
|
-
}
|
|
407
395
|
if (enrichment.identity.bio?.trim())
|
|
408
396
|
updatePayload.intro = enrichment.identity.bio.trim();
|
|
409
397
|
if (enrichment.identity.location?.trim())
|
|
@@ -435,19 +423,6 @@ export async function autoGenerateNode(state, deps) {
|
|
|
435
423
|
if (Object.keys(updatePayload).length > 0) {
|
|
436
424
|
await deps.database.updateUser(state.userId, updatePayload);
|
|
437
425
|
}
|
|
438
|
-
// Post-enrichment dedup: check if this ghost matches an existing user
|
|
439
|
-
if (user.isGhost) {
|
|
440
|
-
const currentSocials = await deps.database.getUserSocials(state.userId);
|
|
441
|
-
const duplicate = await deps.database.findDuplicateUser(state.userId, currentSocials);
|
|
442
|
-
if (duplicate) {
|
|
443
|
-
logger.info("Post-enrichment dedup: merging ghost into existing user", {
|
|
444
|
-
ghostId: state.userId,
|
|
445
|
-
targetId: duplicate.id,
|
|
446
|
-
});
|
|
447
|
-
await deps.database.mergeGhostUser(state.userId, duplicate.id);
|
|
448
|
-
return { error: `Merged as duplicate of user ${duplicate.id}` };
|
|
449
|
-
}
|
|
450
|
-
}
|
|
451
426
|
// Build a text blob from the enrichment result so it flows
|
|
452
427
|
// through premise decomposition (when available) rather than
|
|
453
428
|
// bypassing premises via prePopulatedProfile.
|
|
@@ -468,19 +443,9 @@ export async function autoGenerateNode(state, deps) {
|
|
|
468
443
|
operationsPerformed: { scraped: true },
|
|
469
444
|
};
|
|
470
445
|
}
|
|
471
|
-
if (user.isGhost) {
|
|
472
|
-
logger.info("Low-confidence enrichment for ghost, soft-deleting", { userId: state.userId });
|
|
473
|
-
await deps.database.softDeleteGhost(state.userId);
|
|
474
|
-
return { error: "Enrichment not confident for ghost user" };
|
|
475
|
-
}
|
|
476
446
|
logger.warn("Chat API returned low-signal enrichment, falling back to basic info", { userId: state.userId });
|
|
477
447
|
}
|
|
478
448
|
catch (enrichErr) {
|
|
479
|
-
if (user.isGhost) {
|
|
480
|
-
logger.info("Enrichment failed for ghost, soft-deleting", { userId: state.userId });
|
|
481
|
-
await deps.database.softDeleteGhost(state.userId);
|
|
482
|
-
return { error: "Enrichment failed for ghost user" };
|
|
483
|
-
}
|
|
484
449
|
logger.warn("Chat API enrichment failed, falling back to basic info", {
|
|
485
450
|
userId: state.userId,
|
|
486
451
|
error: enrichErr instanceof Error ? enrichErr.message : String(enrichErr),
|
package/dist/index.d.ts
CHANGED
|
@@ -41,9 +41,9 @@ export { RadarGraphFactory } from "./opportunities/index.js";
|
|
|
41
41
|
export { HydeGraphFactory } from "./discovery/index.js";
|
|
42
42
|
export { NetworkGraphFactory } from "./networks/index.js";
|
|
43
43
|
export { NetworkMembershipGraphFactory } from "./networks/index.js";
|
|
44
|
-
export { IntentGraphFactory } from "./intents/index.js";
|
|
45
|
-
export { SemanticVerifier } from "./intents/index.js";
|
|
46
44
|
export { IntentNetworkGraphFactory } from "./networks/index.js";
|
|
45
|
+
export { Intents } from "./intents/intent.module.js";
|
|
46
|
+
export type { FollowUpPlan, FollowUpPlanInput, IntakeAnswer, IntakePack, IntakePackInput, IntakePackQuestion, IntakePackQuestionOption, IntakeRound, IntentIndexerOutput, IntentsDeps, IntentToolDeps, SynthesisInput, SynthesisResult, } from "./intents/intent.module.js";
|
|
47
47
|
export { MaintenanceGraphFactory } from "./maintenance/maintenance.graph.js";
|
|
48
48
|
export type { MaintenanceGraphDatabase, MaintenanceGraphCache, MaintenanceGraphQueue } from "./maintenance/maintenance.graph.js";
|
|
49
49
|
export { NegotiationGraphFactory, negotiateCandidates } from "./negotiations/index.js";
|
|
@@ -60,13 +60,6 @@ export { ChatInterruptClassifier } from "./agents/index.js";
|
|
|
60
60
|
export { ChatSummarizer } from "./agents/index.js";
|
|
61
61
|
export { HydeGenerator } from "./discovery/index.js";
|
|
62
62
|
export { SuggestionGenerator } from "./agents/index.js";
|
|
63
|
-
export { IntentIndexer } from "./intents/index.js";
|
|
64
|
-
export type { IntentIndexerOutput } from "./intents/index.js";
|
|
65
|
-
export { SignalIntakePackGenerator } from "./intents/index.js";
|
|
66
|
-
export type { IntakePackQuestion } from "./intents/index.js";
|
|
67
|
-
export { SignalIntakeOrchestrator, FALLBACK_WHO_QUESTION, } from "./intents/index.js";
|
|
68
|
-
export type { IntakeAnswer, IntakeRound, } from "./intents/index.js";
|
|
69
|
-
export { normalizeIntentDescription } from "./intents/index.js";
|
|
70
63
|
export { LensInferrer } from "./discovery/index.js";
|
|
71
64
|
export { NegotiationInsightsGenerator } from "./negotiations/index.js";
|
|
72
65
|
export type { NegotiationDigest } from "./negotiations/index.js";
|
package/dist/index.js
CHANGED
|
@@ -37,9 +37,11 @@ export { RadarGraphFactory } from "./opportunities/index.js";
|
|
|
37
37
|
export { HydeGraphFactory } from "./discovery/index.js";
|
|
38
38
|
export { NetworkGraphFactory } from "./networks/index.js";
|
|
39
39
|
export { NetworkMembershipGraphFactory } from "./networks/index.js";
|
|
40
|
-
export { IntentGraphFactory } from "./intents/index.js";
|
|
41
|
-
export { SemanticVerifier } from "./intents/index.js";
|
|
42
40
|
export { IntentNetworkGraphFactory } from "./networks/index.js";
|
|
41
|
+
// ─── Intents ──────────────────────────────────────────────────────────────────
|
|
42
|
+
// The whole capability behind one class: lifecycle graph, verification,
|
|
43
|
+
// network indexing, guided intake, and the agent-facing tools.
|
|
44
|
+
export { Intents } from "./intents/intent.module.js";
|
|
43
45
|
export { MaintenanceGraphFactory } from "./maintenance/maintenance.graph.js";
|
|
44
46
|
export { NegotiationGraphFactory, negotiateCandidates } from "./negotiations/index.js";
|
|
45
47
|
export { OpportunityGraphFactory } from "./opportunities/index.js";
|
|
@@ -54,10 +56,6 @@ export { ChatInterruptClassifier } from "./agents/index.js";
|
|
|
54
56
|
export { ChatSummarizer } from "./agents/index.js";
|
|
55
57
|
export { HydeGenerator } from "./discovery/index.js";
|
|
56
58
|
export { SuggestionGenerator } from "./agents/index.js";
|
|
57
|
-
export { IntentIndexer } from "./intents/index.js";
|
|
58
|
-
export { SignalIntakePackGenerator } from "./intents/index.js";
|
|
59
|
-
export { SignalIntakeOrchestrator, FALLBACK_WHO_QUESTION, } from "./intents/index.js";
|
|
60
|
-
export { normalizeIntentDescription } from "./intents/index.js";
|
|
61
59
|
export { LensInferrer } from "./discovery/index.js";
|
|
62
60
|
export { NegotiationInsightsGenerator } from "./negotiations/index.js";
|
|
63
61
|
export { IndexNegotiator } from "./negotiations/index.js";
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* state and an explicit {@link IntentGraphDeps}. This file composes the
|
|
6
6
|
* dependency bag and wires the edges — nothing else.
|
|
7
7
|
*/
|
|
8
|
-
import { ExplicitIntentInferrer } from "
|
|
9
|
-
import { SemanticVerifier } from "
|
|
10
|
-
import { IntentReconciler } from "
|
|
8
|
+
import { ExplicitIntentInferrer } from "../intent.inferrer.js";
|
|
9
|
+
import { SemanticVerifier } from "../intent.verifier.js";
|
|
10
|
+
import { IntentReconciler } from "../intent.reconciler.js";
|
|
11
11
|
import type { IntentGraphDatabase } from "../../shared/interfaces/database.interface.js";
|
|
12
12
|
import type { EmbeddingGenerator } from "../../shared/interfaces/embedder.interface.js";
|
|
13
13
|
import type { IntentGraphQueue } from "../../shared/interfaces/queue.interface.js";
|
|
@@ -42,10 +42,10 @@ export declare class IntentGraphFactory {
|
|
|
42
42
|
confidence: "low" | "medium" | "high";
|
|
43
43
|
description: string;
|
|
44
44
|
}[];
|
|
45
|
-
verifiedIntents: import("
|
|
46
|
-
validationFailures: import("
|
|
47
|
-
actions: import("
|
|
48
|
-
executionResults: import("
|
|
45
|
+
verifiedIntents: import("./intent.graph.state.js").VerifiedIntent[];
|
|
46
|
+
validationFailures: import("./intent.graph.state.js").IntentValidationFailure[];
|
|
47
|
+
actions: import("../intent.reconciler.js").NormalizedIntentAction[];
|
|
48
|
+
executionResults: import("./intent.graph.state.js").ExecutionResult[];
|
|
49
49
|
error: string | undefined;
|
|
50
50
|
trace: {
|
|
51
51
|
node: string;
|
|
@@ -93,10 +93,10 @@ export declare class IntentGraphFactory {
|
|
|
93
93
|
confidence: "low" | "medium" | "high";
|
|
94
94
|
description: string;
|
|
95
95
|
}[]> | undefined;
|
|
96
|
-
verifiedIntents?: import("
|
|
97
|
-
validationFailures?: import("
|
|
98
|
-
actions?: import("
|
|
99
|
-
executionResults?: import("
|
|
96
|
+
verifiedIntents?: import("./intent.graph.state.js").VerifiedIntent[] | import("@langchain/langgraph").OverwriteValue<import("./intent.graph.state.js").VerifiedIntent[]> | undefined;
|
|
97
|
+
validationFailures?: import("./intent.graph.state.js").IntentValidationFailure[] | import("@langchain/langgraph").OverwriteValue<import("./intent.graph.state.js").IntentValidationFailure[]> | undefined;
|
|
98
|
+
actions?: import("../intent.reconciler.js").NormalizedIntentAction[] | import("@langchain/langgraph").OverwriteValue<import("../intent.reconciler.js").NormalizedIntentAction[]> | undefined;
|
|
99
|
+
executionResults?: import("./intent.graph.state.js").ExecutionResult[] | import("@langchain/langgraph").OverwriteValue<import("./intent.graph.state.js").ExecutionResult[]> | undefined;
|
|
100
100
|
error?: string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined;
|
|
101
101
|
trace?: {
|
|
102
102
|
node: string;
|
|
@@ -177,10 +177,10 @@ export declare class IntentGraphFactory {
|
|
|
177
177
|
confidence: "low" | "medium" | "high";
|
|
178
178
|
description: string;
|
|
179
179
|
}[]>, unknown>;
|
|
180
|
-
verifiedIntents: import("@langchain/langgraph").BaseChannel<import("
|
|
181
|
-
validationFailures: import("@langchain/langgraph").BaseChannel<import("
|
|
182
|
-
actions: import("@langchain/langgraph").BaseChannel<import("
|
|
183
|
-
executionResults: import("@langchain/langgraph").BaseChannel<import("
|
|
180
|
+
verifiedIntents: import("@langchain/langgraph").BaseChannel<import("./intent.graph.state.js").VerifiedIntent[], import("./intent.graph.state.js").VerifiedIntent[] | import("@langchain/langgraph").OverwriteValue<import("./intent.graph.state.js").VerifiedIntent[]>, unknown>;
|
|
181
|
+
validationFailures: import("@langchain/langgraph").BaseChannel<import("./intent.graph.state.js").IntentValidationFailure[], import("./intent.graph.state.js").IntentValidationFailure[] | import("@langchain/langgraph").OverwriteValue<import("./intent.graph.state.js").IntentValidationFailure[]>, unknown>;
|
|
182
|
+
actions: import("@langchain/langgraph").BaseChannel<import("../intent.reconciler.js").NormalizedIntentAction[], import("../intent.reconciler.js").NormalizedIntentAction[] | import("@langchain/langgraph").OverwriteValue<import("../intent.reconciler.js").NormalizedIntentAction[]>, unknown>;
|
|
183
|
+
executionResults: import("@langchain/langgraph").BaseChannel<import("./intent.graph.state.js").ExecutionResult[], import("./intent.graph.state.js").ExecutionResult[] | import("@langchain/langgraph").OverwriteValue<import("./intent.graph.state.js").ExecutionResult[]>, unknown>;
|
|
184
184
|
error: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
|
|
185
185
|
trace: import("@langchain/langgraph").BaseChannel<{
|
|
186
186
|
node: string;
|
|
@@ -277,10 +277,10 @@ export declare class IntentGraphFactory {
|
|
|
277
277
|
confidence: "low" | "medium" | "high";
|
|
278
278
|
description: string;
|
|
279
279
|
}[]>, unknown>;
|
|
280
|
-
verifiedIntents: import("@langchain/langgraph").BaseChannel<import("
|
|
281
|
-
validationFailures: import("@langchain/langgraph").BaseChannel<import("
|
|
282
|
-
actions: import("@langchain/langgraph").BaseChannel<import("
|
|
283
|
-
executionResults: import("@langchain/langgraph").BaseChannel<import("
|
|
280
|
+
verifiedIntents: import("@langchain/langgraph").BaseChannel<import("./intent.graph.state.js").VerifiedIntent[], import("./intent.graph.state.js").VerifiedIntent[] | import("@langchain/langgraph").OverwriteValue<import("./intent.graph.state.js").VerifiedIntent[]>, unknown>;
|
|
281
|
+
validationFailures: import("@langchain/langgraph").BaseChannel<import("./intent.graph.state.js").IntentValidationFailure[], import("./intent.graph.state.js").IntentValidationFailure[] | import("@langchain/langgraph").OverwriteValue<import("./intent.graph.state.js").IntentValidationFailure[]>, unknown>;
|
|
282
|
+
actions: import("@langchain/langgraph").BaseChannel<import("../intent.reconciler.js").NormalizedIntentAction[], import("../intent.reconciler.js").NormalizedIntentAction[] | import("@langchain/langgraph").OverwriteValue<import("../intent.reconciler.js").NormalizedIntentAction[]>, unknown>;
|
|
283
|
+
executionResults: import("@langchain/langgraph").BaseChannel<import("./intent.graph.state.js").ExecutionResult[], import("./intent.graph.state.js").ExecutionResult[] | import("@langchain/langgraph").OverwriteValue<import("./intent.graph.state.js").ExecutionResult[]>, unknown>;
|
|
284
284
|
error: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
|
|
285
285
|
trace: import("@langchain/langgraph").BaseChannel<{
|
|
286
286
|
node: string;
|
|
@@ -411,8 +411,8 @@ export declare class IntentGraphFactory {
|
|
|
411
411
|
validationFailures?: undefined;
|
|
412
412
|
trace?: undefined;
|
|
413
413
|
} | {
|
|
414
|
-
verifiedIntents: import("
|
|
415
|
-
validationFailures: import("
|
|
414
|
+
verifiedIntents: import("./intent.graph.state.js").VerifiedIntent[];
|
|
415
|
+
validationFailures: import("./intent.graph.state.js").IntentValidationFailure[];
|
|
416
416
|
agentTimings: import("../../chat/chat-streaming.types.js").DebugMetaAgent[];
|
|
417
417
|
trace: {
|
|
418
418
|
node: string;
|
|
@@ -471,10 +471,10 @@ export declare class IntentGraphFactory {
|
|
|
471
471
|
confidence: "low" | "medium" | "high";
|
|
472
472
|
description: string;
|
|
473
473
|
}[]>, unknown>;
|
|
474
|
-
verifiedIntents: import("@langchain/langgraph").BaseChannel<import("
|
|
475
|
-
validationFailures: import("@langchain/langgraph").BaseChannel<import("
|
|
476
|
-
actions: import("@langchain/langgraph").BaseChannel<import("
|
|
477
|
-
executionResults: import("@langchain/langgraph").BaseChannel<import("
|
|
474
|
+
verifiedIntents: import("@langchain/langgraph").BaseChannel<import("./intent.graph.state.js").VerifiedIntent[], import("./intent.graph.state.js").VerifiedIntent[] | import("@langchain/langgraph").OverwriteValue<import("./intent.graph.state.js").VerifiedIntent[]>, unknown>;
|
|
475
|
+
validationFailures: import("@langchain/langgraph").BaseChannel<import("./intent.graph.state.js").IntentValidationFailure[], import("./intent.graph.state.js").IntentValidationFailure[] | import("@langchain/langgraph").OverwriteValue<import("./intent.graph.state.js").IntentValidationFailure[]>, unknown>;
|
|
476
|
+
actions: import("@langchain/langgraph").BaseChannel<import("../intent.reconciler.js").NormalizedIntentAction[], import("../intent.reconciler.js").NormalizedIntentAction[] | import("@langchain/langgraph").OverwriteValue<import("../intent.reconciler.js").NormalizedIntentAction[]>, unknown>;
|
|
477
|
+
executionResults: import("@langchain/langgraph").BaseChannel<import("./intent.graph.state.js").ExecutionResult[], import("./intent.graph.state.js").ExecutionResult[] | import("@langchain/langgraph").OverwriteValue<import("./intent.graph.state.js").ExecutionResult[]>, unknown>;
|
|
478
478
|
error: import("@langchain/langgraph").BaseChannel<string | undefined, string | import("@langchain/langgraph").OverwriteValue<string | undefined> | undefined, unknown>;
|
|
479
479
|
trace: import("@langchain/langgraph").BaseChannel<{
|
|
480
480
|
node: string;
|
|
@@ -532,7 +532,7 @@ export declare class IntentGraphFactory {
|
|
|
532
532
|
} | undefined> | undefined, unknown>;
|
|
533
533
|
}>;
|
|
534
534
|
executor: {
|
|
535
|
-
executionResults: import("
|
|
535
|
+
executionResults: import("./intent.graph.state.js").ExecutionResult[];
|
|
536
536
|
};
|
|
537
537
|
}, unknown, unknown, []>;
|
|
538
538
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Intent graph, stage 4 and the read fast path.
|
|
3
3
|
*/
|
|
4
|
-
import { ExecutionResult } from "
|
|
4
|
+
import { ExecutionResult } from "./intent.graph.state.js";
|
|
5
5
|
import { type IntentGraphDeps, type IntentState } from "./intent.graph.shared.js";
|
|
6
6
|
/**
|
|
7
7
|
* Node 4: Executor
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Intent graph, stage 4 and the read fast path.
|
|
3
3
|
*/
|
|
4
|
-
import { normalizeIntentDescription } from "../
|
|
4
|
+
import { normalizeIntentDescription } from "../intent.proposal.js";
|
|
5
5
|
import { timed } from "../../shared/observability/performance.js";
|
|
6
6
|
import { enforceIntentActionBoundary, generateIntentEmbedding, logger, toSpeechActType } from "./intent.graph.shared.js";
|
|
7
7
|
/**
|
|
@@ -6,10 +6,10 @@
|
|
|
6
6
|
* dependency bag and wires the edges — nothing else.
|
|
7
7
|
*/
|
|
8
8
|
import { StateGraph, START, END } from "@langchain/langgraph";
|
|
9
|
-
import { ExplicitIntentInferrer } from "
|
|
10
|
-
import { SemanticVerifier } from "
|
|
11
|
-
import { IntentReconciler } from "
|
|
12
|
-
import { IntentGraphState } from "
|
|
9
|
+
import { ExplicitIntentInferrer } from "../intent.inferrer.js";
|
|
10
|
+
import { SemanticVerifier } from "../intent.verifier.js";
|
|
11
|
+
import { IntentReconciler } from "../intent.reconciler.js";
|
|
12
|
+
import { IntentGraphState } from "./intent.graph.state.js";
|
|
13
13
|
import { logger } from "./intent.graph.shared.js";
|
|
14
14
|
import { inferenceNode, prepNode } from "./intent.graph.infer.js";
|
|
15
15
|
import { reconciliationNode, verificationNode } from "./intent.graph.reconcile.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Intent graph, stages 2-3: verify inferred signals, then reconcile against what exists.
|
|
3
3
|
*/
|
|
4
|
-
import { VerifiedIntent, type IntentValidationFailure } from "
|
|
5
|
-
import type { NormalizedIntentAction } from "
|
|
4
|
+
import { VerifiedIntent, type IntentValidationFailure } from "./intent.graph.state.js";
|
|
5
|
+
import type { NormalizedIntentAction } from "../intent.reconciler.js";
|
|
6
6
|
import type { DebugMetaAgent } from "../../agents/index.js";
|
|
7
7
|
import { type IntentGraphDeps, type IntentState } from "./intent.graph.shared.js";
|
|
8
8
|
/**
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* top-level functions now, each taking an explicit {@link IntentGraphDeps}.
|
|
6
6
|
* This module owns the bag, the logger, and the pure helpers.
|
|
7
7
|
*/
|
|
8
|
-
import { IntentGraphState, VerifiedIntent, type IntentValidationFailure } from "
|
|
9
|
-
import { ExplicitIntentInferrer } from "
|
|
10
|
-
import { SemanticVerifier } from "
|
|
11
|
-
import { IntentReconciler } from "
|
|
12
|
-
import type { NormalizedIntentAction } from "
|
|
8
|
+
import { IntentGraphState, VerifiedIntent, type IntentValidationFailure } from "./intent.graph.state.js";
|
|
9
|
+
import { ExplicitIntentInferrer } from "../intent.inferrer.js";
|
|
10
|
+
import { SemanticVerifier } from "../intent.verifier.js";
|
|
11
|
+
import { IntentReconciler } from "../intent.reconciler.js";
|
|
12
|
+
import type { NormalizedIntentAction } from "../intent.reconciler.js";
|
|
13
13
|
import { IntentGraphDatabase } from "../../shared/interfaces/database.interface.js";
|
|
14
14
|
import type { EmbeddingGenerator } from "../../shared/interfaces/embedder.interface.js";
|
|
15
15
|
import type { IntentGraphQueue } from "../../shared/interfaces/queue.interface.js";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* top-level functions now, each taking an explicit {@link IntentGraphDeps}.
|
|
6
6
|
* This module owns the bag, the logger, and the pure helpers.
|
|
7
7
|
*/
|
|
8
|
-
import { DEFAULT_SPECIFICITY_WARNING } from "../
|
|
8
|
+
import { DEFAULT_SPECIFICITY_WARNING } from "../intent.proposal.js";
|
|
9
9
|
import { getAbortSignalConfig } from "../../shared/agent/model-signal.js";
|
|
10
10
|
import { protocolLogger } from "../../shared/observability/protocol.logger.js";
|
|
11
11
|
export const logger = protocolLogger("IntentGraphFactory");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseMessage } from "@langchain/core/messages";
|
|
2
|
-
import { InferredIntent } from "../
|
|
3
|
-
import { SemanticVerifierOutput } from "../
|
|
2
|
+
import { InferredIntent } from "../intent.inferrer.js";
|
|
3
|
+
import { SemanticVerifierOutput } from "../intent.verifier.js";
|
|
4
4
|
import type { DebugMetaAgent } from '../../agents/index.js';
|
|
5
5
|
import type { ToolScopeType } from '../../shared/agent/tool.scope.js';
|
|
6
6
|
/**
|
|
@@ -139,7 +139,7 @@ export declare const IntentGraphState: import("@langchain/langgraph").Annotation
|
|
|
139
139
|
/**
|
|
140
140
|
* Final actions to be performed on the DB (Create, Update, Expire).
|
|
141
141
|
*/
|
|
142
|
-
actions: import("@langchain/langgraph").BaseChannel<import("../
|
|
142
|
+
actions: import("@langchain/langgraph").BaseChannel<import("../intent.reconciler.js").NormalizedIntentAction[], import("../intent.reconciler.js").NormalizedIntentAction[] | import("@langchain/langgraph").OverwriteValue<import("../intent.reconciler.js").NormalizedIntentAction[]>, unknown>;
|
|
143
143
|
/**
|
|
144
144
|
* Results of executing actions against the database.
|
|
145
145
|
* Populated by executorNode after actions are persisted.
|
|
@@ -9,11 +9,11 @@ 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 "
|
|
13
|
-
import { invokeWithAbortSignal } from "
|
|
14
|
-
import { protocolLogger } from "
|
|
15
|
-
import { Timed } from "
|
|
16
|
-
import { UnderspecificationTypeSchema } from "
|
|
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
|
+
import { UnderspecificationTypeSchema } from "../shared/schemas/underspecification.schema.js";
|
|
17
17
|
const logger = protocolLogger("IntentClarifier");
|
|
18
18
|
const clarificationSchema = z.discriminatedUnion("needsClarification", [
|
|
19
19
|
z.object({
|
|
@@ -10,10 +10,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
10
10
|
import { HumanMessage, SystemMessage } from "@langchain/core/messages";
|
|
11
11
|
import { tool } from "@langchain/core/tools";
|
|
12
12
|
import { z } from "zod";
|
|
13
|
-
import { log } from "
|
|
14
|
-
import { Timed } from "
|
|
15
|
-
import { createStructuredModel } from "
|
|
16
|
-
import { invokeWithAbortSignal } from "
|
|
13
|
+
import { log } from "../shared/observability/log.js";
|
|
14
|
+
import { Timed } from "../shared/observability/performance.js";
|
|
15
|
+
import { createStructuredModel } from "../shared/agent/model.config.js";
|
|
16
|
+
import { invokeWithAbortSignal } from "../shared/agent/model-signal.js";
|
|
17
17
|
// ──────────────────────────────────────────────────────────────
|
|
18
18
|
// Response schema
|
|
19
19
|
// ──────────────────────────────────────────────────────────────
|