@siduri-x/api 2.0.4 → 2.0.6

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.
@@ -1,4 +1,4 @@
1
1
 
2
- > @siduri-x/api@2.0.4 build /home/zagin/Projects/vxnus-studio/projects/siduri-x/apps/api
2
+ > @siduri-x/api@2.0.6 build /home/zagin/Projects/vxnus-studio/projects/siduri-x/apps/api
3
3
  > tsc
4
4
 
@@ -1,11 +1,8 @@
1
1
 
2
- > @siduri-x/api@2.0.4 test /home/zagin/Projects/vxnus-studio/projects/siduri-x/apps/api
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/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)
5
+ PASS src/runtime.test.ts (8.747 s)
9
6
  ● Console
10
7
 
11
8
  console.error
@@ -21,23 +18,26 @@ PASS src/runtime.test.ts (10.411 s)
21
18
 
22
19
  at ../../packages/core/dist/context-retriever.js:23:25
23
20
  at async Promise.all (index 0)
24
- at retrieveRuntimeContext (../../packages/core/dist/context-retriever.js:19:78)
21
+ at retrieveRuntimeContext (../../packages/core/dist/context-retriever.js:19:124)
25
22
  at contextRetrievalStage (../../packages/core/dist/perception-pipeline.js:66:30)
26
23
  at PerceptionPipeline.execute (../../packages/core/dist/perception-pipeline.js:21:34)
27
24
  at Object.<anonymous> (src/runtime.test.ts:74:22)
28
25
 
29
- PASS src/t4-gating.test.ts (10.904 s)
26
+ PASS src/context-mapper.test.ts (9.124 s)
27
+ PASS src/t6-security.test.ts (10.202 s)
28
+ PASS src/b0-b6.test.ts
29
+ PASS src/teach-mode.test.ts (9.87 s)
30
30
  PASS src/auth.test.ts
31
31
  PASS src/smoke.test.ts
32
- PASS src/b0-b6.test.ts
32
+ PASS src/t5-experience.test.ts (11.204 s)
33
33
  PASS src/t7-release.test.ts
34
- PASS src/knowledge.test.ts
35
- PASS src/t6-security.test.ts (12.086 s)
36
34
  PASS src/boot.test.ts
37
- PASS src/teach-mode.test.ts (11.464 s)
35
+ PASS src/index.test.ts (10.419 s)
36
+ PASS src/t4-gating.test.ts (11.037 s)
37
+ PASS src/knowledge.test.ts
38
38
  
39
39
  Test Suites: 13 passed, 13 total
40
40
  Tests: 90 passed, 90 total
41
41
  Snapshots: 0 total
42
- Time: 14.772 s, estimated 16 s
42
+ Time: 15.936 s
43
43
  Ran all test suites.
package/dist/app.js CHANGED
@@ -510,7 +510,12 @@ function createApp(runtimes = new Map()) {
510
510
  if (!runtime.memory)
511
511
  return res.status(400).json({ error: "Memory organ not configured" });
512
512
  try {
513
- await runtime.memory.approveClaim(req.body.id);
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
+ }
514
519
  res.json({ approved: true, status: 'approved' });
515
520
  }
