@rsconcept/rstool 0.1.0 → 0.2.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.
Files changed (77) hide show
  1. package/README.md +21 -26
  2. package/dist/analysis-JiwOYDKx.d.ts +16 -0
  3. package/dist/common-DxLg3eXX.d.ts +17 -0
  4. package/dist/constituenta-Dnd6iToB.d.ts +36 -0
  5. package/dist/diagnostic-BMYvciz8.d.ts +15 -0
  6. package/dist/evaluation-CCVYH0wA.d.ts +21 -0
  7. package/dist/index.d.ts +12 -15
  8. package/dist/index.js +7 -585
  9. package/dist/mappers/model-adapter.d.ts +18 -23
  10. package/dist/mappers/model-adapter.js +183 -231
  11. package/dist/mappers/model-adapter.js.map +1 -1
  12. package/dist/mappers/schema-adapter.d.ts +16 -18
  13. package/dist/mappers/schema-adapter.js +55 -84
  14. package/dist/mappers/schema-adapter.js.map +1 -1
  15. package/dist/mappers/types.d.ts +15 -16
  16. package/dist/mappers/types.js +16 -17
  17. package/dist/mappers/types.js.map +1 -1
  18. package/dist/model-value-SFAVj0dw.d.ts +35 -0
  19. package/dist/models/analysis.d.ts +2 -18
  20. package/dist/models/analysis.js +1 -1
  21. package/dist/models/common.d.ts +2 -15
  22. package/dist/models/common.js +1 -8
  23. package/dist/models/constituenta.d.ts +2 -38
  24. package/dist/models/constituenta.js +1 -1
  25. package/dist/models/diagnostic.d.ts +2 -17
  26. package/dist/models/diagnostic.js +1 -1
  27. package/dist/models/evaluation.d.ts +2 -23
  28. package/dist/models/evaluation.js +1 -1
  29. package/dist/models/index.d.ts +10 -13
  30. package/dist/models/index.js +4 -491
  31. package/dist/models/model-value.d.ts +2 -37
  32. package/dist/models/model-value.js +1 -1
  33. package/dist/models/rstool-agent.d.ts +2 -36
  34. package/dist/models/rstool-agent.js +90 -477
  35. package/dist/models/rstool-agent.js.map +1 -1
  36. package/dist/models/session.d.ts +2 -29
  37. package/dist/models/session.js +1 -1
  38. package/dist/models/tool-contract.d.ts +2 -33
  39. package/dist/models/tool-contract.js +5 -5
  40. package/dist/models/tool-contract.js.map +1 -1
  41. package/dist/rstool-agent-DkeH5Qml.d.ts +33 -0
  42. package/dist/session/session-store.d.ts +14 -21
  43. package/dist/session/session-store.js +59 -63
  44. package/dist/session/session-store.js.map +1 -1
  45. package/dist/session-BHGCCLfQ.d.ts +24 -0
  46. package/dist/tool-contract-CsGqg_0P.d.ts +30 -0
  47. package/dist/wrapper/client.d.ts +26 -24
  48. package/dist/wrapper/client.js +90 -93
  49. package/dist/wrapper/client.js.map +1 -1
  50. package/dist/wrapper/stdio-wrapper.d.ts +1 -1
  51. package/dist/wrapper/stdio-wrapper.js +166 -664
  52. package/dist/wrapper/stdio-wrapper.js.map +1 -1
  53. package/docs/CONCEPTUAL-SCHEMA.md +168 -0
  54. package/docs/CONSTITUENTA.md +46 -23
  55. package/docs/DIAGNOSTICS.md +79 -74
  56. package/docs/DOMAIN.md +32 -30
  57. package/docs/GRAMMAR-REF.md +55 -55
  58. package/docs/PORTAL-API.md +7 -10
  59. package/docs/README.md +1 -0
  60. package/docs/SYNTAX.md +32 -32
  61. package/docs/TYPIFICATION.md +14 -9
  62. package/package.json +8 -7
  63. package/skills/INSTALL.md +35 -0
  64. package/skills/README.md +17 -9
  65. package/skills/rstool-helper/EXAMPLES.md +51 -10
  66. package/skills/rstool-helper/GUIDE.md +141 -0
  67. package/skills/rstool-helper/REFERENCE.md +5 -3
  68. package/skills/rstool-helper/SKILL.md +23 -134
  69. package/dist/index.js.map +0 -1
  70. package/dist/models/analysis.js.map +0 -1
  71. package/dist/models/common.js.map +0 -1
  72. package/dist/models/constituenta.js.map +0 -1
  73. package/dist/models/diagnostic.js.map +0 -1
  74. package/dist/models/evaluation.js.map +0 -1
  75. package/dist/models/index.js.map +0 -1
  76. package/dist/models/model-value.js.map +0 -1
  77. package/dist/models/session.js.map +0 -1
