@rsconcept/rstool 1.7.1 → 2.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 +7 -7
- package/dist/index.js +1 -1
- package/dist/mappers/model-adapter.d.ts +6 -2
- package/dist/mappers/model-adapter.js +28 -3
- package/dist/mappers/model-adapter.js.map +1 -1
- package/dist/mappers/schema-adapter.d.ts +1 -2
- package/dist/mappers/schema-adapter.js +1 -1
- package/dist/mappers/types.d.ts +4 -5
- package/dist/models/index.js +1 -1
- package/dist/models/rstool-agent.js +1 -2
- package/dist/{models-DG2uTaV_.js → models-D06g8LId.js} +6 -5
- package/dist/{models-DG2uTaV_.js.map → models-D06g8LId.js.map} +1 -1
- package/dist/{rsform-builder-DKwZfJvN.js → rsform-builder-BlXEe5Ow.js} +2 -2
- package/dist/{rsform-builder-DKwZfJvN.js.map → rsform-builder-BlXEe5Ow.js.map} +1 -1
- package/dist/session/session-store.d.ts +3 -3
- package/dist/session/session-store.js +1 -2
- package/dist/wrapper/client.d.ts +15 -9
- package/dist/wrapper/client.js +79 -12
- package/dist/wrapper/client.js.map +1 -1
- package/dist/wrapper/stdio-wrapper.d.ts +1 -1
- package/dist/wrapper/stdio-wrapper.js +18 -10
- package/dist/wrapper/stdio-wrapper.js.map +1 -1
- package/docs/BRIEF.md +93 -0
- package/docs/CONCEPTUAL-SCHEMA.md +17 -2
- package/docs/CONSTRUCTIONS.md +384 -0
- package/docs/DIAGNOSTICS.md +9 -8
- package/docs/DOMAIN.md +12 -0
- package/docs/METHOD.md +208 -0
- package/docs/MODEL-TESTING.md +48 -0
- package/docs/PORTAL-API.md +38 -285
- package/docs/PORTAL-MODELS.md +24 -0
- package/docs/PORTAL-OSS.md +56 -0
- package/docs/PORTAL-PUBLISH.md +39 -0
- package/docs/PORTAL-READ.md +301 -0
- package/docs/README.md +8 -4
- package/docs/REQUIREMENTS.md +61 -0
- package/docs/SYNTAX.md +5 -4
- package/docs/TYPIFICATION.md +12 -3
- package/docs/brief.schema.json +173 -0
- package/examples/README.md +16 -2
- package/examples/access-control/NOTES.md +23 -0
- package/examples/access-control/anti/collapsed.json +439 -0
- package/examples/access-control/anti/weakened.json +439 -0
- package/examples/access-control/brief-v1.json +231 -0
- package/examples/access-control/brief.json +310 -0
- package/examples/access-control/build-rsform.ts +151 -0
- package/examples/access-control/requirements-v1.md +9 -0
- package/examples/access-control/requirements-v2.md +4 -0
- package/examples/access-control/rsform-session-v1.json +439 -0
- package/examples/access-control/rsform-session.json +523 -0
- package/examples/audit-diagnostics.ts +9 -1
- package/examples/briefs.test.ts +126 -0
- package/examples/clinic-booking/NOTES.md +24 -0
- package/examples/clinic-booking/anti/collapsed.json +615 -0
- package/examples/clinic-booking/anti/species-as-genus.json +568 -0
- package/examples/clinic-booking/brief-v1.json +332 -0
- package/examples/clinic-booking/brief.json +405 -0
- package/examples/clinic-booking/build-rsform.ts +174 -0
- package/examples/clinic-booking/requirements-v1.md +9 -0
- package/examples/clinic-booking/requirements-v2.md +4 -0
- package/examples/clinic-booking/rsform-session-v1.json +615 -0
- package/examples/clinic-booking/rsform-session.json +700 -0
- package/examples/diagnostics-utils.ts +26 -0
- package/examples/kinship/brief.json +337 -0
- package/examples/kinship/build-rsform.ts +7 -4
- package/examples/kinship/rsform-session.json +20 -63
- package/examples/kinship/rsmodel-session.json +14 -14
- package/examples/kinship-subordination/NOTES.md +49 -0
- package/examples/kinship-subordination/brief.json +161 -0
- package/examples/kinship-subordination/build-rsform.ts +100 -0
- package/examples/kinship-subordination/rsform-session.json +795 -0
- package/examples/library-loans/NOTES.md +46 -0
- package/examples/library-loans/anti/collapsed.json +481 -0
- package/examples/library-loans/anti/species-as-genus.json +334 -0
- package/examples/library-loans/anti/uncovered.json +406 -0
- package/examples/library-loans/anti/weakened.json +464 -0
- package/examples/library-loans/brief-v1.json +340 -0
- package/examples/library-loans/brief.json +502 -0
- package/examples/library-loans/build-rsform.ts +239 -0
- package/examples/library-loans/requirements-v1.md +11 -0
- package/examples/library-loans/requirements-v2.md +5 -0
- package/examples/library-loans/rsform-session-v1.json +481 -0
- package/examples/library-loans/rsform-session.json +652 -0
- package/examples/library-loans/source-markup.md +18 -0
- package/examples/movd/brief.json +220 -0
- package/examples/movd/build-rsform.ts +5 -2
- package/examples/movd/rsform-session.json +14 -46
- package/examples/subordination/NOTES.md +59 -0
- package/examples/subordination/anti/collapsed.json +556 -0
- package/examples/subordination/anti/single-relation.json +125 -0
- package/examples/subordination/anti/transitive.json +573 -0
- package/examples/subordination/anti/weakened.json +539 -0
- package/examples/subordination/brief.json +386 -0
- package/examples/subordination/build-rsform.ts +63 -0
- package/examples/subordination/constants.ts +115 -0
- package/examples/subordination/rsform-session.json +556 -0
- package/examples/subordination/source-markup.md +19 -0
- package/examples/subordination/source.md +40 -0
- package/package.json +29 -20
- package/skills/INSTALL.md +28 -29
- package/skills/README.md +25 -10
- package/skills/rs-core/SKILL.md +56 -0
- package/skills/rs-explain/SKILL.md +28 -0
- package/skills/rs-explicate/SKILL.md +71 -0
- package/skills/rs-interpret/SKILL.md +67 -0
- package/skills/rs-portal/SKILL.md +51 -0
- package/skills/rs-review/SKILL.md +79 -0
- package/skills/rs-scope/SKILL.md +67 -0
- package/skills/rs-synthesis/SKILL.md +52 -0
- package/skills/rstool/SKILL.md +70 -0
- package/skills/rstool-helper/GUIDE.md +18 -272
- package/skills/rstool-helper/SKILL.md +8 -55
- package/skills/{rstool-helper → rstool-runtime}/EXAMPLES.md +40 -12
- package/skills/{rstool-helper → rstool-runtime}/REFERENCE.md +28 -7
- package/skills/rstool-runtime/SKILL.md +96 -0
- package/skills/scripts/brief-check.test.ts +165 -0
- package/skills/scripts/brief-check.ts +826 -0
- package/skills/scripts/check-brief.ts +94 -0
- package/skills/scripts/rstool-skills.mjs +119 -0
- package/skills/scripts/skill-stubs.test.ts +48 -0
- package/src/mappers/model-adapter.ts +34 -1
- package/src/models/rstool-agent.test.ts +95 -0
- package/src/wrapper/client.test.ts +43 -4
- package/src/wrapper/client.ts +95 -16
- package/src/wrapper/stdio-handler.test.ts +43 -0
- package/src/wrapper/stdio-handler.ts +19 -5
|
@@ -98,4 +98,47 @@ describe('handleStdioRequest', () => {
|
|
|
98
98
|
expect((all.result as unknown[]).length).toBeGreaterThan(0);
|
|
99
99
|
expect(filtered.result).toEqual(all.result);
|
|
100
100
|
});
|
|
101
|
+
|
|
102
|
+
it('filters diagnostics by flat kind and severity params', async () => {
|
|
103
|
+
const sessionTool = new RSToolAgent();
|
|
104
|
+
const created = await handleStdioRequest(sessionTool, { id: 30, method: 'createSession' });
|
|
105
|
+
const sessionId = (created.result as { sessionId: string }).sessionId;
|
|
106
|
+
// X1 without convention → schema diagnostic; D1 with broken formula → expression diagnostic
|
|
107
|
+
await handleStdioRequest(sessionTool, {
|
|
108
|
+
id: 31,
|
|
109
|
+
method: 'applySchemaPatch',
|
|
110
|
+
params: {
|
|
111
|
+
sessionId,
|
|
112
|
+
mode: 'best_effort',
|
|
113
|
+
items: [{ alias: 'X1' }, { alias: 'D1', definitionFormal: 'Pr1(' }]
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
const all = await handleStdioRequest(sessionTool, { id: 32, method: 'listDiagnostics', params: { sessionId } });
|
|
118
|
+
const kinds = new Set((all.result as { kind: string }[]).map(item => item.kind));
|
|
119
|
+
expect(kinds.has('schema')).toBe(true);
|
|
120
|
+
expect(kinds.has('expression')).toBe(true);
|
|
121
|
+
|
|
122
|
+
const schemaOnly = await handleStdioRequest(sessionTool, {
|
|
123
|
+
id: 33,
|
|
124
|
+
method: 'listDiagnostics',
|
|
125
|
+
params: { sessionId, kind: 'schema' }
|
|
126
|
+
});
|
|
127
|
+
expect((schemaOnly.result as { kind: string }[]).every(item => item.kind === 'schema')).toBe(true);
|
|
128
|
+
expect((schemaOnly.result as unknown[]).length).toBeLessThan((all.result as unknown[]).length);
|
|
129
|
+
|
|
130
|
+
const warningsOnly = await handleStdioRequest(sessionTool, {
|
|
131
|
+
id: 34,
|
|
132
|
+
method: 'listDiagnostics',
|
|
133
|
+
params: { sessionId, severity: 'warning' }
|
|
134
|
+
});
|
|
135
|
+
expect((warningsOnly.result as { severity: string }[]).every(item => item.severity === 'warning')).toBe(true);
|
|
136
|
+
|
|
137
|
+
const legacy = await handleStdioRequest(sessionTool, {
|
|
138
|
+
id: 35,
|
|
139
|
+
method: 'listDiagnostics',
|
|
140
|
+
params: { sessionId, filters: { kind: 'schema' } }
|
|
141
|
+
});
|
|
142
|
+
expect(legacy.result).toEqual(schemaOnly.result);
|
|
143
|
+
});
|
|
101
144
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ListDiagnosticsFilters } from '../models/diagnostic';
|
|
1
2
|
import type { RSToolAgent } from '../models/rstool-agent';
|
|
2
3
|
|
|
3
4
|
export interface StdioRequest {
|
|
@@ -63,6 +64,22 @@ function omitSessionId(input: Record<string, unknown>): Record<string, unknown>
|
|
|
63
64
|
return rest;
|
|
64
65
|
}
|
|
65
66
|
|
|
67
|
+
/** Flat `constituentId` / `kind` / `severity` params; legacy nested `filters` object is still accepted. */
|
|
68
|
+
function diagnosticsFilters(input: Record<string, unknown>): ListDiagnosticsFilters | undefined {
|
|
69
|
+
const source = { ...asObject(input.filters), ...omitSessionId(input) };
|
|
70
|
+
const filters: ListDiagnosticsFilters = {};
|
|
71
|
+
if (typeof source.constituentId === 'number') {
|
|
72
|
+
filters.constituentId = source.constituentId;
|
|
73
|
+
}
|
|
74
|
+
if (source.kind === 'expression' || source.kind === 'schema' || source.kind === 'model') {
|
|
75
|
+
filters.kind = source.kind;
|
|
76
|
+
}
|
|
77
|
+
if (source.severity === 'error' || source.severity === 'warning') {
|
|
78
|
+
filters.severity = source.severity;
|
|
79
|
+
}
|
|
80
|
+
return Object.keys(filters).length > 0 ? filters : undefined;
|
|
81
|
+
}
|
|
82
|
+
|
|
66
83
|
export async function handleStdioRequest(tool: RSToolAgent, request: StdioRequest): Promise<StdioResponse> {
|
|
67
84
|
try {
|
|
68
85
|
const params = asObject(request.params);
|
|
@@ -110,15 +127,12 @@ export async function handleStdioRequest(tool: RSToolAgent, request: StdioReques
|
|
|
110
127
|
optionalSessionId(params)
|
|
111
128
|
)
|
|
112
129
|
};
|
|
113
|
-
case 'listDiagnostics':
|
|
114
|
-
const constituentId = params.constituentId;
|
|
115
|
-
const filters = typeof constituentId === 'number' ? { constituentId } : (params.filters as never);
|
|
130
|
+
case 'listDiagnostics':
|
|
116
131
|
return {
|
|
117
132
|
id: request.id,
|
|
118
133
|
ok: true,
|
|
119
|
-
result: tool.listDiagnostics(
|
|
134
|
+
result: tool.listDiagnostics(diagnosticsFilters(params), optionalSessionId(params))
|
|
120
135
|
};
|
|
121
|
-
}
|
|
122
136
|
case 'analyzeExpression':
|
|
123
137
|
return {
|
|
124
138
|
id: request.id,
|