@rsconcept/rstool 0.10.2 → 1.0.0
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/README.md +41 -31
- package/dist/agent-workflow-D-PSIb-m.d.ts +70 -0
- package/dist/analysis-LLnPhmGa.d.ts +23 -0
- package/dist/{common-DxLg3eXX.d.ts → common-DHJalS-Q.d.ts} +6 -1
- package/dist/constituenta-DnGR6bnM.d.ts +54 -0
- package/dist/diagnostic-D9yl_mEL.d.ts +19 -0
- package/dist/evaluation-Cns8BFm4.d.ts +31 -0
- package/dist/index.d.ts +11 -11
- package/dist/index.js +1 -1
- package/dist/mappers/model-adapter.d.ts +3 -3
- package/dist/mappers/schema-adapter.d.ts +4 -4
- package/dist/mappers/types.d.ts +6 -2
- package/dist/mappers/types.js +2 -0
- package/dist/mappers/types.js.map +1 -1
- package/dist/{model-value-SFAVj0dw.d.ts → model-value-BbonPzMz.d.ts} +14 -3
- package/dist/models/agent-workflow.d.ts +2 -0
- package/dist/models/agent-workflow.js +1 -0
- package/dist/models/analysis.d.ts +1 -1
- package/dist/models/common.d.ts +1 -1
- package/dist/models/constituenta.d.ts +2 -2
- package/dist/models/diagnostic.d.ts +1 -1
- package/dist/models/evaluation.d.ts +2 -2
- package/dist/models/index.d.ts +11 -11
- package/dist/models/index.js +2 -2
- package/dist/models/model-value.d.ts +2 -2
- package/dist/models/rstool-agent.d.ts +1 -1
- package/dist/models/rstool-agent.js +1 -1
- package/dist/models/session.d.ts +1 -1
- package/dist/models/tool-contract.d.ts +2 -2
- package/dist/models/tool-contract.js +2 -1
- package/dist/models/tool-contract.js.map +1 -1
- package/dist/rstool-agent-_8bplZnb.d.ts +71 -0
- package/dist/rstool-agent-kijHA9ML.js +476 -0
- package/dist/rstool-agent-kijHA9ML.js.map +1 -0
- package/dist/session/session-store.d.ts +18 -5
- package/dist/session/session-store.js +1 -64
- package/dist/{session-BPgsE80c.d.ts → session-ChexW8i7.d.ts} +11 -8
- package/dist/session-store-C3jyOSqI.js +142 -0
- package/dist/session-store-C3jyOSqI.js.map +1 -0
- package/dist/tool-contract-5_Q44DGE.d.ts +164 -0
- package/dist/wrapper/client.d.ts +23 -0
- package/dist/wrapper/client.js +17 -0
- package/dist/wrapper/client.js.map +1 -1
- package/dist/wrapper/stdio-wrapper.js +62 -52
- package/dist/wrapper/stdio-wrapper.js.map +1 -1
- package/docs/CONSTITUENTA.md +2 -2
- package/docs/DIAGNOSTICS.md +20 -18
- package/docs/MODEL-TESTING.md +3 -3
- package/docs/PORTAL-API.md +24 -18
- package/examples/README.md +1 -1
- package/examples/agent-client.ts +11 -41
- package/examples/build-chocolate-nim-rsform.ts +23 -18
- package/examples/chocolate-nim/build-rsform.ts +23 -18
- package/examples/chocolate-nim/build-rsmodel.ts +10 -12
- package/examples/chocolate-nim/rsform-session.json +290 -290
- package/examples/chocolate-nim/rsmodel-session.json +291 -291
- package/examples/expression-bank/bank-constituents.ts +304 -53
- package/examples/expression-bank/build-rsform.ts +19 -16
- package/examples/expression-bank/rsform-session.json +1551 -1551
- package/examples/kinship/build-rsform.ts +23 -18
- package/examples/kinship/build-rsmodel.ts +13 -15
- package/examples/kinship/rsform-session.json +219 -219
- package/examples/kinship/rsmodel-session.json +221 -221
- package/examples/kinship/session.ts +19 -21
- package/examples/movd/build-rsform.ts +23 -18
- package/examples/movd/build-rsmodel.ts +18 -20
- package/examples/movd/rsform-session.json +262 -262
- package/examples/movd/rsmodel-session.json +264 -264
- package/examples/sample/build-rsform.ts +19 -50
- package/examples/sample/build-rsmodel.ts +25 -44
- package/examples/sample/rsform-session.json +36 -33
- package/examples/sample/rsmodel-session.json +36 -33
- package/examples/template-apply/build-rsform.ts +27 -24
- package/examples/template-apply/rsform-session.json +48 -48
- package/package.json +3 -3
- package/skills/rstool-helper/EXAMPLES.md +44 -116
- package/skills/rstool-helper/GUIDE.md +40 -25
- package/skills/rstool-helper/REFERENCE.md +40 -177
- package/src/index.ts +24 -17
- package/src/mappers/portal-adapter.ts +43 -0
- package/src/mappers/types.ts +4 -0
- package/src/models/agent-workflow.ts +78 -0
- package/src/models/analysis.ts +7 -0
- package/src/models/common.ts +7 -0
- package/src/models/constituenta.ts +24 -6
- package/src/models/diagnostic.ts +4 -0
- package/src/models/evaluation.ts +11 -0
- package/src/models/import-detect.ts +39 -0
- package/src/models/import-export.ts +24 -0
- package/src/models/index.ts +22 -14
- package/src/models/model-value.ts +12 -0
- package/src/models/portal-json.ts +44 -0
- package/src/models/rstool-agent.test.ts +300 -147
- package/src/models/rstool-agent.ts +350 -93
- package/src/models/session.ts +8 -5
- package/src/models/tool-contract.ts +81 -42
- package/src/session/batch-apply.test.ts +28 -0
- package/src/session/batch-apply.ts +47 -0
- package/src/session/persistence.ts +56 -0
- package/src/session/session-store.ts +67 -4
- package/src/wrapper/client.ts +23 -0
- package/src/wrapper/stdio-wrapper.ts +59 -49
- package/dist/analysis-JiwOYDKx.d.ts +0 -16
- package/dist/constituenta-Dnd6iToB.d.ts +0 -36
- package/dist/diagnostic-BMYvciz8.d.ts +0 -15
- package/dist/evaluation-CCVYH0wA.d.ts +0 -21
- package/dist/index-uhkmwruf.d.ts +0 -46
- package/dist/rstool-agent-BZi5jO1y.js +0 -158
- package/dist/rstool-agent-BZi5jO1y.js.map +0 -1
- package/dist/rstool-agent-pRaPnZay.d.ts +0 -35
- package/dist/session/session-store.js.map +0 -1
- package/dist/tool-contract-n1ghUOrK.d.ts +0 -32
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { writeFile } from 'node:fs/promises';
|
|
2
2
|
import { resolve } from 'node:path';
|
|
3
3
|
|
|
4
|
-
import { CstType, RSToolWrapperClient, type
|
|
4
|
+
import { CstType, RSToolWrapperClient, type AgentConstituentaPatch } from '../../src';
|
|
5
5
|
|
|
6
6
|
async function run() {
|
|
7
7
|
const client = new RSToolWrapperClient({
|
|
@@ -12,60 +12,29 @@ async function run() {
|
|
|
12
12
|
await client.waitUntilReady();
|
|
13
13
|
const session = await client.call<{ sessionId: string; contractVersion: string }>('createSession');
|
|
14
14
|
|
|
15
|
-
const
|
|
15
|
+
const items: AgentConstituentaPatch[] = [
|
|
16
|
+
{ id: 1, alias: 'X1', cstType: CstType.BASE, definitionFormal: '' },
|
|
17
|
+
{ id: 2, alias: 'C1', cstType: CstType.CONSTANT, definitionFormal: '' },
|
|
16
18
|
{
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
19
|
+
id: 3,
|
|
20
|
+
alias: 'S1',
|
|
21
|
+
cstType: CstType.STRUCTURED,
|
|
22
|
+
definitionFormal: 'ℬ(X1×X1)',
|
|
23
|
+
convention: 'Pairs (parent, child) over X1.'
|
|
23
24
|
},
|
|
24
|
-
{
|
|
25
|
-
|
|
26
|
-
id: 2,
|
|
27
|
-
alias: 'C1',
|
|
28
|
-
cstType: CstType.CONSTANT,
|
|
29
|
-
definitionFormal: ''
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
draft: {
|
|
34
|
-
id: 3,
|
|
35
|
-
alias: 'S1',
|
|
36
|
-
cstType: CstType.STRUCTURED,
|
|
37
|
-
definitionFormal: 'ℬ(X1×X1)',
|
|
38
|
-
convention: 'Pairs (parent, child) over X1.'
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
draft: {
|
|
43
|
-
id: 4,
|
|
44
|
-
alias: 'D1',
|
|
45
|
-
cstType: CstType.TERM,
|
|
46
|
-
definitionFormal: 'Pr1(S1)'
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
draft: {
|
|
51
|
-
id: 5,
|
|
52
|
-
alias: 'A1',
|
|
53
|
-
cstType: CstType.AXIOM,
|
|
54
|
-
definitionFormal: '1=1'
|
|
55
|
-
}
|
|
56
|
-
}
|
|
25
|
+
{ id: 4, alias: 'D1', cstType: CstType.TERM, definitionFormal: 'Pr1(S1)' },
|
|
26
|
+
{ id: 5, alias: 'A1', cstType: CstType.AXIOM, definitionFormal: '1=1' }
|
|
57
27
|
];
|
|
58
28
|
|
|
59
|
-
|
|
60
|
-
|
|
29
|
+
const result = await client.call<{ diagnostics: unknown[]; summary: { items: { alias: string }[] } }>(
|
|
30
|
+
'applySchemaPatch',
|
|
31
|
+
{
|
|
61
32
|
sessionId: session.sessionId,
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
'diagnostics'
|
|
68
|
-
);
|
|
33
|
+
items
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
for (const item of result.summary.items) {
|
|
37
|
+
console.log(`Added ${item.alias}:`, result.diagnostics?.length ?? 0, 'diagnostics');
|
|
69
38
|
}
|
|
70
39
|
|
|
71
40
|
await client.call('commitStep', {
|
|
@@ -3,7 +3,7 @@ import { resolve } from 'node:path';
|
|
|
3
3
|
|
|
4
4
|
import { TUPLE_ID } from '@rsconcept/domain';
|
|
5
5
|
|
|
6
|
-
import { CstType, RSToolWrapperClient, type
|
|
6
|
+
import { CstType, RSToolWrapperClient, type AgentConstituentaPatch } from '../../src';
|
|
7
7
|
|
|
8
8
|
async function run() {
|
|
9
9
|
const client = new RSToolWrapperClient({
|
|
@@ -14,63 +14,44 @@ async function run() {
|
|
|
14
14
|
await client.waitUntilReady();
|
|
15
15
|
const session = await client.call<{ sessionId: string; contractVersion: string }>('createSession');
|
|
16
16
|
|
|
17
|
-
const
|
|
17
|
+
const items: AgentConstituentaPatch[] = [
|
|
18
|
+
{ id: 1, alias: 'X1', cstType: CstType.BASE, definitionFormal: '' },
|
|
19
|
+
{ id: 2, alias: 'C1', cstType: CstType.CONSTANT, definitionFormal: '' },
|
|
18
20
|
{
|
|
19
|
-
|
|
21
|
+
id: 3,
|
|
22
|
+
alias: 'S1',
|
|
23
|
+
cstType: CstType.STRUCTURED,
|
|
24
|
+
definitionFormal: 'ℬ(X1×X1)',
|
|
25
|
+
convention: 'Pairs (parent, child) over X1.'
|
|
20
26
|
},
|
|
21
|
-
{
|
|
22
|
-
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
draft: {
|
|
26
|
-
id: 3,
|
|
27
|
-
alias: 'S1',
|
|
28
|
-
cstType: CstType.STRUCTURED,
|
|
29
|
-
definitionFormal: 'ℬ(X1×X1)',
|
|
30
|
-
convention: 'Pairs (parent, child) over X1.'
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
draft: { id: 4, alias: 'D1', cstType: CstType.TERM, definitionFormal: 'Pr1(S1)' }
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
draft: { id: 5, alias: 'A1', cstType: CstType.AXIOM, definitionFormal: '1=1' }
|
|
38
|
-
}
|
|
27
|
+
{ id: 4, alias: 'D1', cstType: CstType.TERM, definitionFormal: 'Pr1(S1)' },
|
|
28
|
+
{ id: 5, alias: 'A1', cstType: CstType.AXIOM, definitionFormal: '1=1' }
|
|
39
29
|
];
|
|
40
30
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
console.log(
|
|
47
|
-
`Added ${input.draft.alias}:`,
|
|
48
|
-
(result as { diagnostics?: unknown[] }).diagnostics?.length ?? 0,
|
|
49
|
-
'diagnostics'
|
|
50
|
-
);
|
|
51
|
-
}
|
|
31
|
+
await client.call('applySchemaPatch', {
|
|
32
|
+
sessionId: session.sessionId,
|
|
33
|
+
items
|
|
34
|
+
});
|
|
52
35
|
|
|
53
|
-
const model = await client.call('
|
|
36
|
+
const model = await client.call('setModelValues', {
|
|
54
37
|
sessionId: session.sessionId,
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
]
|
|
61
|
-
}
|
|
38
|
+
set: [
|
|
39
|
+
{ target: 1, value: { 0: 'alice', 1: 'bob' } },
|
|
40
|
+
{ target: 2, value: { 0: 'zero', 1: 'one', 2: 'two' } },
|
|
41
|
+
{ target: 3, value: [[TUPLE_ID, 0, 1]] }
|
|
42
|
+
]
|
|
62
43
|
});
|
|
63
44
|
console.log('Model values set:', model);
|
|
64
45
|
|
|
65
|
-
const d1Eval = await client.call('
|
|
46
|
+
const d1Eval = await client.call('evaluate', {
|
|
66
47
|
sessionId: session.sessionId,
|
|
67
|
-
|
|
48
|
+
constituentId: 4
|
|
68
49
|
});
|
|
69
50
|
console.log('D1 (Pr1(S1)) evaluation:', d1Eval);
|
|
70
51
|
|
|
71
|
-
const a1Eval = await client.call('
|
|
52
|
+
const a1Eval = await client.call('evaluate', {
|
|
72
53
|
sessionId: session.sessionId,
|
|
73
|
-
|
|
54
|
+
constituentId: 5
|
|
74
55
|
});
|
|
75
56
|
console.log('A1 (1=1) evaluation:', a1Eval);
|
|
76
57
|
|
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
{
|
|
2
|
-
"contractVersion": "
|
|
2
|
+
"contractVersion": "2.0.0",
|
|
3
3
|
"state": {
|
|
4
|
-
"sessionId": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
4
|
+
"sessionId": "b86aa3b1-3a18-47e9-b025-4295ab9ba57c",
|
|
5
|
+
"alias": "",
|
|
6
|
+
"title": "",
|
|
7
|
+
"comment": "",
|
|
8
|
+
"createdAt": "2026-07-01T17:12:43.950Z",
|
|
9
|
+
"updatedAt": "2026-07-01T17:12:43.963Z",
|
|
7
10
|
"revisions": [
|
|
8
11
|
{
|
|
9
|
-
"revisionId": "
|
|
10
|
-
"at": "2026-
|
|
12
|
+
"revisionId": "49f6f60f-04d2-435a-8d56-e31de745c581",
|
|
13
|
+
"at": "2026-07-01T17:12:43.963Z",
|
|
11
14
|
"message": "Built sample RSForm"
|
|
12
15
|
}
|
|
13
16
|
],
|
|
14
17
|
"items": [
|
|
15
18
|
{
|
|
16
|
-
"id":
|
|
17
|
-
"alias": "
|
|
18
|
-
"cstType": "
|
|
19
|
-
"definitionFormal": "",
|
|
19
|
+
"id": 5,
|
|
20
|
+
"alias": "A1",
|
|
21
|
+
"cstType": "axiom",
|
|
22
|
+
"definitionFormal": "1=1",
|
|
20
23
|
"term": "",
|
|
21
24
|
"definitionText": "",
|
|
22
25
|
"convention": "",
|
|
23
26
|
"analysis": {
|
|
24
27
|
"success": true,
|
|
25
28
|
"type": {
|
|
26
|
-
"typeID":
|
|
27
|
-
"base": {
|
|
28
|
-
"typeID": 3,
|
|
29
|
-
"baseID": "X1"
|
|
30
|
-
}
|
|
29
|
+
"typeID": 6
|
|
31
30
|
},
|
|
32
31
|
"valueClass": "value",
|
|
33
32
|
"diagnostics": []
|
|
@@ -57,14 +56,35 @@
|
|
|
57
56
|
"diagnostics": []
|
|
58
57
|
}
|
|
59
58
|
},
|
|
59
|
+
{
|
|
60
|
+
"id": 1,
|
|
61
|
+
"alias": "X1",
|
|
62
|
+
"cstType": "basic",
|
|
63
|
+
"definitionFormal": "",
|
|
64
|
+
"term": "",
|
|
65
|
+
"definitionText": "",
|
|
66
|
+
"convention": "",
|
|
67
|
+
"analysis": {
|
|
68
|
+
"success": true,
|
|
69
|
+
"type": {
|
|
70
|
+
"typeID": 5,
|
|
71
|
+
"base": {
|
|
72
|
+
"typeID": 3,
|
|
73
|
+
"baseID": "X1"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"valueClass": "value",
|
|
77
|
+
"diagnostics": []
|
|
78
|
+
}
|
|
79
|
+
},
|
|
60
80
|
{
|
|
61
81
|
"id": 3,
|
|
62
82
|
"alias": "S1",
|
|
63
83
|
"cstType": "structure",
|
|
64
84
|
"definitionFormal": "ℬ(X1×X1)",
|
|
65
|
-
"convention": "Pairs (parent, child) over X1.",
|
|
66
85
|
"term": "",
|
|
67
86
|
"definitionText": "",
|
|
87
|
+
"convention": "Pairs (parent, child) over X1.",
|
|
68
88
|
"analysis": {
|
|
69
89
|
"success": true,
|
|
70
90
|
"type": {
|
|
@@ -107,23 +127,6 @@
|
|
|
107
127
|
"valueClass": "value",
|
|
108
128
|
"diagnostics": []
|
|
109
129
|
}
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"id": 5,
|
|
113
|
-
"alias": "A1",
|
|
114
|
-
"cstType": "axiom",
|
|
115
|
-
"definitionFormal": "1=1",
|
|
116
|
-
"term": "",
|
|
117
|
-
"definitionText": "",
|
|
118
|
-
"convention": "",
|
|
119
|
-
"analysis": {
|
|
120
|
-
"success": true,
|
|
121
|
-
"type": {
|
|
122
|
-
"typeID": 6
|
|
123
|
-
},
|
|
124
|
-
"valueClass": "value",
|
|
125
|
-
"diagnostics": []
|
|
126
|
-
}
|
|
127
130
|
}
|
|
128
131
|
],
|
|
129
132
|
"model": {
|
|
@@ -1,33 +1,32 @@
|
|
|
1
1
|
{
|
|
2
|
-
"contractVersion": "
|
|
2
|
+
"contractVersion": "2.0.0",
|
|
3
3
|
"state": {
|
|
4
|
-
"sessionId": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
4
|
+
"sessionId": "4de6414b-d6a7-45c9-b950-2e622e0caa0e",
|
|
5
|
+
"alias": "",
|
|
6
|
+
"title": "",
|
|
7
|
+
"comment": "",
|
|
8
|
+
"createdAt": "2026-07-01T17:13:04.299Z",
|
|
9
|
+
"updatedAt": "2026-07-01T17:13:04.322Z",
|
|
7
10
|
"revisions": [
|
|
8
11
|
{
|
|
9
|
-
"revisionId": "
|
|
10
|
-
"at": "2026-
|
|
12
|
+
"revisionId": "9a11d6ff-a181-4680-b706-1507d776c5ac",
|
|
13
|
+
"at": "2026-07-01T17:13:04.322Z",
|
|
11
14
|
"message": "Built sample RSModel"
|
|
12
15
|
}
|
|
13
16
|
],
|
|
14
17
|
"items": [
|
|
15
18
|
{
|
|
16
|
-
"id":
|
|
17
|
-
"alias": "
|
|
18
|
-
"cstType": "
|
|
19
|
-
"definitionFormal": "",
|
|
19
|
+
"id": 5,
|
|
20
|
+
"alias": "A1",
|
|
21
|
+
"cstType": "axiom",
|
|
22
|
+
"definitionFormal": "1=1",
|
|
20
23
|
"term": "",
|
|
21
24
|
"definitionText": "",
|
|
22
25
|
"convention": "",
|
|
23
26
|
"analysis": {
|
|
24
27
|
"success": true,
|
|
25
28
|
"type": {
|
|
26
|
-
"typeID":
|
|
27
|
-
"base": {
|
|
28
|
-
"typeID": 3,
|
|
29
|
-
"baseID": "X1"
|
|
30
|
-
}
|
|
29
|
+
"typeID": 6
|
|
31
30
|
},
|
|
32
31
|
"valueClass": "value",
|
|
33
32
|
"diagnostics": []
|
|
@@ -57,14 +56,35 @@
|
|
|
57
56
|
"diagnostics": []
|
|
58
57
|
}
|
|
59
58
|
},
|
|
59
|
+
{
|
|
60
|
+
"id": 1,
|
|
61
|
+
"alias": "X1",
|
|
62
|
+
"cstType": "basic",
|
|
63
|
+
"definitionFormal": "",
|
|
64
|
+
"term": "",
|
|
65
|
+
"definitionText": "",
|
|
66
|
+
"convention": "",
|
|
67
|
+
"analysis": {
|
|
68
|
+
"success": true,
|
|
69
|
+
"type": {
|
|
70
|
+
"typeID": 5,
|
|
71
|
+
"base": {
|
|
72
|
+
"typeID": 3,
|
|
73
|
+
"baseID": "X1"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"valueClass": "value",
|
|
77
|
+
"diagnostics": []
|
|
78
|
+
}
|
|
79
|
+
},
|
|
60
80
|
{
|
|
61
81
|
"id": 3,
|
|
62
82
|
"alias": "S1",
|
|
63
83
|
"cstType": "structure",
|
|
64
84
|
"definitionFormal": "ℬ(X1×X1)",
|
|
65
|
-
"convention": "Pairs (parent, child) over X1.",
|
|
66
85
|
"term": "",
|
|
67
86
|
"definitionText": "",
|
|
87
|
+
"convention": "Pairs (parent, child) over X1.",
|
|
68
88
|
"analysis": {
|
|
69
89
|
"success": true,
|
|
70
90
|
"type": {
|
|
@@ -107,23 +127,6 @@
|
|
|
107
127
|
"valueClass": "value",
|
|
108
128
|
"diagnostics": []
|
|
109
129
|
}
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
"id": 5,
|
|
113
|
-
"alias": "A1",
|
|
114
|
-
"cstType": "axiom",
|
|
115
|
-
"definitionFormal": "1=1",
|
|
116
|
-
"term": "",
|
|
117
|
-
"definitionText": "",
|
|
118
|
-
"convention": "",
|
|
119
|
-
"analysis": {
|
|
120
|
-
"success": true,
|
|
121
|
-
"type": {
|
|
122
|
-
"typeID": 6
|
|
123
|
-
},
|
|
124
|
-
"valueClass": "value",
|
|
125
|
-
"diagnostics": []
|
|
126
|
-
}
|
|
127
130
|
}
|
|
128
131
|
],
|
|
129
132
|
"model": {
|
|
@@ -3,7 +3,9 @@ import { resolve } from 'node:path';
|
|
|
3
3
|
|
|
4
4
|
import { TUPLE_ID } from '@rsconcept/domain';
|
|
5
5
|
|
|
6
|
-
import { CstType, EvalStatus, RSToolWrapperClient, type
|
|
6
|
+
import { CstType, EvalStatus, RSToolWrapperClient, type AgentConstituentaPatch } from '../../src';
|
|
7
|
+
|
|
8
|
+
type DraftBatch = { draft: AgentConstituentaPatch };
|
|
7
9
|
|
|
8
10
|
import {
|
|
9
11
|
D1_ID,
|
|
@@ -42,7 +44,7 @@ const S2_VALUE = [
|
|
|
42
44
|
async function buildSchema(client: RSToolWrapperClient): Promise<string> {
|
|
43
45
|
const session = await client.call<{ sessionId: string }>('createSession');
|
|
44
46
|
|
|
45
|
-
const drafts:
|
|
47
|
+
const drafts: DraftBatch[] = [
|
|
46
48
|
{
|
|
47
49
|
draft: {
|
|
48
50
|
id: T1_ID,
|
|
@@ -144,18 +146,21 @@ async function buildSchema(client: RSToolWrapperClient): Promise<string> {
|
|
|
144
146
|
}
|
|
145
147
|
];
|
|
146
148
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
149
|
+
const patch = await client.call<{
|
|
150
|
+
success: boolean;
|
|
151
|
+
summary: { items: Array<{ alias: string; analysisSuccess: boolean }> };
|
|
152
|
+
failed: Array<{ draft: { alias: string } }>;
|
|
153
|
+
}>('applySchemaPatch', {
|
|
154
|
+
sessionId: session.sessionId,
|
|
155
|
+
mode: 'atomic',
|
|
156
|
+
items: drafts.map(entry => entry.draft)
|
|
157
|
+
});
|
|
158
|
+
if (!patch.success) {
|
|
159
|
+
const failedAlias = patch.failed[0]?.draft.alias ?? 'unknown';
|
|
160
|
+
throw new Error(`${failedAlias}: analysis failed`);
|
|
161
|
+
}
|
|
162
|
+
for (const item of patch.summary.items) {
|
|
163
|
+
console.log(`${item.alias}: OK`);
|
|
159
164
|
}
|
|
160
165
|
|
|
161
166
|
await client.call('commitStep', {
|
|
@@ -167,20 +172,18 @@ async function buildSchema(client: RSToolWrapperClient): Promise<string> {
|
|
|
167
172
|
}
|
|
168
173
|
|
|
169
174
|
async function verifyModel(client: RSToolWrapperClient, schemaJson: string) {
|
|
170
|
-
const imported = await client.call<{ sessionId: string }>('
|
|
175
|
+
const imported = await client.call<{ sessionId: string }>('importData', {
|
|
171
176
|
payload: schemaJson
|
|
172
177
|
});
|
|
173
178
|
|
|
174
|
-
await client.call('
|
|
179
|
+
await client.call('setModelValues', {
|
|
175
180
|
sessionId: imported.sessionId,
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
]
|
|
183
|
-
}
|
|
181
|
+
set: [
|
|
182
|
+
{ target: X1_ID, value: X1_BINDING },
|
|
183
|
+
{ target: X2_ID, value: X2_BINDING },
|
|
184
|
+
{ target: S1_ID, value: S1_VALUE },
|
|
185
|
+
{ target: S2_ID, value: S2_VALUE }
|
|
186
|
+
]
|
|
184
187
|
});
|
|
185
188
|
|
|
186
189
|
const recalculated = await client.call<{
|