@onecx/integration-interface 6.27.2 → 6.28.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/package.json +3 -3
- package/src/index.d.ts +2 -0
- package/src/index.js +2 -0
- package/src/index.js.map +1 -1
- package/src/lib/gatherers/ai-completion/v1/ai-completion.gatherer.d.ts +28 -0
- package/src/lib/gatherers/ai-completion/v1/ai-completion.gatherer.js +34 -0
- package/src/lib/gatherers/ai-completion/v1/ai-completion.gatherer.js.map +1 -0
- package/src/lib/gatherers/ai-completion/v1/ai-completion.model.d.ts +12 -0
- package/src/lib/gatherers/ai-completion/v1/ai-completion.model.js +3 -0
- package/src/lib/gatherers/ai-completion/v1/ai-completion.model.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onecx/integration-interface",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.28.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"tslib": "^2.6.3",
|
|
11
11
|
"rxjs": "^7.8.1",
|
|
12
|
-
"@onecx/accelerator": "^6.
|
|
13
|
-
"@onecx/nx-migration-utils": "^6.
|
|
12
|
+
"@onecx/accelerator": "^6.28.0",
|
|
13
|
+
"@onecx/nx-migration-utils": "^6.28.0",
|
|
14
14
|
"@nx/devkit": "^20.3.0",
|
|
15
15
|
"@phenomnomnominal/tsquery": "^6",
|
|
16
16
|
"typescript": "^5.5.4"
|
package/src/index.d.ts
CHANGED
|
@@ -43,3 +43,5 @@ export * from './lib/topics/notification/v1/notification.topic';
|
|
|
43
43
|
export * from './lib/services/notification.service';
|
|
44
44
|
export * from './lib/gatherers/ai-context/v1/ai-context.model';
|
|
45
45
|
export * from './lib/gatherers/ai-context/v1/ai-context.gatherer';
|
|
46
|
+
export * from './lib/gatherers/ai-completion/v1/ai-completion.model';
|
|
47
|
+
export * from './lib/gatherers/ai-completion/v1/ai-completion.gatherer';
|
package/src/index.js
CHANGED
|
@@ -46,4 +46,6 @@ tslib_1.__exportStar(require("./lib/topics/notification/v1/notification.topic"),
|
|
|
46
46
|
tslib_1.__exportStar(require("./lib/services/notification.service"), exports);
|
|
47
47
|
tslib_1.__exportStar(require("./lib/gatherers/ai-context/v1/ai-context.model"), exports);
|
|
48
48
|
tslib_1.__exportStar(require("./lib/gatherers/ai-context/v1/ai-context.gatherer"), exports);
|
|
49
|
+
tslib_1.__exportStar(require("./lib/gatherers/ai-completion/v1/ai-completion.model"), exports);
|
|
50
|
+
tslib_1.__exportStar(require("./lib/gatherers/ai-completion/v1/ai-completion.gatherer"), exports);
|
|
49
51
|
//# sourceMappingURL=index.js.map
|
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/integration-interface/src/index.ts"],"names":[],"mappings":";;;AAAA,wFAA6D;AAC7D,qFAA0D;AAC1D,0FAA+D;AAC/D,uFAA4D;AAE5D,0FAA+D;AAE/D,8FAAmE;AAEnE,4FAAiE;AACjE,oFAAyD;AACzD,6FAAkE;AAElE,0FAA+D;AAC/D,0FAA+D;AAE/D,4FAAiE;AAEjE,oGAAyE;AACzE,0GAA+E;AAC/E,4FAAiE;AACjE,wFAA6D;AAC7D,2FAAgE;AAEhE,iGAAsE;AAEtE,gFAAqD;AACrD,gFAAqD;AAErD,mGAAwE;AACxE,yGAA8E;AAC9E,uFAA4D;AAC5D,oGAAyE;AAEzE,wFAA6D;AAE7D,gGAAqE;AACrE,gGAAqE;AAErE,8EAAmD;AACnD,kFAAuD;AACvD,sFAA2D;AAC3D,yFAA8D;AAE9D,kGAAuE;AACvE,kGAAuE;AAEvE,sFAA2D;AAE3D,+FAAoE;AACpE,+FAAoE;AACpE,kFAAuD;AAEvD,2EAAgD;AAChD,2EAAgD;AAChD,sEAA2C;AAE3C,0FAA+D;AAC/D,0FAA+D;AAC/D,8EAAmD;AACnD,yFAA8D;AAC9D,4FAAiE"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/integration-interface/src/index.ts"],"names":[],"mappings":";;;AAAA,wFAA6D;AAC7D,qFAA0D;AAC1D,0FAA+D;AAC/D,uFAA4D;AAE5D,0FAA+D;AAE/D,8FAAmE;AAEnE,4FAAiE;AACjE,oFAAyD;AACzD,6FAAkE;AAElE,0FAA+D;AAC/D,0FAA+D;AAE/D,4FAAiE;AAEjE,oGAAyE;AACzE,0GAA+E;AAC/E,4FAAiE;AACjE,wFAA6D;AAC7D,2FAAgE;AAEhE,iGAAsE;AAEtE,gFAAqD;AACrD,gFAAqD;AAErD,mGAAwE;AACxE,yGAA8E;AAC9E,uFAA4D;AAC5D,oGAAyE;AAEzE,wFAA6D;AAE7D,gGAAqE;AACrE,gGAAqE;AAErE,8EAAmD;AACnD,kFAAuD;AACvD,sFAA2D;AAC3D,yFAA8D;AAE9D,kGAAuE;AACvE,kGAAuE;AAEvE,sFAA2D;AAE3D,+FAAoE;AACpE,+FAAoE;AACpE,kFAAuD;AAEvD,2EAAgD;AAChD,2EAAgD;AAChD,sEAA2C;AAE3C,0FAA+D;AAC/D,0FAA+D;AAC/D,8EAAmD;AACnD,yFAA8D;AAC9D,4FAAiE;AACjE,+FAAoE;AACpE,kGAAuE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Gatherer } from "@onecx/accelerator";
|
|
2
|
+
import type { AiCompletionRequest, AiCompletionResponse } from "./ai-completion.model";
|
|
3
|
+
/**
|
|
4
|
+
* This class acts as a thin communication layer for AI completions between consumers inside
|
|
5
|
+
* onecx-portal-ui-libs and the AI Provider Remote Component. It publishes AI completion requests,
|
|
6
|
+
* collects responses from the registered provider instance and returns them to the caller.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
*
|
|
11
|
+
* // create the gatherer in the provider (remote component) so it can answer completion requests
|
|
12
|
+
* // in ngOnDestroy, call the gatherer.destroy() method to clean up resources
|
|
13
|
+
*
|
|
14
|
+
* const aiCompletionGatherer = new AiCompletionGatherer(async (request) => {
|
|
15
|
+
* // request the AI provider BFF with request.agent / request.message / ...
|
|
16
|
+
* // and return the response: { message: string }
|
|
17
|
+
* // return null if you do not want to contribute to this request
|
|
18
|
+
* return { message: "..." }
|
|
19
|
+
* });
|
|
20
|
+
*
|
|
21
|
+
* // on the consumer side, publish the request and get the responses back:
|
|
22
|
+
* const responses = await aiCompletionGatherer.gather(request)
|
|
23
|
+
* // responses is an array of (AiCompletionResponse | null)
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export declare class AiCompletionGatherer extends Gatherer<AiCompletionRequest, AiCompletionResponse | null> {
|
|
27
|
+
constructor(callback: (request: AiCompletionRequest) => Promise<AiCompletionResponse | null>);
|
|
28
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AiCompletionGatherer = void 0;
|
|
4
|
+
const accelerator_1 = require("@onecx/accelerator");
|
|
5
|
+
/**
|
|
6
|
+
* This class acts as a thin communication layer for AI completions between consumers inside
|
|
7
|
+
* onecx-portal-ui-libs and the AI Provider Remote Component. It publishes AI completion requests,
|
|
8
|
+
* collects responses from the registered provider instance and returns them to the caller.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
*
|
|
13
|
+
* // create the gatherer in the provider (remote component) so it can answer completion requests
|
|
14
|
+
* // in ngOnDestroy, call the gatherer.destroy() method to clean up resources
|
|
15
|
+
*
|
|
16
|
+
* const aiCompletionGatherer = new AiCompletionGatherer(async (request) => {
|
|
17
|
+
* // request the AI provider BFF with request.agent / request.message / ...
|
|
18
|
+
* // and return the response: { message: string }
|
|
19
|
+
* // return null if you do not want to contribute to this request
|
|
20
|
+
* return { message: "..." }
|
|
21
|
+
* });
|
|
22
|
+
*
|
|
23
|
+
* // on the consumer side, publish the request and get the responses back:
|
|
24
|
+
* const responses = await aiCompletionGatherer.gather(request)
|
|
25
|
+
* // responses is an array of (AiCompletionResponse | null)
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
class AiCompletionGatherer extends accelerator_1.Gatherer {
|
|
29
|
+
constructor(callback) {
|
|
30
|
+
super("aiCompletion", 1, callback);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.AiCompletionGatherer = AiCompletionGatherer;
|
|
34
|
+
//# sourceMappingURL=ai-completion.gatherer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-completion.gatherer.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/gatherers/ai-completion/v1/ai-completion.gatherer.ts"],"names":[],"mappings":";;;AAAA,oDAA6C;AAI7C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAa,oBAAqB,SAAQ,sBAA0D;IAChG,YAAY,QAAgF;QACxF,KAAK,CAAC,cAAc,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAA;IACtC,CAAC;CACJ;AAJD,oDAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai-completion.model.js","sourceRoot":"","sources":["../../../../../../../../libs/integration-interface/src/lib/gatherers/ai-completion/v1/ai-completion.model.ts"],"names":[],"mappings":""}
|