package/docs/DOMAIN.md CHANGED
@@ -18,20 +18,22 @@ A **constituent** is the atomic building block of a conceptual schema. Each cons
18
18
 
19
19
  Constituent aliases follow a strict prefix scheme:
20
20
 
21
- | Alias prefix | Role | Notes |
22
- |-----|------|-------|
23
- | `N#` | Nominoid | Free vocabulary item, no formal definition |
24
- | `X#` | Base set | Undefined concept, set of distinguishable elements |
25
- | `C#` | Constant set | Undefined concept, set-theoretic constant with operations |
26
- | `S#` | Structured concept | Undefined concept with explicit typification, axioms, convention |
27
- | `D#` | Term | Derived concept (set / value) defined by a formal expression |
28
- | `F#` | Term-function | Parameterised derived concept yielding an STE |
29
- | `P#` | Predicate-function | Parameterised derived concept yielding a logical expression |
30
- | `A#` | Axiom | Logical statement asserting requirements |
31
- | `T#` | Statement | Logical assertion about the model |
32
- | `R#` | Radical | Template placeholder for arbitrary typification |
33
-
34
- **Undefined concepts** (`X#`, `C#`, `S#`) are introduced by conventions (and optional axioms); they have **no formal definition**. **Derived concepts** (`D#`, `F#`, `P#`, `A#`, `T#`) carry a formal expression and must follow declaration order — every referenced constituent must already exist.
21
+ | Alias prefix | Role | Notes |
22
+ | ------------ | ---------------------------------------- | ----------------------------------------------------------------------------------------------- |
23
+ | `N#` | Nominoid | Free vocabulary item, no formal definition |
24
+ | `X#` | Base set | Undefined concept, set of elements |
25
+ | `C#` | Constant set | Undefined concept, set of elements, allows arithmetic predicates and operations |
26
+ | `S#` | Structured concept (**genus structure**) | Undefined concept; `definitionFormal` gives **typification**; meaning via `convention` / axioms |
27
+ | `D#` | Term | Derived concept; `definitionFormal` is the **definition**; value computed in a model |
28
+ | `F#` | Term-function | Parameterised derived concept yielding an STE |
29
+ | `P#` | Predicate-function | Parameterised derived concept yielding a logical expression |
30
+ | `A#` | Axiom | Logical statement asserting requirements |
31
+ | `T#` | Statement | Logical assertion about the model |
32
+ | `R#` | Radical | Template placeholder for arbitrary typification |
33
+
34
+ **Undefined concepts** (`X#`, `C#`, `S#`) are introduced by conventions (and optional axioms). For `S#`, the formal field states **typification** (the grade of elements), not a defining construction. **Derived concepts** (`D#`, `F#`, `P#`, `A#`, `T#`) carry a formal **definition** and must follow declaration order — every referenced constituent must already exist; their model values are obtained by evaluation.
35
+
36
+ **Structure vs term:** `S#` with `ℬ(X1×X1)` declares “elements are pairs over `X1`”; the actual pairs come from interpretation. `D#` with `X1×X1` as the whole expression denotes the **full Cartesian product** (all pairs), which is a computed set — use `S#` + projections when modeling a relation.
35
37
 
36
38
  A **crucial constituent** is marked as content-bearing for filtering / focus; it has no semantic effect on the formal calculus.
37
39
 
@@ -39,27 +41,27 @@ A **crucial constituent** is marked as content-bearing for filtering / focus; it
39
41
 
40
42
  Each constituent has one of the following correctness statuses:
41
43
 
42
- | Status | Meaning |
43
- |--------|---------|
44
- | Unknown | Not yet validated |
45
- | OK | Validated as correct |
46
- | Error | Validation failed |
47
- | Property | Defines a non-computable set; only membership tests are admissible |
48
- | Incalculable | Cannot be evaluated directly (e.g. expected exponential blow-up) |
44
+ | Status | Meaning |
45
+ | ------------ | ------------------------------------------------------------------ |
46
+ | Unknown | Not yet validated |
47
+ | OK | Validated as correct |
48
+ | Error | Validation failed |
49
+ | Property | Defines a non-computable set; only membership tests are admissible |
50
+ | Incalculable | Cannot be evaluated directly (e.g. expected exponential blow-up) |
49
51
 
