@rsconcept/rstool 1.0.0 → 1.0.2

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.
Files changed (43) hide show
  1. package/README.md +22 -4
  2. package/dist/{agent-workflow-D-PSIb-m.d.ts → agent-workflow-Gk0Vfnv1.d.ts} +3 -9
  3. package/dist/index.d.ts +3 -3
  4. package/dist/index.js +1 -2
  5. package/dist/models/agent-workflow.d.ts +2 -2
  6. package/dist/models/index.d.ts +3 -3
  7. package/dist/models/index.js +1 -1
  8. package/dist/models/rstool-agent.d.ts +1 -1
  9. package/dist/models/rstool-agent.js +1 -1
  10. package/dist/models/tool-contract.d.ts +1 -1
  11. package/dist/{rstool-agent-kijHA9ML.js → models-9G6ur_pg.js} +242 -34
  12. package/dist/models-9G6ur_pg.js.map +1 -0
  13. package/dist/{rstool-agent-_8bplZnb.d.ts → rstool-agent-D2cQze_b.d.ts} +3 -3
  14. package/dist/session/session-store.js +1 -1
  15. package/dist/{tool-contract-5_Q44DGE.d.ts → tool-contract-0uRGhEfW.d.ts} +2 -2
  16. package/dist/wrapper/stdio-wrapper.js +16 -14
  17. package/dist/wrapper/stdio-wrapper.js.map +1 -1
  18. package/docs/DIAGNOSTICS.md +23 -14
  19. package/examples/build-chocolate-nim-rsform.ts +150 -209
  20. package/examples/kinship/build-rsmodel.ts +5 -3
  21. package/examples/sample/build-rsform.ts +7 -9
  22. package/examples/sample/rsform-session.json +31 -31
  23. package/package.json +6 -4
  24. package/src/mappers/portal-adapter.ts +14 -8
  25. package/src/models/agent-workflow.ts +1 -13
  26. package/src/models/import-detect.test.ts +66 -0
  27. package/src/models/import-detect.ts +6 -3
  28. package/src/models/portal-json.test.ts +38 -0
  29. package/src/models/portal-json.ts +11 -2
  30. package/src/models/rstool-agent.test.ts +402 -3
  31. package/src/models/rstool-agent.ts +61 -17
  32. package/src/session/batch-apply.test.ts +132 -8
  33. package/src/session/batch-apply.ts +38 -0
  34. package/src/session/persistence.test.ts +66 -0
  35. package/src/session/persistence.ts +14 -1
  36. package/src/session/session-store.ts +10 -3
  37. package/src/wrapper/client.test.ts +58 -0
  38. package/src/wrapper/stdio-handler.test.ts +101 -0
  39. package/src/wrapper/stdio-handler.ts +195 -0
  40. package/src/wrapper/stdio-wrapper.ts +2 -195
  41. package/dist/rstool-agent-kijHA9ML.js.map +0 -1
  42. package/dist/session-store-C3jyOSqI.js +0 -142
  43. package/dist/session-store-C3jyOSqI.js.map +0 -1
@@ -1,9 +1,7 @@
1
1
  import { writeFile } from 'node:fs/promises';
2
2
  import { resolve } from 'node:path';
3
3
 
4
- import { CstType, RSToolWrapperClient, type AgentConstituentaPatch } from '../src';
5
-
6
- type DraftBatch = { draft: AgentConstituentaPatch };
4
+ import { CstType, RSToolWrapperClient, type AgentConstituentaPatch, type ApplySchemaPatchResult } from '../src';
7
5
 
8
6
  import { DEFAULT_RSFORM_SESSION_PATH } from './chocolate-nim/constants';
9
7
 
