@mcp-abap-adt/llm-agent 12.0.2 → 12.0.4
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/interfaces/agent-contracts.d.ts +25 -0
- package/dist/interfaces/agent-contracts.d.ts.map +1 -1
- package/dist/interfaces/agent-contracts.js.map +1 -1
- package/dist/interfaces/builder.d.ts +55 -0
- package/dist/interfaces/builder.d.ts.map +1 -0
- package/dist/interfaces/builder.js +2 -0
- package/dist/interfaces/builder.js.map +1 -0
- package/dist/interfaces/health.d.ts +25 -0
- package/dist/interfaces/health.d.ts.map +1 -0
- package/dist/interfaces/health.js +2 -0
- package/dist/interfaces/health.js.map +1 -0
- package/dist/interfaces/index.d.ts +13 -2
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/index.js +1 -0
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/mcp-connection-strategy.d.ts +26 -0
- package/dist/interfaces/mcp-connection-strategy.d.ts.map +1 -0
- package/dist/interfaces/mcp-connection-strategy.js +2 -0
- package/dist/interfaces/mcp-connection-strategy.js.map +1 -0
- package/dist/interfaces/metrics.d.ts +58 -0
- package/dist/interfaces/metrics.d.ts.map +1 -0
- package/dist/interfaces/metrics.js +9 -0
- package/dist/interfaces/metrics.js.map +1 -0
- package/dist/interfaces/model-resolver.d.ts +9 -0
- package/dist/interfaces/model-resolver.d.ts.map +1 -0
- package/dist/interfaces/model-resolver.js +2 -0
- package/dist/interfaces/model-resolver.js.map +1 -0
- package/dist/interfaces/pipeline.d.ts +52 -0
- package/dist/interfaces/pipeline.d.ts.map +1 -0
- package/dist/interfaces/pipeline.js +9 -0
- package/dist/interfaces/pipeline.js.map +1 -0
- package/dist/interfaces/plugin.d.ts +81 -1
- package/dist/interfaces/plugin.d.ts.map +1 -1
- package/dist/interfaces/reranker.d.ts +5 -0
- package/dist/interfaces/reranker.d.ts.map +1 -0
- package/dist/interfaces/reranker.js +2 -0
- package/dist/interfaces/reranker.js.map +1 -0
- package/dist/interfaces/session.d.ts +7 -0
- package/dist/interfaces/session.d.ts.map +1 -0
- package/dist/interfaces/session.js +2 -0
- package/dist/interfaces/session.js.map +1 -0
- package/dist/interfaces/tracer.d.ts +17 -0
- package/dist/interfaces/tracer.d.ts.map +1 -0
- package/dist/interfaces/tracer.js +2 -0
- package/dist/interfaces/tracer.js.map +1 -0
- package/dist/interfaces/validator.d.ts +18 -0
- package/dist/interfaces/validator.d.ts.map +1 -0
- package/dist/interfaces/validator.js +8 -0
- package/dist/interfaces/validator.js.map +1 -0
- package/package.json +1 -1
- package/dist/rag/embedder-factories.d.ts +0 -9
- package/dist/rag/embedder-factories.d.ts.map +0 -1
- package/dist/rag/embedder-factories.js +0 -33
- package/dist/rag/embedder-factories.js.map +0 -1
- package/dist/rag/ollama-rag.d.ts +0 -26
- package/dist/rag/ollama-rag.d.ts.map +0 -1
- package/dist/rag/ollama-rag.js +0 -93
- package/dist/rag/ollama-rag.js.map +0 -1
- package/dist/rag/openai-embedder.d.ts +0 -22
- package/dist/rag/openai-embedder.d.ts.map +0 -1
- package/dist/rag/openai-embedder.js +0 -122
- package/dist/rag/openai-embedder.js.map +0 -1
- package/dist/rag/providers/qdrant-rag-provider.d.ts +0 -39
- package/dist/rag/providers/qdrant-rag-provider.d.ts.map +0 -1
- package/dist/rag/providers/qdrant-rag-provider.js +0 -93
- package/dist/rag/providers/qdrant-rag-provider.js.map +0 -1
- package/dist/rag/qdrant-rag.d.ts +0 -31
- package/dist/rag/qdrant-rag.d.ts.map +0 -1
- package/dist/rag/qdrant-rag.js +0 -300
- package/dist/rag/qdrant-rag.js.map +0 -1
- package/dist/rag/sap-ai-core-embedder.d.ts +0 -22
- package/dist/rag/sap-ai-core-embedder.d.ts.map +0 -1
- package/dist/rag/sap-ai-core-embedder.js +0 -56
- package/dist/rag/sap-ai-core-embedder.js.map +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AgentStreamChunk, Message } from '../types.js';
|
|
1
2
|
import type { CallOptions, ModelUsageEntry } from './types.js';
|
|
2
3
|
import { SmartAgentError } from './types.js';
|
|
3
4
|
export declare class OrchestratorError extends SmartAgentError {
|
|
@@ -28,4 +29,28 @@ export interface SmartAgentResponse {
|
|
|
28
29
|
export interface AgentCallOptions extends CallOptions {
|
|
29
30
|
externalTools?: unknown[];
|
|
30
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Bridge interface for agent implementations that wrap LLM providers.
|
|
34
|
+
* Used by LlmAdapter in llm-agent-server to wrap legacy BaseAgent subclasses.
|
|
35
|
+
*/
|
|
36
|
+
export interface BaseAgentLlmBridge {
|
|
37
|
+
callWithTools(messages: Message[], tools: unknown[], options?: {
|
|
38
|
+
temperature?: number;
|
|
39
|
+
maxTokens?: number;
|
|
40
|
+
topP?: number;
|
|
41
|
+
stop?: string[];
|
|
42
|
+
}): Promise<{
|
|
43
|
+
content: string;
|
|
44
|
+
raw?: unknown;
|
|
45
|
+
}>;
|
|
46
|
+
streamWithTools(messages: Message[], tools: unknown[], options?: {
|
|
47
|
+
temperature?: number;
|
|
48
|
+
maxTokens?: number;
|
|
49
|
+
topP?: number;
|
|
50
|
+
stop?: string[];
|
|
51
|
+
}): AsyncGenerator<{
|
|
52
|
+
content: string;
|
|
53
|
+
raw?: unknown;
|
|
54
|
+
} | AgentStreamChunk, void, unknown>;
|
|
55
|
+
}
|
|
31
56
|
//# sourceMappingURL=agent-contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-contracts.d.ts","sourceRoot":"","sources":["../../src/interfaces/agent-contracts.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,qBAAa,iBAAkB,SAAQ,eAAe;gBACxC,OAAO,EAAE,MAAM,EAAE,IAAI,SAAuB;CAIzD;AAED,MAAM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ACjB,GACA,cAAc,CACf;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,gBAAgB,EACrD,IAAI,EACJ,OAAO,CACR,CAAC;CACH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-contracts.js","sourceRoot":"","sources":["../../src/interfaces/agent-contracts.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-contracts.js","sourceRoot":"","sources":["../../src/interfaces/agent-contracts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,OAAO,iBAAkB,SAAQ,eAAe;IACpD,YAAY,OAAe,EAAE,IAAI,GAAG,oBAAoB;QACtD,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAC;IAClC,CAAC;CACF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { CircuitBreaker } from '../resilience/circuit-breaker.js';
|
|
2
|
+
import type { Message } from '../types.js';
|
|
3
|
+
import type { AgentCallOptions, OrchestratorError, SmartAgentResponse } from './agent-contracts.js';
|
|
4
|
+
import type { ILlmApiAdapter } from './api-adapter.js';
|
|
5
|
+
import type { ILlm } from './llm.js';
|
|
6
|
+
import type { IModelProvider } from './model-provider.js';
|
|
7
|
+
import type { IRag } from './rag.js';
|
|
8
|
+
import type { IRequestLogger } from './request-logger.js';
|
|
9
|
+
import type { LlmStreamChunk, Result } from './types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Public API surface of SmartAgent for consumers.
|
|
12
|
+
* The full SmartAgent class lives in @mcp-abap-adt/llm-agent-libs.
|
|
13
|
+
* SmartAgentHandle in llm-agent-libs uses the concrete SmartAgent type
|
|
14
|
+
* via the generic SmartAgentHandle<SmartAgent> specialization.
|
|
15
|
+
*/
|
|
16
|
+
export interface ISmartAgent {
|
|
17
|
+
process(textOrMessages: string | Message[], options?: AgentCallOptions): Promise<Result<SmartAgentResponse, OrchestratorError>>;
|
|
18
|
+
streamProcess(textOrMessages: string | Message[], options?: AgentCallOptions): AsyncIterable<Result<LlmStreamChunk, OrchestratorError>>;
|
|
19
|
+
}
|
|
20
|
+
/** Type alias for the RAG store map passed to SmartAgent. */
|
|
21
|
+
export type SmartAgentRagStores<K extends string = string> = Record<K, IRag>;
|
|
22
|
+
/**
|
|
23
|
+
* Handle returned by SmartAgentBuilder.build().
|
|
24
|
+
*
|
|
25
|
+
* Generic over the agent type so that:
|
|
26
|
+
* - Consumers coding against the public contract use `SmartAgentHandle` (default: `ISmartAgent`).
|
|
27
|
+
* - llm-agent-libs re-exports `SmartAgentHandle<SmartAgent>` to preserve full concrete typing
|
|
28
|
+
* (including internal methods like `applyConfigUpdate`, `reconfigure`, `getActiveConfig`).
|
|
29
|
+
*/
|
|
30
|
+
export interface SmartAgentHandle<T extends ISmartAgent = ISmartAgent> {
|
|
31
|
+
/** The built and wired agent, ready to call .process(). */
|
|
32
|
+
agent: T;
|
|
33
|
+
/**
|
|
34
|
+
* Direct LLM chat — bypasses SmartAgent pipeline.
|
|
35
|
+
* Used by SmartServer passthrough mode to forward the full message history.
|
|
36
|
+
*/
|
|
37
|
+
chat: ILlm['chat'];
|
|
38
|
+
/** Direct LLM streaming chat. */
|
|
39
|
+
streamChat: ILlm['streamChat'];
|
|
40
|
+
/** Request logger for per-model usage tracking. */
|
|
41
|
+
requestLogger: IRequestLogger;
|
|
42
|
+
/** Gracefully close MCP connections. Call on shutdown. */
|
|
43
|
+
close(): Promise<void>;
|
|
44
|
+
/** Circuit breakers (empty when not configured). */
|
|
45
|
+
circuitBreakers: CircuitBreaker[];
|
|
46
|
+
/** RAG stores (for config hot-reload weight updates). */
|
|
47
|
+
ragStores: SmartAgentRagStores;
|
|
48
|
+
/** Model provider for discovery. Undefined when not available. */
|
|
49
|
+
modelProvider?: IModelProvider;
|
|
50
|
+
/** Look up a registered API adapter by name. */
|
|
51
|
+
getApiAdapter(name: string): ILlmApiAdapter | undefined;
|
|
52
|
+
/** List all registered API adapter names. */
|
|
53
|
+
listApiAdapters(): string[];
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.d.ts","sourceRoot":"","sources":["../../src/interfaces/builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAMzD;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,OAAO,CACL,cAAc,EAAE,MAAM,GAAG,OAAO,EAAE,EAClC,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,MAAM,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAC1D,aAAa,CACX,cAAc,EAAE,MAAM,GAAG,OAAO,EAAE,EAClC,OAAO,CAAC,EAAE,gBAAgB,GACzB,aAAa,CAAC,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,CAAC,CAAC;CAC7D;AAMD,6DAA6D;AAC7D,MAAM,MAAM,mBAAmB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAM7E;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,WAAW,GAAG,WAAW;IACnE,2DAA2D;IAC3D,KAAK,EAAE,CAAC,CAAC;IACT;;;OAGG;IACH,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,iCAAiC;IACjC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC/B,mDAAmD;IACnD,aAAa,EAAE,cAAc,CAAC;IAC9B,0DAA0D;IAC1D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IACvB,oDAAoD;IACpD,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,yDAAyD;IACzD,SAAS,EAAE,mBAAmB,CAAC;IAC/B,kEAAkE;IAClE,aAAa,CAAC,EAAE,cAAc,CAAC;IAC/B,gDAAgD;IAChD,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;IACxD,6CAA6C;IAC7C,eAAe,IAAI,MAAM,EAAE,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../src/interfaces/builder.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { CircuitState } from '../resilience/circuit-breaker.js';
|
|
2
|
+
import type { MetricsSnapshot } from './metrics.js';
|
|
3
|
+
export interface HealthComponentStatus {
|
|
4
|
+
llm: boolean;
|
|
5
|
+
rag: boolean;
|
|
6
|
+
mcp: Array<{
|
|
7
|
+
name: string;
|
|
8
|
+
ok: boolean;
|
|
9
|
+
error?: string;
|
|
10
|
+
}>;
|
|
11
|
+
}
|
|
12
|
+
export interface CircuitBreakerStatus {
|
|
13
|
+
index: number;
|
|
14
|
+
state: CircuitState;
|
|
15
|
+
}
|
|
16
|
+
export interface HealthStatus {
|
|
17
|
+
status: 'healthy' | 'degraded' | 'unhealthy';
|
|
18
|
+
uptime: number;
|
|
19
|
+
version: string;
|
|
20
|
+
timestamp: string;
|
|
21
|
+
components: HealthComponentStatus;
|
|
22
|
+
circuitBreakers?: CircuitBreakerStatus[];
|
|
23
|
+
metrics?: MetricsSnapshot;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=health.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/interfaces/health.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC3D;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,YAAY,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,SAAS,GAAG,UAAU,GAAG,WAAW,CAAC;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,qBAAqB,CAAC;IAClC,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAC;IACzC,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"health.js","sourceRoot":"","sources":["../../src/interfaces/health.ts"],"names":[],"mappings":""}
|
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
export type { IQueryExpander } from '../rag/query-expander.js';
|
|
2
|
-
export { type AgentCallOptions, OrchestratorError, type SmartAgentResponse, type StopReason, } from './agent-contracts.js';
|
|
2
|
+
export { type AgentCallOptions, type BaseAgentLlmBridge, OrchestratorError, type SmartAgentResponse, type StopReason, } from './agent-contracts.js';
|
|
3
3
|
export type { HistoryEntry, IContextAssembler } from './assembler.js';
|
|
4
|
+
export type { ISmartAgent, SmartAgentHandle, SmartAgentRagStores, } from './builder.js';
|
|
4
5
|
export type { ISubpromptClassifier } from './classifier.js';
|
|
6
|
+
export type { CircuitBreakerStatus, HealthComponentStatus, HealthStatus, } from './health.js';
|
|
5
7
|
export type { IHistoryMemory } from './history-memory.js';
|
|
6
8
|
export type { HistoryTurn, IHistorySummarizer, } from './history-summarizer.js';
|
|
7
9
|
export type { ILlm } from './llm.js';
|
|
8
10
|
export type { ILlmCallStrategy } from './llm-call-strategy.js';
|
|
9
11
|
export type { IMcpClient } from './mcp-client.js';
|
|
12
|
+
export type { ConnectionStrategyOptions, IMcpConnectionStrategy, McpClientFactory, McpClientFactoryResult, McpConnectionConfig, McpConnectionResult, } from './mcp-connection-strategy.js';
|
|
13
|
+
export type { CounterSnapshot, HistogramSnapshot, ICounter, IHistogram, IMetrics, MetricsSnapshot, } from './metrics.js';
|
|
10
14
|
export type { IModelFilter, IModelInfo, IModelProvider, } from './model-provider.js';
|
|
11
|
-
export type {
|
|
15
|
+
export type { IModelResolver } from './model-resolver.js';
|
|
16
|
+
export type { BuiltInStageType, ControlFlowType, StageDefinition, StageType, } from './pipeline.js';
|
|
17
|
+
export type { IPluginLoader, IRagStoreConfig, ISmartAgentPlugin, IStageHandler, LoadedPlugins, PluginExports, RagScope, } from './plugin.js';
|
|
12
18
|
export type { IQueryEmbedding } from './query-embedding.js';
|
|
13
19
|
export type { EmbedderFactory, EmbedderFactoryConfig, IEmbedder, IEmbedderBatch, IEmbedResult, IIdStrategy, IRag, IRagBackendWriter, IRagEditor, IRagProvider, IRagProviderRegistry, IRagRegistry, RagCollectionMeta, RagCollectionScope, } from './rag.js';
|
|
14
20
|
export { isBatchEmbedder } from './rag.js';
|
|
15
21
|
export type { ILlmRateLimiter } from './rate-limiter.js';
|
|
16
22
|
export type { IRequestLogger, LlmCallEntry, LlmComponent, RagQueryEntry, RequestSummary, TokenBucket, TokenCategory, ToolCallEntry, } from './request-logger.js';
|
|
23
|
+
export type { IReranker } from './reranker.js';
|
|
24
|
+
export type { ISessionManager } from './session.js';
|
|
17
25
|
export type { ISkill, ISkillManager, ISkillMeta, ISkillResource, } from './skill.js';
|
|
26
|
+
export type { ISpan, ITracer, SpanOptions, SpanStatus } from './tracer.js';
|
|
18
27
|
export type { AgentConfig, CallOptions, ContextFrame, LlmFinishReason, LlmResponse, LlmStreamChunk, LlmTool, LlmToolCall, LlmToolCallDelta, LlmUsage, McpTool, McpToolResult, ModelUsageEntry, RagMetadata, RagResult, Result, StreamHookContext, StreamToolCall, Subprompt, SubpromptType, TimingEntry, ToolCallRecord, ToolHeartbeat, TraceContext, } from './types.js';
|
|
19
28
|
export { AssemblerError, ClassifierError, LlmError, McpError, RagError, SkillError, SmartAgentError, } from './types.js';
|
|
29
|
+
export type { IOutputValidator, ValidationResult } from './validator.js';
|
|
30
|
+
export { ValidatorError } from './validator.js';
|
|
20
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACL,KAAK,gBAAgB,EACrB,iBAAiB,EACjB,KAAK,kBAAkB,EACvB,KAAK,UAAU,GAChB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACtE,YAAY,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAC5D,YAAY,EAAE,cAAc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WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,cAAc,EACd,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,QAAQ,EACR,OAAO,EACP,aAAa,EACb,eAAe,EACf,WAAW,EACX,SAAS,EACT,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,SAAS,EACT,aAAa,EACb,WAAW,EACX,cAAc,EACd,aAAa,EACb,YAAY,GACb,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,cAAc,EACd,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
|
package/dist/interfaces/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { OrchestratorError, } from './agent-contracts.js';
|
|
2
2
|
export { isBatchEmbedder } from './rag.js';
|
|
3
3
|
export { AssemblerError, ClassifierError, LlmError, McpError, RagError, SkillError, SmartAgentError, } from './types.js';
|
|
4
|
+
export { ValidatorError } from './validator.js';
|
|
4
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,iBAAiB,GAGlB,MAAM,sBAAsB,CAAC;AA2E9B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AA+C3C,OAAO,EACL,cAAc,EACd,eAAe,EACf,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { CallOptions, ILogger, IMcpClient } from '@mcp-abap-adt/llm-agent';
|
|
2
|
+
export interface McpConnectionResult {
|
|
3
|
+
clients: IMcpClient[];
|
|
4
|
+
toolsChanged: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface IMcpConnectionStrategy {
|
|
7
|
+
resolve(currentClients: IMcpClient[], options?: CallOptions): Promise<McpConnectionResult>;
|
|
8
|
+
dispose?(): Promise<void> | void;
|
|
9
|
+
}
|
|
10
|
+
export interface McpConnectionConfig {
|
|
11
|
+
type: 'http' | 'stdio';
|
|
12
|
+
url?: string;
|
|
13
|
+
command?: string;
|
|
14
|
+
args?: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface McpClientFactoryResult {
|
|
17
|
+
client: IMcpClient;
|
|
18
|
+
close?: () => Promise<void> | void;
|
|
19
|
+
}
|
|
20
|
+
export type McpClientFactory = (config: McpConnectionConfig) => Promise<McpClientFactoryResult>;
|
|
21
|
+
export interface ConnectionStrategyOptions {
|
|
22
|
+
skipRevectorize?: boolean;
|
|
23
|
+
logger?: ILogger;
|
|
24
|
+
cooldownMs?: number;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=mcp-connection-strategy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-connection-strategy.d.ts","sourceRoot":"","sources":["../../src/interfaces/mcp-connection-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEhF,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,CACL,cAAc,EAAE,UAAU,EAAE,EAC5B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,mBAAmB,CAAC,CAAC;IAEhC,OAAO,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACpC;AAED,MAAM,MAAM,gBAAgB,GAAG,CAC7B,MAAM,EAAE,mBAAmB,KACxB,OAAO,CAAC,sBAAsB,CAAC,CAAC;AAErC,MAAM,WAAW,yBAAyB;IACxC,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-connection-strategy.js","sourceRoot":"","sources":["../../src/interfaces/mcp-connection-strategy.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metrics interfaces — modeled after OTEL-compatible counters and histograms.
|
|
3
|
+
*
|
|
4
|
+
* Consumers implement `IMetrics` to plug in Prometheus, OTEL, or any metrics
|
|
5
|
+
* backend. The library ships `NoopMetrics` (zero overhead) and `InMemoryMetrics`
|
|
6
|
+
* (useful for testing and diagnostics).
|
|
7
|
+
*/
|
|
8
|
+
export interface ICounter {
|
|
9
|
+
/** Increment the counter by 1 (or a custom value). */
|
|
10
|
+
add(value?: number, attributes?: Record<string, string>): void;
|
|
11
|
+
}
|
|
12
|
+
export interface IHistogram {
|
|
13
|
+
/** Record a single observation (e.g. latency in ms). */
|
|
14
|
+
record(value: number, attributes?: Record<string, string>): void;
|
|
15
|
+
}
|
|
16
|
+
export interface IMetrics {
|
|
17
|
+
/** Total incoming requests to SmartAgent.process / streamProcess. */
|
|
18
|
+
requestCount: ICounter;
|
|
19
|
+
/** Request end-to-end latency (ms). */
|
|
20
|
+
requestLatency: IHistogram;
|
|
21
|
+
/** Number of tool calls executed (internal MCP). */
|
|
22
|
+
toolCallCount: ICounter;
|
|
23
|
+
/** Number of RAG queries executed. Attributes: store (store name), hit (true|false). */
|
|
24
|
+
ragQueryCount: ICounter;
|
|
25
|
+
/** Intent classifier invocation count. Attributes: intent (action|feedback|chat). */
|
|
26
|
+
classifierIntentCount: ICounter;
|
|
27
|
+
/** LLM chat / streamChat invocations. */
|
|
28
|
+
llmCallCount: ICounter;
|
|
29
|
+
/** LLM call latency (ms). */
|
|
30
|
+
llmCallLatency: IHistogram;
|
|
31
|
+
/** Circuit breaker state transitions. Attributes: from, to, target (llm|embedder). */
|
|
32
|
+
circuitBreakerTransition: ICounter;
|
|
33
|
+
/** Tool result cache hits. */
|
|
34
|
+
toolCacheHitCount: ICounter;
|
|
35
|
+
}
|
|
36
|
+
export interface CounterSnapshot {
|
|
37
|
+
total: number;
|
|
38
|
+
byAttributes: Map<string, number>;
|
|
39
|
+
}
|
|
40
|
+
export interface HistogramSnapshot {
|
|
41
|
+
count: number;
|
|
42
|
+
sum: number;
|
|
43
|
+
min: number;
|
|
44
|
+
max: number;
|
|
45
|
+
values: number[];
|
|
46
|
+
}
|
|
47
|
+
export interface MetricsSnapshot {
|
|
48
|
+
requestCount: CounterSnapshot;
|
|
49
|
+
requestLatency: HistogramSnapshot;
|
|
50
|
+
toolCallCount: CounterSnapshot;
|
|
51
|
+
ragQueryCount: CounterSnapshot;
|
|
52
|
+
classifierIntentCount: CounterSnapshot;
|
|
53
|
+
llmCallCount: CounterSnapshot;
|
|
54
|
+
llmCallLatency: HistogramSnapshot;
|
|
55
|
+
circuitBreakerTransition: CounterSnapshot;
|
|
56
|
+
toolCacheHitCount: CounterSnapshot;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,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,YAAY,EAAE,eAAe,CAAC;IAC9B,cAAc,EAAE,iBAAiB,CAAC;IAClC,aAAa,EAAE,eAAe,CAAC;IAC/B,aAAa,EAAE,eAAe,CAAC;IAC/B,qBAAqB,EAAE,eAAe,CAAC;IACvC,YAAY,EAAE,eAAe,CAAC;IAC9B,cAAc,EAAE,iBAAiB,CAAC;IAClC,wBAAwB,EAAE,eAAe,CAAC;IAC1C,iBAAiB,EAAE,eAAe,CAAC;CACpC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Metrics interfaces — modeled after OTEL-compatible counters and histograms.
|
|
3
|
+
*
|
|
4
|
+
* Consumers implement `IMetrics` to plug in Prometheus, OTEL, or any metrics
|
|
5
|
+
* backend. The library ships `NoopMetrics` (zero overhead) and `InMemoryMetrics`
|
|
6
|
+
* (useful for testing and diagnostics).
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metrics.js","sourceRoot":"","sources":["../../src/interfaces/metrics.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ILlm } from '@mcp-abap-adt/llm-agent';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves a model name + role into a ready-to-use ILlm instance.
|
|
4
|
+
* Used by SmartServer to handle PUT /v1/config model changes.
|
|
5
|
+
*/
|
|
6
|
+
export interface IModelResolver {
|
|
7
|
+
resolve(modelName: string, role: 'main' | 'classifier' | 'helper'): Promise<ILlm>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=model-resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-resolver.d.ts","sourceRoot":"","sources":["../../src/interfaces/model-resolver.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,OAAO,CACL,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,GACrC,OAAO,CAAC,IAAI,CAAC,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-resolver.js","sourceRoot":"","sources":["../../src/interfaces/model-resolver.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pipeline DSL types — structured pipeline definition.
|
|
3
|
+
*
|
|
4
|
+
* A structured pipeline describes the execution topology of the SmartAgent
|
|
5
|
+
* as a tree of stages. Each stage has a type (built-in operation or control
|
|
6
|
+
* flow construct), optional config, and optional condition (`when`).
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Built-in stage types — each maps to an IStageHandler implementation.
|
|
10
|
+
*/
|
|
11
|
+
export type BuiltInStageType = 'classify' | 'summarize' | 'translate' | 'expand' | 'rag-query' | 'rerank' | 'tool-select' | 'skill-select' | 'build-tool-query' | 'assemble' | 'tool-loop' | 'history-upsert';
|
|
12
|
+
/**
|
|
13
|
+
* Control flow stage types — orchestrate child stages without
|
|
14
|
+
* performing domain logic themselves.
|
|
15
|
+
*/
|
|
16
|
+
export type ControlFlowType = 'parallel' | 'repeat';
|
|
17
|
+
/** Union of all recognized stage types. */
|
|
18
|
+
export type StageType = BuiltInStageType | ControlFlowType;
|
|
19
|
+
/**
|
|
20
|
+
* A single pipeline stage as parsed from structured YAML.
|
|
21
|
+
*/
|
|
22
|
+
export interface StageDefinition {
|
|
23
|
+
/** Unique ID within the pipeline. Used for logging, tracing, and timing entries. */
|
|
24
|
+
id: string;
|
|
25
|
+
/** Stage type — either a built-in operation or a control flow construct. */
|
|
26
|
+
type: StageType;
|
|
27
|
+
/**
|
|
28
|
+
* Arbitrary config passed to the stage handler.
|
|
29
|
+
* Each handler defines its own expected config shape.
|
|
30
|
+
*/
|
|
31
|
+
config?: Record<string, unknown>;
|
|
32
|
+
/**
|
|
33
|
+
* Condition expression. When present, the stage is skipped if the
|
|
34
|
+
* expression evaluates to falsy.
|
|
35
|
+
*/
|
|
36
|
+
when?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Child stages — used by `parallel` and `repeat` control flow types.
|
|
39
|
+
*/
|
|
40
|
+
stages?: StageDefinition[];
|
|
41
|
+
/**
|
|
42
|
+
* Sequential follow-up stages — used by `parallel` type only.
|
|
43
|
+
*/
|
|
44
|
+
after?: StageDefinition[];
|
|
45
|
+
/** Maximum iterations — used by `repeat` type. Default: 10. */
|
|
46
|
+
maxIterations?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Stop condition — used by `repeat` type.
|
|
49
|
+
*/
|
|
50
|
+
until?: string;
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=pipeline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/interfaces/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;GAEG;AACH,MAAM,MAAM,gBAAgB,GACxB,UAAU,GACV,WAAW,GACX,WAAW,GACX,QAAQ,GACR,WAAW,GACX,QAAQ,GACR,aAAa,GACb,cAAc,GACd,kBAAkB,GAClB,UAAU,GACV,WAAW,GACX,gBAAgB,CAAC;AAErB;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEpD,2CAA2C;AAC3C,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,eAAe,CAAC;AAM3D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,oFAAoF;IACpF,EAAE,EAAE,MAAM,CAAC;IAEX,4EAA4E;IAC5E,IAAI,EAAE,SAAS,CAAC;IAEhB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEjC;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,MAAM,CAAC,EAAE,eAAe,EAAE,CAAC;IAE3B;;OAEG;IACH,KAAK,CAAC,EAAE,eAAe,EAAE,CAAC;IAE1B,+DAA+D;IAC/D,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pipeline DSL types — structured pipeline definition.
|
|
3
|
+
*
|
|
4
|
+
* A structured pipeline describes the execution topology of the SmartAgent
|
|
5
|
+
* as a tree of stages. Each stage has a type (built-in operation or control
|
|
6
|
+
* flow construct), optional config, and optional condition (`when`).
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=pipeline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/interfaces/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -4,7 +4,14 @@
|
|
|
4
4
|
* Plugins allow consumers to attach named RAG stores (with lifecycle scopes)
|
|
5
5
|
* and extend classifier prompts without modifying core agent code.
|
|
6
6
|
*/
|
|
7
|
-
import type {
|
|
7
|
+
import type { IQueryExpander } from '../rag/query-expander.js';
|
|
8
|
+
import type { ILlmApiAdapter } from './api-adapter.js';
|
|
9
|
+
import type { IClientAdapter } from './client-adapter.js';
|
|
10
|
+
import type { IMcpClient } from './mcp-client.js';
|
|
11
|
+
import type { EmbedderFactory, IRag } from './rag.js';
|
|
12
|
+
import type { IReranker } from './reranker.js';
|
|
13
|
+
import type { ISkillManager } from './skill.js';
|
|
14
|
+
import type { IOutputValidator } from './validator.js';
|
|
8
15
|
/**
|
|
9
16
|
* Lifecycle scope of a RAG store provided by a plugin.
|
|
10
17
|
*
|
|
@@ -48,4 +55,77 @@ export interface ISmartAgentPlugin {
|
|
|
48
55
|
*/
|
|
49
56
|
classifierPromptExtension?: string;
|
|
50
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Stage handler interface for pipeline extensibility.
|
|
60
|
+
*
|
|
61
|
+
* Generic over the pipeline context type so that:
|
|
62
|
+
* - Consumers coding against the public contract use `IStageHandler` (default: `unknown`).
|
|
63
|
+
* - llm-agent-libs re-exports `IStageHandler<PipelineContext>` to preserve full
|
|
64
|
+
* concrete typing for internal handlers.
|
|
65
|
+
*/
|
|
66
|
+
export interface IStageHandler<TContext = unknown> {
|
|
67
|
+
execute(ctx: TContext, config: Record<string, unknown>, span: unknown): Promise<boolean>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Shape of a plugin module's named exports.
|
|
71
|
+
* All fields are optional — a plugin can register any subset.
|
|
72
|
+
*/
|
|
73
|
+
export interface PluginExports {
|
|
74
|
+
/** Custom pipeline stage handlers, keyed by stage type name. */
|
|
75
|
+
stageHandlers?: Record<string, IStageHandler>;
|
|
76
|
+
/** Custom embedder factories, keyed by embedder name. */
|
|
77
|
+
embedderFactories?: Record<string, EmbedderFactory>;
|
|
78
|
+
/** Custom RAG reranker (replaces the default). */
|
|
79
|
+
reranker?: IReranker;
|
|
80
|
+
/** Custom query expander (replaces the default). */
|
|
81
|
+
queryExpander?: IQueryExpander;
|
|
82
|
+
/** Custom output validator (replaces the default). */
|
|
83
|
+
outputValidator?: IOutputValidator;
|
|
84
|
+
/** Custom skill manager (replaces the default). */
|
|
85
|
+
skillManager?: ISkillManager;
|
|
86
|
+
/** Pre-built MCP clients (accumulated from all plugins). */
|
|
87
|
+
mcpClients?: IMcpClient[];
|
|
88
|
+
/** Client adapters for auto-detecting prompt-based clients (accumulated). */
|
|
89
|
+
clientAdapters?: IClientAdapter[];
|
|
90
|
+
/** API protocol adapters, keyed by adapter name. */
|
|
91
|
+
apiAdapters?: Record<string, ILlmApiAdapter>;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Result of loading all plugins.
|
|
95
|
+
* Merged registrations from all discovered plugin sources.
|
|
96
|
+
*/
|
|
97
|
+
export interface LoadedPlugins {
|
|
98
|
+
stageHandlers: Map<string, IStageHandler>;
|
|
99
|
+
embedderFactories: Record<string, EmbedderFactory>;
|
|
100
|
+
reranker?: IReranker;
|
|
101
|
+
queryExpander?: IQueryExpander;
|
|
102
|
+
outputValidator?: IOutputValidator;
|
|
103
|
+
skillManager?: ISkillManager;
|
|
104
|
+
mcpClients: IMcpClient[];
|
|
105
|
+
clientAdapters: IClientAdapter[];
|
|
106
|
+
apiAdapters: Map<string, ILlmApiAdapter>;
|
|
107
|
+
/** Source identifiers for successfully loaded plugins. */
|
|
108
|
+
loadedFiles: string[];
|
|
109
|
+
/** Plugins that failed to load, with error messages. */
|
|
110
|
+
errors: Array<{
|
|
111
|
+
file: string;
|
|
112
|
+
error: string;
|
|
113
|
+
}>;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Plugin loader interface.
|
|
117
|
+
*
|
|
118
|
+
* Abstracts how plugins are discovered and loaded. The library ships
|
|
119
|
+
* a default filesystem-based implementation (`FileSystemPluginLoader`).
|
|
120
|
+
* Consumers can provide their own implementation to load plugins from
|
|
121
|
+
* npm packages, remote registries, databases, or any other source.
|
|
122
|
+
*/
|
|
123
|
+
export interface IPluginLoader {
|
|
124
|
+
/**
|
|
125
|
+
* Discover and load plugins.
|
|
126
|
+
*
|
|
127
|
+
* @returns Merged plugin registrations from all discovered sources.
|
|
128
|
+
*/
|
|
129
|
+
load(): Promise<LoadedPlugins>;
|
|
130
|
+
}
|
|
51
131
|
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/interfaces/plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,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C;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAChD;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;OAIG;IACH,IAAI,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reranker.d.ts","sourceRoot":"","sources":["../../src/interfaces/reranker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAE3E,MAAM,WAAW,SAAS;IACxB,MAAM,CACJ,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,SAAS,EAAE,EACpB,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;CAC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reranker.js","sourceRoot":"","sources":["../../src/interfaces/reranker.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/interfaces/session.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,YAAY,IAAI,OAAO,CAAC;IACxB,KAAK,IAAI,IAAI,CAAC;IACd,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.js","sourceRoot":"","sources":["../../src/interfaces/session.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type SpanStatus = 'ok' | 'error';
|
|
2
|
+
export interface SpanOptions {
|
|
3
|
+
parent?: ISpan;
|
|
4
|
+
attributes?: Record<string, string | number | boolean>;
|
|
5
|
+
traceId?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface ISpan {
|
|
8
|
+
readonly name: string;
|
|
9
|
+
setAttribute(key: string, value: string | number | boolean): void;
|
|
10
|
+
addEvent(name: string, attributes?: Record<string, string | number | boolean>): void;
|
|
11
|
+
setStatus(status: SpanStatus, message?: string): void;
|
|
12
|
+
end(): void;
|
|
13
|
+
}
|
|
14
|
+
export interface ITracer {
|
|
15
|
+
startSpan(name: string, options?: SpanOptions): ISpan;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=tracer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracer.d.ts","sourceRoot":"","sources":["../../src/interfaces/tracer.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC;AAExC,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC;IACvD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,KAAK;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAClE,QAAQ,CACN,IAAI,EAAE,MAAM,EACZ,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GACrD,IAAI,CAAC;IACR,SAAS,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtD,GAAG,IAAI,IAAI,CAAC;CACb;AAED,MAAM,WAAW,OAAO;IACtB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,KAAK,CAAC;CACvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tracer.js","sourceRoot":"","sources":["../../src/interfaces/tracer.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Message } from '../types.js';
|
|
2
|
+
import type { CallOptions, LlmTool, Result } from './types.js';
|
|
3
|
+
import { SmartAgentError } from './types.js';
|
|
4
|
+
export interface ValidationResult {
|
|
5
|
+
valid: boolean;
|
|
6
|
+
reason?: string;
|
|
7
|
+
correctedContent?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare class ValidatorError extends SmartAgentError {
|
|
10
|
+
constructor(message: string, code?: string);
|
|
11
|
+
}
|
|
12
|
+
export interface IOutputValidator {
|
|
13
|
+
validate(content: string, context: {
|
|
14
|
+
messages: Message[];
|
|
15
|
+
tools: LlmTool[];
|
|
16
|
+
}, options?: CallOptions): Promise<Result<ValidationResult, ValidatorError>>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=validator.d.ts.map
|