@mcp-abap-adt/llm-agent 25.0.0 → 27.0.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/README.md +2 -0
- package/dist/credentials/static.d.ts +9 -0
- package/dist/credentials/static.d.ts.map +1 -0
- package/dist/credentials/static.js +12 -0
- package/dist/credentials/static.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/interfaces/builder.d.ts +11 -1
- package/dist/interfaces/builder.d.ts.map +1 -1
- package/dist/interfaces/collect-server-descriptors.d.ts +12 -0
- package/dist/interfaces/collect-server-descriptors.d.ts.map +1 -0
- package/dist/interfaces/collect-server-descriptors.js +19 -0
- package/dist/interfaces/collect-server-descriptors.js.map +1 -0
- package/dist/interfaces/index.d.ts +3 -2
- package/dist/interfaces/index.d.ts.map +1 -1
- package/dist/interfaces/index.js.map +1 -1
- package/dist/interfaces/mcp-connection-strategy.d.ts +29 -2
- package/dist/interfaces/mcp-connection-strategy.d.ts.map +1 -1
- package/dist/interfaces/mcp-server-from-factory.d.ts +15 -0
- package/dist/interfaces/mcp-server-from-factory.d.ts.map +1 -0
- package/dist/interfaces/mcp-server-from-factory.js +37 -0
- package/dist/interfaces/mcp-server-from-factory.js.map +1 -0
- package/dist/interfaces/mcp-server.d.ts +24 -0
- package/dist/interfaces/mcp-server.d.ts.map +1 -0
- package/dist/interfaces/mcp-server.js +2 -0
- package/dist/interfaces/mcp-server.js.map +1 -0
- package/dist/interfaces/pipeline-plugin.d.ts +16 -6
- package/dist/interfaces/pipeline-plugin.d.ts.map +1 -1
- package/dist/interfaces/plugin.d.ts +11 -3
- package/dist/interfaces/plugin.d.ts.map +1 -1
- package/dist/interfaces/rag.d.ts +133 -23
- package/dist/interfaces/rag.d.ts.map +1 -1
- package/dist/interfaces/rag.js.map +1 -1
- package/dist/interfaces/tool-catalog.d.ts +4 -2
- package/dist/interfaces/tool-catalog.d.ts.map +1 -1
- package/dist/interfaces/tool-catalog.js.map +1 -1
- package/dist/interfaces/types.d.ts +2 -1
- package/dist/interfaces/types.d.ts.map +1 -1
- package/dist/interfaces/types.js.map +1 -1
- package/dist/llm/base-llm-provider.d.ts +29 -4
- package/dist/llm/base-llm-provider.d.ts.map +1 -1
- package/dist/llm/base-llm-provider.js +45 -9
- package/dist/llm/base-llm-provider.js.map +1 -1
- package/dist/logger/normalise-logger.d.ts +28 -0
- package/dist/logger/normalise-logger.d.ts.map +1 -0
- package/dist/logger/normalise-logger.js +50 -0
- package/dist/logger/normalise-logger.js.map +1 -0
- package/dist/logger/text-logger.d.ts +14 -0
- package/dist/logger/text-logger.d.ts.map +1 -0
- package/dist/logger/text-logger.js +2 -0
- package/dist/logger/text-logger.js.map +1 -0
- package/dist/policy/fallback-llm-call-strategy.d.ts +3 -3
- package/dist/policy/fallback-llm-call-strategy.d.ts.map +1 -1
- package/dist/policy/fallback-llm-call-strategy.js +3 -2
- package/dist/policy/fallback-llm-call-strategy.js.map +1 -1
- package/dist/rag/catalog/index.d.ts +2 -0
- package/dist/rag/catalog/index.d.ts.map +1 -0
- package/dist/rag/catalog/index.js +2 -0
- package/dist/rag/catalog/index.js.map +1 -0
- package/dist/rag/catalog/validation.d.ts +56 -0
- package/dist/rag/catalog/validation.d.ts.map +1 -0
- package/dist/rag/catalog/validation.js +168 -0
- package/dist/rag/catalog/validation.js.map +1 -0
- package/dist/rag/corrections/errors.d.ts +69 -0
- package/dist/rag/corrections/errors.d.ts.map +1 -1
- package/dist/rag/corrections/errors.js +98 -0
- package/dist/rag/corrections/errors.js.map +1 -1
- package/dist/rag/identity-filter.d.ts +19 -0
- package/dist/rag/identity-filter.d.ts.map +1 -0
- package/dist/rag/identity-filter.js +31 -0
- package/dist/rag/identity-filter.js.map +1 -0
- package/dist/rag/in-memory-rag.d.ts +3 -1
- package/dist/rag/in-memory-rag.d.ts.map +1 -1
- package/dist/rag/in-memory-rag.js +20 -15
- package/dist/rag/in-memory-rag.js.map +1 -1
- package/dist/rag/index.d.ts +3 -0
- package/dist/rag/index.d.ts.map +1 -1
- package/dist/rag/index.js +2 -0
- package/dist/rag/index.js.map +1 -1
- package/dist/rag/mcp-tools/index.d.ts +1 -1
- package/dist/rag/mcp-tools/index.d.ts.map +1 -1
- package/dist/rag/mcp-tools/index.js.map +1 -1
- package/dist/rag/mcp-tools/rag-collection-tools.d.ts +36 -5
- package/dist/rag/mcp-tools/rag-collection-tools.d.ts.map +1 -1
- package/dist/rag/mcp-tools/rag-collection-tools.js +128 -54
- package/dist/rag/mcp-tools/rag-collection-tools.js.map +1 -1
- package/dist/rag/providers/base-provider.d.ts +8 -6
- package/dist/rag/providers/base-provider.d.ts.map +1 -1
- package/dist/rag/providers/base-provider.js +18 -0
- package/dist/rag/providers/base-provider.js.map +1 -1
- package/dist/rag/providers/in-memory-rag-provider.d.ts +11 -8
- package/dist/rag/providers/in-memory-rag-provider.d.ts.map +1 -1
- package/dist/rag/providers/in-memory-rag-provider.js +13 -5
- package/dist/rag/providers/in-memory-rag-provider.js.map +1 -1
- package/dist/rag/providers/vector-rag-provider.d.ts +11 -8
- package/dist/rag/providers/vector-rag-provider.d.ts.map +1 -1
- package/dist/rag/providers/vector-rag-provider.js +13 -5
- package/dist/rag/providers/vector-rag-provider.js.map +1 -1
- package/dist/rag/registry/index.d.ts +1 -0
- package/dist/rag/registry/index.d.ts.map +1 -1
- package/dist/rag/registry/index.js +1 -0
- package/dist/rag/registry/index.js.map +1 -1
- package/dist/rag/registry/simple-rag-registry.d.ts +90 -15
- package/dist/rag/registry/simple-rag-registry.d.ts.map +1 -1
- package/dist/rag/registry/simple-rag-registry.js +331 -57
- package/dist/rag/registry/simple-rag-registry.js.map +1 -1
- package/dist/rag/registry/store-key.d.ts +15 -0
- package/dist/rag/registry/store-key.d.ts.map +1 -0
- package/dist/rag/registry/store-key.js +25 -0
- package/dist/rag/registry/store-key.js.map +1 -0
- package/dist/rag/search-strategy.d.ts +9 -0
- package/dist/rag/search-strategy.d.ts.map +1 -1
- package/dist/rag/search-strategy.js +49 -22
- package/dist/rag/search-strategy.js.map +1 -1
- package/dist/rag/tokenizer.d.ts +17 -0
- package/dist/rag/tokenizer.d.ts.map +1 -0
- package/dist/rag/tokenizer.js +38 -0
- package/dist/rag/tokenizer.js.map +1 -0
- package/dist/rag/vector-rag.d.ts +2 -2
- package/dist/rag/vector-rag.d.ts.map +1 -1
- package/dist/rag/vector-rag.js +29 -21
- package/dist/rag/vector-rag.js.map +1 -1
- package/dist/resilience/embedder-resilience.d.ts +2 -2
- package/dist/resilience/embedder-resilience.d.ts.map +1 -1
- package/dist/resilience/embedder-resilience.js +3 -1
- package/dist/resilience/embedder-resilience.js.map +1 -1
- package/dist/testing/rag-filter-conformance.d.ts +60 -0
- package/dist/testing/rag-filter-conformance.d.ts.map +1 -0
- package/dist/testing/rag-filter-conformance.js +379 -0
- package/dist/testing/rag-filter-conformance.js.map +1 -0
- package/dist/types.d.ts +11 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -1
- package/dist/interfaces/failure-strategy.d.ts +0 -95
- package/dist/interfaces/failure-strategy.d.ts.map +0 -1
- package/dist/interfaces/failure-strategy.js +0 -96
- package/dist/interfaces/failure-strategy.js.map +0 -1
- package/dist/llm/rate-limit.d.ts +0 -165
- package/dist/llm/rate-limit.d.ts.map +0 -1
- package/dist/llm/rate-limit.js +0 -394
- package/dist/llm/rate-limit.js.map +0 -1
- package/dist/resilience/status.d.ts +0 -29
- package/dist/resilience/status.d.ts.map +0 -1
- package/dist/resilience/status.js +0 -51
- package/dist/resilience/status.js.map +0 -1
package/dist/interfaces/rag.d.ts
CHANGED
|
@@ -14,8 +14,6 @@ export interface IEmbedder {
|
|
|
14
14
|
export interface EmbedderFactoryConfig {
|
|
15
15
|
/** Base URL for the embedding service (Ollama URL, OpenAI base, etc.) */
|
|
16
16
|
url?: string;
|
|
17
|
-
/** API key when required by the embedding provider */
|
|
18
|
-
apiKey?: string;
|
|
19
17
|
/** Embedding model name */
|
|
20
18
|
model?: string;
|
|
21
19
|
/** Per-request timeout in milliseconds */
|
|
@@ -27,6 +25,18 @@ export interface EmbedderFactoryConfig {
|
|
|
27
25
|
*/
|
|
28
26
|
export type EmbedderFactory = (cfg: EmbedderFactoryConfig) => IEmbedder;
|
|
29
27
|
export interface IRag {
|
|
28
|
+
/**
|
|
29
|
+
* Top-`k` records for `embedding`.
|
|
30
|
+
*
|
|
31
|
+
* Identity scope (a security contract, not a hint): when
|
|
32
|
+
* `options.ragFilter.sessionId` is set, return only records whose
|
|
33
|
+
* `metadata.sessionId` equals it; the same for `ragFilter.userId` and
|
|
34
|
+
* `metadata.userId`; both set → both must match. A record without the
|
|
35
|
+
* filtered key is excluded. The filter applies BEFORE top-k, so a scoped
|
|
36
|
+
* query returns up to `k` of its own records. Neither set → no identity
|
|
37
|
+
* filtering. Conformance cases:
|
|
38
|
+
* `@mcp-abap-adt/llm-agent/testing/rag-filter-conformance`.
|
|
39
|
+
*/
|
|
30
40
|
query(embedding: IQueryEmbedding, k: number, options?: CallOptions): Promise<Result<RagResult[], RagError>>;
|
|
31
41
|
healthCheck(options?: CallOptions): Promise<Result<void, RagError>>;
|
|
32
42
|
/** Fetch a single document by its metadata id. Returns null if not found. */
|
|
@@ -87,6 +97,69 @@ export interface IRagBackendWriter {
|
|
|
87
97
|
}>, options?: CallOptions): Promise<Result<void, RagError>>;
|
|
88
98
|
}
|
|
89
99
|
export type RagCollectionScope = 'session' | 'user' | 'global';
|
|
100
|
+
/**
|
|
101
|
+
* What a catalog can store and give back unchanged on every backend: JSON, with
|
|
102
|
+
* finite numbers only. `unknown` admitted cycles, BigInt, functions and class
|
|
103
|
+
* instances, which the three backends cannot round-trip alike. NaN, ±Infinity
|
|
104
|
+
* and a cycle reached through an untyped caller are refused at runtime with
|
|
105
|
+
* RAG_INVALID_ATTRIBUTES (validateRagAttributes), before anything is created.
|
|
106
|
+
*/
|
|
107
|
+
export type RagJsonValue = null | boolean | number | string | readonly RagJsonValue[] | {
|
|
108
|
+
readonly [key: string]: RagJsonValue;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* The scope is required and selects its owner key. One type, used by the record
|
|
112
|
+
* AND by both createCollection contracts, so no layer can hold a user or session
|
|
113
|
+
* collection without its owner (§6.3).
|
|
114
|
+
*/
|
|
115
|
+
export type RagCollectionOwner = {
|
|
116
|
+
readonly scope: 'global';
|
|
117
|
+
} | {
|
|
118
|
+
readonly scope: 'user';
|
|
119
|
+
readonly userId: string;
|
|
120
|
+
} | {
|
|
121
|
+
readonly scope: 'session';
|
|
122
|
+
readonly sessionId: string;
|
|
123
|
+
};
|
|
124
|
+
/** A catalog record. It says whose it is, or it is not a record at all. */
|
|
125
|
+
export type RagCollectionRecord = {
|
|
126
|
+
/** What the PROVIDER knows the store by — the name createCollection was given. */
|
|
127
|
+
readonly storeName: string;
|
|
128
|
+
/** The LOGICAL name a registry registers it under. */
|
|
129
|
+
readonly name: string;
|
|
130
|
+
/** Opaque: persisted and returned exactly as given, never interpreted here. */
|
|
131
|
+
readonly attributes?: RagJsonValue;
|
|
132
|
+
} & RagCollectionOwner;
|
|
133
|
+
/** IRagProvider.createCollection's options. */
|
|
134
|
+
export type RagProviderCreateCollectionOptions = RagCollectionOwner & {
|
|
135
|
+
/** The logical name; `name` is the store name. Absent → the provider records `name`. */
|
|
136
|
+
collectionName?: string;
|
|
137
|
+
attributes?: RagJsonValue;
|
|
138
|
+
/** Take over a store that exists without a record; never create one. */
|
|
139
|
+
adoptExisting?: boolean;
|
|
140
|
+
};
|
|
141
|
+
/** IRagRegistry.createCollection's params. */
|
|
142
|
+
export type RagRegistryCreateCollectionParams = {
|
|
143
|
+
providerName: string;
|
|
144
|
+
/** Logical — passed on to the provider as opts.collectionName. */
|
|
145
|
+
collectionName: string;
|
|
146
|
+
displayName?: string;
|
|
147
|
+
description?: string;
|
|
148
|
+
tags?: readonly string[];
|
|
149
|
+
/** Opaque, passed through unchanged (§9.5). */
|
|
150
|
+
attributes?: RagJsonValue;
|
|
151
|
+
/** Forwarded to the provider unchanged. */
|
|
152
|
+
adoptExisting?: boolean;
|
|
153
|
+
} & RagCollectionOwner;
|
|
154
|
+
/** What IRagProvider.describeCollections reads back. */
|
|
155
|
+
export type RagCatalogDescription = {
|
|
156
|
+
readonly records: readonly RagCollectionRecord[];
|
|
157
|
+
/** Catalog rows that are not valid records — reported, never returned as records. */
|
|
158
|
+
readonly rejected: readonly {
|
|
159
|
+
readonly storeName?: string;
|
|
160
|
+
readonly reason: string;
|
|
161
|
+
}[];
|
|
162
|
+
};
|
|
90
163
|
export interface RagCollectionMeta {
|
|
91
164
|
readonly name: string;
|
|
92
165
|
readonly displayName: string;
|
|
@@ -99,25 +172,50 @@ export interface RagCollectionMeta {
|
|
|
99
172
|
readonly tags?: readonly string[];
|
|
100
173
|
}
|
|
101
174
|
export interface IRagRegistry {
|
|
175
|
+
/**
|
|
176
|
+
* Throws `DuplicateCollectionError` when its scope (default `'global'`)
|
|
177
|
+
* already holds `name`, and `ReservedCollectionNameError` for a global named
|
|
178
|
+
* `user/…` or `session/…`.
|
|
179
|
+
*/
|
|
102
180
|
register(name: string, rag: IRag, editor?: IRagEditor, meta?: Omit<RagCollectionMeta, 'name' | 'editable'>): void;
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
181
|
+
/**
|
|
182
|
+
* Entries are keyed by scope and name (§6.4): a caller may hold a global, a
|
|
183
|
+
* user and a session collection of one name. `scope` selects the entry. When
|
|
184
|
+
* it is omitted the name must be held by exactly one scope; a name several
|
|
185
|
+
* hold fails with AmbiguousCollectionError (RAG_AMBIGUOUS_COLLECTION, naming
|
|
186
|
+
* them in `.scopes`) — thrown by `unregister`, `get` and `getEditor`, whose
|
|
187
|
+
* return values cannot tell "ambiguous" from "absent", and returned by
|
|
188
|
+
* `deleteCollection`.
|
|
189
|
+
*/
|
|
190
|
+
unregister(name: string, scope?: RagCollectionScope): boolean;
|
|
191
|
+
get(name: string, scope?: RagCollectionScope): IRag | undefined;
|
|
192
|
+
getEditor(name: string, scope?: RagCollectionScope): IRagEditor | undefined;
|
|
106
193
|
list(): readonly RagCollectionMeta[];
|
|
107
194
|
/** Create a collection via a provider and register it atomically. */
|
|
108
|
-
createCollection(params:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
195
|
+
createCollection(params: RagRegistryCreateCollectionParams): Promise<Result<RagCollectionMeta, RagError>>;
|
|
196
|
+
/**
|
|
197
|
+
* Register a collection whose store EXISTS, from its catalog record, under its
|
|
198
|
+
* logical name, keeping the store name the record gives (§6.3). Creates
|
|
199
|
+
* nothing and asks no provider for anything. `providerName` is the name the
|
|
200
|
+
* owning provider is registered under in the IRagProviderRegistry: with it,
|
|
201
|
+
* deleting the entry reaches that provider under `record.storeName`; without
|
|
202
|
+
* it the entry is a reference and deleting it only unregisters — so a
|
|
203
|
+
* hydrated collection adopted without it could never be deleted, and would
|
|
204
|
+
* come back at the next hydration. Throws InvalidOwnerError,
|
|
205
|
+
* ReservedCollectionNameError or DuplicateCollectionError. Optional so an
|
|
206
|
+
* external implementation is not broken by gaining a member.
|
|
207
|
+
*/
|
|
208
|
+
adopt?(record: RagCollectionRecord, rag: IRag, editor?: IRagEditor, providerName?: string): void;
|
|
209
|
+
/**
|
|
210
|
+
* Delete a collection: unregister it, then delete its data through the
|
|
211
|
+
* provider that created it. A failure is returned with the collection
|
|
212
|
+
* already unregistered.
|
|
213
|
+
*/
|
|
214
|
+
deleteCollection(name: string, scope?: RagCollectionScope): Promise<Result<void, RagError>>;
|
|
215
|
+
/**
|
|
216
|
+
* Delete every session-scoped collection with the given sessionId, going
|
|
217
|
+
* through all of them even when one fails; the failures come back together.
|
|
218
|
+
*/
|
|
121
219
|
closeSession(sessionId: string): Promise<Result<void, RagError>>;
|
|
122
220
|
}
|
|
123
221
|
export interface IRagProvider {
|
|
@@ -125,16 +223,28 @@ export interface IRagProvider {
|
|
|
125
223
|
readonly kind: string;
|
|
126
224
|
readonly editable: boolean;
|
|
127
225
|
readonly supportedScopes: readonly RagCollectionScope[];
|
|
128
|
-
createCollection(name: string, opts: {
|
|
129
|
-
scope: RagCollectionScope;
|
|
130
|
-
sessionId?: string;
|
|
131
|
-
userId?: string;
|
|
132
|
-
}): Promise<Result<{
|
|
226
|
+
createCollection(name: string, opts: RagProviderCreateCollectionOptions): Promise<Result<{
|
|
133
227
|
rag: IRag;
|
|
134
228
|
editor: IRagEditor;
|
|
135
229
|
}, RagError>>;
|
|
230
|
+
/**
|
|
231
|
+
* Delete a store. A provider with a catalog deletes the record FIRST, then the
|
|
232
|
+
* data; if the record cannot be deleted it stops, leaves both, and fails with
|
|
233
|
+
* CatalogRecordDeleteError.
|
|
234
|
+
*/
|
|
136
235
|
deleteCollection?(name: string): Promise<Result<void, RagError>>;
|
|
137
236
|
listCollections?(): Promise<Result<string[], RagError>>;
|
|
237
|
+
/** The catalog, read back. A provider without one does not declare this. */
|
|
238
|
+
describeCollections?(): Promise<Result<RagCatalogDescription, RagError>>;
|
|
239
|
+
/**
|
|
240
|
+
* Handles for a store that EXISTS. Creates nothing, ensures nothing, writes no
|
|
241
|
+
* catalog record — now or on any later call through the handles: an operation
|
|
242
|
+
* on a store that is gone fails.
|
|
243
|
+
*/
|
|
244
|
+
openCollection?(record: RagCollectionRecord): Promise<Result<{
|
|
245
|
+
rag: IRag;
|
|
246
|
+
editor: IRagEditor;
|
|
247
|
+
}, RagError>>;
|
|
138
248
|
}
|
|
139
249
|
export interface IRagProviderRegistry {
|
|
140
250
|
registerProvider(provider: IRagProvider): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rag.d.ts","sourceRoot":"","sources":["../../src/interfaces/rag.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,e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,EAAE,MAAM,EACZ,IAAI,EAAE,kCAAkC,GACvC,OAAO,CAAC,MAAM,CAAC;QAAE,GAAG,EAAE,IAAI,CAAC;QAAC,MAAM,EAAE,UAAU,CAAA;KAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEhE;;;;OAIG;IACH,gBAAgB,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IACjE,eAAe,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;IAExD,4EAA4E;IAC5E,mBAAmB,CAAC,IAAI,OAAO,CAAC,MAAM,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC,CAAC;IAEzE;;;;OAIG;IACH,cAAc,CAAC,CACb,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,MAAM,CAAC;QAAE,GAAG,EAAE,IAAI,CAAC;QAAC,MAAM,EAAE,UAAU,CAAA;KAAE,EAAE,QAAQ,CAAC,CAAC,CAAC;CACjE;AAED,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAAC;IAC/C,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IACpD,aAAa,IAAI,SAAS,MAAM,EAAE,CAAC;CACpC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rag.js","sourceRoot":"","sources":["../../src/interfaces/rag.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"rag.js","sourceRoot":"","sources":["../../src/interfaces/rag.ts"],"names":[],"mappings":"AAqEA,MAAM,UAAU,eAAe,CAAC,CAAY;IAC1C,OAAO,CACL,YAAY,IAAI,CAAC;QACjB,OAAQ,CAA8B,CAAC,UAAU,KAAK,UAAU,CACjE,CAAC;AACJ,CAAC;AAYD;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAChC,CAAY;IAEZ,MAAM,CAAC,GAAI,CAAgC,CAAC,YAAY,CAAC;IACzD,OAAO,OAAO,CAAC,KAAK,QAAQ,IAAI,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACnE,CAAC"}
|
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
export interface ToolCatalogStatus {
|
|
8
8
|
/** Tools successfully listed across all MCP clients. */
|
|
9
9
|
total: number;
|
|
10
|
-
/**
|
|
10
|
+
/** Distinct tool records written: writes that returned ok: true, counted
|
|
11
|
+
* once per record id (a later write to the same id replaces the earlier). */
|
|
11
12
|
vectorized: number;
|
|
12
|
-
/** Names of tools that failed to be written
|
|
13
|
+
/** Names of tools that failed to be written, or whose record was replaced
|
|
14
|
+
* by a later tool's write to the same id. */
|
|
13
15
|
failed: string[];
|
|
14
16
|
/** Clients whose listTools() failed; their tools never reached `total`. */
|
|
15
17
|
clientFailures: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-catalog.d.ts","sourceRoot":"","sources":["../../src/interfaces/tool-catalog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd
|
|
1
|
+
{"version":3,"file":"tool-catalog.d.ts","sourceRoot":"","sources":["../../src/interfaces/tool-catalog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,KAAK,EAAE,MAAM,CAAC;IACd;kFAC8E;IAC9E,UAAU,EAAE,MAAM,CAAC;IACnB;kDAC8C;IAC9C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,2EAA2E;IAC3E,cAAc,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,+EAA+E;IAC/E,oBAAoB,IAAI,iBAAiB,GAAG,SAAS,CAAC;CACvD;AAED,uDAAuD;AACvD,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,oBAAoB,CAM3E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-catalog.js","sourceRoot":"","sources":["../../src/interfaces/tool-catalog.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tool-catalog.js","sourceRoot":"","sources":["../../src/interfaces/tool-catalog.ts"],"names":[],"mappings":"AAoCA,uDAAuD;AACvD,MAAM,UAAU,qBAAqB,CAAC,CAAU;IAC9C,OAAO,CACL,OAAO,CAAC,KAAK,QAAQ;QACrB,CAAC,KAAK,IAAI;QACV,OAAQ,CAA0B,CAAC,oBAAoB,KAAK,UAAU,CACvE,CAAC;AACJ,CAAC"}
|
|
@@ -34,7 +34,8 @@ export interface CallOptions {
|
|
|
34
34
|
* override can never corrupt their internal structured output (JSON plans,
|
|
35
35
|
* verdicts). Same for temperature / maxTokens / topP / stop. */
|
|
36
36
|
model?: string;
|
|
37
|
-
/** Filter RAG results by namespace or other metadata.
|
|
37
|
+
/** Filter RAG results by namespace or other metadata. Every `IRag` store
|
|
38
|
+
* honours `sessionId` and `userId` as an identity scope (see `IRag.query`). */
|
|
38
39
|
ragFilter?: {
|
|
39
40
|
namespace?: string;
|
|
40
41
|
userId?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/interfaces/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAMhD,MAAM,MAAM,MAAM,CAAC,CAAC,EAAE,CAAC,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qDAAqD;IACrD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,WAAW,CAAC;IACtB,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;CACf;AAMD,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,SAAS,CAAC;IAClB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,KAAK,EAAE,OAAO,EAAE,CAAC;IACjB,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,WAAW,EAAE;QACX,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAMD,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAMD,MAAM,WAAW,WAAW;IAC1B,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/interfaces/types.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/interfaces/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAqGH,8EAA8E;AAC9E,eAAe;AACf,8EAA8E;AAE9E,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAGtB;IAFlB,YACE,OAAe,EACC,IAAY;QAE5B,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,SAAI,GAAJ,IAAI,CAA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,eAAe;IACjD,YAAY,OAAe,EAAE,IAAI,GAAG,iBAAiB;QACnD,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,gBAAgB,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,OAAO,UAAW,SAAQ,eAAe;IAC7C,YAAY,OAAe,EAAE,IAAI,GAAG,aAAa;QAC/C,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -26,10 +26,6 @@ export declare abstract class BaseLLMProvider<C extends LLMProviderConfig = LLMP
|
|
|
26
26
|
constructor(config: C);
|
|
27
27
|
abstract chat(messages: Message[], tools?: unknown[], options?: LLMCallOptions): Promise<LLMResponse>;
|
|
28
28
|
abstract streamChat(messages: Message[], tools?: unknown[], options?: LLMCallOptions): AsyncIterable<LLMResponse>;
|
|
29
|
-
/**
|
|
30
|
-
* Validate configuration
|
|
31
|
-
*/
|
|
32
|
-
protected validateConfig(): void;
|
|
33
29
|
/**
|
|
34
30
|
* Which account and endpoint this call bills to.
|
|
35
31
|
*
|
|
@@ -44,6 +40,35 @@ export declare abstract class BaseLLMProvider<C extends LLMProviderConfig = LLMP
|
|
|
44
40
|
* (organization, project, resource group) — never the raw secret.
|
|
45
41
|
*/
|
|
46
42
|
protected quotaScope(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Which account this call's quota belongs to.
|
|
45
|
+
*
|
|
46
|
+
* A rate limit is per account, so two callers holding different credentials
|
|
47
|
+
* against one endpoint must not share a 429 gate — one of them getting limited
|
|
48
|
+
* would otherwise throttle the other. That dimension used to come from a
|
|
49
|
+
* fingerprint of the configured `apiKey`; the base no longer carries one, and
|
|
50
|
+
* a secret was the wrong thing to derive a cache key from in the first place.
|
|
51
|
+
*
|
|
52
|
+
* It comes from the credential **object's identity** instead: an opaque id
|
|
53
|
+
* assigned on first sight and remembered for as long as the object lives. That
|
|
54
|
+
* needs no secret and stays synchronous, which `quotaKey` requires.
|
|
55
|
+
*
|
|
56
|
+
* Two providers that wrap the same key in two separate credential objects get
|
|
57
|
+
* two buckets where they used to share one. That is the safe direction: the
|
|
58
|
+
* failure worth preventing is two *different* accounts sharing a gate. A
|
|
59
|
+
* consumer that means them to share sets `quotaScope` on the provider's config.
|
|
60
|
+
*/
|
|
61
|
+
protected credentialScope(): string;
|
|
62
|
+
/**
|
|
63
|
+
* The credential this provider authenticates with, when it has one.
|
|
64
|
+
*
|
|
65
|
+
* `LLMProviderConfig` declares none — each provider declares its own, typed for
|
|
66
|
+
* what its target speaks — so a provider overrides this to take part in
|
|
67
|
+
* per-account quota isolation. The object is never read for its secret here.
|
|
68
|
+
*/
|
|
69
|
+
protected quotaCredential(): object | undefined;
|
|
70
|
+
private static readonly credentialIds;
|
|
71
|
+
private static nextCredentialId;
|
|
47
72
|
/**
|
|
48
73
|
* Reduce spellings of one endpoint to one key.
|
|
49
74
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-llm-provider.d.ts","sourceRoot":"","sources":["../../src/llm/base-llm-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,OAAO,EACR,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,eAAe,CAAC;AAEvB,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,CACF,QAAQ,EAAE,OAAO,EAAE,EACnB,KAAK,CAAC,EAAE,OAAO,EAAE,EACjB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,WAAW,CAAC,CAAC;IAExB;;OAEG;IACH,UAAU,CACR,QAAQ,EAAE,OAAO,EAAE,EACnB,KAAK,CAAC,EAAE,OAAO,EAAE,EACjB,OAAO,CAAC,EAAE,cAAc,GACvB,aAAa,CAAC,WAAW,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AAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM;IAM1C,8DAA8D;IAC9D,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;IAI9C;;;;;;;;;;;;;OAaG;IACH,SAAS,CAAC,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAiB/D;;;;;OAKG;IACH,SAAS,CAAC,iBAAiB,CAAC,CAAC,SAAS,KAAK,EACzC,QAAQ,EAAE,OAAO,EACjB,OAAO,EAAE,CAAC,GACT,CAAC;IAIJ,mDAAmD;IACnD,SAAS,CAAC,iBAAiB,CAAC,CAAC,EAC3B,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,KAAK,CAAC,EAAE;QACN,+EAA+E;QAC/E,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,OAAO,CAAC,EAAE,oBAAoB,CAAC,SAAS,CAAC,CAAC;KAC3C,GACA,OAAO,CAAC,CAAC,CAAC;CAUd"}
|
|
@@ -8,14 +8,6 @@ export class BaseLLMProvider {
|
|
|
8
8
|
constructor(config) {
|
|
9
9
|
this.config = config;
|
|
10
10
|
}
|
|
11
|
-
/**
|
|
12
|
-
* Validate configuration
|
|
13
|
-
*/
|
|
14
|
-
validateConfig() {
|
|
15
|
-
if (!this.config.apiKey) {
|
|
16
|
-
throw new Error('API key is required');
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
11
|
// --- Rate limiting (issue #282) -----------------------------------------
|
|
20
12
|
//
|
|
21
13
|
// The policy is shared (see `rate-limit.ts`); a provider supplies only the
|
|
@@ -39,9 +31,53 @@ export class BaseLLMProvider {
|
|
|
39
31
|
quotaScope() {
|
|
40
32
|
return [
|
|
41
33
|
this.canonicalEndpoint(this.quotaEndpoint()),
|
|
42
|
-
|
|
34
|
+
// A consumer's explicit scope wins, so two providers can be made to share a
|
|
35
|
+
// gate on purpose; otherwise the credential object's identity separates them.
|
|
36
|
+
this.config.quotaScope ?? this.credentialScope(),
|
|
43
37
|
].join('|');
|
|
44
38
|
}
|
|
39
|
+
/**
|
|
40
|
+
* Which account this call's quota belongs to.
|
|
41
|
+
*
|
|
42
|
+
* A rate limit is per account, so two callers holding different credentials
|
|
43
|
+
* against one endpoint must not share a 429 gate — one of them getting limited
|
|
44
|
+
* would otherwise throttle the other. That dimension used to come from a
|
|
45
|
+
* fingerprint of the configured `apiKey`; the base no longer carries one, and
|
|
46
|
+
* a secret was the wrong thing to derive a cache key from in the first place.
|
|
47
|
+
*
|
|
48
|
+
* It comes from the credential **object's identity** instead: an opaque id
|
|
49
|
+
* assigned on first sight and remembered for as long as the object lives. That
|
|
50
|
+
* needs no secret and stays synchronous, which `quotaKey` requires.
|
|
51
|
+
*
|
|
52
|
+
* Two providers that wrap the same key in two separate credential objects get
|
|
53
|
+
* two buckets where they used to share one. That is the safe direction: the
|
|
54
|
+
* failure worth preventing is two *different* accounts sharing a gate. A
|
|
55
|
+
* consumer that means them to share sets `quotaScope` on the provider's config.
|
|
56
|
+
*/
|
|
57
|
+
credentialScope() {
|
|
58
|
+
const credential = this.quotaCredential();
|
|
59
|
+
if (!credential)
|
|
60
|
+
return 'anonymous';
|
|
61
|
+
let id = BaseLLMProvider.credentialIds.get(credential);
|
|
62
|
+
if (id === undefined) {
|
|
63
|
+
BaseLLMProvider.nextCredentialId += 1;
|
|
64
|
+
id = `c${BaseLLMProvider.nextCredentialId}`;
|
|
65
|
+
BaseLLMProvider.credentialIds.set(credential, id);
|
|
66
|
+
}
|
|
67
|
+
return id;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* The credential this provider authenticates with, when it has one.
|
|
71
|
+
*
|
|
72
|
+
* `LLMProviderConfig` declares none — each provider declares its own, typed for
|
|
73
|
+
* what its target speaks — so a provider overrides this to take part in
|
|
74
|
+
* per-account quota isolation. The object is never read for its secret here.
|
|
75
|
+
*/
|
|
76
|
+
quotaCredential() {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
static credentialIds = new WeakMap();
|
|
80
|
+
static nextCredentialId = 0;
|
|
45
81
|
/**
|
|
46
82
|
* Reduce spellings of one endpoint to one key.
|
|
47
83
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-llm-provider.js","sourceRoot":"","sources":["../../src/llm/base-llm-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAQzC,OAAO,EACL,iBAAiB,EACjB,oBAAoB,GAErB,MAAM,eAAe,CAAC;AAgCvB,MAAM,OAAgB,eAAe;IAI1B,MAAM,CAAI;IAEnB,YAAY,MAAS;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAcD
|
|
1
|
+
{"version":3,"file":"base-llm-provider.js","sourceRoot":"","sources":["../../src/llm/base-llm-provider.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAQzC,OAAO,EACL,iBAAiB,EACjB,oBAAoB,GAErB,MAAM,eAAe,CAAC;AAgCvB,MAAM,OAAgB,eAAe;IAI1B,MAAM,CAAI;IAEnB,YAAY,MAAS;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAcD,2EAA2E;IAC3E,EAAE;IACF,2EAA2E;IAC3E,2EAA2E;IAC3E,6EAA6E;IAC7E,4EAA4E;IAC5E,uEAAuE;IAEvE;;;;;;;;;;;;OAYG;IACO,UAAU;QAClB,OAAO;YACL,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;YAC5C,4EAA4E;YAC5E,8EAA8E;YAC9E,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,IAAI,CAAC,eAAe,EAAE;SACjD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACd,CAAC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,SAAS,QAAQ,CAAC,KAAc,EAAE,IAAY;IAC5C,MAAM,OAAO,GAAI,KAA8C,EAAE,QAAQ;QACvE,EAAE,OAAO,CAAC;IACZ,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,SAAS,CAAC;IAC9D,yDAAyD;IACzD,MAAM,GAAG,GAAI,OAA4C,CAAC,GAAG,CAAC;IAC9D,IAAI,OAAO,GAAG,KAAK,UAAU,EAAE,CAAC;QAC9B,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QAClC,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC/D,CAAC;IACD,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAkC,CAAC,EAAE,CAAC;QACxE,IAAI,CAAC,CAAC,WAAW,EAAE,KAAK,IAAI;YAC1B,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IACjE,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ITextLogger } from './text-logger.js';
|
|
2
|
+
import type { ILogger } from './types.js';
|
|
3
|
+
/** Either logger a consumer may hand to an input seam. */
|
|
4
|
+
export type AnyLogger = ILogger | ITextLogger;
|
|
5
|
+
/**
|
|
6
|
+
* An event logger has a callable `log`; a text logger does not.
|
|
7
|
+
*
|
|
8
|
+
* **Precedence is deliberate, and it is part of the contract.** Structural
|
|
9
|
+
* typing lets one object satisfy BOTH shapes — a text logger that also exposes
|
|
10
|
+
* `log`. Such an object is treated as an EVENT logger and returned unchanged.
|
|
11
|
+
* That keeps every logger that works today working exactly as it does today,
|
|
12
|
+
* which is this release's binding constraint; deciding the other way would
|
|
13
|
+
* silently re-route an existing consumer's events through the level mapping.
|
|
14
|
+
* A consumer who wants the text path for a hybrid object passes only its text
|
|
15
|
+
* methods, or wraps it.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isTextLogger(logger: AnyLogger): logger is ITextLogger;
|
|
18
|
+
/**
|
|
19
|
+
* Normalise whatever a consumer passed into the event logger the internals
|
|
20
|
+
* already speak. An `ILogger` is returned unchanged — the existing path does
|
|
21
|
+
* not move — and an `ITextLogger` is wrapped.
|
|
22
|
+
*
|
|
23
|
+
* The event's `type` is the message (a `warning` carries its own), and the
|
|
24
|
+
* whole event travels as `meta`: a structured event fits inside `meta`, while
|
|
25
|
+
* a closed union could never carry arbitrary text.
|
|
26
|
+
*/
|
|
27
|
+
export declare function normaliseLogger(logger: AnyLogger): ILogger;
|
|
28
|
+
//# sourceMappingURL=normalise-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalise-logger.d.ts","sourceRoot":"","sources":["../../src/logger/normalise-logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,OAAO,EAAY,MAAM,YAAY,CAAC;AAEpD,0DAA0D;AAC1D,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,WAAW,CAAC;AAE9C;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,IAAI,WAAW,CAErE;AAWD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAY1D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An event logger has a callable `log`; a text logger does not.
|
|
3
|
+
*
|
|
4
|
+
* **Precedence is deliberate, and it is part of the contract.** Structural
|
|
5
|
+
* typing lets one object satisfy BOTH shapes — a text logger that also exposes
|
|
6
|
+
* `log`. Such an object is treated as an EVENT logger and returned unchanged.
|
|
7
|
+
* That keeps every logger that works today working exactly as it does today,
|
|
8
|
+
* which is this release's binding constraint; deciding the other way would
|
|
9
|
+
* silently re-route an existing consumer's events through the level mapping.
|
|
10
|
+
* A consumer who wants the text path for a hybrid object passes only its text
|
|
11
|
+
* methods, or wraps it.
|
|
12
|
+
*/
|
|
13
|
+
export function isTextLogger(logger) {
|
|
14
|
+
return typeof logger.log !== 'function';
|
|
15
|
+
}
|
|
16
|
+
/** Levels per §7: only these three sets differ from `info`. */
|
|
17
|
+
const ERROR_EVENTS = new Set(['pipeline_error']);
|
|
18
|
+
const WARN_EVENTS = new Set(['warning']);
|
|
19
|
+
const DEBUG_EVENTS = new Set([
|
|
20
|
+
'rag_upsert',
|
|
21
|
+
'rag_query',
|
|
22
|
+
'tools_selected',
|
|
23
|
+
]);
|
|
24
|
+
/**
|
|
25
|
+
* Normalise whatever a consumer passed into the event logger the internals
|
|
26
|
+
* already speak. An `ILogger` is returned unchanged — the existing path does
|
|
27
|
+
* not move — and an `ITextLogger` is wrapped.
|
|
28
|
+
*
|
|
29
|
+
* The event's `type` is the message (a `warning` carries its own), and the
|
|
30
|
+
* whole event travels as `meta`: a structured event fits inside `meta`, while
|
|
31
|
+
* a closed union could never carry arbitrary text.
|
|
32
|
+
*/
|
|
33
|
+
export function normaliseLogger(logger) {
|
|
34
|
+
if (!isTextLogger(logger))
|
|
35
|
+
return logger;
|
|
36
|
+
return {
|
|
37
|
+
log(event) {
|
|
38
|
+
const message = event.type === 'warning' ? event.message : event.type;
|
|
39
|
+
if (ERROR_EVENTS.has(event.type))
|
|
40
|
+
logger.error(message, event);
|
|
41
|
+
else if (WARN_EVENTS.has(event.type))
|
|
42
|
+
logger.warn(message, event);
|
|
43
|
+
else if (DEBUG_EVENTS.has(event.type))
|
|
44
|
+
logger.debug(message, event);
|
|
45
|
+
else
|
|
46
|
+
logger.info(message, event);
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=normalise-logger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalise-logger.js","sourceRoot":"","sources":["../../src/logger/normalise-logger.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,MAAiB;IAC5C,OAAO,OAAQ,MAAkB,CAAC,GAAG,KAAK,UAAU,CAAC;AACvD,CAAC;AAED,+DAA+D;AAC/D,MAAM,YAAY,GAAG,IAAI,GAAG,CAAmB,CAAC,gBAAgB,CAAC,CAAC,CAAC;AACnE,MAAM,WAAW,GAAG,IAAI,GAAG,CAAmB,CAAC,SAAS,CAAC,CAAC,CAAC;AAC3D,MAAM,YAAY,GAAG,IAAI,GAAG,CAAmB;IAC7C,YAAY;IACZ,WAAW;IACX,gBAAgB;CACjB,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,MAAiB;IAC/C,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IAEzC,OAAO;QACL,GAAG,CAAC,KAAe;YACjB,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;YACtE,IAAI,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;gBAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;iBAC1D,IAAI,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;gBAAE,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;iBAC7D,IAAI,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;gBAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;;gBAC/D,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;QACnC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ILogger as InterfacesUtilsLogger } from '@mcp-abap-adt/interfaces-utils';
|
|
2
|
+
/**
|
|
3
|
+
* The ordinary text logger: `info`/`error`/`warn`/`debug(message, meta?)`.
|
|
4
|
+
*
|
|
5
|
+
* This is `@mcp-abap-adt/interfaces-utils`' `ILogger`, re-exported under a
|
|
6
|
+
* second name because llm-agent's own exported `ILogger` — the event one —
|
|
7
|
+
* cannot move: `IPipelineContext.logger` and `IPipelinePlugin` hand it OUT to
|
|
8
|
+
* consumer plugins, so changing that name's shape would break every plugin.
|
|
9
|
+
*
|
|
10
|
+
* Two names for one job is the acknowledged cost of not breaking anyone in
|
|
11
|
+
* this release; converging on one is a rename, and a rename is a major.
|
|
12
|
+
*/
|
|
13
|
+
export type ITextLogger = InterfacesUtilsLogger;
|
|
14
|
+
//# sourceMappingURL=text-logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-logger.d.ts","sourceRoot":"","sources":["../../src/logger/text-logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvF;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GAAG,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"text-logger.js","sourceRoot":"","sources":["../../src/logger/text-logger.ts"],"names":[],"mappings":""}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import type { CallOptions, ILlm, ILlmCallStrategy, LlmError, LlmStreamChunk, LlmTool, Message, Result } from '@mcp-abap-adt/llm-agent';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AnyLogger } from '../logger/normalise-logger.js';
|
|
3
3
|
/**
|
|
4
4
|
* Starts with streaming. On error, logs the cause and retries the same call
|
|
5
5
|
* via non-streaming. All subsequent calls use non-streaming for this instance.
|
|
6
6
|
*/
|
|
7
7
|
export declare class FallbackLlmCallStrategy implements ILlmCallStrategy {
|
|
8
|
-
private readonly logger?;
|
|
9
8
|
private streamingDisabled;
|
|
10
9
|
private readonly streaming;
|
|
11
10
|
private readonly nonStreaming;
|
|
12
|
-
|
|
11
|
+
private readonly logger?;
|
|
12
|
+
constructor(logger?: AnyLogger);
|
|
13
13
|
call(llm: ILlm, messages: Message[], tools: LlmTool[], options?: CallOptions): AsyncIterable<Result<LlmStreamChunk, LlmError>>;
|
|
14
14
|
private logFallback;
|
|
15
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fallback-llm-call-strategy.d.ts","sourceRoot":"","sources":["../../src/policy/fallback-llm-call-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,IAAI,EACJ,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,OAAO,EACP,OAAO,EACP,MAAM,EACP,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"fallback-llm-call-strategy.d.ts","sourceRoot":"","sources":["../../src/policy/fallback-llm-call-strategy.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,IAAI,EACJ,gBAAgB,EAChB,QAAQ,EACR,cAAc,EACd,OAAO,EACP,OAAO,EACP,MAAM,EACP,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAM/D;;;GAGG;AACH,qBAAa,uBAAwB,YAAW,gBAAgB;IAC9D,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkC;IAC5D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAqC;IAClE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAU;gBAEtB,MAAM,CAAC,EAAE,SAAS;IAIvB,IAAI,CACT,GAAG,EAAE,IAAI,EACT,QAAQ,EAAE,OAAO,EAAE,EACnB,KAAK,EAAE,OAAO,EAAE,EAChB,OAAO,CAAC,EAAE,WAAW,GACpB,aAAa,CAAC,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC;IA4ClD,OAAO,CAAC,WAAW;CAcpB"}
|