@carlonicora/nestjs-neo4jsonapi 2.1.0 → 2.3.0
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/dist/agents/graph/graph.module.d.ts.map +1 -1
- package/dist/agents/graph/graph.module.js +3 -0
- package/dist/agents/graph/graph.module.js.map +1 -1
- package/dist/agents/graph/interfaces/graph.catalog.interface.d.ts +24 -0
- package/dist/agents/graph/interfaces/graph.catalog.interface.d.ts.map +1 -1
- package/dist/agents/graph/services/graph.catalog.service.d.ts +9 -0
- package/dist/agents/graph/services/graph.catalog.service.d.ts.map +1 -1
- package/dist/agents/graph/services/graph.catalog.service.js +61 -1
- package/dist/agents/graph/services/graph.catalog.service.js.map +1 -1
- package/dist/agents/graph/services/graph.search.service.d.ts +16 -1
- package/dist/agents/graph/services/graph.search.service.d.ts.map +1 -1
- package/dist/agents/graph/services/graph.search.service.js +51 -4
- package/dist/agents/graph/services/graph.search.service.js.map +1 -1
- package/dist/agents/graph/services/humanize-tool.d.ts +17 -2
- package/dist/agents/graph/services/humanize-tool.d.ts.map +1 -1
- package/dist/agents/graph/services/humanize-tool.js +71 -6
- package/dist/agents/graph/services/humanize-tool.js.map +1 -1
- package/dist/agents/graph/services/materialise-bridge.d.ts +6 -0
- package/dist/agents/graph/services/materialise-bridge.d.ts.map +1 -1
- package/dist/agents/graph/services/materialise-bridge.js +17 -1
- package/dist/agents/graph/services/materialise-bridge.js.map +1 -1
- package/dist/agents/graph/services/scope.guard.d.ts +43 -0
- package/dist/agents/graph/services/scope.guard.d.ts.map +1 -0
- package/dist/agents/graph/services/scope.guard.js +91 -0
- package/dist/agents/graph/services/scope.guard.js.map +1 -0
- package/dist/agents/graph/tools/read-entity.tool.d.ts +9 -1
- package/dist/agents/graph/tools/read-entity.tool.d.ts.map +1 -1
- package/dist/agents/graph/tools/read-entity.tool.js +30 -5
- package/dist/agents/graph/tools/read-entity.tool.js.map +1 -1
- package/dist/agents/graph/tools/resolve-entity.tool.d.ts.map +1 -1
- package/dist/agents/graph/tools/resolve-entity.tool.js +8 -1
- package/dist/agents/graph/tools/resolve-entity.tool.js.map +1 -1
- package/dist/agents/graph/tools/search-entities.tool.d.ts +9 -1
- package/dist/agents/graph/tools/search-entities.tool.d.ts.map +1 -1
- package/dist/agents/graph/tools/search-entities.tool.js +37 -8
- package/dist/agents/graph/tools/search-entities.tool.js.map +1 -1
- package/dist/agents/graph/tools/tool.factory.d.ts +4 -0
- package/dist/agents/graph/tools/tool.factory.d.ts.map +1 -1
- package/dist/agents/graph/tools/tool.factory.js.map +1 -1
- package/dist/agents/graph/tools/traverse.tool.d.ts +9 -1
- package/dist/agents/graph/tools/traverse.tool.d.ts.map +1 -1
- package/dist/agents/graph/tools/traverse.tool.js +21 -5
- package/dist/agents/graph/tools/traverse.tool.js.map +1 -1
- package/dist/agents/operator/contexts/operator.context.d.ts +4 -0
- package/dist/agents/operator/contexts/operator.context.d.ts.map +1 -1
- package/dist/agents/operator/contexts/operator.context.js +4 -0
- package/dist/agents/operator/contexts/operator.context.js.map +1 -1
- package/dist/agents/operator/operator.module.d.ts.map +1 -1
- package/dist/agents/operator/operator.module.js +4 -0
- package/dist/agents/operator/operator.module.js.map +1 -1
- package/dist/agents/operator/services/operator.service.d.ts +15 -0
- package/dist/agents/operator/services/operator.service.d.ts.map +1 -1
- package/dist/agents/operator/services/operator.service.js +23 -5
- package/dist/agents/operator/services/operator.service.js.map +1 -1
- package/dist/agents/operator/tools/entity-write.tools.d.ts +124 -0
- package/dist/agents/operator/tools/entity-write.tools.d.ts.map +1 -0
- package/dist/agents/operator/tools/entity-write.tools.js +471 -0
- package/dist/agents/operator/tools/entity-write.tools.js.map +1 -0
- package/dist/agents/operator/tools/operator.tool.registry.d.ts +5 -1
- package/dist/agents/operator/tools/operator.tool.registry.d.ts.map +1 -1
- package/dist/agents/operator/tools/operator.tool.registry.js +19 -2
- package/dist/agents/operator/tools/operator.tool.registry.js.map +1 -1
- package/dist/agents/operator/tools/search-documents.tool.d.ts +16 -1
- package/dist/agents/operator/tools/search-documents.tool.d.ts.map +1 -1
- package/dist/agents/operator/tools/search-documents.tool.js +59 -3
- package/dist/agents/operator/tools/search-documents.tool.js.map +1 -1
- package/dist/agents/prompts/index.d.ts +1 -0
- package/dist/agents/prompts/index.d.ts.map +1 -1
- package/dist/agents/prompts/index.js +7 -1
- package/dist/agents/prompts/index.js.map +1 -1
- package/dist/agents/responder/contexts/responder.context.d.ts +19 -0
- package/dist/agents/responder/contexts/responder.context.d.ts.map +1 -1
- package/dist/agents/responder/contexts/responder.context.js +6 -0
- package/dist/agents/responder/contexts/responder.context.js.map +1 -1
- package/dist/agents/responder/factories/responder.context.factory.d.ts +4 -0
- package/dist/agents/responder/factories/responder.context.factory.d.ts.map +1 -1
- package/dist/agents/responder/factories/responder.context.factory.js +2 -0
- package/dist/agents/responder/factories/responder.context.factory.js.map +1 -1
- package/dist/agents/responder/nodes/graph.node.service.d.ts.map +1 -1
- package/dist/agents/responder/nodes/graph.node.service.js +18 -2
- package/dist/agents/responder/nodes/graph.node.service.js.map +1 -1
- package/dist/agents/responder/nodes/planner.node.service.d.ts +1 -1
- package/dist/agents/responder/nodes/planner.node.service.d.ts.map +1 -1
- package/dist/agents/responder/nodes/planner.node.service.js +5 -0
- package/dist/agents/responder/nodes/planner.node.service.js.map +1 -1
- package/dist/agents/responder/nodes/responder.answer.node.service.d.ts +33 -1
- package/dist/agents/responder/nodes/responder.answer.node.service.d.ts.map +1 -1
- package/dist/agents/responder/nodes/responder.answer.node.service.js +69 -27
- package/dist/agents/responder/nodes/responder.answer.node.service.js.map +1 -1
- package/dist/agents/responder/services/responder.service.d.ts +7 -0
- package/dist/agents/responder/services/responder.service.d.ts.map +1 -1
- package/dist/agents/responder/services/responder.service.js +3 -0
- package/dist/agents/responder/services/responder.service.js.map +1 -1
- package/dist/common/interfaces/entity.schema.interface.d.ts +16 -0
- package/dist/common/interfaces/entity.schema.interface.d.ts.map +1 -1
- package/dist/common/interfaces/index.d.ts +1 -0
- package/dist/common/interfaces/index.d.ts.map +1 -1
- package/dist/common/interfaces/index.js +1 -0
- package/dist/common/interfaces/index.js.map +1 -1
- package/dist/common/interfaces/seed.context.interface.d.ts +62 -0
- package/dist/common/interfaces/seed.context.interface.d.ts.map +1 -0
- package/dist/common/interfaces/seed.context.interface.js +20 -0
- package/dist/common/interfaces/seed.context.interface.js.map +1 -0
- package/dist/config/interfaces/config.prompts.interface.d.ts +12 -0
- package/dist/config/interfaces/config.prompts.interface.d.ts.map +1 -1
- package/dist/core/blocknote/services/blocknote.service.d.ts +23 -14
- package/dist/core/blocknote/services/blocknote.service.d.ts.map +1 -1
- package/dist/core/blocknote/services/blocknote.service.js +48 -32
- package/dist/core/blocknote/services/blocknote.service.js.map +1 -1
- package/dist/core/llm/services/llm.service.d.ts.map +1 -1
- package/dist/core/llm/services/llm.service.js +34 -2
- package/dist/core/llm/services/llm.service.js.map +1 -1
- package/dist/core/llm/services/tool-error-feedback.d.ts +40 -0
- package/dist/core/llm/services/tool-error-feedback.d.ts.map +1 -0
- package/dist/core/llm/services/tool-error-feedback.js +131 -0
- package/dist/core/llm/services/tool-error-feedback.js.map +1 -0
- package/dist/foundations/assistant/assistant.module.d.ts.map +1 -1
- package/dist/foundations/assistant/assistant.module.js +7 -1
- package/dist/foundations/assistant/assistant.module.js.map +1 -1
- package/dist/foundations/assistant/controllers/assistant.controller.d.ts +13 -1
- package/dist/foundations/assistant/controllers/assistant.controller.d.ts.map +1 -1
- package/dist/foundations/assistant/controllers/assistant.controller.js +37 -3
- package/dist/foundations/assistant/controllers/assistant.controller.js.map +1 -1
- package/dist/foundations/assistant/dtos/assistant-append.dto.d.ts +6 -0
- package/dist/foundations/assistant/dtos/assistant-append.dto.d.ts.map +1 -1
- package/dist/foundations/assistant/dtos/assistant-append.dto.js +1 -1
- package/dist/foundations/assistant/dtos/assistant-append.dto.js.map +1 -1
- package/dist/foundations/assistant/dtos/assistant-post.dto.d.ts +29 -0
- package/dist/foundations/assistant/dtos/assistant-post.dto.d.ts.map +1 -1
- package/dist/foundations/assistant/dtos/assistant-post.dto.js +47 -2
- package/dist/foundations/assistant/dtos/assistant-post.dto.js.map +1 -1
- package/dist/foundations/assistant/repositories/assistant.repository.d.ts +22 -0
- package/dist/foundations/assistant/repositories/assistant.repository.d.ts.map +1 -1
- package/dist/foundations/assistant/repositories/assistant.repository.js +28 -0
- package/dist/foundations/assistant/repositories/assistant.repository.js.map +1 -1
- package/dist/foundations/assistant/services/assistant-mention.extractor.d.ts +36 -0
- package/dist/foundations/assistant/services/assistant-mention.extractor.d.ts.map +1 -0
- package/dist/foundations/assistant/services/assistant-mention.extractor.js +99 -0
- package/dist/foundations/assistant/services/assistant-mention.extractor.js.map +1 -0
- package/dist/foundations/assistant/services/assistant.service.d.ts +93 -2
- package/dist/foundations/assistant/services/assistant.service.d.ts.map +1 -1
- package/dist/foundations/assistant/services/assistant.service.js +388 -60
- package/dist/foundations/assistant/services/assistant.service.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DynamicStructuredTool } from "@langchain/core/tools";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { ContextualiserService } from "../../contextualiser/services/contextualiser.service";
|
|
4
|
+
import { ScopeGuard } from "../../graph/services/scope.guard";
|
|
4
5
|
import { ToolCallRecord, ToolFactory } from "../../graph/tools/tool.factory";
|
|
5
6
|
import { OperatorRetrievalContext } from "../interfaces/operator.tool.interface";
|
|
6
7
|
declare const inputSchema: z.ZodObject<{
|
|
@@ -10,8 +11,22 @@ export { inputSchema as searchDocumentsInputSchema };
|
|
|
10
11
|
export declare class SearchDocumentsTool {
|
|
11
12
|
private readonly factory;
|
|
12
13
|
private readonly contextualiserService;
|
|
13
|
-
|
|
14
|
+
private readonly scopeGuard;
|
|
15
|
+
constructor(factory: ToolFactory, contextualiserService: ContextualiserService, scopeGuard: ScopeGuard);
|
|
14
16
|
build(ctx: OperatorRetrievalContext, recorder: ToolCallRecord[]): DynamicStructuredTool;
|
|
15
17
|
invoke(input: z.infer<typeof inputSchema>, ctx: OperatorRetrievalContext, recorder: ToolCallRecord[]): Promise<string>;
|
|
18
|
+
/**
|
|
19
|
+
* Enforcement point: a scoped run must not read passages whose source record
|
|
20
|
+
* lives under another scope root.
|
|
21
|
+
*
|
|
22
|
+
* Retrieved passages carry their provenance in the opaque `metadata` bag the
|
|
23
|
+
* contributing retrieval source filled in. Entries that name a source record
|
|
24
|
+
* are grouped by type and checked with ONE ScopeGuard.filter call per type
|
|
25
|
+
* (never one per chunk). Entries that name no source record are plain
|
|
26
|
+
* document chunks with no entity provenance to test — they are company-wide
|
|
27
|
+
* material (help content and the like) and are left alone; scoping them is
|
|
28
|
+
* only possible once a retrieval source tags them.
|
|
29
|
+
*/
|
|
30
|
+
private dropOutOfScope;
|
|
16
31
|
}
|
|
17
32
|
//# sourceMappingURL=search-documents.tool.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-documents.tool.d.ts","sourceRoot":"","sources":["../../../../src/agents/operator/tools/search-documents.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAA0B,MAAM,uCAAuC,CAAC;AAEzG,QAAA,MAAM,WAAW;;iBAEf,CAAC;AAEH,OAAO,EAAE,WAAW,IAAI,0BAA0B,EAAE,CAAC;AAIrD,qBACa,mBAAmB;IAE5B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,qBAAqB;
|
|
1
|
+
{"version":3,"file":"search-documents.tool.d.ts","sourceRoot":"","sources":["../../../../src/agents/operator/tools/search-documents.tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,sDAAsD,CAAC;AAC7F,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,wBAAwB,EAA0B,MAAM,uCAAuC,CAAC;AAEzG,QAAA,MAAM,WAAW;;iBAEf,CAAC;AAEH,OAAO,EAAE,WAAW,IAAI,0BAA0B,EAAE,CAAC;AAIrD,qBACa,mBAAmB;IAE5B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IAGtC,OAAO,CAAC,QAAQ,CAAC,UAAU;gBAJV,OAAO,EAAE,WAAW,EACpB,qBAAqB,EAAE,qBAAqB,EAG5C,UAAU,EAAE,UAAU;IAGzC,KAAK,CAAC,GAAG,EAAE,wBAAwB,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,qBAAqB;IAUjF,MAAM,CACV,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,EAClC,GAAG,EAAE,wBAAwB,EAC7B,QAAQ,EAAE,cAAc,EAAE,GACzB,OAAO,CAAC,MAAM,CAAC;IAwClB;;;;;;;;;;;OAWG;YACW,cAAc;CAwC7B"}
|
|
@@ -14,6 +14,7 @@ const tools_1 = require("@langchain/core/tools");
|
|
|
14
14
|
const common_1 = require("@nestjs/common");
|
|
15
15
|
const zod_1 = require("zod");
|
|
16
16
|
const contextualiser_service_1 = require("../../contextualiser/services/contextualiser.service");
|
|
17
|
+
const scope_guard_1 = require("../../graph/services/scope.guard");
|
|
17
18
|
const tool_factory_1 = require("../../graph/tools/tool.factory");
|
|
18
19
|
const inputSchema = zod_1.z.object({
|
|
19
20
|
question: zod_1.z.string().describe("The natural-language question to answer from the company's documents."),
|
|
@@ -21,9 +22,13 @@ const inputSchema = zod_1.z.object({
|
|
|
21
22
|
exports.searchDocumentsInputSchema = inputSchema;
|
|
22
23
|
const NO_INFORMATION_MESSAGE = "No information found in the company documents for this question.";
|
|
23
24
|
let SearchDocumentsTool = class SearchDocumentsTool {
|
|
24
|
-
constructor(factory, contextualiserService
|
|
25
|
+
constructor(factory, contextualiserService,
|
|
26
|
+
// ScopeGuard is deliberately the LAST constructor parameter so existing
|
|
27
|
+
// positional call sites keep working.
|
|
28
|
+
scopeGuard) {
|
|
25
29
|
this.factory = factory;
|
|
26
30
|
this.contextualiserService = contextualiserService;
|
|
31
|
+
this.scopeGuard = scopeGuard;
|
|
27
32
|
}
|
|
28
33
|
build(ctx, recorder) {
|
|
29
34
|
return new tools_1.DynamicStructuredTool({
|
|
@@ -49,7 +54,7 @@ let SearchDocumentsTool = class SearchDocumentsTool {
|
|
|
49
54
|
messages: ctx.messages,
|
|
50
55
|
question: input.question,
|
|
51
56
|
});
|
|
52
|
-
const notebook = state.notebook ?? [];
|
|
57
|
+
const notebook = await this.dropOutOfScope(state.notebook ?? [], ctx);
|
|
53
58
|
return {
|
|
54
59
|
answer: notebook.length
|
|
55
60
|
? notebook.map((n) => `${n.chunkId}: ${n.content}`).join("\n")
|
|
@@ -67,11 +72,62 @@ let SearchDocumentsTool = class SearchDocumentsTool {
|
|
|
67
72
|
recorder.push(...local);
|
|
68
73
|
}
|
|
69
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Enforcement point: a scoped run must not read passages whose source record
|
|
77
|
+
* lives under another scope root.
|
|
78
|
+
*
|
|
79
|
+
* Retrieved passages carry their provenance in the opaque `metadata` bag the
|
|
80
|
+
* contributing retrieval source filled in. Entries that name a source record
|
|
81
|
+
* are grouped by type and checked with ONE ScopeGuard.filter call per type
|
|
82
|
+
* (never one per chunk). Entries that name no source record are plain
|
|
83
|
+
* document chunks with no entity provenance to test — they are company-wide
|
|
84
|
+
* material (help content and the like) and are left alone; scoping them is
|
|
85
|
+
* only possible once a retrieval source tags them.
|
|
86
|
+
*/
|
|
87
|
+
async dropOutOfScope(entries, ctx) {
|
|
88
|
+
if (!ctx.scopeId || !ctx.scopeType)
|
|
89
|
+
return entries;
|
|
90
|
+
if (entries.length === 0)
|
|
91
|
+
return entries;
|
|
92
|
+
const sourceOf = (entry) => {
|
|
93
|
+
const metadata = entry.metadata ?? {};
|
|
94
|
+
const type = metadata.entityType ?? metadata.sourceType ?? metadata.type;
|
|
95
|
+
const id = metadata.entityId ?? metadata.sourceId ?? metadata.id;
|
|
96
|
+
return typeof type === "string" && type && typeof id === "string" && id ? { type, id } : undefined;
|
|
97
|
+
};
|
|
98
|
+
const byType = new Map();
|
|
99
|
+
for (const entry of entries) {
|
|
100
|
+
const source = sourceOf(entry);
|
|
101
|
+
if (!source)
|
|
102
|
+
continue;
|
|
103
|
+
const ids = byType.get(source.type) ?? new Set();
|
|
104
|
+
ids.add(source.id);
|
|
105
|
+
byType.set(source.type, ids);
|
|
106
|
+
}
|
|
107
|
+
if (byType.size === 0)
|
|
108
|
+
return entries;
|
|
109
|
+
const allowed = new Map();
|
|
110
|
+
for (const [type, ids] of byType) {
|
|
111
|
+
const kept = await this.scopeGuard.filter({
|
|
112
|
+
type,
|
|
113
|
+
records: Array.from(ids).map((id) => ({ id })),
|
|
114
|
+
ctx,
|
|
115
|
+
});
|
|
116
|
+
allowed.set(type, new Set(kept.map((record) => record.id)));
|
|
117
|
+
}
|
|
118
|
+
return entries.filter((entry) => {
|
|
119
|
+
const source = sourceOf(entry);
|
|
120
|
+
if (!source)
|
|
121
|
+
return true;
|
|
122
|
+
return allowed.get(source.type)?.has(source.id) ?? false;
|
|
123
|
+
});
|
|
124
|
+
}
|
|
70
125
|
};
|
|
71
126
|
exports.SearchDocumentsTool = SearchDocumentsTool;
|
|
72
127
|
exports.SearchDocumentsTool = SearchDocumentsTool = __decorate([
|
|
73
128
|
(0, common_1.Injectable)(),
|
|
74
129
|
__metadata("design:paramtypes", [tool_factory_1.ToolFactory,
|
|
75
|
-
contextualiser_service_1.ContextualiserService
|
|
130
|
+
contextualiser_service_1.ContextualiserService,
|
|
131
|
+
scope_guard_1.ScopeGuard])
|
|
76
132
|
], SearchDocumentsTool);
|
|
77
133
|
//# sourceMappingURL=search-documents.tool.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-documents.tool.js","sourceRoot":"","sources":["../../../../src/agents/operator/tools/search-documents.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA8D;AAC9D,2CAA4C;AAC5C,6BAAwB;AACxB,iGAA6F;AAC7F,iEAA6E;AAG7E,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uEAAuE,CAAC;CACvG,CAAC,CAAC;AAEqB,iDAA0B;AAElD,MAAM,sBAAsB,GAAG,kEAAkE,CAAC;AAG3F,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACmB,OAAoB,EACpB,qBAA4C;
|
|
1
|
+
{"version":3,"file":"search-documents.tool.js","sourceRoot":"","sources":["../../../../src/agents/operator/tools/search-documents.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA8D;AAC9D,2CAA4C;AAC5C,6BAAwB;AACxB,iGAA6F;AAC7F,kEAA8D;AAC9D,iEAA6E;AAG7E,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uEAAuE,CAAC;CACvG,CAAC,CAAC;AAEqB,iDAA0B;AAElD,MAAM,sBAAsB,GAAG,kEAAkE,CAAC;AAG3F,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YACmB,OAAoB,EACpB,qBAA4C;I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AAM,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE;YAC9B,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;YAC/B,IAAI,CAAC,MAAM;gBAAE,OAAO,IAAI,CAAC;YACzB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,KAAK,CAAC;QAC3D,CAAC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AAnHY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAGiB,0BAAW;QACG,8CAAqB;QAGhC,wBAAU;GAN9B,mBAAmB,CAmH/B"}
|
|
@@ -2,6 +2,7 @@ export { defaultGraphCreatorPrompt } from "../graph.creator/services/graph.creat
|
|
|
2
2
|
export { prompt as graphCreatorPrompt } from "../graph.creator/services/graph.creator.service";
|
|
3
3
|
export { defaultAnswerPrompt as defaultResponderAnswerPrompt } from "../responder/nodes/responder.answer.node.service";
|
|
4
4
|
export { defaultAnswerPrompt } from "../responder/nodes/responder.answer.node.service";
|
|
5
|
+
export { buildResponderOutputSchema, defaultResponderAnalyseDescription, defaultResponderFinalAnswerDescription, } from "../responder/nodes/responder.answer.node.service";
|
|
5
6
|
export { defaultQuestionRefinerPrompt } from "../contextualiser/nodes/question.refiner.node.service";
|
|
6
7
|
export { defaultRationalPlanPrompt } from "../contextualiser/nodes/rational.node.service";
|
|
7
8
|
export { defaultKeyConceptsPrompt } from "../contextualiser/nodes/keyconcepts.node.service";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/prompts/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAE5F,O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BAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,mDAAmD,CAAC;AAG7F,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Prompt configuration is now via baseConfig.prompts (see ConfigPromptsInterface)
|
|
3
3
|
// This file exports the default prompts for reference
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.defaultTldrPrompt = exports.defaultCombinePrompt = exports.defaultMapPrompt = exports.defaultChunkVectorPrompt = exports.defaultChunkPrompt = exports.defaultAtomicFactsPrompt = exports.defaultKeyConceptsPrompt = exports.defaultRationalPlanPrompt = exports.defaultQuestionRefinerPrompt = exports.defaultAnswerPrompt = exports.defaultResponderAnswerPrompt = exports.graphCreatorPrompt = exports.defaultGraphCreatorPrompt = void 0;
|
|
5
|
+
exports.defaultTldrPrompt = exports.defaultCombinePrompt = exports.defaultMapPrompt = exports.defaultChunkVectorPrompt = exports.defaultChunkPrompt = exports.defaultAtomicFactsPrompt = exports.defaultKeyConceptsPrompt = exports.defaultRationalPlanPrompt = exports.defaultQuestionRefinerPrompt = exports.defaultResponderFinalAnswerDescription = exports.defaultResponderAnalyseDescription = exports.buildResponderOutputSchema = exports.defaultAnswerPrompt = exports.defaultResponderAnswerPrompt = exports.graphCreatorPrompt = exports.defaultGraphCreatorPrompt = void 0;
|
|
6
6
|
// Default prompts - re-exported from services for reference
|
|
7
7
|
var graph_creator_service_1 = require("../graph.creator/services/graph.creator.service");
|
|
8
8
|
Object.defineProperty(exports, "defaultGraphCreatorPrompt", { enumerable: true, get: function () { return graph_creator_service_1.defaultGraphCreatorPrompt; } });
|
|
@@ -14,6 +14,12 @@ Object.defineProperty(exports, "defaultResponderAnswerPrompt", { enumerable: tru
|
|
|
14
14
|
// Also exported under its own name — app-side prompt overrides reference it directly.
|
|
15
15
|
var responder_answer_node_service_2 = require("../responder/nodes/responder.answer.node.service");
|
|
16
16
|
Object.defineProperty(exports, "defaultAnswerPrompt", { enumerable: true, get: function () { return responder_answer_node_service_2.defaultAnswerPrompt; } });
|
|
17
|
+
// Responder answer-node structured-output description defaults — apps that
|
|
18
|
+
// override `prompts.responderSchemaDescriptions` can reference these.
|
|
19
|
+
var responder_answer_node_service_3 = require("../responder/nodes/responder.answer.node.service");
|
|
20
|
+
Object.defineProperty(exports, "buildResponderOutputSchema", { enumerable: true, get: function () { return responder_answer_node_service_3.buildResponderOutputSchema; } });
|
|
21
|
+
Object.defineProperty(exports, "defaultResponderAnalyseDescription", { enumerable: true, get: function () { return responder_answer_node_service_3.defaultResponderAnalyseDescription; } });
|
|
22
|
+
Object.defineProperty(exports, "defaultResponderFinalAnswerDescription", { enumerable: true, get: function () { return responder_answer_node_service_3.defaultResponderFinalAnswerDescription; } });
|
|
17
23
|
// Contextualiser default prompts
|
|
18
24
|
var question_refiner_node_service_1 = require("../contextualiser/nodes/question.refiner.node.service");
|
|
19
25
|
Object.defineProperty(exports, "defaultQuestionRefinerPrompt", { enumerable: true, get: function () { return question_refiner_node_service_1.defaultQuestionRefinerPrompt; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/prompts/index.ts"],"names":[],"mappings":";AAAA,kFAAkF;AAClF,sDAAsD;;;AAEtD,4DAA4D;AAC5D,yFAA4F;AAAnF,kIAAA,yBAAyB,OAAA;AAClC,oFAAoF;AACpF,yFAA+F;AAAtF,2HAAA,MAAM,OAAsB;AACrC,kGAAuH;AAA9G,6IAAA,mBAAmB,OAAgC;AAC5D,sFAAsF;AACtF,kGAAuF;AAA9E,oIAAA,mBAAmB,OAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/prompts/index.ts"],"names":[],"mappings":";AAAA,kFAAkF;AAClF,sDAAsD;;;AAEtD,4DAA4D;AAC5D,yFAA4F;AAAnF,kIAAA,yBAAyB,OAAA;AAClC,oFAAoF;AACpF,yFAA+F;AAAtF,2HAAA,MAAM,OAAsB;AACrC,kGAAuH;AAA9G,6IAAA,mBAAmB,OAAgC;AAC5D,sFAAsF;AACtF,kGAAuF;AAA9E,oIAAA,mBAAmB,OAAA;AAC5B,2EAA2E;AAC3E,sEAAsE;AACtE,kGAI0D;AAHxD,2IAAA,0BAA0B,OAAA;AAC1B,mJAAA,kCAAkC,OAAA;AAClC,uJAAA,sCAAsC,OAAA;AAGxC,iCAAiC;AACjC,uGAAqG;AAA5F,6IAAA,4BAA4B,OAAA;AACrC,uFAA0F;AAAjF,kIAAA,yBAAyB,OAAA;AAClC,6FAA4F;AAAnF,oIAAA,wBAAwB,OAAA;AACjC,6FAA4F;AAAnF,oIAAA,wBAAwB,OAAA;AACjC,iFAAgF;AAAvE,wHAAA,kBAAkB,OAAA;AAC3B,+FAA6F;AAApF,qIAAA,wBAAwB,OAAA;AAEjC,6BAA6B;AAC7B,gFAAsH;AAA7G,sHAAA,gBAAgB,OAAA;AAAE,0HAAA,oBAAoB,OAAA;AAAE,uHAAA,iBAAiB,OAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { DriftSearchResult } from "../../drift/services/drift.search.service";
|
|
2
2
|
import { DataLimits } from "../../../common/types/data.limits";
|
|
3
3
|
import { MessageInterface } from "../../../common/interfaces/message.interface";
|
|
4
|
+
import type { AssistantSeedContext } from "../../../common/interfaces/seed.context.interface";
|
|
4
5
|
import type { GraphNodeOutput } from "../../graph/interfaces/graph.node.output.interface";
|
|
5
6
|
import type { EntityReference } from "../interfaces/entity.reference.interface";
|
|
6
7
|
import type { UnifiedTrace } from "../interfaces/unified.trace.interface";
|
|
@@ -20,6 +21,24 @@ export declare const ResponderContext: import("@langchain/langgraph").Annotation
|
|
|
20
21
|
(): import("@langchain/langgraph").LastValue<string>;
|
|
21
22
|
Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
|
|
22
23
|
};
|
|
24
|
+
/** Id of the scope-root node the whole run is confined to. Absent = unscoped. */
|
|
25
|
+
scopeId: {
|
|
26
|
+
(annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BaseChannel<string, string | import("@langchain/langgraph").OverwriteValue<string>, unknown>;
|
|
27
|
+
(): import("@langchain/langgraph").LastValue<string>;
|
|
28
|
+
Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
|
|
29
|
+
};
|
|
30
|
+
/** JSON:API type of the scope root, e.g. "campaigns". Present iff scopeId is. */
|
|
31
|
+
scopeType: {
|
|
32
|
+
(annotation: import("@langchain/langgraph").SingleReducer<string, string>): import("@langchain/langgraph").BaseChannel<string, string | import("@langchain/langgraph").OverwriteValue<string>, unknown>;
|
|
33
|
+
(): import("@langchain/langgraph").LastValue<string>;
|
|
34
|
+
Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
|
|
35
|
+
};
|
|
36
|
+
/** App-provided context blocks guaranteed present this turn (seed-context providers). */
|
|
37
|
+
seedContexts: {
|
|
38
|
+
(annotation: import("@langchain/langgraph").SingleReducer<AssistantSeedContext[], AssistantSeedContext[]>): import("@langchain/langgraph").BaseChannel<AssistantSeedContext[], AssistantSeedContext[] | import("@langchain/langgraph").OverwriteValue<AssistantSeedContext[]>, unknown>;
|
|
39
|
+
(): import("@langchain/langgraph").LastValue<AssistantSeedContext[]>;
|
|
40
|
+
Root: <S extends import("@langchain/langgraph").StateDefinition>(sd: S) => import("@langchain/langgraph").AnnotationRoot<S>;
|
|
41
|
+
};
|
|
23
42
|
dataLimits: import("@langchain/langgraph").LastValue<DataLimits>;
|
|
24
43
|
context: import("@langchain/langgraph").BaseChannel<import("@langchain/langgraph").StateType<{
|
|
25
44
|
companyId: import("@langchain/langgraph").BaseChannel<string, string | import("@langchain/langgraph").OverwriteValue<string>, unknown>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responder.context.d.ts","sourceRoot":"","sources":["../../../../src/agents/responder/contexts/responder.context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAG9E,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAE1E,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"responder.context.d.ts","sourceRoot":"","sources":["../../../../src/agents/responder/contexts/responder.context.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAG9E,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAEhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uCAAuC,CAAC;AAE1E,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;IAK3B,iFAAiF;;;;;;IAEjF,iFAAiF;;;;;;IAEjF,yFAAyF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AO;+BACE,OAAO;sBAChB,OAAO;uBACN,MAAM;;sBAHP,OAAO;+BACE,OAAO;sBAChB,OAAO;uBACN,MAAM;;;sBAHP,OAAO;+BACE,OAAO;sBAChB,OAAO;uBACN,MAAM;;;;;;;;;;;;;;;EAwBnB,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,OAAO,gBAAgB,CAAC,KAAK,CAAC"}
|
|
@@ -7,6 +7,12 @@ exports.ResponderContext = langgraph_1.Annotation.Root({
|
|
|
7
7
|
companyId: (langgraph_1.Annotation),
|
|
8
8
|
contentId: (langgraph_1.Annotation),
|
|
9
9
|
contentType: (langgraph_1.Annotation),
|
|
10
|
+
/** Id of the scope-root node the whole run is confined to. Absent = unscoped. */
|
|
11
|
+
scopeId: (langgraph_1.Annotation),
|
|
12
|
+
/** JSON:API type of the scope root, e.g. "campaigns". Present iff scopeId is. */
|
|
13
|
+
scopeType: (langgraph_1.Annotation),
|
|
14
|
+
/** App-provided context blocks guaranteed present this turn (seed-context providers). */
|
|
15
|
+
seedContexts: (langgraph_1.Annotation),
|
|
10
16
|
dataLimits: (0, langgraph_1.Annotation)(),
|
|
11
17
|
context: (0, langgraph_1.Annotation)({
|
|
12
18
|
default: () => undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responder.context.js","sourceRoot":"","sources":["../../../../src/agents/responder/contexts/responder.context.ts"],"names":[],"mappings":";;;AAAA,oDAAkD;
|
|
1
|
+
{"version":3,"file":"responder.context.js","sourceRoot":"","sources":["../../../../src/agents/responder/contexts/responder.context.ts"],"names":[],"mappings":";;;AAAA,oDAAkD;AAarC,QAAA,gBAAgB,GAAG,sBAAU,CAAC,IAAI,CAAC;IAC9C,WAAW;IACX,SAAS,EAAE,CAAA,sBAAkB,CAAA;IAC7B,SAAS,EAAE,CAAA,sBAA8B,CAAA;IACzC,WAAW,EAAE,CAAA,sBAA8B,CAAA;IAC3C,iFAAiF;IACjF,OAAO,EAAE,CAAA,sBAA8B,CAAA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,IAAI,EAAE,EAAE,CAAC;IACpG,UAAU,EAAE,IAAA,sBAAU,EAAgB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;IAC3F,KAAK,EAAE,IAAA,sBAAU,EAAe;QAC9B,OAAO,EAAE,GAAG,EAAE,CACZ,CAAC;YACC,OAAO,EAAE;gBACP,SAAS,EAAE,EAAE;gBACb,UAAU,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE;gBAC1E,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;aAChC;YACD,MAAM,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;YAC7D,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;SACrC,CAAiB;QACpB,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,GAAG,MAAM,EAAE,CAAC;KAC1D,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -10,6 +10,10 @@ export declare class ResponderContextFactoryService {
|
|
|
10
10
|
contentId?: string;
|
|
11
11
|
contentType?: string;
|
|
12
12
|
dataLimits: DataLimits;
|
|
13
|
+
/** Id of the scope-root node the whole run is confined to. Absent = unscoped. */
|
|
14
|
+
scopeId?: string;
|
|
15
|
+
/** JSON:API type of the scope root, e.g. "campaigns". Present iff scopeId is. */
|
|
16
|
+
scopeType?: string;
|
|
13
17
|
}): ResponderContextState;
|
|
14
18
|
createAnswer(params: {
|
|
15
19
|
state: ResponderContextState;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responder.context.factory.d.ts","sourceRoot":"","sources":["../../../../src/agents/responder/factories/responder.context.factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mCAAmC,EAAE,MAAM,+DAA+D,CAAC;AACpH,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AAExF,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,qBACa,8BAA8B;IAC7B,OAAO,CAAC,QAAQ,CAAC,mCAAmC;gBAAnC,mCAAmC,EAAE,mCAAmC;IAErG,MAAM,CAAC,MAAM,EAAE;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"responder.context.factory.d.ts","sourceRoot":"","sources":["../../../../src/agents/responder/factories/responder.context.factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mCAAmC,EAAE,MAAM,+DAA+D,CAAC;AACpH,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AAExF,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAE/D,qBACa,8BAA8B;IAC7B,OAAO,CAAC,QAAQ,CAAC,mCAAmC;gBAAnC,mCAAmC,EAAE,mCAAmC;IAErG,MAAM,CAAC,MAAM,EAAE;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,UAAU,CAAC;QACvB,iFAAiF;QACjF,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,iFAAiF;QACjF,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,GAAG,qBAAqB;IAiBzB,YAAY,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,qBAAqB,CAAA;KAAE,GAAG,0BAA0B;CAgCnF"}
|
|
@@ -22,6 +22,8 @@ let ResponderContextFactoryService = class ResponderContextFactoryService {
|
|
|
22
22
|
companyId: params.companyId,
|
|
23
23
|
contentId: params.contentId,
|
|
24
24
|
contentType: params.contentType,
|
|
25
|
+
scopeId: params.scopeId,
|
|
26
|
+
scopeType: params.scopeType,
|
|
25
27
|
dataLimits: params.dataLimits,
|
|
26
28
|
driftContext: undefined,
|
|
27
29
|
context: undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responder.context.factory.js","sourceRoot":"","sources":["../../../../src/agents/responder/factories/responder.context.factory.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,kHAAoH;AAGpH,+EAA2E;AAIpE,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACzC,YAA6B,mCAAwE;QAAxE,wCAAmC,GAAnC,mCAAmC,CAAqC;IAAG,CAAC;IAEzG,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"responder.context.factory.js","sourceRoot":"","sources":["../../../../src/agents/responder/factories/responder.context.factory.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,kHAAoH;AAGpH,+EAA2E;AAIpE,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IACzC,YAA6B,mCAAwE;QAAxE,wCAAmC,GAAnC,mCAAmC,CAAqC;IAAG,CAAC;IAEzG,MAAM,CAAC,MASN;QACC,OAAO;YACL,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,UAAU,EAAE,MAAM,CAAC,UAAU;YAC7B,YAAY,EAAE,SAAS;YAC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GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAItB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,YAAY;IACjB,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;IAdlC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqC;gBAGzC,GAAG,EAAE,UAAU,EACf,KAAK,EAAE,mBAAmB,EAI1B,OAAO,EAAE,WAAW,EACpB,WAAW,EAAE,iBAAiB,EAC9B,YAAY,EAAE,kBAAkB,EAChC,UAAU,EAAE,kBAAkB,EAC9B,QAAQ,EAAE,cAAc,EACxB,YAAY,EAAE,YAAY,EACd,EAAE,CAAC,EAAE,gBAAgB;IAG9C,OAAO,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,qBAAqB,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;IA6PhG,OAAO,CAAC,eAAe;IAuBvB,OAAO,CAAC,aAAa;CAOtB"}
|
|
@@ -66,10 +66,14 @@ let GraphNodeService = GraphNodeService_1 = class GraphNodeService {
|
|
|
66
66
|
}
|
|
67
67
|
async execute(params) {
|
|
68
68
|
const state = params.state;
|
|
69
|
+
// Every graph tool built below reads scopeId/scopeType off this context —
|
|
70
|
+
// it is the only channel confining the whole turn to one scope root.
|
|
69
71
|
const ctx = {
|
|
70
72
|
companyId: state.companyId,
|
|
71
73
|
userId: state.userId,
|
|
72
74
|
userModuleIds: state.userModuleIds ?? [],
|
|
75
|
+
scopeId: state.scopeId,
|
|
76
|
+
scopeType: state.scopeType,
|
|
73
77
|
};
|
|
74
78
|
if (ctx.userModuleIds.length === 0) {
|
|
75
79
|
const out = {
|
|
@@ -94,6 +98,11 @@ let GraphNodeService = GraphNodeService_1 = class GraphNodeService {
|
|
|
94
98
|
if (this.ws) {
|
|
95
99
|
const ws = this.ws;
|
|
96
100
|
const userId = state.userId;
|
|
101
|
+
// id → human label, harvested from each tool result as the turn runs.
|
|
102
|
+
// The id-taking tools (read_entity, traverse) only ever receive a uuid,
|
|
103
|
+
// so without this the status line can only print the uuid back at the
|
|
104
|
+
// user. resolve_entity/search_entities run first and carry the names.
|
|
105
|
+
const labels = new Map();
|
|
97
106
|
tools = tools.map((t) => new tools_1.DynamicStructuredTool({
|
|
98
107
|
name: t.name,
|
|
99
108
|
description: t.description,
|
|
@@ -101,14 +110,21 @@ let GraphNodeService = GraphNodeService_1 = class GraphNodeService {
|
|
|
101
110
|
func: async (input) => {
|
|
102
111
|
try {
|
|
103
112
|
await ws.sendMessageToUser(userId, "assistant:status", {
|
|
104
|
-
status: (0, humanize_tool_1.humanizeTool)(t.name, input),
|
|
113
|
+
status: (0, humanize_tool_1.humanizeTool)(t.name, input, labels),
|
|
105
114
|
at: new Date().toISOString(),
|
|
106
115
|
});
|
|
107
116
|
}
|
|
108
117
|
catch (err) {
|
|
109
118
|
this.logger.warn(`assistant:status emit failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
110
119
|
}
|
|
111
|
-
|
|
120
|
+
const result = await t.func(input);
|
|
121
|
+
try {
|
|
122
|
+
(0, humanize_tool_1.collectEntityLabels)(result, labels);
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
this.logger.warn(`assistant:status label harvest failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
126
|
+
}
|
|
127
|
+
return result;
|
|
112
128
|
},
|
|
113
129
|
}));
|
|
114
130
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.node.service.js","sourceRoot":"","sources":["../../../../src/agents/responder/nodes/graph.node.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA8D;AAC9D,6BAAwB;AACxB,iDAA8D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P,uCAAiB;QAChB,yCAAkB;QACpB,yCAAkB;QACpB,iCAAc;QACV,4BAAY;QACT,oCAAgB;GAfzC,gBAAgB,CA4R5B"}
|
|
1
|
+
{"version":3,"file":"graph.node.service.js","sourceRoot":"","sources":["../../../../src/agents/responder/nodes/graph.node.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAA8D;AAC9D,6BAAwB;AACxB,iDAA8D;AAC9D,0FAAsF;AACtF,wEAAoE;AACpE,sFAAiF;AACjF,iEAA6E;AAC7E,+EAA0E;AAC1E,iFAA4E;AAC5E,iFAA4E;AAC5E,yEAAoE;AACpE,mEAA+D;AAC/D,2FAA2F;AAC3F,sEAAuF;AAI1E,QAAA,mBAAmB,GAAG,EAAE,CAAC;AACzB,QAAA,wBAAwB,GAAG,MAAM,CAAC;AAE/C,MAAM,iBAAiB,GAAG;;;;;;iPAMuN,CAAC;AAElP,MAAM,aAAa,GAAG,6FAA6F,CAAC;AAEpH,MAAM,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACjC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,QAAQ,EAAE,OAAC,CAAC,KAAK,CACf,OAAC,CAAC,MAAM,CAAC;QACP,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;QAChB,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE;QACd,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;QAClB,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;KACjD,CAAC,CACH;IACD,IAAI,EAAE,OAAC,CAAC,OAAO,EAAE;CAClB,CAAC,CAAC;AAGI,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAG3B,YACmB,GAAe,EACf,KAA0B;IAC3C,0EAA0E;IAC1E,0DAA0D;IAEzC,OAAoB,EACpB,WAA8B,EAC9B,YAAgC,EAChC,U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AAmB;oBACvC,CAAC,CAAC,GAAG,CAAC;YACZ,mBAAmB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO;YACL,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,kBAAkB,EAAE,GAAG,CAAC,QAAQ,CAAC,MAAM;YACvC,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,YAAY,EAAE,GAAG,CAAC,YAAY;YAC9B,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,GAAG,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,mBAAmB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC/D,CAAC;IACJ,CAAC;IAEO,aAAa,CAAC,KAA4B;QAChD,OAAO;YACL,QAAQ,EAAE,OAAO;YACjB,SAAS,EAAE,WAAW;YACtB,YAAY,EAAE,KAAK,CAAC,QAAQ;SAC7B,CAAC;IACJ,CAAC;CACF,CAAA;AA7SY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;IAgBR,WAAA,IAAA,iBAAQ,GAAE,CAAA;qCAXW,wBAAU;QACR,2CAAmB;QAIjB,0BAAW;QACP,uCAAiB;QAChB,yCAAkB;QACpB,yCAAkB;QACpB,iCAAc;QACV,4BAAY;QACT,oCAAgB;GAfzC,gBAAgB,CA6S5B"}
|
|
@@ -3,7 +3,7 @@ import { BaseConfigInterface } from "../../../config/interfaces";
|
|
|
3
3
|
import { LLMService } from "../../../core/llm/services/llm.service";
|
|
4
4
|
import { GraphCatalogService } from "../../graph/services/graph.catalog.service";
|
|
5
5
|
import { ResponderContextState } from "../contexts/responder.context";
|
|
6
|
-
export declare const defaultPlannerPrompt = "\nYou decide which retrieval branches a unified assistant should run for a single user turn.\n\nYou have three branches to choose from (subset, not exclusive):\n- runGraph \u2192 traverses entities (accounts, orders, etc.) the user has access to via tools\n- runContextualiser \u2192 multi-hop document retrieval (chunks, atomic facts, key concepts)\n- runDrift \u2192 community-level summary search\n\nDecide based on the user's question, prior chat history, the available entity catalog, and any content scope.\nYou MUST select at least one branch. Prefer multiple branches in parallel when the question could plausibly draw on more than one.\n\nRefine the question into a single canonical form that all chosen branches can use.\n\nWhen you produce `refinedQuestion`, preserve every proper-noun-looking span in the user's question verbatim. Do not change \"and\" to \"or\" (or vice versa) inside what could be a name; do not collapse, expand, split, or pluralise names. The graph branch uses `refinedQuestion` as the user's literal phrase to look up records \u2014 paraphrasing breaks the lookup. If you must restructure the question, do so around the names, not over them.\n\nReturn STRICTLY: { runGraph, runContextualiser, runDrift, reasoning, refinedQuestion }.\n";
|
|
6
|
+
export declare const defaultPlannerPrompt = "\nYou decide which retrieval branches a unified assistant should run for a single user turn.\n\nYou have three branches to choose from (subset, not exclusive):\n- runGraph \u2192 traverses entities (accounts, orders, etc.) the user has access to via tools\n- runContextualiser \u2192 multi-hop document retrieval (chunks, atomic facts, key concepts)\n- runDrift \u2192 community-level summary search\n\nDecide based on the user's question, prior chat history, the available entity catalog, and any content scope.\nYou MUST select at least one branch. Prefer multiple branches in parallel when the question could plausibly draw on more than one.\n\n`seedTitles` lists context sections the host application already guarantees will be present at the answer stage. Plan retrieval for what they do NOT cover \u2014 never pick a branch solely to re-fetch that same context.\n\nRefine the question into a single canonical form that all chosen branches can use.\n\nWhen you produce `refinedQuestion`, preserve every proper-noun-looking span in the user's question verbatim. Do not change \"and\" to \"or\" (or vice versa) inside what could be a name; do not collapse, expand, split, or pluralise names. The graph branch uses `refinedQuestion` as the user's literal phrase to look up records \u2014 paraphrasing breaks the lookup. If you must restructure the question, do so around the names, not over them.\n\nReturn STRICTLY: { runGraph, runContextualiser, runDrift, reasoning, refinedQuestion }.\n";
|
|
7
7
|
export declare class PlannerNodeService {
|
|
8
8
|
private readonly llm;
|
|
9
9
|
private readonly catalog;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner.node.service.d.ts","sourceRoot":"","sources":["../../../../src/agents/responder/nodes/planner.node.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,mBAAmB,EAA0B,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"planner.node.service.d.ts","sourceRoot":"","sources":["../../../../src/agents/responder/nodes/planner.node.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAE/C,OAAO,EAAE,mBAAmB,EAA0B,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAkBtE,eAAO,MAAM,oBAAoB,s+CAkBhC,CAAC;AAEF,qBACa,kBAAkB;IAK3B,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,aAAa;IANhC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;IAC9D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;gBAGnB,GAAG,EAAE,UAAU,EACf,OAAO,EAAE,mBAAmB,EAC5B,aAAa,EAAE,aAAa,CAAC,mBAAmB,CAAC;IAM9D,OAAO,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,qBAAqB,CAAA;KAAE,GAAG,OAAO,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;CAiEjG"}
|
|
@@ -28,6 +28,7 @@ const PlannerInputSchema = zod_1.z.object({
|
|
|
28
28
|
catalog: zod_1.z.string(),
|
|
29
29
|
history: zod_1.z.array(zod_1.z.object({ role: zod_1.z.string(), content: zod_1.z.string() })),
|
|
30
30
|
contentScope: zod_1.z.object({ contentType: zod_1.z.string(), contentId: zod_1.z.string() }).nullable(),
|
|
31
|
+
seedTitles: zod_1.z.array(zod_1.z.string()),
|
|
31
32
|
});
|
|
32
33
|
exports.defaultPlannerPrompt = `
|
|
33
34
|
You decide which retrieval branches a unified assistant should run for a single user turn.
|
|
@@ -40,6 +41,8 @@ You have three branches to choose from (subset, not exclusive):
|
|
|
40
41
|
Decide based on the user's question, prior chat history, the available entity catalog, and any content scope.
|
|
41
42
|
You MUST select at least one branch. Prefer multiple branches in parallel when the question could plausibly draw on more than one.
|
|
42
43
|
|
|
44
|
+
\`seedTitles\` lists context sections the host application already guarantees will be present at the answer stage. Plan retrieval for what they do NOT cover — never pick a branch solely to re-fetch that same context.
|
|
45
|
+
|
|
43
46
|
Refine the question into a single canonical form that all chosen branches can use.
|
|
44
47
|
|
|
45
48
|
When you produce \`refinedQuestion\`, preserve every proper-noun-looking span in the user's question verbatim. Do not change "and" to "or" (or vice versa) inside what could be a name; do not collapse, expand, split, or pluralise names. The graph branch uses \`refinedQuestion\` as the user's literal phrase to look up records — paraphrasing breaks the lookup. If you must restructure the question, do so around the names, not over them.
|
|
@@ -60,6 +63,7 @@ let PlannerNodeService = PlannerNodeService_1 = class PlannerNodeService {
|
|
|
60
63
|
const catalogText = this.catalog.getTypeIndexFor(state.userModuleIds ?? []);
|
|
61
64
|
const history = (state.chatHistory ?? []).map((m) => ({ role: String(m.type), content: m.content }));
|
|
62
65
|
const contentScope = state.contentId && state.contentType ? { contentType: state.contentType, contentId: state.contentId } : null;
|
|
66
|
+
const seedTitles = (state.seedContexts ?? []).map((s) => s.title);
|
|
63
67
|
try {
|
|
64
68
|
const out = await this.llm.call({
|
|
65
69
|
systemPrompts: [this.systemPrompt],
|
|
@@ -69,6 +73,7 @@ let PlannerNodeService = PlannerNodeService_1 = class PlannerNodeService {
|
|
|
69
73
|
catalog: catalogText,
|
|
70
74
|
history,
|
|
71
75
|
contentScope,
|
|
76
|
+
seedTitles,
|
|
72
77
|
},
|
|
73
78
|
outputSchema: PlannerOutputSchema,
|
|
74
79
|
temperature: 0.0,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"planner.node.service.js","sourceRoot":"","sources":["../../../../src/agents/responder/nodes/planner.node.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,2CAA+C;AAC/C,6BAAwB;AAExB,wEAAoE;AACpE,sFAAiF;AAGjF,MAAM,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE;IACrB,iBAAiB,EAAE,OAAC,CAAC,OAAO,EAAE;IAC9B,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE;IACrB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE;CAC5B,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IACrE,YAAY,EAAE,OAAC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"planner.node.service.js","sourceRoot":"","sources":["../../../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KAAK,EAAE;oBACL,OAAO,EAAE,EAAE,SAAS,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE;oBACvF,WAAW,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE;iBAC9B;aACT,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AA9EY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAMa,wBAAU;QACN,2CAAmB;QACb,sBAAa;GAPpC,kBAAkB,CA8E9B"}
|
|
@@ -1,13 +1,45 @@
|
|
|
1
1
|
import { ConfigService } from "@nestjs/config";
|
|
2
|
+
import { z } from "zod";
|
|
2
3
|
import { BaseConfigInterface } from "../../../config/interfaces";
|
|
3
4
|
import { LLMService } from "../../../core/llm/services/llm.service";
|
|
4
5
|
import { ResponderContext, ResponderContextState } from "../../responder/contexts/responder.context";
|
|
5
|
-
export declare const defaultAnswerPrompt = "\nYou are the synthesizer of a unified ERP assistant. You are given a user\nquestion and the results of up to three retrieval branches that ran in\nparallel before you. Your job is to write a clear, useful answer using\nONLY the data those branches returned.\n\n## What you receive\n\nEach turn arrives with these inputs:\n\n- `question` \u2014 the user's refined question.\n- `graphSection` \u2014 the graph branch's own prose reply about the records it\n loaded, followed by an \"--- entities for citation ---\" block listing each\n cited entity as `[ref:N] type \u2014 reason` plus an optional JSON block of\n field values. Treat the prose at the top of `graphSection` as the\n authoritative graph result; weave it into the unified answer rather than\n restating the entity list line-by-line. The `[ref:N]` handles are opaque\n reference tokens \u2014 use them only inside the `references` array, never\n inside `finalAnswer` or `title`.\n- `notebookSection` \u2014 chunks the contextualiser branch retrieved from the\n document store, each prefixed with its chunkId followed by a snippet of\n text.\n- `driftSection` \u2014 community-level summaries (when the drift branch ran).\n- `scopeSection` \u2014 optional scope hint when the conversation is bound to a\n single content.\n- `branchesUsed` \u2014 list of branches that produced data this turn.\n\nA section is the empty string `\"\"` when its branch did not run. When all\ndata sections are empty, you have no information for this turn \u2014 say so\nplainly without referencing \"company knowledge\", \"notebook\", or other\nsystem internals.\n\n## How to write the answer\n\n1. **Identify the user's intent.** Are they asking for a list, a single\n fact, a procedure, a status, or a comparison? Match the answer's shape\n to the question.\n\n2. **Use the graph branch's prose as authoritative graph data.** The\n prose at the top of `graphSection` was written by the same component\n that loaded the records; it already contains the field values, names,\n and statuses. Weave it into `finalAnswer`. You may reorganise it,\n merge it with material from `notebookSection` or `driftSection`, or\n tighten the wording \u2014 but do not invent values that are not in the\n prose, the entity field blocks, or the chunks.\n\n3. **Quote chunk content faithfully.** When you draw from\n `notebookSection`, quote or paraphrase the snippet rather than\n substituting your own restatement.\n\n4. **Cite the chunks that grounded a document answer.** When you quote or\n paraphrase from `notebookSection`, add the chunkId to `citations` with\n a relevance score 0\u2013100. Use only chunkIds that actually appear in\n `notebookSection`. If `notebookSection` is empty, `citations` MUST be\n `[]`.\n\n5. **Cite the entities that grounded
|
|
6
|
+
export declare const defaultAnswerPrompt = "\nYou are the synthesizer of a unified ERP assistant. You are given a user\nquestion and the results of up to three retrieval branches that ran in\nparallel before you. Your job is to write a clear, useful answer using\nONLY the data those branches returned.\n\n## What you receive\n\nEach turn arrives with these inputs:\n\n- `question` \u2014 the user's refined question.\n- `graphSection` \u2014 the graph branch's own prose reply about the records it\n loaded, followed by an \"--- entities for citation ---\" block listing each\n cited entity as `[ref:N] type \u2014 reason` plus an optional JSON block of\n field values. Treat the prose at the top of `graphSection` as the\n authoritative graph result; weave it into the unified answer rather than\n restating the entity list line-by-line. The `[ref:N]` handles are opaque\n reference tokens \u2014 use them only inside the `references` array, never\n inside `finalAnswer` or `title`.\n- `notebookSection` \u2014 chunks the contextualiser branch retrieved from the\n document store, each prefixed with its chunkId followed by a snippet of\n text.\n- `driftSection` \u2014 community-level summaries (when the drift branch ran).\n- `seedSection` \u2014 context blocks the host application guarantees are\n present for this conversation, independent of retrieval. Treat them as\n authoritative data on par with the retrieval branches. When a block\n carries an \"entities for citation\" list, those `[ref:N]` handles are\n citable in `references`.\n- `scopeSection` \u2014 optional scope hint when the conversation is bound to a\n single content.\n- `branchesUsed` \u2014 list of branches that produced data this turn.\n\nA section is the empty string `\"\"` when its branch did not run. When all\ndata sections are empty, you have no information for this turn \u2014 say so\nplainly without referencing \"company knowledge\", \"notebook\", or other\nsystem internals.\n\n## How to write the answer\n\n1. **Identify the user's intent.** Are they asking for a list, a single\n fact, a procedure, a status, or a comparison? Match the answer's shape\n to the question.\n\n2. **Use the graph branch's prose as authoritative graph data.** The\n prose at the top of `graphSection` was written by the same component\n that loaded the records; it already contains the field values, names,\n and statuses. Weave it into `finalAnswer`. You may reorganise it,\n merge it with material from `notebookSection` or `driftSection`, or\n tighten the wording \u2014 but do not invent values that are not in the\n prose, the entity field blocks, or the chunks.\n\n3. **Quote chunk content faithfully.** When you draw from\n `notebookSection`, quote or paraphrase the snippet rather than\n substituting your own restatement.\n\n4. **Cite the chunks that grounded a document answer.** When you quote or\n paraphrase from `notebookSection`, add the chunkId to `citations` with\n a relevance score 0\u2013100. Use only chunkIds that actually appear in\n `notebookSection`. If `notebookSection` is empty, `citations` MUST be\n `[]`.\n\n5. **Cite the entities that grounded the answer.** Every entity whose\n information the answer relies on goes into `references` as\n `{ ref, relevance, reason }`, with the `ref` handle copied verbatim\n from the \"entities for citation\" block of `graphSection` or\n `seedSection` (e.g. `\"ref:0\"`). Never invent a handle. Never put a\n chunk into `references`; never put an entity into `citations`. If\n neither section lists an entity, `references` MUST be `[]`.\n\n6. **No handles, no UUIDs in user-facing text.** `title` and\n `finalAnswer` must not contain the word \"ref\", the bracketed handle,\n or any UUID. The handles are translated back to real (type, id) pairs\n after you return.\n\n7. **Suggested questions are optional.** If the answer is solid and\n obvious next-step questions exist, propose 3\u20135; otherwise return `[]`.\n Do not return suggestions when you had no data.\n\n8. **No-data case.** If every data section is empty (or together they do\n not cover what the user asked), say so directly. Do not say \"answer\n is not available in the company knowledge\" \u2014 that is a bad system\n phrase. Return `citations: []` and `references: []` in this case.\n\n## Output schema\n\nReturn strictly:\n\n- `title` \u2014 short headline for the UI (under ~70 chars). No handles, no UUIDs.\n- `analyse` \u2014 one to three sentences describing how you derived the answer\n (which branches you used, which records you compared). Internal-facing.\n No handles.\n- `finalAnswer` \u2014 the user-facing markdown answer. Use headings sparingly,\n bullet lists where they help, and field values from the graph branch's\n prose and entity field blocks. No handles, no UUIDs.\n- `citations` \u2014 array of `{ chunkId, relevance }` for chunks you used.\n- `references` \u2014 array of `{ ref, relevance, reason }` for entities you used.\n- `questions` \u2014 array of follow-up question strings.\n";
|
|
7
|
+
/** Historical default for the output schema's `analyse` field description. */
|
|
8
|
+
export declare const defaultResponderAnalyseDescription = "You should first analyse each notebook content before providing a final answer. During the analysis, consider complementary information from other notes and employ a majority voting strategy to resolve any inconsistencies.";
|
|
9
|
+
/** Historical default for the output schema's `finalAnswer` field description. */
|
|
10
|
+
export declare const defaultResponderFinalAnswerDescription = "Generate a comprehensive, detailed, and well-structured final answer using only information from the notebook. If insufficient information is available, clearly state that the answer is not available in the company knowledge.\n\nFormat Requirements:\n- Use proper markdown formatting with headers (##, ###) to organize content into logical sections\n- Include bullet points or numbered lists for multiple items, steps, or concepts\n- Expand on concepts with thorough explanations rather than brief summaries\n- Use subheadings to break complex topics into digestible parts\n- Provide detailed context and background information to help users understand completely\n- Include specific examples or details from the notebook when available\n- Ensure the answer flows logically and is educational in nature\n- Make the response comprehensive and informative, not minimalistic\n ";
|
|
11
|
+
/**
|
|
12
|
+
* Builds the responder answer node's structured-output schema. The `analyse`
|
|
13
|
+
* and `finalAnswer` descriptions are overridable via
|
|
14
|
+
* `ConfigPromptsInterface.responderSchemaDescriptions`; all other fields are
|
|
15
|
+
* fixed. Called with no arguments, the schema is identical to the historical
|
|
16
|
+
* hardcoded one.
|
|
17
|
+
*/
|
|
18
|
+
export declare const buildResponderOutputSchema: (descriptions?: {
|
|
19
|
+
analyse?: string;
|
|
20
|
+
finalAnswer?: string;
|
|
21
|
+
}) => z.ZodObject<{
|
|
22
|
+
title: z.ZodString;
|
|
23
|
+
analyse: z.ZodString;
|
|
24
|
+
citations: z.ZodArray<z.ZodObject<{
|
|
25
|
+
chunkId: z.ZodString;
|
|
26
|
+
relevance: z.ZodNumber;
|
|
27
|
+
}, z.core.$strip>>;
|
|
28
|
+
references: z.ZodArray<z.ZodObject<{
|
|
29
|
+
ref: z.ZodString;
|
|
30
|
+
relevance: z.ZodNumber;
|
|
31
|
+
reason: z.ZodString;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
questions: z.ZodArray<z.ZodString>;
|
|
34
|
+
finalAnswer: z.ZodString;
|
|
35
|
+
}, z.core.$strip>;
|
|
6
36
|
export declare class ResponderAnswerNodeService {
|
|
7
37
|
private readonly llmService;
|
|
8
38
|
private readonly configService;
|
|
9
39
|
private readonly logger;
|
|
10
40
|
private readonly systemPrompt;
|
|
41
|
+
private readonly outputSchema;
|
|
42
|
+
private readonly temperature;
|
|
11
43
|
constructor(llmService: LLMService, configService: ConfigService<BaseConfigInterface>);
|
|
12
44
|
execute(params: {
|
|
13
45
|
state: typeof ResponderContext.State;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"responder.answer.node.service.d.ts","sourceRoot":"","sources":["../../../../src/agents/responder/nodes/responder.answer.node.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"responder.answer.node.service.d.ts","sourceRoot":"","sources":["../../../../src/agents/responder/nodes/responder.answer.node.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAA0B,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,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