@carlonicora/nestjs-neo4jsonapi 3.1.1 → 3.2.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/dist/agents/graph/graph.module.d.ts.map +1 -1
- package/dist/agents/graph/graph.module.js +8 -1
- package/dist/agents/graph/graph.module.js.map +1 -1
- package/dist/agents/graph/interfaces/graph.catalog.interface.d.ts +8 -0
- package/dist/agents/graph/interfaces/graph.catalog.interface.d.ts.map +1 -1
- package/dist/agents/graph/prompts/graph.node.system.prompt.d.ts +1 -1
- package/dist/agents/graph/prompts/graph.node.system.prompt.d.ts.map +1 -1
- package/dist/agents/graph/prompts/graph.node.system.prompt.js +4 -2
- package/dist/agents/graph/prompts/graph.node.system.prompt.js.map +1 -1
- package/dist/agents/graph/services/field-formatting.d.ts +41 -7
- package/dist/agents/graph/services/field-formatting.d.ts.map +1 -1
- package/dist/agents/graph/services/field-formatting.js +111 -17
- package/dist/agents/graph/services/field-formatting.js.map +1 -1
- package/dist/agents/graph/services/graph.catalog.service.d.ts +3 -0
- package/dist/agents/graph/services/graph.catalog.service.d.ts.map +1 -1
- package/dist/agents/graph/services/graph.catalog.service.js +38 -5
- package/dist/agents/graph/services/graph.catalog.service.js.map +1 -1
- package/dist/agents/graph/services/materialise-bridge.d.ts +4 -1
- package/dist/agents/graph/services/materialise-bridge.d.ts.map +1 -1
- package/dist/agents/graph/services/materialise-bridge.js +10 -7
- package/dist/agents/graph/services/materialise-bridge.js.map +1 -1
- package/dist/agents/graph/services/related-edges.service.d.ts +40 -0
- package/dist/agents/graph/services/related-edges.service.d.ts.map +1 -0
- package/dist/agents/graph/services/related-edges.service.js +61 -0
- package/dist/agents/graph/services/related-edges.service.js.map +1 -0
- package/dist/agents/graph/tools/describe-entity.tool.d.ts.map +1 -1
- package/dist/agents/graph/tools/describe-entity.tool.js +1 -0
- package/dist/agents/graph/tools/describe-entity.tool.js.map +1 -1
- package/dist/agents/graph/tools/read-entity.tool.d.ts +5 -3
- package/dist/agents/graph/tools/read-entity.tool.d.ts.map +1 -1
- package/dist/agents/graph/tools/read-entity.tool.js +33 -10
- package/dist/agents/graph/tools/read-entity.tool.js.map +1 -1
- package/dist/agents/graph/tools/search-entities.tool.d.ts +3 -1
- package/dist/agents/graph/tools/search-entities.tool.d.ts.map +1 -1
- package/dist/agents/graph/tools/search-entities.tool.js +24 -13
- package/dist/agents/graph/tools/search-entities.tool.js.map +1 -1
- package/dist/agents/graph/tools/traverse.tool.d.ts +16 -1
- package/dist/agents/graph/tools/traverse.tool.d.ts.map +1 -1
- package/dist/agents/graph/tools/traverse.tool.js +123 -12
- package/dist/agents/graph/tools/traverse.tool.js.map +1 -1
- package/dist/agents/index.d.ts +2 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +6 -2
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/operator/tools/entity-write.tools.d.ts +3 -0
- package/dist/agents/operator/tools/entity-write.tools.d.ts.map +1 -1
- package/dist/agents/operator/tools/entity-write.tools.js +6 -0
- package/dist/agents/operator/tools/entity-write.tools.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 +28 -19
- package/dist/agents/responder/nodes/graph.node.service.js.map +1 -1
- package/dist/common/interfaces/entity.schema.interface.d.ts +10 -0
- package/dist/common/interfaces/entity.schema.interface.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.module.d.ts","sourceRoot":"","sources":["../../../src/agents/graph/graph.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"graph.module.d.ts","sourceRoot":"","sources":["../../../src/agents/graph/graph.module.ts"],"names":[],"mappings":"AAqBA;;;;;;;GAOG;AACH,qBA2Ca,WAAW;CAAG"}
|
|
@@ -10,12 +10,15 @@ exports.GraphModule = void 0;
|
|
|
10
10
|
// packages/nestjs-neo4jsonapi/src/agents/graph/graph.module.ts
|
|
11
11
|
const common_1 = require("@nestjs/common");
|
|
12
12
|
const scope_predicate_source_1 = require("../../common/repositories/scope-predicate.source");
|
|
13
|
+
const blocknote_module_1 = require("../../core/blocknote/blocknote.module");
|
|
13
14
|
const llm_module_1 = require("../../core/llm/llm.module");
|
|
14
15
|
const user_modules_repository_1 = require("./repositories/user-modules.repository");
|
|
15
16
|
const graph_index_manager_1 = require("./services/graph.index.manager");
|
|
16
17
|
const graph_search_service_1 = require("./services/graph.search.service");
|
|
17
18
|
const descriptor_source_1 = require("./services/descriptor.source");
|
|
18
19
|
const graph_catalog_service_1 = require("./services/graph.catalog.service");
|
|
20
|
+
const field_formatting_1 = require("./services/field-formatting");
|
|
21
|
+
const related_edges_service_1 = require("./services/related-edges.service");
|
|
19
22
|
const scope_guard_1 = require("./services/scope.guard");
|
|
20
23
|
const scope_predicate_service_1 = require("./services/scope.predicate.service");
|
|
21
24
|
const describe_entity_tool_1 = require("./tools/describe-entity.tool");
|
|
@@ -38,7 +41,7 @@ exports.GraphModule = GraphModule;
|
|
|
38
41
|
exports.GraphModule = GraphModule = __decorate([
|
|
39
42
|
(0, common_1.Global)(),
|
|
40
43
|
(0, common_1.Module)({
|
|
41
|
-
imports: [llm_module_1.LLMModule],
|
|
44
|
+
imports: [llm_module_1.LLMModule, blocknote_module_1.BlockNoteModule],
|
|
42
45
|
providers: [
|
|
43
46
|
descriptor_source_1.GraphDescriptorRegistry,
|
|
44
47
|
{
|
|
@@ -57,6 +60,8 @@ exports.GraphModule = GraphModule = __decorate([
|
|
|
57
60
|
graph_search_service_1.GraphSearchService,
|
|
58
61
|
scope_guard_1.ScopeGuard,
|
|
59
62
|
scope_predicate_service_1.ScopePredicateService,
|
|
63
|
+
field_formatting_1.ToolFieldFormatterService,
|
|
64
|
+
related_edges_service_1.RelatedEdgesService,
|
|
60
65
|
{ provide: scope_predicate_source_1.SCOPE_PREDICATE_SOURCE, useExisting: scope_predicate_service_1.ScopePredicateService },
|
|
61
66
|
],
|
|
62
67
|
exports: [
|
|
@@ -72,6 +77,8 @@ exports.GraphModule = GraphModule = __decorate([
|
|
|
72
77
|
graph_search_service_1.GraphSearchService,
|
|
73
78
|
scope_guard_1.ScopeGuard,
|
|
74
79
|
scope_predicate_service_1.ScopePredicateService,
|
|
80
|
+
field_formatting_1.ToolFieldFormatterService,
|
|
81
|
+
related_edges_service_1.RelatedEdgesService,
|
|
75
82
|
scope_predicate_source_1.SCOPE_PREDICATE_SOURCE,
|
|
76
83
|
],
|
|
77
84
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.module.js","sourceRoot":"","sources":["../../../src/agents/graph/graph.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+DAA+D;AAC/D,2CAAgD;AAChD,6FAA0F;AAC1F,0DAAsD;AACtD,oFAA+E;AAC/E,wEAAmE;AACnE,0EAAqE;AACrE,oEAAuE;AACvE,4EAAuE;AACvE,wDAAoD;AACpD,gFAA2E;AAC3E,uEAAkE;AAClE,+DAA0D;AAC1D,qEAAgE;AAChE,uEAAkE;AAClE,uDAAmD;AACnD,yDAAqD;AAErD;;;;;;;GAOG;
|
|
1
|
+
{"version":3,"file":"graph.module.js","sourceRoot":"","sources":["../../../src/agents/graph/graph.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,+DAA+D;AAC/D,2CAAgD;AAChD,6FAA0F;AAC1F,4EAAwE;AACxE,0DAAsD;AACtD,oFAA+E;AAC/E,wEAAmE;AACnE,0EAAqE;AACrE,oEAAuE;AACvE,4EAAuE;AACvE,kEAAwE;AACxE,4EAAuE;AACvE,wDAAoD;AACpD,gFAA2E;AAC3E,uEAAkE;AAClE,+DAA0D;AAC1D,qEAAgE;AAChE,uEAAkE;AAClE,uDAAmD;AACnD,yDAAqD;AAErD;;;;;;;GAOG;AA4CI,IAAM,WAAW,GAAjB,MAAM,WAAW;CAAG,CAAA;AAAd,kCAAW;sBAAX,WAAW;IA3CvB,IAAA,eAAM,GAAE;IACR,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,sBAAS,EAAE,kCAAe,CAAC;QACrC,SAAS,EAAE;YACT,2CAAuB;YACvB;gBACE,OAAO,EAAE,2CAAmB;gBAC5B,UAAU,EAAE,CAAC,GAA4B,EAAE,EAAE,CAAC,IAAI,2CAAmB,CAAC,GAAG,CAAC;gBAC1E,MAAM,EAAE,CAAC,2CAAuB,CAAC;aAClC;YACD,0BAAW;YACX,uCAAiB;YACjB,yCAAkB;YAClB,yCAAkB;YAClB,iCAAc;YACd,4BAAY;YACZ,+CAAqB;YACrB,uCAAiB;YACjB,yCAAkB;YAClB,wBAAU;YACV,+CAAqB;YACrB,4CAAyB;YACzB,2CAAmB;YACnB,EAAE,OAAO,EAAE,+CAAsB,EAAE,WAAW,EAAE,+CAAqB,EAAE;SACxE;QACD,OAAO,EAAE;YACP,2CAAuB;YACvB,2CAAmB;YACnB,+CAAqB;YACrB,0BAAW;YACX,uCAAiB;YACjB,yCAAkB;YAClB,yCAAkB;YAClB,iCAAc;YACd,4BAAY;YACZ,yCAAkB;YAClB,wBAAU;YACV,+CAAqB;YACrB,4CAAyB;YACzB,2CAAmB;YACnB,+CAAsB;SACvB;KACF,CAAC;GACW,WAAW,CAAG"}
|
|
@@ -32,6 +32,12 @@ export interface CatalogRelationship {
|
|
|
32
32
|
* Used by the traverse tool to pass the correct lookup key to
|
|
33
33
|
* AbstractRepository.findByRelated, which keys relationships by descriptor name. */
|
|
34
34
|
inverseKey?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Internal: true when the traversal is polymorphic — it has no single target
|
|
37
|
+
* type (`targetType` is `"*"`) and its results carry their own type. Compiled
|
|
38
|
+
* from `chat.related`; never declared on a descriptor relationship.
|
|
39
|
+
*/
|
|
40
|
+
polymorphic?: true;
|
|
35
41
|
}
|
|
36
42
|
export interface CatalogScopeHop {
|
|
37
43
|
/** Descriptor relationship key on the SOURCE type of this hop. */
|
|
@@ -74,5 +80,7 @@ export interface CatalogEntity {
|
|
|
74
80
|
scope?: CatalogScope;
|
|
75
81
|
/** Mirrors chat.writable. */
|
|
76
82
|
writable?: boolean;
|
|
83
|
+
/** Mirrors chat.list — stage-1 field names for list-returning tools. */
|
|
84
|
+
list?: string[];
|
|
77
85
|
}
|
|
78
86
|
//# sourceMappingURL=graph.catalog.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.catalog.interface.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/interfaces/graph.catalog.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AAE/E,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,oDAAoD;IACpD,UAAU,EAAE,OAAO,CAAC;IACpB,6CAA6C;IAC7C,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,KAAK,GAAG,MAAM,CAAC;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,eAAe,EAAE,KAAK,GAAG,IAAI,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,+FAA+F;IAC/F,SAAS,EAAE,OAAO,CAAC;IACnB;;;yFAGqF;IACrF,UAAU,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"graph.catalog.interface.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/interfaces/graph.catalog.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AAE/E,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AQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,OAAO,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;IACjB,0DAA0D;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,4FAA4F;IAC5F,MAAM,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACrC,+EAA+E;IAC/E,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GraphNodeDomainPrompts } from "../../../config/interfaces/config.prompts.interface";
|
|
2
|
-
export declare const GRAPH_NODE_SYSTEM_PROMPT_BASE = "# Role\n\n{DOMAIN_ROLE}\n\nThe data is stored as a graph \u2014 entities are nodes, and the connections between them are edges.\n\nYou answer the user's questions by traversing this graph: find the entities the question is about, read their fields, and walk the relationships between them to reach related entities, continuing until you have enough information to answer. Nearly every useful answer requires following at least one edge \u2014 a single search is rarely the whole story.\n\nEvery fact in your answer must come from a tool call that returned it. Do not invent field names, relationship names, entity types, or record contents.\n\n## Your data\n\n{GRAPH_MAP}\n\nThe list above is the complete inventory of entity types available to you \u2014 anything not listed does not exist. Each entry shows only the type and a one-line description; fields and relationships are not included here. To learn the fields and relationships of any type, call `describe_entity({ type })` \u2014 its response is the only authoritative source for that type's schema. Do not assume a field or relationship exists until `describe_entity` confirms it.\n\nA field marked `money` in the catalogue above is stored as an integer in minor units; its marker states how many decimals (e.g. `total_amount (number, money [integer stored in minor units (2 decimals); divide by 10^2 to display], ...)`). For these fields, every record returned by `read_entity`, `search_entities`, or `traverse` also carries a sibling `<name>_formatted` string \u2014 quote that string when narrating the value in your answer, and never quote the raw integer as if it were the display amount. Filters and sort still target the raw field, in minor units.\n\n{DOMAIN_DATA_CONVENTIONS}\n\n## Tools\n\nYou have five tools.\n\n**Never ask the user a clarifying question.** The user expects an answer, not a follow-up. After `resolve_entity` returns at least one usable candidate, immediately continue: `describe_entity` \u2192 `search_entities` / `traverse` / `read_entity` \u2192 answer. Do not stop the tool chain to confirm what to do next. If multiple candidates of different types could match, pick the one whose type and connected relationships best fit the user's question. State the assumption you made in the `reason` clause of the entity you return; do not ask the user.\n\n{DOMAIN_DISAMBIGUATION}\n\nBefore choosing a tool, check the \"Entities already in this conversation\" block that may be provided below. If the user's phrase refers to an entity listed there \u2014 by its exact name, by a partial name, or implicitly (\"them\", \"their\", \"other\", \"these\") \u2014 treat that entity as resolved. Use its `type` and `id` directly with `read_entity` or `traverse`. **A previous-turn record's nested relationships also carry their own `{ type, id }` \u2014 those ids are addressable, so call `read_entity` or `traverse` with them directly.** Do not call `resolve_entity` for a name that is already resolved in context, and do not call `resolve_entity` for a record whose id you already have.\n\nOtherwise, if the user names an entity \u2014 a person, a place, an organisation, a project, anything that could correspond to a record in the graph \u2014 your first tool call is `resolve_entity` with the user's literal phrase. Do not guess a type. `resolve_entity` returns candidates across every entity type in one shot; you then pick a candidate and proceed with `describe_entity` + the typed tools.\n\nSome entities in the catalog are marked `(bridge \u2192 \u2026)` in the type index. A bridge is a junction record whose own fields are minimal \u2014 the actionable data lives on the relationships named in the bridge marker. When `traverse`, `read_entity`, or `search_entities` returns a record of a bridge type, the response already contains those relationships' targets inlined as nested objects, alongside a `__materialised: [...]` array listing which keys were filled. Do not call `traverse` on a relationship that already appears in `__materialised` \u2014 its content is already in front of you. If a relationship is in the bridge's `materialiseTo` per `describe_entity` but missing from `__materialised`, the target is gated by your module access; do not retry that traverse \u2014 narrate the gap to the user.\n\n- `resolve_entity(text)` \u2014 look up nodes by name across every entity type in one call. Pass the user's literal phrase verbatim, including words like \"and\", \"&\", or other punctuation that may be part of a name. The response carries a `matchMode`, `items` sorted by `score` descending, and an optional `recommendation`:\n - `exact` or `fuzzy` \u2192\n - **If the response carries `recommendation`, follow it.** It surfaces a deterministic rule already applied to the candidates and is more reliable than re-deriving the rule each turn.\n - Otherwise: if `items[0].summary` equals the user's literal phrase (case-insensitive), `items[0]` is the answer \u2014 pick it without further disambiguation. Words like \"and\", \"&\", or commas inside that phrase are part of the name; never split the phrase into multiple `resolve_entity` calls and never ask the user to clarify between `items[0]` and lower-ranked items just because the phrase looks plural.\n - Otherwise: if `items.length === 1` or `items[0].score - items[1].score \u2265 0.15`, pick `items[0]`.\n - Otherwise: pick the most plausible candidate by name match and continue traversing \u2014 the question still has to be answered. Do not refuse the user when at least one usable candidate exists.\n - `semantic` \u2192 same rules, margin \u2265 0.08. The match is approximate; reflect that in the `reason` clause.\n - `none` \u2192 no record exists; tell the user in your answer and suggest rephrasing.\n\n- `describe_entity(type)` \u2014 inspect one entity type in full: every field with its type, and every relationship with its target type and description. Call this for every type you intend to touch, before searching, reading, or traversing it. The next three tools will refuse to run on a type that has not been described in this turn.\n\n- `search_entities(type, filters?, sort?, limit?)` \u2014 find records of a known type by filter and sort. Use this when you already have the type (from `resolve_entity` or because the user referred to a kind of record without naming a specific one, e.g. \"all records of that type created after a given date\"). `search_entities` does not search by name \u2014 to find a record by name, call `resolve_entity` first.\n\n- `read_entity(type, id, include?)` \u2014 fetch the full fields of a single node by id. Tool outputs from other tools are summaries; call this to get the complete record before reporting on it.\n\n- `traverse(fromType, fromId, relationship, filters?, sort?, limit?)` \u2014 walk one edge from a known node to its connected nodes. The `relationship` must be one listed under the source type in the catalogue. `filters` and `sort` apply to the target node's fields. This is the only way to cross from one entity type to another.\n\n{DOMAIN_DEPTH}\n\nIf a tool returns `{ error: \"\u2026\" }`, read the message \u2014 it usually lists valid fields or relationships, or tells you to call `describe_entity` first. Pick one of those and call the tool again. Recover within the same turn; do not apologise to the user for a tool error. Never stop on the first error.\n\n## Output\n\nReturn these fields:\n\n- `answer` \u2014 a concise prose reply (2\u20134 sentences for a single record, a markdown bullet list when enumerating) built from the actual field values and traversal results. When you report on a record, use its real field values, not its type name. When you report a money value, quote the `<name>_formatted` string from the record. When you report a date, use the date as it appears in the record.\n\n{DOMAIN_OUTPUT_RULES}\n\n- `entities` \u2014 every entity that contributes to the meaning of your `answer`, as `{ type, id, reason, fields? }`. An entity contributes when it is the subject the user asked about, or a record the answer reports a fact about. `reason` is one short clause explaining that role (for example \"the account the user asked about\", \"one of the records listed in the answer\"). Populate `fields` with the values you quoted in `answer`. Do not include entities you retrieved, inspected, and discarded: a `resolve_entity` call that returned three candidates of which you only used one \u2014 the other two are not entities to return; a `traverse` that walked an edge whose target you did not mention \u2014 not an entity. These entities are persisted and re-loaded as context on the next turn, so polluting them with irrelevant records will cause the next turn to confuse them with the actual subject \u2014 be strict.\n\n- `stop` \u2014 set to `true` once `answer` is complete and `entities` is the matching set.\n";
|
|
2
|
+
export declare const GRAPH_NODE_SYSTEM_PROMPT_BASE = "# Role\n\n{DOMAIN_ROLE}\n\nThe data is stored as a graph \u2014 entities are nodes, and the connections between them are edges.\n\nYou answer the user's questions by traversing this graph: find the entities the question is about, read their fields, and walk the relationships between them to reach related entities, continuing until you have enough information to answer. Nearly every useful answer requires following at least one edge \u2014 a single search is rarely the whole story.\n\nEvery fact in your answer must come from a tool call that returned it. Do not invent field names, relationship names, entity types, or record contents.\n\n## Your data\n\n{GRAPH_MAP}\n\nThe list above is the complete inventory of entity types available to you \u2014 anything not listed does not exist. Each entry shows only the type and a one-line description; fields and relationships are not included here. To learn the fields and relationships of any type, call `describe_entity({ type })` \u2014 its response is the only authoritative source for that type's schema. Do not assume a field or relationship exists until `describe_entity` confirms it.\n\nA field marked `money` in the catalogue above is stored as an integer in minor units; its marker states how many decimals (e.g. `total_amount (number, money [integer stored in minor units (2 decimals); divide by 10^2 to display], ...)`). For these fields, every record returned by `read_entity`, `search_entities`, or `traverse` also carries a sibling `<name>_formatted` string \u2014 quote that string when narrating the value in your answer, and never quote the raw integer as if it were the display amount. Filters and sort still target the raw field, in minor units.\n\n{DOMAIN_DATA_CONVENTIONS}\n\n## Tools\n\nYou have five tools.\n\n**Never ask the user a clarifying question.** The user expects an answer, not a follow-up. After `resolve_entity` returns at least one usable candidate, immediately continue: `describe_entity` \u2192 `search_entities` / `traverse` / `read_entity` \u2192 answer. Do not stop the tool chain to confirm what to do next. If multiple candidates of different types could match, pick the one whose type and connected relationships best fit the user's question. State the assumption you made in the `reason` clause of the entity you return; do not ask the user.\n\n{DOMAIN_DISAMBIGUATION}\n\nBefore choosing a tool, check the \"Entities already in this conversation\" block that may be provided below. If the user's phrase refers to an entity listed there \u2014 by its exact name, by a partial name, or implicitly (\"them\", \"their\", \"other\", \"these\") \u2014 treat that entity as resolved. Use its `type` and `id` directly with `read_entity` or `traverse`. **A previous-turn record's nested relationships also carry their own `{ type, id }` \u2014 those ids are addressable, so call `read_entity` or `traverse` with them directly.** Do not call `resolve_entity` for a name that is already resolved in context, and do not call `resolve_entity` for a record whose id you already have.\n\nOtherwise, if the user names an entity \u2014 a person, a place, an organisation, a project, anything that could correspond to a record in the graph \u2014 your first tool call is `resolve_entity` with the user's literal phrase. Do not guess a type. `resolve_entity` returns candidates across every entity type in one shot; you then pick a candidate and proceed with `describe_entity` + the typed tools.\n\nSome entities in the catalog are marked `(bridge \u2192 \u2026)` in the type index. A bridge is a junction record whose own fields are minimal \u2014 the actionable data lives on the relationships named in the bridge marker. When `traverse`, `read_entity`, or `search_entities` returns a record of a bridge type, the response already contains those relationships' targets inlined as nested objects, alongside a `__materialised: [...]` array listing which keys were filled. Do not call `traverse` on a relationship that already appears in `__materialised` \u2014 its content is already in front of you. If a relationship is in the bridge's `materialiseTo` per `describe_entity` but missing from `__materialised`, the target is gated by your module access; do not retry that traverse \u2014 narrate the gap to the user.\n\n- `resolve_entity(text)` \u2014 look up nodes by name across every entity type in one call. Pass the user's literal phrase verbatim, including words like \"and\", \"&\", or other punctuation that may be part of a name. The response carries a `matchMode`, `items` sorted by `score` descending, and an optional `recommendation`:\n - `exact` or `fuzzy` \u2192\n - **If the response carries `recommendation`, follow it.** It surfaces a deterministic rule already applied to the candidates and is more reliable than re-deriving the rule each turn.\n - Otherwise: if `items[0].summary` equals the user's literal phrase (case-insensitive), `items[0]` is the answer \u2014 pick it without further disambiguation. Words like \"and\", \"&\", or commas inside that phrase are part of the name; never split the phrase into multiple `resolve_entity` calls and never ask the user to clarify between `items[0]` and lower-ranked items just because the phrase looks plural.\n - Otherwise: if `items.length === 1` or `items[0].score - items[1].score \u2265 0.15`, pick `items[0]`.\n - Otherwise: pick the most plausible candidate by name match and continue traversing \u2014 the question still has to be answered. Do not refuse the user when at least one usable candidate exists.\n - `semantic` \u2192 same rules, margin \u2265 0.08. The match is approximate; reflect that in the `reason` clause.\n - `none` \u2192 no record exists; tell the user in your answer and suggest rephrasing.\n\n- `describe_entity(type)` \u2014 inspect one entity type in full: every field with its type, and every relationship with its target type and description. Call this for every type you intend to touch, before searching, reading, or traversing it. The next three tools will refuse to run on a type that has not been described in this turn.\n\n- `search_entities(type, filters?, sort?, limit?)` \u2014 find records of a known type by filter and sort. Use this when you already have the type (from `resolve_entity` or because the user referred to a kind of record without naming a specific one, e.g. \"all records of that type created after a given date\"). `search_entities` does not search by name \u2014 to find a record by name, call `resolve_entity` first.\n\n- `read_entity(type, id, include?)` \u2014 fetch the full fields of a single node by id. Tool outputs from other tools are summaries; call this to get the complete record before reporting on it. Calling `read_entity` again for a record already returned in full earlier in this conversation is refused with `{ alreadyRead: true }` \u2014 reuse the copy you already have instead of re-reading.\n\n- `traverse(fromType, fromId, relationship, filters?, sort?, limit?)` \u2014 walk one edge from a known node to its connected nodes. The `relationship` must be one listed under the source type in the catalogue. `filters` and `sort` apply to the target node's fields. This is the only way to cross from one entity type to another. A relationship named `related` is polymorphic: it returns records of mixed types linked to the source by mentions or GM-drawn links, each item tagged with its own `type` \u2014 treat each exactly like a `search_entities` result of that type; filters and sort do not apply to it.\n\nA list item from `search_entities` or `traverse` may carry `availableOnRead`: those fields exist on that record and were withheld from the list for size \u2014 call `read_entity` with the item's `type` and `id` to obtain them. A field absent from both `fields` and `availableOnRead` is empty, not withheld.\n\n{DOMAIN_DEPTH}\n\nIf a tool returns `{ error: \"\u2026\" }`, read the message \u2014 it usually lists valid fields or relationships, or tells you to call `describe_entity` first. Pick one of those and call the tool again. Recover within the same turn; do not apologise to the user for a tool error. Never stop on the first error.\n\n## Output\n\nReturn these fields:\n\n- `answer` \u2014 a concise prose reply (2\u20134 sentences for a single record, a markdown bullet list when enumerating) built from the actual field values and traversal results. When you report on a record, use its real field values, not its type name. When you report a money value, quote the `<name>_formatted` string from the record. When you report a date, use the date as it appears in the record.\n\n{DOMAIN_OUTPUT_RULES}\n\n- `entities` \u2014 every entity that contributes to the meaning of your `answer`, as `{ type, id, reason, fields? }`. An entity contributes when it is the subject the user asked about, or a record the answer reports a fact about. `reason` is one short clause explaining that role (for example \"the account the user asked about\", \"one of the records listed in the answer\"). Populate `fields` with the values you quoted in `answer`. Do not include entities you retrieved, inspected, and discarded: a `resolve_entity` call that returned three candidates of which you only used one \u2014 the other two are not entities to return; a `traverse` that walked an edge whose target you did not mention \u2014 not an entity. These entities are persisted and re-loaded as context on the next turn, so polluting them with irrelevant records will cause the next turn to confuse them with the actual subject \u2014 be strict.\n\n- `stop` \u2014 set to `true` once `answer` is complete and `entities` is the matching set.\n";
|
|
3
3
|
export declare function describeDomainLayer(domain?: GraphNodeDomainPrompts): string;
|
|
4
4
|
export declare function renderGraphNodeSystemPrompt(graphMap: string, domain?: GraphNodeDomainPrompts): string;
|
|
5
5
|
//# sourceMappingURL=graph.node.system.prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.node.system.prompt.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/prompts/graph.node.system.prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAE7F,eAAO,MAAM,6BAA6B
|
|
1
|
+
{"version":3,"file":"graph.node.system.prompt.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/prompts/graph.node.system.prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAE7F,eAAO,MAAM,6BAA6B,i9SAoEzC,CAAC;AAMF,wBAAgB,mBAAmB,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,MAAM,CAG3E;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,sBAAsB,GAAG,MAAM,CAerG"}
|
|
@@ -50,9 +50,11 @@ Some entities in the catalog are marked \`(bridge → …)\` in the type index.
|
|
|
50
50
|
|
|
51
51
|
- \`search_entities(type, filters?, sort?, limit?)\` — find records of a known type by filter and sort. Use this when you already have the type (from \`resolve_entity\` or because the user referred to a kind of record without naming a specific one, e.g. "all records of that type created after a given date"). \`search_entities\` does not search by name — to find a record by name, call \`resolve_entity\` first.
|
|
52
52
|
|
|
53
|
-
- \`read_entity(type, id, include?)\` — fetch the full fields of a single node by id. Tool outputs from other tools are summaries; call this to get the complete record before reporting on it.
|
|
53
|
+
- \`read_entity(type, id, include?)\` — fetch the full fields of a single node by id. Tool outputs from other tools are summaries; call this to get the complete record before reporting on it. Calling \`read_entity\` again for a record already returned in full earlier in this conversation is refused with \`{ alreadyRead: true }\` — reuse the copy you already have instead of re-reading.
|
|
54
54
|
|
|
55
|
-
- \`traverse(fromType, fromId, relationship, filters?, sort?, limit?)\` — walk one edge from a known node to its connected nodes. The \`relationship\` must be one listed under the source type in the catalogue. \`filters\` and \`sort\` apply to the target node's fields. This is the only way to cross from one entity type to another.
|
|
55
|
+
- \`traverse(fromType, fromId, relationship, filters?, sort?, limit?)\` — walk one edge from a known node to its connected nodes. The \`relationship\` must be one listed under the source type in the catalogue. \`filters\` and \`sort\` apply to the target node's fields. This is the only way to cross from one entity type to another. A relationship named \`related\` is polymorphic: it returns records of mixed types linked to the source by mentions or GM-drawn links, each item tagged with its own \`type\` — treat each exactly like a \`search_entities\` result of that type; filters and sort do not apply to it.
|
|
56
|
+
|
|
57
|
+
A list item from \`search_entities\` or \`traverse\` may carry \`availableOnRead\`: those fields exist on that record and were withheld from the list for size — call \`read_entity\` with the item's \`type\` and \`id\` to obtain them. A field absent from both \`fields\` and \`availableOnRead\` is empty, not withheld.
|
|
56
58
|
|
|
57
59
|
{DOMAIN_DEPTH}
|
|
58
60
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.node.system.prompt.js","sourceRoot":"","sources":["../../../../src/agents/graph/prompts/graph.node.system.prompt.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"graph.node.system.prompt.js","sourceRoot":"","sources":["../../../../src/agents/graph/prompts/graph.node.system.prompt.ts"],"names":[],"mappings":";;;AA4EA,kDAGC;AAED,kEAeC;AA9FY,QAAA,6BAA6B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoE5C,CAAC;AAEF,MAAM,YAAY,GAAG,oDAAoD,CAAC;AAE1E,MAAM,YAAY,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,aAAa,CAAU,CAAC;AAEpG,SAAgB,mBAAmB,CAAC,MAA+B;IACjE,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,IAAI,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;IACtG,OAAO,4BAA4B,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AACvD,CAAC;AAED,SAAgB,2BAA2B,CAAC,QAAgB,EAAE,MAA+B;IAC3F,yEAAyE;IACzE,6EAA6E;IAC7E,OAAO,qCAA6B,CAAC,OAAO,CAC1C,aAAa,EACb,GAAG,EAAE,CACH,QAAQ;QACR,4KAA4K,CAC/K;SACE,OAAO,CAAC,eAAe,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,YAAY,CAAC;SACpE,OAAO,CAAC,2BAA2B,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;SACjF,OAAO,CAAC,yBAAyB,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;SAC9E,OAAO,CAAC,gBAAgB,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;SAC5D,OAAO,CAAC,uBAAuB,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;SACzE,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BlockNoteService } from "../../../core/blocknote/services/blocknote.service";
|
|
2
2
|
import { FieldKind } from "../../../common/interfaces/entity.schema.interface";
|
|
3
|
+
import { CatalogEntity } from "../interfaces/graph.catalog.interface";
|
|
4
|
+
/**
|
|
5
|
+
* Stage-1 (list) length default for entities with no `chat.list` declaration.
|
|
6
|
+
* A rendered field whose string length exceeds this is withheld to
|
|
7
|
+
* `availableOnRead` instead of emitted. A declared `chat.list` has no
|
|
8
|
+
* backstop — this constant only governs the undeclared fallback.
|
|
9
|
+
* (spec § "Stage rules")
|
|
10
|
+
*/
|
|
11
|
+
export declare const LIST_FIELD_MAX_CHARS = 200;
|
|
12
|
+
export type ToolFieldStage = "list" | "detail";
|
|
13
|
+
export interface ToolFieldsResult {
|
|
14
|
+
fields: Record<string, unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* Described, non-empty fields withheld from a list projection. Omitted
|
|
17
|
+
* entirely when empty or when stage is "detail".
|
|
18
|
+
*/
|
|
19
|
+
availableOnRead?: string[];
|
|
20
|
+
}
|
|
3
21
|
/**
|
|
4
22
|
* Format a money field's raw minor-unit integer as a decimal string the LLM
|
|
5
23
|
* can safely quote to the user (e.g. 600 with minorUnits=2 → "6.00").
|
|
@@ -8,11 +26,27 @@ import { FieldKind } from "../../../common/interfaces/entity.schema.interface";
|
|
|
8
26
|
*/
|
|
9
27
|
export declare function formatMoneyField(value: unknown, kind: FieldKind): string | null;
|
|
10
28
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
29
|
+
* Renders a record's catalogued fields for a tool result and stages them
|
|
30
|
+
* between a `list` (digest) and `detail` (complete) projection.
|
|
31
|
+
*
|
|
32
|
+
* Rendering runs before staging so both stages benefit: richtext fields
|
|
33
|
+
* become markdown and empty values are dropped before the stage split ever
|
|
34
|
+
* sees them (spec § "Rendering, then staging").
|
|
16
35
|
*/
|
|
17
|
-
export declare
|
|
36
|
+
export declare class ToolFieldFormatterService {
|
|
37
|
+
private readonly blockNote;
|
|
38
|
+
constructor(blockNote: BlockNoteService);
|
|
39
|
+
build(params: {
|
|
40
|
+
entity: CatalogEntity;
|
|
41
|
+
record: Record<string, unknown>;
|
|
42
|
+
stage: ToolFieldStage;
|
|
43
|
+
}): ToolFieldsResult;
|
|
44
|
+
/**
|
|
45
|
+
* Defensive: anything that does not parse as a BlockNote node array passes
|
|
46
|
+
* through unchanged rather than throwing (spec § "Rendering, then
|
|
47
|
+
* staging" — malformed values must be harmless, not a 500).
|
|
48
|
+
*/
|
|
49
|
+
private renderRichtext;
|
|
50
|
+
private isEmpty;
|
|
51
|
+
}
|
|
18
52
|
//# sourceMappingURL=field-formatting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-formatting.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/services/field-formatting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"field-formatting.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/services/field-formatting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oDAAoD,CAAC;AACtF,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAEtE;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE/C,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAO/E;AAED;;;;;;;GAOG;AACH,qBACa,yBAAyB;IACxB,OAAO,CAAC,QAAQ,CAAC,SAAS;gBAAT,SAAS,EAAE,gBAAgB;IAExD,KAAK,CAAC,MAAM,EAAE;QAAE,MAAM,EAAE,aAAa,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,KAAK,EAAE,cAAc,CAAA;KAAE,GAAG,gBAAgB;IA2ClH;;;;OAIG;IACH,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,OAAO;CAGhB"}
|
|
@@ -1,7 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.ToolFieldFormatterService = exports.LIST_FIELD_MAX_CHARS = void 0;
|
|
3
13
|
exports.formatMoneyField = formatMoneyField;
|
|
4
|
-
|
|
14
|
+
const common_1 = require("@nestjs/common");
|
|
15
|
+
const blocknote_service_1 = require("../../../core/blocknote/services/blocknote.service");
|
|
16
|
+
/**
|
|
17
|
+
* Stage-1 (list) length default for entities with no `chat.list` declaration.
|
|
18
|
+
* A rendered field whose string length exceeds this is withheld to
|
|
19
|
+
* `availableOnRead` instead of emitted. A declared `chat.list` has no
|
|
20
|
+
* backstop — this constant only governs the undeclared fallback.
|
|
21
|
+
* (spec § "Stage rules")
|
|
22
|
+
*/
|
|
23
|
+
exports.LIST_FIELD_MAX_CHARS = 200;
|
|
5
24
|
/**
|
|
6
25
|
* Format a money field's raw minor-unit integer as a decimal string the LLM
|
|
7
26
|
* can safely quote to the user (e.g. 600 with minorUnits=2 → "6.00").
|
|
@@ -20,24 +39,99 @@ function formatMoneyField(value, kind) {
|
|
|
20
39
|
return (value / factor).toFixed(minor);
|
|
21
40
|
}
|
|
22
41
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
42
|
+
* Renders a record's catalogued fields for a tool result and stages them
|
|
43
|
+
* between a `list` (digest) and `detail` (complete) projection.
|
|
44
|
+
*
|
|
45
|
+
* Rendering runs before staging so both stages benefit: richtext fields
|
|
46
|
+
* become markdown and empty values are dropped before the stage split ever
|
|
47
|
+
* sees them (spec § "Rendering, then staging").
|
|
28
48
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
49
|
+
let ToolFieldFormatterService = class ToolFieldFormatterService {
|
|
50
|
+
constructor(blockNote) {
|
|
51
|
+
this.blockNote = blockNote;
|
|
52
|
+
}
|
|
53
|
+
build(params) {
|
|
54
|
+
const { entity, record, stage } = params;
|
|
55
|
+
// 1. Render every described field; drop empties. Declaration order is
|
|
56
|
+
// preserved because entity.fields drives the iteration.
|
|
57
|
+
const rendered = new Map();
|
|
58
|
+
for (const f of entity.fields) {
|
|
59
|
+
let value = record[f.name];
|
|
60
|
+
if (f.kind?.type === "richtext")
|
|
61
|
+
value = this.renderRichtext(value);
|
|
62
|
+
if (this.isEmpty(value))
|
|
63
|
+
continue;
|
|
64
|
+
rendered.set(f.name, value);
|
|
65
|
+
}
|
|
66
|
+
// 2. Stage split.
|
|
67
|
+
const emitted = [];
|
|
68
|
+
const withheld = [];
|
|
69
|
+
if (stage === "detail") {
|
|
70
|
+
emitted.push(...rendered.keys());
|
|
71
|
+
}
|
|
72
|
+
else if (entity.list) {
|
|
73
|
+
for (const name of entity.list)
|
|
74
|
+
if (rendered.has(name))
|
|
75
|
+
emitted.push(name);
|
|
76
|
+
for (const name of rendered.keys())
|
|
77
|
+
if (!entity.list.includes(name))
|
|
78
|
+
withheld.push(name);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
for (const [name, value] of rendered) {
|
|
82
|
+
const length = typeof value === "string" ? value.length : JSON.stringify(value).length;
|
|
83
|
+
(length <= exports.LIST_FIELD_MAX_CHARS ? emitted : withheld).push(name);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
// 3. Emit, with money companions (both stages).
|
|
87
|
+
const byName = new Map(entity.fields.map((f) => [f.name, f]));
|
|
88
|
+
const fields = {};
|
|
89
|
+
for (const name of emitted) {
|
|
90
|
+
const value = rendered.get(name);
|
|
91
|
+
fields[name] = value;
|
|
92
|
+
const kind = byName.get(name)?.kind;
|
|
93
|
+
if (kind?.type === "money") {
|
|
94
|
+
const formatted = formatMoneyField(value, kind);
|
|
95
|
+
if (formatted !== null)
|
|
96
|
+
fields[`${name}_formatted`] = formatted;
|
|
38
97
|
}
|
|
39
98
|
}
|
|
99
|
+
return withheld.length ? { fields, availableOnRead: withheld } : { fields };
|
|
40
100
|
}
|
|
41
|
-
|
|
42
|
-
|
|
101
|
+
/**
|
|
102
|
+
* Defensive: anything that does not parse as a BlockNote node array passes
|
|
103
|
+
* through unchanged rather than throwing (spec § "Rendering, then
|
|
104
|
+
* staging" — malformed values must be harmless, not a 500).
|
|
105
|
+
*/
|
|
106
|
+
renderRichtext(value) {
|
|
107
|
+
if (typeof value !== "string")
|
|
108
|
+
return value;
|
|
109
|
+
const trimmed = value.trim();
|
|
110
|
+
if (!trimmed.startsWith("["))
|
|
111
|
+
return value;
|
|
112
|
+
let nodes;
|
|
113
|
+
try {
|
|
114
|
+
nodes = JSON.parse(trimmed);
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return value;
|
|
118
|
+
}
|
|
119
|
+
if (!Array.isArray(nodes))
|
|
120
|
+
return value;
|
|
121
|
+
try {
|
|
122
|
+
return this.blockNote.convertToMarkdown({ nodes }).trim();
|
|
123
|
+
}
|
|
124
|
+
catch {
|
|
125
|
+
return value;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
isEmpty(value) {
|
|
129
|
+
return value == null || value === "" || (Array.isArray(value) && value.length === 0);
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
exports.ToolFieldFormatterService = ToolFieldFormatterService;
|
|
133
|
+
exports.ToolFieldFormatterService = ToolFieldFormatterService = __decorate([
|
|
134
|
+
(0, common_1.Injectable)(),
|
|
135
|
+
__metadata("design:paramtypes", [blocknote_service_1.BlockNoteService])
|
|
136
|
+
], ToolFieldFormatterService);
|
|
43
137
|
//# sourceMappingURL=field-formatting.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"field-formatting.js","sourceRoot":"","sources":["../../../../src/agents/graph/services/field-formatting.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"field-formatting.js","sourceRoot":"","sources":["../../../../src/agents/graph/services/field-formatting.ts"],"names":[],"mappings":";;;;;;;;;;;;AA+BA,4CAOC;AAtCD,2CAA4C;AAC5C,0FAAsF;AAItF;;;;;;GAMG;AACU,QAAA,oBAAoB,GAAG,GAAG,CAAC;AAaxC;;;;;GAKG;AACH,SAAgB,gBAAgB,CAAC,KAAc,EAAE,IAAe;IAC9D,IAAI,IAAI,CAAC,IAAI,KAAK,OAAO;QAAE,OAAO,IAAI,CAAC;IACvC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtE,MAAM,KAAK,GAAG,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC;IACnC,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,EAAE,IAAI,KAAK,CAAC;IAC3B,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;;GAOG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAAyB;IACpC,YAA6B,SAA2B;QAA3B,cAAS,GAAT,SAAS,CA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AAc;QACnC,IAAI,OAAO,KAAK,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAC;QAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;QAC7B,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;QAC3C,IAAI,KAAc,CAAC;QACnB,IAAI,CAAC;YACH,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC9B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;QACD,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YAAE,OAAO,KAAK,CAAC;QACxC,IAAI,CAAC;YACH,OAAO,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;QAC5D,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;IAEO,OAAO,CAAC,KAAc;QAC5B,OAAO,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;IACvF,CAAC;CACF,CAAA;AAxEY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,mBAAU,GAAE;qCAE6B,oCAAgB;GAD7C,yBAAyB,CAwErC"}
|
|
@@ -38,8 +38,11 @@ export interface DescriptorSource {
|
|
|
38
38
|
chat?: {
|
|
39
39
|
summary?: (d: any) => string;
|
|
40
40
|
textSearchFields?: string[];
|
|
41
|
+
list?: string[];
|
|
41
42
|
scope?: string;
|
|
42
43
|
writable?: boolean;
|
|
44
|
+
/** Compile a polymorphic chat-only "related" traversal (RELATES_TO, both directions). */
|
|
45
|
+
related?: boolean;
|
|
43
46
|
};
|
|
44
47
|
bridge?: {
|
|
45
48
|
materialiseTo: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph.catalog.service.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/services/graph.catalog.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EACL,aAAa,EAKd,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,oDAAoD,CAAC;AAe/E;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,OAAO,IAAI,KAAK,CAAC;QACf,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAC;QAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,EAAE,MAAM,CAAC;QACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,SAAS,CAAA;SAAE,CAAC,CAAC;QACjF,aAAa,EAAE,MAAM,CACnB,MAAM,EACN;YACE,KAAK,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,QAAQ,EAAE,MAAM,CAAC;gBAAC,SAAS,EAAE,MAAM,CAAA;aAAE,CAAC;YAC7D,SAAS,EAAE,IAAI,GAAG,KAAK,CAAC;YACxB,YAAY,EAAE,MAAM,CAAC;YACrB,WAAW,EAAE,KAAK,GAAG,MAAM,CAAC;YAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,OAAO,CAAC,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,WAAW,EAAE,MAAM,CAAA;aAAE,CAAC;SACjD,CACF,CAAC;QACF,IAAI,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"graph.catalog.service.d.ts","sourceRoot":"","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AE,CAAC;YAChB,KAAK,CAAC,EAAE,MAAM,CAAC;YACf,QAAQ,CAAC,EAAE,OAAO,CAAC;YACnB,yFAAyF;YACzF,OAAO,CAAC,EAAE,OAAO,CAAC;SACnB,CAAC;QACF,MAAM,CAAC,EAAE;YAAE,aAAa,EAAE,MAAM,EAAE,CAAA;SAAE,CAAC;KACtC,CAAC,CAAC;CACJ;AASD,qBACa,mBAAoB,YAAW,sBAAsB;IAMpD,OAAO,CAAC,QAAQ,CAAC,MAAM;IALnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAC/D,OAAO,CAAC,QAAQ,CAAoC;IACpD,2EAA2E;IAC3E,OAAO,CAAC,kBAAkB,CAA6B;gBAE1B,MAAM,EAAE,gBAAgB;IAErD,sBAAsB;IAItB,YAAY,IAAI,IAAI;IA2KpB;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IA+CpB,OAAO,CAAC,YAAY;IA0CpB,SAAS,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM;IAqB1C,OAAO,CAAC,iBAAiB;IAuBzB;;;;;;OAMG;IACH,eAAe,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM;IAYhD;;;OAGG;IACH,kBAAkB,CAAC,aAAa,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;IAUrD,yBAAyB,IAAI,aAAa,EAAE;IAQ5C;;;;;;;;OAQG;IACH,cAAc,IAAI,aAAa,EAAE;IAIjC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAI9B,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,aAAa,GAAG,IAAI;CAM7E"}
|
|
@@ -53,6 +53,14 @@ let GraphCatalogService = GraphCatalogService_1 = class GraphCatalogService {
|
|
|
53
53
|
sortable: SORTABLE_TYPES.has(def.type),
|
|
54
54
|
...(def.kind ? { kind: def.kind } : {}),
|
|
55
55
|
}));
|
|
56
|
+
if (d.chat?.list) {
|
|
57
|
+
const described = new Set(fields.map((f) => f.name));
|
|
58
|
+
for (const name of d.chat.list) {
|
|
59
|
+
if (!described.has(name)) {
|
|
60
|
+
throw new Error(`Entity "${d.model.type}" declares chat.list field "${name}", which is not a described field on it.`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
56
64
|
const relationships = [];
|
|
57
65
|
for (const [name, rel] of Object.entries(d.relationships)) {
|
|
58
66
|
if (!rel.description)
|
|
@@ -68,6 +76,19 @@ let GraphCatalogService = GraphCatalogService_1 = class GraphCatalogService {
|
|
|
68
76
|
isReverse: false,
|
|
69
77
|
});
|
|
70
78
|
}
|
|
79
|
+
if (d.chat?.related) {
|
|
80
|
+
relationships.push({
|
|
81
|
+
name: "related",
|
|
82
|
+
sourceType: d.model.type,
|
|
83
|
+
targetType: "*",
|
|
84
|
+
cardinality: "many",
|
|
85
|
+
description: "Records linked to this one by mentions or GM-drawn links. Results carry their own type.",
|
|
86
|
+
cypherDirection: "out",
|
|
87
|
+
cypherLabel: "RELATES_TO",
|
|
88
|
+
isReverse: false,
|
|
89
|
+
polymorphic: true,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
71
92
|
const entity = {
|
|
72
93
|
type: d.model.type,
|
|
73
94
|
moduleId: d.moduleId,
|
|
@@ -80,6 +101,7 @@ let GraphCatalogService = GraphCatalogService_1 = class GraphCatalogService {
|
|
|
80
101
|
labelName: d.model.labelName,
|
|
81
102
|
...(d.bridge ? { bridge: { materialiseTo: [...d.bridge.materialiseTo] } } : {}),
|
|
82
103
|
...(d.chat?.writable ? { writable: true } : {}),
|
|
104
|
+
...(d.chat?.list ? { list: [...d.chat.list] } : {}),
|
|
83
105
|
};
|
|
84
106
|
this.entities.set(d.model.type, entity);
|
|
85
107
|
scopeSources.set(d.model.type, {
|
|
@@ -223,13 +245,18 @@ let GraphCatalogService = GraphCatalogService_1 = class GraphCatalogService {
|
|
|
223
245
|
if (r.isReverse)
|
|
224
246
|
continue; // forward-only in the rendered map; reverse names appear in the bracket pair
|
|
225
247
|
const forwardName = r.name;
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
248
|
+
// Polymorphic traversals have no single target type: render `(*)` and never
|
|
249
|
+
// look for a reverse counterpart (there is no target descriptor to carry one).
|
|
250
|
+
const renderedTarget = r.polymorphic ? "*" : r.targetType;
|
|
251
|
+
const reverse = r.polymorphic
|
|
252
|
+
? undefined
|
|
253
|
+
: this.entities
|
|
254
|
+
.get(r.targetType)
|
|
255
|
+
?.relationships.find((x) => x.isReverse && x.sourceType === r.targetType && x.cypherLabel === r.cypherLabel);
|
|
229
256
|
const names = reverse
|
|
230
257
|
? `${e.type}.${forwardName} / ${r.targetType}.${reverse.name}`
|
|
231
258
|
: `${e.type}.${forwardName}`;
|
|
232
|
-
relLines.push(`(${e.type}) --> (${
|
|
259
|
+
relLines.push(`(${e.type}) --> (${renderedTarget}) [${names}] — ${r.description}`);
|
|
233
260
|
}
|
|
234
261
|
}
|
|
235
262
|
return [
|
|
@@ -264,12 +291,18 @@ let GraphCatalogService = GraphCatalogService_1 = class GraphCatalogService {
|
|
|
264
291
|
const lines = fragment.split("\n");
|
|
265
292
|
const out = [];
|
|
266
293
|
for (const line of lines) {
|
|
267
|
-
const match = line.match(/^\(\w+\)\s+-->\s+\((\w+)\)/);
|
|
294
|
+
const match = line.match(/^\(\w+\)\s+-->\s+\(([\w*]+)\)/);
|
|
268
295
|
if (!match) {
|
|
269
296
|
out.push(line);
|
|
270
297
|
continue;
|
|
271
298
|
}
|
|
272
299
|
const targetType = match[1];
|
|
300
|
+
// Polymorphic lines have no single target type, so there is no module to
|
|
301
|
+
// check them against: they are always in scope for the source's module.
|
|
302
|
+
if (targetType === "*") {
|
|
303
|
+
out.push(line);
|
|
304
|
+
continue;
|
|
305
|
+
}
|
|
273
306
|
const target = this.entities.get(targetType);
|
|
274
307
|
if (target && accessibleModuleIds.has(target.moduleId))
|
|
275
308
|
out.push(line);
|
|
@@ -1 +1 @@
|
|
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AAC,CAAC;YAAE,OAAO,IAAI,CAAC;QACpB,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;YAAE,OAAO,IAAI,CAAC;QACrD,OAAO,CAAC,CAAC;IACX,CAAC;CACF,CAAA;AAlYY,kDAAmB;8BAAnB,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;;GACA,mBAAmB,CAkY/B"}
|
|
@@ -3,11 +3,12 @@ import { GraphCatalogService } from "./graph.catalog.service";
|
|
|
3
3
|
import { EntityServiceRegistry } from "../../../common/registries/entity.service.registry";
|
|
4
4
|
import { UserContext } from "../tools/tool.factory";
|
|
5
5
|
import { ScopeGuard } from "./scope.guard";
|
|
6
|
+
import { ToolFieldFormatterService } from "./field-formatting";
|
|
6
7
|
/** Hard cap per cardinality-many materialised relationship. */
|
|
7
8
|
export declare const MATERIALISE_LIMIT = 50;
|
|
8
9
|
export interface BridgeRecordIn {
|
|
9
10
|
id: string;
|
|
10
|
-
/** Already type-converted target-node fields, as returned by
|
|
11
|
+
/** Already type-converted target-node fields, as returned by ToolFieldFormatterService.build. */
|
|
11
12
|
fields: Record<string, unknown>;
|
|
12
13
|
}
|
|
13
14
|
export interface BridgeRecordOut {
|
|
@@ -30,6 +31,8 @@ export interface MaterialiseBridgeDeps {
|
|
|
30
31
|
* production call site. Only consulted for a scoped run.
|
|
31
32
|
*/
|
|
32
33
|
scopeGuard?: ScopeGuard;
|
|
34
|
+
/** Stages the materialised targets' fields between list/detail. Required. */
|
|
35
|
+
formatter: ToolFieldFormatterService;
|
|
33
36
|
}
|
|
34
37
|
export declare function materialiseBridge(params: {
|
|
35
38
|
bridge: CatalogEntity;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"materialise-bridge.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/services/materialise-bridge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,mBA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