50
52
  ## RSModel evaluation states
51
53
 
52
54
  In a conceptual model each item has one of the following evaluation statuses:
53
55
 
54
- | Status | Meaning |
55
- |--------|---------|
56
- | `NO_EVAL` (1) | Not evaluated (definition is not interpretable) |
57
- | `NOT_PROCESSED` (2) | Interpretation has not been computed yet |
58
- | `INVALID_DATA` (3) | Provided data is invalid |
59
- | `EVAL_FAIL` (4) | Evaluation raised an error |
60
- | `AXIOM_FALSE` (5) | Axiom evaluated to FALSE |
61
- | `EMPTY` (6) | Result is the empty set |
62
- | `HAS_DATA` (7) | Interpretation computed and non-empty |
56
+ | Status | Meaning |
57
+ | ------------------- | ----------------------------------------------- |
58
+ | `NO_EVAL` (1) | Not evaluated (definition is not interpretable) |
59
+ | `NOT_PROCESSED` (2) | Interpretation has not been computed yet |
60
+ | `INVALID_DATA` (3) | Provided data is invalid |
61
+ | `EVAL_FAIL` (4) | Evaluation raised an error |
62
+ | `AXIOM_FALSE` (5) | Axiom evaluated to FALSE |
63
+ | `EMPTY` (6) | Result is the empty set |
64
+ | `HAS_DATA` (7) | Interpretation computed and non-empty |
63
65
 
64
66
  ## Synthesis and OSS
65
67
 
@@ -1,79 +1,79 @@
1
1
  # Grammar reference (pointers)
2
2
 
3
- The full Lezer grammar ships inside `@rsconcept/domain` at `node_modules/@rsconcept/domain/src/rslang/parser/rslang.grammar`. The generated parser is `parser.ts` in the same folder. Below is a compact token map agents can use without opening the grammar.
3
+ Below is a compact token map agents can use without opening the grammar. For full grammar see `@rsconcept/domain` package.
4
4
 
5
5
  ## Token classes
6
6
 
7
- | Class | Tokens / examples |
8
- |-------|-------------------|
9
- | Whitespace | space, tab, newline |
10
- | Integer literal | `0`, `42` |
11
- | Empty set | `∅` |
12
- | Integer set | `Z` |
13
- | Globals | `X#`, `C#`, `S#`, `D#`, `F#`, `P#`, `A#`, `T#`, `N#`, `R#` |
14
- | Locals | `x`, `ξ`, `μ2`, `y1` |
15
- | Punctuation | `(`, `)`, `[`, `]`, `{`, `}`, `,`, `;` |
16
- | Comment | none — RSLang has no comments inside formal expressions |
7
+ | Class | Tokens / examples |
8
+ | --------------- | ---------------------------------------------------------- |
9
+ | Whitespace | space, tab, newline |
10
+ | Integer literal | `0`, `42` |
11
+ | Empty set | `∅` |
12
+ | Integer set | `Z` |
13
+ | Globals | `X#`, `C#`, `S#`, `D#`, `F#`, `P#`, `A#`, `T#`, `N#`, `R#` |
14
+ | Locals | `x`, `ξ`, `μ2`, `y1` |
15
+ | Punctuation | `(`, `)`, `[`, `]`, `{`, `}`, `,`, `;` |
16
+ | Comment | none — RSLang has no comments inside formal expressions |
17
17
 
18
18
  ## Set / structural operators
19
19
 
