@rsconcept/rstool 0.10.2 → 1.0.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 +41 -31
- package/dist/agent-workflow-D-PSIb-m.d.ts +70 -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 -1
- 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/rstool-agent-_8bplZnb.d.ts +71 -0
- package/dist/rstool-agent-kijHA9ML.js +476 -0
- package/dist/rstool-agent-kijHA9ML.js.map +1 -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/session-store-C3jyOSqI.js +142 -0
- package/dist/session-store-C3jyOSqI.js.map +1 -0
- package/dist/tool-contract-5_Q44DGE.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 +62 -52
- package/dist/wrapper/stdio-wrapper.js.map +1 -1
- package/docs/CONSTITUENTA.md +2 -2
- package/docs/DIAGNOSTICS.md +20 -18
- 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 +23 -18
- 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 +13 -15
- 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 +19 -50
- package/examples/sample/build-rsmodel.ts +25 -44
- package/examples/sample/rsform-session.json +36 -33
- 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 +3 -3
- 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 +43 -0
- package/src/mappers/types.ts +4 -0
- package/src/models/agent-workflow.ts +78 -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.ts +39 -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.ts +44 -0
- package/src/models/rstool-agent.test.ts +300 -147
- package/src/models/rstool-agent.ts +350 -93
- package/src/models/session.ts +8 -5
- package/src/models/tool-contract.ts +81 -42
- package/src/session/batch-apply.test.ts +28 -0
- package/src/session/batch-apply.ts +47 -0
- package/src/session/persistence.ts +56 -0
- package/src/session/session-store.ts +67 -4
- package/src/wrapper/client.ts +23 -0
- package/src/wrapper/stdio-wrapper.ts +59 -49
- 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
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type PortalModelImportData, type PortalSchemaImportData } from './portal-json';
|
|
2
|
+
|
|
3
|
+
/** Portal export target: conceptual schema or model values. */
|
|
4
|
+
export type PortalExportKind = 'schema' | 'model';
|
|
5
|
+
|
|
6
|
+
/** Serialized JSON string or parsed object for export helpers. */
|
|
7
|
+
export type ExportFormat = 'json' | 'object';
|
|
8
|
+
|
|
9
|
+
/** Input for {@link RSToolAgent.exportPortal}. */
|
|
10
|
+
export interface ExportPortalInput {
|
|
11
|
+
kind: PortalExportKind;
|
|
12
|
+
/** Default: `json` (string). Use `object` for structured data. */
|
|
13
|
+
format?: ExportFormat;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Import payload discriminator.
|
|
18
|
+
*
|
|
19
|
+
* Use `'auto'` to detect from JSON shape, or pass an explicit kind when ambiguous.
|
|
20
|
+
*/
|
|
21
|
+
export type ImportDataKind = 'auto' | 'session' | 'portal-schema' | 'portal-details';
|
|
22
|
+
|
|
23
|
+
/** JSON string or Portal import object, depending on {@link ExportFormat}. */
|
|
24
|
+
export type ExportPortalResult = string | PortalSchemaImportData | PortalModelImportData;
|
package/src/models/index.ts
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
export {
|
|
2
|
+
type AgentConstituentaPatch,
|
|
3
|
+
type ApplySchemaPatchInput,
|
|
4
|
+
type ApplySchemaPatchResult,
|
|
5
|
+
type SessionStateDetail,
|
|
6
|
+
type SessionStateResult,
|
|
7
|
+
type SessionSummary,
|
|
8
|
+
type SessionSummaryItem
|
|
9
|
+
} from './agent-workflow';
|
|
1
10
|
export { type AnalysisResult, type AnalyzeExpressionInput } from './analysis';
|
|
2
11
|
export {
|
|
3
12
|
CstType,
|
|
@@ -8,34 +17,33 @@ export {
|
|
|
8
17
|
type RSToolErrorDescription,
|
|
9
18
|
type RSToolValue
|
|
10
19
|
} from './common';
|
|
11
|
-
export {
|
|
12
|
-
type AddOrUpdateConstituentaInput,
|
|
13
|
-
type AddOrUpdateConstituentaResult,
|
|
14
|
-
type ConstituentaDraft,
|
|
15
|
-
type ConstituentaState
|
|
16
|
-
} from './constituenta';
|
|
20
|
+
export { type ApplyConstituentsMode, type ConstituentaDraft, type ConstituentaState } from './constituenta';
|
|
17
21
|
export { type DiagnosticRecord, type ListDiagnosticsFilters } from './diagnostic';
|
|
22
|
+
export { type EvaluateInput, type EvaluationResult } from './evaluation';
|
|
18
23
|
export {
|
|
19
|
-
type
|
|
20
|
-
type
|
|
21
|
-
type
|
|
22
|
-
|
|
24
|
+
type ExportFormat,
|
|
25
|
+
type ExportPortalInput,
|
|
26
|
+
type ExportPortalResult,
|
|
27
|
+
type ImportDataKind,
|
|
28
|
+
type PortalExportKind
|
|
29
|
+
} from './import-export';
|
|
23
30
|
export {
|
|
24
|
-
type ClearConstituentaValuesInput,
|
|
25
31
|
type ModelValueState,
|
|
26
32
|
type RecalculateModelResult,
|
|
27
33
|
type SessionModelState,
|
|
28
34
|
type SetConstituentaValueInput,
|
|
29
|
-
type
|
|
35
|
+
type SetModelValuesInput
|
|
30
36
|
} from './model-value';
|
|
31
37
|
export {
|
|
32
38
|
PORTAL_JSON_CONTRACT_VERSION,
|
|
33
39
|
type PortalImportMetadata,
|
|
34
40
|
type PortalModelImportData,
|
|
41
|
+
type PortalRsformDetails,
|
|
35
42
|
type PortalSchemaConstituenta,
|
|
36
43
|
type PortalSchemaImportData,
|
|
37
|
-
type PortalTermForm
|
|
44
|
+
type PortalTermForm,
|
|
45
|
+
portalItemToDraft
|
|
38
46
|
} from './portal-json';
|
|
39
47
|
export { RSToolAgent } from './rstool-agent';
|
|
40
48
|
export { type SessionHandle, type SessionRevision, type SessionState } from './session';
|
|
41
|
-
export { CONTRACT_VERSION, type RSToolAgentContract } from './tool-contract';
|
|
49
|
+
export { CONTRACT_VERSION, type RSToolAgentContract, type RSToolAgentOptions } from './tool-contract';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type BasicBinding, type EvalStatus, type RSToolValue } from './common';
|
|
2
2
|
|
|
3
|
+
/** Model value for one constituent. */
|
|
3
4
|
export interface ModelValueState {
|
|
4
5
|
id: number;
|
|
5
6
|
/** Frontend type string: `basic` or normalized effective typification. */
|
|
@@ -7,11 +8,14 @@ export interface ModelValueState {
|
|
|
7
8
|
value: RSToolValue | BasicBinding;
|
|
8
9
|
}
|
|
9
10
|
|
|
11
|
+
/** All model values in a session. */
|
|
10
12
|
export interface SessionModelState {
|
|
11
13
|
items: ModelValueState[];
|
|
12
14
|
}
|
|
13
15
|
|
|
16
|
+
/** Set or replace the model value for one constituent. */
|
|
14
17
|
export interface SetConstituentaValueInput {
|
|
18
|
+
/** Target constituent id. */
|
|
15
19
|
target: number;
|
|
16
20
|
/** Optional type override; inferred from schema when omitted. */
|
|
17
21
|
type?: string;
|
|
@@ -26,6 +30,14 @@ export interface ClearConstituentaValuesInput {
|
|
|
26
30
|
items: number[];
|
|
27
31
|
}
|
|
28
32
|
|
|
33
|
+
/** Input for {@link RSToolAgent.setModelValues}. */
|
|
34
|
+
export interface SetModelValuesInput {
|
|
35
|
+
set?: SetConstituentaValueInput[];
|
|
36
|
+
/** Constituent ids whose model values should be cleared. */
|
|
37
|
+
clear?: number[];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Per-constituent outcome after {@link RSToolAgent.recalculateModel}. */
|
|
29
41
|
export interface RecalculateModelResult {
|
|
30
42
|
items: Array<{ id: number; alias: string; value: RSToolValue | null; status: EvalStatus }>;
|
|
31
43
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { type BasicBinding, type RSToolValue } from './common';
|
|
2
|
+
import { type ConstituentaDraft } from './constituenta';
|
|
2
3
|
|
|
3
4
|
/** Portal JSON import/export format version (schema and model files). */
|
|
4
5
|
export const PORTAL_JSON_CONTRACT_VERSION = '1.0.0';
|
|
5
6
|
|
|
7
|
+
/** Shared metadata block in Portal schema and model JSON files. */
|
|
6
8
|
export interface PortalImportMetadata {
|
|
7
9
|
contract_version: string;
|
|
8
10
|
title: string;
|
|
@@ -10,11 +12,13 @@ export interface PortalImportMetadata {
|
|
|
10
12
|
description: string;
|
|
11
13
|
}
|
|
12
14
|
|
|
15
|
+
/** Inflected or tagged surface form of a term. */
|
|
13
16
|
export interface PortalTermForm {
|
|
14
17
|
text: string;
|
|
15
18
|
tags: string;
|
|
16
19
|
}
|
|
17
20
|
|
|
21
|
+
/** One constituent in Portal schema JSON (`cst_type`, snake_case fields). */
|
|
18
22
|
export interface PortalSchemaConstituenta {
|
|
19
23
|
id: number;
|
|
20
24
|
alias: string;
|
|
@@ -31,11 +35,30 @@ export interface PortalSchemaConstituenta {
|
|
|
31
35
|
term_forms: PortalTermForm[];
|
|
32
36
|
}
|
|
33
37
|
|
|
38
|
+
/** Full Portal conceptual schema import/export document. */
|
|
34
39
|
export interface PortalSchemaImportData extends PortalImportMetadata {
|
|
35
40
|
items: PortalSchemaConstituenta[];
|
|
36
41
|
attribution: Array<{ container: number; attribute: number }>;
|
|
37
42
|
}
|
|
38
43
|
|
|
44
|
+
/** `GET /api/rsforms/:id/details` response (schema payload only). */
|
|
45
|
+
export interface PortalRsformDetails {
|
|
46
|
+
id?: number;
|
|
47
|
+
title?: string;
|
|
48
|
+
alias?: string;
|
|
49
|
+
description?: string;
|
|
50
|
+
items: Array<{
|
|
51
|
+
id: number;
|
|
52
|
+
alias: string;
|
|
53
|
+
cst_type: string;
|
|
54
|
+
definition_formal?: string;
|
|
55
|
+
term_raw?: string;
|
|
56
|
+
definition_raw?: string;
|
|
57
|
+
convention?: string;
|
|
58
|
+
}>;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** Full Portal conceptual model import/export document. */
|
|
39
62
|
export interface PortalModelImportData extends PortalImportMetadata {
|
|
40
63
|
items: Array<{
|
|
41
64
|
id: number;
|
|
@@ -43,3 +66,24 @@ export interface PortalModelImportData extends PortalImportMetadata {
|
|
|
43
66
|
value: RSToolValue | BasicBinding;
|
|
44
67
|
}>;
|
|
45
68
|
}
|
|
69
|
+
|
|
70
|
+
/** Map a Portal API or JSON schema item to an agent {@link ConstituentaDraft}. */
|
|
71
|
+
export function portalItemToDraft(item: {
|
|
72
|
+
id: number;
|
|
73
|
+
alias: string;
|
|
74
|
+
cst_type: string;
|
|
75
|
+
definition_formal?: string;
|
|
76
|
+
term_raw?: string;
|
|
77
|
+
definition_raw?: string;
|
|
78
|
+
convention?: string;
|
|
79
|
+
}): ConstituentaDraft {
|
|
80
|
+
return {
|
|
81
|
+
id: item.id,
|
|
82
|
+
alias: item.alias,
|
|
83
|
+
cstType: item.cst_type as ConstituentaDraft['cstType'],
|
|
84
|
+
definitionFormal: item.definition_formal ?? '',
|
|
85
|
+
term: item.term_raw ?? '',
|
|
86
|
+
definitionText: item.definition_raw ?? '',
|
|
87
|
+
convention: item.convention ?? ''
|
|
88
|
+
};
|
|
89
|
+
}
|