@rsconcept/rstool 0.5.2 → 0.6.1

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.
@@ -0,0 +1,134 @@
1
+ {
2
+ "contractVersion": "1.3.0",
3
+ "state": {
4
+ "sessionId": "2d99e61f-79aa-471f-aaed-6965538e6fc8",
5
+ "createdAt": "2026-05-27T07:22:35.861Z",
6
+ "updatedAt": "2026-05-27T07:22:35.880Z",
7
+ "revisions": [
8
+ {
9
+ "revisionId": "14a15ffa-87c1-4ed7-bcf1-b8e6367fbd6d",
10
+ "at": "2026-05-27T07:22:35.880Z",
11
+ "message": "Built sample RSForm"
12
+ }
13
+ ],
14
+ "items": [
15
+ {
16
+ "id": 1,
17
+ "alias": "X1",
18
+ "cstType": "basic",
19
+ "definitionFormal": "",
20
+ "term": "",
21
+ "definitionText": "",
22
+ "convention": "",
23
+ "analysis": {
24
+ "success": true,
25
+ "type": {
26
+ "typeID": 5,
27
+ "base": {
28
+ "typeID": 3,
29
+ "baseID": "X1"
30
+ }
31
+ },
32
+ "valueClass": "value",
33
+ "diagnostics": []
34
+ }
35
+ },
36
+ {
37
+ "id": 2,
38
+ "alias": "C1",
39
+ "cstType": "constant",
40
+ "definitionFormal": "",
41
+ "term": "",
42
+ "definitionText": "",
43
+ "convention": "",
44
+ "analysis": {
45
+ "success": true,
46
+ "type": {
47
+ "typeID": 5,
48
+ "base": {
49
+ "typeID": 3,
50
+ "baseID": "C1",
51
+ "isOrdered": true,
52
+ "isArithmetic": true,
53
+ "isIntegerCompatible": true
54
+ }
55
+ },
56
+ "valueClass": "value",
57
+ "diagnostics": []
58
+ }
59
+ },
60
+ {
61
+ "id": 3,
62
+ "alias": "S1",
63
+ "cstType": "structure",
64
+ "definitionFormal": "ℬ(X1×X1)",
65
+ "convention": "Pairs (parent, child) over X1.",
66
+ "term": "",
67
+ "definitionText": "",
68
+ "analysis": {
69
+ "success": true,
70
+ "type": {
71
+ "typeID": 5,
72
+ "base": {
73
+ "typeID": 4,
74
+ "factors": [
75
+ {
76
+ "typeID": 3,
77
+ "baseID": "X1"
78
+ },
79
+ {
80
+ "typeID": 3,
81
+ "baseID": "X1"
82
+ }
83
+ ]
84
+ }
85
+ },
86
+ "valueClass": "value",
87
+ "diagnostics": []
88
+ }
89
+ },
90
+ {
91
+ "id": 4,
92
+ "alias": "D1",
93
+ "cstType": "term",
94
+ "definitionFormal": "Pr1(S1)",
95
+ "term": "",
96
+ "definitionText": "",
97
+ "convention": "",
98
+ "analysis": {
99
+ "success": true,
100
+ "type": {
101
+ "typeID": 5,
102
+ "base": {
103
+ "typeID": 3,
104
+ "baseID": "X1"
105
+ }
106
+ },
107
+ "valueClass": "value",
108
+ "diagnostics": []
109
+ }
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
+ }
128
+ ],
129
+ "model": {
130
+ "items": []
131
+ }
132
+ },
133
+ "diagnostics": []
134
+ }
@@ -0,0 +1,163 @@
1
+ {
2
+ "contractVersion": "1.3.0",
3
+ "state": {
4
+ "sessionId": "3026929f-c091-4bed-8fb7-fffd913c49bd",
5
+ "createdAt": "2026-05-27T07:22:37.637Z",
6
+ "updatedAt": "2026-05-27T07:22:37.665Z",
7
+ "revisions": [
8
+ {
9
+ "revisionId": "af453320-14f6-4ea8-abd2-f03201cec00d",
10
+ "at": "2026-05-27T07:22:37.665Z",
11
+ "message": "Built sample RSModel"
12
+ }
13
+ ],
14
+ "items": [
15
+ {
16
+ "id": 1,
17
+ "alias": "X1",
18
+ "cstType": "basic",
19
+ "definitionFormal": "",
20
+ "term": "",
21
+ "definitionText": "",
22
+ "convention": "",
23
+ "analysis": {
24
+ "success": true,
25
+ "type": {
26
+ "typeID": 5,
27
+ "base": {
28
+ "typeID": 3,
29
+ "baseID": "X1"
30
+ }
31
+ },
32
+ "valueClass": "value",
33
+ "diagnostics": []
34
+ }
35
+ },
36
+ {
37
+ "id": 2,
38
+ "alias": "C1",
39
+ "cstType": "constant",
40
+ "definitionFormal": "",
41
+ "term": "",
42
+ "definitionText": "",
43
+ "convention": "",
44
+ "analysis": {
45
+ "success": true,
46
+ "type": {
47
+ "typeID": 5,
48
+ "base": {
49
+ "typeID": 3,
50
+ "baseID": "C1",
51
+ "isOrdered": true,
52
+ "isArithmetic": true,
53
+ "isIntegerCompatible": true
54
+ }
55
+ },
56
+ "valueClass": "value",
57
+ "diagnostics": []
58
+ }
59
+ },
60
+ {
61
+ "id": 3,
62
+ "alias": "S1",
63
+ "cstType": "structure",
64
+ "definitionFormal": "ℬ(X1×X1)",
65
+ "convention": "Pairs (parent, child) over X1.",
66
+ "term": "",
67
+ "definitionText": "",
68
+ "analysis": {
69
+ "success": true,
70
+ "type": {
71
+ "typeID": 5,
72
+ "base": {
73
+ "typeID": 4,
74
+ "factors": [
75
+ {
76
+ "typeID": 3,
77
+ "baseID": "X1"
78
+ },
79
+ {
80
+ "typeID": 3,
81
+ "baseID": "X1"
82
+ }
83
+ ]
84
+ }
85
+ },
86
+ "valueClass": "value",
87
+ "diagnostics": []
88
+ }
89
+ },
90
+ {
91
+ "id": 4,
92
+ "alias": "D1",
93
+ "cstType": "term",
94
+ "definitionFormal": "Pr1(S1)",
95
+ "term": "",
96
+ "definitionText": "",
97
+ "convention": "",
98
+ "analysis": {
99
+ "success": true,
100
+ "type": {
101
+ "typeID": 5,
102
+ "base": {
103
+ "typeID": 3,
104
+ "baseID": "X1"
105
+ }
106
+ },
107
+ "valueClass": "value",
108
+ "diagnostics": []
109
+ }
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
+ }
128
+ ],
129
+ "model": {
130
+ "items": [
131
+ {
132
+ "id": 1,
133
+ "type": "basic",
134
+ "value": {
135
+ "0": "alice",
136
+ "1": "bob"
137
+ }
138
+ },
139
+ {
140
+ "id": 2,
141
+ "type": "basic",
142
+ "value": {
143
+ "0": "zero",
144
+ "1": "one",
145
+ "2": "two"
146
+ }
147
+ },
148
+ {
149
+ "id": 3,
150
+ "type": "ℬ(X1×X1)",
151
+ "value": [
152
+ [
153
+ -111,
154
+ 0,
155
+ 1
156
+ ]
157
+ ]
158
+ }
159
+ ]
160
+ }
161
+ },
162
+ "diagnostics": []
163
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsconcept/rstool",
3
- "version": "0.5.2",
3
+ "version": "0.6.1",
4
4
  "description": "Agent-facing library for incremental RSForm construction, RSLang analysis, diagnostics, modeling, and evaluation. Wraps @rsconcept/domain with a deterministic session contract and stdio wrapper.",
5
5
  "license": "MIT",
6
6
  "author": "IRBorisov",
@@ -35,6 +35,7 @@
35
35
  "./skills/rstool-helper/*": "./skills/rstool-helper/*",
36
36
  "./skills/INSTALL.md": "./skills/INSTALL.md",
37
37
  "./docs/*": "./docs/*",
38
+ "./examples/*": "./examples/*",
38
39
  "./package.json": "./package.json"
39
40
  },