516
521
  catch (e) {
@@ -525,7 +530,12 @@ function createApp(runtimes = new Map()) {
525
530
  if (!runtime.memory)
526
531
  return res.status(400).json({ error: "Memory organ not configured" });
527
532
  try {
528
- await runtime.memory.rejectClaim(req.body.id);
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
+ }
529
539
  res.json({ rejected: true, status: 'rejected' });
530
540
  }
531
541
  catch (e) {
@@ -541,7 +551,12 @@ function createApp(runtimes = new Map()) {
541
551
  if (!runtime.memory)
542
552
  return res.status(400).json({ error: "Memory organ not configured" });
543
553
  try {
544
- await runtime.memory.approveDirective(req.body.id);
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
+ }
545
560
  res.json({ approved: true, status: 'active' });
546
561
  }
547
562
  catch (e) {
@@ -556,7 +571,12 @@ function createApp(runtimes = new Map()) {
556
571
  if (!runtime.memory)
557
572
  return res.status(400).json({ error: "Memory organ not configured" });
558
573
  try {
559
- await runtime.memory.rejectDirective(req.body.id);
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
+ }
560
580
  res.json({ rejected: true, status: 'rejected' });
561
581
  }
562
582
  catch (e) {
@@ -571,7 +591,12 @@ function createApp(runtimes = new Map()) {
571
591
  if (!runtime.memory)
572
592
  return res.status(400).json({ error: "Memory organ not configured" });
573
593
  try {
574
- await runtime.memory.revokeDirective(req.body.id);
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
+ }
575
600
  res.json({ revoked: true, status: 'revoked' });
576
601
  }
577
602
  catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siduri-x/api",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -13,16 +13,16 @@
13
13
  "dotenv": "^17.4.2",
14
14
  "express": "^5.2.1",
15
15
  "@siduri-x/body": "2.0.1",
16
- "@siduri-x/brain": "2.0.2",
16
+ "@siduri-x/brain": "2.0.3",
17
+ "@siduri-x/core": "2.0.6",
17
18
  "@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
21
  "@siduri-x/knowledge": "2.0.3",
22
- "@siduri-x/memory": "2.0.2",
22
+ "@siduri-x/memory": "2.0.4",
23
23
  "@siduri-x/mouth": "2.0.2",
24
24
  "@siduri-x/observation": "2.0.1",
25
- "@siduri-x/self": "2.0.2",
25
+ "@siduri-x/self": "2.0.4",
26
26
  "@siduri-x/vision": "2.0.1",
27
27
  "@siduri-x/voice": "2.0.2"
28
28
  },
package/siduri.sqlite CHANGED
Binary file
package/src/app.ts CHANGED
@@ -540,7 +540,11 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
540
540
  if (!runtime) return res.status(404).json({ error: "Companion not found" });
541
541
  if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
542
542
  try {
543
- await runtime.memory.approveClaim(req.body.id);
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
+ }
544
548
  res.json({ approved: true, status: 'approved' });
545
549
  } catch (e: any) {
546
550
  res.status(500).json({ error: e.message });
@@ -553,7 +557,11 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
553
557
  if (!runtime) return res.status(404).json({ error: "Companion not found" });
554
558
  if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
555
559
  try {
556
- await runtime.memory.rejectClaim(req.body.id);
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
+ }
557
565
  res.json({ rejected: true, status: 'rejected' });
558
566
  } catch (e: any) {
559
567
  res.status(500).json({ error: e.message });
@@ -567,7 +575,11 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
567
575
  if (!runtime) return res.status(404).json({ error: "Companion not found" });
568
576
  if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
569
577
  try {
570
- await runtime.memory.approveDirective(req.body.id);
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
+ }
571
583
  res.json({ approved: true, status: 'active' });
572
584
  } catch (e: any) {
573
585
  res.status(500).json({ error: e.message });
@@ -580,7 +592,11 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
580
592
  if (!runtime) return res.status(404).json({ error: "Companion not found" });
581
593
  if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
582
594
  try {
583
- await runtime.memory.rejectDirective(req.body.id);
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
+ }
584
600
  res.json({ rejected: true, status: 'rejected' });
585
601
  } catch (e: any) {
586
602
  res.status(500).json({ error: e.message });
@@ -593,7 +609,11 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
593
609
  if (!runtime) return res.status(404).json({ error: "Companion not found" });
594
610
  if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
595
611
  try {
596
- await runtime.memory.revokeDirective(req.body.id);
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
+ }
597
617
  res.json({ revoked: true, status: 'revoked' });
598
618
  } catch (e: any) {
599
619
  res.status(500).json({ error: e.message });