20
- | Token | Symbol |
21
- |-------|--------|
22
- | Union | `∪` |
23
- | Intersection | `∩` |
24
- | Difference | `\` |
25
- | Symmetric difference | `∆` |
26
- | Cartesian product | `×` |
27
- | Boolean | `ℬ` |
28
- | Sum set | `red` |
29
- | Singleton | `bool` |
30
- | Desingleton | `debool` |
31
- | Small projection | `pr1`, `pr1,3`, … |
32
- | Large projection | `Pr1`, `Pr2,4`, … |
33
- | Filter | `Fi1[D](S)`, `Fi1,2[D](S)` |
34
- | Cardinality | `card` |
20
+ | Token | Symbol |
21
+ | -------------------- | -------------------------- |
22
+ | Union | `∪` |
23
+ | Intersection | `∩` |
24
+ | Difference | `\` |
25
+ | Symmetric difference | `∆` |
26
+ | Cartesian product | `×` |
27
+ | Boolean | `ℬ` |
28
+ | Sum set | `red` |
29
+ | Singleton | `bool` |
30
+ | Desingleton | `debool` |
31
+ | Small projection | `pr1`, `pr1,3`, … |
32
+ | Large projection | `Pr1`, `Pr2,4`, … |
33
+ | Filter | `Fi1[D](S)`, `Fi1,2[D](S)` |
34
+ | Cardinality | `card` |
35
35
 
36
36
  ## Predicates
37
37
 
38
- | Token | Symbol |
39
- |-------|--------|
40
- | Membership | `∈` |
41
- | Non-membership | `∉` |
42
- | Inclusion | `⊆` |
43
- | Strict inclusion | `⊂` |
44
- | Non-inclusion | `⊄` |
45
- | Equality | `=` |
46
- | Inequality | `≠` |
47
- | Less | `<` |
48
- | Less-or-equal | `≤` |
49
- | Greater | `>` |
50
- | Greater-or-equal | `≥` |
38
+ | Token | Symbol |
39
+ | ---------------- | ------ |
40
+ | Membership | `∈` |
41
+ | Non-membership | `∉` |
42
+ | Inclusion | `⊆` |
43
+ | Strict inclusion | `⊂` |
44
+ | Non-inclusion | `⊄` |
45
+ | Equality | `=` |
46
+ | Inequality | `≠` |
47
+ | Less | `<` |
48
+ | Less-or-equal | `≤` |
49
+ | Greater | `>` |
50
+ | Greater-or-equal | `≥` |
51
51
 
52
52
  ## Logical connectives
53
53
 
54
- | Token | Symbol |
55
- |-------|--------|
56
- | Negation | `¬` |
57
- | Conjunction | `&` |
58
- | Disjunction | `∨` |
59
- | Implication | `⇒` |
60
- | Equivalence | `⇔` |
54
+ | Token | Symbol |
55
+ | ----------- | ------ |
56
+ | Negation | `¬` |
57
+ | Conjunction | `&` |
58
+ | Disjunction | `∨` |
59
+ | Implication | `⇒` |
60
+ | Equivalence | `⇔` |
61
61
 
62
62
  ## Quantifiers
63
63
 
64
- | Token | Symbol |
65
- |-------|--------|
66
- | Universal | `∀` |
67
- | Existential | `∃` |
64
+ | Token | Symbol |
65
+ | ----------- | ------ |
66
+ | Universal | `∀` |
67
+ | Existential | `∃` |
68
68
 
69
69
  ## Declarators
70
70
 
71
- | Token | Form |
72
- |-------|------|
73
- | Function declaration | `F# ::= [<params>] <body STE>` |
74
- | Predicate declaration | `P# ::= [<params>] <body LE>` |
71
+ | Token | Form |
72
+ | --------------------- | ------------------------------------------------- |
73
+ | Function declaration | `F# ::= [<params>] <body STE>` |
74
+ | Predicate declaration | `P# ::= [<params>] <body LE>` |
75
75
  | Parameter declaration | `α ∈ <STE>` (commas separate; commas inside `[]`) |
76
- | Function call | `F#[<arg1>, <arg2>, …]` |
76
+ | Function call | `F#[<arg1>, <arg2>, …]` |
77
77
 
78
78
  ## Precedence (from highest to lowest)
79
79
 
@@ -6,19 +6,16 @@ When an agent needs to **inspect existing** RSForms, OSS, or RSModels persisted
6
6
 
7
7
  - **UI:** `https://portal.acconcept.ru/`
8
8
  - **REST API:** `https://api.portal.acconcept.ru/`
9
- - **Local dev:** path prefix `/api/...`, base URL from `VITE_PORTAL_BACKEND`.
10
9
 
11
10
  ## Path rewrite rules
12
11
 
13
- Drop UI hash query params (`?tab=`, etc.). Keep numeric ids exactly as the UI shows them.
14
-
15
- | Portal UI path | REST target |
16
- |----------------|-------------|
17
- | `/rsforms/:id` | `GET /api/rsforms/:id` (metadata: owner, titles) |
18
- | `/rsforms/:id` (full payload) | `GET /api/rsforms/:id/details` |
19
- | `/rsforms/:id` (a saved version) | `GET /api/library/:id/versions/:version` |
20
- | `/oss/:id` | `GET /api/oss/:id` (and the sibling OSS viewset routes) |
21
- | `/models/:id` | `GET /api/models/:id` (RSModel router) |
12
+ | Portal UI path | REST target |
13
+ | -------------------------------- | ------------------------------------------------------- |
14
+ | `/rsforms/:id` | `GET /api/rsforms/:id` (metadata: owner, titles) |
15
+ | `/rsforms/:id` (full payload) | `GET /api/rsforms/:id/details` |
16
+ | `/rsforms/:id` (a saved version) | `GET /api/library/:id/versions/:version` |
17
+ | `/oss/:id` | `GET /api/oss/:id` (and the sibling OSS viewset routes) |
18
+ | `/models/:id` | `GET /api/models/:id` (RSModel router) |
22
19
 
