nirs4all-ui 0.1.13 → 0.1.14
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 +3 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/nodeRegistry/index.d.ts +9 -0
- package/dist/nodeRegistry/index.d.ts.map +1 -0
- package/dist/nodeRegistry/index.js +9 -0
- package/dist/nodeRegistry/index.js.map +1 -0
- package/dist/nodeRegistry/n4m.d.ts +83 -0
- package/dist/nodeRegistry/n4m.d.ts.map +1 -0
- package/dist/nodeRegistry/n4m.js +131 -0
- package/dist/nodeRegistry/n4m.js.map +1 -0
- package/package.json +5 -1
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ spectra motion asset.
|
|
|
21
21
|
| `conformal` | `nirs4all-ui/conformal` | Validation and pure view-model projection for native nirs4all `CalibratedRunResult.to_dict()` and `ConformalMetricSet.to_dict()` payloads, guarantee-status badges, calibration replay provenance, coverage options, per-sample prediction interval rows, materialized interval summaries, and empirical metric rows. |
|
|
22
22
|
| `robustness` | `nirs4all-ui/robustness` | Validation and compact card view-models for nirs4all robustness `summary.json` artifacts, optional conformal guarantee badge projection, plus fallback and registry-derived mode/scenario/distribution vocabulary and form validation aligned with the Python keyword registry. |
|
|
23
23
|
| `keywordRegistry` | `nirs4all-ui/keywordRegistry` | Metadata-only validation, indexing, id/path/token/alias resolution, value-option extraction, form-field projection, ordered form-section grouping, optimizer-persistence field grouping, and workspace prediction publication contract projection for the exported full Python nirs4all keyword/effect registry. |
|
|
24
|
+
| `nodeRegistry` | `nirs4all-ui/nodeRegistry` | `projectN4mManifest`: projects the n4m method manifest (`n4m_cli --manifest-json`) into typed pipeline-editor node definitions — role → node type, typed parameters (bounds, choices, unset defaults), required fit inputs, `n4m:<method_id>` operator token. |
|
|
24
25
|
| `tuning` | `nirs4all-ui/tuning` | Validation and pure view-model projection for native nirs4all `TuningResult.to_dict()` payloads, lightweight `TuningResult.summary_artifact()` / `nirs4all.tuning.summary` cards, and pre-execution `nirs4all.tuning.ordered_search_space` artifacts for Studio/Web forms without optimizer logic. |
|
|
25
26
|
| `dataset` | `nirs4all-ui/dataset` | Dataset preview contracts, counts, split summaries, spectral ranges, task labels, badges, and stats. |
|
|
26
27
|
| `components` | `nirs4all-ui/components` | Stateless React components that render shared runtime, diagnostic, and metric affordances. |
|
|
@@ -35,7 +36,7 @@ spectra motion asset.
|
|
|
35
36
|
The root export also exposes namespace barrels:
|
|
36
37
|
|
|
37
38
|
```ts
|
|
38
|
-
import { brand, chains, conformal, dag, dataset, datasetBuilder, keywordRegistry, lab, robustness, runtime, score, styles, tuning } from "nirs4all-ui";
|
|
39
|
+
import { brand, chains, conformal, dag, dataset, datasetBuilder, keywordRegistry, lab, nodeRegistry, robustness, runtime, score, styles, tuning } from "nirs4all-ui";
|
|
39
40
|
```
|
|
40
41
|
|
|
41
42
|
Prefer domain imports when a consumer only needs one area:
|
|
@@ -47,6 +48,7 @@ import { buildRuntimeResultStatusView } from "nirs4all-ui/runtime";
|
|
|
47
48
|
import { createConformalGuaranteeView, getCalibrationReplaySource, parseCalibratedRunResultArtifact } from "nirs4all-ui/conformal";
|
|
48
49
|
import { createRobustnessGuaranteeView, createRobustnessSummaryCards, getRobustnessSpectralReplay, parseRobustnessSummaryArtifact, validateRobustnessScenarioDraft } from "nirs4all-ui/robustness";
|
|
49
50
|
import { createKeywordRegistryFieldViews, createKeywordRegistryWorkspacePredictionPublicationContract, parseKeywordRegistryDocument } from "nirs4all-ui/keywordRegistry";
|
|
51
|
+
import { projectN4mManifest } from "nirs4all-ui/nodeRegistry";
|
|
50
52
|
import { createTuningSearchSpacePreview, createTuningStudySummary, createTuningSummaryCard, createTuningTrialRows, parseOrderedTuningSearchSpaceArtifact, parseTuningResultArtifact, parseTuningSummaryArtifact } from "nirs4all-ui/tuning";
|
|
51
53
|
import { DatasetBuilder } from "nirs4all-ui/datasetBuilder";
|
|
52
54
|
import { DagGraphView, fromCompiledGraph } from "nirs4all-ui/dag";
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * as runtime from "./runtime/index.js";
|
|
|
10
10
|
export * as conformal from "./conformal/index.js";
|
|
11
11
|
export * as robustness from "./robustness/index.js";
|
|
12
12
|
export * as keywordRegistry from "./keywordRegistry/index.js";
|
|
13
|
+
export * as nodeRegistry from "./nodeRegistry/index.js";
|
|
13
14
|
export * as tuning from "./tuning/index.js";
|
|
14
15
|
export * as dataset from "./dataset/index.js";
|
|
15
16
|
export * as components from "./components/index.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,SAAS,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,eAAe,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,YAAY,MAAM,yBAAyB,CAAC;AACxD,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,oBAAoB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ export * as runtime from "./runtime/index.js";
|
|
|
10
10
|
export * as conformal from "./conformal/index.js";
|
|
11
11
|
export * as robustness from "./robustness/index.js";
|
|
12
12
|
export * as keywordRegistry from "./keywordRegistry/index.js";
|
|
13
|
+
export * as nodeRegistry from "./nodeRegistry/index.js";
|
|
13
14
|
export * as tuning from "./tuning/index.js";
|
|
14
15
|
export * as dataset from "./dataset/index.js";
|
|
15
16
|
export * as components from "./components/index.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GA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,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,KAAK,MAAM,kBAAkB,CAAC;AAC1C,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node registry projections — public surface.
|
|
3
|
+
*
|
|
4
|
+
* Pure helpers that turn native method metadata (the n4m manifest) into
|
|
5
|
+
* pipeline-editor node definitions for Studio and Web. Execution stays with
|
|
6
|
+
* the hosts' runtimes.
|
|
7
|
+
*/
|
|
8
|
+
export * from "./n4m.js";
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/nodeRegistry/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node registry projections — public surface.
|
|
3
|
+
*
|
|
4
|
+
* Pure helpers that turn native method metadata (the n4m manifest) into
|
|
5
|
+
* pipeline-editor node definitions for Studio and Web. Execution stays with
|
|
6
|
+
* the hosts' runtimes.
|
|
7
|
+
*/
|
|
8
|
+
export * from "./n4m.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/nodeRegistry/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
export declare const N4M_OPERATOR_TOKEN_PREFIX: "n4m:";
|
|
2
|
+
export type N4mRole = "transformer" | "regressor" | "classifier" | "selector" | "sample_filter" | "splitter" | "augmenter" | "generic";
|
|
3
|
+
export type N4mFitInput = "y" | "labels" | "sample_weight" | "groups" | "feature_groups" | "blocks" | "axis" | "target_domain" | "fold_ids";
|
|
4
|
+
export type N4mInputRequirement = "none" | "optional" | "required";
|
|
5
|
+
export type N4mParamType = "int" | "double" | "bool" | "enum" | "int_array" | "double_array";
|
|
6
|
+
export type N4mParamValue = number | boolean | string | number[];
|
|
7
|
+
export interface N4mManifestParam {
|
|
8
|
+
name: string;
|
|
9
|
+
type: N4mParamType;
|
|
10
|
+
required: boolean;
|
|
11
|
+
/** `null` means an unset optional value (the native default applies). */
|
|
12
|
+
default: N4mParamValue | null;
|
|
13
|
+
min: number | null;
|
|
14
|
+
max: number | null;
|
|
15
|
+
choices: readonly string[];
|
|
16
|
+
}
|
|
17
|
+
export interface N4mManifestMethod {
|
|
18
|
+
method_id: string;
|
|
19
|
+
fq_name: string;
|
|
20
|
+
kind: "estimator" | "procedure";
|
|
21
|
+
roles: readonly N4mRole[];
|
|
22
|
+
node_kinds: readonly string[];
|
|
23
|
+
capabilities: readonly string[];
|
|
24
|
+
state_format?: string;
|
|
25
|
+
inputs: Readonly<Record<N4mFitInput, N4mInputRequirement>>;
|
|
26
|
+
params: readonly N4mManifestParam[];
|
|
27
|
+
}
|
|
28
|
+
/** The `n4m_cli --manifest-json` document. */
|
|
29
|
+
export interface N4mManifest {
|
|
30
|
+
abi: string;
|
|
31
|
+
methods: readonly N4mManifestMethod[];
|
|
32
|
+
}
|
|
33
|
+
export type NodeType = "preprocessing" | "model" | "filter" | "splitting" | "augmentation";
|
|
34
|
+
export type NodeParameterType = "int" | "float" | "bool" | "select" | "array";
|
|
35
|
+
export interface NodeParameterDefinition {
|
|
36
|
+
name: string;
|
|
37
|
+
label: string;
|
|
38
|
+
type: NodeParameterType;
|
|
39
|
+
required: boolean;
|
|
40
|
+
/** Absent when the native default is an unset optional value. */
|
|
41
|
+
default?: N4mParamValue;
|
|
42
|
+
/** Numeric bounds; for arrays they bound each item. */
|
|
43
|
+
min?: number;
|
|
44
|
+
max?: number;
|
|
45
|
+
options?: {
|
|
46
|
+
value: string;
|
|
47
|
+
label: string;
|
|
48
|
+
}[];
|
|
49
|
+
itemType?: "int" | "float";
|
|
50
|
+
}
|
|
51
|
+
export interface NodeFitInputRequirement {
|
|
52
|
+
input: N4mFitInput;
|
|
53
|
+
requirement: "optional" | "required";
|
|
54
|
+
label: string;
|
|
55
|
+
}
|
|
56
|
+
/** A pipeline-editor node projected from one n4m method role. */
|
|
57
|
+
export interface NodeDefinition {
|
|
58
|
+
/** `<type>.n4m_<method_id with "_" for ".">`. */
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
type: NodeType;
|
|
62
|
+
description: string;
|
|
63
|
+
category: string;
|
|
64
|
+
/** Portable operator token `n4m:<method_id>`, serialized as the step `class`. */
|
|
65
|
+
classPath: string;
|
|
66
|
+
source: "n4m";
|
|
67
|
+
tags: string[];
|
|
68
|
+
parameters: NodeParameterDefinition[];
|
|
69
|
+
n4m: {
|
|
70
|
+
methodId: string;
|
|
71
|
+
kind: "estimator" | "procedure";
|
|
72
|
+
role: Exclude<N4mRole, "generic">;
|
|
73
|
+
capabilities: readonly string[];
|
|
74
|
+
fitInputs: NodeFitInputRequirement[];
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Project the n4m method manifest into pipeline-editor node definitions: one
|
|
79
|
+
* node per distinct node type a method's roles map to. Generic procedures have
|
|
80
|
+
* no pipeline node and are omitted.
|
|
81
|
+
*/
|
|
82
|
+
export declare function projectN4mManifest(manifest: N4mManifest): NodeDefinition[];
|
|
83
|
+
//# sourceMappingURL=n4m.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"n4m.d.ts","sourceRoot":"","sources":["../../src/nodeRegistry/n4m.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,yBAAyB,EAAG,MAAe,CAAC;A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uB,EAAE,CAAC;IACtC,GAAG,EAAE;QACH,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,WAAW,GAAG,WAAW,CAAC;QAChC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAClC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;QAChC,SAAS,EAAE,uBAAuB,EAAE,CAAC;KACtC,CAAC;CACH;AA6FD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,WAAW,GAAG,cAAc,EAAE,CAkC1E"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export const N4M_OPERATOR_TOKEN_PREFIX = "n4m:";
|
|
2
|
+
const ROLE_NODE_TYPE = {
|
|
3
|
+
transformer: "preprocessing",
|
|
4
|
+
selector: "preprocessing",
|
|
5
|
+
regressor: "model",
|
|
6
|
+
classifier: "model",
|
|
7
|
+
sample_filter: "filter",
|
|
8
|
+
splitter: "splitting",
|
|
9
|
+
augmenter: "augmentation",
|
|
10
|
+
};
|
|
11
|
+
const ROLE_LABEL = {
|
|
12
|
+
transformer: "transformer",
|
|
13
|
+
selector: "feature selector",
|
|
14
|
+
regressor: "regressor",
|
|
15
|
+
classifier: "classifier",
|
|
16
|
+
sample_filter: "sample filter",
|
|
17
|
+
splitter: "splitter",
|
|
18
|
+
augmenter: "augmenter",
|
|
19
|
+
};
|
|
20
|
+
const FIT_INPUT_LABEL = {
|
|
21
|
+
y: "targets",
|
|
22
|
+
labels: "class labels",
|
|
23
|
+
sample_weight: "sample weights",
|
|
24
|
+
groups: "sample groups",
|
|
25
|
+
feature_groups: "feature groups",
|
|
26
|
+
blocks: "multiblock",
|
|
27
|
+
axis: "wavelengths",
|
|
28
|
+
target_domain: "transfer target",
|
|
29
|
+
fold_ids: "CV folds",
|
|
30
|
+
};
|
|
31
|
+
const ACRONYMS = new Set([
|
|
32
|
+
"airpls", "aom", "arpls", "asls", "beads", "bipls", "bve", "cars", "cow", "cppls", "cv", "da", "di", "ds",
|
|
33
|
+
"dtw", "ecr", "emcuve", "emsc", "epo", "fck", "g", "ga", "gpr", "hpo", "iasls", "ipw", "irf", "iriv", "l1",
|
|
34
|
+
"lda", "lw", "mb", "mir", "msc", "nipals", "o2pls", "on", "osc", "pca", "pcr", "pds", "pls", "pop", "pso",
|
|
35
|
+
"q", "qda", "rep", "rosa", "saps", "scars", "simpls", "sipls", "snip", "snv", "so", "spa", "spxy", "st",
|
|
36
|
+
"svd", "t2", "uve", "vip", "vissa", "vsn", "wvc", "x", "y",
|
|
37
|
+
]);
|
|
38
|
+
function humanize(snake) {
|
|
39
|
+
return snake
|
|
40
|
+
.split("_")
|
|
41
|
+
.filter(Boolean)
|
|
42
|
+
.map((word) => (ACRONYMS.has(word) ? word.toUpperCase() : `${word.charAt(0).toUpperCase()}${word.slice(1)}`))
|
|
43
|
+
.join(" ");
|
|
44
|
+
}
|
|
45
|
+
function methodGroup(methodId) {
|
|
46
|
+
const segments = methodId.split(".");
|
|
47
|
+
return segments[segments.length - 2] ?? segments[0] ?? methodId;
|
|
48
|
+
}
|
|
49
|
+
const PARAM_TYPE = {
|
|
50
|
+
int: "int",
|
|
51
|
+
double: "float",
|
|
52
|
+
bool: "bool",
|
|
53
|
+
enum: "select",
|
|
54
|
+
int_array: "array",
|
|
55
|
+
double_array: "array",
|
|
56
|
+
};
|
|
57
|
+
function projectParam(param) {
|
|
58
|
+
const view = {
|
|
59
|
+
name: param.name,
|
|
60
|
+
label: humanize(param.name),
|
|
61
|
+
type: PARAM_TYPE[param.type],
|
|
62
|
+
required: param.required,
|
|
63
|
+
};
|
|
64
|
+
if (param.type === "enum")
|
|
65
|
+
view.options = param.choices.map((choice) => ({ value: choice, label: choice }));
|
|
66
|
+
if (param.type === "int_array")
|
|
67
|
+
view.itemType = "int";
|
|
68
|
+
if (param.type === "double_array")
|
|
69
|
+
view.itemType = "float";
|
|
70
|
+
if (param.default !== null)
|
|
71
|
+
view.default = param.default;
|
|
72
|
+
if (param.min !== null)
|
|
73
|
+
view.min = param.min;
|
|
74
|
+
if (param.max !== null)
|
|
75
|
+
view.max = param.max;
|
|
76
|
+
return view;
|
|
77
|
+
}
|
|
78
|
+
function fitInputRequirements(method) {
|
|
79
|
+
return Object.keys(FIT_INPUT_LABEL)
|
|
80
|
+
.map((input) => ({ input, requirement: method.inputs[input] }))
|
|
81
|
+
.filter((entry) => entry.requirement !== "none")
|
|
82
|
+
.map(({ input, requirement }) => ({ input, requirement, label: FIT_INPUT_LABEL[input] }));
|
|
83
|
+
}
|
|
84
|
+
function describe(method, role, fitInputs) {
|
|
85
|
+
const required = fitInputs.filter((entry) => entry.requirement === "required" && entry.input !== "y");
|
|
86
|
+
const needs = required.length > 0 ? ` Requires ${required.map((entry) => entry.label).join(", ")}.` : "";
|
|
87
|
+
return `Native nirs4all-methods ${ROLE_LABEL[role]} (${method.method_id}).${needs}`;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Project the n4m method manifest into pipeline-editor node definitions: one
|
|
91
|
+
* node per distinct node type a method's roles map to. Generic procedures have
|
|
92
|
+
* no pipeline node and are omitted.
|
|
93
|
+
*/
|
|
94
|
+
export function projectN4mManifest(manifest) {
|
|
95
|
+
const nodes = [];
|
|
96
|
+
for (const method of manifest.methods) {
|
|
97
|
+
const group = methodGroup(method.method_id);
|
|
98
|
+
const leaf = method.method_id.split(".").pop() ?? method.method_id;
|
|
99
|
+
const fitInputs = fitInputRequirements(method);
|
|
100
|
+
const parameters = method.params.map(projectParam);
|
|
101
|
+
const seen = new Set();
|
|
102
|
+
for (const role of method.roles) {
|
|
103
|
+
if (role === "generic")
|
|
104
|
+
continue;
|
|
105
|
+
const type = ROLE_NODE_TYPE[role];
|
|
106
|
+
if (seen.has(type))
|
|
107
|
+
continue;
|
|
108
|
+
seen.add(type);
|
|
109
|
+
nodes.push({
|
|
110
|
+
id: `${type}.n4m_${method.method_id.replaceAll(".", "_")}`,
|
|
111
|
+
name: humanize(leaf),
|
|
112
|
+
type,
|
|
113
|
+
description: describe(method, role, fitInputs),
|
|
114
|
+
category: humanize(group),
|
|
115
|
+
classPath: `${N4M_OPERATOR_TOKEN_PREFIX}${method.method_id}`,
|
|
116
|
+
source: "n4m",
|
|
117
|
+
tags: ["n4m", role, group],
|
|
118
|
+
parameters,
|
|
119
|
+
n4m: {
|
|
120
|
+
methodId: method.method_id,
|
|
121
|
+
kind: method.kind,
|
|
122
|
+
role,
|
|
123
|
+
capabilities: method.capabilities,
|
|
124
|
+
fitInputs,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return nodes;
|
|
130
|
+
}
|
|
131
|
+
//# sourceMappingURL=n4m.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"n4m.js","sourceRoot":"","sources":["../../src/nodeRegistry/n4m.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAe,CAAC;AAqGzD,MAAM,cAAc,GAAkD;IACpE,WAAW,EAAE,eAAe;IAC5B,QAAQ,EAAE,eAAe;IACzB,SAAS,EAAE,OAAO;IAClB,UAAU,EAAE,OAAO;IACnB,aAAa,EAAE,QAAQ;IACvB,QAAQ,EAAE,WAAW;IACrB,SAAS,EAAE,cAAc;CAC1B,CAAC;AAEF,MAAM,UAAU,GAAgD;IAC9D,WAAW,EAAE,aAAa;IAC1B,QAAQ,EAAE,kBAAkB;IAC5B,SAAS,EAAE,WAAW;IACtB,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,eAAe;IAC9B,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,WAAW;CACvB,CAAC;AAEF,MAAM,eAAe,GAAgC;IACnD,CAAC,EAAE,SAAS;IACZ,MAAM,EAAE,cAAc;IACtB,aAAa,EAAE,gBAAgB;IAC/B,MAAM,EAAE,eAAe;IACvB,cAAc,EAAE,gBAAgB;IAChC,MAAM,EAAE,YAAY;IACpB,IAAI,E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,CAAC,SAAS,EAAE;gBAC5D,MAAM,EAAE,KAAK;gBACb,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC;gBAC1B,UAAU;gBACV,GAAG,EAAE;oBACH,QAAQ,EAAE,MAAM,CAAC,SAAS;oBAC1B,IAAI,EAAE,MAAM,CAAC,IAAI;oBACjB,IAAI;oBACJ,YAAY,EAAE,MAAM,CAAC,YAAY;oBACjC,SAAS;iBACV;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nirs4all-ui",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
4
4
|
"description": "Shared React UI components, visual assets, and pure view-model helpers for nirs4all apps.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "(CECILL-2.1 OR AGPL-3.0-or-later)",
|
|
@@ -49,6 +49,10 @@
|
|
|
49
49
|
"types": "./dist/keywordRegistry/index.d.ts",
|
|
50
50
|
"import": "./dist/keywordRegistry/index.js"
|
|
51
51
|
},
|
|
52
|
+
"./nodeRegistry": {
|
|
53
|
+
"types": "./dist/nodeRegistry/index.d.ts",
|
|
54
|
+
"import": "./dist/nodeRegistry/index.js"
|
|
55
|
+
},
|
|
52
56
|
"./tuning": {
|
|
53
57
|
"types": "./dist/tuning/index.d.ts",
|
|
54
58
|
"import": "./dist/tuning/index.js"
|