@siduri-x/api 2.0.17 → 2.0.18
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 +10 -10
- package/dist/app.js +22 -4
- package/package.json +3 -3
- package/siduri.sqlite +0 -0
- package/src/app.ts +20 -4
package/.turbo/turbo-build.log
CHANGED
package/.turbo/turbo-test.log
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
> @siduri-x/api@2.0.17 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/runtime.test.ts (
|
|
5
|
+
PASS src/context-mapper.test.ts (6.296 s)
|
|
6
|
+
PASS src/runtime.test.ts (8.132 s)
|
|
7
7
|
● Console
|
|
8
8
|
|
|
9
9
|
console.error
|
|
@@ -25,20 +25,20 @@ PASS src/runtime.test.ts (12.425 s)
|
|
|
25
25
|
at PerceptionPipeline.execute (../../packages/core/dist/perception-pipeline.js:21:34)
|
|
26
26
|
at Object.<anonymous> (src/runtime.test.ts:74:22)
|
|
27
27
|
|
|
28
|
-
PASS src/
|
|
29
|
-
PASS src/
|
|
30
|
-
PASS src/
|
|
28
|
+
PASS src/knowledge.test.ts (12.267 s)
|
|
29
|
+
PASS src/index.test.ts (5.03 s)
|
|
30
|
+
PASS src/t4-gating.test.ts (11.856 s)
|
|
31
|
+
PASS src/teach-mode.test.ts (12.017 s)
|
|
31
32
|
PASS src/auth.test.ts
|
|
32
33
|
PASS src/smoke.test.ts
|
|
33
|
-
PASS src/t6-security.test.ts (14.239 s)
|
|
34
|
-
PASS src/t7-release.test.ts
|
|
35
34
|
PASS src/boot.test.ts
|
|
36
|
-
PASS src/
|
|
35
|
+
PASS src/t6-security.test.ts (12.673 s)
|
|
36
|
+
PASS src/t7-release.test.ts
|
|
37
|
+
PASS src/t5-experience.test.ts (12.057 s)
|
|
37
38
|
PASS src/b0-b6.test.ts
|
|
38
|
-
PASS src/index.test.ts
|
|
39
39
|
[999D[K
|
|
40
40
|
Test Suites: 13 passed, 13 total
|
|
41
41
|
Tests: 94 passed, 94 total
|
|
42
42
|
Snapshots: 0 total
|
|
43
|
-
Time:
|
|
43
|
+
Time: 15.305 s
|
|
44
44
|
Ran all test suites.
|
package/dist/app.js
CHANGED
|
@@ -855,13 +855,22 @@ function createApp(runtimes = new Map()) {
|
|
|
855
855
|
if (!runtime.memory)
|
|
856
856
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
857
857
|
try {
|
|
858
|
+
let name;
|
|
858
859
|
if (typeof runtime.approveProposal === 'function') {
|
|
859
|
-
await runtime.approveProposal(req.body.id, { companionId: id });
|
|
860
|
+
const pRes = await runtime.approveProposal(req.body.id, { companionId: id });
|
|
861
|
+
name = pRes?.name;
|
|
860
862
|
}
|
|
861
863
|
else {
|
|
862
864
|
await runtime.memory.approveClaim(req.body.id);
|
|
863
865
|
}
|
|
864
|
-
|
|
866
|
+
if (!name && runtime.self && typeof runtime.self.getIdentity === 'function') {
|
|
867
|
+
try {
|
|
868
|
+
const ident = await runtime.self.getIdentity(id);
|
|
869
|
+
name = ident?.name;
|
|
870
|
+
}
|
|
871
|
+
catch { }
|
|
872
|
+
}
|
|
873
|
+
res.json({ approved: true, status: 'approved', name });
|
|
865
874
|
}
|
|
866
875
|
catch (e) {
|
|
867
876
|
res.status(500).json({ error: e.message });
|
|
@@ -896,13 +905,22 @@ function createApp(runtimes = new Map()) {
|
|
|
896
905
|
if (!runtime.memory)
|
|
897
906
|
return res.status(400).json({ error: "Memory organ not configured" });
|
|
898
907
|
try {
|
|
908
|
+
let name;
|
|
899
909
|
if (typeof runtime.approveDirective === 'function') {
|
|
900
|
-
await runtime.approveDirective(req.body.id, { companionId: id });
|
|
910
|
+
const bRes = await runtime.approveDirective(req.body.id, { companionId: id });
|
|
911
|
+
name = bRes?.name;
|
|
901
912
|
}
|
|
902
913
|
else {
|
|
903
914
|
await runtime.memory.approveDirective(req.body.id);
|
|
904
915
|
}
|
|
905
|
-
|
|
916
|
+
if (!name && runtime.self && typeof runtime.self.getIdentity === 'function') {
|
|
917
|
+
try {
|
|
918
|
+
const ident = await runtime.self.getIdentity(id);
|
|
919
|
+
name = ident?.name;
|
|
920
|
+
}
|
|
921
|
+
catch { }
|
|
922
|
+
}
|
|
923
|
+
res.json({ approved: true, status: 'active', name });
|
|
906
924
|
}
|
|
907
925
|
catch (e) {
|
|
908
926
|
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.18",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
"dotenv": "^17.4.2",
|
|
14
14
|
"express": "^5.2.1",
|
|
15
15
|
"@siduri-x/body": "2.0.2",
|
|
16
|
-
"@siduri-x/brain": "2.0.
|
|
16
|
+
"@siduri-x/brain": "2.0.12",
|
|
17
|
+
"@siduri-x/core": "2.0.15",
|
|
17
18
|
"@siduri-x/ear": "2.0.4",
|
|
18
|
-
"@siduri-x/core": "2.0.14",
|
|
19
19
|
"@siduri-x/hands": "2.0.3",
|
|
20
20
|
"@siduri-x/knowledge": "2.0.7",
|
|
21
21
|
"@siduri-x/memory": "2.0.6",
|
package/siduri.sqlite
CHANGED
|
Binary file
|
package/src/app.ts
CHANGED
|
@@ -879,12 +879,20 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
879
879
|
if (!runtime) return res.status(404).json({ error: "Companion not found" });
|
|
880
880
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
881
881
|
try {
|
|
882
|
+
let name: string | undefined;
|
|
882
883
|
if (typeof (runtime as any).approveProposal === 'function') {
|
|
883
|
-
await (runtime as any).approveProposal(req.body.id, { companionId: id });
|
|
884
|
+
const pRes = await (runtime as any).approveProposal(req.body.id, { companionId: id });
|
|
885
|
+
name = pRes?.name;
|
|
884
886
|
} else {
|
|
885
887
|
await runtime.memory.approveClaim(req.body.id);
|
|
886
888
|
}
|
|
887
|
-
|
|
889
|
+
if (!name && runtime.self && typeof (runtime.self as any).getIdentity === 'function') {
|
|
890
|
+
try {
|
|
891
|
+
const ident = await (runtime.self as any).getIdentity(id);
|
|
892
|
+
name = ident?.name;
|
|
893
|
+
} catch {}
|
|
894
|
+
}
|
|
895
|
+
res.json({ approved: true, status: 'approved', name });
|
|
888
896
|
} catch (e: any) {
|
|
889
897
|
res.status(500).json({ error: e.message });
|
|
890
898
|
}
|
|
@@ -914,12 +922,20 @@ export function createApp(runtimes: Map<string, SiduriRuntime> = new Map()): App
|
|
|
914
922
|
if (!runtime) return res.status(404).json({ error: "Companion not found" });
|
|
915
923
|
if (!runtime.memory) return res.status(400).json({ error: "Memory organ not configured" });
|
|
916
924
|
try {
|
|
925
|
+
let name: string | undefined;
|
|
917
926
|
if (typeof (runtime as any).approveDirective === 'function') {
|
|
918
|
-
await (runtime as any).approveDirective(req.body.id, { companionId: id });
|
|
927
|
+
const bRes = await (runtime as any).approveDirective(req.body.id, { companionId: id });
|
|
928
|
+
name = bRes?.name;
|
|
919
929
|
} else {
|
|
920
930
|
await runtime.memory.approveDirective(req.body.id);
|
|
921
931
|
}
|
|
922
|
-
|
|
932
|
+
if (!name && runtime.self && typeof (runtime.self as any).getIdentity === 'function') {
|
|
933
|
+
try {
|
|
934
|
+
const ident = await (runtime.self as any).getIdentity(id);
|
|
935
|
+
name = ident?.name;
|
|
936
|
+
} catch {}
|
|
937
|
+
}
|
|
938
|
+
res.json({ approved: true, status: 'active', name });
|
|
923
939
|
} catch (e: any) {
|
|
924
940
|
res.status(500).json({ error: e.message });
|
|
925
941
|
}
|