23
20
  ## OpenAPI
24
21
 
package/docs/README.md CHANGED
@@ -5,6 +5,7 @@ Standalone English reference distilled from the Portal manuals and `CONTEXT.md`.
5
5
  | File | Read when |
6
6
  |------|-----------|
7
7
  | [`DOMAIN.md`](DOMAIN.md) | You need the Concept Portal vocabulary (constituenta, conceptual schema/model, OSS, synthesis). |
8
+ | [`CONCEPTUAL-SCHEMA.md`](CONCEPTUAL-SCHEMA.md) | You are designing/reviewing a conceptual schema as a system (thesaurus value, closed-world text definitions, genus structures, axioms). |
8
9
  | [`CONSTITUENTA.md`](CONSTITUENTA.md) | You are upserting constituents — fields, `cstType` table, validation rules, recommended order. |
9
10
  | [`SYNTAX.md`](SYNTAX.md) | You are constructing RSLang expressions — operators, quantifiers, parameterised functions, examples. |
10
11
  | [`TYPIFICATION.md`](TYPIFICATION.md) | You are interpreting `AnalysisResult.type` / `valueClass` or constructing template expressions with radicals. |
package/docs/SYNTAX.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # RSLang syntax reference
2
2
 
3
- Distilled from the Portal help topics under `help-rslang-*`. Use this when constructing or repairing RSLang expressions. For full grammar tokens see `GRAMMAR-REF.md`. For typification rules see `TYPIFICATION.md`.
3
+ Use this when constructing or repairing RSLang expressions. For full grammar tokens see `GRAMMAR-REF.md`. For typification rules see `TYPIFICATION.md`.
4
4
 
5
5
  ## Identifier rules
6
6
 
@@ -17,22 +17,22 @@ Distilled from the Portal help topics under `help-rslang-*`. Use this when const
17
17
 
18
18
  ## Set-theoretic expressions
19
19
 
20
- | Construct | Syntax | Notes |
21
- |-----------|--------|-------|
22
- | Union | `D1 ∪ D2` | |
23
- | Intersection | `D1 ∩ D2` | |
24
- | Difference | `D1 \ D2` | |
25
- | Symmetric difference | `D1 ∆ D2` | |
26
- | Cartesian product | `X1 × X2` | typification: tuple |
27
- | Boolean / power set | `ℬ(X1)` | set of all subsets |
28
- | Tuple | `(a, b, c)` | ordered, n ≥ 2 |
29
- | Enumeration | `{a, b, c}` | unordered, n ≥ 1 |
30
- | Singleton | `bool(a)` ≡ `{a}` | |
31
- | Desingleton | `debool({a})` ≡ `a` | only for one-element sets |
32
- | Sum set | `red(S1)` | union of inner sets; `S1` must be a set of sets |
33
- | Small projection | `pr1((a1, …, an))` | returns `a1` |
34
- | Large projection | `Pr1(S1)` | set of first components of tuples in `S1` |
35
- | Filter | `Fi1[D1](S1)` | subset of `S1` whose first projection ∈ `D1` |
20
+ | Construct | Syntax | Notes |
21
+ | -------------------- | ------------------- | ----------------------------------------------- |
22
+ | Union | `D1 ∪ D2` | |
23
+ | Intersection | `D1 ∩ D2` | |
24
+ | Difference | `D1 \ D2` | |
25
+ | Symmetric difference | `D1 ∆ D2` | |
26
+ | Cartesian product | `X1 × X2` | typification: tuple |
27
+ | Boolean / power set | `ℬ(X1)` | set of all subsets |
28
+ | Tuple | `(a, b, c)` | ordered, n ≥ 2 |
29
+ | Enumeration | `{a, b, c}` | unordered, n ≥ 1 |
30
+ | Singleton | `bool(a)` ≡ `{a}` | |
31
+ | Desingleton | `debool({a})` ≡ `a` | only for one-element sets |
32
+ | Sum set | `red(S1)` | union of inner sets; `S1` must be a set of sets |
33
+ | Small projection | `pr1((a1, …, an))` | returns `a1` |
34
+ | Large projection | `Pr1(S1)` | set of first components of tuples in `S1` |
35
+ | Filter | `Fi1[D1](S1)` | subset of `S1` whose first projection ∈ `D1` |
36
36
 