40
41
  "bin": {
@@ -45,6 +46,7 @@
45
46
  "src",
46
47
  "skills",
47
48
  "docs",
49
+ "examples",
48
50
  "README.md",
49
51
  "LICENSE"
50
52
  ],
@@ -1,6 +1,6 @@
1
1
  # Примеры rstool
2
2
 
3
- Короткие примеры для агентов. Полные скрипты — `../../examples/`. Воркфлоу — [GUIDE.md](GUIDE.md).
3
+ Короткие примеры для агентов. Полные скрипты и JSON-сессии — `../../examples/` ([README](../../examples/README.md)). Воркфлоу — [GUIDE.md](GUIDE.md).
4
4
 
5
5
  ## Минимальная сессия
6
6
 
@@ -46,6 +46,21 @@
46
46
  9. Сохрани: `exportSession` / `importSession`.
47
47
  10. Для загрузки в Portal: `exportPortalSchema` (схема) или `exportPortalModel` (модель).
48
48
 
49
+ ### Оценка или правка КС из Portal
50
+
51
+ Когда пользователь даёт UI-ссылку вида `https://portal.acconcept.ru/rsforms/:id`,
52
+ не открывай SPA и не парси HTML. Преобразуй ссылку в REST API по правилам
53
+ [PORTAL-API.md](../../docs/PORTAL-API.md): метаданные `GET /api/rsforms/:id`,
54
+ полная КС `GET /api/rsforms/:id/details`, версия `GET /api/library/:id/versions/:version`.
55
+
56
+ Portal JSON из `/details` не является форматом `exportSession` и не передаётся в
57
+ `importSession` напрямую. Создай `createSession({ title, alias, comment: description })`
58
+ и перенеси `items[]` через `addOrUpdateConstituenta`, сохраняя raw-поля:
59
+ `cst_type → cstType`, `definition_formal → definitionFormal`,
60
+ `term_raw → term`, `definition_raw → definitionText`, `convention → convention`.
61
+ После переноса запусти `listDiagnostics`; для результата в Portal используй
62
+ `exportPortalSchema`, а для локального снапшота — `exportSession`.
63
+
49
64
  ### Концептуализация (КС из содержания источника)
50
65
 
51
66
  Когда нужно построить или существенно развить КС по тексту ПО, требованиям или предметному описанию. Правила редукции, слоёв и паттернов — [CONCEPTUAL-SCHEMA.md](../../docs/CONCEPTUAL-SCHEMA.md).
@@ -186,6 +186,10 @@ interface AnalysisResult {
186
186
  - `state.model.items[]` — присутствует, если заданы значения интерпретации.
187
187
  - `diagnostics[]` — накопленные диагностики со смещениями и кодами.
188
188
 
189
+ `importSession(payload)` принимает только этот формат `exportSession`. JSON Portal из
190
+ `GET /api/rsforms/:id/details` сначала переноси в сессию через `createSession` и
191
+ `addOrUpdateConstituenta`; поля и REST-пути описаны в `docs/PORTAL-API.md`.
192
+
189
193
  ## JSON импорта Portal
190
194
 
191
195
  Для **Load from JSON** на существующей схеме или модели Portal: