@rsconcept/rstool 0.1.0 → 0.2.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 +21 -26
- package/dist/analysis-JiwOYDKx.d.ts +16 -0
- package/dist/common-DxLg3eXX.d.ts +17 -0
- package/dist/constituenta-Dnd6iToB.d.ts +36 -0
- package/dist/diagnostic-BMYvciz8.d.ts +15 -0
- package/dist/evaluation-CCVYH0wA.d.ts +21 -0
- package/dist/index.d.ts +12 -15
- package/dist/index.js +7 -585
- package/dist/mappers/model-adapter.d.ts +18 -23
- package/dist/mappers/model-adapter.js +183 -231
- package/dist/mappers/model-adapter.js.map +1 -1
- package/dist/mappers/schema-adapter.d.ts +16 -18
- package/dist/mappers/schema-adapter.js +55 -84
- package/dist/mappers/schema-adapter.js.map +1 -1
- package/dist/mappers/types.d.ts +15 -16
- package/dist/mappers/types.js +16 -17
- package/dist/mappers/types.js.map +1 -1
- package/dist/model-value-SFAVj0dw.d.ts +35 -0
- package/dist/models/analysis.d.ts +2 -18
- package/dist/models/analysis.js +1 -1
- package/dist/models/common.d.ts +2 -15
- package/dist/models/common.js +1 -8
- package/dist/models/constituenta.d.ts +2 -38
- package/dist/models/constituenta.js +1 -1
- package/dist/models/diagnostic.d.ts +2 -17
- package/dist/models/diagnostic.js +1 -1
- package/dist/models/evaluation.d.ts +2 -23
- package/dist/models/evaluation.js +1 -1
- package/dist/models/index.d.ts +10 -13
- package/dist/models/index.js +4 -491
- package/dist/models/model-value.d.ts +2 -37
- package/dist/models/model-value.js +1 -1
- package/dist/models/rstool-agent.d.ts +2 -36
- package/dist/models/rstool-agent.js +90 -477
- package/dist/models/rstool-agent.js.map +1 -1
- package/dist/models/session.d.ts +2 -29
- package/dist/models/session.js +1 -1
- package/dist/models/tool-contract.d.ts +2 -33
- package/dist/models/tool-contract.js +5 -5
- package/dist/models/tool-contract.js.map +1 -1
- package/dist/rstool-agent-DkeH5Qml.d.ts +33 -0
- package/dist/session/session-store.d.ts +14 -21
- package/dist/session/session-store.js +59 -63
- package/dist/session/session-store.js.map +1 -1
- package/dist/session-BHGCCLfQ.d.ts +24 -0
- package/dist/tool-contract-CsGqg_0P.d.ts +30 -0
- package/dist/wrapper/client.d.ts +26 -24
- package/dist/wrapper/client.js +90 -93
- package/dist/wrapper/client.js.map +1 -1
- package/dist/wrapper/stdio-wrapper.d.ts +1 -1
- package/dist/wrapper/stdio-wrapper.js +166 -664
- package/dist/wrapper/stdio-wrapper.js.map +1 -1
- package/docs/CONSTITUENTA.md +39 -23
- package/docs/DIAGNOSTICS.md +79 -74
- package/docs/DOMAIN.md +5 -3
- package/docs/GRAMMAR-REF.md +55 -55
- package/docs/PORTAL-API.md +7 -10
- package/docs/SYNTAX.md +32 -32
- package/docs/TYPIFICATION.md +14 -9
- package/package.json +8 -7
- package/skills/INSTALL.md +35 -0
- package/skills/README.md +17 -9
- package/skills/rstool-helper/EXAMPLES.md +51 -10
- package/skills/rstool-helper/GUIDE.md +133 -0
- package/skills/rstool-helper/REFERENCE.md +5 -3
- package/skills/rstool-helper/SKILL.md +23 -134
- package/dist/index.js.map +0 -1
- package/dist/models/analysis.js.map +0 -1
- package/dist/models/common.js.map +0 -1
- package/dist/models/constituenta.js.map +0 -1
- package/dist/models/diagnostic.js.map +0 -1
- package/dist/models/evaluation.js.map +0 -1
- package/dist/models/index.js.map +0 -1
- package/dist/models/model-value.js.map +0 -1
- package/dist/models/session.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @rsconcept/rstool
|
|
2
2
|
|
|
3
|
-
Agent-facing library for **incremental RSForm construction**, **RSLang expression analysis**, **diagnostics**, **modeling**, and **evaluation**. It wraps [`@rsconcept/domain`](https://www.npmjs.com/package/@rsconcept/domain) with a deterministic session contract and a stdio JSON wrapper that LLM agents and
|
|
3
|
+
Agent-facing library for **incremental RSForm construction**, **RSLang expression analysis**, **diagnostics**, **modeling**, and **evaluation**. It wraps [`@rsconcept/domain`](https://www.npmjs.com/package/@rsconcept/domain) with a deterministic session contract and a stdio JSON wrapper that LLM agents and MCP clients can call directly.
|
|
4
4
|
|
|
5
5
|
## Agent skill
|
|
6
6
|
|
|
7
|
-
RS language + rstool workflows for agents: `skills/rstool-helper/` (`
|
|
7
|
+
RS language + rstool workflows for agents: `skills/rstool-helper/` (`GUIDE.md`, `REFERENCE.md`, `EXAMPLES.md`) and `docs/` (`DOMAIN.md`, `SYNTAX.md`, …). A **thin** entry skill is installed into the project’s agent skills folder; see [Installing the agent skill](#installing-the-agent-skill) below.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -52,16 +52,20 @@ await client.close();
|
|
|
52
52
|
- Deterministic diagnostics and export/import for reproducible agent workflows.
|
|
53
53
|
- Library API + stdio JSON wrapper as the only supported transports (MCP adapter lives in [`@rsconcept/rstool-mcp`](../rstool-mcp/)).
|
|
54
54
|
|
|
55
|
+
## Publishing
|
|
56
|
+
|
|
57
|
+
Maintainers: see [PUBLISHING.md](./PUBLISHING.md) for npm release steps.
|
|
58
|
+
|
|
55
59
|
## Repo scripts
|
|
56
60
|
|
|
57
|
-
|
|
61
|
+
From `rsconcept/rstool` (or run `powershell -File scripts/dev/LocalDevSetup.ps1` from the repo root on Windows):
|
|
58
62
|
|
|
59
|
-
- `npm install`
|
|
60
|
-
- `npm run typecheck
|
|
61
|
-
- `npm test
|
|
62
|
-
- `npm run build
|
|
63
|
-
- `npm run wrapper
|
|
64
|
-
- `npm run example:client
|
|
63
|
+
- `npm install` / `npm ci`
|
|
64
|
+
- `npm run typecheck`
|
|
65
|
+
- `npm test`
|
|
66
|
+
- `npm run build` — produce `dist/` via tsdown
|
|
67
|
+
- `npm run wrapper` — dev stdio wrapper via `tsx`
|
|
68
|
+
- `npm run example:client`, `npm run example:build-schema`, `npm run example:build-rsmodel`
|
|
65
69
|
|
|
66
70
|
## Stdio protocol
|
|
67
71
|
|
|
@@ -107,7 +111,7 @@ Example response:
|
|
|
107
111
|
Run:
|
|
108
112
|
|
|
109
113
|
```bash
|
|
110
|
-
npm run example:client
|
|
114
|
+
npm run example:client
|
|
111
115
|
```
|
|
112
116
|
|
|
113
117
|
File: [`examples/agent-client.ts`](examples/agent-client.ts)
|
|
@@ -122,28 +126,19 @@ The example:
|
|
|
122
126
|
- sets a base binding and evaluates a term
|
|
123
127
|
- fetches diagnostics
|
|
124
128
|
|
|
125
|
-
## Installing the
|
|
129
|
+
## Installing the agent skill
|
|
126
130
|
|
|
127
|
-
|
|
131
|
+
After `npm install @rsconcept/rstool`, **you do not copy files yourself**. Ask your agent, for example:
|
|
128
132
|
|
|
129
|
-
|
|
130
|
-
# Cursor (per-project skills)
|
|
131
|
-
mkdir -p .agents/skills
|
|
132
|
-
cp -r node_modules/@rsconcept/rstool/skills/rstool-helper .agents/skills/rstool-helper
|
|
133
|
-
cp -r node_modules/@rsconcept/rstool/docs .agents/skills/rstool-helper/docs
|
|
133
|
+
> Install the rstool agent skill according to the package instructions.
|
|
134
134
|
|
|
135
|
-
|
|
136
|
-
```
|
|
135
|
+
The agent should read and follow:
|
|
137
136
|
|
|
138
|
-
|
|
137
|
+
`node_modules/@rsconcept/rstool/skills/INSTALL.md`
|
|
139
138
|
|
|
140
|
-
|
|
141
|
-
New-Item -ItemType Directory -Force .agents/skills
|
|
142
|
-
Copy-Item -Recurse -Force node_modules/@rsconcept/rstool/skills/rstool-helper .agents/skills/rstool-helper
|
|
143
|
-
Copy-Item -Recurse -Force node_modules/@rsconcept/rstool/docs .agents/skills/rstool-helper/docs
|
|
144
|
-
```
|
|
139
|
+
That copies `skills/rstool-helper/SKILL.md` from the package into your host’s project skills directory (for example `.agents/skills/rstool-helper/SKILL.md`). Full guidance stays in the package (`skills/rstool-helper/GUIDE.md`, `docs/*.md`) and is read from `node_modules` when needed.
|
|
145
140
|
|
|
146
|
-
|
|
141
|
+
Details: `skills/README.md`.
|
|
147
142
|
|
|
148
143
|
## License
|
|
149
144
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { a as RSToolErrorDescription, n as CstType, s as ValueClass } from "./common-DxLg3eXX.js";
|
|
2
|
+
|
|
3
|
+
//#region src/models/analysis.d.ts
|
|
4
|
+
interface AnalyzeExpressionInput {
|
|
5
|
+
expression: string;
|
|
6
|
+
cstType: CstType;
|
|
7
|
+
}
|
|
8
|
+
interface AnalysisResult {
|
|
9
|
+
success: boolean;
|
|
10
|
+
type: Record<string, unknown> | null;
|
|
11
|
+
valueClass: ValueClass | null;
|
|
12
|
+
diagnostics: RSToolErrorDescription[];
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { AnalyzeExpressionInput as n, AnalysisResult as t };
|
|
16
|
+
//# sourceMappingURL=analysis-JiwOYDKx.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CstType as CstType$1 } from "@rsconcept/domain/library/rsform";
|
|
2
|
+
import { BasicBinding, EvalStatus as EvalStatus$1 } from "@rsconcept/domain/library/rsmodel";
|
|
3
|
+
import { ValueClass as ValueClass$1 } from "@rsconcept/domain/rslang";
|
|
4
|
+
import { RSErrorCode } from "@rsconcept/domain/rslang/error";
|
|
5
|
+
|
|
6
|
+
//#region src/models/common.d.ts
|
|
7
|
+
/** Runtime evaluation value: number, nested array (set/tuple), or boolean 0/1. */
|
|
8
|
+
type RSToolValue = number | RSToolValue[];
|
|
9
|
+
interface RSToolErrorDescription {
|
|
10
|
+
code: number;
|
|
11
|
+
from: number;
|
|
12
|
+
to: number;
|
|
13
|
+
params?: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { RSToolErrorDescription as a, RSErrorCode as i, CstType$1 as n, RSToolValue as o, EvalStatus$1 as r, ValueClass$1 as s, BasicBinding as t };
|
|
17
|
+
//# sourceMappingURL=common-DxLg3eXX.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { n as CstType } from "./common-DxLg3eXX.js";
|
|
2
|
+
import { t as AnalysisResult } from "./analysis-JiwOYDKx.js";
|
|
3
|
+
import { t as DiagnosticRecord } from "./diagnostic-BMYvciz8.js";
|
|
4
|
+
|
|
5
|
+
//#region src/models/constituenta.d.ts
|
|
6
|
+
interface ConstituentaDraft {
|
|
7
|
+
id: number;
|
|
8
|
+
/** Alias */
|
|
9
|
+
alias: string;
|
|
10
|
+
/** CST type */
|
|
11
|
+
cstType: CstType;
|
|
12
|
+
/** Formal definition */
|
|
13
|
+
definitionFormal: string;
|
|
14
|
+
/** Natural-language term */
|
|
15
|
+
term?: string;
|
|
16
|
+
/** Natural-language definition */
|
|
17
|
+
definitionText?: string;
|
|
18
|
+
/** Convention or comment */
|
|
19
|
+
convention?: string;
|
|
20
|
+
}
|
|
21
|
+
interface ConstituentaState extends Omit<ConstituentaDraft, 'term' | 'definitionText' | 'convention'> {
|
|
22
|
+
term: string;
|
|
23
|
+
definitionText: string;
|
|
24
|
+
convention: string;
|
|
25
|
+
analysis: AnalysisResult;
|
|
26
|
+
}
|
|
27
|
+
interface AddOrUpdateConstituentaInput {
|
|
28
|
+
draft: ConstituentaDraft;
|
|
29
|
+
}
|
|
30
|
+
interface AddOrUpdateConstituentaResult {
|
|
31
|
+
state: ConstituentaState;
|
|
32
|
+
diagnostics: DiagnosticRecord[];
|
|
33
|
+
}
|
|
34
|
+
//#endregion
|
|
35
|
+
export { ConstituentaState as i, AddOrUpdateConstituentaResult as n, ConstituentaDraft as r, AddOrUpdateConstituentaInput as t };
|
|
36
|
+
//# sourceMappingURL=constituenta-Dnd6iToB.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { a as RSToolErrorDescription } from "./common-DxLg3eXX.js";
|
|
2
|
+
|
|
3
|
+
//#region src/models/diagnostic.d.ts
|
|
4
|
+
interface DiagnosticRecord {
|
|
5
|
+
sessionId: string;
|
|
6
|
+
constituentId?: number;
|
|
7
|
+
expression: string;
|
|
8
|
+
error: RSToolErrorDescription;
|
|
9
|
+
}
|
|
10
|
+
interface ListDiagnosticsFilters {
|
|
11
|
+
constituentId?: number;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { ListDiagnosticsFilters as n, DiagnosticRecord as t };
|
|
15
|
+
//# sourceMappingURL=diagnostic-BMYvciz8.d.ts.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { a as RSToolErrorDescription, n as CstType, o as RSToolValue, r as EvalStatus, t as BasicBinding } from "./common-DxLg3eXX.js";
|
|
2
|
+
|
|
3
|
+
//#region src/models/evaluation.d.ts
|
|
4
|
+
interface EvaluateExpressionInput {
|
|
5
|
+
expression: string;
|
|
6
|
+
cstType: CstType;
|
|
7
|
+
}
|
|
8
|
+
interface EvaluateConstituentaInput {
|
|
9
|
+
constituentId: number;
|
|
10
|
+
}
|
|
11
|
+
interface EvaluationResult {
|
|
12
|
+
success: boolean;
|
|
13
|
+
value: RSToolValue | BasicBinding | null;
|
|
14
|
+
status: EvalStatus;
|
|
15
|
+
iterations: number;
|
|
16
|
+
cacheHits: number;
|
|
17
|
+
diagnostics: RSToolErrorDescription[];
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
export { EvaluateExpressionInput as n, EvaluationResult as r, EvaluateConstituentaInput as t };
|
|
21
|
+
//# sourceMappingURL=evaluation-CCVYH0wA.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export { BasicBinding, EvalStatus
|
|
13
|
-
export { CstType } from '@rsconcept/domain/library/rsform';
|
|
14
|
-
export { RSErrorCode } from '@rsconcept/domain/rslang/error';
|
|
15
|
-
export { ValueClass } from '@rsconcept/domain/rslang';
|
|
1
|
+
import { a as RSToolErrorDescription, i as RSErrorCode, n as CstType, o as RSToolValue, r as EvalStatus, s as ValueClass, t as BasicBinding } from "./common-DxLg3eXX.js";
|
|
2
|
+
import { n as AnalyzeExpressionInput, t as AnalysisResult } from "./analysis-JiwOYDKx.js";
|
|
3
|
+
import { n as ListDiagnosticsFilters, t as DiagnosticRecord } from "./diagnostic-BMYvciz8.js";
|
|
4
|
+
import { i as ConstituentaState, n as AddOrUpdateConstituentaResult, r as ConstituentaDraft, t as AddOrUpdateConstituentaInput } from "./constituenta-Dnd6iToB.js";
|
|
5
|
+
import { n as EvaluateExpressionInput, r as EvaluationResult, t as EvaluateConstituentaInput } from "./evaluation-CCVYH0wA.js";
|
|
6
|
+
import { a as SetConstituentaValueInput, i as SessionModelState, n as ModelValueState, o as SetConstituentaValuesInput, r as RecalculateModelResult, t as ClearConstituentaValuesInput } from "./model-value-SFAVj0dw.js";
|
|
7
|
+
import { n as SessionRevision, r as SessionState, t as SessionHandle } from "./session-BHGCCLfQ.js";
|
|
8
|
+
import { n as RSToolAgentContract, t as CONTRACT_VERSION } from "./tool-contract-CsGqg_0P.js";
|
|
9
|
+
import { t as RSToolAgent } from "./rstool-agent-DkeH5Qml.js";
|
|
10
|
+
import { DomainAnalysisLike, DomainErrorLike, toPublicAnalysis, toPublicError } from "./mappers/types.js";
|
|
11
|
+
import { RSToolWrapperClient, RSToolWrapperClientOptions, WrapperResponse } from "./wrapper/client.js";
|
|
12
|
+
export { type AddOrUpdateConstituentaInput, type AddOrUpdateConstituentaResult, type AnalysisResult, type AnalyzeExpressionInput, type BasicBinding, CONTRACT_VERSION, type ClearConstituentaValuesInput, type ConstituentaDraft, type ConstituentaState, CstType, type DiagnosticRecord, type DomainAnalysisLike, type DomainErrorLike, EvalStatus, type EvaluateConstituentaInput, type EvaluateExpressionInput, type EvaluationResult, type ListDiagnosticsFilters, type ModelValueState, RSErrorCode, RSToolAgent, type RSToolAgentContract, type RSToolErrorDescription, type RSToolValue, RSToolWrapperClient, type RSToolWrapperClientOptions, type RecalculateModelResult, type SessionHandle, type SessionModelState, type SessionRevision, type SessionState, type SetConstituentaValueInput, type SetConstituentaValuesInput, ValueClass, type WrapperResponse, toPublicAnalysis, toPublicError };
|