@mcp-abap-adt/llm-agent-server-libs 19.1.2 → 20.0.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/factories/controller-factory.d.ts +20 -6
- package/dist/factories/controller-factory.d.ts.map +1 -1
- package/dist/factories/controller-factory.js +52 -11
- package/dist/factories/controller-factory.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/pipelines/controller.d.ts +4 -2
- package/dist/pipelines/controller.d.ts.map +1 -1
- package/dist/pipelines/controller.js +55 -5
- package/dist/pipelines/controller.js.map +1 -1
- package/dist/pipelines/dag.d.ts +2 -2
- package/dist/pipelines/dag.d.ts.map +1 -1
- package/dist/pipelines/dag.js +4 -3
- package/dist/pipelines/dag.js.map +1 -1
- package/dist/pipelines/flat.d.ts.map +1 -1
- package/dist/pipelines/flat.js +2 -1
- package/dist/pipelines/flat.js.map +1 -1
- package/dist/pipelines/linear.d.ts.map +1 -1
- package/dist/pipelines/linear.js +2 -1
- package/dist/pipelines/linear.js.map +1 -1
- package/dist/pipelines/register-skill-sources.d.ts +21 -0
- package/dist/pipelines/register-skill-sources.d.ts.map +1 -0
- package/dist/pipelines/register-skill-sources.js +57 -0
- package/dist/pipelines/register-skill-sources.js.map +1 -0
- package/dist/pipelines/server-context.d.ts +37 -1
- package/dist/pipelines/server-context.d.ts.map +1 -1
- package/dist/pipelines/server-context.js.map +1 -1
- package/dist/pipelines/stepper.d.ts +2 -2
- package/dist/pipelines/stepper.js +2 -2
- package/dist/smart-agent/config.d.ts +1 -1
- package/dist/smart-agent/config.d.ts.map +1 -1
- package/dist/smart-agent/config.js +7 -3
- package/dist/smart-agent/config.js.map +1 -1
- package/dist/smart-agent/controller/artifacts.d.ts +116 -0
- package/dist/smart-agent/controller/artifacts.d.ts.map +1 -0
- package/dist/smart-agent/controller/artifacts.js +192 -0
- package/dist/smart-agent/controller/artifacts.js.map +1 -0
- package/dist/smart-agent/controller/board.d.ts +73 -0
- package/dist/smart-agent/controller/board.d.ts.map +1 -0
- package/dist/smart-agent/controller/board.js +233 -0
- package/dist/smart-agent/controller/board.js.map +1 -0
- package/dist/smart-agent/controller/controller-coordinator-handler.d.ts +75 -7
- package/dist/smart-agent/controller/controller-coordinator-handler.d.ts.map +1 -1
- package/dist/smart-agent/controller/controller-coordinator-handler.js +929 -66
- package/dist/smart-agent/controller/controller-coordinator-handler.js.map +1 -1
- package/dist/smart-agent/controller/finalizer.d.ts +48 -0
- package/dist/smart-agent/controller/finalizer.d.ts.map +1 -0
- package/dist/smart-agent/controller/finalizer.js +126 -0
- package/dist/smart-agent/controller/finalizer.js.map +1 -0
- package/dist/smart-agent/controller/memorizer.d.ts +2 -2
- package/dist/smart-agent/controller/memorizer.d.ts.map +1 -1
- package/dist/smart-agent/controller/memorizer.js +2 -2
- package/dist/smart-agent/controller/memorizer.js.map +1 -1
- package/dist/smart-agent/controller/outcome.d.ts +28 -0
- package/dist/smart-agent/controller/outcome.d.ts.map +1 -0
- package/dist/smart-agent/controller/outcome.js +30 -0
- package/dist/smart-agent/controller/outcome.js.map +1 -0
- package/dist/smart-agent/controller/planner.d.ts +41 -14
- package/dist/smart-agent/controller/planner.d.ts.map +1 -1
- package/dist/smart-agent/controller/planner.js +149 -73
- package/dist/smart-agent/controller/planner.js.map +1 -1
- package/dist/smart-agent/controller/reviewer.d.ts +48 -0
- package/dist/smart-agent/controller/reviewer.d.ts.map +1 -0
- package/dist/smart-agent/controller/reviewer.js +116 -0
- package/dist/smart-agent/controller/reviewer.js.map +1 -0
- package/dist/smart-agent/controller/run-scope.d.ts +50 -0
- package/dist/smart-agent/controller/run-scope.d.ts.map +1 -0
- package/dist/smart-agent/controller/run-scope.js +99 -0
- package/dist/smart-agent/controller/run-scope.js.map +1 -0
- package/dist/smart-agent/controller/session-bundle.d.ts +5 -0
- package/dist/smart-agent/controller/session-bundle.d.ts.map +1 -1
- package/dist/smart-agent/controller/session-bundle.js +27 -0
- package/dist/smart-agent/controller/session-bundle.js.map +1 -1
- package/dist/smart-agent/controller/types.d.ts +124 -15
- package/dist/smart-agent/controller/types.d.ts.map +1 -1
- package/dist/smart-agent/controller/types.js +30 -1
- package/dist/smart-agent/controller/types.js.map +1 -1
- package/dist/smart-agent/embedder-knowledge-index.d.ts +28 -0
- package/dist/smart-agent/embedder-knowledge-index.d.ts.map +1 -0
- package/dist/smart-agent/embedder-knowledge-index.js +71 -0
- package/dist/smart-agent/embedder-knowledge-index.js.map +1 -0
- package/dist/smart-agent/jsonl-knowledge-backend.d.ts +26 -10
- package/dist/smart-agent/jsonl-knowledge-backend.d.ts.map +1 -1
- package/dist/smart-agent/jsonl-knowledge-backend.js +81 -9
- package/dist/smart-agent/jsonl-knowledge-backend.js.map +1 -1
- package/dist/smart-agent/pg-pool.d.ts +58 -0
- package/dist/smart-agent/pg-pool.d.ts.map +1 -0
- package/dist/smart-agent/pg-pool.js +149 -0
- package/dist/smart-agent/pg-pool.js.map +1 -0
- package/dist/smart-agent/skill-plugins-config.d.ts +97 -0
- package/dist/smart-agent/skill-plugins-config.d.ts.map +1 -0
- package/dist/smart-agent/skill-plugins-config.js +318 -0
- package/dist/smart-agent/skill-plugins-config.js.map +1 -0
- package/dist/smart-agent/skill-plugins-config.test.d.ts +2 -0
- package/dist/smart-agent/skill-plugins-config.test.d.ts.map +1 -0
- package/dist/smart-agent/skill-plugins-config.test.js.map +1 -0
- package/dist/smart-agent/skill-plugins-host-factory.d.ts +98 -0
- package/dist/smart-agent/skill-plugins-host-factory.d.ts.map +1 -0
- package/dist/smart-agent/skill-plugins-host-factory.js +284 -0
- package/dist/smart-agent/skill-plugins-host-factory.js.map +1 -0
- package/dist/smart-agent/skill-plugins-host-factory.test.d.ts +2 -0
- package/dist/smart-agent/skill-plugins-host-factory.test.d.ts.map +1 -0
- package/dist/smart-agent/skill-plugins-host-factory.test.js.map +1 -0
- package/dist/smart-agent/smart-server.d.ts +25 -0
- package/dist/smart-agent/smart-server.d.ts.map +1 -1
- package/dist/smart-agent/smart-server.js +141 -7
- package/dist/smart-agent/smart-server.js.map +1 -1
- package/package.json +9 -7
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BuiltCoordinator, CallOptions, IEmbedder, IKnowledgeRagHandle, IPipelineFactory, LlmTool, PipelineFactoryDepsBase } from '@mcp-abap-adt/llm-agent';
|
|
2
2
|
import type { KnowledgeBackend } from '@mcp-abap-adt/llm-agent-libs';
|
|
3
|
-
import type { ControllerConfig } from '../smart-agent/controller/types.js';
|
|
3
|
+
import type { ControllerConfig, PlannerKind } from '../smart-agent/controller/types.js';
|
|
4
4
|
/**
|
|
5
5
|
* Runtime dependencies for {@link ControllerFactory}. Like the Stepper factory
|
|
6
6
|
* deps, it extends {@link PipelineFactoryDepsBase} — the three controller roles
|
|
@@ -13,13 +13,22 @@ export interface ControllerFactoryDeps extends PipelineFactoryDepsBase {
|
|
|
13
13
|
backend: KnowledgeBackend;
|
|
14
14
|
/** Per-sessionId knowledge RAG factory. */
|
|
15
15
|
knowledgeRagFor: (sessionId: string) => IKnowledgeRagHandle | Promise<IKnowledgeRagHandle>;
|
|
16
|
-
/**
|
|
17
|
-
* (
|
|
16
|
+
/** ALWAYS required: results-RAG recall ranks by embedding similarity in every
|
|
17
|
+
* persistence mode (and distance target-state, if used). `build()` throws when
|
|
18
|
+
* absent — optional here only so the dep object can be assembled incrementally. */
|
|
18
19
|
embedder?: IEmbedder;
|
|
19
20
|
/** Semantic top-K tool selection over the vectorized MCP catalog. */
|
|
20
21
|
selectTools: (query: string, k?: number, options?: CallOptions) => Promise<readonly LlmTool[]>;
|
|
21
22
|
/** Optional override marking a tool as consumer-supplied (test-only). */
|
|
22
23
|
isExternalTool?: (toolName: string) => boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Optional controller-own skills recall hook. When present, the planner queries
|
|
26
|
+
* it before each create-plan/replan and injects a bounded "Relevant skills"
|
|
27
|
+
* block into the prompt. The controller pipeline builds this from the skill
|
|
28
|
+
* plugin-host + configured group. Absent → the planner prompt is byte-identical
|
|
29
|
+
* to the agnostic path (the measurement toggle).
|
|
30
|
+
*/
|
|
31
|
+
skillsRecall?: (goal: string, options?: CallOptions) => Promise<string>;
|
|
23
32
|
}
|
|
24
33
|
/**
|
|
25
34
|
* Builder-factory for the `controller` pipeline — the code-level (no-YAML)
|
|
@@ -33,9 +42,14 @@ export interface ControllerFactoryDeps extends PipelineFactoryDepsBase {
|
|
|
33
42
|
* ```ts
|
|
34
43
|
* import { ControllerFactory } from '@mcp-abap-adt/llm-agent-server-libs/controller';
|
|
35
44
|
* const { handler } = await new ControllerFactory().build(config, {
|
|
36
|
-
* // role is typed as string by the base deps — resolve it explicitly.
|
|
45
|
+
* // role is typed as string by the base deps — resolve it explicitly. reviewer/
|
|
46
|
+
* // finalizer are only requested when their subagent block is present; map them
|
|
47
|
+
* // to config.subagents.reviewer ?? planner (likewise finalizer) for a 5-role config.
|
|
37
48
|
* makeRoleLlm: (role) =>
|
|
38
|
-
* makeLlm(
|
|
49
|
+
* makeLlm(
|
|
50
|
+
* config.subagents[role as keyof typeof config.subagents] ??
|
|
51
|
+
* config.subagents.planner,
|
|
52
|
+
* ),
|
|
39
53
|
* callMcp, backend, knowledgeRagFor, embedder, selectTools,
|
|
40
54
|
* });
|
|
41
55
|
* const handle = await builder.withStepperCoordinator(handler).build();
|
|
@@ -43,6 +57,6 @@ export interface ControllerFactoryDeps extends PipelineFactoryDepsBase {
|
|
|
43
57
|
*/
|
|
44
58
|
export declare class ControllerFactory implements IPipelineFactory<ControllerConfig, ControllerFactoryDeps> {
|
|
45
59
|
readonly kind: "controller";
|
|
46
|
-
build(config: ControllerConfig, deps: ControllerFactoryDeps): Promise<BuiltCoordinator>;
|
|
60
|
+
build(config: ControllerConfig, deps: ControllerFactoryDeps, plannerKind?: PlannerKind): Promise<BuiltCoordinator>;
|
|
47
61
|
}
|
|
48
62
|
//# sourceMappingURL=controller-factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller-factory.d.ts","sourceRoot":"","sources":["../../src/factories/controller-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,OAAO,EACP,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"controller-factory.d.ts","sourceRoot":"","sources":["../../src/factories/controller-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,gBAAgB,EAChB,OAAO,EACP,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAMrE,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,oCAAoC,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,WAAW,qBAAsB,SAAQ,uBAAuB;IACpE,uEAAuE;IACvE,OAAO,EAAE,gBAAgB,CAAC;IAC1B,2CAA2C;IAC3C,eAAe,EAAE,CACf,SAAS,EAAE,MAAM,KACd,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACxD;;wFAEoF;IACpF,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,qEAAqE;IACrE,WAAW,EAAE,CACX,KAAK,EAAE,MAAM,EACb,CAAC,CAAC,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,WAAW,KAClB,OAAO,CAAC,SAAS,OAAO,EAAE,CAAC,CAAC;IACjC,yEAAyE;IACzE,cAAc,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;IAC/C;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACzE;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,qBAAa,iBACX,YAAW,gBAAgB,CAAC,gBAAgB,EAAE,qBAAqB,CAAC;IAEpE,QAAQ,CAAC,IAAI,EAAG,YAAY,CAAU;IAEhC,KAAK,CACT,MAAM,EAAE,gBAAgB,EACxB,IAAI,EAAE,qBAAqB,EAC3B,WAAW,GAAE,WAA8B,GAC1C,OAAO,CAAC,gBAAgB,CAAC;CA0E7B"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { validateBoardBudget } from '../smart-agent/controller/board.js';
|
|
1
2
|
import { ControllerCoordinatorHandler } from '../smart-agent/controller/controller-coordinator-handler.js';
|
|
3
|
+
import { LlmFinalizer } from '../smart-agent/controller/finalizer.js';
|
|
4
|
+
import { LlmReviewer } from '../smart-agent/controller/reviewer.js';
|
|
2
5
|
import { makeSubagentClient } from '../smart-agent/controller/subagent-client.js';
|
|
3
6
|
/**
|
|
4
7
|
* Builder-factory for the `controller` pipeline — the code-level (no-YAML)
|
|
@@ -12,9 +15,14 @@ import { makeSubagentClient } from '../smart-agent/controller/subagent-client.js
|
|
|
12
15
|
* ```ts
|
|
13
16
|
* import { ControllerFactory } from '@mcp-abap-adt/llm-agent-server-libs/controller';
|
|
14
17
|
* const { handler } = await new ControllerFactory().build(config, {
|
|
15
|
-
* // role is typed as string by the base deps — resolve it explicitly.
|
|
18
|
+
* // role is typed as string by the base deps — resolve it explicitly. reviewer/
|
|
19
|
+
* // finalizer are only requested when their subagent block is present; map them
|
|
20
|
+
* // to config.subagents.reviewer ?? planner (likewise finalizer) for a 5-role config.
|
|
16
21
|
* makeRoleLlm: (role) =>
|
|
17
|
-
* makeLlm(
|
|
22
|
+
* makeLlm(
|
|
23
|
+
* config.subagents[role as keyof typeof config.subagents] ??
|
|
24
|
+
* config.subagents.planner,
|
|
25
|
+
* ),
|
|
18
26
|
* callMcp, backend, knowledgeRagFor, embedder, selectTools,
|
|
19
27
|
* });
|
|
20
28
|
* const handle = await builder.withStepperCoordinator(handler).build();
|
|
@@ -22,21 +30,45 @@ import { makeSubagentClient } from '../smart-agent/controller/subagent-client.js
|
|
|
22
30
|
*/
|
|
23
31
|
export class ControllerFactory {
|
|
24
32
|
kind = 'controller';
|
|
25
|
-
async build(config, deps) {
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'
|
|
33
|
+
async build(config, deps, plannerKind = 'smart-executor') {
|
|
34
|
+
// results-RAG recall is embedding-based in EVERY persistence mode → require an
|
|
35
|
+
// embedder AND a semantic-recall-capable backend. The embedder alone is not
|
|
36
|
+
// enough: a programmatic caller could pass an embedder PLUS a plain backend with
|
|
37
|
+
// no index, and recall would silently degrade to insertion order. Assert BOTH at
|
|
38
|
+
// the controller boundary, fail loud at build time.
|
|
39
|
+
if (!deps.embedder) {
|
|
40
|
+
throw new Error("pipeline 'controller' requires an embedder: results-RAG recall ranks by " +
|
|
41
|
+
'embedding similarity (and distance target-state, if used). Provide deps.embedder.');
|
|
34
42
|
}
|
|
43
|
+
if (!deps.backend.semanticRecallCapable) {
|
|
44
|
+
throw new Error("pipeline 'controller' requires a semantic-recall-capable knowledge backend " +
|
|
45
|
+
'(one built with an embedder-backed index); the injected backend reports ' +
|
|
46
|
+
'semanticRecallCapable=false, so recall would degrade to insertion order. ' +
|
|
47
|
+
'Build the backend via buildKnowledgeBackend (with a resolved embedder) or ' +
|
|
48
|
+
'inject a semantic-capable one.');
|
|
49
|
+
}
|
|
50
|
+
const b = config.budgets;
|
|
51
|
+
validateBoardBudget({
|
|
52
|
+
maxDigestChars: b.maxDigestChars ?? 500,
|
|
53
|
+
maxIntentChars: b.maxIntentChars ?? 120,
|
|
54
|
+
maxActiveSteps: b.maxActiveSteps ?? 16,
|
|
55
|
+
maxBoardChars: b.maxBoardChars ?? 12000,
|
|
56
|
+
keepRecentDigests: b.keepRecentDigests ?? 8,
|
|
57
|
+
});
|
|
35
58
|
const [evaluatorLlm, plannerLlm, executorLlm] = await Promise.all([
|
|
36
59
|
deps.makeRoleLlm('evaluator'),
|
|
37
60
|
deps.makeRoleLlm('planner'),
|
|
38
61
|
deps.makeRoleLlm('executor'),
|
|
39
62
|
]);
|
|
63
|
+
// reviewer/finalizer default to the planner's LLM when their subagent config is
|
|
64
|
+
// absent (3-role config); the factory only resolves a distinct role LLM when the
|
|
65
|
+
// subagent block is present, so a 3-role config needs no resolver change.
|
|
66
|
+
const reviewerLlm = config.subagents.reviewer
|
|
67
|
+
? await deps.makeRoleLlm('reviewer')
|
|
68
|
+
: plannerLlm;
|
|
69
|
+
const finalizerLlm = config.subagents.finalizer
|
|
70
|
+
? await deps.makeRoleLlm('finalizer')
|
|
71
|
+
: plannerLlm;
|
|
40
72
|
const handler = new ControllerCoordinatorHandler({
|
|
41
73
|
evaluator: makeSubagentClient(evaluatorLlm),
|
|
42
74
|
planner: makeSubagentClient(plannerLlm),
|
|
@@ -47,11 +79,20 @@ export class ControllerFactory {
|
|
|
47
79
|
callMcp: (name, args) => deps.callMcp(name, args),
|
|
48
80
|
selectTools: deps.selectTools,
|
|
49
81
|
...(deps.isExternalTool ? { isExternalTool: deps.isExternalTool } : {}),
|
|
82
|
+
...(deps.skillsRecall ? { skillsRecall: deps.skillsRecall } : {}),
|
|
83
|
+
reviewer: new LlmReviewer(makeSubagentClient(reviewerLlm)),
|
|
84
|
+
finalizer: new LlmFinalizer(makeSubagentClient(finalizerLlm), {
|
|
85
|
+
budget: 12000,
|
|
86
|
+
perResultCap: 4000,
|
|
87
|
+
}),
|
|
50
88
|
config,
|
|
89
|
+
plannerKind,
|
|
51
90
|
models: {
|
|
52
91
|
evaluator: evaluatorLlm.model ?? 'unknown',
|
|
53
92
|
planner: plannerLlm.model ?? 'unknown',
|
|
54
93
|
executor: executorLlm.model ?? 'unknown',
|
|
94
|
+
reviewer: reviewerLlm.model ?? 'unknown',
|
|
95
|
+
finalizer: finalizerLlm.model ?? 'unknown',
|
|
55
96
|
},
|
|
56
97
|
});
|
|
57
98
|
return { handler };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller-factory.js","sourceRoot":"","sources":["../../src/factories/controller-factory.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,4BAA4B,EAAE,MAAM,6DAA6D,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"controller-factory.js","sourceRoot":"","sources":["../../src/factories/controller-factory.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,4BAA4B,EAAE,MAAM,6DAA6D,CAAC;AAC3G,OAAO,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AA0ClF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,OAAO,iBAAiB;IAGnB,IAAI,GAAG,YAAqB,CAAC;IAEtC,KAAK,CAAC,KAAK,CACT,MAAwB,EACxB,IAA2B,EAC3B,cAA2B,gBAAgB;QAE3C,+EAA+E;QAC/E,4EAA4E;QAC5E,iFAAiF;QACjF,iFAAiF;QACjF,oDAAoD;QACpD,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CACb,0EAA0E;gBACxE,mFAAmF,CACtF,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;YACxC,MAAM,IAAI,KAAK,CACb,6EAA6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E,IAAI,CAAC,eAAe;YACrC,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC;YACjD,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,GAAG,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvE,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACjE,QAAQ,EAAE,IAAI,WAAW,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;YAC1D,SAAS,EAAE,IAAI,YAAY,CAAC,kBAAkB,CAAC,YAAY,CAAC,EAAE;gBAC5D,MAAM,EAAE,KAAK;gBACb,YAAY,EAAE,IAAI;aACnB,CAAC;YACF,MAAM;YACN,WAAW;YACX,MAAM,EAAE;gBACN,SAAS,EAAE,YAAY,CAAC,KAAK,IAAI,SAAS;gBAC1C,OAAO,EAAE,UAAU,CAAC,KAAK,IAAI,SAAS;gBACtC,QAAQ,EAAE,WAAW,CAAC,KAAK,IAAI,SAAS;gBACxC,QAAQ,EAAE,WAAW,CAAC,KAAK,IAAI,SAAS;gBACxC,SAAS,EAAE,YAAY,CAAC,KAAK,IAAI,SAAS;aAC3C;SACF,CAAC,CAAC;QACH,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC;CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "
|
|
1
|
+
export declare const PACKAGE_VERSION = "20.0.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from './smart-agent/build-dag-coordinator-deps.js';
|
|
|
4
4
|
export * from './smart-agent/build-stepper-root.js';
|
|
5
5
|
export * from './smart-agent/config.js';
|
|
6
6
|
export * from './smart-agent/jsonl-knowledge-backend.js';
|
|
7
|
+
export { makePgPool, makePgReadPool } from './smart-agent/pg-pool.js';
|
|
7
8
|
export * from './smart-agent/pipeline.js';
|
|
8
9
|
export * from './smart-agent/resolve-agent-embedder.js';
|
|
9
10
|
export * from './smart-agent/session-identity-resolver.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0CAA0C,CAAC;AACzD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8CAA8C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0CAA0C,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACtE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8CAA8C,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from './smart-agent/build-dag-coordinator-deps.js';
|
|
|
4
4
|
export * from './smart-agent/build-stepper-root.js';
|
|
5
5
|
export * from './smart-agent/config.js';
|
|
6
6
|
export * from './smart-agent/jsonl-knowledge-backend.js';
|
|
7
|
+
export { makePgPool, makePgReadPool } from './smart-agent/pg-pool.js';
|
|
7
8
|
export * from './smart-agent/pipeline.js';
|
|
8
9
|
export * from './smart-agent/resolve-agent-embedder.js';
|
|
9
10
|
export * from './smart-agent/session-identity-resolver.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0CAA0C,CAAC;AACzD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8CAA8C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6CAA6C,CAAC;AAC5D,cAAc,qCAAqC,CAAC;AACpD,cAAc,yBAAyB,CAAC;AACxC,cAAc,0CAA0C,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AACtE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8CAA8C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IPipelineInstance, IPipelinePlugin } from '@mcp-abap-adt/llm-agent';
|
|
2
|
-
import type { ControllerConfig } from '../smart-agent/controller/types.js';
|
|
2
|
+
import type { ControllerConfig, PlannerKind } from '../smart-agent/controller/types.js';
|
|
3
3
|
import type { IControllerServerPipelineContext } from './server-context.js';
|
|
4
4
|
export { ControllerFactory, type ControllerFactoryDeps, } from '../factories/controller-factory.js';
|
|
5
5
|
export { ControllerCoordinatorHandler, type ControllerHandlerDeps, } from '../smart-agent/controller/controller-coordinator-handler.js';
|
|
@@ -13,7 +13,9 @@ export type { ControllerConfig, SessionBundle, } from '../smart-agent/controller
|
|
|
13
13
|
* the runnable agent plus a disposal hook.
|
|
14
14
|
*/
|
|
15
15
|
export declare class ControllerPipelinePlugin implements IPipelinePlugin<ControllerConfig> {
|
|
16
|
-
readonly name
|
|
16
|
+
readonly name: string;
|
|
17
|
+
private readonly plannerKind;
|
|
18
|
+
constructor(name?: string, plannerKind?: PlannerKind);
|
|
17
19
|
parseConfig(raw: unknown): ControllerConfig;
|
|
18
20
|
build(cfg: ControllerConfig, ctx: IControllerServerPipelineContext): Promise<IPipelineInstance>;
|
|
19
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/pipelines/controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,iBAAiB,EACjB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"controller.d.ts","sourceRoot":"","sources":["../../src/pipelines/controller.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,iBAAiB,EACjB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAKjC,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACZ,MAAM,oCAAoC,CAAC;AAE5C,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AAM5E,OAAO,EACL,iBAAiB,EACjB,KAAK,qBAAqB,GAC3B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,4BAA4B,EAC5B,KAAK,qBAAqB,GAC3B,MAAM,6DAA6D,CAAC;AACrE,OAAO,EACL,KAAK,eAAe,EACpB,kBAAkB,GACnB,MAAM,8CAA8C,CAAC;AACtD,YAAY,EACV,gBAAgB,EAChB,aAAa,GACd,MAAM,oCAAoC,CAAC;AAE5C;;;;;;GAMG;AACH,qBAAa,wBACX,YAAW,eAAe,CAAC,gBAAgB,CAAC;IAE5C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;gBAExC,IAAI,SAAe,EACnB,WAAW,GAAE,WAA8B;IAM7C,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB;IAsDrC,KAAK,CACT,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,gCAAgC,GACpC,OAAO,CAAC,iBAAiB,CAAC;CA2E9B"}
|
|
@@ -15,7 +15,12 @@ export { makeSubagentClient, } from '../smart-agent/controller/subagent-client.j
|
|
|
15
15
|
* the runnable agent plus a disposal hook.
|
|
16
16
|
*/
|
|
17
17
|
export class ControllerPipelinePlugin {
|
|
18
|
-
name
|
|
18
|
+
name;
|
|
19
|
+
plannerKind;
|
|
20
|
+
constructor(name = 'controller', plannerKind = 'smart-executor') {
|
|
21
|
+
this.name = name;
|
|
22
|
+
this.plannerKind = plannerKind;
|
|
23
|
+
}
|
|
19
24
|
parseConfig(raw) {
|
|
20
25
|
const cfg = (raw ?? {});
|
|
21
26
|
const subagents = (cfg.subagents ?? {});
|
|
@@ -27,11 +32,15 @@ export class ControllerPipelinePlugin {
|
|
|
27
32
|
const targetStateRaw = (cfg.targetState ?? {});
|
|
28
33
|
const sessionMemoryRaw = (cfg.sessionMemory ?? {});
|
|
29
34
|
const budgetsRaw = (cfg.budgets ?? {});
|
|
35
|
+
if ('planner' in cfg) {
|
|
36
|
+
throw new Error('controller: `planner:` removed — capability is preset-encoded. Select ' +
|
|
37
|
+
'pipeline: { name: controller } (smart-executor) or ' +
|
|
38
|
+
'{ name: controller-weak } (weak-executor), or pass the kind to ' +
|
|
39
|
+
'`new ControllerFactory().build(config, deps, "weak-executor")` when ' +
|
|
40
|
+
'composing in code. No `planner:` alias exists.');
|
|
41
|
+
}
|
|
30
42
|
return {
|
|
31
43
|
subagents: subagents,
|
|
32
|
-
planner: (cfg.planner === 'adaptive'
|
|
33
|
-
? 'adaptive'
|
|
34
|
-
: 'incremental'),
|
|
35
44
|
targetState: {
|
|
36
45
|
strategy: 'auto',
|
|
37
46
|
distanceThreshold: 0.25,
|
|
@@ -46,6 +55,11 @@ export class ControllerPipelinePlugin {
|
|
|
46
55
|
maxRetries: 3,
|
|
47
56
|
maxRewinds: 5,
|
|
48
57
|
maxToolCalls: 10,
|
|
58
|
+
maxDigestChars: 500,
|
|
59
|
+
maxIntentChars: 120,
|
|
60
|
+
maxActiveSteps: 16,
|
|
61
|
+
maxBoardChars: 12000,
|
|
62
|
+
keepRecentDigests: 8,
|
|
49
63
|
...budgetsRaw,
|
|
50
64
|
},
|
|
51
65
|
};
|
|
@@ -60,6 +74,41 @@ export class ControllerPipelinePlugin {
|
|
|
60
74
|
// yields [] and the loop runs with external tools only.
|
|
61
75
|
const toolsRag = ctx.toolsRag;
|
|
62
76
|
const selectTools = (query, k, options) => toolsRag ? toolsRag.query(query, k, options) : Promise.resolve([]);
|
|
77
|
+
// Controller-OWN skills recall hook (B4). The controller pipeline builds its
|
|
78
|
+
// subagent prompts itself (it does NOT use the context-assembler), so it needs
|
|
79
|
+
// its own recall: query the configured controller skill group and format a
|
|
80
|
+
// bounded "Relevant skills" block the planner injects into create-plan/replan.
|
|
81
|
+
// Wired ONLY when a host AND a controller group are present; otherwise left
|
|
82
|
+
// undefined so the planner prompt stays byte-identical to the agnostic path.
|
|
83
|
+
// `controllerSkillGroup` is an INDEPENDENT channel from `serveCollections`
|
|
84
|
+
// (assembler pipelines); the group's existence is validated at startup, so we
|
|
85
|
+
// gate purely on host + group presence and do NOT couple to serveCollections.
|
|
86
|
+
const skillHost = ctx.skillHost;
|
|
87
|
+
const group = ctx.skillRecall?.controllerSkillGroup;
|
|
88
|
+
// Resolve the recall handle ONCE (the host memoises it anyway; this is the
|
|
89
|
+
// correct shape — no per-recall rag(group) lookup, and the wrapper's dimension/
|
|
90
|
+
// verdict cache is shared across recalls).
|
|
91
|
+
const skillRagHandle = skillHost && group ? skillHost.rag(group) : undefined;
|
|
92
|
+
const skillsRecall = skillRagHandle
|
|
93
|
+
? async (goal, options) => {
|
|
94
|
+
const k = ctx.skillRecall?.k ?? 4;
|
|
95
|
+
const maxInjectChars = ctx.skillRecall?.maxInjectChars ?? 4000;
|
|
96
|
+
const queryOpts = ctx.skillRecall?.threshold !== undefined
|
|
97
|
+
? { k, threshold: ctx.skillRecall.threshold }
|
|
98
|
+
: { k };
|
|
99
|
+
const hits = await skillRagHandle.query(goal, queryOpts, options);
|
|
100
|
+
if (hits.length === 0)
|
|
101
|
+
return '';
|
|
102
|
+
let block = 'Relevant skills:\n';
|
|
103
|
+
for (const h of hits) {
|
|
104
|
+
const next = `${block}- ${h.record.content}\n`;
|
|
105
|
+
if (next.length > maxInjectChars)
|
|
106
|
+
break;
|
|
107
|
+
block = next;
|
|
108
|
+
}
|
|
109
|
+
return block.trimEnd();
|
|
110
|
+
}
|
|
111
|
+
: undefined;
|
|
63
112
|
// The factory resolves the three role LLMs via makeRoleLlm, wraps them as
|
|
64
113
|
// subagent clients, validates the embedder requirement, and builds the
|
|
65
114
|
// handler. external-tool routing is decided PER-REQUEST inside the handler
|
|
@@ -71,8 +120,9 @@ export class ControllerPipelinePlugin {
|
|
|
71
120
|
knowledgeRagFor: (sessionId) => ctx.knowledgeRagFor(sessionId),
|
|
72
121
|
embedder: ctx.embedder,
|
|
73
122
|
selectTools,
|
|
123
|
+
...(skillsRecall ? { skillsRecall } : {}),
|
|
74
124
|
};
|
|
75
|
-
const { handler } = await new ControllerFactory().build(cfg, deps);
|
|
125
|
+
const { handler } = await new ControllerFactory().build(cfg, deps, this.plannerKind);
|
|
76
126
|
const builder = await ctx.createAgentBuilder();
|
|
77
127
|
const handle = await builder.withStepperCoordinator(handler).build();
|
|
78
128
|
return { agent: handle.agent, close: () => handle.close() };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/pipelines/controller.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,iBAAiB,GAElB,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/pipelines/controller.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,iBAAiB,GAElB,MAAM,oCAAoC,CAAC;AAK5C,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGhE,8EAA8E;AAC9E,mEAAmE;AACnE,gFAAgF;AAChF,4EAA4E;AAC5E,OAAO,EACL,iBAAiB,GAElB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,4BAA4B,GAE7B,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAEL,kBAAkB,GACnB,MAAM,8CAA8C,CAAC;AAMtD;;;;;;GAMG;AACH,MAAM,OAAO,wBAAwB;IAG1B,IAAI,CAAS;IACL,WAAW,CAAc;IAC1C,YACE,IAAI,GAAG,YAAY,EACnB,cAA2B,gBAAgB;QAE3C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAED,WAAW,CAAC,GAAY;QACtB,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,EAAE,CAA4B,CAAC;QACnD,MAAM,SAAS,GAAG,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAA4B,CAAC;QACnE,KAAK,MAAM,IAAI,IAAI,CAAC,WAAW,EAAE,SAAS,EAAE,UAAU,CAAU,EAAE,C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kB,EAAE,CAAC;QAC/C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;QACrE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;IAC9D,CAAC;CACF"}
|
package/dist/pipelines/dag.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export type DagPipelineConfig = Record<string, unknown>;
|
|
|
10
10
|
*
|
|
11
11
|
* @deprecated Legacy pipeline. `dag` runs on its own legacy coordinator/step
|
|
12
12
|
* interpreter and stays selectable only for backward compatibility — it is not
|
|
13
|
-
* the active development path. The newer `controller` pipeline (
|
|
14
|
-
*
|
|
13
|
+
* the active development path. The newer `controller` pipeline (smart-executor /
|
|
14
|
+
* controller-weak presets) is the maintained interpreter; new deployments should use
|
|
15
15
|
* it. The controller interpreter was not designed to drive the legacy DAG flow,
|
|
16
16
|
* so do not migrate a `dag` config onto it. May be removed in a future major.
|
|
17
17
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dag.d.ts","sourceRoot":"","sources":["../../src/pipelines/dag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"dag.d.ts","sourceRoot":"","sources":["../../src/pipelines/dag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,kFAAkF;AAClF,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAExD;;;;;;;;;;;;GAYG;AACH,qBAAa,iBAAkB,YAAW,eAAe,CAAC,iBAAiB,CAAC;IAC1E,QAAQ,CAAC,IAAI,SAAS;IAEtB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,iBAAiB;IAQtC,KAAK,CACT,GAAG,EAAE,iBAAiB,EACtB,GAAG,EAAE,sBAAsB,GAC1B,OAAO,CAAC,iBAAiB,CAAC;CAsB9B"}
|
package/dist/pipelines/dag.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DagCoordinatorHandler } from '@mcp-abap-adt/llm-agent-libs';
|
|
2
2
|
import { buildDagCoordinatorDeps } from '../smart-agent/build-dag-coordinator-deps.js';
|
|
3
|
+
import { registerSkillSources } from './register-skill-sources.js';
|
|
3
4
|
/**
|
|
4
5
|
* Built-in `dag` pipeline plugin. Validates the raw DAG coordinator config
|
|
5
6
|
* (requires a `planner`), assembles the coordinator deps via the shared
|
|
@@ -8,8 +9,8 @@ import { buildDagCoordinatorDeps } from '../smart-agent/build-dag-coordinator-de
|
|
|
8
9
|
*
|
|
9
10
|
* @deprecated Legacy pipeline. `dag` runs on its own legacy coordinator/step
|
|
10
11
|
* interpreter and stays selectable only for backward compatibility — it is not
|
|
11
|
-
* the active development path. The newer `controller` pipeline (
|
|
12
|
-
*
|
|
12
|
+
* the active development path. The newer `controller` pipeline (smart-executor /
|
|
13
|
+
* controller-weak presets) is the maintained interpreter; new deployments should use
|
|
13
14
|
* it. The controller interpreter was not designed to drive the legacy DAG flow,
|
|
14
15
|
* so do not migrate a `dag` config onto it. May be removed in a future major.
|
|
15
16
|
*/
|
|
@@ -38,7 +39,7 @@ export class DagPipelinePlugin {
|
|
|
38
39
|
throw new Error("pipeline 'dag': buildDagCoordinatorDeps returned undefined");
|
|
39
40
|
}
|
|
40
41
|
const handler = new DagCoordinatorHandler(deps);
|
|
41
|
-
const builder = await ctx.createAgentBuilder();
|
|
42
|
+
const builder = registerSkillSources(await ctx.createAgentBuilder(), ctx);
|
|
42
43
|
const handle = await builder.withStepperCoordinator(handler).build();
|
|
43
44
|
return { agent: handle.agent, close: () => handle.close() };
|
|
44
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dag.js","sourceRoot":"","sources":["../../src/pipelines/dag.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;
|
|
1
|
+
{"version":3,"file":"dag.js","sourceRoot":"","sources":["../../src/pipelines/dag.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AACvF,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAMnE;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,iBAAiB;IACnB,IAAI,GAAG,KAAK,CAAC;IAEtB,WAAW,CAAC,GAAY;QACtB,MAAM,GAAG,GAAG,CAAC,GAAG,IAAI,EAAE,CAA4B,CAAC;QACnD,IAAI,GAAG,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;QACvE,CAAC;QACD,OAAO,GAAG,CAAC;IACb,CAAC;IAED,KAAK,CAAC,KAAK,CACT,GAAsB,EACtB,GAA2B;QAE3B,MAAM,IAAI,GAAG,MAAM,uBAAuB,CAAC;YACzC,QAAQ,EAAE,GAAG;YACb,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,gBAAgB,EAAE,GAAG,CAAC,gBAAgB;YACtC,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,SAAS,EAAE,GAAG,CAAC,SAAS;YACxB,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,QAAQ,EAAE,GAAG,CAAC,cAAc;YAC5B,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;YAC9B,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;SACzB,CAAC,CAAC;QACH,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CACb,4DAA4D,CAC7D,CAAC;QACJ,CAAC;QACD,MAAM,OAAO,GAAG,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,oBAAoB,CAAC,MAAM,GAAG,CAAC,kBAAkB,EAAE,EAAE,GAAG,CAAC,CAAC;QAC1E,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;QACrE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;IAC9D,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flat.d.ts","sourceRoot":"","sources":["../../src/pipelines/flat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"flat.d.ts","sourceRoot":"","sources":["../../src/pipelines/flat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE;;;;;GAKG;AACH,qBAAa,kBACX,YAAW,eAAe,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAEjD,QAAQ,CAAC,IAAI,UAAU;IAEvB,WAAW,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC;IAI9B,KAAK,CACT,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAC3B,GAAG,EAAE,sBAAsB,GAC1B,OAAO,CAAC,iBAAiB,CAAC;CAK9B"}
|
package/dist/pipelines/flat.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { registerSkillSources } from './register-skill-sources.js';
|
|
1
2
|
/**
|
|
2
3
|
* Built-in `flat` pipeline plugin. No coordinator — just builds a plain
|
|
3
4
|
* {@link SmartAgent} with the base tool loop (no decomposition, planning, or
|
|
@@ -10,7 +11,7 @@ export class FlatPipelinePlugin {
|
|
|
10
11
|
return {};
|
|
11
12
|
}
|
|
12
13
|
async build(_cfg, ctx) {
|
|
13
|
-
const builder = await ctx.createAgentBuilder();
|
|
14
|
+
const builder = registerSkillSources(await ctx.createAgentBuilder(), ctx);
|
|
14
15
|
const handle = await builder.build();
|
|
15
16
|
return { agent: handle.agent, close: () => handle.close() };
|
|
16
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flat.js","sourceRoot":"","sources":["../../src/pipelines/flat.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"flat.js","sourceRoot":"","sources":["../../src/pipelines/flat.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGnE;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IAGpB,IAAI,GAAG,MAAM,CAAC;IAEvB,WAAW;QACT,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,KAAK,CAAC,KAAK,CACT,IAA2B,EAC3B,GAA2B;QAE3B,MAAM,OAAO,GAAG,oBAAoB,CAAC,MAAM,GAAG,CAAC,kBAAkB,EAAE,EAAE,GAAG,CAAC,CAAC;QAC1E,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;QACrC,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;IAC9D,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linear.d.ts","sourceRoot":"","sources":["../../src/pipelines/linear.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"linear.d.ts","sourceRoot":"","sources":["../../src/pipelines/linear.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAIjC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,2DAA2D;AAC3D,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3D;;;;;;GAMG;AACH,qBAAa,oBACX,YAAW,eAAe,CAAC,oBAAoB,CAAC;IAEhD,QAAQ,CAAC,IAAI,YAAY;IAEzB,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,oBAAoB;IAIzC,KAAK,CACT,GAAG,EAAE,oBAAoB,EACzB,GAAG,EAAE,sBAAsB,GAC1B,OAAO,CAAC,iBAAiB,CAAC;CAU9B"}
|
package/dist/pipelines/linear.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LinearFactory } from '../factories/index.js';
|
|
2
2
|
import { parseLinearConfig } from './parsers.js';
|
|
3
|
+
import { registerSkillSources } from './register-skill-sources.js';
|
|
3
4
|
/**
|
|
4
5
|
* Built-in `linear` pipeline plugin. The raw config is resolved into
|
|
5
6
|
* {@link CoordinatorHandlerDeps} (via {@link parseLinearConfig}) at build time
|
|
@@ -18,7 +19,7 @@ export class LinearPipelinePlugin {
|
|
|
18
19
|
makeRoleLlm: (role) => ctx.resolveLlm(role),
|
|
19
20
|
callMcp: (n, a, s) => ctx.callMcp(n, a, s).then(String),
|
|
20
21
|
});
|
|
21
|
-
const builder = await ctx.createAgentBuilder();
|
|
22
|
+
const builder = registerSkillSources(await ctx.createAgentBuilder(), ctx);
|
|
22
23
|
const handle = await builder.withStepperCoordinator(handler).build();
|
|
23
24
|
return { agent: handle.agent, close: () => handle.close() };
|
|
24
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linear.js","sourceRoot":"","sources":["../../src/pipelines/linear.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"linear.js","sourceRoot":"","sources":["../../src/pipelines/linear.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAMnE;;;;;;GAMG;AACH,MAAM,OAAO,oBAAoB;IAGtB,IAAI,GAAG,QAAQ,CAAC;IAEzB,WAAW,CAAC,GAAY;QACtB,OAAO,CAAC,GAAG,IAAI,EAAE,CAA4B,CAAC;IAChD,CAAC;IAED,KAAK,CAAC,KAAK,CACT,GAAyB,EACzB,GAA2B;QAE3B,MAAM,IAAI,GAAG,MAAM,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;QAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,IAAI,aAAa,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE;YACxD,WAAW,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;YAC3C,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC;SACxD,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,oBAAoB,CAAC,MAAM,GAAG,CAAC,kBAAkB,EAAE,EAAE,GAAG,CAAC,CAAC;QAC1E,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,sBAAsB,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;QACrE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;IAC9D,CAAC;CACF"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SmartAgentBuilder } from '@mcp-abap-adt/llm-agent-libs';
|
|
2
|
+
import type { IServerPipelineContext } from './server-context.js';
|
|
3
|
+
/**
|
|
4
|
+
* Implicit assembler wiring (B3): when a skill plugin-host is present on the
|
|
5
|
+
* context, register each served skill group's RAG handle as one more
|
|
6
|
+
* {@link skillsRagSource} `IRag` source on the agent builder. Called ONCE at
|
|
7
|
+
* build time by the assembler-based pipelines (flat/default, linear) — the
|
|
8
|
+
* serving collection set is fixed at host load.
|
|
9
|
+
*
|
|
10
|
+
* Absent `ctx.skillHost` this is a NO-OP (zero behavior change).
|
|
11
|
+
*
|
|
12
|
+
* Each group is registered under its own collection name so distinct groups do
|
|
13
|
+
* not collide in the RAG registry; all derive from the same `relevant-skills`
|
|
14
|
+
* base key so the assembler renders them under one "Relevant Skills" header
|
|
15
|
+
* family. Recall sizing (`k`/`threshold`) comes from `ctx.skillRecall`, threaded
|
|
16
|
+
* from the `skillPlugins:` host config.
|
|
17
|
+
*
|
|
18
|
+
* @returns the same builder (fluent), for call-site chaining.
|
|
19
|
+
*/
|
|
20
|
+
export declare function registerSkillSources(builder: SmartAgentBuilder, ctx: IServerPipelineContext): SmartAgentBuilder;
|
|
21
|
+
//# sourceMappingURL=register-skill-sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-skill-sources.d.ts","sourceRoot":"","sources":["../../src/pipelines/register-skill-sources.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAUlE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,iBAAiB,EAC1B,GAAG,EAAE,sBAAsB,GAC1B,iBAAiB,CA+BnB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { skillsRagSource } from '@mcp-abap-adt/llm-agent-libs';
|
|
2
|
+
/**
|
|
3
|
+
* Section/store key under which the skills RAG source is registered. A single
|
|
4
|
+
* key (not per-group) keeps the assembler's "Relevant Skills" section stable
|
|
5
|
+
* regardless of how many groups the host serves; the title-cased key becomes
|
|
6
|
+
* the section header automatically.
|
|
7
|
+
*/
|
|
8
|
+
const SKILLS_STORE_KEY = 'relevant-skills';
|
|
9
|
+
/**
|
|
10
|
+
* Implicit assembler wiring (B3): when a skill plugin-host is present on the
|
|
11
|
+
* context, register each served skill group's RAG handle as one more
|
|
12
|
+
* {@link skillsRagSource} `IRag` source on the agent builder. Called ONCE at
|
|
13
|
+
* build time by the assembler-based pipelines (flat/default, linear) — the
|
|
14
|
+
* serving collection set is fixed at host load.
|
|
15
|
+
*
|
|
16
|
+
* Absent `ctx.skillHost` this is a NO-OP (zero behavior change).
|
|
17
|
+
*
|
|
18
|
+
* Each group is registered under its own collection name so distinct groups do
|
|
19
|
+
* not collide in the RAG registry; all derive from the same `relevant-skills`
|
|
20
|
+
* base key so the assembler renders them under one "Relevant Skills" header
|
|
21
|
+
* family. Recall sizing (`k`/`threshold`) comes from `ctx.skillRecall`, threaded
|
|
22
|
+
* from the `skillPlugins:` host config.
|
|
23
|
+
*
|
|
24
|
+
* @returns the same builder (fluent), for call-site chaining.
|
|
25
|
+
*/
|
|
26
|
+
export function registerSkillSources(builder, ctx) {
|
|
27
|
+
const host = ctx.skillHost;
|
|
28
|
+
if (!host)
|
|
29
|
+
return builder;
|
|
30
|
+
const k = ctx.skillRecall?.k ?? 4;
|
|
31
|
+
const threshold = ctx.skillRecall?.threshold;
|
|
32
|
+
// Honor the operator-configured served subset (`skillPlugins.serveCollections`):
|
|
33
|
+
// register ONLY those groups so conflicting groups are not read together. When
|
|
34
|
+
// unset, register every group the host serves (prior behavior).
|
|
35
|
+
const serve = ctx.skillRecall?.serveCollections;
|
|
36
|
+
const served = serve !== undefined ? new Set(serve) : undefined;
|
|
37
|
+
let out = builder;
|
|
38
|
+
for (const g of host.groups()) {
|
|
39
|
+
if (served && !served.has(g.group))
|
|
40
|
+
continue;
|
|
41
|
+
const name = `${SKILLS_STORE_KEY}:${g.group}`;
|
|
42
|
+
out = out.addRagCollection({
|
|
43
|
+
name,
|
|
44
|
+
rag: skillsRagSource(host.rag(g.group), {
|
|
45
|
+
group: g.group,
|
|
46
|
+
k,
|
|
47
|
+
...(threshold !== undefined ? { threshold } : {}),
|
|
48
|
+
}),
|
|
49
|
+
meta: {
|
|
50
|
+
displayName: 'Relevant Skills',
|
|
51
|
+
scope: 'global',
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=register-skill-sources.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-skill-sources.js","sourceRoot":"","sources":["../../src/pipelines/register-skill-sources.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAG/D;;;;;GAKG;AACH,MAAM,gBAAgB,GAAG,iBAAiB,CAAC;AAE3C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAA0B,EAC1B,GAA2B;IAE3B,MAAM,IAAI,GAAG,GAAG,CAAC,SAAS,CAAC;IAC3B,IAAI,CAAC,IAAI;QAAE,OAAO,OAAO,CAAC;IAE1B,MAAM,CAAC,GAAG,GAAG,CAAC,WAAW,E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