@siduri-x/api 2.0.3 → 2.0.5
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/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +14 -14
- package/dist/app.js +45 -14
- package/package.json +8 -8
- package/siduri.sqlite +0 -0
- package/src/app.ts +40 -14
package/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @siduri-x/api@2.0.
|
|
2
|
+
> @siduri-x/api@2.0.5 test /home/zagin/Projects/vxnus-studio/projects/siduri-x/apps/api
|
|
3
3
|
> jest --config jest.config.json
|
|
4
4
|
|
|
5
|
-
PASS src/
|
|
6
|
-
PASS src/runtime.test.ts (
|
|
5
|
+
PASS src/t5-experience.test.ts (11.413 s)
|
|
6
|
+
PASS src/runtime.test.ts (11.982 s)
|
|
7
7
|
● Console
|
|
8
8
|
|
|
9
9
|
console.error
|
|
@@ -19,25 +19,25 @@ PASS src/runtime.test.ts (17.986 s)
|
|
|
19
19
|
|
|
20
20
|
at ../../packages/core/dist/context-retriever.js:23:25
|
|
21
21
|
at async Promise.all (index 0)
|
|
22
|
-
at retrieveRuntimeContext (../../packages/core/dist/context-retriever.js:19:
|
|
22
|
+
at retrieveRuntimeContext (../../packages/core/dist/context-retriever.js:19:124)
|
|
23
23
|
at contextRetrievalStage (../../packages/core/dist/perception-pipeline.js:66:30)
|
|
24
24
|
at PerceptionPipeline.execute (../../packages/core/dist/perception-pipeline.js:21:34)
|
|
25
25
|
at Object.<anonymous> (src/runtime.test.ts:74:22)
|
|
26
26
|
|
|
27
|
-
PASS src/
|
|
28
|
-
PASS src/t4-gating.test.ts (19.152 s)
|
|
29
|
-
PASS src/index.test.ts (19.326 s)
|
|
30
|
-
PASS src/teach-mode.test.ts (20.058 s)
|
|
31
|
-
PASS src/t7-release.test.ts
|
|
32
|
-
PASS src/smoke.test.ts
|
|
33
|
-
PASS src/auth.test.ts
|
|
34
|
-
PASS src/t6-security.test.ts (19.898 s)
|
|
27
|
+
PASS src/knowledge.test.ts
|
|
35
28
|
PASS src/boot.test.ts
|
|
29
|
+
PASS src/context-mapper.test.ts (12.608 s)
|
|
30
|
+
PASS src/auth.test.ts
|
|
31
|
+
PASS src/smoke.test.ts
|
|
36
32
|
PASS src/b0-b6.test.ts
|
|
37
|
-
PASS src/
|
|
33
|
+
PASS src/t7-release.test.ts
|
|
34
|
+
PASS src/index.test.ts (14.286 s)
|
|
35
|
+
PASS src/teach-mode.test.ts (14.196 s)
|
|
36
|
+
PASS src/t4-gating.test.ts (13.791 s)
|
|
37
|
+
PASS src/t6-security.test.ts (14.999 s)
|
|
38
38
|
[999D[K
|
|
39
39
|
Test Suites: 13 passed, 13 total
|
|
40
40
|
Tests: 90 passed, 90 total
|
|
41
41
|
Snapshots: 0 total
|
|
42
|
-
Time:
|
|
42
|
+
Time: 18.45 s
|
|
43
43
|
Ran all test suites.
|
package/dist/app.js
CHANGED
|
@@ -188,6 +188,7 @@ function createApp(runtimes = new Map()) {
|
|
|
188
188
|
context: mappingResult.context,
|
|
189
189
|
history,
|
|
190
190
|
...(req.body?.medium ? { medium: req.body.medium } : {}),
|
|
191
|
+
subtitleLanguage: req.body?.subtitleLanguage || req.body?.subtitle_language,
|
|
191
192
|
});
|
|
192
193
|
res.json(response);
|
|
193
194
|
}
|
|
@@ -243,9 +244,10 @@ function createApp(runtimes = new Map()) {
|
|
|
243
244
|
history,
|
|
244
245
|
medium: 'web',
|
|
245
246
|
signal: abortController.signal,
|
|
247
|
+
subtitleLanguage: req.body?.subtitleLanguage || req.body?.subtitle_language,
|
|
246
248
|
});
|
|
247
249
|
res.write(`event: staged\ndata: ${JSON.stringify({ response_id: response.response_id, correlation_id: response.correlation_id, status: response.status, mode: response.metadata?.mode })}\n\n`);
|
|
248
|
-
const avatarEvent = response.metadata?.events?.find((e) => (e.kind === 'avatar' || e.kind === 'body') && (e.approval === 'APPROVED' || !e.approval));
|
|
250
|
+
const avatarEvent = response.metadata?.events?.find((e) => (e.kind === 'avatar' || e.kind === 'body') && (e.approval?.toLowerCase() === 'approved' || e.approval === 'APPROVED' || !e.approval));
|
|
249
251
|
if (avatarEvent) {
|
|
250
252
|
res.write(`event: avatar\ndata: ${JSON.stringify(avatarEvent)}\n\n`);
|
|
251
253
|
}
|
|
@@ -365,7 +367,9 @@ function createApp(runtimes = new Map()) {
|
|
|
365
367
|
if (!runtime.memory)
|
|
366
368
|
return res.json({ claims: [] });
|
|
367
369
|
try {
|
|
368
|
-
const claims =
|
|
370
|
+
const claims = typeof runtime.memory.getAllClaims === 'function'
|
|
371
|
+
? await runtime.memory.getAllClaims()
|
|
372
|
+
: await runtime.memory.getClaims();
|
|
369
373
|
res.json({ claims });
|
|
370
374
|
}
|
|
371
375
|
catch (e) {
|
|
@@ -380,7 +384,9 @@ function createApp(runtimes = new Map()) {
|
|
|
380
384
|
if (!runtime.memory)
|
|
381
385
|
return res.json({ directives: [] });
|
|
382
386
|
try {
|
|
383
|
-
const directives =
|
|
387
|
+
const directives = typeof runtime.memory.getAllDirectives === 'function'
|
|
388
|
+
? await runtime.memory.getAllDirectives()
|
|
389
|
+
: await runtime.memory.getDirectives();
|
|
384
390
|
res.json({ directives });
|
|
385
391
|
}
|
|
386
392
|
catch (e) {
|
|
@@ -504,8 +510,13 @@ function createApp(runtimes = new Map()) {
|
|
|
504
510
|
if (!runtime.memory)
|
|
505
511
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
506
512
|
try {
|
|
507
|
-
|
|
508
|
-
|
|
513
|
+
if (typeof runtime.approveProposal === 'function') {
|
|
514
|
+
await runtime.approveProposal(req.body.id, { companionId: id });
|
|
515
|
+
}
|
|
516
|
+
else {
|
|
517
|
+
await runtime.memory.approveClaim(req.body.id);
|
|
518
|
+
}
|
|
519
|
+
res.json({ approved: true, status: 'approved' });
|
|
509
520
|
}
|
|
510
521
|
catch (e) {
|
|
511
522
|
res.status(500).json({ error: e.message });
|
|
@@ -519,8 +530,13 @@ function createApp(runtimes = new Map()) {
|
|
|
519
530
|
if (!runtime.memory)
|
|
520
531
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
521
532
|
try {
|
|
522
|
-
|
|
523
|
-
|
|
533
|
+
if (typeof runtime.rejectProposal === 'function') {
|
|
534
|
+
await runtime.rejectProposal(req.body.id, { companionId: id });
|
|
535
|
+
}
|
|
536
|
+
else {
|
|
537
|
+
await runtime.memory.rejectClaim(req.body.id);
|
|
538
|
+
}
|
|
539
|
+
res.json({ rejected: true, status: 'rejected' });
|
|
524
540
|
}
|
|
525
541
|
catch (e) {
|
|
526
542
|
res.status(500).json({ error: e.message });
|
|
@@ -535,8 +551,13 @@ function createApp(runtimes = new Map()) {
|
|
|
535
551
|
if (!runtime.memory)
|
|
536
552
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
537
553
|
try {
|
|
538
|
-
|
|
539
|
-
|
|
554
|
+
if (typeof runtime.approveDirective === 'function') {
|
|
555
|
+
await runtime.approveDirective(req.body.id, { companionId: id });
|
|
556
|
+
}
|
|
557
|
+
else {
|
|
558
|
+
await runtime.memory.approveDirective(req.body.id);
|
|
559
|
+
}
|
|
560
|
+
res.json({ approved: true, status: 'active' });
|
|
540
561
|
}
|
|
541
562
|
catch (e) {
|
|
542
563
|
res.status(500).json({ error: e.message });
|
|
@@ -550,8 +571,13 @@ function createApp(runtimes = new Map()) {
|
|
|
550
571
|
if (!runtime.memory)
|
|
551
572
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
552
573
|
try {
|
|
553
|
-
|
|
554
|
-
|
|
574
|
+
if (typeof runtime.rejectDirective === 'function') {
|
|
575
|
+
await runtime.rejectDirective(req.body.id, { companionId: id });
|
|
576
|
+
}
|
|
577
|
+
else {
|
|
578
|
+
await runtime.memory.rejectDirective(req.body.id);
|
|
579
|
+
}
|
|
580
|
+
res.json({ rejected: true, status: 'rejected' });
|
|
555
581
|
}
|
|
556
582
|
catch (e) {
|
|
557
583
|
res.status(500).json({ error: e.message });
|
|
@@ -565,8 +591,13 @@ function createApp(runtimes = new Map()) {
|
|
|
565
591
|
if (!runtime.memory)
|
|
566
592
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
567
593
|
try {
|
|
568
|
-
|
|
569
|
-
|
|
594
|
+
if (typeof runtime.revokeDirective === 'function') {
|
|
595
|
+
await runtime.revokeDirective(req.body.id, { companionId: id });
|
|
596
|
+
}
|
|
597
|
+
else {
|
|
598
|
+
await runtime.memory.revokeDirective(req.body.id);
|
|
599
|
+
}
|
|
600
|
+
res.json({ revoked: true, status: 'revoked' });
|
|
570
601
|
}
|
|
571
602
|
catch (e) {
|
|
572
603
|
res.status(500).json({ error: e.message });
|
|
@@ -581,7 +612,7 @@ function createApp(runtimes = new Map()) {
|
|
|
581
612
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
582
613
|
try {
|
|
583
614
|
await runtime.memory.disableDirective(req.body.id);
|
|
584
|
-
res.json({ disabled: true });
|
|
615
|
+
res.json({ disabled: true, status: 'disabled' });
|
|
585
616
|
}
|
|
586
617
|
catch (e) {
|
|
587
618
|
res.status(500).json({ error: e.message });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siduri-x/api",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -13,18 +13,18 @@
|
|
|
13
13
|
"dotenv": "^17.4.2",
|
|
14
14
|
"express": "^5.2.1",
|
|
15
15
|
"@siduri-x/body": "2.0.1",
|
|
16
|
-
"@siduri-x/
|
|
17
|
-
"@siduri-x/brain": "2.0.1",
|
|
16
|
+
"@siduri-x/brain": "2.0.2",
|
|
18
17
|
"@siduri-x/ear": "2.0.1",
|
|
18
|
+
"@siduri-x/core": "2.0.5",
|
|
19
19
|
"@siduri-x/eknowledge": "2.0.1",
|
|
20
20
|
"@siduri-x/hands": "2.0.1",
|
|
21
|
-
"@siduri-x/knowledge": "2.0.
|
|
22
|
-
"@siduri-x/
|
|
23
|
-
"@siduri-x/mouth": "2.0.1",
|
|
21
|
+
"@siduri-x/knowledge": "2.0.3",
|
|
22
|
+
"@siduri-x/mouth": "2.0.2",
|
|
24
23
|
"@siduri-x/observation": "2.0.1",
|
|
25
|
-
"@siduri-x/
|
|
24
|
+
"@siduri-x/memory": "2.0.3",
|
|
25
|
+
"@siduri-x/self": "2.0.3",
|
|
26
26
|
"@siduri-x/vision": "2.0.1",
|
|
27
|
-
"@siduri-x/voice": "2.0.
|
|
27
|
+
"@siduri-x/voice": "2.0.2"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/cors": "^2.8.19",
|
package/siduri.sqlite
CHANGED
|
Binary file
|
package/src/app.ts
CHANGED
|
@@ -218,6 +218,7 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
218
218
|
context: mappingResult.context,
|
|
219
219
|
history,
|
|
220
220
|
...(req.body?.medium ? { medium: req.body.medium } : {}),
|
|
221
|
+
subtitleLanguage: req.body?.subtitleLanguage || req.body?.subtitle_language,
|
|
221
222
|
});
|
|
222
223
|
res.json(response);
|
|
223
224
|
} catch (e: any) {
|
|
@@ -279,12 +280,13 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
279
280
|
history,
|
|
280
281
|
medium: 'web',
|
|
281
282
|
signal: abortController.signal,
|
|
283
|
+
subtitleLanguage: req.body?.subtitleLanguage || req.body?.subtitle_language,
|
|
282
284
|
});
|
|
283
285
|
|
|
284
286
|
res.write(`event: staged\ndata: ${JSON.stringify({ response_id: response.response_id, correlation_id: response.correlation_id, status: response.status, mode: response.metadata?.mode })}\n\n`);
|
|
285
287
|
|
|
286
288
|
const avatarEvent = response.metadata?.events?.find(
|
|
287
|
-
(e: any) => (e.kind === 'avatar' || e.kind === 'body') && (e.approval === 'APPROVED' || !e.approval)
|
|
289
|
+
(e: any) => (e.kind === 'avatar' || e.kind === 'body') && (e.approval?.toLowerCase() === 'approved' || e.approval === 'APPROVED' || !e.approval)
|
|
288
290
|
);
|
|
289
291
|
if (avatarEvent) {
|
|
290
292
|
res.write(`event: avatar\ndata: ${JSON.stringify(avatarEvent)}\n\n`);
|
|
@@ -405,7 +407,9 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
405
407
|
if (!runtime) return res.status(404).json({ error: "Companion not found" });
|
|
406
408
|
if (!runtime.memory) return res.json({ claims: [] });
|
|
407
409
|
try {
|
|
408
|
-
const claims =
|
|
410
|
+
const claims = typeof (runtime.memory as any).getAllClaims === 'function'
|
|
411
|
+
? await (runtime.memory as any).getAllClaims()
|
|
412
|
+
: await runtime.memory.getClaims();
|
|
409
413
|
res.json({ claims });
|
|
410
414
|
} catch (e: any) {
|
|
411
415
|
res.status(500).json({ error: e.message });
|
|
@@ -418,7 +422,9 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
418
422
|
if (!runtime) return res.status(404).json({ error: "Companion not found" });
|
|
419
423
|
if (!runtime.memory) return res.json({ directives: [] });
|
|
420
424
|
try {
|
|
421
|
-
const directives =
|
|
425
|
+
const directives = typeof (runtime.memory as any).getAllDirectives === 'function'
|
|
426
|
+
? await (runtime.memory as any).getAllDirectives()
|
|
427
|
+
: await runtime.memory.getDirectives();
|
|
422
428
|
res.json({ directives });
|
|
423
429
|
} catch (e: any) {
|
|
424
430
|
res.status(500).json({ error: e.message });
|
|
@@ -534,8 +540,12 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
534
540
|
if (!runtime) return res.status(404).json({ error: "Companion not found" });
|
|
535
541
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
536
542
|
try {
|
|
537
|
-
|
|
538
|
-
|
|
543
|
+
if (typeof (runtime as any).approveProposal === 'function') {
|
|
544
|
+
await (runtime as any).approveProposal(req.body.id, { companionId: id });
|
|
545
|
+
} else {
|
|
546
|
+
await runtime.memory.approveClaim(req.body.id);
|
|
547
|
+
}
|
|
548
|
+
res.json({ approved: true, status: 'approved' });
|
|
539
549
|
} catch (e: any) {
|
|
540
550
|
res.status(500).json({ error: e.message });
|
|
541
551
|
}
|
|
@@ -547,8 +557,12 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
547
557
|
if (!runtime) return res.status(404).json({ error: "Companion not found" });
|
|
548
558
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
549
559
|
try {
|
|
550
|
-
|
|
551
|
-
|
|
560
|
+
if (typeof (runtime as any).rejectProposal === 'function') {
|
|
561
|
+
await (runtime as any).rejectProposal(req.body.id, { companionId: id });
|
|
562
|
+
} else {
|
|
563
|
+
await runtime.memory.rejectClaim(req.body.id);
|
|
564
|
+
}
|
|
565
|
+
res.json({ rejected: true, status: 'rejected' });
|
|
552
566
|
} catch (e: any) {
|
|
553
567
|
res.status(500).json({ error: e.message });
|
|
554
568
|
}
|
|
@@ -561,8 +575,12 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
561
575
|
if (!runtime) return res.status(404).json({ error: "Companion not found" });
|
|
562
576
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
563
577
|
try {
|
|
564
|
-
|
|
565
|
-
|
|
578
|
+
if (typeof (runtime as any).approveDirective === 'function') {
|
|
579
|
+
await (runtime as any).approveDirective(req.body.id, { companionId: id });
|
|
580
|
+
} else {
|
|
581
|
+
await runtime.memory.approveDirective(req.body.id);
|
|
582
|
+
}
|
|
583
|
+
res.json({ approved: true, status: 'active' });
|
|
566
584
|
} catch (e: any) {
|
|
567
585
|
res.status(500).json({ error: e.message });
|
|
568
586
|
}
|
|
@@ -574,8 +592,12 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
574
592
|
if (!runtime) return res.status(404).json({ error: "Companion not found" });
|
|
575
593
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
576
594
|
try {
|
|
577
|
-
|
|
578
|
-
|
|
595
|
+
if (typeof (runtime as any).rejectDirective === 'function') {
|
|
596
|
+
await (runtime as any).rejectDirective(req.body.id, { companionId: id });
|
|
597
|
+
} else {
|
|
598
|
+
await runtime.memory.rejectDirective(req.body.id);
|
|
599
|
+
}
|
|
600
|
+
res.json({ rejected: true, status: 'rejected' });
|
|
579
601
|
} catch (e: any) {
|
|
580
602
|
res.status(500).json({ error: e.message });
|
|
581
603
|
}
|
|
@@ -587,8 +609,12 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
587
609
|
if (!runtime) return res.status(404).json({ error: "Companion not found" });
|
|
588
610
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
589
611
|
try {
|
|
590
|
-
|
|
591
|
-
|
|
612
|
+
if (typeof (runtime as any).revokeDirective === 'function') {
|
|
613
|
+
await (runtime as any).revokeDirective(req.body.id, { companionId: id });
|
|
614
|
+
} else {
|
|
615
|
+
await runtime.memory.revokeDirective(req.body.id);
|
|
616
|
+
}
|
|
617
|
+
res.json({ revoked: true, status: 'revoked' });
|
|
592
618
|
} catch (e: any) {
|
|
593
619
|
res.status(500).json({ error: e.message });
|
|
594
620
|
}
|
|
@@ -601,7 +627,7 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
601
627
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
602
628
|
try {
|
|
603
629
|
await runtime.memory.disableDirective(req.body.id);
|
|
604
|
-
res.json({ disabled: true });
|
|
630
|
+
res.json({ disabled: true, status: 'disabled' });
|
|
605
631
|
} catch (e: any) {
|
|
606
632
|
res.status(500).json({ error: e.message });
|
|
607
633
|
}
|