@siduri-x/api 2.0.3 → 2.0.4
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 +12 -12
- package/dist/app.js +15 -9
- package/package.json +7 -7
- package/src/app.ts +15 -9
package/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
> @siduri-x/api@2.0.
|
|
2
|
+
> @siduri-x/api@2.0.4 test /home/zagin/Projects/vxnus-studio/projects/siduri-x/apps/api
|
|
3
3
|
> jest --config jest.config.json
|
|
4
4
|
|
|
5
|
-
PASS src/context-mapper.test.ts (
|
|
6
|
-
PASS src/
|
|
5
|
+
PASS src/context-mapper.test.ts (9.405 s)
|
|
6
|
+
PASS src/index.test.ts (11.391 s)
|
|
7
|
+
PASS src/t5-experience.test.ts (11.412 s)
|
|
8
|
+
PASS src/runtime.test.ts (10.411 s)
|
|
7
9
|
● Console
|
|
8
10
|
|
|
9
11
|
console.error
|
|
@@ -24,20 +26,18 @@ PASS src/runtime.test.ts (17.986 s)
|
|
|
24
26
|
at PerceptionPipeline.execute (../../packages/core/dist/perception-pipeline.js:21:34)
|
|
25
27
|
at Object.<anonymous> (src/runtime.test.ts:74:22)
|
|
26
28
|
|
|
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
|
|
29
|
+
PASS src/t4-gating.test.ts (10.904 s)
|
|
33
30
|
PASS src/auth.test.ts
|
|
34
|
-
PASS src/
|
|
35
|
-
PASS src/boot.test.ts
|
|
31
|
+
PASS src/smoke.test.ts
|
|
36
32
|
PASS src/b0-b6.test.ts
|
|
33
|
+
PASS src/t7-release.test.ts
|
|
37
34
|
PASS src/knowledge.test.ts
|
|
35
|
+
PASS src/t6-security.test.ts (12.086 s)
|
|
36
|
+
PASS src/boot.test.ts
|
|
37
|
+
PASS src/teach-mode.test.ts (11.464 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: 14.772 s, estimated 16 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) {
|
|
@@ -505,7 +511,7 @@ function createApp(runtimes = new Map()) {
|
|
|
505
511
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
506
512
|
try {
|
|
507
513
|
await runtime.memory.approveClaim(req.body.id);
|
|
508
|
-
res.json({ approved: true });
|
|
514
|
+
res.json({ approved: true, status: 'approved' });
|
|
509
515
|
}
|
|
510
516
|
catch (e) {
|
|
511
517
|
res.status(500).json({ error: e.message });
|
|
@@ -520,7 +526,7 @@ function createApp(runtimes = new Map()) {
|
|
|
520
526
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
521
527
|
try {
|
|
522
528
|
await runtime.memory.rejectClaim(req.body.id);
|
|
523
|
-
res.json({ rejected: true });
|
|
529
|
+
res.json({ rejected: true, status: 'rejected' });
|
|
524
530
|
}
|
|
525
531
|
catch (e) {
|
|
526
532
|
res.status(500).json({ error: e.message });
|
|
@@ -536,7 +542,7 @@ function createApp(runtimes = new Map()) {
|
|
|
536
542
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
537
543
|
try {
|
|
538
544
|
await runtime.memory.approveDirective(req.body.id);
|
|
539
|
-
res.json({ approved: true });
|
|
545
|
+
res.json({ approved: true, status: 'active' });
|
|
540
546
|
}
|
|
541
547
|
catch (e) {
|
|
542
548
|
res.status(500).json({ error: e.message });
|
|
@@ -551,7 +557,7 @@ function createApp(runtimes = new Map()) {
|
|
|
551
557
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
552
558
|
try {
|
|
553
559
|
await runtime.memory.rejectDirective(req.body.id);
|
|
554
|
-
res.json({ rejected: true });
|
|
560
|
+
res.json({ rejected: true, status: 'rejected' });
|
|
555
561
|
}
|
|
556
562
|
catch (e) {
|
|
557
563
|
res.status(500).json({ error: e.message });
|
|
@@ -566,7 +572,7 @@ function createApp(runtimes = new Map()) {
|
|
|
566
572
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
567
573
|
try {
|
|
568
574
|
await runtime.memory.revokeDirective(req.body.id);
|
|
569
|
-
res.json({ revoked: true });
|
|
575
|
+
res.json({ revoked: true, status: 'revoked' });
|
|
570
576
|
}
|
|
571
577
|
catch (e) {
|
|
572
578
|
res.status(500).json({ error: e.message });
|
|
@@ -581,7 +587,7 @@ function createApp(runtimes = new Map()) {
|
|
|
581
587
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
582
588
|
try {
|
|
583
589
|
await runtime.memory.disableDirective(req.body.id);
|
|
584
|
-
res.json({ disabled: true });
|
|
590
|
+
res.json({ disabled: true, status: 'disabled' });
|
|
585
591
|
}
|
|
586
592
|
catch (e) {
|
|
587
593
|
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.4",
|
|
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.4",
|
|
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/memory": "2.0.
|
|
23
|
-
"@siduri-x/mouth": "2.0.
|
|
21
|
+
"@siduri-x/knowledge": "2.0.3",
|
|
22
|
+
"@siduri-x/memory": "2.0.2",
|
|
23
|
+
"@siduri-x/mouth": "2.0.2",
|
|
24
24
|
"@siduri-x/observation": "2.0.1",
|
|
25
25
|
"@siduri-x/self": "2.0.2",
|
|
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/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 });
|
|
@@ -535,7 +541,7 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
535
541
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
536
542
|
try {
|
|
537
543
|
await runtime.memory.approveClaim(req.body.id);
|
|
538
|
-
res.json({ approved: true });
|
|
544
|
+
res.json({ approved: true, status: 'approved' });
|
|
539
545
|
} catch (e: any) {
|
|
540
546
|
res.status(500).json({ error: e.message });
|
|
541
547
|
}
|
|
@@ -548,7 +554,7 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
548
554
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
549
555
|
try {
|
|
550
556
|
await runtime.memory.rejectClaim(req.body.id);
|
|
551
|
-
res.json({ rejected: true });
|
|
557
|
+
res.json({ rejected: true, status: 'rejected' });
|
|
552
558
|
} catch (e: any) {
|
|
553
559
|
res.status(500).json({ error: e.message });
|
|
554
560
|
}
|
|
@@ -562,7 +568,7 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
562
568
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
563
569
|
try {
|
|
564
570
|
await runtime.memory.approveDirective(req.body.id);
|
|
565
|
-
res.json({ approved: true });
|
|
571
|
+
res.json({ approved: true, status: 'active' });
|
|
566
572
|
} catch (e: any) {
|
|
567
573
|
res.status(500).json({ error: e.message });
|
|
568
574
|
}
|
|
@@ -575,7 +581,7 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
575
581
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
576
582
|
try {
|
|
577
583
|
await runtime.memory.rejectDirective(req.body.id);
|
|
578
|
-
res.json({ rejected: true });
|
|
584
|
+
res.json({ rejected: true, status: 'rejected' });
|
|
579
585
|
} catch (e: any) {
|
|
580
586
|
res.status(500).json({ error: e.message });
|
|
581
587
|
}
|
|
@@ -588,7 +594,7 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
588
594
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
589
595
|
try {
|
|
590
596
|
await runtime.memory.revokeDirective(req.body.id);
|
|
591
|
-
res.json({ revoked: true });
|
|
597
|
+
res.json({ revoked: true, status: 'revoked' });
|
|
592
598
|
} catch (e: any) {
|
|
593
599
|
res.status(500).json({ error: e.message });
|
|
594
600
|
}
|
|
@@ -601,7 +607,7 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
601
607
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
602
608
|
try {
|
|
603
609
|
await runtime.memory.disableDirective(req.body.id);
|
|
604
|
-
res.json({ disabled: true });
|
|
610
|
+
res.json({ disabled: true, status: 'disabled' });
|
|
605
611
|
} catch (e: any) {
|
|
606
612
|
res.status(500).json({ error: e.message });
|
|
607
613
|
}
|