@kapeta/local-cluster-service 0.71.6 → 0.72.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/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# [0.72.0](https://github.com/kapetacom/local-cluster-service/compare/v0.71.6...v0.72.0) (2024-09-24)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* Add redirect endpoint for opening conversation ([#258](https://github.com/kapetacom/local-cluster-service/issues/258)) ([2b400ac](https://github.com/kapetacom/local-cluster-service/commit/2b400ac0066813a9e18c105628743650646c83c6))
|
7
|
+
|
1
8
|
## [0.71.6](https://github.com/kapetacom/local-cluster-service/compare/v0.71.5...v0.71.6) (2024-09-19)
|
2
9
|
|
3
10
|
|
@@ -25,6 +25,7 @@ const UIServer_1 = require("./UIServer");
|
|
25
25
|
const crypto_1 = require("crypto");
|
26
26
|
const PageGenerator_1 = require("./PageGenerator");
|
27
27
|
const utils_1 = require("./utils");
|
28
|
+
const utils_2 = require("../utils/utils");
|
28
29
|
const UI_SERVERS = {};
|
29
30
|
const router = (0, express_promise_router_1.default)();
|
30
31
|
router.use('/', cors_1.corsHandler);
|
@@ -544,6 +545,12 @@ router.post('/ui/get-vote', async (req, res) => {
|
|
544
545
|
router.post('/:handle/all', async (req, res) => {
|
545
546
|
await handleAll(req, res);
|
546
547
|
});
|
548
|
+
router.get('/conversations/:agentName/:systemId/redirect', async (req, res) => {
|
549
|
+
const aiService = (0, utils_2.getRemoteUrl)('ai-service', 'https://ai.kapeta.com');
|
550
|
+
const agentName = req.params.agentName;
|
551
|
+
const systemId = req.params.systemId;
|
552
|
+
res.redirect(aiService + `/v2/conversations/${encodeURIComponent(agentName)}/${encodeURIComponent(systemId)}`);
|
553
|
+
});
|
547
554
|
async function handleAll(req, res) {
|
548
555
|
const handle = req.params.handle;
|
549
556
|
const systemId = req.query.systemId ?? undefined;
|
@@ -25,6 +25,7 @@ const UIServer_1 = require("./UIServer");
|
|
25
25
|
const crypto_1 = require("crypto");
|
26
26
|
const PageGenerator_1 = require("./PageGenerator");
|
27
27
|
const utils_1 = require("./utils");
|
28
|
+
const utils_2 = require("../utils/utils");
|
28
29
|
const UI_SERVERS = {};
|
29
30
|
const router = (0, express_promise_router_1.default)();
|
30
31
|
router.use('/', cors_1.corsHandler);
|
@@ -544,6 +545,12 @@ router.post('/ui/get-vote', async (req, res) => {
|
|
544
545
|
router.post('/:handle/all', async (req, res) => {
|
545
546
|
await handleAll(req, res);
|
546
547
|
});
|
548
|
+
router.get('/conversations/:agentName/:systemId/redirect', async (req, res) => {
|
549
|
+
const aiService = (0, utils_2.getRemoteUrl)('ai-service', 'https://ai.kapeta.com');
|
550
|
+
const agentName = req.params.agentName;
|
551
|
+
const systemId = req.params.systemId;
|
552
|
+
res.redirect(aiService + `/v2/conversations/${encodeURIComponent(agentName)}/${encodeURIComponent(systemId)}`);
|
553
|
+
});
|
547
554
|
async function handleAll(req, res) {
|
548
555
|
const handle = req.params.handle;
|
549
556
|
const systemId = req.query.systemId ?? undefined;
|
package/package.json
CHANGED
package/src/storm/routes.ts
CHANGED
@@ -51,6 +51,7 @@ import { UIServer } from './UIServer';
|
|
51
51
|
import { randomUUID } from 'crypto';
|
52
52
|
import { PageQueue } from './PageGenerator';
|
53
53
|
import { copyDirectory, createFuture, readFilesAndContent } from './utils';
|
54
|
+
import { getRemoteUrl } from '../utils/utils';
|
54
55
|
|
55
56
|
const UI_SERVERS: { [key: string]: UIServer } = {};
|
56
57
|
const router = Router();
|
@@ -679,6 +680,14 @@ router.post('/:handle/all', async (req: KapetaBodyRequest, res: Response) => {
|
|
679
680
|
await handleAll(req, res);
|
680
681
|
});
|
681
682
|
|
683
|
+
router.get('/conversations/:agentName/:systemId/redirect', async (req: KapetaBodyRequest, res: Response) => {
|
684
|
+
const aiService = getRemoteUrl('ai-service', 'https://ai.kapeta.com');
|
685
|
+
const agentName = req.params.agentName as string;
|
686
|
+
const systemId = req.params.systemId as string;
|
687
|
+
|
688
|
+
res.redirect(aiService + `/v2/conversations/${encodeURIComponent(agentName)}/${encodeURIComponent(systemId)}`);
|
689
|
+
});
|
690
|
+
|
682
691
|
async function handleAll(req: KapetaBodyRequest, res: Response) {
|
683
692
|
const handle = req.params.handle as string;
|
684
693
|
const systemId = (req.query.systemId as string) ?? undefined;
|