@mcp-abap-adt/llm-agent-server-libs 32.0.1 → 33.1.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/README.md +4 -0
- package/dist/builders/controller-skill-pipeline-builder.d.ts +1 -0
- package/dist/builders/controller-skill-pipeline-builder.d.ts.map +1 -1
- package/dist/builders/controller-skill-pipeline-builder.js +1 -0
- package/dist/builders/controller-skill-pipeline-builder.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/pipelines/controller.d.ts.map +1 -1
- package/dist/pipelines/controller.js +4 -1
- package/dist/pipelines/controller.js.map +1 -1
- package/dist/smart-agent/build-stepper-root.d.ts.map +1 -1
- package/dist/smart-agent/build-stepper-root.js +4 -3
- package/dist/smart-agent/build-stepper-root.js.map +1 -1
- package/dist/smart-agent/config-reload-watcher.js +2 -2
- package/dist/smart-agent/config-reload-watcher.js.map +1 -1
- package/dist/smart-agent/controller/controller-coordinator-handler.d.ts.map +1 -1
- package/dist/smart-agent/controller/controller-coordinator-handler.js +6 -4
- package/dist/smart-agent/controller/controller-coordinator-handler.js.map +1 -1
- package/dist/smart-agent/controller/recall.d.ts +3 -1
- package/dist/smart-agent/controller/recall.d.ts.map +1 -1
- package/dist/smart-agent/controller/recall.js +6 -2
- package/dist/smart-agent/controller/recall.js.map +1 -1
- package/dist/smart-agent/controller/usage-logging.d.ts.map +1 -1
- package/dist/smart-agent/controller/usage-logging.js +3 -1
- package/dist/smart-agent/controller/usage-logging.js.map +1 -1
- package/dist/smart-agent/http/chat-route-handler.d.ts.map +1 -1
- package/dist/smart-agent/http/chat-route-handler.js +11 -0
- package/dist/smart-agent/http/chat-route-handler.js.map +1 -1
- package/dist/smart-agent/http/config-route-handler.d.ts.map +1 -1
- package/dist/smart-agent/http/config-route-handler.js +16 -0
- package/dist/smart-agent/http/config-route-handler.js.map +1 -1
- package/dist/smart-agent/llm-config-map.d.ts +1 -0
- package/dist/smart-agent/llm-config-map.d.ts.map +1 -1
- package/dist/smart-agent/llm-config-map.js +2 -0
- package/dist/smart-agent/llm-config-map.js.map +1 -1
- package/dist/smart-agent/mcp/borrow-mcp-servers.d.ts +4 -0
- package/dist/smart-agent/mcp/borrow-mcp-servers.d.ts.map +1 -0
- package/dist/smart-agent/mcp/borrow-mcp-servers.js +11 -0
- package/dist/smart-agent/mcp/borrow-mcp-servers.js.map +1 -0
- package/dist/smart-agent/pipeline-settings.d.ts.map +1 -1
- package/dist/smart-agent/pipeline-settings.js +0 -1
- package/dist/smart-agent/pipeline-settings.js.map +1 -1
- package/dist/smart-agent/resolve-config-sections.d.ts.map +1 -1
- package/dist/smart-agent/resolve-config-sections.js +20 -4
- package/dist/smart-agent/resolve-config-sections.js.map +1 -1
- package/dist/smart-agent/smart-server.d.ts +5 -3
- package/dist/smart-agent/smart-server.d.ts.map +1 -1
- package/dist/smart-agent/smart-server.js +13 -11
- 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 +4 -2
- package/dist/smart-agent/stepper-coordinator-handler.js.map +1 -1
- package/dist/smart-agent/workers/worker-registry.d.ts +4 -1
- package/dist/smart-agent/workers/worker-registry.d.ts.map +1 -1
- package/dist/smart-agent/workers/worker-registry.js +4 -0
- package/dist/smart-agent/workers/worker-registry.js.map +1 -1
- package/dist/smart-agent/yaml-loader.d.ts +3 -2
- package/dist/smart-agent/yaml-loader.d.ts.map +1 -1
- package/dist/smart-agent/yaml-loader.js +6 -14
- package/dist/smart-agent/yaml-loader.js.map +1 -1
- package/package.json +5 -5
|
@@ -102,6 +102,7 @@ export async function backfillWorkerCacheFromHandle(entry, handle) {
|
|
|
102
102
|
handle.mcpClients &&
|
|
103
103
|
handle.mcpClients.length > 0) {
|
|
104
104
|
entry.mcpClients = handle.mcpClients;
|
|
105
|
+
entry.mcpClientDescriptors = handle.mcpClientDescriptors;
|
|
105
106
|
}
|
|
106
107
|
if (!entry.toolsRag) {
|
|
107
108
|
const t = handle.ragRegistry.get('tools', 'global');
|
|
@@ -220,6 +221,9 @@ export class WorkerRegistry {
|
|
|
220
221
|
ragRegistry: parts.ragRegistry,
|
|
221
222
|
toolsRag: injectedToolsRag,
|
|
222
223
|
mcpClients: injectedMcpClients,
|
|
224
|
+
mcpClientDescriptors: injectedMcpClients === cached.mcpClients
|
|
225
|
+
? cached.mcpClientDescriptors
|
|
226
|
+
: parts.mcpClientDescriptors,
|
|
223
227
|
requestLogger: parts.logger,
|
|
224
228
|
embedder: cached.embedder,
|
|
225
229
|
}, new Map([[sub.name, cached]]));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker-registry.js","sourceRoot":"","sources":["../../../src/smart-agent/workers/worker-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"worker-registry.js","sourceRoot":"","sources":["../../../src/smart-agent/workers/worker-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAcH,OAAO,EAGL,kBAAkB,GACnB,MAAM,8BAA8B,CAAC;AAyCtC,8EAA8E;AAC9E,4DAA4D;AAC5D,8EAA8E;AAE9E;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,KAAgC;IAEhC,MAAM,OAAO,GAAyB,EAAE,CAAC;IACzC,KAAK,MAAM,KAAK,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;QACnC,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;YAChB,IAAI,CAAC;gBACH,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;YAC9B,CAAC;YAAC,MAAM,CAAC;gBACP,sDAAsD;YACxD,CAAC;QACH,CAAC;IACH,CAAC;IACD,KAAK,CAAC,KAAK,EAAE,CAAC;IACd,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EA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C1B,UAAU,EAAE,kBAAkB;gBAC9B,oBAAoB,EAClB,kBAAkB,KAAK,MAAM,CAAC,UAAU;oBACtC,CAAC,CAAC,MAAM,CAAC,oBAAoB;oBAC7B,CAAC,CAAC,KAAK,CAAC,oBAAoB;gBAChC,aAAa,EAAE,KAAK,CAAC,MAAM;gBAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;aAC1B,EACD,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAC9B,CAAC;YACF,QAAQ,CAAC,GAAG,CACV,GAAG,CAAC,IAAI,EACR,IAAI,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,EAAE;gBACzC,WAAW,EAAE,GAAG,CAAC,WAAW;aAC7B,CAAC,CACH,CAAC;QACJ,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import { resolveEnvVars } from '@mcp-abap-adt/llm-agent-libs';
|
|
2
|
+
export { resolveEnvVars };
|
|
1
3
|
export type YamlConfig = Record<string, unknown>;
|
|
2
|
-
export declare const YAML_TEMPLATE = "port: 4004\nhost: 0.0.0.0\n\n# Request routing mode:\n# hard \u2014 Fully managed context. Ignores client history/system prompt. Uses RAG + internal MCP tools only.\n# pass \u2014 Transparent proxy. Logs everything but modifies nothing.\n# smart \u2014 Hybrid. Preserves client history but enriches it with RAG context and MCP tools based on analysis. (default)\nmode: smart\n\nllm:\n provider: deepseek # deepseek | openai | anthropic | sap-ai-sdk | ollama\n # No secret here: your composition root holds the credential. To use an account\n # other than its default, name it: credentialRef: <NAME>\n model: deepseek-chat\n # Unset sampling knobs are not sent \u2014 the model applies its own default.\n # Set them only for a model that accepts them (gpt-5, o-series and\n # claude-opus-4-7+ accept temperature 1 only).\n # temperature: 0.7\n # classifierTemperature: 0.1\n\nrag:\n store: # the vector store: its own address and account\n type: in-memory # in-memory | qdrant | hana-vector | pg-vector\n # collectionName: llm-agent # qdrant (default llm-agent) | hana-vector | pg-vector (required)\n # credentialRef: QDRANT # the store's account, resolved by your composition root\n dedupThreshold: 0.92 # in-memory only\n vectorWeight: 0.7 # in-memory only: semantic similarity weight (0..1)\n keywordWeight: 0.3 # in-memory only: lexical matching weight (0..1)\n embedder: # omit for a keyword-only in-memory store\n provider: ollama # ollama | openai | sap-ai-core | <custom>\n url: http://localhost:11434\n model: bge-m3\n # resourceGroup: default # SAP AI Core resource group (sap-ai-core)\n # scenario: orchestration # SAP AI Core scenario: orchestration (default) | foundation-models\n # credentialRef: AICORE # the embedder's own account\n\nmcp:\n # type: none | http | stdio\n # To disable MCP, set type to 'none'\n type: http\n url: http://localhost:3001/mcp/stream/http\n\nagent:\n externalToolsValidationMode: permissive # permissive | strict\n maxIterations: 10\n maxToolCalls: 30\n toolUnavailableTtlMs: 600000 # Temporary tool blacklist TTL (ms)\n ragQueryK: 10\n # contextBudgetTokens: 4000 # Max tokens for RAG context in system prompt (0 = no limit)\n # semanticHistoryEnabled: false # Enable semantic history via RAG\n # historyRecencyWindow: 4 # Last N messages from client history in LLM context\n # historyTurnSummaryPrompt: \"...\" # LLM prompt for turn summarization\n showReasoning: false # Explain strategy at start of response\n historyAutoSummarizeLimit: 10 # History length to trigger compression\n queryExpansionEnabled: false # Expand RAG queries with LLM-generated synonyms\n toolResultCacheTtlMs: 300000 # Tool result cache TTL (ms); 0 to disable\n sessionTokenBudget: 0 # Multi-turn token budget; 0 to disable\n # ragTranslateEnabled: true # Translate non-ASCII RAG queries to English (default: true)\n # classificationEnabled: false # Enable for custom pipelines with multi-store routing\n # toolReselectPerIteration: false # Re-select tools via RAG on each tool-loop iteration\n # llmCallStrategy: streaming # streaming | non-streaming | fallback\n # streamMode: full # full | final \u2014 streaming behavior for tool loops\n # heartbeatIntervalMs: 5000 # SSE heartbeat interval during tool execution (ms)\n # healthTimeoutMs: 5000 # Health check probe timeout (ms); increase for slow providers (SAP AI Core: 15000)\n # retry: # LLM retry config for 429/5xx errors\n # maxAttempts: 3\n # backoffMs: 1000\n # retryOn: [429, 500, 502, 503]\n # retryOnMidStream: ['SSE stream'] # Substrings triggering mid-stream retry\n\n# --- Advanced Multi-Model LLM (optional) ------------------------------------\n# Assign different models for different internal roles via a top-level llm: map.\n# (The legacy pipeline.llm override was removed \u2014 use the top-level llm: map now.)\n# llm:\n# main:\n# provider: deepseek # deepseek | openai | anthropic | sap-ai-sdk\n# model: deepseek-chat\n# temperature: 0.7\n# classifier: # optional; if absent, main config is reused\n# provider: openai\n# credentialRef: OPENAI_KEY_CHEAP # a second account, named \u2014 resolved by your composition root\n# model: gpt-4o-mini\n# temperature: 0.1\n# helper: # optional; if absent, main config is reused\n# provider: deepseek\n# model: deepseek-chat\n# temperature: 0.1\n\n# prompts:\n# system: \"You are a helpful assistant specialized in SAP ABAP development.\"\n# classifier: |\n# You are an intent classifier... (see source for full default prompt)\n# reasoning: |\n# IMPORTANT: Always start your response with a brief <reasoning> block...\n# ragTranslate: |\n# Translate the user request to English for search purposes...\n# historySummary: |\n# Summarize the conversation so far...\n\nlog: smart-server.log # path to log file; omit for stdout\n# logDir: sessions # Directory for detailed session debug logs\n# pluginDir: ./my-plugins # Additional plugin directory (loaded after defaults)\n# plugins: # Explicit plugin module specifiers (npm packages or paths)\n# - \"@scope/my-pipeline-plugin\" # bare specifier resolved from cwd\n# - ./local-plugin.mjs # relative path resolved against cwd\n\n# subagents: # Optional: nested agents callable from pipeline\n# - name: code-reviewer # Used as stage config: { agent: code-reviewer }\n# description: | # Optional. Shown to the Coordinator planner LLM\n# Reviews code and returns # so it can pick this agent for the right step.\n# structured JSON.\n# config: ./agents/code-reviewer.yaml\n\n# pipeline: # Optional: select the request pipeline.\n# name: flat # flat (default) | linear | dag | stepper | controller | controller-weak | <plugin>\n# config: # The selected pipeline's section (parsed at startup by the server, or by a dynamic plugin's factory)\n# mode: planned-react # e.g. stepper: cyclic-react | planned-react | deep-stepper\n# knowledgeSeed: [] # stepper: deployment-supplied tool guidance\n#\n# NOTE: the legacy 'coordinator:' block and the old 'pipeline:' shape\n# (mcp/rag/stages/llm overrides) were REMOVED in this major. A config that\n# still uses them fails loud at startup. Top-level 'llm:', 'mcp:', 'rag:' now\n# own those concerns; pipeline behavior moves under 'pipeline.config'.\n";
|
|
4
|
+
export declare const YAML_TEMPLATE = "port: 4004\nhost: 0.0.0.0\n\n# Request routing mode:\n# hard \u2014 Fully managed context. Ignores client history/system prompt. Uses RAG + internal MCP tools only.\n# pass \u2014 Transparent proxy. Logs everything but modifies nothing.\n# smart \u2014 Hybrid. Preserves client history but enriches it with RAG context and MCP tools based on analysis. (default)\nmode: smart\n\nllm:\n # promptCaching: true # default; false disables client-controlled caching\n provider: deepseek # deepseek | openai | anthropic | sap-ai-sdk | ollama\n # No secret here: your composition root holds the credential. To use an account\n # other than its default, name it: credentialRef: <NAME>\n model: deepseek-chat\n # Unset sampling knobs are not sent \u2014 the model applies its own default.\n # Set them only for a model that accepts them (gpt-5, o-series and\n # claude-opus-4-7+ accept temperature 1 only).\n # temperature: 0.7\n # classifierTemperature: 0.1\n\nrag:\n store: # the vector store: its own address and account\n type: in-memory # in-memory | qdrant | hana-vector | pg-vector\n # collectionName: llm-agent # qdrant (default llm-agent) | hana-vector | pg-vector (required)\n # credentialRef: QDRANT # the store's account, resolved by your composition root\n dedupThreshold: 0.92 # in-memory only\n vectorWeight: 0.7 # in-memory only: semantic similarity weight (0..1)\n keywordWeight: 0.3 # in-memory only: lexical matching weight (0..1)\n embedder: # omit for a keyword-only in-memory store\n provider: ollama # ollama | openai | sap-ai-core | <custom>\n url: http://localhost:11434\n model: bge-m3\n # resourceGroup: default # SAP AI Core resource group (sap-ai-core)\n # scenario: orchestration # SAP AI Core scenario: orchestration (default) | foundation-models\n # credentialRef: AICORE # the embedder's own account\n\nmcp:\n # type: none | http | stdio\n # To disable MCP, set type to 'none'\n type: http\n url: http://localhost:3001/mcp/stream/http\n\nagent:\n externalToolsValidationMode: permissive # permissive | strict\n # Tool-loop limits are off by default. Uncomment to restore the old limits.\n # maxIterations: 10\n # maxToolCalls: 30\n toolUnavailableTtlMs: 600000 # Temporary tool blacklist TTL (ms)\n ragQueryK: 10\n # contextBudgetTokens: 4000 # Max tokens for RAG context in system prompt (0 = no limit)\n # semanticHistoryEnabled: false # Enable semantic history via RAG\n # historyRecencyWindow: 4 # Last N messages from client history in LLM context\n # historyTurnSummaryPrompt: \"...\" # LLM prompt for turn summarization\n showReasoning: false # Explain strategy at start of response\n historyAutoSummarizeLimit: 10 # History length to trigger compression\n queryExpansionEnabled: false # Expand RAG queries with LLM-generated synonyms\n toolResultCacheTtlMs: 300000 # Tool result cache TTL (ms); 0 to disable\n sessionTokenBudget: 0 # Multi-turn token budget; 0 to disable\n # ragTranslateEnabled: true # Translate non-ASCII RAG queries to English (default: true)\n # classificationEnabled: false # Enable for custom pipelines with multi-store routing\n # toolReselectPerIteration: false # Re-select tools via RAG on each tool-loop iteration\n # llmCallStrategy: streaming # streaming | non-streaming | fallback\n # streamMode: full # full | final \u2014 streaming behavior for tool loops\n # heartbeatIntervalMs: 5000 # SSE heartbeat interval during tool execution (ms)\n # healthTimeoutMs: 5000 # Health check probe timeout (ms); increase for slow providers (SAP AI Core: 15000)\n # retry: # LLM retry config for 429/5xx errors\n # maxAttempts: 3\n # backoffMs: 1000\n # retryOn: [429, 500, 502, 503]\n # retryOnMidStream: ['SSE stream'] # Substrings triggering mid-stream retry\n\n# --- Advanced Multi-Model LLM (optional) ------------------------------------\n# Assign different models for different internal roles via a top-level llm: map.\n# (The legacy pipeline.llm override was removed \u2014 use the top-level llm: map now.)\n# llm:\n# main:\n# provider: deepseek # deepseek | openai | anthropic | sap-ai-sdk\n# model: deepseek-chat\n# temperature: 0.7\n# classifier: # optional; if absent, main config is reused\n# provider: openai\n# credentialRef: OPENAI_KEY_CHEAP # a second account, named \u2014 resolved by your composition root\n# model: gpt-4o-mini\n# temperature: 0.1\n# helper: # optional; if absent, main config is reused\n# provider: deepseek\n# model: deepseek-chat\n# temperature: 0.1\n\n# prompts:\n# system: \"You are a helpful assistant specialized in SAP ABAP development.\"\n# classifier: |\n# You are an intent classifier... (see source for full default prompt)\n# reasoning: |\n# IMPORTANT: Always start your response with a brief <reasoning> block...\n# ragTranslate: |\n# Translate the user request to English for search purposes...\n# historySummary: |\n# Summarize the conversation so far...\n\nlog: smart-server.log # path to log file; omit for stdout\n# logDir: sessions # Directory for detailed session debug logs\n# pluginDir: ./my-plugins # Additional plugin directory (loaded after defaults)\n# plugins: # Explicit plugin module specifiers (npm packages or paths)\n# - \"@scope/my-pipeline-plugin\" # bare specifier resolved from cwd\n# - ./local-plugin.mjs # relative path resolved against cwd\n\n# subagents: # Optional: nested agents callable from pipeline\n# - name: code-reviewer # Used as stage config: { agent: code-reviewer }\n# description: | # Optional. Shown to the Coordinator planner LLM\n# Reviews code and returns # so it can pick this agent for the right step.\n# structured JSON.\n# config: ./agents/code-reviewer.yaml\n\n# pipeline: # Optional: select the request pipeline.\n# name: flat # flat (default) | linear | dag | stepper | controller | controller-weak | <plugin>\n# config: # The selected pipeline's section (parsed at startup by the server, or by a dynamic plugin's factory)\n# mode: planned-react # e.g. stepper: cyclic-react | planned-react | deep-stepper\n# knowledgeSeed: [] # stepper: deployment-supplied tool guidance\n#\n# NOTE: the legacy 'coordinator:' block and the old 'pipeline:' shape\n# (mcp/rag/stages/llm overrides) were REMOVED in this major. A config that\n# still uses them fails loud at startup. Top-level 'llm:', 'mcp:', 'rag:' now\n# own those concerns; pipeline behavior moves under 'pipeline.config'.\n";
|
|
3
5
|
export declare const get: (obj: unknown, ...keys: string[]) => unknown;
|
|
4
|
-
export declare function resolveEnvVars(value: unknown, env?: NodeJS.ProcessEnv): unknown;
|
|
5
6
|
export declare function loadYamlConfig(filePath: string, env?: NodeJS.ProcessEnv): YamlConfig;
|
|
6
7
|
export declare function generateConfigTemplate(outputPath: string): void;
|
|
7
8
|
//# sourceMappingURL=yaml-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-loader.d.ts","sourceRoot":"","sources":["../../src/smart-agent/yaml-loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"yaml-loader.d.ts","sourceRoot":"","sources":["../../src/smart-agent/yaml-loader.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,OAAO,EAAE,cAAc,EAAE,CAAC;AAE1B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEjD,eAAO,MAAM,aAAa,kkOA6HzB,CAAC;AAEF,eAAO,MAAM,GAAG,GAAI,KAAK,OAAO,EAAE,GAAG,MAAM,MAAM,EAAE,KAAG,OAM7C,CAAC;AAEV,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,UAAU,CAGZ;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAE/D"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs';
|
|
2
|
+
import { resolveEnvVars } from '@mcp-abap-adt/llm-agent-libs';
|
|
2
3
|
import { parse as parseYaml } from 'yaml';
|
|
4
|
+
export { resolveEnvVars };
|
|
3
5
|
export const YAML_TEMPLATE = `port: 4004
|
|
4
6
|
host: 0.0.0.0
|
|
5
7
|
|
|
@@ -10,6 +12,7 @@ host: 0.0.0.0
|
|
|
10
12
|
mode: smart
|
|
11
13
|
|
|
12
14
|
llm:
|
|
15
|
+
# promptCaching: true # default; false disables client-controlled caching
|
|
13
16
|
provider: deepseek # deepseek | openai | anthropic | sap-ai-sdk | ollama
|
|
14
17
|
# No secret here: your composition root holds the credential. To use an account
|
|
15
18
|
# other than its default, name it: credentialRef: <NAME>
|
|
@@ -44,8 +47,9 @@ mcp:
|
|
|
44
47
|
|
|
45
48
|
agent:
|
|
46
49
|
externalToolsValidationMode: permissive # permissive | strict
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
# Tool-loop limits are off by default. Uncomment to restore the old limits.
|
|
51
|
+
# maxIterations: 10
|
|
52
|
+
# maxToolCalls: 30
|
|
49
53
|
toolUnavailableTtlMs: 600000 # Temporary tool blacklist TTL (ms)
|
|
50
54
|
ragQueryK: 10
|
|
51
55
|
# contextBudgetTokens: 4000 # Max tokens for RAG context in system prompt (0 = no limit)
|
|
@@ -130,18 +134,6 @@ export const get = (obj, ...keys) => keys.reduce((o, k) => {
|
|
|
130
134
|
}
|
|
131
135
|
return undefined;
|
|
132
136
|
}, obj);
|
|
133
|
-
export function resolveEnvVars(value, env = process.env) {
|
|
134
|
-
if (typeof value === 'string')
|
|
135
|
-
return value.replace(/\$\{([^}:]+)(?::-(.*?))?\}/g, (_, name, fallback) => env[name] || fallback || '');
|
|
136
|
-
if (Array.isArray(value))
|
|
137
|
-
return value.map((v) => resolveEnvVars(v, env));
|
|
138
|
-
if (value !== null && typeof value === 'object')
|
|
139
|
-
return Object.fromEntries(Object.entries(value).map(([k, v]) => [
|
|
140
|
-
k,
|
|
141
|
-
resolveEnvVars(v, env),
|
|
142
|
-
]));
|
|
143
|
-
return value;
|
|
144
|
-
}
|
|
145
137
|
export function loadYamlConfig(filePath, env = process.env) {
|
|
146
138
|
const raw = fs.readFileSync(filePath, 'utf8');
|
|
147
139
|
return resolveEnvVars(parseYaml(raw), env);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"yaml-loader.js","sourceRoot":"","sources":["../../src/smart-agent/yaml-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"yaml-loader.js","sourceRoot":"","sources":["../../src/smart-agent/yaml-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,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|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"@mcp-abap-adt/interfaces-auth": "^2.1.0",
|
|
66
|
-
"@mcp-abap-adt/llm-agent": "^
|
|
67
|
-
"@mcp-abap-adt/llm-agent-libs": "^
|
|
66
|
+
"@mcp-abap-adt/llm-agent": "^33.2.0",
|
|
67
|
+
"@mcp-abap-adt/llm-agent-libs": "^33.1.0",
|
|
68
68
|
"@mcp-abap-adt/llm-agent-mcp": "^30.9.1",
|
|
69
69
|
"@mcp-abap-adt/llm-agent-rag": "^30.10.2",
|
|
70
|
-
"@mcp-abap-adt/sap-aicore-llm": "^
|
|
70
|
+
"@mcp-abap-adt/sap-aicore-llm": "^31.0.0"
|
|
71
71
|
},
|
|
72
72
|
"peerDependenciesMeta": {
|
|
73
73
|
"@mcp-abap-adt/sap-aicore-llm": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
|
-
"@mcp-abap-adt/sap-aicore-llm": "^
|
|
78
|
+
"@mcp-abap-adt/sap-aicore-llm": "^31.0.0",
|
|
79
79
|
"@types/pg": "^8.23.1"
|
|
80
80
|
},
|
|
81
81
|
"publishConfig": {
|