@mcp-abap-adt/llm-agent-server-libs 18.1.2 → 19.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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/legacy/dag.d.ts +4 -0
- package/dist/legacy/dag.d.ts.map +1 -0
- package/dist/legacy/dag.js +4 -0
- package/dist/legacy/dag.js.map +1 -0
- package/dist/legacy/flat.d.ts +2 -0
- package/dist/legacy/flat.d.ts.map +1 -0
- package/dist/legacy/flat.js +3 -0
- package/dist/legacy/flat.js.map +1 -0
- package/dist/legacy/linear.d.ts +3 -0
- package/dist/legacy/linear.d.ts.map +1 -0
- package/dist/legacy/linear.js +3 -0
- package/dist/legacy/linear.js.map +1 -0
- package/dist/legacy/stepper.d.ts +5 -0
- package/dist/legacy/stepper.d.ts.map +1 -0
- package/dist/legacy/stepper.js +5 -0
- package/dist/legacy/stepper.js.map +1 -0
- package/dist/pipelines/controller.d.ts +19 -0
- package/dist/pipelines/controller.d.ts.map +1 -0
- package/dist/pipelines/controller.js +100 -0
- package/dist/pipelines/controller.js.map +1 -0
- package/dist/pipelines/dag.d.ts +23 -0
- package/dist/pipelines/dag.d.ts.map +1 -0
- package/dist/pipelines/dag.js +46 -0
- package/dist/pipelines/dag.js.map +1 -0
- package/dist/pipelines/flat.d.ts +14 -0
- package/dist/pipelines/flat.d.ts.map +1 -0
- package/dist/pipelines/flat.js +18 -0
- package/dist/pipelines/flat.js.map +1 -0
- package/dist/pipelines/linear.d.ts +17 -0
- package/dist/pipelines/linear.d.ts.map +1 -0
- package/dist/pipelines/linear.js +26 -0
- package/dist/pipelines/linear.js.map +1 -0
- package/dist/pipelines/parsers.d.ts +5 -0
- package/dist/pipelines/parsers.d.ts.map +1 -0
- package/dist/pipelines/parsers.js +20 -0
- package/dist/pipelines/parsers.js.map +1 -0
- package/dist/pipelines/server-context.d.ts +53 -0
- package/dist/pipelines/server-context.d.ts.map +1 -0
- package/dist/pipelines/server-context.js +9 -0
- package/dist/pipelines/server-context.js.map +1 -0
- package/dist/pipelines/stepper.d.ts +23 -0
- package/dist/pipelines/stepper.d.ts.map +1 -0
- package/dist/pipelines/stepper.js +60 -0
- package/dist/pipelines/stepper.js.map +1 -0
- package/dist/smart-agent/config.d.ts +13 -4
- package/dist/smart-agent/config.d.ts.map +1 -1
- package/dist/smart-agent/config.js +137 -228
- package/dist/smart-agent/config.js.map +1 -1
- package/dist/smart-agent/controller/controller-coordinator-handler.d.ts +99 -0
- package/dist/smart-agent/controller/controller-coordinator-handler.d.ts.map +1 -0
- package/dist/smart-agent/controller/controller-coordinator-handler.js +627 -0
- package/dist/smart-agent/controller/controller-coordinator-handler.js.map +1 -0
- package/dist/smart-agent/controller/memorizer.d.ts +6 -0
- package/dist/smart-agent/controller/memorizer.d.ts.map +1 -0
- package/dist/smart-agent/controller/memorizer.js +5 -0
- package/dist/smart-agent/controller/memorizer.js.map +1 -0
- package/dist/smart-agent/controller/need-resolver.d.ts +3 -0
- package/dist/smart-agent/controller/need-resolver.d.ts.map +1 -0
- package/dist/smart-agent/controller/need-resolver.js +4 -0
- package/dist/smart-agent/controller/need-resolver.js.map +1 -0
- package/dist/smart-agent/controller/planner.d.ts +34 -0
- package/dist/smart-agent/controller/planner.d.ts.map +1 -0
- package/dist/smart-agent/controller/planner.js +247 -0
- package/dist/smart-agent/controller/planner.js.map +1 -0
- package/dist/smart-agent/controller/prompts.d.ts +17 -0
- package/dist/smart-agent/controller/prompts.d.ts.map +1 -0
- package/dist/smart-agent/controller/prompts.js +20 -0
- package/dist/smart-agent/controller/prompts.js.map +1 -0
- package/dist/smart-agent/controller/session-bundle.d.ts +15 -0
- package/dist/smart-agent/controller/session-bundle.d.ts.map +1 -0
- package/dist/smart-agent/controller/session-bundle.js +53 -0
- package/dist/smart-agent/controller/session-bundle.js.map +1 -0
- package/dist/smart-agent/controller/subagent-client.d.ts +7 -0
- package/dist/smart-agent/controller/subagent-client.d.ts.map +1 -0
- package/dist/smart-agent/controller/subagent-client.js +18 -0
- package/dist/smart-agent/controller/subagent-client.js.map +1 -0
- package/dist/smart-agent/controller/target-state.d.ts +28 -0
- package/dist/smart-agent/controller/target-state.d.ts.map +1 -0
- package/dist/smart-agent/controller/target-state.js +59 -0
- package/dist/smart-agent/controller/target-state.js.map +1 -0
- package/dist/smart-agent/controller/types.d.ts +121 -0
- package/dist/smart-agent/controller/types.d.ts.map +1 -0
- package/dist/smart-agent/controller/types.js +2 -0
- package/dist/smart-agent/controller/types.js.map +1 -0
- package/dist/smart-agent/resolve-agent-embedder.d.ts.map +1 -1
- package/dist/smart-agent/resolve-agent-embedder.js +8 -2
- package/dist/smart-agent/resolve-agent-embedder.js.map +1 -1
- package/dist/smart-agent/smart-server.d.ts +188 -31
- package/dist/smart-agent/smart-server.d.ts.map +1 -1
- package/dist/smart-agent/smart-server.js +809 -637
- package/dist/smart-agent/smart-server.js.map +1 -1
- package/dist/smart-agent/stepper-coordinator-handler.d.ts.map +1 -1
- package/dist/smart-agent/stepper-coordinator-handler.js +25 -11
- package/dist/smart-agent/stepper-coordinator-handler.js.map +1 -1
- package/package.json +44 -8
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "
|
|
1
|
+
export declare const PACKAGE_VERSION = "19.1.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/index.d.ts
CHANGED
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,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,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
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,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,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,8CAA8C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dag.d.ts","sourceRoot":"","sources":["../../src/legacy/dag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dag.js","sourceRoot":"","sources":["../../src/legacy/dag.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flat.d.ts","sourceRoot":"","sources":["../../src/legacy/flat.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flat.js","sourceRoot":"","sources":["../../src/legacy/flat.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear.d.ts","sourceRoot":"","sources":["../../src/legacy/linear.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear.js","sourceRoot":"","sources":["../../src/legacy/linear.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { buildStepperCoordinator, CyclicFactory, DeepStepperFactory, PlannedFactory, } from '../factories/index.js';
|
|
2
|
+
export { parseStepperCoordinatorConfig } from '../pipelines/parsers.js';
|
|
3
|
+
export { buildFromComposition, buildStepperRoot, } from '../smart-agent/build-stepper-root.js';
|
|
4
|
+
export { StepperCoordinatorHandler } from '../smart-agent/stepper-coordinator-handler.js';
|
|
5
|
+
//# sourceMappingURL=stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepper.d.ts","sourceRoot":"","sources":["../../src/legacy/stepper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,kBAAkB,EAClB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EACL,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { buildStepperCoordinator, CyclicFactory, DeepStepperFactory, PlannedFactory, } from '../factories/index.js';
|
|
2
|
+
export { parseStepperCoordinatorConfig } from '../pipelines/parsers.js';
|
|
3
|
+
export { buildFromComposition, buildStepperRoot, } from '../smart-agent/build-stepper-root.js';
|
|
4
|
+
export { StepperCoordinatorHandler } from '../smart-agent/stepper-coordinator-handler.js';
|
|
5
|
+
//# sourceMappingURL=stepper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepper.js","sourceRoot":"","sources":["../../src/legacy/stepper.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,aAAa,EACb,kBAAkB,EAClB,cAAc,GACf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EACL,oBAAoB,EACpB,gBAAgB,GACjB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IPipelineInstance, IPipelinePlugin } from '@mcp-abap-adt/llm-agent';
|
|
2
|
+
import type { ControllerConfig } from '../smart-agent/controller/types.js';
|
|
3
|
+
import type { IControllerServerPipelineContext } from './server-context.js';
|
|
4
|
+
export { ControllerCoordinatorHandler, type ControllerHandlerDeps, } from '../smart-agent/controller/controller-coordinator-handler.js';
|
|
5
|
+
export { type ISubagentClient, makeSubagentClient, } from '../smart-agent/controller/subagent-client.js';
|
|
6
|
+
export type { ControllerConfig, SessionBundle, } from '../smart-agent/controller/types.js';
|
|
7
|
+
/**
|
|
8
|
+
* Built-in `controller` pipeline plugin. Validates the controller config
|
|
9
|
+
* dialect (three required subagent roles + defaulted target-state / session
|
|
10
|
+
* memory / budgets), wires the {@link ControllerCoordinatorHandler} from the
|
|
11
|
+
* server pipeline context, registers it on a fresh agent builder, and returns
|
|
12
|
+
* the runnable agent plus a disposal hook.
|
|
13
|
+
*/
|
|
14
|
+
export declare class ControllerPipelinePlugin implements IPipelinePlugin<ControllerConfig> {
|
|
15
|
+
readonly name = "controller";
|
|
16
|
+
parseConfig(raw: unknown): ControllerConfig;
|
|
17
|
+
build(cfg: ControllerConfig, ctx: IControllerServerPipelineContext): Promise<IPipelineInstance>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=controller.d.ts.map
|
|
@@ -0,0 +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;AAMjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,qBAAqB,CAAC;AAM5E,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,gBAAgB;IAE7B,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB;IA0CrC,KAAK,CACT,GAAG,EAAE,gBAAgB,EACrB,GAAG,EAAE,gCAAgC,GACpC,OAAO,CAAC,iBAAiB,CAAC;CAuD9B"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { ControllerCoordinatorHandler, } from '../smart-agent/controller/controller-coordinator-handler.js';
|
|
2
|
+
import { makeSubagentClient } from '../smart-agent/controller/subagent-client.js';
|
|
3
|
+
import { buildMcpBridge } from '../smart-agent/smart-server.js';
|
|
4
|
+
// Re-export the controller building blocks so embedders (no-YAML) can compose
|
|
5
|
+
// the coordinator directly onto their own SmartAgentBuilder via
|
|
6
|
+
// `builder.withStepperCoordinator(new ControllerCoordinatorHandler(deps))`,
|
|
7
|
+
// without going through the plugin/registry.
|
|
8
|
+
export { ControllerCoordinatorHandler, } from '../smart-agent/controller/controller-coordinator-handler.js';
|
|
9
|
+
export { makeSubagentClient, } from '../smart-agent/controller/subagent-client.js';
|
|
10
|
+
/**
|
|
11
|
+
* Built-in `controller` pipeline plugin. Validates the controller config
|
|
12
|
+
* dialect (three required subagent roles + defaulted target-state / session
|
|
13
|
+
* memory / budgets), wires the {@link ControllerCoordinatorHandler} from the
|
|
14
|
+
* server pipeline context, registers it on a fresh agent builder, and returns
|
|
15
|
+
* the runnable agent plus a disposal hook.
|
|
16
|
+
*/
|
|
17
|
+
export class ControllerPipelinePlugin {
|
|
18
|
+
name = 'controller';
|
|
19
|
+
parseConfig(raw) {
|
|
20
|
+
const cfg = (raw ?? {});
|
|
21
|
+
const subagents = (cfg.subagents ?? {});
|
|
22
|
+
for (const role of ['evaluator', 'planner', 'executor']) {
|
|
23
|
+
if (subagents[role] === undefined) {
|
|
24
|
+
throw new Error(`pipeline 'controller' requires 'subagents.${role}' (each an LLM config with at least a 'provider')`);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const targetStateRaw = (cfg.targetState ?? {});
|
|
28
|
+
const sessionMemoryRaw = (cfg.sessionMemory ?? {});
|
|
29
|
+
const budgetsRaw = (cfg.budgets ?? {});
|
|
30
|
+
return {
|
|
31
|
+
subagents: subagents,
|
|
32
|
+
planner: (cfg.planner === 'adaptive'
|
|
33
|
+
? 'adaptive'
|
|
34
|
+
: 'incremental'),
|
|
35
|
+
targetState: {
|
|
36
|
+
strategy: 'auto',
|
|
37
|
+
distanceThreshold: 0.25,
|
|
38
|
+
...targetStateRaw,
|
|
39
|
+
},
|
|
40
|
+
sessionMemory: {
|
|
41
|
+
collection: 'session-memory',
|
|
42
|
+
...sessionMemoryRaw,
|
|
43
|
+
},
|
|
44
|
+
budgets: {
|
|
45
|
+
maxSteps: 20,
|
|
46
|
+
maxRetries: 3,
|
|
47
|
+
maxRewinds: 5,
|
|
48
|
+
maxToolCalls: 10,
|
|
49
|
+
...budgetsRaw,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
async build(cfg, ctx) {
|
|
54
|
+
// Embedder is only needed for distance-based target-state strategies.
|
|
55
|
+
// consumer-confirm needs none, so an embedder-less deployment can use it.
|
|
56
|
+
const needsEmbedder = cfg.targetState.strategy === 'semantic-distance' ||
|
|
57
|
+
cfg.targetState.strategy === 'auto';
|
|
58
|
+
if (needsEmbedder && !ctx.embedder) {
|
|
59
|
+
throw new Error(`pipeline 'controller' targetState.strategy '${cfg.targetState.strategy}' requires an embedder (semantic distance); configure rag.embedder or use strategy: consumer-confirm`);
|
|
60
|
+
}
|
|
61
|
+
const [evaluatorLlm, plannerLlm, executorLlm] = await Promise.all([
|
|
62
|
+
ctx.makeLlm(cfg.subagents.evaluator),
|
|
63
|
+
ctx.makeLlm(cfg.subagents.planner),
|
|
64
|
+
ctx.makeLlm(cfg.subagents.executor),
|
|
65
|
+
]);
|
|
66
|
+
const mcpClients = ctx.mcpClients ?? [];
|
|
67
|
+
const mcpBridge = buildMcpBridge(mcpClients);
|
|
68
|
+
// INTERNAL tools reach the executor/planner via SEMANTIC selection over the
|
|
69
|
+
// vectorized MCP catalog (toolsRag) — relevant top-K per query, not a full
|
|
70
|
+
// dump. The server vectorizes every MCP `tool:<name>` into toolsRag at
|
|
71
|
+
// startup. When no toolsRag is wired (MCP-less / no embedder) selection
|
|
72
|
+
// yields [] and the loop runs with external tools only.
|
|
73
|
+
const toolsRag = ctx.toolsRag;
|
|
74
|
+
const selectTools = (query, k, options) => toolsRag ? toolsRag.query(query, k, options) : Promise.resolve([]);
|
|
75
|
+
// NOTE: external-tool routing is decided PER-REQUEST inside the handler from
|
|
76
|
+
// `ctx.externalTools` (the client-supplied tools for that request). We do NOT
|
|
77
|
+
// wire `isExternalTool` here — the build-time server ctx never carries them.
|
|
78
|
+
const deps = {
|
|
79
|
+
evaluator: makeSubagentClient(evaluatorLlm),
|
|
80
|
+
planner: makeSubagentClient(plannerLlm),
|
|
81
|
+
executor: makeSubagentClient(executorLlm),
|
|
82
|
+
backend: ctx.stepperKnowledgeBackend,
|
|
83
|
+
knowledgeRagFor: (sessionId) => ctx.knowledgeRagFor(sessionId),
|
|
84
|
+
embedder: ctx.embedder,
|
|
85
|
+
callMcp: (name, args) => mcpBridge(name, args),
|
|
86
|
+
selectTools,
|
|
87
|
+
config: cfg,
|
|
88
|
+
models: {
|
|
89
|
+
evaluator: evaluatorLlm.model ?? 'unknown',
|
|
90
|
+
planner: plannerLlm.model ?? 'unknown',
|
|
91
|
+
executor: executorLlm.model ?? 'unknown',
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
const handler = new ControllerCoordinatorHandler(deps);
|
|
95
|
+
const builder = await ctx.createAgentBuilder();
|
|
96
|
+
const handle = await builder.withStepperCoordinator(handler).build();
|
|
97
|
+
return { agent: handle.agent, close: () => handle.close() };
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"controller.js","sourceRoot":"","sources":["../../src/pipelines/controller.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,4BAA4B,GAE7B,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,8CAA8C,CAAC;AAElF,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAGhE,8EAA8E;AAC9E,gEAAgE;AAChE,4EAA4E;AAC5E,6CAA6C;AAC7C,OAAO,EACL,4BAA4B,GAE7B,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAEL,kBAAkB,GACnB,MAAM,8CAA8C,CAAC;AAMtD;;;;;;GAMG;AACH,MAAM,OAAO,wBAAwB;IAG1B,IAAI,GAAG,YAAY,CAAC;IAE7B,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,CAAC;YACjE,IAAI,SAAS,CAAC,IAAI,CAAC,K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,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;aACzC;SACF,CAAC;QAEF,MAAM,OAAO,GAAG,IAAI,4BAA4B,CAAC,IAAI,CAAC,CAAC;QACvD,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,kBAAkB,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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IPipelineInstance, IPipelinePlugin } from '@mcp-abap-adt/llm-agent';
|
|
2
|
+
import type { IServerPipelineContext } from './server-context.js';
|
|
3
|
+
/** Config = the raw `coordinator:` (DAG) YAML block, validated by parseConfig. */
|
|
4
|
+
export type DagPipelineConfig = Record<string, unknown>;
|
|
5
|
+
/**
|
|
6
|
+
* Built-in `dag` pipeline plugin. Validates the raw DAG coordinator config
|
|
7
|
+
* (requires a `planner`), assembles the coordinator deps via the shared
|
|
8
|
+
* `buildDagCoordinatorDeps`, registers a `DagCoordinatorHandler` on a fresh
|
|
9
|
+
* agent builder, and returns the runnable agent plus a disposal hook.
|
|
10
|
+
*
|
|
11
|
+
* @deprecated Legacy pipeline. `dag` runs on its own legacy coordinator/step
|
|
12
|
+
* interpreter and stays selectable only for backward compatibility — it is not
|
|
13
|
+
* the active development path. The newer `controller` pipeline (incremental /
|
|
14
|
+
* adaptive planner) is the maintained interpreter; new deployments should use
|
|
15
|
+
* it. The controller interpreter was not designed to drive the legacy DAG flow,
|
|
16
|
+
* so do not migrate a `dag` config onto it. May be removed in a future major.
|
|
17
|
+
*/
|
|
18
|
+
export declare class DagPipelinePlugin implements IPipelinePlugin<DagPipelineConfig> {
|
|
19
|
+
readonly name = "dag";
|
|
20
|
+
parseConfig(raw: unknown): DagPipelineConfig;
|
|
21
|
+
build(cfg: DagPipelineConfig, ctx: IServerPipelineContext): Promise<IPipelineInstance>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=dag.d.ts.map
|
|
@@ -0,0 +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;AAGjC,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"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DagCoordinatorHandler } from '@mcp-abap-adt/llm-agent-libs';
|
|
2
|
+
import { buildDagCoordinatorDeps } from '../smart-agent/build-dag-coordinator-deps.js';
|
|
3
|
+
/**
|
|
4
|
+
* Built-in `dag` pipeline plugin. Validates the raw DAG coordinator config
|
|
5
|
+
* (requires a `planner`), assembles the coordinator deps via the shared
|
|
6
|
+
* `buildDagCoordinatorDeps`, registers a `DagCoordinatorHandler` on a fresh
|
|
7
|
+
* agent builder, and returns the runnable agent plus a disposal hook.
|
|
8
|
+
*
|
|
9
|
+
* @deprecated Legacy pipeline. `dag` runs on its own legacy coordinator/step
|
|
10
|
+
* interpreter and stays selectable only for backward compatibility — it is not
|
|
11
|
+
* the active development path. The newer `controller` pipeline (incremental /
|
|
12
|
+
* adaptive planner) is the maintained interpreter; new deployments should use
|
|
13
|
+
* it. The controller interpreter was not designed to drive the legacy DAG flow,
|
|
14
|
+
* so do not migrate a `dag` config onto it. May be removed in a future major.
|
|
15
|
+
*/
|
|
16
|
+
export class DagPipelinePlugin {
|
|
17
|
+
name = 'dag';
|
|
18
|
+
parseConfig(raw) {
|
|
19
|
+
const cfg = (raw ?? {});
|
|
20
|
+
if (cfg.planner === undefined) {
|
|
21
|
+
throw new Error("pipeline 'dag' requires a 'planner' in its config");
|
|
22
|
+
}
|
|
23
|
+
return cfg;
|
|
24
|
+
}
|
|
25
|
+
async build(cfg, ctx) {
|
|
26
|
+
const deps = await buildDagCoordinatorDeps({
|
|
27
|
+
coordCfg: cfg,
|
|
28
|
+
llmMap: ctx.llmMap,
|
|
29
|
+
pipelineFallback: ctx.pipelineFallback,
|
|
30
|
+
mainLlm: ctx.mainLlm,
|
|
31
|
+
helperLlm: ctx.helperLlm,
|
|
32
|
+
mainTemp: ctx.mainTemp,
|
|
33
|
+
registry: ctx.workerRegistry,
|
|
34
|
+
makeLlm: (c) => ctx.makeLlm(c),
|
|
35
|
+
warn: (m) => ctx.warn(m),
|
|
36
|
+
});
|
|
37
|
+
if (!deps) {
|
|
38
|
+
throw new Error("pipeline 'dag': buildDagCoordinatorDeps returned undefined");
|
|
39
|
+
}
|
|
40
|
+
const handler = new DagCoordinatorHandler(deps);
|
|
41
|
+
const builder = await ctx.createAgentBuilder();
|
|
42
|
+
const handle = await builder.withStepperCoordinator(handler).build();
|
|
43
|
+
return { agent: handle.agent, close: () => handle.close() };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=dag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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AE,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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { IPipelineInstance, IPipelinePlugin } from '@mcp-abap-adt/llm-agent';
|
|
2
|
+
import type { IServerPipelineContext } from './server-context.js';
|
|
3
|
+
/**
|
|
4
|
+
* Built-in `flat` pipeline plugin. No coordinator — just builds a plain
|
|
5
|
+
* {@link SmartAgent} with the base tool loop (no decomposition, planning, or
|
|
6
|
+
* multi-worker orchestration). Used for simple single-turn or stateless
|
|
7
|
+
* deployments.
|
|
8
|
+
*/
|
|
9
|
+
export declare class FlatPipelinePlugin implements IPipelinePlugin<Record<string, never>> {
|
|
10
|
+
readonly name = "flat";
|
|
11
|
+
parseConfig(): Record<string, never>;
|
|
12
|
+
build(_cfg: Record<string, never>, ctx: IServerPipelineContext): Promise<IPipelineInstance>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=flat.d.ts.map
|
|
@@ -0,0 +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;AACjC,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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in `flat` pipeline plugin. No coordinator — just builds a plain
|
|
3
|
+
* {@link SmartAgent} with the base tool loop (no decomposition, planning, or
|
|
4
|
+
* multi-worker orchestration). Used for simple single-turn or stateless
|
|
5
|
+
* deployments.
|
|
6
|
+
*/
|
|
7
|
+
export class FlatPipelinePlugin {
|
|
8
|
+
name = 'flat';
|
|
9
|
+
parseConfig() {
|
|
10
|
+
return {};
|
|
11
|
+
}
|
|
12
|
+
async build(_cfg, ctx) {
|
|
13
|
+
const builder = await ctx.createAgentBuilder();
|
|
14
|
+
const handle = await builder.build();
|
|
15
|
+
return { agent: handle.agent, close: () => handle.close() };
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=flat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flat.js","sourceRoot":"","sources":["../../src/pipelines/flat.ts"],"names":[],"mappings":"AAMA;;;;;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,MAAM,GAAG,CAAC,kBAAkB,EAAE,CAAC;QAC/C,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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { IPipelineInstance, IPipelinePlugin } from '@mcp-abap-adt/llm-agent';
|
|
2
|
+
import type { IServerPipelineContext } from './server-context.js';
|
|
3
|
+
/** Config = the raw `coordinator:` (linear) YAML block. */
|
|
4
|
+
export type LinearPipelineConfig = Record<string, unknown>;
|
|
5
|
+
/**
|
|
6
|
+
* Built-in `linear` pipeline plugin. The raw config is resolved into
|
|
7
|
+
* {@link CoordinatorHandlerDeps} (via {@link parseLinearConfig}) at build time
|
|
8
|
+
* (it needs `ctx` to resolve LLMs), wrapped by {@link LinearFactory} into a
|
|
9
|
+
* {@link CoordinatorHandler}, registered on a fresh agent builder, and returned
|
|
10
|
+
* as a runnable agent plus a disposal hook.
|
|
11
|
+
*/
|
|
12
|
+
export declare class LinearPipelinePlugin implements IPipelinePlugin<LinearPipelineConfig> {
|
|
13
|
+
readonly name = "linear";
|
|
14
|
+
parseConfig(raw: unknown): LinearPipelineConfig;
|
|
15
|
+
build(cfg: LinearPipelineConfig, ctx: IServerPipelineContext): Promise<IPipelineInstance>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=linear.d.ts.map
|
|
@@ -0,0 +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;AAGjC,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"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LinearFactory } from '../factories/index.js';
|
|
2
|
+
import { parseLinearConfig } from './parsers.js';
|
|
3
|
+
/**
|
|
4
|
+
* Built-in `linear` pipeline plugin. The raw config is resolved into
|
|
5
|
+
* {@link CoordinatorHandlerDeps} (via {@link parseLinearConfig}) at build time
|
|
6
|
+
* (it needs `ctx` to resolve LLMs), wrapped by {@link LinearFactory} into a
|
|
7
|
+
* {@link CoordinatorHandler}, registered on a fresh agent builder, and returned
|
|
8
|
+
* as a runnable agent plus a disposal hook.
|
|
9
|
+
*/
|
|
10
|
+
export class LinearPipelinePlugin {
|
|
11
|
+
name = 'linear';
|
|
12
|
+
parseConfig(raw) {
|
|
13
|
+
return (raw ?? {});
|
|
14
|
+
}
|
|
15
|
+
async build(cfg, ctx) {
|
|
16
|
+
const deps = await parseLinearConfig(cfg, ctx);
|
|
17
|
+
const { handler } = await new LinearFactory().build(deps, {
|
|
18
|
+
makeRoleLlm: (role) => ctx.resolveLlm(role),
|
|
19
|
+
callMcp: (n, a, s) => ctx.callMcp(n, a, s).then(String),
|
|
20
|
+
});
|
|
21
|
+
const builder = await ctx.createAgentBuilder();
|
|
22
|
+
const handle = await builder.withStepperCoordinator(handler).build();
|
|
23
|
+
return { agent: handle.agent, close: () => handle.close() };
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=linear.js.map
|
|
@@ -0,0 +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;AAMjD;;;;;;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,MAAM,GAAG,CAAC,kBAAkB,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"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { parseStepperCoordinatorConfig, type StepperCoordinatorConfig, } from '../smart-agent/config.js';
|
|
2
|
+
import type { CoordinatorHandlerDeps } from '@mcp-abap-adt/llm-agent-libs';
|
|
3
|
+
import type { IServerPipelineContext } from './server-context.js';
|
|
4
|
+
export declare function parseLinearConfig(cfg: Record<string, unknown>, ctx: IServerPipelineContext): Promise<CoordinatorHandlerDeps>;
|
|
5
|
+
//# sourceMappingURL=parsers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parsers.d.ts","sourceRoot":"","sources":["../../src/pipelines/parsers.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,6BAA6B,EAC7B,KAAK,wBAAwB,GAC9B,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAM3E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,GAAG,EAAE,sBAAsB,GAC1B,OAAO,CAAC,sBAAsB,CAAC,CAiBjC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// PERMANENT facade: re-exports the pure parsers from config.ts (they STAY there;
|
|
2
|
+
// build-stepper-root.ts and others import them from config.ts). Nothing is moved.
|
|
3
|
+
export { parseStepperCoordinatorConfig, } from '../smart-agent/config.js';
|
|
4
|
+
import { resolveCoordinatorDispatch, resolveCoordinatorDispatchKind, resolveCoordinatorPlanning, } from '../smart-agent/config.js';
|
|
5
|
+
export async function parseLinearConfig(cfg, ctx) {
|
|
6
|
+
const plannerLlm = await ctx.resolveLlm('planner');
|
|
7
|
+
const planningKind = cfg.planning ??
|
|
8
|
+
'one-shot';
|
|
9
|
+
// resolveCoordinatorDispatchKind accepts only the dispatch union; cast after
|
|
10
|
+
// the YAML schema has constrained it.
|
|
11
|
+
const dispatchKind = resolveCoordinatorDispatchKind(cfg.dispatch);
|
|
12
|
+
return {
|
|
13
|
+
planning: resolveCoordinatorPlanning(planningKind, plannerLlm),
|
|
14
|
+
dispatch: resolveCoordinatorDispatch(dispatchKind, plannerLlm, undefined),
|
|
15
|
+
maxSteps: cfg.maxSteps ?? 10,
|
|
16
|
+
maxRetriesPerStep: cfg.maxRetriesPerStep ?? 1,
|
|
17
|
+
failPolicy: cfg.failPolicy ?? 'abort',
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=parsers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parsers.js","sourceRoot":"","sources":["../../src/pipelines/parsers.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,kFAAkF;AAClF,OAAO,EACL,6BAA6B,GAE9B,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAGlC,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,GAA4B,EAC5B,GAA2B;IAE3B,MAAM,UAAU,GAAG,MAAM,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;IACnD,MAAM,YAAY,GACf,GAAG,CAAC,QAA2D;QAChE,UAAU,CAAC;IACb,6EAA6E;IAC7E,sCAAsC;IACtC,MAAM,YAAY,GAAG,8BAA8B,CACjD,GAAG,CAAC,QAAsD,CAC3D,CAAC;IACF,OAAO;QACL,QAAQ,EAAE,0BAA0B,CAAC,YAAY,EAAE,UAAU,CAAC;QAC9D,QAAQ,EAAE,0BAA0B,CAAC,YAAY,EAAE,UAAU,EAAE,SAAS,CAAC;QACzE,QAAQ,EAAG,GAAG,CAAC,QAAmB,IAAI,EAAE;QACxC,iBAAiB,EAAG,GAAG,CAAC,iBAA4B,IAAI,CAAC;QACzD,UAAU,EAAG,GAAG,CAAC,UAAmC,IAAI,OAAO;KAChE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { IEmbedder, ILlm, IPipelineContext, ISubAgent, IToolsRagHandle } from '@mcp-abap-adt/llm-agent';
|
|
2
|
+
import type { KnowledgeBackend, SmartAgentBuilder } from '@mcp-abap-adt/llm-agent-libs';
|
|
3
|
+
import type { NormalizedLlmMap } from '../smart-agent/config.js';
|
|
4
|
+
import type { SmartServerLlmConfig } from '../smart-agent/smart-server.js';
|
|
5
|
+
/**
|
|
6
|
+
* Server-side pipeline context. Extends the portable core IPipelineContext with
|
|
7
|
+
* the SmartAgentBuilder factory (host owns agent assembly) and the raw materials
|
|
8
|
+
* the DAG/linear coordinator builders need. Built-ins downcast IPipelineContext
|
|
9
|
+
* to this; the stepper variant uses only the core surface.
|
|
10
|
+
*/
|
|
11
|
+
export interface IServerPipelineContext extends IPipelineContext {
|
|
12
|
+
/** Builder pre-wired with all shared infra EXCEPT the coordinator. */
|
|
13
|
+
createAgentBuilder(): Promise<SmartAgentBuilder>;
|
|
14
|
+
makeLlm(cfg: SmartServerLlmConfig): Promise<ILlm>;
|
|
15
|
+
llmMap?: NormalizedLlmMap;
|
|
16
|
+
pipelineFallback?: SmartServerLlmConfig;
|
|
17
|
+
mainLlm: ILlm;
|
|
18
|
+
helperLlm?: ILlm;
|
|
19
|
+
mainTemp: number;
|
|
20
|
+
/** Session-scoped worker registry (DAG workers / linear subagents). */
|
|
21
|
+
workerRegistry: ReadonlyMap<string, ISubAgent>;
|
|
22
|
+
warn(msg: string): void;
|
|
23
|
+
/**
|
|
24
|
+
* Durable knowledge backend (session-bundle persistence + artifacts). The
|
|
25
|
+
* server always builds exactly one (`buildKnowledgeBackend`): JSONL when a
|
|
26
|
+
* `logDir` is set, else in-memory. Shared across sessions; consumed by the
|
|
27
|
+
* stepper/controller coordinators.
|
|
28
|
+
*/
|
|
29
|
+
stepperKnowledgeBackend: KnowledgeBackend;
|
|
30
|
+
/**
|
|
31
|
+
* The embedder resolved once at startup from `rag.embedder` (or the configured
|
|
32
|
+
* embedder), shared with makeRag and the subagent context-builder. Used by the
|
|
33
|
+
* controller pipeline for target-state semantic distance. Undefined when no
|
|
34
|
+
* embedder is configured.
|
|
35
|
+
*/
|
|
36
|
+
embedder?: IEmbedder;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Controller-pipeline view of the server context. With the durable knowledge
|
|
40
|
+
* backend and embedder now folded into the base {@link IServerPipelineContext}
|
|
41
|
+
* (external tools are routed per-REQUEST via `PipelineContext.externalTools`,
|
|
42
|
+
* not the build-time ctx), this is a transparent alias retained for the
|
|
43
|
+
* controller plugin / fixtures that reference it by name.
|
|
44
|
+
*/
|
|
45
|
+
export type IControllerServerPipelineContext = IServerPipelineContext;
|
|
46
|
+
/** Always-present empty handle for no-RAG/no-MCP deployments. */
|
|
47
|
+
export declare const EMPTY_TOOLS_RAG: IToolsRagHandle;
|
|
48
|
+
/** Deps = the full context minus toolsRag (which the factory defaults). */
|
|
49
|
+
export type ServerPipelineContextDeps = Omit<IServerPipelineContext, 'toolsRag'> & {
|
|
50
|
+
toolsRag?: IToolsRagHandle;
|
|
51
|
+
};
|
|
52
|
+
export declare function createServerPipelineContext(deps: ServerPipelineContextDeps): IServerPipelineContext;
|
|
53
|
+
//# sourceMappingURL=server-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-context.d.ts","sourceRoot":"","sources":["../../src/pipelines/server-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,IAAI,EACJ,gBAAgB,EAChB,SAAS,EACT,eAAe,EAChB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D,sEAAsE;IACtE,kBAAkB,IAAI,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAEjD,OAAO,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClD,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,gBAAgB,CAAC,EAAE,oBAAoB,CAAC;IACxC,OAAO,EAAE,IAAI,CAAC;IACd,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,uEAAuE;IACvE,cAAc,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC/C,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB;;;;;OAKG;IACH,uBAAuB,EAAE,gBAAgB,CAAC;IAC1C;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,gCAAgC,GAAG,sBAAsB,CAAC;AAEtE,iEAAiE;AACjE,eAAO,MAAM,eAAe,EAAE,eAG7B,CAAC;AAEF,2EAA2E;AAC3E,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAC1C,sBAAsB,EACtB,UAAU,CACX,GAAG;IACF,QAAQ,CAAC,EAAE,eAAe,CAAC;CAC5B,CAAC;AAEF,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,yBAAyB,GAC9B,sBAAsB,CAExB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Always-present empty handle for no-RAG/no-MCP deployments. */
|
|
2
|
+
export const EMPTY_TOOLS_RAG = {
|
|
3
|
+
query: async () => [],
|
|
4
|
+
lookup: () => undefined,
|
|
5
|
+
};
|
|
6
|
+
export function createServerPipelineContext(deps) {
|
|
7
|
+
return { ...deps, toolsRag: deps.toolsRag ?? EMPTY_TOOLS_RAG };
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=server-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server-context.js","sourceRoot":"","sources":["../../src/pipelines/server-context.ts"],"names":[],"mappings":"AA0DA,iEAAiE;AACjE,MAAM,CAAC,MAAM,eAAe,GAAoB;IAC9C,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,EAAE;IACrB,MAAM,EAAE,GAAG,EAAE,CAAC,SAAS;CACxB,CAAC;AAUF,MAAM,UAAU,2BAA2B,CACzC,IAA+B;IAE/B,OAAO,EAAE,GAAG,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,eAAe,EAAE,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { IPipelineInstance, IPipelinePlugin } from '@mcp-abap-adt/llm-agent';
|
|
2
|
+
import { type StepperCoordinatorConfig } from './parsers.js';
|
|
3
|
+
import type { IServerPipelineContext } from './server-context.js';
|
|
4
|
+
/**
|
|
5
|
+
* Built-in `stepper` pipeline plugin. Parses the coordinator config dialect,
|
|
6
|
+
* picks the matching builder-factory by `mode`, builds the coordinator stage
|
|
7
|
+
* handler, registers it on a fresh agent builder, and returns the runnable
|
|
8
|
+
* agent plus a disposal hook.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated Legacy pipeline. `stepper` runs on its own legacy composition
|
|
11
|
+
* step-interpreter and stays selectable only for backward compatibility — it is
|
|
12
|
+
* not the active development path. The newer `controller` pipeline (incremental
|
|
13
|
+
* / adaptive planner) is the maintained interpreter; new deployments should use
|
|
14
|
+
* it. The controller interpreter was not designed to drive the legacy stepper
|
|
15
|
+
* flow, so do not migrate a `stepper` config onto it. May be removed in a future
|
|
16
|
+
* major.
|
|
17
|
+
*/
|
|
18
|
+
export declare class StepperPipelinePlugin implements IPipelinePlugin<StepperCoordinatorConfig> {
|
|
19
|
+
readonly name = "stepper";
|
|
20
|
+
parseConfig(raw: unknown): StepperCoordinatorConfig;
|
|
21
|
+
build(cfg: StepperCoordinatorConfig, ctx: IServerPipelineContext): Promise<IPipelineInstance>;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=stepper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stepper.d.ts","sourceRoot":"","sources":["../../src/pipelines/stepper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAQjC,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE;;;;;;;;;;;;;GAaG;AACH,qBAAa,qBACX,YAAW,eAAe,CAAC,wBAAwB,CAAC;IAEpD,QAAQ,CAAC,IAAI,aAAa;IAE1B,WAAW,CAAC,GAAG,EAAE,OAAO,GAAG,wBAAwB;IAM7C,KAAK,CACT,GAAG,EAAE,wBAAwB,EAC7B,GAAG,EAAE,sBAAsB,GAC1B,OAAO,CAAC,iBAAiB,CAAC;CAsC9B"}
|