@rsconcept/rstool 0.10.3 → 1.0.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.
- package/README.md +61 -33
- package/dist/agent-workflow-Gk0Vfnv1.d.ts +64 -0
- package/dist/analysis-LLnPhmGa.d.ts +23 -0
- package/dist/{common-DxLg3eXX.d.ts → common-DHJalS-Q.d.ts} +6 -1
- package/dist/constituenta-DnGR6bnM.d.ts +54 -0
- package/dist/diagnostic-D9yl_mEL.d.ts +19 -0
- package/dist/evaluation-Cns8BFm4.d.ts +31 -0
- package/dist/index.d.ts +11 -11
- package/dist/index.js +1 -2
- package/dist/mappers/model-adapter.d.ts +3 -3
- package/dist/mappers/schema-adapter.d.ts +4 -4
- package/dist/mappers/types.d.ts +6 -2
- package/dist/mappers/types.js +2 -0
- package/dist/mappers/types.js.map +1 -1
- package/dist/{model-value-SFAVj0dw.d.ts → model-value-BbonPzMz.d.ts} +14 -3
- package/dist/models/agent-workflow.d.ts +2 -0
- package/dist/models/agent-workflow.js +1 -0
- package/dist/models/analysis.d.ts +1 -1
- package/dist/models/common.d.ts +1 -1
- package/dist/models/constituenta.d.ts +2 -2
- package/dist/models/diagnostic.d.ts +1 -1
- package/dist/models/evaluation.d.ts +2 -2
- package/dist/models/index.d.ts +11 -11
- package/dist/models/index.js +2 -2
- package/dist/models/model-value.d.ts +2 -2
- 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 +2 -2
- package/dist/models/tool-contract.js +2 -1
- package/dist/models/tool-contract.js.map +1 -1
- package/dist/models-Bw6Uum8i.js +685 -0
- package/dist/models-Bw6Uum8i.js.map +1 -0
- package/dist/rstool-agent-D2cQze_b.d.ts +71 -0
- package/dist/session/session-store.d.ts +18 -5
- package/dist/session/session-store.js +1 -64
- package/dist/{session-BPgsE80c.d.ts → session-ChexW8i7.d.ts} +11 -8
- package/dist/tool-contract-0uRGhEfW.d.ts +164 -0
- package/dist/wrapper/client.d.ts +23 -0
- package/dist/wrapper/client.js +17 -0
- package/dist/wrapper/client.js.map +1 -1
- package/dist/wrapper/stdio-wrapper.js +75 -63
- package/dist/wrapper/stdio-wrapper.js.map +1 -1
- package/docs/CONSTITUENTA.md +2 -2
- package/docs/DIAGNOSTICS.md +6 -5
- package/docs/MODEL-TESTING.md +3 -3
- package/docs/PORTAL-API.md +24 -18
- package/examples/README.md +1 -1
- package/examples/agent-client.ts +11 -41
- package/examples/build-chocolate-nim-rsform.ts +21 -70
- package/examples/chocolate-nim/build-rsform.ts +23 -18
- package/examples/chocolate-nim/build-rsmodel.ts +10 -12
- package/examples/chocolate-nim/rsform-session.json +290 -290
- package/examples/chocolate-nim/rsmodel-session.json +291 -291
- package/examples/expression-bank/bank-constituents.ts +304 -53
- package/examples/expression-bank/build-rsform.ts +19 -16
- package/examples/expression-bank/rsform-session.json +1551 -1551
- package/examples/kinship/build-rsform.ts +23 -18
- package/examples/kinship/build-rsmodel.ts +16 -16
- package/examples/kinship/rsform-session.json +219 -219
- package/examples/kinship/rsmodel-session.json +221 -221
- package/examples/kinship/session.ts +19 -21
- package/examples/movd/build-rsform.ts +23 -18
- package/examples/movd/build-rsmodel.ts +18 -20
- package/examples/movd/rsform-session.json +262 -262
- package/examples/movd/rsmodel-session.json +264 -264
- package/examples/sample/build-rsform.ts +18 -51
- package/examples/sample/build-rsmodel.ts +25 -44
- package/examples/sample/rsform-session.json +10 -7
- package/examples/sample/rsmodel-session.json +36 -33
- package/examples/template-apply/build-rsform.ts +27 -24
- package/examples/template-apply/rsform-session.json +48 -48
- package/package.json +4 -2
- package/skills/rstool-helper/EXAMPLES.md +44 -116
- package/skills/rstool-helper/GUIDE.md +40 -25
- package/skills/rstool-helper/REFERENCE.md +40 -177
- package/src/index.ts +24 -17
- package/src/mappers/portal-adapter.ts +49 -0
- package/src/mappers/types.ts +4 -0
- package/src/models/agent-workflow.ts +66 -0
- package/src/models/analysis.ts +7 -0
- package/src/models/common.ts +7 -0
- package/src/models/constituenta.ts +24 -6
- package/src/models/diagnostic.ts +4 -0
- package/src/models/evaluation.ts +11 -0
- package/src/models/import-detect.test.ts +66 -0
- package/src/models/import-detect.ts +42 -0
- package/src/models/import-export.ts +24 -0
- package/src/models/index.ts +22 -14
- package/src/models/model-value.ts +12 -0
- package/src/models/portal-json.test.ts +38 -0
- package/src/models/portal-json.ts +54 -1
- package/src/models/rstool-agent.test.ts +698 -146
- package/src/models/rstool-agent.ts +392 -92
- package/src/models/session.ts +8 -5
- package/src/models/tool-contract.ts +81 -42
- package/src/session/batch-apply.test.ts +123 -0
- package/src/session/batch-apply.ts +82 -0
- package/src/session/persistence.test.ts +63 -0
- package/src/session/persistence.ts +69 -0
- package/src/session/session-store.ts +76 -6
- package/src/wrapper/client.test.ts +58 -0
- package/src/wrapper/client.ts +23 -0
- package/src/wrapper/stdio-handler.test.ts +101 -0
- package/src/wrapper/stdio-handler.ts +195 -0
- package/src/wrapper/stdio-wrapper.ts +4 -187
- package/dist/analysis-JiwOYDKx.d.ts +0 -16
- package/dist/constituenta-Dnd6iToB.d.ts +0 -36
- package/dist/diagnostic-BMYvciz8.d.ts +0 -15
- package/dist/evaluation-CCVYH0wA.d.ts +0 -21
- package/dist/index-uhkmwruf.d.ts +0 -46
- package/dist/rstool-agent-BZi5jO1y.js +0 -158
- package/dist/rstool-agent-BZi5jO1y.js.map +0 -1
- package/dist/rstool-agent-pRaPnZay.d.ts +0 -35
- package/dist/session/session-store.js.map +0 -1
- package/dist/tool-contract-n1ghUOrK.d.ts +0 -32
|
@@ -1,8 +1,19 @@
|
|
|
1
|
-
import { type BasicBinding, type RSToolValue } from './common';
|
|
1
|
+
import { CstType, type BasicBinding, type RSToolValue } from './common';
|
|
2
|
+
import { type ConstituentaDraft } from './constituenta';
|
|
3
|
+
|
|
4
|
+
const CST_TYPE_VALUES = new Set<string>(Object.values(CstType));
|
|
5
|
+
|
|
6
|
+
function parsePortalCstType(value: string, alias: string): ConstituentaDraft['cstType'] {
|
|
7
|
+
if (!CST_TYPE_VALUES.has(value)) {
|
|
8
|
+
throw new Error(`Invalid cst_type "${value}" for constituent "${alias}"`);
|
|
9
|
+
}
|
|
10
|
+
return value as ConstituentaDraft['cstType'];
|
|
11
|
+
}
|
|
2
12
|
|
|
3
13
|
/** Portal JSON import/export format version (schema and model files). */
|
|
4
14
|
export const PORTAL_JSON_CONTRACT_VERSION = '1.0.0';
|
|
5
15
|
|
|
16
|
+
/** Shared metadata block in Portal schema and model JSON files. */
|
|
6
17
|
export interface PortalImportMetadata {
|
|
7
18
|
contract_version: string;
|
|
8
19
|
title: string;
|
|
@@ -10,11 +21,13 @@ export interface PortalImportMetadata {
|
|
|
10
21
|
description: string;
|
|
11
22
|
}
|
|
12
23
|
|
|
24
|
+
/** Inflected or tagged surface form of a term. */
|
|
13
25
|
export interface PortalTermForm {
|
|
14
26
|
text: string;
|
|
15
27
|
tags: string;
|
|
16
28
|
}
|
|
17
29
|
|
|
30
|
+
/** One constituent in Portal schema JSON (`cst_type`, snake_case fields). */
|
|
18
31
|
export interface PortalSchemaConstituenta {
|
|
19
32
|
id: number;
|
|
20
33
|
alias: string;
|
|
@@ -31,11 +44,30 @@ export interface PortalSchemaConstituenta {
|
|
|
31
44
|
term_forms: PortalTermForm[];
|
|
32
45
|
}
|
|
33
46
|
|
|
47
|
+
/** Full Portal conceptual schema import/export document. */
|
|
34
48
|
export interface PortalSchemaImportData extends PortalImportMetadata {
|
|
35
49
|
items: PortalSchemaConstituenta[];
|
|
36
50
|
attribution: Array<{ container: number; attribute: number }>;
|
|
37
51
|
}
|
|
38
52
|
|
|
53
|
+
/** `GET /api/rsforms/:id/details` response (schema payload only). */
|
|
54
|
+
export interface PortalRsformDetails {
|
|
55
|
+
id?: number;
|
|
56
|
+
title?: string;
|
|
57
|
+
alias?: string;
|
|
58
|
+
description?: string;
|
|
59
|
+
items: Array<{
|
|
60
|
+
id: number;
|
|
61
|
+
alias: string;
|
|
62
|
+
cst_type: string;
|
|
63
|
+
definition_formal?: string;
|
|
64
|
+
term_raw?: string;
|
|
65
|
+
definition_raw?: string;
|
|
66
|
+
convention?: string;
|
|
67
|
+
}>;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Full Portal conceptual model import/export document. */
|
|
39
71
|
export interface PortalModelImportData extends PortalImportMetadata {
|
|
40
72
|
items: Array<{
|
|
41
73
|
id: number;
|
|
@@ -43,3 +75,24 @@ export interface PortalModelImportData extends PortalImportMetadata {
|
|
|
43
75
|
value: RSToolValue | BasicBinding;
|
|
44
76
|
}>;
|
|
45
77
|
}
|
|
78
|
+
|
|
79
|
+
/** Map a Portal API or JSON schema item to an agent {@link ConstituentaDraft}. */
|
|
80
|
+
export function portalItemToDraft(item: {
|
|
81
|
+
id: number;
|
|
82
|
+
alias: string;
|
|
83
|
+
cst_type: string;
|
|
84
|
+
definition_formal?: string;
|
|
85
|
+
term_raw?: string;
|
|
86
|
+
definition_raw?: string;
|
|
87
|
+
convention?: string;
|
|
88
|
+
}): ConstituentaDraft {
|
|
89
|
+
return {
|
|
90
|
+
id: item.id,
|
|
91
|
+
alias: item.alias,
|
|
92
|
+
cstType: parsePortalCstType(item.cst_type, item.alias),
|
|
93
|
+
definitionFormal: item.definition_formal ?? '',
|
|
94
|
+
term: item.term_raw ?? '',
|
|
95
|
+
definitionText: item.definition_raw ?? '',
|
|
96
|
+
convention: item.convention ?? ''
|
|
97
|
+
};
|
|
98
|
+
}
|