@carlonicora/nestjs-neo4jsonapi 4.2.0 → 4.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 +6 -0
- package/dist/agents/graph/graph.module.js.map +1 -1
- package/dist/agents/graph/interfaces/graph.catalog.interface.d.ts +46 -1
- package/dist/agents/graph/interfaces/graph.catalog.interface.d.ts.map +1 -1
- package/dist/agents/graph/services/graph.catalog.service.d.ts +14 -2
- package/dist/agents/graph/services/graph.catalog.service.d.ts.map +1 -1
- package/dist/agents/graph/services/graph.catalog.service.js +75 -0
- package/dist/agents/graph/services/graph.catalog.service.js.map +1 -1
- package/dist/agents/graph/services/richtext.write.d.ts +52 -0
- package/dist/agents/graph/services/richtext.write.d.ts.map +1 -0
- package/dist/agents/graph/services/richtext.write.js +92 -0
- package/dist/agents/graph/services/richtext.write.js.map +1 -0
- package/dist/agents/graph/services/writable.rules.d.ts +37 -0
- package/dist/agents/graph/services/writable.rules.d.ts.map +1 -0
- package/dist/agents/graph/services/writable.rules.js +46 -0
- package/dist/agents/graph/services/writable.rules.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 +15 -0
- package/dist/agents/graph/tools/describe-entity.tool.js.map +1 -1
- package/dist/agents/index.d.ts +1 -1
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/operator/contexts/operator.context.d.ts +17 -1
- package/dist/agents/operator/contexts/operator.context.d.ts.map +1 -1
- package/dist/agents/operator/contexts/operator.context.js +8 -0
- package/dist/agents/operator/contexts/operator.context.js.map +1 -1
- package/dist/agents/operator/controllers/operator.controller.d.ts.map +1 -1
- package/dist/agents/operator/controllers/operator.controller.js +10 -1
- package/dist/agents/operator/controllers/operator.controller.js.map +1 -1
- package/dist/agents/operator/interfaces/operator.tool.interface.d.ts +49 -1
- package/dist/agents/operator/interfaces/operator.tool.interface.d.ts.map +1 -1
- package/dist/agents/operator/interfaces/operator.tool.interface.js.map +1 -1
- package/dist/agents/operator/prompts/operator.system.prompt.d.ts +1 -1
- package/dist/agents/operator/prompts/operator.system.prompt.d.ts.map +1 -1
- package/dist/agents/operator/prompts/operator.system.prompt.js +2 -0
- package/dist/agents/operator/prompts/operator.system.prompt.js.map +1 -1
- package/dist/agents/operator/services/operator.service.d.ts +32 -0
- package/dist/agents/operator/services/operator.service.d.ts.map +1 -1
- package/dist/agents/operator/services/operator.service.js +83 -2
- package/dist/agents/operator/services/operator.service.js.map +1 -1
- package/dist/agents/operator/tools/entity-write.tools.d.ts +75 -19
- package/dist/agents/operator/tools/entity-write.tools.d.ts.map +1 -1
- package/dist/agents/operator/tools/entity-write.tools.js +422 -149
- package/dist/agents/operator/tools/entity-write.tools.js.map +1 -1
- package/dist/common/helpers/bound-content.d.ts +21 -0
- package/dist/common/helpers/bound-content.d.ts.map +1 -0
- package/dist/common/helpers/bound-content.js +28 -0
- package/dist/common/helpers/bound-content.js.map +1 -0
- package/dist/common/helpers/index.d.ts +1 -0
- package/dist/common/helpers/index.d.ts.map +1 -1
- package/dist/common/helpers/index.js +1 -0
- package/dist/common/helpers/index.js.map +1 -1
- package/dist/common/interfaces/entity.schema.interface.d.ts +27 -4
- package/dist/common/interfaces/entity.schema.interface.d.ts.map +1 -1
- package/dist/foundations/assistant/controllers/assistant.controller.d.ts +0 -7
- package/dist/foundations/assistant/controllers/assistant.controller.d.ts.map +1 -1
- package/dist/foundations/assistant/controllers/assistant.controller.js +2 -16
- package/dist/foundations/assistant/controllers/assistant.controller.js.map +1 -1
- package/dist/foundations/assistant/services/assistant.service.d.ts +0 -9
- package/dist/foundations/assistant/services/assistant.service.d.ts.map +1 -1
- package/dist/foundations/assistant/services/assistant.service.js +32 -35
- package/dist/foundations/assistant/services/assistant.service.js.map +1 -1
- package/dist/foundations/assistant-action/entities/assistant-action.d.ts +1 -0
- package/dist/foundations/assistant-action/entities/assistant-action.d.ts.map +1 -1
- package/dist/foundations/assistant-action/entities/assistant-action.js +1 -0
- package/dist/foundations/assistant-action/entities/assistant-action.js.map +1 -1
- package/dist/foundations/assistant-action/services/assistant-action.service.d.ts +2 -0
- package/dist/foundations/assistant-action/services/assistant-action.service.d.ts.map +1 -1
- package/dist/foundations/assistant-action/services/assistant-action.service.js +1 -0
- package/dist/foundations/assistant-action/services/assistant-action.service.js.map +1 -1
- package/dist/mcp/mcp.module.d.ts +4 -0
- package/dist/mcp/mcp.module.d.ts.map +1 -1
- package/dist/mcp/mcp.module.js +6 -1
- package/dist/mcp/mcp.module.js.map +1 -1
- package/dist/mcp/services/mcp.entity.write.service.d.ts +16 -1
- package/dist/mcp/services/mcp.entity.write.service.d.ts.map +1 -1
- package/dist/mcp/services/mcp.entity.write.service.js +25 -6
- package/dist/mcp/services/mcp.entity.write.service.js.map +1 -1
- package/dist/mcp/services/mcp.promoted.tools.factory.d.ts +21 -4
- package/dist/mcp/services/mcp.promoted.tools.factory.d.ts.map +1 -1
- package/dist/mcp/services/mcp.promoted.tools.factory.js +28 -5
- package/dist/mcp/services/mcp.promoted.tools.factory.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writable.rules.js","sourceRoot":"","sources":["../../../../src/agents/graph/services/writable.rules.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACI,MAAM,UAAU,GAAG,CAAC,MAAqB,EAAsB,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;AAAvF,QAAA,UAAU,cAA6E;AAEpG,qFAAqF;AAC9E,MAAM,kBAAkB,GAAG,CAAC,MAAqB,EAAY,EAAE,CACpE,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,C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pG,QAAA,yBAAyB,6BAC2E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe-entity.tool.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/tools/describe-entity.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"describe-entity.tool.d.ts","sourceRoot":"","sources":["../../../../src/agents/graph/tools/describe-entity.tool.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE1E,QAAA,MAAM,WAAW;;iBAEf,CAAC;AAEH,OAAO,EAAE,WAAW,IAAI,yBAAyB,EAAE,CAAC;AAEpD,qBACa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,WAAW;IAEjD,KAAK,CAAC,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,qBAAqB;IASpE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CA4CjH"}
|
|
@@ -13,6 +13,7 @@ exports.DescribeEntityTool = exports.describeEntityInputSchema = void 0;
|
|
|
13
13
|
const common_1 = require("@nestjs/common");
|
|
14
14
|
const tools_1 = require("@langchain/core/tools");
|
|
15
15
|
const zod_1 = require("zod");
|
|
16
|
+
const writable_rules_1 = require("../services/writable.rules");
|
|
16
17
|
const tool_factory_1 = require("./tool.factory");
|
|
17
18
|
const inputSchema = zod_1.z.object({
|
|
18
19
|
type: zod_1.z.string().describe("Entity type name from the graph map."),
|
|
@@ -35,6 +36,13 @@ let DescribeEntityTool = class DescribeEntityTool {
|
|
|
35
36
|
const entity = this.factory.resolveEntity(input.type, ctx);
|
|
36
37
|
if ("error" in entity)
|
|
37
38
|
return entity;
|
|
39
|
+
// The write tools refuse anything not marked writable here, so the model
|
|
40
|
+
// must be TOLD which fields and relationships it may set — without this
|
|
41
|
+
// it fills system-generated fields and read-only traversals, and the
|
|
42
|
+
// refusal only lands after the user has approved the action. Omitted
|
|
43
|
+
// entirely for a read-only type: a host that opts nothing in sees the
|
|
44
|
+
// response it has always seen.
|
|
45
|
+
const writable = entity.writable === true;
|
|
38
46
|
return {
|
|
39
47
|
type: entity.type,
|
|
40
48
|
description: entity.description,
|
|
@@ -45,13 +53,20 @@ let DescribeEntityTool = class DescribeEntityTool {
|
|
|
45
53
|
filterable: f.filterable,
|
|
46
54
|
sortable: f.sortable,
|
|
47
55
|
...(f.kind ? { kind: f.kind } : {}),
|
|
56
|
+
// A richtext field is READ as markdown (the tool layer renders the
|
|
57
|
+
// stored BlockNote document), so it must be WRITTEN as markdown too —
|
|
58
|
+
// the write tools convert it back. Without saying so the model has no
|
|
59
|
+
// way to know the two directions match.
|
|
60
|
+
...(f.kind?.type === "richtext" ? { format: "markdown" } : {}),
|
|
48
61
|
...(entity.list ? { stage: entity.list.includes(f.name) ? "list" : "detail" } : {}),
|
|
62
|
+
...(writable ? { writable: (0, writable_rules_1.isFieldWritable)(entity, f.name) } : {}),
|
|
49
63
|
})),
|
|
50
64
|
relationships: entity.relationships.map((r) => ({
|
|
51
65
|
name: r.name,
|
|
52
66
|
targetType: r.targetType,
|
|
53
67
|
cardinality: r.cardinality,
|
|
54
68
|
description: r.description,
|
|
69
|
+
...(writable ? { writable: (0, writable_rules_1.isRelationshipWritable)(entity, r) } : {}),
|
|
55
70
|
})),
|
|
56
71
|
...(entity.bridge ? { bridge: { materialiseTo: [...entity.bridge.materialiseTo] } } : {}),
|
|
57
72
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"describe-entity.tool.js","sourceRoot":"","sources":["../../../../src/agents/graph/tools/describe-entity.tool.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,iDAA8D;AAC9D,6BAAwB;AACxB,iDAA0E;AAE1E,MAAM,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;CAClE,CAAC,CAAC;AAEqB,gDAAyB;AAG1C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,YAA6B,OAAoB;QAApB,YAAO,GAAP,OAAO,CAAa;IAAG,CAAC;IAErD,KAAK,CAAC,GAAgB,EAAE,QAA0B;QAChD,OAAO,IAAI,6BAAqB,CAAC;YAC/B,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,oEAAoE;YACjF,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAC;SAC/E,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAkC,EAAE,GAAgB,EAAE,QAA0B;QAC3F,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,CACzB,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,EAClC,KAAK,IAAI,EAAE;YACT,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;YAC3D,IAAI,OAAO,IAAI,MAAM;gBAAE,OAAO,MAAM,CAAC;YACrC,OAAO;gBACL,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,WAAW,EAAE,MAAM,CAAC,WAAW;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B,IAAA,mBAAU,GAAE;qCAE2B,0BAAW;GADtC,kBAAkB,CAwD9B"}
|
package/dist/agents/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export { defaultOperatorSystemPrompt } from "./operator/prompts/operator.system.
|
|
|
53
53
|
export { GRAPH_NODE_SYSTEM_PROMPT_BASE, renderGraphNodeSystemPrompt, describeDomainLayer, } from "./graph/prompts/graph.node.system.prompt";
|
|
54
54
|
export { OperatorCheckpointerService, OPERATOR_DEFAULT_APPROVAL_TTL_DAYS, } from "./operator/services/operator.checkpointer.service";
|
|
55
55
|
export { OPERATOR_TOOLS } from "./operator/interfaces/operator.tool.interface";
|
|
56
|
-
export type { OperatorChunkCitation, OperatorRetrievalContext, OperatorToolCallRecord, OperatorToolContribution, OperatorToolDefinition, } from "./operator/interfaces/operator.tool.interface";
|
|
56
|
+
export type { OperatorActionProposal, OperatorChunkCitation, OperatorRetrievalContext, OperatorToolCallRecord, OperatorToolContribution, OperatorToolDefinition, ProposalRef, } from "./operator/interfaces/operator.tool.interface";
|
|
57
57
|
export { SearchDocumentsTool } from "./operator/tools/search-documents.tool";
|
|
58
58
|
export { SearchCommunitiesTool } from "./operator/tools/search-communities.tool";
|
|
59
59
|
export { OperatorTestActionTool } from "./operator/tools/operator-test-action.tool";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agents/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAGhD,cAAc,WAAW,CAAC;AAK1B,YAAY,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAG3F,OAAO,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AACzF,OAAO,EAAE,wBAAwB,EAAE,MAAM,0DAA0D,CAAC;AAGpG,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,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FAAgF;AAAvE,yHAAA,kBAAkB,OAAA;AAC3B,yEAAuE;AAA9D,mHAAA,eAAe,OAAA;AAExB,yEAAuE;AAA9D,mHAAA,eAAe,OAAA;AAExB,oFAAwF;AAA/E,qIAAA,2BAA2B,OAAA;AACpC,qFAIkD;AAHhD,yIAAA,6BAA6B,OAAA;AAC7B,uIAAA,2BAA2B,OAAA;AAC3B,+HAAA,mBAAmB,OAAA;AAErB,mGAG2D;AAFzD,4IAAA,2BAA2B,OAAA;AAC3B,mJAAA,kCAAkC,OAAA;AAGpC,wBAAwB;AACxB,yFAA+E;AAAtE,yHAAA,cAAc,OAAA;AAUvB,gFAA6E;AAApE,4HAAA,mBAAmB,OAAA;AAC5B,oFAAiF;AAAxE,gIAAA,qBAAqB,OAAA;AAC9B,wFAAoF;AAA3E,mIAAA,sBAAsB,OAAA;AAC/B,kFAA+E;AAAtE,8HAAA,oBAAoB,OAAA"}
|
|
@@ -62,6 +62,14 @@ export declare const OperatorContext: import("@langchain/langgraph").AnnotationR
|
|
|
62
62
|
output: number;
|
|
63
63
|
}>, unknown>;
|
|
64
64
|
finalAnswer: import("@langchain/langgraph").BaseChannel<OperatorFinalAnswer, OperatorFinalAnswer | import("@langchain/langgraph").OverwriteValue<OperatorFinalAnswer>, unknown>;
|
|
65
|
+
/**
|
|
66
|
+
* Error the approved destructive tool of the last tools pass returned instead
|
|
67
|
+
* of writing. Last-write-wins, and written on EVERY pass that executed an
|
|
68
|
+
* approved destructive call — a successful one writes `null`, so a failure can
|
|
69
|
+
* never linger and mark a later action failed. The assistant layer reads it to
|
|
70
|
+
* transition the AssistantAction to `failed` instead of `executed`.
|
|
71
|
+
*/
|
|
72
|
+
actionError: import("@langchain/langgraph").BaseChannel<string, string | import("@langchain/langgraph").OverwriteValue<string>, unknown>;
|
|
65
73
|
}>;
|
|
66
74
|
/**
|
|
67
75
|
* The attribution channels added to the root above, as OPTIONAL properties.
|
|
@@ -77,6 +85,14 @@ export declare const OperatorContext: import("@langchain/langgraph").AnnotationR
|
|
|
77
85
|
* `scopeType` predate it and are left exactly as consumers already see them.
|
|
78
86
|
*/
|
|
79
87
|
type OperatorAttributionState = Pick<CallerAttributionState, "scopeLabel" | "assistantId">;
|
|
88
|
+
/**
|
|
89
|
+
* Every channel added after the published state shape froze, declared OPTIONAL
|
|
90
|
+
* for the reason above: a consumer's existing state literal must keep compiling.
|
|
91
|
+
* `actionError` joins the attribution pair here for exactly that reason.
|
|
92
|
+
*/
|
|
93
|
+
type OperatorLateState = OperatorAttributionState & {
|
|
94
|
+
actionError?: string | null;
|
|
95
|
+
};
|
|
80
96
|
/**
|
|
81
97
|
* The un-widened shape LangGraph itself hands to a node callback — every
|
|
82
98
|
* channel required, `StateGraph`'s own view of the state.
|
|
@@ -89,6 +105,6 @@ type OperatorAttributionState = Pick<CallerAttributionState, "scopeLabel" | "ass
|
|
|
89
105
|
* {@link OperatorContextState} widens.
|
|
90
106
|
*/
|
|
91
107
|
export type OperatorGraphState = typeof OperatorContext.State;
|
|
92
|
-
export type OperatorContextState = Omit<OperatorGraphState, keyof
|
|
108
|
+
export type OperatorContextState = Omit<OperatorGraphState, keyof OperatorLateState> & OperatorLateState;
|
|
93
109
|
export {};
|
|
94
110
|
//# sourceMappingURL=operator.context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.context.d.ts","sourceRoot":"","sources":["../../../../src/agents/operator/contexts/operator.context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAC;AAE7F,MAAM,MAAM,gBAAgB,GAAG;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM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B,EAAE,YAAY,GAAG,aAAa,CAAC,CAAC;AAE3F;;;;GAIG;AACH,KAAK,iBAAiB,GAAG,wBAAwB,GAAG;IAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAEpF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,kBAAkB,GAAG,OAAO,eAAe,CAAC,KAAK,CAAC;AAE9D,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,kBAAkB,EAAE,MAAM,iBAAiB,CAAC,GAAG,iBAAiB,CAAC"}
|
|
@@ -31,5 +31,13 @@ exports.OperatorContext = langgraph_1.Annotation.Root({
|
|
|
31
31
|
default: () => ({ input: 0, output: 0 }),
|
|
32
32
|
}),
|
|
33
33
|
finalAnswer: (0, langgraph_1.Annotation)({ reducer: (_, b) => b, default: () => null }),
|
|
34
|
+
/**
|
|
35
|
+
* Error the approved destructive tool of the last tools pass returned instead
|
|
36
|
+
* of writing. Last-write-wins, and written on EVERY pass that executed an
|
|
37
|
+
* approved destructive call — a successful one writes `null`, so a failure can
|
|
38
|
+
* never linger and mark a later action failed. The assistant layer reads it to
|
|
39
|
+
* transition the AssistantAction to `failed` instead of `executed`.
|
|
40
|
+
*/
|
|
41
|
+
actionError: (0, langgraph_1.Annotation)({ reducer: (_, b) => b, default: () => null }),
|
|
34
42
|
});
|
|
35
43
|
//# sourceMappingURL=operator.context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.context.js","sourceRoot":"","sources":["../../../../src/agents/operator/contexts/operator.context.ts"],"names":[],"mappings":";;;AAAA,oDAAkD;AASrC,QAAA,eAAe,GAAG,sBAAU,CAAC,IAAI,CAAC;IAC7C,QAAQ,EAAE,IAAA,sBAAU,EAAgB,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,EAAE,EAAE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E,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;KACzC,CAAC;IACF,WAAW,EAAE,IAAA,sBAAU,EAA6B,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC;IAClG;;;;;;OAMG;IACH,WAAW,EAAE,IAAA,sBAAU,EAAgB,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,IAAI,EAAE,CAAC;CACtF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.controller.d.ts","sourceRoot":"","sources":["../../../../src/agents/operator/controllers/operator.controller.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"operator.controller.d.ts","sourceRoot":"","sources":["../../../../src/agents/operator/controllers/operator.controller.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,oBAAoB,EAAE,MAAM,4DAA4D,CAAC;AAClG,OAAO,EAAoB,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAIhF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0DAA0D,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAE,MAAM,wDAAwD,CAAC;AAI1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAG7F;;;;;;;;GAQG;AACH,qBAEa,kBAAkB;IAI3B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB;;;;;OAKG;IACmC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;IAXzE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;gBAG3C,UAAU,EAAE,gBAAgB,EAC5B,OAAO,EAAE,cAAc;IACxC;;;;;OAKG;IACoD,eAAe,CAAC,EAAE,wBAAwB;IAGnG;;;;;;;OAOG;IAEG,MAAM,CAAS,IAAI,EAAE,gBAAgB,EAAS,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC;IAqD5F;;;;;OAKG;IAEG,MAAM,CACY,WAAW,EAAE,MAAM,EACjC,IAAI,EAAE,kBAAkB,EACzB,GAAG,EAAE,oBAAoB,GAC/B,OAAO,CAAC,GAAG,CAAC;CAsChB"}
|
|
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
exports.OperatorController = void 0;
|
|
17
17
|
const common_1 = require("@nestjs/common");
|
|
18
18
|
const jwt_auth_guard_1 = require("../../../common/guards/jwt.auth.guard");
|
|
19
|
+
const bound_content_1 = require("../../../common/helpers/bound-content");
|
|
19
20
|
const credit_gate_1 = require("../../../common/helpers/credit-gate");
|
|
20
21
|
const tokens_1 = require("../../../common/tokens");
|
|
21
22
|
const jsonapi_service_1 = require("../../../core/jsonapi/services/jsonapi.service");
|
|
@@ -60,7 +61,14 @@ let OperatorController = OperatorController_1 = class OperatorController {
|
|
|
60
61
|
if (this.creditValidator && req.user?.companyId)
|
|
61
62
|
await this.creditValidator.validateCredits({ companyId: req.user.companyId });
|
|
62
63
|
const { content, title, howToMode, limitToHowToId } = body.data.attributes;
|
|
63
|
-
|
|
64
|
+
// Same resolution as `AssistantController.create` — the two engines share
|
|
65
|
+
// `AssistantPostDto`, so an operator thread must bind to the scope the
|
|
66
|
+
// client sent (`relationships.content`) exactly as a responder thread does.
|
|
67
|
+
// Without it the thread had no BOUND_TO edge and every record the write
|
|
68
|
+
// tools created landed outside the caller's campaign.
|
|
69
|
+
const boundContent = (0, bound_content_1.resolveBoundContent)(body.data.relationships?.content?.data);
|
|
70
|
+
this.logger.log(`create: userId=${req.user.userId} companyId=${req.user.companyId} firstMessageLen=${content.length}` +
|
|
71
|
+
(boundContent ? ` boundTo=${boundContent.type}/${boundContent.id}` : ""));
|
|
64
72
|
const { assistant, userMessage, assistantMessage, toolCalls, action } = await this.assistants.createWithFirstMessageOperator({
|
|
65
73
|
companyId: req.user.companyId,
|
|
66
74
|
userId: req.user.userId,
|
|
@@ -68,6 +76,7 @@ let OperatorController = OperatorController_1 = class OperatorController {
|
|
|
68
76
|
title,
|
|
69
77
|
howToMode,
|
|
70
78
|
limitToHowToId,
|
|
79
|
+
boundContent,
|
|
71
80
|
});
|
|
72
81
|
const document = (await this.jsonApi.buildSingle(assistant_1.AssistantDescriptor.model, assistant));
|
|
73
82
|
const messagesDoc = (await this.jsonApi.buildList(assistant_message_1.AssistantMessageDescriptor.model, [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.controller.js","sourceRoot":"","sources":["../../../../src/agents/operator/controllers/operator.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAWwB;AACxB,0EAAqE;AACrE,qEAAqE;AAErE,mDAAoF;AACpF,oFAAgF;AAChF,sGAA4G;AAC5G,yGAA+G;AAC/G,mHAA8G;AAC9G,mGAA8F;AAC9F,+FAA0F;AAC1F,iFAAwF;AACxF,2FAAuF;AACvF,0GAAgG;AAChG,iGAA6F;AAC7F,6DAAyD;AAEzD;;;;;;;;GAQG;AAGI,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAG7B,YACmB,UAA4B,EAC5B,OAAuB,EAOF,eAA2D;QARhF,eAAU,GAAV,UAAU,CAAkB;QAC5B,YAAO,GAAP,OAAO,CAAgB;QAOe,oBAAe,GAAf,eAAe,CAA2B;QAXlF,WAAM,GAAG,IAAI,eAAM,CAAC,oBAAkB,CAAC,IAAI,CAAC,CAAC;IAY3D,CAAC;IAEJ;;;;;;;OAOG;IAEG,AAAN,KAAK,CAAC,MAAM,CAAS,IAAsB,EAAS,GAAyB;QAC3E,IAAI,GAAG,CAAC,IAAI,EAAE,SAAS,IAAI,CAAC,CAAC,MAAM,IAAA,4BAAc,EAAC,IAAI,CAAC,eAAe,EAAE,EAAE,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,EAAE,CAAC;YAC5G,MAAM,IAAI,0BAAiB,EAAE,CAAC;QAChC,CAAC;QAED,IAAI,IAAI,CAAC,eAAe,IAAI,GAAG,CAAC,IAAI,EAAE,SAAS;YAC7C,MAAM,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QAEhF,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC;QAC3E,IAAI,CAAC,MAAM,CAAC,GAAG,CACb,kBAAkB,GAAG,CAAC,IAAI,CAAC,MAAM,cAAc,GAAG,CAAC,IAAI,CAAC,SAAS,oBAAoB,OAAO,CAAC,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"operator.controller.js","sourceRoot":"","sources":["../../../../src/agents/operator/controllers/operator.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAWwB;AACxB,0EAAqE;AACrE,yEAA4E;AAC5E,qEAAqE;AAErE,mDAAoF;AACpF,oFAAgF;AAChF,sGAA4G;AAC5G,yGAA+G;AAC/G,mHAA8G;AAC9G,mGAA8F;AAC9F,+FAA0F;AAC1F,iFAAwF;AACxF,2FAAuF;AACvF,0GAAgG;AAChG,iGAA6F;AAC7F,6DAAyD;AAEzD;;;;;;;;GAQG;AAGI,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAG7B,YACmB,UAA4B,EAC5B,OAAuB,EAOF,eAA2D;QARhF,eAAU,GAAV,UAAU,CAAkB;QAC5B,YAAO,GAAP,OAAO,CAAgB;QAOe,oBAAe,GAAf,eAAe,CAA2B;QAXlF,WAAM,GAAG,IAAI,eAAM,CAAC,o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AAyB,CAAC,KAAK,EAAE,MAAM,CAAC,CAGzF,CAAC;YACF,wDAAwD;YACxD,wEAAwE;YACxE,QAAQ,CAAC,QAAQ,GAAG,IAAA,oCAAa,EAAC,QAAQ,CAAC,QAAiC,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;gBAC9F,IAAI,EAAE,8BAAa,CAAC,IAAI;gBACxB,EAAE,EAAE,WAAW;aAChB,CAAC,CAAC;QACL,CAAC;QACD,QAAQ,CAAC,IAAI,GAAG,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC;QACxD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAA;AA9HY,gDAAkB;AAwBvB;IADL,IAAA,aAAI,EAAC,4BAAY,CAAC,QAAQ,CAAC;IACd,WAAA,IAAA,aAAI,GAAE,CAAA;IAA0B,WAAA,IAAA,YAAG,GAAE,CAAA;;qCAAxB,qCAAgB;;gDAmD1C;AASK;IADL,IAAA,aAAI,EAAC,GAAG,4BAAY,CAAC,QAAQ,iBAAiB,6CAAoB,CAAC,QAAQ,EAAE,CAAC;IAE5E,WAAA,IAAA,cAAK,EAAC,aAAa,CAAC,CAAA;IACpB,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,YAAG,GAAE,CAAA;;6CADQ,yCAAkB;;gDAuCjC;6BA7HU,kBAAkB;IAF9B,IAAA,kBAAS,EAAC,6BAAY,CAAC;IACvB,IAAA,mBAAU,GAAE;IAaR,WAAA,IAAA,iBAAQ,GAAE,CAAA;IAAE,WAAA,IAAA,eAAM,EAAC,yBAAgB,CAAC,CAAA;qCARR,oCAAgB;QACnB,gCAAc;GAL/B,kBAAkB,CA8H9B"}
|
|
@@ -2,11 +2,59 @@ import { DynamicStructuredTool } from "@langchain/core/tools";
|
|
|
2
2
|
import { MessageInterface } from "../../../common/interfaces/message.interface";
|
|
3
3
|
import { DataLimits } from "../../../common/types/data.limits";
|
|
4
4
|
import { ToolCallRecord, UserContext } from "../../graph/tools/tool.factory";
|
|
5
|
+
/**
|
|
6
|
+
* One referenced record, resolved to a display name.
|
|
7
|
+
*
|
|
8
|
+
* `id` exists for React keys only and must NEVER be rendered: the approval card
|
|
9
|
+
* shows names, never ids.
|
|
10
|
+
*/
|
|
11
|
+
export interface ProposalRef {
|
|
12
|
+
id: string;
|
|
13
|
+
/** JSON:API type, e.g. "npcs". */
|
|
14
|
+
type: string;
|
|
15
|
+
/** Display name; `"(not found)"` when the id is unknown or out of scope. */
|
|
16
|
+
label: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Name-resolved description of a pending write, stored on the AssistantAction as
|
|
20
|
+
* a JSON string and rendered by the approval card. `toolArgs` stays the raw
|
|
21
|
+
* audit copy and is no longer used for display.
|
|
22
|
+
*/
|
|
23
|
+
export type OperatorActionProposal = {
|
|
24
|
+
/** JSON:API type of the record being written. */
|
|
25
|
+
type: string;
|
|
26
|
+
/** update / delete / link / unlink: the target record's name. Absent on create. */
|
|
27
|
+
target?: ProposalRef;
|
|
28
|
+
/** create / update: the field values being written (raw, as the tool received them). */
|
|
29
|
+
attributes?: Record<string, unknown>;
|
|
30
|
+
/** create: related records, resolved. The scope relationship (e.g. campaign) is STRIPPED here. */
|
|
31
|
+
relationships?: Record<string, ProposalRef[]>;
|
|
32
|
+
/** link / unlink: the relationship name. */
|
|
33
|
+
relationship?: string;
|
|
34
|
+
/** link / unlink: the resolved targets. */
|
|
35
|
+
targets?: ProposalRef[];
|
|
36
|
+
};
|
|
5
37
|
export interface OperatorToolDefinition {
|
|
6
38
|
tool: DynamicStructuredTool;
|
|
7
39
|
destructive: boolean;
|
|
8
40
|
/** Human-readable line shown in the approval card. Required when destructive. */
|
|
9
|
-
summarise?: (args: Record<string, unknown>) => string
|
|
41
|
+
summarise?: (args: Record<string, unknown>) => string | Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Structured, name-resolved rendering of the pending write for the approval
|
|
44
|
+
* card — an `OperatorActionProposal`. Optional: a tool without it (or one that
|
|
45
|
+
* fails) simply produces no proposal and never blocks the approval.
|
|
46
|
+
*/
|
|
47
|
+
present?: (args: Record<string, unknown>) => Promise<Record<string, unknown> | undefined>;
|
|
48
|
+
/**
|
|
49
|
+
* Pre-flight check, run BEFORE the approval interrupt. A non-null string is
|
|
50
|
+
* returned to the model as a tool error and no approval is requested; `null`
|
|
51
|
+
* lets the approval go ahead.
|
|
52
|
+
*
|
|
53
|
+
* Without it an invalid call is only refused when it executes — AFTER the user
|
|
54
|
+
* approved it — so the user approves an action and nothing is written. It must
|
|
55
|
+
* run the same checks the execution path runs and write nothing itself.
|
|
56
|
+
*/
|
|
57
|
+
validate?: (args: Record<string, unknown>) => Promise<string | null>;
|
|
10
58
|
}
|
|
11
59
|
/** Chunk citation pushed into the per-turn recorder by retrieval tools. */
|
|
12
60
|
export interface OperatorChunkCitation {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.tool.interface.d.ts","sourceRoot":"","sources":["../../../../src/agents/operator/interfaces/operator.tool.interface.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAE7E,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,WAAW,EAAE,OAAO,CAAC;IACrB,iFAAiF;IACjF,SAAS,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"operator.tool.interface.d.ts","sourceRoot":"","sources":["../../../../src/agents/operator/interfaces/operator.tool.interface.ts"],"names":[],"mappings":"AA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OAQG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CACtE;AAED,2EAA2E;AAC3E,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,cAAc;IAC5D,SAAS,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACrC;AAED,oEAAoE;AACpE,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B;;;;;;OAMG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC,kGAAkG;IAClG,KAAK,CAAC,GAAG,EAAE,wBAAwB,EAAE,QAAQ,EAAE,cAAc,EAAE,GAAG,sBAAsB,CAAC;CAC1F;AAED,6FAA6F;AAC7F,eAAO,MAAM,cAAc,eAA2B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.tool.interface.js","sourceRoot":"","sources":["../../../../src/agents/operator/interfaces/operator.tool.interface.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"operator.tool.interface.js","sourceRoot":"","sources":["../../../../src/agents/operator/interfaces/operator.tool.interface.ts"],"names":[],"mappings":";;;AA0GA,6FAA6F;AAChF,QAAA,cAAc,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const defaultOperatorSystemPrompt = "# Role\n\nYou are an operator agent for a company ERP. You answer the user's request by calling tools in a loop: inspect the data, walk relationships, and \u2014 when the user asks for it \u2014 perform actions.\n\nEvery fact in your final reply must come from a tool call that returned it. Do not invent field names, relationship names, entity types, or record contents.\n\n## How to work\n\n- Call tools step by step. A typical request needs several tool calls; keep going until you have what you need, then reply without calling further tools.\n- If a tool returns an error message (for example \"Tool error: ...\" or \"{ error: ... }\"), read it, correct your input, and try again. Never stop on the first error and never apologise to the user for a tool error.\n- When an error tells you how to recover, recover immediately in the same run: if it suggests a corrected value (a \"suggestion\" field, or \"Retry this call with ...\"), retry the same tool with that value; if it says another tool must be called first (for example describe_entity), call that tool and then retry the original call. Never relay a tool error to the user as a question, and never ask permission to continue \u2014 you already have it.\n- Some tools perform real actions (they create, change, or delete data). When you call one of these, the system pauses and asks the user to approve the action before it runs. If the user denies it, you will see \"Action denied by the user.\" \u2014 accept the decision, do not retry the action, and wrap up by telling the user what was and was not done.\n- Never ask the user a clarifying question mid-run; make the most reasonable assumption, state it in your reply, and proceed.\n\n## Output\n\nWhen you are done, reply in plain prose with the answer or a summary of the actions performed. Quote real field values from tool results.\n\n- If the tool results do not contain the information needed to answer, say so plainly (\"I could not find ...\") instead of guessing.\n- Never claim to have performed, created, updated, or deleted anything unless a tool result in this conversation confirms that exact action. You have no ability to act outside your tools.\n";
|
|
1
|
+
export declare const defaultOperatorSystemPrompt = "# Role\n\nYou are an operator agent for a company ERP. You answer the user's request by calling tools in a loop: inspect the data, walk relationships, and \u2014 when the user asks for it \u2014 perform actions.\n\nEvery fact in your final reply must come from a tool call that returned it. Do not invent field names, relationship names, entity types, or record contents.\n\n## How to work\n\n- Call tools step by step. A typical request needs several tool calls; keep going until you have what you need, then reply without calling further tools.\n- If a tool returns an error message (for example \"Tool error: ...\" or \"{ error: ... }\"), read it, correct your input, and try again. Never stop on the first error and never apologise to the user for a tool error.\n- When an error tells you how to recover, recover immediately in the same run: if it suggests a corrected value (a \"suggestion\" field, or \"Retry this call with ...\"), retry the same tool with that value; if it says another tool must be called first (for example describe_entity), call that tool and then retry the original call. Never relay a tool error to the user as a question, and never ask permission to continue \u2014 you already have it.\n- Some tools perform real actions (they create, change, or delete data). When you call one of these, the system pauses and asks the user to approve the action before it runs. If the user denies it, you will see \"Action denied by the user.\" \u2014 accept the decision, do not retry the action, and wrap up by telling the user what was and was not done.\n- Never ask the user a clarifying question mid-run; make the most reasonable assumption, state it in your reply, and proceed.\n\n## Output\n\nWhen you are done, reply in plain prose with the answer or a summary of the actions performed. Quote real field values from tool results.\n\n- Never show a record id to the user. Ids are for tool calls only. Refer to every record by its name (or title), and when you need to disambiguate two records with the same name, describe them by another field they differ on (a location, a date, a status), never by id.\n\n- If the tool results do not contain the information needed to answer, say so plainly (\"I could not find ...\") instead of guessing.\n- Never claim to have performed, created, updated, or deleted anything unless a tool result in this conversation confirms that exact action. You have no ability to act outside your tools.\n";
|
|
2
2
|
//# sourceMappingURL=operator.system.prompt.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.system.prompt.d.ts","sourceRoot":"","sources":["../../../../src/agents/operator/prompts/operator.system.prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,
|
|
1
|
+
{"version":3,"file":"operator.system.prompt.d.ts","sourceRoot":"","sources":["../../../../src/agents/operator/prompts/operator.system.prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,05EAsBvC,CAAC"}
|
|
@@ -19,6 +19,8 @@ Every fact in your final reply must come from a tool call that returned it. Do n
|
|
|
19
19
|
|
|
20
20
|
When you are done, reply in plain prose with the answer or a summary of the actions performed. Quote real field values from tool results.
|
|
21
21
|
|
|
22
|
+
- Never show a record id to the user. Ids are for tool calls only. Refer to every record by its name (or title), and when you need to disambiguate two records with the same name, describe them by another field they differ on (a location, a date, a status), never by id.
|
|
23
|
+
|
|
22
24
|
- If the tool results do not contain the information needed to answer, say so plainly ("I could not find ...") instead of guessing.
|
|
23
25
|
- Never claim to have performed, created, updated, or deleted anything unless a tool result in this conversation confirms that exact action. You have no ability to act outside your tools.
|
|
24
26
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.system.prompt.js","sourceRoot":"","sources":["../../../../src/agents/operator/prompts/operator.system.prompt.ts"],"names":[],"mappings":";;;AAAa,QAAA,2BAA2B,GAAG
|
|
1
|
+
{"version":3,"file":"operator.system.prompt.js","sourceRoot":"","sources":["../../../../src/agents/operator/prompts/operator.system.prompt.ts"],"names":[],"mappings":";;;AAAa,QAAA,2BAA2B,GAAG;;;;;;;;;;;;;;;;;;;;;;CAsB1C,CAAC"}
|
|
@@ -21,11 +21,30 @@ export type OperatorRunResult = {
|
|
|
21
21
|
input: number;
|
|
22
22
|
output: number;
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Error the approved destructive tool returned instead of writing. Present
|
|
26
|
+
* only when an approved action failed: the caller must record the action as
|
|
27
|
+
* failed rather than executed.
|
|
28
|
+
*/
|
|
29
|
+
actionError?: string;
|
|
24
30
|
} | {
|
|
25
31
|
kind: "pending_approval";
|
|
26
32
|
toolName: string;
|
|
27
33
|
toolArgs: Record<string, unknown>;
|
|
28
34
|
summary: string;
|
|
35
|
+
/** Name-resolved rendering of the pending write; absent when it could not be built. */
|
|
36
|
+
proposal?: Record<string, unknown>;
|
|
37
|
+
/**
|
|
38
|
+
* Error the approved destructive tool returned instead of writing. Present
|
|
39
|
+
* only when an approved action failed: the caller must record the action as
|
|
40
|
+
* failed rather than executed.
|
|
41
|
+
*
|
|
42
|
+
* A resumed run can pause again on a SECOND approval — the model reacts to
|
|
43
|
+
* the refusal by proposing another destructive call — so the outcome of the
|
|
44
|
+
* action that was just approved has to travel on this variant too. Reading
|
|
45
|
+
* it only off `completed` silently marks a failed action `executed`.
|
|
46
|
+
*/
|
|
47
|
+
actionError?: string;
|
|
29
48
|
};
|
|
30
49
|
/**
|
|
31
50
|
* OperatorService - the operator agent graph (START → agent ⇄ tools → finalise → END).
|
|
@@ -94,6 +113,19 @@ export declare class OperatorService {
|
|
|
94
113
|
seedContexts?: AssistantSeedContext[];
|
|
95
114
|
}): Promise<OperatorRunResult>;
|
|
96
115
|
private compileGraph;
|
|
116
|
+
/**
|
|
117
|
+
* Runs a destructive tool's `validate` hook, if it has one. A hook that throws
|
|
118
|
+
* is treated as a rejection: the execution path already turns a throw into a
|
|
119
|
+
* `Tool error: ...` ToolMessage, and refusing the call is the safe direction —
|
|
120
|
+
* the alternative is asking the user to approve a call nothing could check.
|
|
121
|
+
*/
|
|
122
|
+
private validateDestructive;
|
|
123
|
+
/**
|
|
124
|
+
* The error a write tool returned instead of writing — write tools report a
|
|
125
|
+
* refusal as `{ error }` (JSON-stringified), never as a throw, so the string
|
|
126
|
+
* has to be parsed back.
|
|
127
|
+
*/
|
|
128
|
+
private extractActionError;
|
|
97
129
|
/** Entity references derived deterministically from the tool-call recorder (never from the LLM). */
|
|
98
130
|
private collectReferences;
|
|
99
131
|
/** Chunk citations recorded by retrieval tool wrappers into the recorder. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operator.service.d.ts","sourceRoot":"","sources":["../../../../src/agents/operator/services/operator.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAG/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,8CAA8C,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AAC9F,OAAO,EAAE,mBAAmB,EAA0B,MAAM,4BAA4B,CAAC;AACzF,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAGpE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uDAAuD,CAAC;AAC7F,OAAO,EAAE,gBAAgB,EAAyC,MAAM,8BAA8B,CAAC;AAOvG,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,2BA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W,CAAC,EAAE,MAAM,CAAC;QACrB,gEAAgE;QAChE,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAC;KACvC,GAAG,OAAO,CAAC,iBAAiB,CAAC;IA0CxB,MAAM,CAAC,MAAM,EAAE;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,OAAO,CAAC;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,aAAa,EAAE,MAAM,EAAE,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,EAAE,gBAAgB,EAAE,CAAC;QAC9B,iFAAiF;QACjF,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,iFAAiF;QACjF,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,8EAA8E;QAC9E,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,gGAAgG;QAChG,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,gEAAgE;QAChE,YAAY,CAAC,EAAE,oBAAoB,EAAE,CAAC;KACvC,GAAG,OAAO,CAAC,iBAAiB,CAAC;YAiChB,YAAY;IAsO1B;;;;;OAKG;YACW,mBAAmB;IAejC;;;;OAIG;IACH,OAAO,CAAC,kBAAkB;IAc1B,oGAAoG;IACpG,OAAO,CAAC,iBAAiB;IAsBzB,6EAA6E;IAC7E,OAAO,CAAC,gBAAgB;IAcxB,OAAO,CAAC,oBAAoB;IAmB5B,OAAO,CAAC,SAAS;CA6BlB"}
|
|
@@ -197,6 +197,8 @@ let OperatorService = OperatorService_1 = class OperatorService {
|
|
|
197
197
|
const ordered = [...calls.filter((c) => isDestructive(c.name)), ...calls.filter((c) => !isDestructive(c.name))];
|
|
198
198
|
const toolMessages = [];
|
|
199
199
|
let destructiveHandled = false;
|
|
200
|
+
/** Set on every pass that EXECUTED an approved destructive call: the error, or null. */
|
|
201
|
+
let actionOutcome;
|
|
200
202
|
for (const [index, call] of ordered.entries()) {
|
|
201
203
|
const callId = call.id ?? `call_${index}`;
|
|
202
204
|
const definition = toolMap.get(call.name);
|
|
@@ -212,11 +214,35 @@ let OperatorService = OperatorService_1 = class OperatorService {
|
|
|
212
214
|
}));
|
|
213
215
|
continue;
|
|
214
216
|
}
|
|
217
|
+
const toolArgs = (call.args ?? {});
|
|
218
|
+
// Pre-flight the call BEFORE freezing the run. An invalid call that is
|
|
219
|
+
// only refused at execution time is refused AFTER the user approved
|
|
220
|
+
// it: they approve an action and nothing is written. A rejection here
|
|
221
|
+
// becomes a recoverable tool error instead, and — because
|
|
222
|
+
// `destructiveHandled` stays false — the model can still get one
|
|
223
|
+
// corrected action approved in this same pass.
|
|
224
|
+
const rejection = await this.validateDestructive(definition, call.name, toolArgs);
|
|
225
|
+
if (rejection) {
|
|
226
|
+
toolMessages.push(new messages_1.ToolMessage({ content: `Tool error: ${rejection}`, tool_call_id: callId }));
|
|
227
|
+
continue;
|
|
228
|
+
}
|
|
215
229
|
destructiveHandled = true;
|
|
230
|
+
// A proposal resolves referenced record NAMES, so it touches the
|
|
231
|
+
// database. It is presentation only: if it fails the approval must
|
|
232
|
+
// still be raised, with the summary alone.
|
|
233
|
+
let proposal;
|
|
234
|
+
try {
|
|
235
|
+
proposal = await definition.present?.(toolArgs);
|
|
236
|
+
}
|
|
237
|
+
catch (err) {
|
|
238
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
239
|
+
this.logger.warn(`operator tool "${call.name}" could not build an approval proposal: ${message}`);
|
|
240
|
+
}
|
|
216
241
|
const payload = {
|
|
217
242
|
toolName: call.name,
|
|
218
|
-
toolArgs
|
|
219
|
-
summary: definition.summarise?.(
|
|
243
|
+
toolArgs,
|
|
244
|
+
summary: (await definition.summarise?.(toolArgs)) ?? `${call.name}(${JSON.stringify(toolArgs)})`,
|
|
245
|
+
...(proposal ? { proposal } : {}),
|
|
220
246
|
};
|
|
221
247
|
const decision = (0, langgraph_1.interrupt)(payload);
|
|
222
248
|
if (!decision?.approved) {
|
|
@@ -226,6 +252,13 @@ let OperatorService = OperatorService_1 = class OperatorService {
|
|
|
226
252
|
}
|
|
227
253
|
try {
|
|
228
254
|
const result = await definition.tool.invoke(call.args ?? {});
|
|
255
|
+
// Only an APPROVED destructive call reaches this line (a denied one
|
|
256
|
+
// continued above), so its outcome is the action's outcome. A write
|
|
257
|
+
// tool reports a refusal as a returned `{ error }`, not a throw, so
|
|
258
|
+
// without reading it back the AssistantAction would be marked
|
|
259
|
+
// executed while nothing was written.
|
|
260
|
+
if (definition.destructive)
|
|
261
|
+
actionOutcome = { error: this.extractActionError(result) };
|
|
229
262
|
toolMessages.push(new messages_1.ToolMessage({
|
|
230
263
|
content: typeof result === "string" ? result : JSON.stringify(result),
|
|
231
264
|
tool_call_id: callId,
|
|
@@ -234,6 +267,8 @@ let OperatorService = OperatorService_1 = class OperatorService {
|
|
|
234
267
|
catch (err) {
|
|
235
268
|
const message = err instanceof Error ? err.message : String(err);
|
|
236
269
|
this.logger.warn(`operator tool "${call.name}" failed: ${message}`);
|
|
270
|
+
if (definition.destructive)
|
|
271
|
+
actionOutcome = { error: message };
|
|
237
272
|
toolMessages.push(new messages_1.ToolMessage({ content: `Tool error: ${message}`, tool_call_id: callId }));
|
|
238
273
|
}
|
|
239
274
|
}
|
|
@@ -246,6 +281,9 @@ let OperatorService = OperatorService_1 = class OperatorService {
|
|
|
246
281
|
toolCalls: newRecords,
|
|
247
282
|
references: this.collectReferences(newRecords),
|
|
248
283
|
citations: this.collectCitations(newRecords),
|
|
284
|
+
// Written only by a pass that executed an approved destructive call, so
|
|
285
|
+
// a read-only pass never clears (nor invents) an action's outcome.
|
|
286
|
+
...(actionOutcome ? { actionError: actionOutcome.error } : {}),
|
|
249
287
|
};
|
|
250
288
|
})
|
|
251
289
|
.addNode("finalise", async (state) => {
|
|
@@ -299,6 +337,44 @@ let OperatorService = OperatorService_1 = class OperatorService {
|
|
|
299
337
|
.addEdge("finalise", langgraph_1.END);
|
|
300
338
|
return workflow.compile({ checkpointer: saver });
|
|
301
339
|
}
|
|
340
|
+
/**
|
|
341
|
+
* Runs a destructive tool's `validate` hook, if it has one. A hook that throws
|
|
342
|
+
* is treated as a rejection: the execution path already turns a throw into a
|
|
343
|
+
* `Tool error: ...` ToolMessage, and refusing the call is the safe direction —
|
|
344
|
+
* the alternative is asking the user to approve a call nothing could check.
|
|
345
|
+
*/
|
|
346
|
+
async validateDestructive(definition, name, args) {
|
|
347
|
+
if (!definition.validate)
|
|
348
|
+
return null;
|
|
349
|
+
try {
|
|
350
|
+
return await definition.validate(args);
|
|
351
|
+
}
|
|
352
|
+
catch (err) {
|
|
353
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
354
|
+
this.logger.warn(`operator tool "${name}" could not be validated: ${message}`);
|
|
355
|
+
return message;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* The error a write tool returned instead of writing — write tools report a
|
|
360
|
+
* refusal as `{ error }` (JSON-stringified), never as a throw, so the string
|
|
361
|
+
* has to be parsed back.
|
|
362
|
+
*/
|
|
363
|
+
extractActionError(result) {
|
|
364
|
+
let parsed = result;
|
|
365
|
+
if (typeof result === "string") {
|
|
366
|
+
try {
|
|
367
|
+
parsed = JSON.parse(result);
|
|
368
|
+
}
|
|
369
|
+
catch {
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (!parsed || typeof parsed !== "object")
|
|
374
|
+
return null;
|
|
375
|
+
const error = parsed.error;
|
|
376
|
+
return typeof error === "string" && error.length ? error : null;
|
|
377
|
+
}
|
|
302
378
|
/** Entity references derived deterministically from the tool-call recorder (never from the LLM). */
|
|
303
379
|
collectReferences(records) {
|
|
304
380
|
const references = [];
|
|
@@ -364,6 +440,10 @@ let OperatorService = OperatorService_1 = class OperatorService {
|
|
|
364
440
|
toolName: payload.toolName ?? "",
|
|
365
441
|
toolArgs: payload.toolArgs ?? {},
|
|
366
442
|
summary: payload.summary ?? "",
|
|
443
|
+
...(payload.proposal ? { proposal: payload.proposal } : {}),
|
|
444
|
+
// The run paused again, but an action approved EARLIER in this same resume
|
|
445
|
+
// may already have failed; without this its status would stay `executed`.
|
|
446
|
+
...(finalState.actionError ? { actionError: finalState.actionError } : {}),
|
|
367
447
|
};
|
|
368
448
|
}
|
|
369
449
|
return {
|
|
@@ -374,6 +454,7 @@ let OperatorService = OperatorService_1 = class OperatorService {
|
|
|
374
454
|
citations: finalState.citations ?? [],
|
|
375
455
|
toolCalls: finalState.toolCalls ?? [],
|
|
376
456
|
tokens: finalState.tokens ?? { input: 0, output: 0 },
|
|
457
|
+
...(finalState.actionError ? { actionError: finalState.actionError } : {}),
|
|
377
458
|
};
|
|
378
459
|
}
|
|
379
460
|
};
|