@vxnus/siduri 2.0.22 → 2.0.23
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/generator.js +3 -1
- package/dist/generator.test.js +9 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +7 -7
package/dist/generator.js
CHANGED
|
@@ -76,7 +76,7 @@ function generateInstanceFiles(options) {
|
|
|
76
76
|
const companionSlug = instanceName.toLowerCase().replace(/[^a-z0-9_-]/g, '') || 'default';
|
|
77
77
|
const instanceId = options.id || 'default';
|
|
78
78
|
const coreVersion = options.coreVersion || '^2.0.7';
|
|
79
|
-
const cliVersion = options.cliVersion || '^2.0.
|
|
79
|
+
const cliVersion = options.cliVersion || '^2.0.23';
|
|
80
80
|
const manifests = options.selectedManifests;
|
|
81
81
|
const hasMemory = manifests.some((m) => m.organType === 'memory');
|
|
82
82
|
const hasVoice = manifests.some((m) => m.organType === 'voice');
|
|
@@ -445,6 +445,7 @@ function generateInstanceFiles(options) {
|
|
|
445
445
|
` req.on('data', (chunk) => { body += chunk; });`,
|
|
446
446
|
` req.on('end', async () => {`,
|
|
447
447
|
` try {`,
|
|
448
|
+
` const payload = JSON.parse(body || '{}');`,
|
|
448
449
|
` const chatContext = payload.context ? { ...payload.context, ...(payload.mode ? { mode: payload.mode } : {}) } : (payload.mode ? { mode: payload.mode } : undefined);`,
|
|
449
450
|
` const response = await dispatchCompanionChat(runtime, {`,
|
|
450
451
|
` id: config.id,`,
|
|
@@ -487,6 +488,7 @@ function generateInstanceFiles(options) {
|
|
|
487
488
|
` res.on('close', onClose);`,
|
|
488
489
|
'',
|
|
489
490
|
` try {`,
|
|
491
|
+
` const payload = JSON.parse(body || '{}');`,
|
|
490
492
|
` const chatContext = payload.context ? { ...payload.context, ...(payload.mode ? { mode: payload.mode } : {}) } : (payload.mode ? { mode: payload.mode } : undefined);`,
|
|
491
493
|
` const response = await dispatchCompanionChat(runtime, {`,
|
|
492
494
|
` id: config.id,`,
|
package/dist/generator.test.js
CHANGED
|
@@ -195,5 +195,14 @@ describe('Instance Generator Composition Invariants (Phase 3)', () => {
|
|
|
195
195
|
expect(srcIndexJs).toContain('relative.startsWith(\'..\')');
|
|
196
196
|
expect(srcIndexJs).toContain('path.isAbsolute(relative)');
|
|
197
197
|
expect(srcIndexJs).toContain('decodeURIComponent');
|
|
198
|
+
// 4. Chat endpoints define payload before accessing payload.context
|
|
199
|
+
const chatEndpointIndex = srcIndexJs.indexOf("pathname === '/chat'");
|
|
200
|
+
const chatStreamEndpointIndex = srcIndexJs.indexOf("pathname === '/chat/stream'");
|
|
201
|
+
expect(chatEndpointIndex).toBeGreaterThan(-1);
|
|
202
|
+
expect(chatStreamEndpointIndex).toBeGreaterThan(-1);
|
|
203
|
+
const chatSlice = srcIndexJs.slice(chatEndpointIndex, chatStreamEndpointIndex);
|
|
204
|
+
const chatStreamSlice = srcIndexJs.slice(chatStreamEndpointIndex, chatStreamEndpointIndex + 1500);
|
|
205
|
+
expect(chatSlice).toContain("const payload = JSON.parse(body || '{}');");
|
|
206
|
+
expect(chatStreamSlice).toContain("const payload = JSON.parse(body || '{}');");
|
|
198
207
|
});
|
|
199
208
|
});
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ const doctor_1 = require("./doctor");
|
|
|
26
26
|
const db_1 = require("./db");
|
|
27
27
|
const configurators_1 = require("./configurators");
|
|
28
28
|
const execFile = (0, node_util_1.promisify)(node_child_process_1.execFile);
|
|
29
|
-
exports.CLI_VERSION = '2.0.
|
|
29
|
+
exports.CLI_VERSION = '2.0.23';
|
|
30
30
|
const colors_1 = require("./colors");
|
|
31
31
|
Object.defineProperty(exports, "colors", { enumerable: true, get: function () { return colors_1.colors; } });
|
|
32
32
|
function printHeader() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vxnus/siduri",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.23",
|
|
4
4
|
"description": "Experimental CLI for installing and configuring Siduri companions",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -23,6 +23,11 @@
|
|
|
23
23
|
"siduri": "./dist/index.js"
|
|
24
24
|
},
|
|
25
25
|
"main": "dist/index.js",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc && node ./scripts/copy-web-dist.cjs",
|
|
28
|
+
"dev": "tsc -w",
|
|
29
|
+
"test": "jest --config jest.config.json"
|
|
30
|
+
},
|
|
26
31
|
"dependencies": {
|
|
27
32
|
"@vxnus/e": "^0.1.5",
|
|
28
33
|
"@vxnus/e-knowledge": "^0.1.5",
|
|
@@ -35,10 +40,5 @@
|
|
|
35
40
|
"ts-jest": "^29.4.12",
|
|
36
41
|
"typescript": "^5.9.3",
|
|
37
42
|
"@types/inquirer": "^9.0.10"
|
|
38
|
-
},
|
|
39
|
-
"scripts": {
|
|
40
|
-
"build": "tsc && node ./scripts/copy-web-dist.cjs",
|
|
41
|
-
"dev": "tsc -w",
|
|
42
|
-
"test": "jest --config jest.config.json"
|
|
43
43
|
}
|
|
44
|
-
}
|
|
44
|
+
}
|