37
37
  Indices `1` may be any natural number or comma-separated multi-index (`pr1,3((a1, a2, a3, a4)) = (a1, a3)`, `Fi1,2[D1](S1)`).
38
38
 
@@ -40,15 +40,15 @@ Indices `1` may be any natural number or comma-separated multi-index (`pr1,3((a1
40
40
 
41
41
  ### Set-theoretic predicates
42
42
 
43
- | Predicate | Syntax |
44
- |-----------|--------|
45
- | Membership | `ξ ∈ S` |
46
- | Non-membership | `ξ ∉ S` |
47
- | Set equality | `S1 = S2` |
48
- | Set inequality | `S1 ≠ S2` |
49
- | Inclusion | `S1 ⊆ S2` |
43
+ | Predicate | Syntax |
44
+ | ---------------- | --------- |
45
+ | Membership | `ξ ∈ S` |
46
+ | Non-membership | `ξ ∉ S` |
47
+ | Set equality | `S1 = S2` |
48
+ | Set inequality | `S1 ≠ S2` |
49
+ | Inclusion | `S1 ⊆ S2` |
50
50
  | Strict inclusion | `S1 ⊂ S2` |
51
- | Non-inclusion | `S1 ⊄ S2` |
51
+ | Non-inclusion | `S1 ⊄ S2` |
52
52
 
53
53
  ### Arithmetic predicates (typification `Logic`)
54
54
 
@@ -56,9 +56,9 @@ Indices `1` may be any natural number or comma-separated multi-index (`pr1,3((a1
56
56
 
57
57
  ### Connectives
58
58
 
59
- | Connective | Syntax |
60
- |------------|--------|
61
- | Negation | `¬A` |
59
+ | Connective | Syntax |
60
+ | ----------- | ------- |
61
+ | Negation | `¬A` |
62
62
  | Conjunction | `A & B` |
63
63
  | Disjunction | `A ∨ B` |
64
64
  | Implication | `A ⇒ B` |
@@ -68,10 +68,10 @@ The constants `TRUE` and `FALSE` are **not** used inside schema explications.
68
68
 
69
69
  ## Quantifiers
70
70
 
71
- | Form | Syntax |
72
- |------|--------|
73
- | Universal | `∀ξ∈STE (LE(ξ))` |
74
- | Existential | `∃ξ∈STE (LE(ξ))` |
71
+ | Form | Syntax |
72
+ | ------------- | ---------------------------- |
73
+ | Universal | `∀ξ∈STE (LE(ξ))` |
74
+ | Existential | `∃ξ∈STE (LE(ξ))` |
75
75
  | Tuple binding | `∀(ξ1, ξ2)∈STE (LE(ξ1, ξ2))` |
76
76
  | Variable list | `∀ξ1, ξ2 ∈ STE (LE(ξ1, ξ2))` |
77
77
 
@@ -4,14 +4,14 @@ Distilled from `help-rslang-typification`, `help-rslang-expression-structure`, a
4
4
 
5
5
  ## Grades
6
6
 
7
- A genus-structure expression `ξ` has typification (a *structure*) if `ξ ∈ H` holds, where `H` is a valid **grade**. Grades are built recursively:
7
+ A genus-structure expression `ξ` has typification (a _structure_) if `ξ ∈ H` holds, where `H` is a valid **grade**. Grades are built recursively:
8
8
 
9
- | Grade | Form | Notes |
10
- |-------|------|-------|
11
- | Element | `Xi`, `Ci` | grade of an undefined concept's elements |
12
- | Integer | `Z` | grade of integer arithmetic results |
13
- | Tuple of arity n | `(H1 × H2 × … × Hn)` | ordered structured grade |
14
- | Set | `ℬ(H)` | set of values of grade `H` |
9
+ | Grade | Form | Notes |
10
+ | ---------------- | -------------------- | ------------------------------------ |
11
+ | Element | `Xi`, `Ci` | grade of a basic concept's elements |
12
+ | Integer | `Z` | grade of integer |
13
+ | Tuple of arity n | `(H1 × H2 × … × Hn)` | ordered structured grade |
14
+ | Set | `ℬ(H)` | unordered set of values of grade `H` |
15
15
 
16
16
  The empty set `∅` has typification `ℬ(R0)` — a set with arbitrary element structure. The radical `R0` ensures it conforms to any element grade in context.
17
17
 
@@ -41,7 +41,6 @@ Template parameterised expressions may contain notations `R1, R2, …` (and `R0`
41
41
  The contract exposes `type: Record<string, unknown> | null` because typifications are JSON-encoded by the analyzer. Useful properties exposed by `@rsconcept/domain` helpers:
42
42
 
43
43
  - `TypeID` enum: `Element`, `Integer`, `Tuple`, `Boolean`, `Logic`, `Functional` — discriminates the top-level shape.
44
- - `TypeClass` enum: `Element`, `Integer`, `Logic`, `Functional`, `Collection` (set / tuple), `Other`.
45
44
  - `TypePath` (sequence of indices) addresses positions inside a tuple-of-sets-of-tuples structure; use `makeTypePath` to construct.
46
45
  - `parseTypeText(...)` parses an ASCII representation `B(X1)`, `(X1×X2)`, etc., into a `Typification`.
47
46
 
@@ -51,6 +50,13 @@ For agents inspecting types from rstool output:
51
50
  2. Use `analysis.type` (object) only as opaque input to `@rsconcept/domain` helpers — do not pattern-match it manually.
52
51
  3. The `valueClass` companion indicates `Value`, `Property` (non-computable membership only), or `Invalid`.
53
52
 
53
+ ## Typification on `S#` vs definition on `D#`
54
+
55
+ - On a **`structure`** (`S#`), `definitionFormal` is read as **typification**. Subexpressions such as `X1×X1` describe **element shape** (here: one pair of base elements).
56
+ - On a **`term`** (`D#`), the same token sequence is a **definition** evaluated in the model. `X1×X1` alone is the Cartesian product — all ordered pairs from `X1` — not the typification of a relation stored in `S#`.
57
+
58
+ Prefer `S#` with `ℬ(X1×X1)` plus `convention` for relations; derive `D#` with `Pr*`, `Fi*`, filters, etc.
59
+
54
60
  ## Forming structures vs. derived structures
55
61
 
56
62
  Forming operations build a new grade:
@@ -72,7 +78,6 @@ Derived structures consume a grade:
72
78
 
73
79
  - Negative integer literals do not exist — use `0 - n`.
74
80
  - `debool(S)` fails if `S` is not a singleton.
75
- - `red(S)` fails unless `S : ℬ(ℬ(H))`.
76
81
  - Tuple projections require the argument to be a tuple of sufficient arity; `pr3((a, b))` is an error.
77
82
  - Filter parameter list arity must match the multi-index in `Fi[...]`.
78
83
  - A radical in the **result expression** of a template is a hard error (`radicalUsage`).
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@rsconcept/rstool",
3
- "version": "0.1.0",
3
+ "version": "0.2.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",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/IRBorisov/ConceptPortal",
9
+ "url": "git+https://github.com/IRBorisov/ConceptPortal.git",
10
10
  "directory": "rsconcept/rstool"
11
11
  },
12
12
  "homepage": "https://portal.acconcept.ru",
@@ -33,11 +33,12 @@
33
33
  "import": "./dist/wrapper/client.js"
34
34
  },
35
35
  "./skills/rstool-helper/*": "./skills/rstool-helper/*",
36
+ "./skills/INSTALL.md": "./skills/INSTALL.md",
36
37
  "./docs/*": "./docs/*",
37
38
  "./package.json": "./package.json"
38
39
  },
39
40
  "bin": {
40
- "rstool-wrapper": "./dist/wrapper/stdio-wrapper.js"
41
+ "rstool-wrapper": "dist/wrapper/stdio-wrapper.js"
41
42
  },
42
43
  "files": [
43
44
  "dist",
@@ -48,7 +49,7 @@
48
49
  "LICENSE"
49
50
  ],
50
51
  "scripts": {
51
- "build": "tsup",
52
+ "build": "tsdown",
52
53
  "typecheck": "tsc -p tsconfig.json --noEmit",
53
54
  "test": "vitest run",
54
55
  "wrapper": "tsx src/wrapper/stdio-wrapper.ts",
@@ -64,10 +65,10 @@
64
65
  "@rsconcept/domain": "^1.0.0"
65
66
  },
66
67
  "devDependencies": {
67
- "@types/node": "^24.0.0",
68
- "tsup": "^8.5.0",
68
+ "@types/node": "^25.9.1",
69
+ "tsdown": "^0.22.0",
69
70
  "tsx": "^4.21.0",
70
- "typescript": "^5.9.3",
71
+ "typescript": "^6.0.3",
71
72
  "vitest": "^4.1.5"
72
73
  },
73
74
  "publishConfig": {
@@ -0,0 +1,35 @@
1
+ # Install `rstool-helper` (agent procedure)
2
+
3
+ Use when the user has run `npm install @rsconcept/rstool` and asks to **install** or **enable** the rstool agent skill. The user should not copy files manually.
4
+
5
+ ## Steps
6
+
7
+ 1. Confirm the package exists: `node_modules/@rsconcept/rstool/package.json`.
8
+ 2. Determine the host’s **project skills directory** (where that host loads `SKILL.md` files). Common layouts:
9
+ - `.agents/skills/<skill-name>/SKILL.md`
10
+ - `.cursor/skills/<skill-name>/SKILL.md`
11
+ - Other paths — use the host’s documentation if unsure.
12
+ 3. Create `<skills-dir>/rstool-helper/` if needed.
13
+ 4. Copy **one file** — the package entry skill:
14
+ - **From:** `node_modules/@rsconcept/rstool/skills/rstool-helper/SKILL.md`
15
+ - **To:** `<skills-dir>/rstool-helper/SKILL.md`
16
+ 5. Do **not** copy `GUIDE.md`, `REFERENCE.md`, `EXAMPLES.md`, or `docs/` into the project. The entry skill points at those files under `node_modules/@rsconcept/rstool/`.
17
+ 6. Confirm the destination `SKILL.md` exists and tell the user the skill is ready.
18
+
19
+ ### Example (`.agents/skills` layout)
20
+
21
+ Bash:
22
+
23
+ ```bash
24
+ mkdir -p .agents/skills/rstool-helper
25
+ cp node_modules/@rsconcept/rstool/skills/rstool-helper/SKILL.md .agents/skills/rstool-helper/SKILL.md
26
+ ```
27
+
28
+ PowerShell:
29
+
30
+ ```powershell
31
+ New-Item -ItemType Directory -Force -Path .agents/skills/rstool-helper | Out-Null
32
+ Copy-Item -Force node_modules/@rsconcept/rstool/skills/rstool-helper/SKILL.md .agents/skills/rstool-helper/SKILL.md
33
+ ```
34
+
35
+ Use the equivalent path for your agent host if it does not use `.agents/skills`.
package/skills/README.md CHANGED
@@ -1,15 +1,23 @@
1
- # Agent skills (rstool)
1
+ # Agent skills (`@rsconcept/rstool`)
2
2
 
3
- Versioned copy of agent skills for this package.
3
+ Each skill lives in its own subdirectory: `skills/<skill-name>/SKILL.md` (plus reference files). Shared install steps: `INSTALL.md`.
4
4
 
5
- ## `rstool-helper`
5
+ ## Layout
6
6
 
7
- Teaches agents RS language and the rstool session API. Files:
7
+ | Path | Role |
8
+ | :--- | :--- |
9
+ | `INSTALL.md` | **Agent procedure** after `npm install` |
10
+ | `rstool-helper/SKILL.md` | Thin **entry** skill — copy into the project’s agent skills folder (see `INSTALL.md`) |
11
+ | `rstool-helper/GUIDE.md` | Canonical workflow and language primer |
12
+ | `rstool-helper/REFERENCE.md` | API, stdio, contract |
13
+ | `rstool-helper/EXAMPLES.md` | Worked examples and pitfalls |
14
+ | `../docs/*.md` | Language reference (DOMAIN, SYNTAX, DIAGNOSTICS, …) |
8
15
 
9
- - `rstool-helper/SKILL.md` — entry and workflow
10
- - `rstool-helper/REFERENCE.md` — contract, stdio, grammar pointers
11
- - `rstool-helper/EXAMPLES.md` — runnable patterns
16
+ ## npm workflow
12
17
 
13
- **Also committed for Cursor:** `.agents/skills/rstool-helper/` (same files). When you change this skill, update **both** directories in the same change set so they stay identical.
18
+ 1. `npm install @rsconcept/rstool`
19
+ 2. User asks the agent to install the skill (no manual copy).
20
+ 3. Agent follows `node_modules/@rsconcept/rstool/skills/INSTALL.md`.
21
+ 4. Agent reads `GUIDE.md` and `docs/` from `node_modules/@rsconcept/rstool/` when working.
14
22
 
15
- Contract changes: see `rsconcept/rstool/AGENTS.md` (sync checklist).
23
+ Contract changes: see `AGENTS.md` in this package (sync checklist).