@@ -20,268 +18,211 @@ async function run() {
20
18
  await client.waitUntilReady();
21
19
  const session = await client.call<{ sessionId: string; contractVersion: string }>('createSession');
22
20
 
23
- const drafts: DraftBatch[] = [
21
+ const items: AgentConstituentaPatch[] = [
24
22
  {
25
- draft: {
26
- id: 1,
27
- alias: 'S1',
28
- cstType: CstType.STRUCTURED,
29
- definitionFormal: 'Z×Z',
30
- term: 'шоколадка',
31
- convention: 'Первая проекция — ширина, вторая — длина'
32
- }
23
+ id: 1,
24
+ alias: 'S1',
25
+ cstType: CstType.STRUCTURED,
26
+ definitionFormal: 'Z×Z',
27
+ term: 'шоколадка',
28
+ convention: 'Первая проекция — ширина, вторая — длина'
33
29
  },
34
30
  {
35
- draft: {
36
- id: 2,
37
- alias: 'D1',
38
- cstType: CstType.TERM,
39
- definitionFormal: 'pr1(S1)',
40
- term: 'ширина шоколадки'
41
- }
31
+ id: 2,
32
+ alias: 'D1',
33
+ cstType: CstType.TERM,
34
+ definitionFormal: 'pr1(S1)',
35
+ term: 'ширина шоколадки'
42
36
  },
43
37
  {
44
- draft: {
45
- id: 3,
46
- alias: 'D2',
47
- cstType: CstType.TERM,
48
- definitionFormal: 'pr2(S1)',
49
- term: 'длина шоколадки'
50
- }
38
+ id: 3,
39
+ alias: 'D2',
40
+ cstType: CstType.TERM,
41
+ definitionFormal: 'pr2(S1)',
42
+ term: 'длина шоколадки'
51
43
  },
52
44
  {
53
- draft: {
54
- id: 4,
55
- alias: 'S2',
56
- cstType: CstType.STRUCTURED,
57
- definitionFormal: 'Z×Z',
58
- term: 'отравленная долька',
59
- convention: 'Координаты отравленной дольки: первая проекция по ширине, вторая — по длине'
60
- }
45
+ id: 4,
46
+ alias: 'S2',
47
+ cstType: CstType.STRUCTURED,
48
+ definitionFormal: 'Z×Z',
49
+ term: 'отравленная долька',
50
+ convention: 'Координаты отравленной дольки: первая проекция по ширине, вторая — по длине'
61
51
  },
62
52
  {
63
- draft: {
64
- id: 5,
65
- alias: 'D3',
66
- cstType: CstType.TERM,
67
- definitionFormal: 'pr1(S2)',
68
- term: 'расположение отравленной дольки по ширине'
69
- }
53
+ id: 5,
54
+ alias: 'D3',
55
+ cstType: CstType.TERM,
56
+ definitionFormal: 'pr1(S2)',
57
+ term: 'расположение отравленной дольки по ширине'
70
58
  },
71
59
  {
72
- draft: {
73
- id: 6,
74
- alias: 'D4',
75
- cstType: CstType.TERM,
76
- definitionFormal: 'pr2(S2)',
77
- term: 'расположение отравленной дольки по длине'
78
- }
60
+ id: 6,
61
+ alias: 'D4',
62
+ cstType: CstType.TERM,
63
+ definitionFormal: 'pr2(S2)',
64
+ term: 'расположение отравленной дольки по длине'
79
65
  },
80
66
  {
81
- draft: {
82
- id: 7,
83
- alias: 'A1',
84
- cstType: CstType.AXIOM,
85
- definitionFormal: '(1≤D3)&(D3≤D1)&(1≤D4)&(D4≤D2)',
86
- term: 'отравленная долька в шоколадке',
87
- definitionText: 'Координаты отравленной дольки лежат в пределах шоколадки'
88
- }
67
+ id: 7,
68
+ alias: 'A1',
69
+ cstType: CstType.AXIOM,
70
+ definitionFormal: '(1≤D3)&(D3≤D1)&(1≤D4)&(D4≤D2)',
71
+ term: 'отравленная долька в шоколадке',
72
+ definitionText: 'Координаты отравленной дольки лежат в пределах шоколадки'
89
73
  },
90
74
  {
91
- draft: {
92
- id: 8,
93
- alias: 'P1',
94
- cstType: CstType.PREDICATE,
95
- definitionFormal: '[α∈Z] R{ξ:=α | ξ≥2 | ξ-2}=0',
96
- term: 'чётное?',
97
- convention: 'Для малых аргументов — прямое вычитание двойки; для больших нужно двоичное представление'
98
- }
75
+ id: 8,
76
+ alias: 'P1',
77
+ cstType: CstType.PREDICATE,
78
+ definitionFormal: '[α∈Z] R{ξ:=α | ξ≥2 | ξ-2}=0',
79
+ term: 'чётное?',
80
+ convention: 'Для малых аргументов — прямое вычитание двойки; для больших нужно двоичное представление'
99
81
  },
100
82
  {
101
- draft: {
102
- id: 9,
103
- alias: 'F1',
104
- cstType: CstType.FUNCTION,
105
- definitionFormal: '[α∈Z, σ∈ℬ(Z×R1)] debool(Pr2(Fi1[{α}](σ)))',
106
- term: 'значение элемента последовательности с данным номером',
107
- definitionText: 'Значение пары с заданным номером в последовательности пар'
108
- }
83
+ id: 9,
84
+ alias: 'F1',
85
+ cstType: CstType.FUNCTION,
86
+ definitionFormal: '[α∈Z, σ∈ℬ(Z×R1)] debool(Pr2(Fi1[{α}](σ)))',
87
+ term: 'значение элемента последовательности с данным номером',
88
+ definitionText: 'Значение пары с заданным номером в последовательности пар'
109
89
  },
110
90
  {
111
- draft: {
112
- id: 10,
113
- alias: 'F2',
114
- cstType: CstType.FUNCTION,
115
- definitionFormal: '[σ∈ℬ(Z)] debool(D{ξ∈σ | ∀α∈σ α≤ξ})',
116
- term: 'максимум набора чисел'
117
- }
91
+ id: 10,
92
+ alias: 'F2',
93
+ cstType: CstType.FUNCTION,
94
+ definitionFormal: '[σ∈ℬ(Z)] debool(D{ξ∈σ | ∀α∈σ α≤ξ})',
95
+ term: 'максимум набора чисел'
118
96
  },
119
97
  {
120
- draft: {
121
- id: 11,
122
- alias: 'F4',
123
- cstType: CstType.FUNCTION,
124
- definitionFormal: '[σ∈ℬ(Z)] D{ξ∈σ | ∀α∈σ α≤ξ}',
125
- term: 'верхние границы набора чисел',
126
- definitionText: 'Множество элементов набора, не меньших всех остальных'
127
- }
98
+ id: 11,
99
+ alias: 'F4',
100
+ cstType: CstType.FUNCTION,
101
+ definitionFormal: '[σ∈ℬ(Z)] D{ξ∈σ | ∀α∈σ α≤ξ}',
102
+ term: 'верхние границы набора чисел',
103
+ definitionText: 'Множество элементов набора, не меньших всех остальных'
128
104
  },
129
105
  {
130
- draft: {
131
- id: 12,
132
- alias: 'F5',
133
- cstType: CstType.FUNCTION,
134
- definitionFormal: '[α∈Z, β∈Z] debool(I{(α,0) | α<β} ∪ I{(α-β,1) | α≥β})',
135
- term: 'деление с остатком на степень двойки',
136
- convention: 'Предполагается, что удвоенный делитель больше делимого'
137
- }
106
+ id: 12,
107
+ alias: 'F5',
108
+ cstType: CstType.FUNCTION,
109
+ definitionFormal: '[α∈Z, β∈Z] debool(I{(α,0) | α<β} ∪ I{(α-β,1) | α≥β})',
110
+ term: 'деление с остатком на степень двойки',
111
+ convention: 'Предполагается, что удвоенный делитель больше делимого'
138
112
  },
139
113
  {
140
- draft: {
141
- id: 13,
142
- alias: 'F6',
143
- cstType: CstType.FUNCTION,
144
- definitionFormal: '[α∈Z, β∈Z] pr1(F5[α, β])',
145
- term: 'остаток'
146
- }
114
+ id: 13,
115
+ alias: 'F6',
116
+ cstType: CstType.FUNCTION,
117
+ definitionFormal: '[α∈Z, β∈Z] pr1(F5[α, β])',
118
+ term: 'остаток'
147
119
  },
148
120
  {
149
- draft: {
150
- id: 14,
151
- alias: 'F7',
152
- cstType: CstType.FUNCTION,
153
- definitionFormal: '[α∈Z, β∈Z] pr2(F5[α, β])',
154
- term: 'целая часть'
155
- }
121
+ id: 14,
122
+ alias: 'F7',
123
+ cstType: CstType.FUNCTION,
124
+ definitionFormal: '[α∈Z, β∈Z] pr2(F5[α, β])',
125
+ term: 'целая часть'
156
126
  },
157
127
  {
158
- draft: {
159
- id: 15,
160
- alias: 'D5',
161
- cstType: CstType.TERM,
162
- definitionFormal: '{(0, D3-1), (1, D4-1), (2, D1-D3), (3, D2-D4)}',
163
- term: 'шоколадка как кучки Ним',
164
- definitionText: 'Четыре кучки камней после разреза по отравленной дольке: слева, сверху, справа и снизу'
165
- }
128
+ id: 15,
129
+ alias: 'D5',
130
+ cstType: CstType.TERM,
131
+ definitionFormal: '{(0, D3-1), (1, D4-1), (2, D1-D3), (3, D2-D4)}',
132
+ term: 'шоколадка как кучки Ним',
133
+ definitionText: 'Четыре кучки камней после разреза по отравленной дольке: слева, сверху, справа и снизу'
166
134
  },
167
135
  {
168
- draft: {
169
- id: 16,
170
- alias: 'D6',
171
- cstType: CstType.TERM,
172
- definitionFormal: 'card(D5)',
173
- term: 'количество кучек'
174
- }
136
+ id: 16,
137
+ alias: 'D6',
138
+ cstType: CstType.TERM,
139
+ definitionFormal: 'card(D5)',
140
+ term: 'количество кучек'
175
141
  },
176
142
  {
177
- draft: {
178
- id: 17,
179
- alias: 'D7',
180
- cstType: CstType.TERM,
181
- definitionFormal: 'Pr1(D5)',
182
- term: 'номера кучек'
183
- }
143
+ id: 17,
144
+ alias: 'D7',
145
+ cstType: CstType.TERM,
146
+ definitionFormal: 'Pr1(D5)',
147
+ term: 'номера кучек'
184
148
  },
185
149
  {
186
- draft: {
187
- id: 18,
188
- alias: 'D8',
189
- cstType: CstType.TERM,
190
- definitionFormal: 'Pr2(D5)',
191
- term: 'размеры кучек'
192
- }
150
+ id: 18,
151
+ alias: 'D8',
152
+ cstType: CstType.TERM,
153
+ definitionFormal: 'Pr2(D5)',
154
+ term: 'размеры кучек'
193
155
  },
194
156
  {
195
- draft: {
196
- id: 19,
197
- alias: 'A2',
198
- cstType: CstType.AXIOM,
199
- definitionFormal: 'card(D5)=card(D7)',
200
- term: 'однозначность количества камней в кучках',
201
- definitionText: 'У каждой кучки ровно один номер'
202
- }
157
+ id: 19,
158
+ alias: 'A2',
159
+ cstType: CstType.AXIOM,
160
+ definitionFormal: 'card(D5)=card(D7)',
161
+ term: 'однозначность количества камней в кучках',
162
+ definitionText: 'У каждой кучки ровно один номер'
203
163
  },
204
164
  {
205
- draft: {
206
- id: 20,
207
- alias: 'A3',
208
- cstType: CstType.AXIOM,
209
- definitionFormal: '∀α∈D5 (pr1(α)<D6 & pr1(α)≥0)',
210
- term: 'последовательная нумерация кучек',
211
- definitionText: 'Номера кучек — целые от нуля до количества кучек минус один'
212
- }
165
+ id: 20,
166
+ alias: 'A3',
167
+ cstType: CstType.AXIOM,
168
+ definitionFormal: '∀α∈D5 (pr1(α)<D6 & pr1(α)≥0)',
169
+ term: 'последовательная нумерация кучек',
170
+ definitionText: 'Номера кучек — целые от нуля до количества кучек минус один'
213
171
  },
214
172
  {
215
- draft: {
216
- id: 21,
217
- alias: 'F8',
218
- cstType: CstType.FUNCTION,
219
- definitionFormal: '[α∈Z] F1[α,D5]',
220
- term: 'количество камней в данной кучке'
221
- }
173
+ id: 21,
174
+ alias: 'F8',
175
+ cstType: CstType.FUNCTION,
176
+ definitionFormal: '[α∈Z] F1[α,D5]',
177
+ term: 'количество камней в данной кучке'
222
178
  },
223
179
  {
224
- draft: {
225
- id: 22,
226
- alias: 'D9',
227
- cstType: CstType.TERM,
228
- definitionFormal: 'Pr1(Fi2[{0}](D5))',
229
- term: 'пустые кучки',
230
- definitionText: 'Номера кучек с нулевым размером'
231
- }
180
+ id: 22,
181
+ alias: 'D9',
182
+ cstType: CstType.TERM,
183
+ definitionFormal: 'Pr1(Fi2[{0}](D5))',
184
+ term: 'пустые кучки',
185
+ definitionText: 'Номера кучек с нулевым размером'
232
186
  },
233
187
  {
234
- draft: {
235
- id: 23,
236
- alias: 'D10',
237
- cstType: CstType.TERM,
238
- definitionFormal: 'D7\\D9',
239
- term: 'непустые кучки',
240
- definitionText: 'Номера кучек с положительным размером'
241
- }
188
+ id: 23,
189
+ alias: 'D10',
190
+ cstType: CstType.TERM,
191
+ definitionFormal: 'D7\\D9',
192
+ term: 'непустые кучки',
193
+ definitionText: 'Номера кучек с положительным размером'
242
194
  },
243
195
  {
244
- draft: {
245
- id: 24,
246
- alias: 'T1',
247
- cstType: CstType.STATEMENT,
248
- definitionFormal: 'D8={0}',
249
- term: 'игра закончена',
250
- definitionText: 'Во всех кучках не осталось камней'
251
- }
196
+ id: 24,
197
+ alias: 'T1',
198
+ cstType: CstType.STATEMENT,
199
+ definitionFormal: 'D8={0}',
200
+ term: 'игра закончена',
201
+ definitionText: 'Во всех кучках не осталось камней'
252
202
  },
253
203
  {
254
- draft: {
255
- id: 25,
256
- alias: 'T2',
257
- cstType: CstType.STATEMENT,
258
- definitionFormal: 'card(D10)=1',
259
- term: 'существует выигрышный ход',
260
- definitionText: 'Осталась ровно одна непустая кучка'
261
- }
204
+ id: 25,
205
+ alias: 'T2',
206
+ cstType: CstType.STATEMENT,
207
+ definitionFormal: 'card(D10)=1',
208
+ term: 'существует выигрышный ход',
209
+ definitionText: 'Осталась ровно одна непустая кучка'
262
210
  },
263
211
  {
264
- draft: {
265
- id: 26,
266
- alias: 'F10',
267
- cstType: CstType.FUNCTION,
268
- definitionFormal: '[σ∈D7×Z] debool(I{ pr2(σ)*D2 | P1[pr1(σ)]} ∪ I{ pr2(σ)*D1 | ¬P1[pr1(σ)]})',
269
- term: 'оценка хода Ним',
270
- definitionText:
271
- 'Стоимость хода в дольках шоколадки: для чётного номера кучки — размер, умноженный на длину, иначе — на ширину'
272
- }
212
+ id: 26,
213
+ alias: 'F10',
214
+ cstType: CstType.FUNCTION,
215
+ definitionFormal: '[σ∈D7×Z] debool(I{ pr2(σ)*D2 | P1[pr1(σ)]} ∪ I{ pr2(σ)*D1 | ¬P1[pr1(σ)]})',
216
+ term: 'оценка хода Ним',
217
+ definitionText:
218
+ 'Стоимость хода в дольках шоколадки: для чётного номера кучки — размер, умноженный на длину, иначе — на ширину'
273
219
  }
274
220
  ];
275
221
 
276
- const patch = await client.call<{
277
- success: boolean;
278
- diagnostics: unknown[];
279
- failed: Array<{ draft: { alias: string }; diagnostics: unknown[] }>;
280
- summary: { items: Array<{ alias: string; analysisSuccess: boolean }> };
281
- }>('applySchemaPatch', {
222
+ const patch = await client.call<ApplySchemaPatchResult>('applySchemaPatch', {
282
223
  sessionId: session.sessionId,
283
224
  mode: 'atomic',
284
- items: drafts.map(entry => entry.draft)
225
+ items
285
226
  });
286
227
 
287
228
  for (const item of patch.summary.items) {
@@ -10,9 +10,11 @@ import {
10
10
  D3_ID,
11
11
  DEFAULT_RSFORM_SESSION_PATH,
12
12
  DEFAULT_RSMODEL_SESSION_PATH,
13
+ S1_ID,
13
14
  S2_ID,
14
15
  S3_ID,
15
- S4_ID
16
+ S4_ID,
17
+ X1_ID
16
18
  } from './constants';
17
19
 
18
20
  /**
@@ -68,8 +70,8 @@ async function run() {
68
70
  await client.call('setModelValues', {
69
71
  sessionId: imported.sessionId,
70
72
  set: [
71
- { target: 1, value: X1_BINDING },
72
- { target: 2, value: S1_VALUE },
73
+ { target: X1_ID, value: X1_BINDING },
74
+ { target: S1_ID, value: S1_VALUE },
73
75
  { target: S2_ID, value: S2_VALUE },
74
76
  { target: S3_ID, value: S3_VALUE },
75
77
  { target: S4_ID, value: S4_VALUE }
@@ -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 AgentConstituentaPatch } from '../../src';
4
+ import { CstType, RSToolWrapperClient, type AgentConstituentaPatch, type ApplySchemaPatchResult } from '../../src';
5
5
 
6
6
  async function run() {
7
7
  const client = new RSToolWrapperClient({
@@ -26,16 +26,14 @@ async function run() {
26
26
  { id: 5, alias: 'A1', cstType: CstType.AXIOM, definitionFormal: '1=1' }
27
27
  ];
28
28
 
29
- const result = await client.call<{ diagnostics: unknown[]; summary: { items: { alias: string }[] } }>(
30
- 'applySchemaPatch',
31
- {
32
- sessionId: session.sessionId,
33
- items
34
- }
35
- );
29
+ const result = await client.call<ApplySchemaPatchResult>('applySchemaPatch', {
30
+ sessionId: session.sessionId,
31
+ items
32
+ });
36
33
  for (const item of result.summary.items) {
37
- console.log(`Added ${item.alias}:`, result.diagnostics?.length ?? 0, 'diagnostics');
34
+ console.log(`Added ${item.alias}`);
38
35
  }
36
+ console.log(`Patch diagnostics: ${result.diagnostics.length}`);
39
37
 
40
38
  await client.call('commitStep', {
41
39
  sessionId: session.sessionId,
@@ -1,32 +1,36 @@
1
1
  {
2
2
  "contractVersion": "2.0.0",
3
3
  "state": {
4
- "sessionId": "b86aa3b1-3a18-47e9-b025-4295ab9ba57c",
4
+ "sessionId": "a03eec4c-6519-4088-9d8c-0a9c11611583",
5
5
  "alias": "",
6
6
  "title": "",
7
7
  "comment": "",
8
- "createdAt": "2026-07-01T17:12:43.950Z",
9
- "updatedAt": "2026-07-01T17:12:43.963Z",
8
+ "createdAt": "2026-07-01T21:33:21.321Z",
9
+ "updatedAt": "2026-07-01T21:33:21.332Z",
10
10
  "revisions": [
11
11
  {
12
- "revisionId": "49f6f60f-04d2-435a-8d56-e31de745c581",
13
- "at": "2026-07-01T17:12:43.963Z",
12
+ "revisionId": "4ec113d2-1d28-4bac-bed8-6a593bb6b0e2",
13
+ "at": "2026-07-01T21:33:21.332Z",
14
14
  "message": "Built sample RSForm"
15
15
  }
16
16
  ],
17
17
  "items": [
18
18
  {
19
- "id": 5,
20
- "alias": "A1",
21
- "cstType": "axiom",
22
- "definitionFormal": "1=1",
19
+ "id": 1,
20
+ "alias": "X1",
21
+ "cstType": "basic",
22
+ "definitionFormal": "",
23
23
  "term": "",
24
24
  "definitionText": "",
25
25
  "convention": "",
26
26
  "analysis": {
27
27
  "success": true,
28
28
  "type": {
29
- "typeID": 6
29
+ "typeID": 5,
30
+ "base": {
31
+ "typeID": 3,
32
+ "baseID": "X1"
33
+ }
30
34
  },
31
35
  "valueClass": "value",
32
36
  "diagnostics": []
@@ -56,27 +60,6 @@
56
60
  "diagnostics": []
57
61
  }
58
62
  },
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
- },
80
63
  {
81
64
  "id": 3,
82
65
  "alias": "S1",
@@ -127,6 +110,23 @@
127
110
  "valueClass": "value",
128
111
  "diagnostics": []
129
112
  }
113
+ },
114
+ {
115
+ "id": 5,
116
+ "alias": "A1",
117
+ "cstType": "axiom",
118
+ "definitionFormal": "1=1",
119
+ "term": "",
120
+ "definitionText": "",
121
+ "convention": "",
122
+ "analysis": {
123
+ "success": true,
124
+ "type": {
125
+ "typeID": 6
126
+ },
127
+ "valueClass": "value",
128
+ "diagnostics": []
129
+ }
130
130
  }
131
131
  ],
132
132
  "model": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsconcept/rstool",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Agent-facing library for incremental RSForm construction, RSLang analysis, diagnostics, modeling, and evaluation. Wraps @rsconcept/domain with a deterministic session contract.",
5
5
  "license": "MIT",
6
6
  "author": "IRBorisov",
@@ -54,6 +54,7 @@
54
54
  "build": "tsdown",
55
55
  "typecheck": "tsc -p tsconfig.json --noEmit",
56
56
  "test": "vitest run",
57
+ "test:coverage": "vitest run --coverage",
57
58
  "wrapper": "tsx src/wrapper/stdio-wrapper.ts",
58
59
  "example:client": "tsx examples/agent-client.ts",
59
60
  "example:build-schema": "tsx examples/sample/build-rsform.ts",
@@ -70,12 +71,13 @@
70
71
  "prepublishOnly": "npm run build"
71
72
  },
72
73
  "dependencies": {
73
- "@rsconcept/domain": "^1.6.1"
74
+ "@rsconcept/domain": "^1.7.4"
74
75
  },
75
76
  "devDependencies": {
76
- "@types/node": "^26.0.1",
77
+ "@types/node": "^26.1.0",
78
+ "@vitest/coverage-v8": "^4.1.9",
77
79
  "tsdown": "^0.22.3",
78
- "tsx": "^4.22.4",
80
+ "tsx": "^4.22.5",
79
81
  "typescript": "^6.0.3",
80
82
  "vitest": "^4.1.9"
81
83
  },
@@ -1,8 +1,15 @@
1
1
  import { type ConstituentaDraft } from '../models/constituenta';
2
- import { type PortalRsformDetails, type PortalSchemaImportData, portalItemToDraft } from '../models/portal-json';
2
+ import {
3
+ type PortalImportMetadata,
4
+ type PortalRsformDetails,
5
+ type PortalSchemaImportData,
6
+ portalItemToDraft
7
+ } from '../models/portal-json';
3
8
  import { type SessionState } from '../models/session';
4
9
 
5
- export function portalSchemaToSessionSeed(data: PortalSchemaImportData): Partial<SessionState> {
10
+ type PortalSessionSeedInput = Partial<Pick<PortalImportMetadata, 'alias' | 'title' | 'description'>>;
11
+
12
+ function portalMetadataToSessionSeed(data: PortalSessionSeedInput): Partial<SessionState> {
6
13
  return {
7
14
  alias: data.alias ?? '',
8
15
  title: data.title ?? '',
@@ -11,13 +18,12 @@ export function portalSchemaToSessionSeed(data: PortalSchemaImportData): Partial
11
18
  };
12
19
  }
13
20
 
21
+ export function portalSchemaToSessionSeed(data: PortalSchemaImportData): Partial<SessionState> {
22
+ return portalMetadataToSessionSeed(data);
23
+ }
24
+
14
25
  export function portalDetailsToSessionSeed(data: PortalRsformDetails): Partial<SessionState> {
15
- return {
16
- alias: data.alias ?? '',
17
- title: data.title ?? '',
18
- comment: data.description ?? '',
19
- items: []
20
- };
26
+ return portalMetadataToSessionSeed(data);
21
27
  }
22
28
 
23
29
  export function portalItemsToDrafts(