@vxnus/siduri 2.0.22 → 2.0.24

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.
@@ -135,7 +135,7 @@ exports.BUILTIN_ORGAN_MANIFESTS = [
135
135
  {
136
136
  name: '@siduri-x/ear',
137
137
  organType: 'ear',
138
- version: '2.0.1',
138
+ version: '2.0.2',
139
139
  displayName: 'Ear (Perception Ingress)',
140
140
  description: 'Multi-modal sensory input ingestion, transcription bounds, and mime validation',
141
141
  entrypoint: './dist/index.js',
package/dist/generator.js CHANGED
@@ -75,8 +75,8 @@ function generateInstanceFiles(options) {
75
75
  const instanceName = options.name || 'my-siduri';
76
76
  const companionSlug = instanceName.toLowerCase().replace(/[^a-z0-9_-]/g, '') || 'default';
77
77
  const instanceId = options.id || 'default';
78
- const coreVersion = options.coreVersion || '^2.0.7';
79
- const cliVersion = options.cliVersion || '^2.0.22';
78
+ const coreVersion = options.coreVersion || '^2.0.8';
79
+ const cliVersion = options.cliVersion || '^2.0.24';
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,7 +445,24 @@ function generateInstanceFiles(options) {
445
445
  ` req.on('data', (chunk) => { body += chunk; });`,
446
446
  ` req.on('end', async () => {`,
447
447
  ` try {`,
448
- ` const chatContext = payload.context ? { ...payload.context, ...(payload.mode ? { mode: payload.mode } : {}) } : (payload.mode ? { mode: payload.mode } : undefined);`,
448
+ ` const payload = JSON.parse(body || '{}');`,
449
+ ` const chatContext = {`,
450
+ ` companionId: config.id,`,
451
+ ` actor: {`,
452
+ ` actorId: 'owner-user',`,
453
+ ` sessionId: \`sess-\${config.id}\`,`,
454
+ ` authorizationRole: 'administrator',`,
455
+ ` capabilities: ['chat', 'memory:approve', 'action:execute'],`,
456
+ ` authenticated: true,`,
457
+ ` },`,
458
+ ` conversation: {`,
459
+ ` channel: 'direct',`,
460
+ ` correlationId: \`corr-\${Date.now()}\`,`,
461
+ ` },`,
462
+ ` source: 'local',`,
463
+ ` ...(payload.context || {}),`,
464
+ ` ...(payload.mode ? { mode: payload.mode } : {}),`,
465
+ ` };`,
449
466
  ` const response = await dispatchCompanionChat(runtime, {`,
450
467
  ` id: config.id,`,
451
468
  ` companionId: config.id,`,
@@ -487,7 +504,24 @@ function generateInstanceFiles(options) {
487
504
  ` res.on('close', onClose);`,
488
505
  '',
489
506
  ` try {`,
490
- ` const chatContext = payload.context ? { ...payload.context, ...(payload.mode ? { mode: payload.mode } : {}) } : (payload.mode ? { mode: payload.mode } : undefined);`,
507
+ ` const payload = JSON.parse(body || '{}');`,
508
+ ` const chatContext = {`,
509
+ ` companionId: config.id,`,
510
+ ` actor: {`,
511
+ ` actorId: 'owner-user',`,
512
+ ` sessionId: \`sess-\${config.id}\`,`,
513
+ ` authorizationRole: 'administrator',`,
514
+ ` capabilities: ['chat', 'memory:approve', 'action:execute'],`,
515
+ ` authenticated: true,`,
516
+ ` },`,
517
+ ` conversation: {`,
518
+ ` channel: 'direct',`,
519
+ ` correlationId: \`corr-\${Date.now()}\`,`,
520
+ ` },`,
521
+ ` source: 'local',`,
522
+ ` ...(payload.context || {}),`,
523
+ ` ...(payload.mode ? { mode: payload.mode } : {}),`,
524
+ ` };`,
491
525
  ` const response = await dispatchCompanionChat(runtime, {`,
492
526
  ` id: config.id,`,
493
527
  ` companionId: config.id,`,
@@ -195,5 +195,16 @@ 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 || '{}');");
207
+ expect(chatSlice).toContain("channel: 'direct'");
208
+ expect(chatStreamSlice).toContain("channel: 'direct'");
198
209
  });
199
210
  });
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { OrganManifest } from './manifest';
3
- export declare const CLI_VERSION = "2.0.22";
3
+ export declare const CLI_VERSION = "2.0.24";
4
4
  import { colors } from './colors';
5
5
  export { colors };
6
6
  export declare function printHeader(): void;
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.22';
29
+ exports.CLI_VERSION = '2.0.24';
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.22",
3
+ "version": "2.0.24",
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
+ }