@rsconcept/rstool 1.6.0 → 1.7.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 +5 -4
- package/dist/{agent-workflow-BTwrxOoX.d.ts → agent-workflow-DY-hfAap.d.ts} +50 -5
- package/dist/{analysis-DA44pfgA.d.ts → analysis-ktWFu4BY.d.ts} +2 -2
- package/dist/{constituenta-QY5w1x91.d.ts → constituenta-HTnFtmxt.d.ts} +3 -3
- package/dist/{diagnostic-C6TRoBgt.d.ts → diagnostic-CODFUU-Q.d.ts} +5 -4
- package/dist/diagnostic-assembly-B-6vIA5I.js.map +1 -1
- package/dist/{evaluation-Cd4S7-3t.d.ts → evaluation-6A7rK4t7.d.ts} +2 -2
- package/dist/index.d.ts +9 -9
- package/dist/index.js +1 -1
- package/dist/mappers/model-adapter.d.ts +2 -2
- package/dist/mappers/schema-adapter.d.ts +4 -4
- package/dist/mappers/types.d.ts +2 -2
- package/dist/models/agent-workflow.d.ts +2 -2
- package/dist/models/analysis.d.ts +1 -1
- package/dist/models/constituenta.d.ts +1 -1
- package/dist/models/diagnostic.d.ts +1 -1
- package/dist/models/evaluation.d.ts +1 -1
- package/dist/models/index.d.ts +9 -9
- package/dist/models/index.js +1 -1
- 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 +1 -1
- package/dist/models/tool-contract.js +1 -1
- package/dist/models/tool-contract.js.map +1 -1
- package/dist/{models-LMyDB0md.js → models-BKmWx92e.js} +116 -3
- package/dist/models-BKmWx92e.js.map +1 -0
- package/dist/{rstool-agent-BrAFJcoE.d.ts → rstool-agent-D-w4DlEo.d.ts} +12 -8
- package/dist/session/session-store.d.ts +2 -2
- package/dist/session/session-store.js +1 -1
- package/dist/{session-CI4rLYby.d.ts → session-Uc_vHrq9.d.ts} +2 -2
- package/dist/{tool-contract-BUaDRHoO.d.ts → tool-contract-i0v2gbWs.d.ts} +13 -8
- package/dist/wrapper/stdio-wrapper.js +8 -2
- package/dist/wrapper/stdio-wrapper.js.map +1 -1
- package/docs/DOMAIN.md +9 -2
- package/docs/README.md +1 -1
- package/package.json +1 -1
- package/skills/rstool-helper/EXAMPLES.md +25 -0
- package/skills/rstool-helper/GUIDE.md +2 -1
- package/skills/rstool-helper/REFERENCE.md +51 -20
- package/src/index.ts +4 -1
- package/src/mappers/diagnostic-assembly.ts +4 -4
- package/src/models/agent-workflow.ts +45 -0
- package/src/models/index.ts +5 -9
- package/src/models/rstool-agent.test.ts +62 -0
- package/src/models/rstool-agent.ts +160 -2
- package/src/models/tool-contract.ts +10 -2
- package/src/wrapper/stdio-handler.ts +8 -1
- package/dist/models-LMyDB0md.js.map +0 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
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 for LLM agents. MCP hosts can use it through [`@rsconcept/rstool-mcp`](https://www.npmjs.com/package/@rsconcept/rstool-mcp).
|
|
4
4
|
|
|
5
|
-
**Contract version:** `3.
|
|
5
|
+
**Contract version:** `3.2.0` — see [skills/rstool-helper/REFERENCE.md](./skills/rstool-helper/REFERENCE.md) for the full v3 API.
|
|
6
6
|
|
|
7
7
|
## Agent skill
|
|
8
8
|
|
|
@@ -77,7 +77,7 @@ Maintainers: see [PUBLISHING.md](./PUBLISHING.md) for npm release steps.
|
|
|
77
77
|
- If a session method is called without an active session, rstool creates one lazily.
|
|
78
78
|
- On startup, a ready handshake is printed.
|
|
79
79
|
|
|
80
|
-
Supported methods (contract `3.
|
|
80
|
+
Supported methods (contract `3.2.0`):
|
|
81
81
|
|
|
82
82
|
- `ping`
|
|
83
83
|
- `methods`
|
|
@@ -98,6 +98,7 @@ Supported methods (contract `3.1.0`):
|
|
|
98
98
|
- `evaluate`
|
|
99
99
|
- `recalculateModel`
|
|
100
100
|
- `restoreOrder`
|
|
101
|
+
- `synthesize`
|
|
101
102
|
|
|
102
103
|
Params are **flat** at the top level (no `params.input` wrapper). Optional `sessionId` sits alongside method fields.
|
|
103
104
|
|
|
@@ -112,7 +113,7 @@ Request:
|
|
|
112
113
|
Response:
|
|
113
114
|
|
|
114
115
|
```json
|
|
115
|
-
{ "id": "1", "ok": true, "result": { "sessionId": "...", "contractVersion": "3.
|
|
116
|
+
{ "id": "1", "ok": true, "result": { "sessionId": "...", "contractVersion": "3.2.0" } }
|
|
116
117
|
```
|
|
117
118
|
|
|
118
119
|
Example `applySchemaPatch`:
|
|
@@ -141,7 +142,7 @@ Response:
|
|
|
141
142
|
"ok": true,
|
|
142
143
|
"result": {
|
|
143
144
|
"success": true,
|
|
144
|
-
"session": { "sessionId": "...", "contractVersion": "3.
|
|
145
|
+
"session": { "sessionId": "...", "contractVersion": "3.2.0" },
|
|
145
146
|
"summary": { "itemCount": 3 }
|
|
146
147
|
}
|
|
147
148
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as Diagnostic } from "./diagnostic-
|
|
1
|
+
import { a as Diagnostic } from "./diagnostic-CODFUU-Q.js";
|
|
2
2
|
import { n as CstType } from "./common-D6TFl6l_.js";
|
|
3
|
-
import { a as ApplyConstituentsResult, i as ApplyConstituentsMode, o as ConstituentaDraft } from "./constituenta-
|
|
4
|
-
import { n as SessionRevision, r as SessionState, t as SessionHandle } from "./session-
|
|
3
|
+
import { a as ApplyConstituentsResult, i as ApplyConstituentsMode, o as ConstituentaDraft } from "./constituenta-HTnFtmxt.js";
|
|
4
|
+
import { n as SessionRevision, r as SessionState, t as SessionHandle } from "./session-Uc_vHrq9.js";
|
|
5
5
|
|
|
6
6
|
//#region src/models/agent-workflow.d.ts
|
|
7
7
|
/** Level of detail returned by {@link RSToolAgent.getSessionState}. */
|
|
@@ -39,6 +39,51 @@ interface RestoreOrderResult {
|
|
|
39
39
|
/** Aliases in the same order as {@link orderedIds}. */
|
|
40
40
|
orderedAliases: string[];
|
|
41
41
|
}
|
|
42
|
+
/** One row of an identification (substitution) table, by alias. */
|
|
43
|
+
interface SynthesisSubstitution {
|
|
44
|
+
/** Alias of the constituenta being replaced (deleted). */
|
|
45
|
+
original: string;
|
|
46
|
+
/** Alias of the surviving constituenta. */
|
|
47
|
+
substitution: string;
|
|
48
|
+
}
|
|
49
|
+
/** Input for {@link RSToolAgent.synthesize}. */
|
|
50
|
+
interface SynthesizeInput {
|
|
51
|
+
/** Session whose constituents are merged into the receiver. */
|
|
52
|
+
sourceSessionId: string;
|
|
53
|
+
/**
|
|
54
|
+
* Optional subset of source aliases to import.
|
|
55
|
+
* Omit or pass an empty array to import all source constituents.
|
|
56
|
+
*/
|
|
57
|
+
items?: string[];
|
|
58
|
+
/**
|
|
59
|
+
* Identification table: one endpoint is a source alias, the other a receiver alias
|
|
60
|
+
* (same rules as Portal schema embedding / «Встраивание схемы»).
|
|
61
|
+
*/
|
|
62
|
+
substitutions?: SynthesisSubstitution[];
|
|
63
|
+
/** When set, a revision is recorded after a successful synthesis. */
|
|
64
|
+
commitMessage?: string;
|
|
65
|
+
}
|
|
66
|
+
/** Result of {@link RSToolAgent.synthesize}. */
|
|
67
|
+
interface SynthesizeResult {
|
|
68
|
+
session: SessionHandle;
|
|
69
|
+
summary: SessionSummary;
|
|
70
|
+
/** False when some constituents failed re-analysis after embedding (best-effort). */
|
|
71
|
+
success: boolean;
|
|
72
|
+
/** Drafts that failed analysis after embedding; empty when {@link success} is true. */
|
|
73
|
+
failed: Array<{
|
|
74
|
+
draft: ConstituentaDraft;
|
|
75
|
+
diagnostics: Diagnostic[];
|
|
76
|
+
}>;
|
|
77
|
+
/** Source constituent id → inserted id in the receiver (before substitutions). */
|
|
78
|
+
idMap: Record<number, number>;
|
|
79
|
+
/** Alias remapping applied to imported constituents. */
|
|
80
|
+
aliasMapping: Record<string, string>;
|
|
81
|
+
/** Ids removed by substitutions. */
|
|
82
|
+
deletedIds: number[];
|
|
83
|
+
/** Ids of constituents inserted from the source (may include later-deleted ones). */
|
|
84
|
+
insertedIds: number[];
|
|
85
|
+
revision?: SessionRevision;
|
|
86
|
+
}
|
|
42
87
|
/** Compact view of one constituent in a session summary. */
|
|
43
88
|
interface SessionSummaryItem {
|
|
44
89
|
id: number;
|
|
@@ -67,5 +112,5 @@ interface ApplySchemaPatchResult extends ApplyConstituentsResult {
|
|
|
67
112
|
revision?: SessionRevision;
|
|
68
113
|
}
|
|
69
114
|
//#endregion
|
|
70
|
-
export { SessionStateDetail as a, SessionSummaryItem as c, RestoreOrderResult as i, ApplySchemaPatchInput as n, SessionStateResult as o, ApplySchemaPatchResult as r, SessionSummary as s, AgentConstituentaPatch as t };
|
|
71
|
-
//# sourceMappingURL=agent-workflow-
|
|
115
|
+
export { SessionStateDetail as a, SessionSummaryItem as c, SynthesizeResult as d, RestoreOrderResult as i, SynthesisSubstitution as l, ApplySchemaPatchInput as n, SessionStateResult as o, ApplySchemaPatchResult as r, SessionSummary as s, AgentConstituentaPatch as t, SynthesizeInput as u };
|
|
116
|
+
//# sourceMappingURL=agent-workflow-DY-hfAap.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Diagnostic } from "./diagnostic-
|
|
1
|
+
import { a as Diagnostic } from "./diagnostic-CODFUU-Q.js";
|
|
2
2
|
import { n as CstType, o as ValueClass } from "./common-D6TFl6l_.js";
|
|
3
3
|
|
|
4
4
|
//#region src/models/analysis.d.ts
|
|
@@ -21,4 +21,4 @@ interface AnalysisResult {
|
|
|
21
21
|
}
|
|
22
22
|
//#endregion
|
|
23
23
|
export { AnalyzeExpressionInput as n, AnalysisResult as t };
|
|
24
|
-
//# sourceMappingURL=analysis-
|
|
24
|
+
//# sourceMappingURL=analysis-ktWFu4BY.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as Diagnostic } from "./diagnostic-
|
|
1
|
+
import { a as Diagnostic } from "./diagnostic-CODFUU-Q.js";
|
|
2
2
|
import { n as CstType } from "./common-D6TFl6l_.js";
|
|
3
|
-
import { t as AnalysisResult } from "./analysis-
|
|
3
|
+
import { t as AnalysisResult } from "./analysis-ktWFu4BY.js";
|
|
4
4
|
|
|
5
5
|
//#region src/models/constituenta.d.ts
|
|
6
6
|
/** Constituent payload before analysis and merge into session state. */
|
|
@@ -51,4 +51,4 @@ interface ApplyConstituentsResult {
|
|
|
51
51
|
}
|
|
52
52
|
//#endregion
|
|
53
53
|
export { ApplyConstituentsResult as a, ApplyConstituentsMode as i, AddOrUpdateConstituentaResult as n, ConstituentaDraft as o, ApplyConstituentsInput as r, ConstituentaState as s, AddOrUpdateConstituentaInput as t };
|
|
54
|
-
//# sourceMappingURL=constituenta-
|
|
54
|
+
//# sourceMappingURL=constituenta-HTnFtmxt.d.ts.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CstDiagnostic, CstDiagnostic as CstDiagnostic$1, DiagnosticKind, DiagnosticKind as DiagnosticKind$1, RSDiagnosticCode, RSDiagnosticCode as RSDiagnosticCode$1 } from "@rsconcept/domain/library";
|
|
2
2
|
import { RSErrorDescription } from "@rsconcept/domain/rslang/error";
|
|
3
3
|
import { EvalStatus } from "@rsconcept/domain/library/rsmodel";
|
|
4
|
+
import { DiagnosticSourceFields } from "@rsconcept/domain/library/rsform-api";
|
|
4
5
|
|
|
5
6
|
//#region src/mappers/diagnostic-assembly.d.ts
|
|
6
7
|
/** Severity of a {@link Diagnostic}. */
|
|
@@ -22,9 +23,9 @@ interface DiagnosticTarget {
|
|
|
22
23
|
}
|
|
23
24
|
declare function getDiagnosticName(code: number): string;
|
|
24
25
|
declare function getDiagnosticSeverity(code: number): DiagnosticSeverity;
|
|
25
|
-
declare function expandCstDiagnostic(cst:
|
|
26
|
+
declare function expandCstDiagnostic(cst: DiagnosticSourceFields, diagnostic: CstDiagnostic): Diagnostic;
|
|
26
27
|
declare function expressionDiagnostic(error: RSErrorDescription, expression: string, target?: DiagnosticTarget): Diagnostic;
|
|
27
|
-
declare function modelStatusDiagnostic(status: EvalStatus, cst:
|
|
28
|
+
declare function modelStatusDiagnostic(status: EvalStatus, cst: DiagnosticSourceFields): Diagnostic | null;
|
|
28
29
|
//#endregion
|
|
29
30
|
//#region src/models/diagnostic.d.ts
|
|
30
31
|
/** Filters for {@link RSToolAgent.listDiagnostics}. */
|
|
@@ -35,4 +36,4 @@ interface ListDiagnosticsFilters {
|
|
|
35
36
|
}
|
|
36
37
|
//#endregion
|
|
37
38
|
export { Diagnostic as a, expandCstDiagnostic as c, getDiagnosticSeverity as d, modelStatusDiagnostic as f, RSDiagnosticCode as i, expressionDiagnostic as l, DiagnosticKind as n, DiagnosticSeverity as o, ListDiagnosticsFilters as r, DiagnosticTarget as s, CstDiagnostic$1 as t, getDiagnosticName as u };
|
|
38
|
-
//# sourceMappingURL=diagnostic-
|
|
39
|
+
//# sourceMappingURL=diagnostic-CODFUU-Q.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostic-assembly-B-6vIA5I.js","names":[],"sources":["../src/mappers/diagnostic-assembly.ts"],"sourcesContent":["import {\n type
|
|
1
|
+
{"version":3,"file":"diagnostic-assembly-B-6vIA5I.js","names":[],"sources":["../src/mappers/diagnostic-assembly.ts"],"sourcesContent":["import {\n type CstDiagnostic,\n DiagnosticKind,\n modelStatusCstDiagnostic,\n RSDiagnosticCode\n} from '@rsconcept/domain/library';\nimport { type DiagnosticSourceFields } from '@rsconcept/domain/library/rsform-api';\nimport { EvalStatus } from '@rsconcept/domain/library/rsmodel';\nimport { isCritical, RSErrorCode, type RSErrorDescription } from '@rsconcept/domain/rslang/error';\n\nexport { DiagnosticKind, RSDiagnosticCode };\n\n/** Severity of a {@link Diagnostic}. */\nexport type DiagnosticSeverity = 'error' | 'warning';\n\n/** Agent-facing diagnostic with redundant fields for autonomous repair. */\nexport interface Diagnostic extends CstDiagnostic {\n name: string;\n severity: DiagnosticSeverity;\n constituentId?: number;\n alias?: string;\n expression: string;\n from: number;\n to: number;\n}\n\n/** Context for attributing a {@link Diagnostic} to a constituent. */\nexport interface DiagnosticTarget {\n constituentId?: number;\n alias?: string;\n}\n\nconst DIAGNOSTIC_NAMES: ReadonlyMap<number, string> = new Map([\n ...Object.entries(RSErrorCode).map(([name, code]) => [code, name] as const),\n ...Object.entries(RSDiagnosticCode).map(([name, code]) => [code, name] as const)\n]);\n\nexport function getDiagnosticName(code: number): string {\n return DIAGNOSTIC_NAMES.get(code) ?? `0x${code.toString(16).toUpperCase()}`;\n}\n\nexport function getDiagnosticSeverity(code: number): DiagnosticSeverity {\n return isCritical(code as RSErrorCode) ? 'error' : 'warning';\n}\n\nexport function expandCstDiagnostic(cst: DiagnosticSourceFields, diagnostic: CstDiagnostic): Diagnostic {\n const expression = expressionForCstDiagnostic(cst, diagnostic);\n return {\n ...diagnostic,\n name: getDiagnosticName(diagnostic.code),\n severity: getDiagnosticSeverity(diagnostic.code),\n constituentId: cst.id,\n alias: cst.alias,\n expression,\n from: 0,\n to: diagnostic.kind === DiagnosticKind.MODEL ? 0 : Math.max(expression.length, 1)\n };\n}\n\nexport function expressionDiagnostic(\n error: RSErrorDescription,\n expression: string,\n target?: DiagnosticTarget\n): Diagnostic {\n return {\n kind: DiagnosticKind.EXPRESSION,\n code: error.code,\n name: getDiagnosticName(error.code),\n severity: getDiagnosticSeverity(error.code),\n constituentId: target?.constituentId,\n alias: target?.alias,\n expression,\n from: error.from,\n to: error.to,\n ...(error.params ? { params: error.params } : {})\n };\n}\n\nexport function modelStatusDiagnostic(status: EvalStatus, cst: DiagnosticSourceFields): Diagnostic | null {\n const base = modelStatusCstDiagnostic(status, cst.cst_type);\n return base ? expandCstDiagnostic(cst, base) : null;\n}\n\nfunction expressionForCstDiagnostic(cst: DiagnosticSourceFields, diagnostic: CstDiagnostic): string {\n switch (diagnostic.code) {\n case RSDiagnosticCode.schemaHomonym:\n case RSDiagnosticCode.schemaMissingTerm:\n return cst.term_resolved;\n case RSDiagnosticCode.schemaMissingConvention:\n return cst.convention;\n case RSDiagnosticCode.schemaTypeMismatch:\n return cst.typification_manual;\n case RSDiagnosticCode.schemaDependencyCycle:\n case RSDiagnosticCode.schemaFormalDuplicate:\n return cst.definition_formal;\n default:\n return cst.definition_formal;\n }\n}\n"],"mappings":";;;AAgCA,MAAM,mBAAgD,IAAI,IAAI,CAC5D,GAAG,OAAO,QAAQ,WAAW,CAAC,CAAC,KAAK,CAAC,MAAM,UAAU,CAAC,MAAM,IAAI,CAAU,GAC1E,GAAG,OAAO,QAAQ,gBAAgB,CAAC,CAAC,KAAK,CAAC,MAAM,UAAU,CAAC,MAAM,IAAI,CAAU,CACjF,CAAC;AAED,SAAgB,kBAAkB,MAAsB;CACtD,OAAO,iBAAiB,IAAI,IAAI,KAAK,KAAK,KAAK,SAAS,EAAE,CAAC,CAAC,YAAY;AAC1E;AAEA,SAAgB,sBAAsB,MAAkC;CACtE,OAAO,WAAW,IAAmB,IAAI,UAAU;AACrD;AAEA,SAAgB,oBAAoB,KAA6B,YAAuC;CACtG,MAAM,aAAa,2BAA2B,KAAK,UAAU;CAC7D,OAAO;EACL,GAAG;EACH,MAAM,kBAAkB,WAAW,IAAI;EACvC,UAAU,sBAAsB,WAAW,IAAI;EAC/C,eAAe,IAAI;EACnB,OAAO,IAAI;EACX;EACA,MAAM;EACN,IAAI,WAAW,SAAS,eAAe,QAAQ,IAAI,KAAK,IAAI,WAAW,QAAQ,CAAC;CAClF;AACF;AAEA,SAAgB,qBACd,OACA,YACA,QACY;CACZ,OAAO;EACL,MAAM,eAAe;EACrB,MAAM,MAAM;EACZ,MAAM,kBAAkB,MAAM,IAAI;EAClC,UAAU,sBAAsB,MAAM,IAAI;EAC1C,eAAe,QAAQ;EACvB,OAAO,QAAQ;EACf;EACA,MAAM,MAAM;EACZ,IAAI,MAAM;EACV,GAAI,MAAM,SAAS,EAAE,QAAQ,MAAM,OAAO,IAAI,CAAC;CACjD;AACF;AAEA,SAAgB,sBAAsB,QAAoB,KAAgD;CACxG,MAAM,OAAO,yBAAyB,QAAQ,IAAI,QAAQ;CAC1D,OAAO,OAAO,oBAAoB,KAAK,IAAI,IAAI;AACjD;AAEA,SAAS,2BAA2B,KAA6B,YAAmC;CAClG,QAAQ,WAAW,MAAnB;EACE,KAAK,iBAAiB;EACtB,KAAK,iBAAiB,mBACpB,OAAO,IAAI;EACb,KAAK,iBAAiB,yBACpB,OAAO,IAAI;EACb,KAAK,iBAAiB,oBACpB,OAAO,IAAI;EACb,KAAK,iBAAiB;EACtB,KAAK,iBAAiB,uBACpB,OAAO,IAAI;EACb,SACE,OAAO,IAAI;CACf;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as Diagnostic } from "./diagnostic-
|
|
1
|
+
import { a as Diagnostic } from "./diagnostic-CODFUU-Q.js";
|
|
2
2
|
import { a as RSToolValue, n as CstType, r as EvalStatus, t as BasicBinding } from "./common-D6TFl6l_.js";
|
|
3
3
|
|
|
4
4
|
//#region src/models/evaluation.d.ts
|
|
@@ -29,4 +29,4 @@ interface EvaluationResult {
|
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
31
|
export { EvaluationResult as i, EvaluateExpressionInput as n, EvaluateInput as r, EvaluateConstituentaInput as t };
|
|
32
|
-
//# sourceMappingURL=evaluation-
|
|
32
|
+
//# sourceMappingURL=evaluation-6A7rK4t7.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { a as Diagnostic, i as RSDiagnosticCode, n as DiagnosticKind, o as DiagnosticSeverity, r as ListDiagnosticsFilters, t as CstDiagnostic } from "./diagnostic-
|
|
1
|
+
import { a as Diagnostic, i as RSDiagnosticCode, n as DiagnosticKind, o as DiagnosticSeverity, r as ListDiagnosticsFilters, t as CstDiagnostic } from "./diagnostic-CODFUU-Q.js";
|
|
2
2
|
import { a as RSToolValue, i as RSErrorCode, n as CstType, o as ValueClass, r as EvalStatus, t as BasicBinding } from "./common-D6TFl6l_.js";
|
|
3
|
-
import { n as AnalyzeExpressionInput, t as AnalysisResult } from "./analysis-
|
|
4
|
-
import { o as ConstituentaDraft, s as ConstituentaState } from "./constituenta-
|
|
3
|
+
import { n as AnalyzeExpressionInput, t as AnalysisResult } from "./analysis-ktWFu4BY.js";
|
|
4
|
+
import { o as ConstituentaDraft, s as ConstituentaState } from "./constituenta-HTnFtmxt.js";
|
|
5
5
|
import { a as SetConstituentaValueInput, i as SessionModelState, n as ModelValueState, r as RecalculateModelResult, s as SetModelValuesInput } from "./model-value-BUhr2IjA.js";
|
|
6
|
-
import { n as SessionRevision, r as SessionState, t as SessionHandle } from "./session-
|
|
7
|
-
import { a as SessionStateDetail, c as SessionSummaryItem, n as ApplySchemaPatchInput, o as SessionStateResult, r as ApplySchemaPatchResult, s as SessionSummary, t as AgentConstituentaPatch } from "./agent-workflow-
|
|
8
|
-
import { i as EvaluationResult, r as EvaluateInput } from "./evaluation-
|
|
9
|
-
import { a as ExportPortalInput, c as PortalExportKind, d as PortalModelImportData, f as PortalRsformDetails, h as PortalTermForm, i as ExportFormat, l as PORTAL_JSON_CONTRACT_VERSION, m as PortalSchemaImportData, n as RSToolAgentContract, o as ExportPortalResult, p as PortalSchemaConstituenta, r as RSToolAgentOptions, s as ImportDataKind, t as CONTRACT_VERSION, u as PortalImportMetadata } from "./tool-contract-
|
|
10
|
-
import { t as RSToolAgent } from "./rstool-agent-
|
|
6
|
+
import { n as SessionRevision, r as SessionState, t as SessionHandle } from "./session-Uc_vHrq9.js";
|
|
7
|
+
import { a as SessionStateDetail, c as SessionSummaryItem, d as SynthesizeResult, l as SynthesisSubstitution, n as ApplySchemaPatchInput, o as SessionStateResult, r as ApplySchemaPatchResult, s as SessionSummary, t as AgentConstituentaPatch, u as SynthesizeInput } from "./agent-workflow-DY-hfAap.js";
|
|
8
|
+
import { i as EvaluationResult, r as EvaluateInput } from "./evaluation-6A7rK4t7.js";
|
|
9
|
+
import { a as ExportPortalInput, c as PortalExportKind, d as PortalModelImportData, f as PortalRsformDetails, h as PortalTermForm, i as ExportFormat, l as PORTAL_JSON_CONTRACT_VERSION, m as PortalSchemaImportData, n as RSToolAgentContract, o as ExportPortalResult, p as PortalSchemaConstituenta, r as RSToolAgentOptions, s as ImportDataKind, t as CONTRACT_VERSION, u as PortalImportMetadata } from "./tool-contract-i0v2gbWs.js";
|
|
10
|
+
import { t as RSToolAgent } from "./rstool-agent-D-w4DlEo.js";
|
|
11
11
|
import { DomainAnalysisLike, DomainErrorLike, toDiagnostic, toPublicAnalysis } from "./mappers/types.js";
|
|
12
12
|
import { RSToolWrapperClient, RSToolWrapperClientOptions, WrapperResponse } from "./wrapper/client.js";
|
|
13
|
-
export { type AgentConstituentaPatch, type AnalysisResult, type AnalyzeExpressionInput, type ApplySchemaPatchInput, type ApplySchemaPatchResult, type BasicBinding, CONTRACT_VERSION, type ConstituentaDraft, type ConstituentaState, type CstDiagnostic, CstType, type Diagnostic, DiagnosticKind, type DiagnosticSeverity, type DomainAnalysisLike, type DomainErrorLike, EvalStatus, type EvaluateInput, type EvaluationResult, type ExportFormat, type ExportPortalInput, type ExportPortalResult, type ImportDataKind, type ListDiagnosticsFilters, type ModelValueState, PORTAL_JSON_CONTRACT_VERSION, type PortalExportKind, type PortalImportMetadata, type PortalModelImportData, type PortalRsformDetails, type PortalSchemaConstituenta, type PortalSchemaImportData, type PortalTermForm, RSDiagnosticCode, RSErrorCode, RSToolAgent, type RSToolAgentContract, type RSToolAgentOptions, type RSToolValue, RSToolWrapperClient, type RSToolWrapperClientOptions, type RecalculateModelResult, type SessionHandle, type SessionModelState, type SessionRevision, type SessionState, type SessionStateDetail, type SessionStateResult, type SessionSummary, type SessionSummaryItem, type SetConstituentaValueInput, type SetModelValuesInput, ValueClass, type WrapperResponse, toDiagnostic, toPublicAnalysis };
|
|
13
|
+
export { type AgentConstituentaPatch, type AnalysisResult, type AnalyzeExpressionInput, type ApplySchemaPatchInput, type ApplySchemaPatchResult, type BasicBinding, CONTRACT_VERSION, type ConstituentaDraft, type ConstituentaState, type CstDiagnostic, CstType, type Diagnostic, DiagnosticKind, type DiagnosticSeverity, type DomainAnalysisLike, type DomainErrorLike, EvalStatus, type EvaluateInput, type EvaluationResult, type ExportFormat, type ExportPortalInput, type ExportPortalResult, type ImportDataKind, type ListDiagnosticsFilters, type ModelValueState, PORTAL_JSON_CONTRACT_VERSION, type PortalExportKind, type PortalImportMetadata, type PortalModelImportData, type PortalRsformDetails, type PortalSchemaConstituenta, type PortalSchemaImportData, type PortalTermForm, RSDiagnosticCode, RSErrorCode, RSToolAgent, type RSToolAgentContract, type RSToolAgentOptions, type RSToolValue, RSToolWrapperClient, type RSToolWrapperClientOptions, type RecalculateModelResult, type SessionHandle, type SessionModelState, type SessionRevision, type SessionState, type SessionStateDetail, type SessionStateResult, type SessionSummary, type SessionSummaryItem, type SetConstituentaValueInput, type SetModelValuesInput, type SynthesisSubstitution, type SynthesizeInput, type SynthesizeResult, ValueClass, type WrapperResponse, toDiagnostic, toPublicAnalysis };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { toDiagnostic, toPublicAnalysis } from "./mappers/types.js";
|
|
2
2
|
import { CstType, EvalStatus, RSErrorCode, ValueClass } from "./models/common.js";
|
|
3
3
|
import { DiagnosticKind, RSDiagnosticCode } from "./models/diagnostic.js";
|
|
4
|
-
import { r as PORTAL_JSON_CONTRACT_VERSION, t as RSToolAgent } from "./models-
|
|
4
|
+
import { r as PORTAL_JSON_CONTRACT_VERSION, t as RSToolAgent } from "./models-BKmWx92e.js";
|
|
5
5
|
import { CONTRACT_VERSION } from "./models/tool-contract.js";
|
|
6
6
|
import { RSToolWrapperClient } from "./wrapper/client.js";
|
|
7
7
|
export { CONTRACT_VERSION, CstType, DiagnosticKind, EvalStatus, PORTAL_JSON_CONTRACT_VERSION, RSDiagnosticCode, RSErrorCode, RSToolAgent, RSToolWrapperClient, ValueClass, toDiagnostic, toPublicAnalysis };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as SetConstituentaValueInput, i as SessionModelState, r as RecalculateModelResult } from "../model-value-BUhr2IjA.js";
|
|
2
|
-
import { r as SessionState } from "../session-
|
|
3
|
-
import { i as EvaluationResult } from "../evaluation-
|
|
2
|
+
import { r as SessionState } from "../session-Uc_vHrq9.js";
|
|
3
|
+
import { i as EvaluationResult } from "../evaluation-6A7rK4t7.js";
|
|
4
4
|
import { CstType } from "@rsconcept/domain/library/rsform";
|
|
5
5
|
import { RSEngine } from "@rsconcept/domain/library/rsengine";
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as Diagnostic } from "../diagnostic-
|
|
2
|
-
import { t as AnalysisResult } from "../analysis-
|
|
3
|
-
import { o as ConstituentaDraft, s as ConstituentaState } from "../constituenta-
|
|
4
|
-
import { r as SessionState } from "../session-
|
|
1
|
+
import { a as Diagnostic } from "../diagnostic-CODFUU-Q.js";
|
|
2
|
+
import { t as AnalysisResult } from "../analysis-ktWFu4BY.js";
|
|
3
|
+
import { o as ConstituentaDraft, s as ConstituentaState } from "../constituenta-HTnFtmxt.js";
|
|
4
|
+
import { r as SessionState } from "../session-Uc_vHrq9.js";
|
|
5
5
|
import { RSForm } from "@rsconcept/domain/library/rsform";
|
|
6
6
|
import { RSLangAnalyzer } from "@rsconcept/domain/rslang";
|
|
7
7
|
|
package/dist/mappers/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as Diagnostic, s as DiagnosticTarget } from "../diagnostic-
|
|
2
|
-
import { t as AnalysisResult } from "../analysis-
|
|
1
|
+
import { a as Diagnostic, s as DiagnosticTarget } from "../diagnostic-CODFUU-Q.js";
|
|
2
|
+
import { t as AnalysisResult } from "../analysis-ktWFu4BY.js";
|
|
3
3
|
import { ValueClass } from "@rsconcept/domain/rslang";
|
|
4
4
|
|
|
5
5
|
//#region src/mappers/types.d.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SessionStateDetail, c as SessionSummaryItem, i as RestoreOrderResult, n as ApplySchemaPatchInput, o as SessionStateResult, r as ApplySchemaPatchResult, s as SessionSummary, t as AgentConstituentaPatch } from "../agent-workflow-
|
|
2
|
-
export { AgentConstituentaPatch, ApplySchemaPatchInput, ApplySchemaPatchResult, RestoreOrderResult, SessionStateDetail, SessionStateResult, SessionSummary, SessionSummaryItem };
|
|
1
|
+
import { a as SessionStateDetail, c as SessionSummaryItem, d as SynthesizeResult, i as RestoreOrderResult, l as SynthesisSubstitution, n as ApplySchemaPatchInput, o as SessionStateResult, r as ApplySchemaPatchResult, s as SessionSummary, t as AgentConstituentaPatch, u as SynthesizeInput } from "../agent-workflow-DY-hfAap.js";
|
|
2
|
+
export { AgentConstituentaPatch, ApplySchemaPatchInput, ApplySchemaPatchResult, RestoreOrderResult, SessionStateDetail, SessionStateResult, SessionSummary, SessionSummaryItem, SynthesisSubstitution, SynthesizeInput, SynthesizeResult };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as AnalyzeExpressionInput, t as AnalysisResult } from "../analysis-
|
|
1
|
+
import { n as AnalyzeExpressionInput, t as AnalysisResult } from "../analysis-ktWFu4BY.js";
|
|
2
2
|
export { AnalysisResult, AnalyzeExpressionInput };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ApplyConstituentsResult, i as ApplyConstituentsMode, n as AddOrUpdateConstituentaResult, o as ConstituentaDraft, r as ApplyConstituentsInput, s as ConstituentaState, t as AddOrUpdateConstituentaInput } from "../constituenta-
|
|
1
|
+
import { a as ApplyConstituentsResult, i as ApplyConstituentsMode, n as AddOrUpdateConstituentaResult, o as ConstituentaDraft, r as ApplyConstituentsInput, s as ConstituentaState, t as AddOrUpdateConstituentaInput } from "../constituenta-HTnFtmxt.js";
|
|
2
2
|
export { AddOrUpdateConstituentaInput, AddOrUpdateConstituentaResult, ApplyConstituentsInput, ApplyConstituentsMode, ApplyConstituentsResult, ConstituentaDraft, ConstituentaState };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as Diagnostic, c as expandCstDiagnostic, d as getDiagnosticSeverity, f as modelStatusDiagnostic, i as RSDiagnosticCode, l as expressionDiagnostic, n as DiagnosticKind, o as DiagnosticSeverity, r as ListDiagnosticsFilters, s as DiagnosticTarget, t as CstDiagnostic, u as getDiagnosticName } from "../diagnostic-
|
|
1
|
+
import { a as Diagnostic, c as expandCstDiagnostic, d as getDiagnosticSeverity, f as modelStatusDiagnostic, i as RSDiagnosticCode, l as expressionDiagnostic, n as DiagnosticKind, o as DiagnosticSeverity, r as ListDiagnosticsFilters, s as DiagnosticTarget, t as CstDiagnostic, u as getDiagnosticName } from "../diagnostic-CODFUU-Q.js";
|
|
2
2
|
export { type CstDiagnostic, type Diagnostic, DiagnosticKind, type DiagnosticSeverity, type DiagnosticTarget, ListDiagnosticsFilters, RSDiagnosticCode, expandCstDiagnostic, expressionDiagnostic, getDiagnosticName, getDiagnosticSeverity, modelStatusDiagnostic };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as EvaluationResult, n as EvaluateExpressionInput, r as EvaluateInput, t as EvaluateConstituentaInput } from "../evaluation-
|
|
1
|
+
import { i as EvaluationResult, n as EvaluateExpressionInput, r as EvaluateInput, t as EvaluateConstituentaInput } from "../evaluation-6A7rK4t7.js";
|
|
2
2
|
export { EvaluateConstituentaInput, EvaluateExpressionInput, EvaluateInput, EvaluationResult };
|
package/dist/models/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { a as Diagnostic, i as RSDiagnosticCode, n as DiagnosticKind, o as DiagnosticSeverity, r as ListDiagnosticsFilters, t as CstDiagnostic } from "../diagnostic-
|
|
1
|
+
import { a as Diagnostic, i as RSDiagnosticCode, n as DiagnosticKind, o as DiagnosticSeverity, r as ListDiagnosticsFilters, t as CstDiagnostic } from "../diagnostic-CODFUU-Q.js";
|
|
2
2
|
import { a as RSToolValue, i as RSErrorCode, n as CstType, o as ValueClass, r as EvalStatus, t as BasicBinding } from "../common-D6TFl6l_.js";
|
|
3
|
-
import { n as AnalyzeExpressionInput, t as AnalysisResult } from "../analysis-
|
|
4
|
-
import { i as ApplyConstituentsMode, o as ConstituentaDraft, s as ConstituentaState } from "../constituenta-
|
|
3
|
+
import { n as AnalyzeExpressionInput, t as AnalysisResult } from "../analysis-ktWFu4BY.js";
|
|
4
|
+
import { i as ApplyConstituentsMode, o as ConstituentaDraft, s as ConstituentaState } from "../constituenta-HTnFtmxt.js";
|
|
5
5
|
import { a as SetConstituentaValueInput, i as SessionModelState, n as ModelValueState, r as RecalculateModelResult, s as SetModelValuesInput } from "../model-value-BUhr2IjA.js";
|
|
6
|
-
import { n as SessionRevision, r as SessionState, t as SessionHandle } from "../session-
|
|
7
|
-
import { a as SessionStateDetail, c as SessionSummaryItem, i as RestoreOrderResult, n as ApplySchemaPatchInput, o as SessionStateResult, r as ApplySchemaPatchResult, s as SessionSummary, t as AgentConstituentaPatch } from "../agent-workflow-
|
|
8
|
-
import { i as EvaluationResult, r as EvaluateInput } from "../evaluation-
|
|
9
|
-
import { a as ExportPortalInput, c as PortalExportKind, d as PortalModelImportData, f as PortalRsformDetails, g as portalItemToDraft, h as PortalTermForm, i as ExportFormat, l as PORTAL_JSON_CONTRACT_VERSION, m as PortalSchemaImportData, n as RSToolAgentContract, o as ExportPortalResult, p as PortalSchemaConstituenta, r as RSToolAgentOptions, s as ImportDataKind, t as CONTRACT_VERSION, u as PortalImportMetadata } from "../tool-contract-
|
|
10
|
-
import { t as RSToolAgent } from "../rstool-agent-
|
|
11
|
-
export { type AgentConstituentaPatch, type AnalysisResult, type AnalyzeExpressionInput, type ApplyConstituentsMode, type ApplySchemaPatchInput, type ApplySchemaPatchResult, type BasicBinding, CONTRACT_VERSION, type ConstituentaDraft, type ConstituentaState, type CstDiagnostic, CstType, type Diagnostic, DiagnosticKind, type DiagnosticSeverity, EvalStatus, type EvaluateInput, type EvaluationResult, type ExportFormat, type ExportPortalInput, type ExportPortalResult, type ImportDataKind, type ListDiagnosticsFilters, type ModelValueState, PORTAL_JSON_CONTRACT_VERSION, type PortalExportKind, type PortalImportMetadata, type PortalModelImportData, type PortalRsformDetails, type PortalSchemaConstituenta, type PortalSchemaImportData, type PortalTermForm, RSDiagnosticCode, RSErrorCode, RSToolAgent, type RSToolAgentContract, type RSToolAgentOptions, type RSToolValue, type RecalculateModelResult, type RestoreOrderResult, type SessionHandle, type SessionModelState, type SessionRevision, type SessionState, type SessionStateDetail, type SessionStateResult, type SessionSummary, type SessionSummaryItem, type SetConstituentaValueInput, type SetModelValuesInput, ValueClass, portalItemToDraft };
|
|
6
|
+
import { n as SessionRevision, r as SessionState, t as SessionHandle } from "../session-Uc_vHrq9.js";
|
|
7
|
+
import { a as SessionStateDetail, c as SessionSummaryItem, d as SynthesizeResult, i as RestoreOrderResult, l as SynthesisSubstitution, n as ApplySchemaPatchInput, o as SessionStateResult, r as ApplySchemaPatchResult, s as SessionSummary, t as AgentConstituentaPatch, u as SynthesizeInput } from "../agent-workflow-DY-hfAap.js";
|
|
8
|
+
import { i as EvaluationResult, r as EvaluateInput } from "../evaluation-6A7rK4t7.js";
|
|
9
|
+
import { a as ExportPortalInput, c as PortalExportKind, d as PortalModelImportData, f as PortalRsformDetails, g as portalItemToDraft, h as PortalTermForm, i as ExportFormat, l as PORTAL_JSON_CONTRACT_VERSION, m as PortalSchemaImportData, n as RSToolAgentContract, o as ExportPortalResult, p as PortalSchemaConstituenta, r as RSToolAgentOptions, s as ImportDataKind, t as CONTRACT_VERSION, u as PortalImportMetadata } from "../tool-contract-i0v2gbWs.js";
|
|
10
|
+
import { t as RSToolAgent } from "../rstool-agent-D-w4DlEo.js";
|
|
11
|
+
export { type AgentConstituentaPatch, type AnalysisResult, type AnalyzeExpressionInput, type ApplyConstituentsMode, type ApplySchemaPatchInput, type ApplySchemaPatchResult, type BasicBinding, CONTRACT_VERSION, type ConstituentaDraft, type ConstituentaState, type CstDiagnostic, CstType, type Diagnostic, DiagnosticKind, type DiagnosticSeverity, EvalStatus, type EvaluateInput, type EvaluationResult, type ExportFormat, type ExportPortalInput, type ExportPortalResult, type ImportDataKind, type ListDiagnosticsFilters, type ModelValueState, PORTAL_JSON_CONTRACT_VERSION, type PortalExportKind, type PortalImportMetadata, type PortalModelImportData, type PortalRsformDetails, type PortalSchemaConstituenta, type PortalSchemaImportData, type PortalTermForm, RSDiagnosticCode, RSErrorCode, RSToolAgent, type RSToolAgentContract, type RSToolAgentOptions, type RSToolValue, type RecalculateModelResult, type RestoreOrderResult, type SessionHandle, type SessionModelState, type SessionRevision, type SessionState, type SessionStateDetail, type SessionStateResult, type SessionSummary, type SessionSummaryItem, type SetConstituentaValueInput, type SetModelValuesInput, type SynthesisSubstitution, type SynthesizeInput, type SynthesizeResult, ValueClass, portalItemToDraft };
|
package/dist/models/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CstType, EvalStatus, RSErrorCode, ValueClass } from "./common.js";
|
|
2
2
|
import { DiagnosticKind, RSDiagnosticCode } from "./diagnostic.js";
|
|
3
|
-
import { i as portalItemToDraft, r as PORTAL_JSON_CONTRACT_VERSION, t as RSToolAgent } from "../models-
|
|
3
|
+
import { i as portalItemToDraft, r as PORTAL_JSON_CONTRACT_VERSION, t as RSToolAgent } from "../models-BKmWx92e.js";
|
|
4
4
|
import { CONTRACT_VERSION } from "./tool-contract.js";
|
|
5
5
|
export { CONTRACT_VERSION, CstType, DiagnosticKind, EvalStatus, PORTAL_JSON_CONTRACT_VERSION, RSDiagnosticCode, RSErrorCode, RSToolAgent, ValueClass, portalItemToDraft };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as RSToolAgent } from "../rstool-agent-
|
|
1
|
+
import { t as RSToolAgent } from "../rstool-agent-D-w4DlEo.js";
|
|
2
2
|
export { RSToolAgent };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as RSToolAgent } from "../models-
|
|
1
|
+
import { t as RSToolAgent } from "../models-BKmWx92e.js";
|
|
2
2
|
export { RSToolAgent };
|
package/dist/models/session.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SessionRevision, r as SessionState, t as SessionHandle } from "../session-
|
|
1
|
+
import { n as SessionRevision, r as SessionState, t as SessionHandle } from "../session-Uc_vHrq9.js";
|
|
2
2
|
export { SessionHandle, SessionRevision, SessionState };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RSToolAgentContract, r as RSToolAgentOptions, t as CONTRACT_VERSION } from "../tool-contract-
|
|
1
|
+
import { n as RSToolAgentContract, r as RSToolAgentOptions, t as CONTRACT_VERSION } from "../tool-contract-i0v2gbWs.js";
|
|
2
2
|
export { CONTRACT_VERSION, RSToolAgentContract, RSToolAgentOptions };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-contract.js","names":[],"sources":["../../src/models/tool-contract.ts"],"sourcesContent":["import {\n type ApplySchemaPatchInput,\n type ApplySchemaPatchResult,\n type RestoreOrderResult,\n type SessionStateDetail,\n type SessionStateResult\n} from './agent-workflow';\nimport { type AnalysisResult, type AnalyzeExpressionInput } from './analysis';\nimport { type Diagnostic, type ListDiagnosticsFilters } from './diagnostic';\nimport { type EvaluateInput, type EvaluationResult } from './evaluation';\nimport { type ExportPortalInput, type ExportPortalResult, type ImportDataKind } from './import-export';\nimport { type RecalculateModelResult, type SessionModelState, type SetModelValuesInput } from './model-value';\nimport { type SessionHandle, type SessionRevision, type SessionState } from './session';\n\n/** Agent-visible contract version; bump on breaking API changes. */\nexport const CONTRACT_VERSION = '3.
|
|
1
|
+
{"version":3,"file":"tool-contract.js","names":[],"sources":["../../src/models/tool-contract.ts"],"sourcesContent":["import {\n type ApplySchemaPatchInput,\n type ApplySchemaPatchResult,\n type RestoreOrderResult,\n type SessionStateDetail,\n type SessionStateResult,\n type SynthesizeInput,\n type SynthesizeResult\n} from './agent-workflow';\nimport { type AnalysisResult, type AnalyzeExpressionInput } from './analysis';\nimport { type Diagnostic, type ListDiagnosticsFilters } from './diagnostic';\nimport { type EvaluateInput, type EvaluationResult } from './evaluation';\nimport { type ExportPortalInput, type ExportPortalResult, type ImportDataKind } from './import-export';\nimport { type RecalculateModelResult, type SessionModelState, type SetModelValuesInput } from './model-value';\nimport { type SessionHandle, type SessionRevision, type SessionState } from './session';\n\n/** Agent-visible contract version; bump on breaking API changes. */\nexport const CONTRACT_VERSION = '3.2.0';\n\n/** Options for constructing an {@link RSToolAgent}. */\nexport interface RSToolAgentOptions {\n /** When set, sessions are persisted to this directory and survive process restarts. */\n persistenceDir?: string;\n}\n\n/**\n * Public method surface of {@link RSToolAgent}.\n *\n * Each method accepts an optional `sessionId`; when omitted, the current session is used\n * (or a new one is created where noted).\n */\nexport interface RSToolAgentContract {\n /** Current contract version string (same as {@link CONTRACT_VERSION}). */\n readonly contractVersion: string;\n\n /** Return the current session, or create one with optional `initial` metadata. */\n ensureSession(initial?: Partial<SessionState>): SessionHandle;\n\n /** Create a new session and make it current. */\n createSession(initial?: Partial<SessionState>): SessionHandle;\n\n /** Return the current session handle, or `null` when none is active. */\n getCurrentSession(): SessionHandle | null;\n\n /** Switch the active session; throws when `sessionId` is unknown. */\n setCurrentSession(sessionId: string): SessionHandle;\n\n /** Apply constituent patches to the schema (analyze, merge, optionally commit). */\n applySchemaPatch(input: ApplySchemaPatchInput, sessionId?: string): ApplySchemaPatchResult;\n\n /** Return session summary (default) or full cloned state when `detail` is `'full'`. */\n getSessionState(detail?: SessionStateDetail, sessionId?: string): SessionStateResult;\n\n /** List diagnostics for the session, optionally filtered by constituent or kind. */\n listDiagnostics(filters?: ListDiagnosticsFilters, sessionId?: string): Diagnostic[];\n\n /** Parse and type-check an RSLang expression against the current schema context. */\n analyzeExpression(input: AnalyzeExpressionInput, sessionId?: string): AnalysisResult;\n\n /** Record a revision checkpoint with an optional message. */\n commitStep(message?: string, sessionId?: string): SessionRevision;\n\n /** Export the session as a JSON string (state + diagnostics). */\n exportSession(sessionId?: string): string;\n\n /** Export schema or model payload in Portal JSON format. */\n exportPortal(input: ExportPortalInput, sessionId?: string): ExportPortalResult;\n\n /**\n * Import a session export or Portal JSON payload and make the new session current.\n *\n * When `kind` is `'auto'`, the payload shape is detected automatically.\n */\n importData(payload: string | object, kind?: ImportDataKind): SessionHandle;\n\n /** Set or clear model values for constituents; returns the updated model state. */\n setModelValues(input: SetModelValuesInput, sessionId?: string): Promise<SessionModelState>;\n\n /** Return a deep clone of the session model state. */\n getModelState(sessionId?: string): SessionModelState;\n\n /**\n * Evaluate a stored constituent or a scratch expression.\n *\n * Provide `constituentId`, or both `expression` and `cstType`.\n */\n evaluate(input: EvaluateInput, sessionId?: string): EvaluationResult;\n\n /** Recompute derived model values for all constituents. */\n recalculateModel(sessionId?: string): RecalculateModelResult;\n\n /**\n * Restore declaration order: formal topology, semantic clusters when ready,\n * otherwise stable against type/kernel preferred ranks.\n */\n restoreOrder(sessionId?: string): RestoreOrderResult;\n\n /**\n * Synthesis by embedding: merge constituents from another session into the receiver,\n * then apply an identification table.\n */\n synthesize(input: SynthesizeInput, sessionId?: string): SynthesizeResult;\n}\n"],"mappings":";;AAiBA,MAAa,mBAAmB"}
|
|
@@ -6,7 +6,7 @@ import { n as enrichSessionConstituents } from "./rsform-builder-DKwZfJvN.js";
|
|
|
6
6
|
import { ModelAdapter } from "./mappers/model-adapter.js";
|
|
7
7
|
import { SchemaAdapter } from "./mappers/schema-adapter.js";
|
|
8
8
|
import { CONTRACT_VERSION } from "./models/tool-contract.js";
|
|
9
|
-
import { restoreConstituentOrder } from "@rsconcept/domain/library/rsform-api";
|
|
9
|
+
import { inlineSynthesis, restoreConstituentOrder } from "@rsconcept/domain/library/rsform-api";
|
|
10
10
|
import { isModelIssue } from "@rsconcept/domain/library/rsmodel-api";
|
|
11
11
|
import { Graph } from "@rsconcept/domain/graph/graph";
|
|
12
12
|
import { extractGlobals } from "@rsconcept/domain/rslang/api";
|
|
@@ -219,7 +219,7 @@ var SessionStore = class {
|
|
|
219
219
|
this.persist(sessionId, envelope);
|
|
220
220
|
return {
|
|
221
221
|
sessionId,
|
|
222
|
-
contractVersion: contractVersion ?? "3.
|
|
222
|
+
contractVersion: contractVersion ?? "3.2.0"
|
|
223
223
|
};
|
|
224
224
|
}
|
|
225
225
|
get(sessionId) {
|
|
@@ -563,6 +563,104 @@ var RSToolAgent = class {
|
|
|
563
563
|
orderedAliases: ordered.map((item) => item.alias)
|
|
564
564
|
};
|
|
565
565
|
}
|
|
566
|
+
/** @inheritdoc */
|
|
567
|
+
synthesize(input, sessionId) {
|
|
568
|
+
const receiverHandle = sessionId ? {
|
|
569
|
+
sessionId: this.resolveSessionId(sessionId),
|
|
570
|
+
contractVersion: this.contractVersion
|
|
571
|
+
} : this.ensureSession();
|
|
572
|
+
const receiverId = receiverHandle.sessionId;
|
|
573
|
+
const sourceId = this.resolveSessionId(input.sourceSessionId);
|
|
574
|
+
if (sourceId === receiverId) throw new Error("synthesize: sourceSessionId must differ from the receiver session");
|
|
575
|
+
const receiverEnvelope = this.sessions.get(receiverId);
|
|
576
|
+
const sourceEnvelope = this.sessions.get(sourceId);
|
|
577
|
+
const snapshot = this.sessions.snapshot(receiverId);
|
|
578
|
+
try {
|
|
579
|
+
const sourceItems = this.selectSourceItems(sourceEnvelope.state.items, input.items);
|
|
580
|
+
const substitutions = this.resolveSynthesisSubstitutions(receiverEnvelope.state.items, sourceItems, input.substitutions ?? []);
|
|
581
|
+
const nextId = receiverEnvelope.state.items.reduce((max, item) => Math.max(max, item.id), 0) + 1;
|
|
582
|
+
const result = inlineSynthesis({
|
|
583
|
+
receiverItems: receiverEnvelope.state.items.map(toSynthesizableSessionItem),
|
|
584
|
+
sourceItems: sourceItems.map(toSynthesizableSessionItem),
|
|
585
|
+
substitutions,
|
|
586
|
+
nextId
|
|
587
|
+
});
|
|
588
|
+
const drafts = result.items.map((item) => ({
|
|
589
|
+
id: item.id,
|
|
590
|
+
alias: item.alias,
|
|
591
|
+
cstType: item.cst_type,
|
|
592
|
+
definitionFormal: item.definition_formal,
|
|
593
|
+
term: item.term_resolved || item.term_raw,
|
|
594
|
+
definitionText: item.definition_resolved || item.definition_raw,
|
|
595
|
+
convention: item.convention
|
|
596
|
+
}));
|
|
597
|
+
receiverEnvelope.state.items = [];
|
|
598
|
+
receiverEnvelope.state.model = { items: receiverEnvelope.state.model.items.filter((value) => !result.deletedIds.has(value.id)) };
|
|
599
|
+
this.sessions.replaceState(receiverId, receiverEnvelope.state);
|
|
600
|
+
const applied = this.applyConstituents({
|
|
601
|
+
drafts,
|
|
602
|
+
mode: "best_effort"
|
|
603
|
+
}, receiverId);
|
|
604
|
+
const revision = input.commitMessage ? this.commitStep(input.commitMessage, receiverId) : void 0;
|
|
605
|
+
return {
|
|
606
|
+
session: receiverHandle,
|
|
607
|
+
summary: this.buildSessionSummary(receiverId),
|
|
608
|
+
success: applied.success,
|
|
609
|
+
failed: applied.failed,
|
|
610
|
+
idMap: result.idMap,
|
|
611
|
+
aliasMapping: result.aliasMapping,
|
|
612
|
+
deletedIds: [...result.deletedIds],
|
|
613
|
+
insertedIds: result.insertedIds,
|
|
614
|
+
revision
|
|
615
|
+
};
|
|
616
|
+
} catch (error) {
|
|
617
|
+
this.sessions.restore(receiverId, snapshot);
|
|
618
|
+
throw error;
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
selectSourceItems(sourceItems, aliases) {
|
|
622
|
+
if (!aliases || aliases.length === 0) return [...sourceItems];
|
|
623
|
+
const byAlias = new Map(sourceItems.map((item) => [item.alias, item]));
|
|
624
|
+
const selected = [];
|
|
625
|
+
for (const alias of aliases) {
|
|
626
|
+
const item = byAlias.get(alias);
|
|
627
|
+
if (!item) throw new Error(`synthesize: unknown source alias "${alias}"`);
|
|
628
|
+
selected.push(item);
|
|
629
|
+
}
|
|
630
|
+
return selected;
|
|
631
|
+
}
|
|
632
|
+
resolveSynthesisSubstitutions(receiverItems, sourceItems, substitutions) {
|
|
633
|
+
if (!substitutions || substitutions.length === 0) return [];
|
|
634
|
+
const receiverByAlias = new Map(receiverItems.map((item) => [item.alias, item]));
|
|
635
|
+
const sourceByAlias = new Map(sourceItems.map((item) => [item.alias, item]));
|
|
636
|
+
const deletedKeys = /* @__PURE__ */ new Set();
|
|
637
|
+
const resolved = [];
|
|
638
|
+
for (const row of substitutions) {
|
|
639
|
+
const originalSource = sourceByAlias.get(row.original);
|
|
640
|
+
const originalReceiver = receiverByAlias.get(row.original);
|
|
641
|
+
const substitutionSource = sourceByAlias.get(row.substitution);
|
|
642
|
+
const substitutionReceiver = receiverByAlias.get(row.substitution);
|
|
643
|
+
let originalId;
|
|
644
|
+
let substitutionId;
|
|
645
|
+
let originalKey;
|
|
646
|
+
if (originalSource && substitutionReceiver) {
|
|
647
|
+
originalId = originalSource.id;
|
|
648
|
+
substitutionId = substitutionReceiver.id;
|
|
649
|
+
originalKey = `s:${originalId}`;
|
|
650
|
+
} else if (originalReceiver && substitutionSource) {
|
|
651
|
+
originalId = originalReceiver.id;
|
|
652
|
+
substitutionId = substitutionSource.id;
|
|
653
|
+
originalKey = `r:${originalId}`;
|
|
654
|
+
} else throw new Error(`synthesize: substitution "${row.original}" → "${row.substitution}" must pair one source alias with one receiver alias`);
|
|
655
|
+
if (deletedKeys.has(originalKey)) throw new Error(`synthesize: constituenta "${row.original}" is substituted more than once`);
|
|
656
|
+
deletedKeys.add(originalKey);
|
|
657
|
+
resolved.push({
|
|
658
|
+
original: originalId,
|
|
659
|
+
substitution: substitutionId
|
|
660
|
+
});
|
|
661
|
+
}
|
|
662
|
+
return resolved;
|
|
663
|
+
}
|
|
566
664
|
addOrUpdateConstituenta(input, sessionId) {
|
|
567
665
|
const id = this.resolveSessionId(sessionId);
|
|
568
666
|
const envelope = this.sessions.get(id);
|
|
@@ -761,7 +859,22 @@ var RSToolAgent = class {
|
|
|
761
859
|
this.sessions.setDiagnostics(sessionId, [...collectSchemaDiagnostics(envelope.state), ...collectModelDiagnostics(envelope.state)]);
|
|
762
860
|
}
|
|
763
861
|
};
|
|
862
|
+
function toSynthesizableSessionItem(item) {
|
|
863
|
+
return {
|
|
864
|
+
id: item.id,
|
|
865
|
+
alias: item.alias,
|
|
866
|
+
cst_type: item.cstType,
|
|
867
|
+
definition_formal: item.definitionFormal,
|
|
868
|
+
typification_manual: "",
|
|
869
|
+
term_raw: item.term,
|
|
870
|
+
term_resolved: item.term,
|
|
871
|
+
term_forms: [],
|
|
872
|
+
definition_raw: item.definitionText,
|
|
873
|
+
definition_resolved: item.definitionText,
|
|
874
|
+
convention: item.convention
|
|
875
|
+
};
|
|
876
|
+
}
|
|
764
877
|
//#endregion
|
|
765
878
|
export { portalItemToDraft as i, SessionStore as n, PORTAL_JSON_CONTRACT_VERSION as r, RSToolAgent as t };
|
|
766
879
|
|
|
767
|
-
//# sourceMappingURL=models-
|
|
880
|
+
//# sourceMappingURL=models-BKmWx92e.js.map
|