@openmbee/opensysml 0.10.0 → 0.10.2-nightly.20261019.ge8607989d
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 +13 -4
- package/dist/browser/wasm.js +4 -1
- package/dist/core/capabilities.d.ts +15 -0
- package/dist/core/capabilities.js +15 -0
- package/dist/core/check.d.ts +90 -0
- package/dist/core/check.js +70 -0
- package/dist/core/connection.d.ts +101 -3
- package/dist/core/connection.js +225 -6
- package/dist/core/errors.d.ts +5 -0
- package/dist/core/exploration.d.ts +6 -0
- package/dist/core/exploration.js +17 -4
- package/dist/core/index.d.ts +6 -3
- package/dist/core/index.js +4 -3
- package/dist/core/model.d.ts +48 -4
- package/dist/core/model.js +48 -3
- package/dist/core/render-view.d.ts +6 -0
- package/dist/core/render-view.js +8 -0
- package/dist/core/values.d.ts +4 -0
- package/dist/core/values.js +5 -3
- package/dist/core/verdict.d.ts +282 -1
- package/dist/core/verdict.js +344 -1
- package/dist/generated/sysml_pb.d.ts +5641 -3395
- package/dist/generated/sysml_pb.js +311 -121
- package/package.json +7 -7
- package/release-digests.json +18 -1
package/README.md
CHANGED
|
@@ -181,10 +181,16 @@ while another origin is not.
|
|
|
181
181
|
`connectWasm()` uses the same `Connection`, `Model`, values and errors over the
|
|
182
182
|
combined `sysml-wasm` module. It serves `ParseFile`, `ParseSources`,
|
|
183
183
|
`GetDiagnostics`, `GetSymbol`, `Evaluate`, `Instantiate`, `ExecuteAction`,
|
|
184
|
-
`ExecuteState` and `GetServerInfo`. Those are the module's complete RPC surface;
|
|
184
|
+
`ExecuteState`, `RenderView` and `GetServerInfo`. Those are the module's complete RPC surface;
|
|
185
185
|
other capability-gated operations fail with `MissingCapabilityError`, and a
|
|
186
186
|
direct unsupported RPC fails with `UNIMPLEMENTED`.
|
|
187
187
|
The adapter uses JSON encoding; requesting protobuf encoding is refused.
|
|
188
|
+
The module answers `RenderView` as the service's protojson `RenderViewResponse` and
|
|
189
|
+
advertises `render_view`, so `connection.renderView()` returns the same `RenderedView`
|
|
190
|
+
over either; `renderedViewFromJson()` decodes such a response saved as JSON (a snapshot a
|
|
191
|
+
page paints before its module has loaded). A traced `ExecuteState` answers the service's
|
|
192
|
+
`DocumentEvent` records and the module advertises `state_trace`, so
|
|
193
|
+
`connection.executeState(…, { trace: true })` returns the same typed trace over either.
|
|
188
194
|
|
|
189
195
|
In Node, install the optional `@openmbee/opensysml-wasm` package at the same
|
|
190
196
|
version as this client. `connectWasm()` resolves its module and matching Go
|
|
@@ -257,9 +263,12 @@ https://cdn.jsdelivr.net/npm/@openmbee/opensysml-wasm@<version>/sysml-wasm.wasm
|
|
|
257
263
|
https://cdn.jsdelivr.net/npm/@openmbee/opensysml-wasm@<version>/wasm_exec.js
|
|
258
264
|
```
|
|
259
265
|
|
|
266
|
+
The same package carries `sysml-prod.wasm.gz`, the gzip-compressed browser build of the
|
|
267
|
+
`sysml` REPL for pages that run the REPL itself; `connectWasm()` does not use it.
|
|
268
|
+
|
|
260
269
|
Browser callers pass those URLs as `wasm` and `wasmExec`; browser package
|
|
261
|
-
resolution is not automatic. The combined module measures about 7
|
|
262
|
-
and
|
|
270
|
+
resolution is not automatic. The combined module measures about 8.7 MB gzipped
|
|
271
|
+
and 6.1 MB with Brotli.
|
|
263
272
|
|
|
264
273
|
## Protobuf, not JSON
|
|
265
274
|
|
|
@@ -518,7 +527,7 @@ verb, and `save` writes what it answers with its image files beside it:
|
|
|
518
527
|
|
|
519
528
|
```ts
|
|
520
529
|
const migration = await connection.migrate("sysml", { path: "Model.mdzip" }, { report: true });
|
|
521
|
-
console.log(migration.report.summary); // migrated
|
|
530
|
+
console.log(migration.report.summary); // migrated 95 element(s): 77 mapped, 15 approximated, …
|
|
522
531
|
for (const entry of migration.report.byVerdict("unmapped")) {
|
|
523
532
|
console.log(`${entry.kind} ${entry.name}: ${entry.note}`);
|
|
524
533
|
}
|
package/dist/browser/wasm.js
CHANGED
|
@@ -83,7 +83,10 @@ async function browserWasmSource(wasm) {
|
|
|
83
83
|
if (wasm instanceof Response && wasm.bodyUsed) {
|
|
84
84
|
throw new Error("the WebAssembly Response body has already been read");
|
|
85
85
|
}
|
|
86
|
-
|
|
86
|
+
if (wasm instanceof Response || wasm instanceof URL) {
|
|
87
|
+
return loadWasmSource(wasm);
|
|
88
|
+
}
|
|
89
|
+
return loadWasmSource(resourceUrl(wasm));
|
|
87
90
|
}
|
|
88
91
|
function resourceUrl(value) {
|
|
89
92
|
if (value instanceof URL) {
|
|
@@ -31,6 +31,9 @@ export declare const CAPABILITY_TENSOR_VALUES = "tensor_values";
|
|
|
31
31
|
export declare const CAPABILITY_METAOBJECT_VALUES = "metaobject_values";
|
|
32
32
|
/** `finalTime` on an execution response: the run's simulation clock when it ended, in seconds. */
|
|
33
33
|
export declare const CAPABILITY_FINAL_TIME = "final_time";
|
|
34
|
+
/** `orderDependent` on an execution response and a feature value, and `orderDependent`/`independent`
|
|
35
|
+
* on a choice-point diagnostic: what a run's values stand only up to. */
|
|
36
|
+
export declare const CAPABILITY_ORDER_DEPENDENCE = "order_dependence";
|
|
34
37
|
/** `ParseFileRequest.language`, which declares the language of inline content. */
|
|
35
38
|
export declare const CAPABILITY_INLINE_LANGUAGE = "inline_language";
|
|
36
39
|
/** `ParseFileRequest.strict_conformance`. */
|
|
@@ -57,6 +60,10 @@ export declare const CAPABILITY_RENDER_DOCUMENT_HTML = "render_document_html";
|
|
|
57
60
|
export declare const CAPABILITY_RENDER_VIEW = "render_view";
|
|
58
61
|
/** The `ExportGraphs` RPC, exporting a behavior's lowered graph as `graphs:1` JSON. */
|
|
59
62
|
export declare const CAPABILITY_EXPORT_GRAPHS = "export_graphs";
|
|
63
|
+
export declare const CAPABILITY_IMPORT_DATA = "import_data";
|
|
64
|
+
export declare const CAPABILITY_COMPARE_RESULTS = "compare_results";
|
|
65
|
+
/** The `CheckBehavior` RPC, searching every schedule of a behavior for violations and divergent values. */
|
|
66
|
+
export declare const CAPABILITY_CHECK = "check";
|
|
60
67
|
/** What the body of a verification case answered, as `verification_verdicts`. */
|
|
61
68
|
export declare const CAPABILITY_VERIFICATION_VERDICTS = "verification_verdicts";
|
|
62
69
|
/** `RunAnalysisResponse.evaluations`: each call the run made to a calc held as a value, such as a trade study's evaluation of every alternative. */
|
|
@@ -123,6 +130,8 @@ export declare const CAPABILITY_CONVERT_DOCUMENTS = "convert_documents";
|
|
|
123
130
|
export declare const CAPABILITY_CONVERT_COMPACT = "convert_compact";
|
|
124
131
|
/** `ParseSourcesRequest.baseModelHash` and `ParseSourcesResponse.affected`: the documents whose results may differ from the base model's, so a client re-reads only those after an edit. */
|
|
125
132
|
export declare const CAPABILITY_PARSE_SOURCES_AFFECTED = "parse_sources_affected";
|
|
133
|
+
/** `RenderDocumentResponse.fileName`: the file a rendered set writes the document to, which the other documents' links to it name. */
|
|
134
|
+
export declare const CAPABILITY_RENDER_DOCUMENT_FILE_NAME = "render_document_file_name";
|
|
126
135
|
/**
|
|
127
136
|
* Orders capability names by code unit, the order the service reports them in.
|
|
128
137
|
* Locale-aware collation ignores the underscores that separate their words.
|
|
@@ -173,3 +182,9 @@ export declare function mismatchReason(info: ServerInfo, options?: {
|
|
|
173
182
|
* than arriving as a generic unsupported-operation error.
|
|
174
183
|
*/
|
|
175
184
|
export declare function capabilityRefusal(info: ServerInfo, capabilities: readonly string[]): ((details: string) => MissingCapabilityError) | undefined;
|
|
185
|
+
/** The `RunRuns` RPC: an action or a Monte Carlo case run repeatedly, the runs tabled. */
|
|
186
|
+
export declare const CAPABILITY_RUNS = "runs";
|
|
187
|
+
/** The `SelfCheck` RPC: the reflective SysMLValidation check of every element. */
|
|
188
|
+
export declare const CAPABILITY_SELF_CHECK = "self_check";
|
|
189
|
+
/** The `RecordRun` RPC: runs of an analysis case recorded into the model. */
|
|
190
|
+
export declare const CAPABILITY_RECORD_RUN = "record_run";
|
|
@@ -35,6 +35,9 @@ export const CAPABILITY_TENSOR_VALUES = "tensor_values";
|
|
|
35
35
|
export const CAPABILITY_METAOBJECT_VALUES = "metaobject_values";
|
|
36
36
|
/** `finalTime` on an execution response: the run's simulation clock when it ended, in seconds. */
|
|
37
37
|
export const CAPABILITY_FINAL_TIME = "final_time";
|
|
38
|
+
/** `orderDependent` on an execution response and a feature value, and `orderDependent`/`independent`
|
|
39
|
+
* on a choice-point diagnostic: what a run's values stand only up to. */
|
|
40
|
+
export const CAPABILITY_ORDER_DEPENDENCE = "order_dependence";
|
|
38
41
|
/** `ParseFileRequest.language`, which declares the language of inline content. */
|
|
39
42
|
export const CAPABILITY_INLINE_LANGUAGE = "inline_language";
|
|
40
43
|
/** `ParseFileRequest.strict_conformance`. */
|
|
@@ -61,6 +64,10 @@ export const CAPABILITY_RENDER_DOCUMENT_HTML = "render_document_html";
|
|
|
61
64
|
export const CAPABILITY_RENDER_VIEW = "render_view";
|
|
62
65
|
/** The `ExportGraphs` RPC, exporting a behavior's lowered graph as `graphs:1` JSON. */
|
|
63
66
|
export const CAPABILITY_EXPORT_GRAPHS = "export_graphs";
|
|
67
|
+
export const CAPABILITY_IMPORT_DATA = "import_data";
|
|
68
|
+
export const CAPABILITY_COMPARE_RESULTS = "compare_results";
|
|
69
|
+
/** The `CheckBehavior` RPC, searching every schedule of a behavior for violations and divergent values. */
|
|
70
|
+
export const CAPABILITY_CHECK = "check";
|
|
64
71
|
/** What the body of a verification case answered, as `verification_verdicts`. */
|
|
65
72
|
export const CAPABILITY_VERIFICATION_VERDICTS = "verification_verdicts";
|
|
66
73
|
/** `RunAnalysisResponse.evaluations`: each call the run made to a calc held as a value, such as a trade study's evaluation of every alternative. */
|
|
@@ -127,6 +134,8 @@ export const CAPABILITY_CONVERT_DOCUMENTS = "convert_documents";
|
|
|
127
134
|
export const CAPABILITY_CONVERT_COMPACT = "convert_compact";
|
|
128
135
|
/** `ParseSourcesRequest.baseModelHash` and `ParseSourcesResponse.affected`: the documents whose results may differ from the base model's, so a client re-reads only those after an edit. */
|
|
129
136
|
export const CAPABILITY_PARSE_SOURCES_AFFECTED = "parse_sources_affected";
|
|
137
|
+
/** `RenderDocumentResponse.fileName`: the file a rendered set writes the document to, which the other documents' links to it name. */
|
|
138
|
+
export const CAPABILITY_RENDER_DOCUMENT_FILE_NAME = "render_document_file_name";
|
|
130
139
|
/**
|
|
131
140
|
* Orders capability names by code unit, the order the service reports them in.
|
|
132
141
|
* Locale-aware collation ignores the underscores that separate their words.
|
|
@@ -229,3 +238,9 @@ export function capabilityRefusal(info, capabilities) {
|
|
|
229
238
|
return new MissingCapabilityError(capability, info, upgradeRemedy(capability));
|
|
230
239
|
};
|
|
231
240
|
}
|
|
241
|
+
/** The `RunRuns` RPC: an action or a Monte Carlo case run repeatedly, the runs tabled. */
|
|
242
|
+
export const CAPABILITY_RUNS = "runs";
|
|
243
|
+
/** The `SelfCheck` RPC: the reflective SysMLValidation check of every element. */
|
|
244
|
+
export const CAPABILITY_SELF_CHECK = "self_check";
|
|
245
|
+
/** The `RecordRun` RPC: runs of an analysis case recorded into the model. */
|
|
246
|
+
export const CAPABILITY_RECORD_RUN = "record_run";
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { CheckBehaviorResponse } from "../generated/sysml_pb.js";
|
|
2
|
+
import { type Standing } from "./engines.js";
|
|
3
|
+
/** One schedule replayed: pass `schedule` as a run's schedule to follow it. */
|
|
4
|
+
export interface CheckWitness {
|
|
5
|
+
schedule: string;
|
|
6
|
+
draws: readonly string[];
|
|
7
|
+
choices: readonly string[];
|
|
8
|
+
inputs: readonly string[];
|
|
9
|
+
/** The witness file's name and content when one was asked for, else empty. */
|
|
10
|
+
fileName: string;
|
|
11
|
+
fileContent: string;
|
|
12
|
+
}
|
|
13
|
+
/** One violation witnessed: a property false at a state, a deadlock or a failure. */
|
|
14
|
+
export interface CheckViolation {
|
|
15
|
+
kind: string;
|
|
16
|
+
property: string;
|
|
17
|
+
error: string;
|
|
18
|
+
depth: number;
|
|
19
|
+
probability: number;
|
|
20
|
+
witness: CheckWitness | undefined;
|
|
21
|
+
text: string;
|
|
22
|
+
}
|
|
23
|
+
/** A feature whose final value the schedule decides. */
|
|
24
|
+
export interface CheckDivergence {
|
|
25
|
+
feature: string;
|
|
26
|
+
values: readonly {
|
|
27
|
+
value: string;
|
|
28
|
+
witness: CheckWitness | undefined;
|
|
29
|
+
}[];
|
|
30
|
+
}
|
|
31
|
+
/** One final outcome of an exhaustive search. */
|
|
32
|
+
export interface CheckFinal {
|
|
33
|
+
outcome: string;
|
|
34
|
+
values: ReadonlyMap<string, string>;
|
|
35
|
+
witness: CheckWitness | undefined;
|
|
36
|
+
}
|
|
37
|
+
/** The explicit-state search's statistics. */
|
|
38
|
+
export interface CheckSearch {
|
|
39
|
+
states: number;
|
|
40
|
+
moves: number;
|
|
41
|
+
maxDepth: number;
|
|
42
|
+
boundsHit: readonly string[];
|
|
43
|
+
horizon: number;
|
|
44
|
+
horizonSet: boolean;
|
|
45
|
+
massBounded: boolean;
|
|
46
|
+
notes: readonly string[];
|
|
47
|
+
scope: readonly string[];
|
|
48
|
+
status: string;
|
|
49
|
+
}
|
|
50
|
+
/** What `CheckBehavior` answered: the verdict over every schedule, each finding witnessed. */
|
|
51
|
+
export interface CheckResult {
|
|
52
|
+
/** `holds`, `fails` or `undecided`. */
|
|
53
|
+
verdict: string;
|
|
54
|
+
/** The report as `sysml -check-property` prints it. */
|
|
55
|
+
lines: readonly string[];
|
|
56
|
+
search: CheckSearch | undefined;
|
|
57
|
+
violations: readonly CheckViolation[];
|
|
58
|
+
divergences: readonly CheckDivergence[];
|
|
59
|
+
finals: readonly CheckFinal[];
|
|
60
|
+
claim: string;
|
|
61
|
+
freeInputs: readonly string[];
|
|
62
|
+
assumptions: readonly string[];
|
|
63
|
+
witness: CheckWitness | undefined;
|
|
64
|
+
contrast: CheckWitness | undefined;
|
|
65
|
+
standing: Standing;
|
|
66
|
+
reason: string;
|
|
67
|
+
}
|
|
68
|
+
/** The options of `Model.checkAction` and `Model.checkStateMachine`. */
|
|
69
|
+
export interface CheckOptions {
|
|
70
|
+
/** Constraints or requirements evaluated at every stable state. */
|
|
71
|
+
properties?: readonly string[];
|
|
72
|
+
/** Features whose final value the schedule may decide. */
|
|
73
|
+
diverge?: readonly string[];
|
|
74
|
+
/** Inputs the symbolic engine ranges over. */
|
|
75
|
+
freeInputs?: readonly string[];
|
|
76
|
+
/** Constraints or requirements the symbolic engine assumes. */
|
|
77
|
+
assume?: readonly string[];
|
|
78
|
+
/** Carry each witness's file in the answer. */
|
|
79
|
+
witness?: boolean;
|
|
80
|
+
/** Bounds on moves per schedule, states visited, loop unrollings and seconds; 0 is the default. */
|
|
81
|
+
depth?: number;
|
|
82
|
+
states?: number;
|
|
83
|
+
unroll?: number;
|
|
84
|
+
timeout?: number;
|
|
85
|
+
/** The engine asked: `check` (the default), `smt` or one `listEngines` names. */
|
|
86
|
+
engine?: string;
|
|
87
|
+
/** The part or usage whose object performs the behavior. */
|
|
88
|
+
performer?: string;
|
|
89
|
+
}
|
|
90
|
+
export declare function checkResultOf(response: CheckBehaviorResponse): CheckResult;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { standingOf } from "./engines.js";
|
|
2
|
+
function witnessOf(pb) {
|
|
3
|
+
if (pb === undefined)
|
|
4
|
+
return undefined;
|
|
5
|
+
return {
|
|
6
|
+
schedule: pb.schedule,
|
|
7
|
+
draws: pb.draws,
|
|
8
|
+
choices: pb.choices,
|
|
9
|
+
inputs: pb.inputs,
|
|
10
|
+
fileName: pb.fileName,
|
|
11
|
+
fileContent: pb.fileContent,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function violationOf(pb) {
|
|
15
|
+
return {
|
|
16
|
+
kind: pb.kind,
|
|
17
|
+
property: pb.property,
|
|
18
|
+
error: pb.error,
|
|
19
|
+
depth: pb.depth,
|
|
20
|
+
probability: pb.probability,
|
|
21
|
+
witness: witnessOf(pb.witness),
|
|
22
|
+
text: pb.text,
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function divergenceOf(pb) {
|
|
26
|
+
return {
|
|
27
|
+
feature: pb.feature,
|
|
28
|
+
values: pb.values.map((v) => ({ value: v.value, witness: witnessOf(v.witness) })),
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function finalOf(pb) {
|
|
32
|
+
return {
|
|
33
|
+
outcome: pb.outcome,
|
|
34
|
+
values: new Map(Object.entries(pb.values)),
|
|
35
|
+
witness: witnessOf(pb.witness),
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function searchOf(pb) {
|
|
39
|
+
if (pb === undefined)
|
|
40
|
+
return undefined;
|
|
41
|
+
return {
|
|
42
|
+
states: pb.states,
|
|
43
|
+
moves: pb.moves,
|
|
44
|
+
maxDepth: pb.maxDepth,
|
|
45
|
+
boundsHit: pb.boundsHit,
|
|
46
|
+
horizon: pb.horizon,
|
|
47
|
+
horizonSet: pb.horizonSet,
|
|
48
|
+
massBounded: pb.massBounded,
|
|
49
|
+
notes: pb.notes,
|
|
50
|
+
scope: pb.scope,
|
|
51
|
+
status: pb.status,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export function checkResultOf(response) {
|
|
55
|
+
return {
|
|
56
|
+
verdict: response.verdict,
|
|
57
|
+
lines: response.lines,
|
|
58
|
+
search: searchOf(response.search),
|
|
59
|
+
violations: response.violations.map(violationOf),
|
|
60
|
+
divergences: response.divergences.map(divergenceOf),
|
|
61
|
+
finals: response.finals.map(finalOf),
|
|
62
|
+
claim: response.claim,
|
|
63
|
+
freeInputs: response.freeInputs,
|
|
64
|
+
assumptions: response.assumptions,
|
|
65
|
+
witness: witnessOf(response.witness),
|
|
66
|
+
contrast: witnessOf(response.contrast),
|
|
67
|
+
standing: standingOf(response),
|
|
68
|
+
reason: response.reason,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -10,10 +10,11 @@ import type { MigrateOptions } from "./conversion.js";
|
|
|
10
10
|
import { type QueryElement, type QueryForm, type QueryPayload } from "./query.js";
|
|
11
11
|
import { DocumentEvent, type BindingValues, type DocumentQueryResult } from "./document.js";
|
|
12
12
|
import { type RenderedView } from "./render-view.js";
|
|
13
|
+
import { type CheckOptions, type CheckResult } from "./check.js";
|
|
13
14
|
import { type Graphs } from "./graphs.js";
|
|
14
15
|
import { type EngineInfo } from "./engines.js";
|
|
15
16
|
import { Exploration } from "./exploration.js";
|
|
16
|
-
import { CalcResult, type AnalysisResult, type SweepTable, type Validation, type Verdict } from "./verdict.js";
|
|
17
|
+
import { RunsResult, SelfCheckResult, Recording, CalcResult, type AnalysisResult, type SweepTable, type Validation, type Verdict, type ImportResult, type Comparison } from "./verdict.js";
|
|
17
18
|
import { type SysMLValue, type ValueInput } from "./values.js";
|
|
18
19
|
import { Editor, type EditOperationData, type EditResult } from "./edit.js";
|
|
19
20
|
/** Wire encoding of the request and response bodies. Protobuf is the default. */
|
|
@@ -163,10 +164,25 @@ export declare class Connection {
|
|
|
163
164
|
renderDocument(modelHash: string, documentId: string, options?: {
|
|
164
165
|
form?: string;
|
|
165
166
|
}): Promise<string>;
|
|
166
|
-
/**
|
|
167
|
+
/**
|
|
168
|
+
* Renders a named view or targeted pseudo-view as diagram data. `show` names
|
|
169
|
+
* the optional notation elements to draw besides those the view's rendering
|
|
170
|
+
* shows (`"edge-labels"`, `"all"`, ...); the service refuses a name it does
|
|
171
|
+
* not know. `depth`, above 0, bounds how many levels of nested elements are
|
|
172
|
+
* drawn below each exposed element, overriding the view's own depth.
|
|
173
|
+
*/
|
|
167
174
|
renderView(modelHash: string, viewName: string, options?: {
|
|
168
175
|
ports?: "minimal" | "full";
|
|
176
|
+
show?: readonly string[];
|
|
177
|
+
depth?: number;
|
|
169
178
|
}): Promise<RenderedView>;
|
|
179
|
+
/** Searches every schedule of an action for a violated property, a deadlock, a failure or a divergent value. */
|
|
180
|
+
checkAction(modelHash: string, actionSymbolId: string, options?: CheckOptions & {
|
|
181
|
+
inputs?: Readonly<Record<string, ValueInput>>;
|
|
182
|
+
}): Promise<CheckResult>;
|
|
183
|
+
/** Searches every schedule of a state machine; see {@link checkAction}. */
|
|
184
|
+
checkStateMachine(modelHash: string, stateMachineSymbolId: string, options?: CheckOptions): Promise<CheckResult>;
|
|
185
|
+
private checkBehavior;
|
|
170
186
|
/**
|
|
171
187
|
* Exports the lowered graph of an action or state machine, and of every
|
|
172
188
|
* behavior it performs, as the canonical `graphs:1` JSON an external
|
|
@@ -178,10 +194,22 @@ export declare class Connection {
|
|
|
178
194
|
inputs?: Readonly<Record<string, ValueInput>>;
|
|
179
195
|
schedule?: string;
|
|
180
196
|
performer?: string;
|
|
197
|
+
/** Simulated seconds to run for (`sysml -advance`); unset runs to completion. */
|
|
198
|
+
advance?: number;
|
|
199
|
+
/** Seed of the model's own draws (`sysml -seed`). */
|
|
200
|
+
seed?: bigint;
|
|
201
|
+
/** How RandomFunctions draws resolve (`sysml -draws`): random, min, max or average. */
|
|
202
|
+
draws?: string;
|
|
203
|
+
/** Seconds the run's clock ticks by (`sysml -clock-step`); 0 is continuous. */
|
|
204
|
+
clockStep?: number;
|
|
181
205
|
}): Promise<{
|
|
182
206
|
outputs: ReadonlyMap<string, SysMLValue | UnsupportedValueError>;
|
|
183
207
|
performer: ReadonlyMap<string, SysMLValue | UnsupportedValueError>;
|
|
184
208
|
finalTime: number;
|
|
209
|
+
/** Output name → how many of the run's unresolved choice points touch it; the
|
|
210
|
+
* value then stands only up to the order the run took, and `exploreAction`
|
|
211
|
+
* shows the set. Absent for an output nothing order-dependent wrote. */
|
|
212
|
+
orderDependent: ReadonlyMap<string, number>;
|
|
185
213
|
}>;
|
|
186
214
|
/** Runs an action once per valid order of its choice points, within a budget. */
|
|
187
215
|
exploreAction(modelHash: string, actionSymbolId: string, options?: {
|
|
@@ -196,12 +224,22 @@ export declare class Connection {
|
|
|
196
224
|
schedule?: string;
|
|
197
225
|
performer?: string;
|
|
198
226
|
trace?: boolean;
|
|
227
|
+
/** Simulated seconds to run for (`sysml -advance`); unset runs to completion. */
|
|
228
|
+
advance?: number;
|
|
229
|
+
/** Seed of the model's own draws (`sysml -seed`). */
|
|
230
|
+
seed?: bigint;
|
|
231
|
+
/** How RandomFunctions draws resolve (`sysml -draws`): random, min, max or average. */
|
|
232
|
+
draws?: string;
|
|
233
|
+
/** Seconds the run's clock ticks by (`sysml -clock-step`); 0 is continuous. */
|
|
234
|
+
clockStep?: number;
|
|
199
235
|
}): Promise<{
|
|
200
236
|
statesVisited: string[];
|
|
201
237
|
finalContext: ReadonlyMap<string, SysMLValue | UnsupportedValueError>;
|
|
202
238
|
finalTime: number;
|
|
203
239
|
trace: DocumentEvent[];
|
|
204
240
|
traceDropped: number;
|
|
241
|
+
/** Final-context key → how many of the run's unresolved choice points touch it. */
|
|
242
|
+
orderDependent: ReadonlyMap<string, number>;
|
|
205
243
|
}>;
|
|
206
244
|
/** Runs a state machine over the events once per valid order of its choice points. */
|
|
207
245
|
exploreState(modelHash: string, stateMachineSymbolId: string, options?: {
|
|
@@ -212,7 +250,9 @@ export declare class Connection {
|
|
|
212
250
|
private sendExecuteState;
|
|
213
251
|
private explorationOf;
|
|
214
252
|
/** Lists the analysis engines the service answers with, as `sysml -engines` does. */
|
|
215
|
-
listEngines(
|
|
253
|
+
listEngines(options?: {
|
|
254
|
+
probe?: boolean;
|
|
255
|
+
}): Promise<EngineInfo[]>;
|
|
216
256
|
/** Asks whether a constraint holds. */
|
|
217
257
|
verifyConstraint(modelHash: string, symbolId: string, options?: VerifyOptions): Promise<Verdict>;
|
|
218
258
|
/** Asks whether a requirement is satisfied. */
|
|
@@ -239,6 +279,8 @@ export declare class Connection {
|
|
|
239
279
|
namedArguments?: Readonly<Record<string, ValueInput>>;
|
|
240
280
|
schedule?: string;
|
|
241
281
|
engine?: string;
|
|
282
|
+
/** Preview the first external tool call instead of making it (`sysml -tool-dry-run`). */
|
|
283
|
+
toolDryRun?: boolean;
|
|
242
284
|
}): Promise<AnalysisResult>;
|
|
243
285
|
/** Runs an analysis case once per valid order of its choice points. */
|
|
244
286
|
exploreAnalysis(modelHash: string, symbolId: string, options?: {
|
|
@@ -248,6 +290,38 @@ export declare class Connection {
|
|
|
248
290
|
schedule?: string;
|
|
249
291
|
}): Promise<Exploration>;
|
|
250
292
|
private sendRunAnalysis;
|
|
293
|
+
/** Runs an action, or a Simulation::MonteCarlo case, `runs` times, each in
|
|
294
|
+
* a context of its own, and tables what the runs observed. */
|
|
295
|
+
runRuns(modelHash: string, options: {
|
|
296
|
+
action?: string;
|
|
297
|
+
analysis?: string;
|
|
298
|
+
runs: bigint | number;
|
|
299
|
+
seed?: bigint | number;
|
|
300
|
+
draws?: string;
|
|
301
|
+
clockStep?: number;
|
|
302
|
+
observe?: readonly string[];
|
|
303
|
+
inputs?: Readonly<Record<string, ValueInput>>;
|
|
304
|
+
performer?: string;
|
|
305
|
+
subject?: string;
|
|
306
|
+
arguments?: readonly ValueInput[];
|
|
307
|
+
namedArguments?: Readonly<Record<string, ValueInput>>;
|
|
308
|
+
engine?: string;
|
|
309
|
+
}): Promise<RunsResult>;
|
|
310
|
+
/** Applies the SysMLValidation constraints, and those of the rule packages
|
|
311
|
+
* named, reflectively to every element of the model. */
|
|
312
|
+
selfCheck(modelHash: string, packages?: readonly string[]): Promise<SelfCheckResult>;
|
|
313
|
+
/** Runs an analysis case once, over the rows of `ranges` or as a Monte
|
|
314
|
+
* Carlo sample of `runs`, and records the runs into the model. */
|
|
315
|
+
recordRun(modelHash: string, symbolId: string, options?: {
|
|
316
|
+
subject?: string;
|
|
317
|
+
arguments?: readonly ValueInput[];
|
|
318
|
+
namedArguments?: Readonly<Record<string, ValueInput>>;
|
|
319
|
+
into?: string;
|
|
320
|
+
ranges?: Readonly<Record<string, readonly [ValueInput, ValueInput] | readonly [ValueInput, ValueInput, ValueInput]>>;
|
|
321
|
+
runs?: bigint | number;
|
|
322
|
+
seed?: bigint | number;
|
|
323
|
+
engine?: string;
|
|
324
|
+
}): Promise<Recording>;
|
|
251
325
|
/** Runs an analysis case or calc once per row of a parameter sweep. */
|
|
252
326
|
runSweep(modelHash: string, symbolId: string, ranges: Readonly<Record<string, readonly [ValueInput, ValueInput] | readonly [ValueInput, ValueInput, ValueInput]>>, options?: {
|
|
253
327
|
subject?: string;
|
|
@@ -259,6 +333,30 @@ export declare class Connection {
|
|
|
259
333
|
}): Promise<SweepTable>;
|
|
260
334
|
private sweepRange;
|
|
261
335
|
private verdictOf;
|
|
336
|
+
/** Sets the feature values data files assign, one edit of the model per
|
|
337
|
+
* file, as `sysml -import` does. */
|
|
338
|
+
importData(modelHash: string, imports: readonly {
|
|
339
|
+
name: string;
|
|
340
|
+
content: string;
|
|
341
|
+
format?: string;
|
|
342
|
+
map?: string;
|
|
343
|
+
}[], options?: {
|
|
344
|
+
importAs?: string;
|
|
345
|
+
dryRun?: boolean;
|
|
346
|
+
acceptDocuments?: boolean;
|
|
347
|
+
}): Promise<ImportResult>;
|
|
348
|
+
/** Runs the configurations a SysML v1 tool's results sidecar indexes against
|
|
349
|
+
* the model and tables the tool's distributions beside the runs', as
|
|
350
|
+
* `sysml -compare-results` does. */
|
|
351
|
+
compareResults(modelHash: string, results: string, options?: {
|
|
352
|
+
actions?: readonly string[];
|
|
353
|
+
runs?: bigint | number;
|
|
354
|
+
seed?: bigint | number;
|
|
355
|
+
draws?: string;
|
|
356
|
+
clockStep?: number;
|
|
357
|
+
observe?: readonly (string | readonly [string, string])[];
|
|
358
|
+
engine?: string;
|
|
359
|
+
}): Promise<Comparison>;
|
|
262
360
|
private instancesOf;
|
|
263
361
|
private requireVerification;
|
|
264
362
|
private requireEngines;
|