@camstack/types 1.2.412 → 1.2.414
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/dist/capabilities/advanced-parameters.d.ts +17 -0
- package/dist/capabilities/ambient-light-sensor.cap.d.ts +5 -0
- package/dist/capabilities/battery.cap.d.ts +1 -0
- package/dist/capabilities/binary.cap.d.ts +5 -0
- package/dist/capabilities/composer.cap.d.ts +4 -0
- package/dist/capabilities/core-blocks.cap.d.ts +25 -0
- package/dist/capabilities/customize-catalog.d.ts +8 -0
- package/dist/capabilities/customize-spec.d.ts +2 -0
- package/dist/capabilities/humidity-sensor.cap.d.ts +5 -0
- package/dist/capabilities/power-meter.cap.d.ts +5 -0
- package/dist/capabilities/running-state.cap.d.ts +1 -0
- package/dist/capabilities/switch.cap.d.ts +5 -0
- package/dist/capabilities/temperature-sensor.cap.d.ts +5 -0
- package/dist/composition/cards/__fixtures__/stored-compositions.d.ts +3 -0
- package/dist/composition/cards/card-types.d.ts +77 -0
- package/dist/composition/cards/classify-field.d.ts +9 -0
- package/dist/composition/cards/convert-unit.d.ts +1 -0
- package/dist/composition/cards/decode.d.ts +3 -0
- package/dist/composition/cards/edit.d.ts +6 -0
- package/dist/composition/cards/encode.d.ts +3 -0
- package/dist/composition/cards/fill-status.d.ts +9 -0
- package/dist/composition/cards/formula-problem.d.ts +5 -0
- package/dist/composition/cards/index.d.ts +9 -0
- package/dist/composition/cards/role-cap.d.ts +1 -0
- package/dist/composition/composition-report.d.ts +2 -0
- package/dist/composition/index.d.ts +1 -0
- package/dist/composition/presets/numeric-transforms.d.ts +2 -0
- package/dist/generated/customize-catalog.d.ts +82 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +21745 -21132
- package/dist/index.mjs +21732 -21133
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Derive advanced Customize parameters from runtime Zod (D939).
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import type { CapabilityCustomizeSpec } from './customize-spec.js';
|
|
6
|
+
export declare const ADVANCED_SHORT_STRING_MAX = 80;
|
|
7
|
+
export type AdvancedParameterKind = 'boolean' | 'number' | 'string' | 'enum';
|
|
8
|
+
export interface DerivedAdvancedParameter {
|
|
9
|
+
readonly path: string;
|
|
10
|
+
readonly kind: AdvancedParameterKind;
|
|
11
|
+
readonly label: string;
|
|
12
|
+
readonly unit?: string;
|
|
13
|
+
readonly enumValues?: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export declare function collectCustomizeOwnedPaths(spec: CapabilityCustomizeSpec): ReadonlySet<string>;
|
|
16
|
+
export declare function collectEventTimestampPaths(spec: CapabilityCustomizeSpec): ReadonlySet<string>;
|
|
17
|
+
export declare function deriveAdvancedParameters(runtimeSchema: z.ZodObject<z.core.$ZodLooseShape>, ownedPaths: ReadonlySet<string>, eventTimestampPaths: ReadonlySet<string>): readonly DerivedAdvancedParameter[];
|
|
@@ -57,5 +57,10 @@ export declare const ambientLightSensorCapability: {
|
|
|
57
57
|
/** Clock fields: written, but excluded from the compare that decides
|
|
58
58
|
* whether persisting is worth a SQLite commit. */
|
|
59
59
|
readonly volatileStateFields: readonly ["lastFetchedAt"];
|
|
60
|
+
readonly customize: {
|
|
61
|
+
readonly version: 1;
|
|
62
|
+
readonly advanced: 'derive';
|
|
63
|
+
readonly targets: readonly [];
|
|
64
|
+
};
|
|
60
65
|
};
|
|
61
66
|
export type IAmbientLightSensorProvider = InferProvider<typeof ambientLightSensorCapability>;
|
|
@@ -55,5 +55,10 @@ export declare const binaryCapability: {
|
|
|
55
55
|
/** Clock fields: written, but excluded from the compare that decides
|
|
56
56
|
* whether persisting is worth a SQLite commit. */
|
|
57
57
|
readonly volatileStateFields: readonly ["lastChangedAt"];
|
|
58
|
+
readonly customize: {
|
|
59
|
+
readonly version: 1;
|
|
60
|
+
readonly advanced: 'derive';
|
|
61
|
+
readonly targets: readonly [];
|
|
62
|
+
};
|
|
58
63
|
};
|
|
59
64
|
export type IBinaryProvider = InferProvider<typeof binaryCapability>;
|
|
@@ -249,6 +249,7 @@ export declare const ComposerBlockVerdictSchema: z.ZodObject<{
|
|
|
249
249
|
status: z.ZodEnum<{
|
|
250
250
|
degraded: "degraded";
|
|
251
251
|
failed: "failed";
|
|
252
|
+
incomplete: "incomplete";
|
|
252
253
|
running: "running";
|
|
253
254
|
starting: "starting";
|
|
254
255
|
stopped: "stopped";
|
|
@@ -262,6 +263,7 @@ export declare const ComposerApplyResultSchema: z.ZodObject<{
|
|
|
262
263
|
status: z.ZodEnum<{
|
|
263
264
|
degraded: "degraded";
|
|
264
265
|
failed: "failed";
|
|
266
|
+
incomplete: "incomplete";
|
|
265
267
|
running: "running";
|
|
266
268
|
starting: "starting";
|
|
267
269
|
stopped: "stopped";
|
|
@@ -404,6 +406,7 @@ export declare const composerCapability: {
|
|
|
404
406
|
status: z.ZodEnum<{
|
|
405
407
|
degraded: "degraded";
|
|
406
408
|
failed: "failed";
|
|
409
|
+
incomplete: "incomplete";
|
|
407
410
|
running: "running";
|
|
408
411
|
starting: "starting";
|
|
409
412
|
stopped: "stopped";
|
|
@@ -427,6 +430,7 @@ export declare const composerCapability: {
|
|
|
427
430
|
status: z.ZodEnum<{
|
|
428
431
|
degraded: "degraded";
|
|
429
432
|
failed: "failed";
|
|
433
|
+
incomplete: "incomplete";
|
|
430
434
|
running: "running";
|
|
431
435
|
starting: "starting";
|
|
432
436
|
stopped: "stopped";
|
|
@@ -66,6 +66,7 @@ export type CoreBlockPlacement = z.infer<typeof CoreBlockPlacementSchema>;
|
|
|
66
66
|
export declare const CoreBlockStatusSchema: z.ZodEnum<{
|
|
67
67
|
degraded: "degraded";
|
|
68
68
|
failed: "failed";
|
|
69
|
+
incomplete: "incomplete";
|
|
69
70
|
running: "running";
|
|
70
71
|
starting: "starting";
|
|
71
72
|
stopped: "stopped";
|
|
@@ -400,6 +401,7 @@ export declare const CoreBlockSchema: z.ZodObject<{
|
|
|
400
401
|
status: z.ZodEnum<{
|
|
401
402
|
degraded: "degraded";
|
|
402
403
|
failed: "failed";
|
|
404
|
+
incomplete: "incomplete";
|
|
403
405
|
running: "running";
|
|
404
406
|
starting: "starting";
|
|
405
407
|
stopped: "stopped";
|
|
@@ -558,6 +560,7 @@ export declare const CompositionStateReadSchema: z.ZodDiscriminatedUnion<[z.ZodO
|
|
|
558
560
|
status: z.ZodEnum<{
|
|
559
561
|
degraded: "degraded";
|
|
560
562
|
failed: "failed";
|
|
563
|
+
incomplete: "incomplete";
|
|
561
564
|
running: "running";
|
|
562
565
|
starting: "starting";
|
|
563
566
|
stopped: "stopped";
|
|
@@ -603,6 +606,7 @@ export declare const CompositionViewSchema: z.ZodObject<{
|
|
|
603
606
|
status: z.ZodEnum<{
|
|
604
607
|
degraded: "degraded";
|
|
605
608
|
failed: "failed";
|
|
609
|
+
incomplete: "incomplete";
|
|
606
610
|
running: "running";
|
|
607
611
|
starting: "starting";
|
|
608
612
|
stopped: "stopped";
|
|
@@ -757,6 +761,7 @@ export declare const CompositionViewSchema: z.ZodObject<{
|
|
|
757
761
|
status: z.ZodEnum<{
|
|
758
762
|
degraded: "degraded";
|
|
759
763
|
failed: "failed";
|
|
764
|
+
incomplete: "incomplete";
|
|
760
765
|
running: "running";
|
|
761
766
|
starting: "starting";
|
|
762
767
|
stopped: "stopped";
|
|
@@ -804,6 +809,7 @@ export declare const CompositionListReadSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
804
809
|
status: z.ZodEnum<{
|
|
805
810
|
degraded: "degraded";
|
|
806
811
|
failed: "failed";
|
|
812
|
+
incomplete: "incomplete";
|
|
807
813
|
running: "running";
|
|
808
814
|
starting: "starting";
|
|
809
815
|
stopped: "stopped";
|
|
@@ -958,6 +964,7 @@ export declare const CompositionListReadSchema: z.ZodDiscriminatedUnion<[z.ZodOb
|
|
|
958
964
|
status: z.ZodEnum<{
|
|
959
965
|
degraded: "degraded";
|
|
960
966
|
failed: "failed";
|
|
967
|
+
incomplete: "incomplete";
|
|
961
968
|
running: "running";
|
|
962
969
|
starting: "starting";
|
|
963
970
|
stopped: "stopped";
|
|
@@ -1009,6 +1016,7 @@ export declare const CompositionGetReadSchema: z.ZodDiscriminatedUnion<[z.ZodObj
|
|
|
1009
1016
|
status: z.ZodEnum<{
|
|
1010
1017
|
degraded: "degraded";
|
|
1011
1018
|
failed: "failed";
|
|
1019
|
+
incomplete: "incomplete";
|
|
1012
1020
|
running: "running";
|
|
1013
1021
|
starting: "starting";
|
|
1014
1022
|
stopped: "stopped";
|
|
@@ -1163,6 +1171,7 @@ export declare const CompositionGetReadSchema: z.ZodDiscriminatedUnion<[z.ZodObj
|
|
|
1163
1171
|
status: z.ZodEnum<{
|
|
1164
1172
|
degraded: "degraded";
|
|
1165
1173
|
failed: "failed";
|
|
1174
|
+
incomplete: "incomplete";
|
|
1166
1175
|
running: "running";
|
|
1167
1176
|
starting: "starting";
|
|
1168
1177
|
stopped: "stopped";
|
|
@@ -1215,6 +1224,7 @@ export declare const CompositionCustomizationReadSchema: z.ZodDiscriminatedUnion
|
|
|
1215
1224
|
status: z.ZodEnum<{
|
|
1216
1225
|
degraded: "degraded";
|
|
1217
1226
|
failed: "failed";
|
|
1227
|
+
incomplete: "incomplete";
|
|
1218
1228
|
running: "running";
|
|
1219
1229
|
starting: "starting";
|
|
1220
1230
|
stopped: "stopped";
|
|
@@ -1369,6 +1379,7 @@ export declare const CompositionCustomizationReadSchema: z.ZodDiscriminatedUnion
|
|
|
1369
1379
|
status: z.ZodEnum<{
|
|
1370
1380
|
degraded: "degraded";
|
|
1371
1381
|
failed: "failed";
|
|
1382
|
+
incomplete: "incomplete";
|
|
1372
1383
|
running: "running";
|
|
1373
1384
|
starting: "starting";
|
|
1374
1385
|
stopped: "stopped";
|
|
@@ -1441,6 +1452,7 @@ export declare const coreBlocksCapability: {
|
|
|
1441
1452
|
status: z.ZodEnum<{
|
|
1442
1453
|
degraded: "degraded";
|
|
1443
1454
|
failed: "failed";
|
|
1455
|
+
incomplete: "incomplete";
|
|
1444
1456
|
running: "running";
|
|
1445
1457
|
starting: "starting";
|
|
1446
1458
|
stopped: "stopped";
|
|
@@ -1607,6 +1619,7 @@ export declare const coreBlocksCapability: {
|
|
|
1607
1619
|
status: z.ZodEnum<{
|
|
1608
1620
|
degraded: "degraded";
|
|
1609
1621
|
failed: "failed";
|
|
1622
|
+
incomplete: "incomplete";
|
|
1610
1623
|
running: "running";
|
|
1611
1624
|
starting: "starting";
|
|
1612
1625
|
stopped: "stopped";
|
|
@@ -1787,6 +1800,7 @@ export declare const coreBlocksCapability: {
|
|
|
1787
1800
|
status: z.ZodEnum<{
|
|
1788
1801
|
degraded: "degraded";
|
|
1789
1802
|
failed: "failed";
|
|
1803
|
+
incomplete: "incomplete";
|
|
1790
1804
|
running: "running";
|
|
1791
1805
|
starting: "starting";
|
|
1792
1806
|
stopped: "stopped";
|
|
@@ -1965,6 +1979,7 @@ export declare const coreBlocksCapability: {
|
|
|
1965
1979
|
status: z.ZodEnum<{
|
|
1966
1980
|
degraded: "degraded";
|
|
1967
1981
|
failed: "failed";
|
|
1982
|
+
incomplete: "incomplete";
|
|
1968
1983
|
running: "running";
|
|
1969
1984
|
starting: "starting";
|
|
1970
1985
|
stopped: "stopped";
|
|
@@ -2139,6 +2154,7 @@ export declare const coreBlocksCapability: {
|
|
|
2139
2154
|
status: z.ZodEnum<{
|
|
2140
2155
|
degraded: "degraded";
|
|
2141
2156
|
failed: "failed";
|
|
2157
|
+
incomplete: "incomplete";
|
|
2142
2158
|
running: "running";
|
|
2143
2159
|
starting: "starting";
|
|
2144
2160
|
stopped: "stopped";
|
|
@@ -2318,6 +2334,7 @@ export declare const coreBlocksCapability: {
|
|
|
2318
2334
|
status: z.ZodEnum<{
|
|
2319
2335
|
degraded: "degraded";
|
|
2320
2336
|
failed: "failed";
|
|
2337
|
+
incomplete: "incomplete";
|
|
2321
2338
|
running: "running";
|
|
2322
2339
|
starting: "starting";
|
|
2323
2340
|
stopped: "stopped";
|
|
@@ -2687,6 +2704,7 @@ export declare const coreBlocksCapability: {
|
|
|
2687
2704
|
status: z.ZodEnum<{
|
|
2688
2705
|
degraded: "degraded";
|
|
2689
2706
|
failed: "failed";
|
|
2707
|
+
incomplete: "incomplete";
|
|
2690
2708
|
running: "running";
|
|
2691
2709
|
starting: "starting";
|
|
2692
2710
|
stopped: "stopped";
|
|
@@ -2960,6 +2978,7 @@ export declare const coreBlocksCapability: {
|
|
|
2960
2978
|
status: z.ZodEnum<{
|
|
2961
2979
|
degraded: "degraded";
|
|
2962
2980
|
failed: "failed";
|
|
2981
|
+
incomplete: "incomplete";
|
|
2963
2982
|
running: "running";
|
|
2964
2983
|
starting: "starting";
|
|
2965
2984
|
stopped: "stopped";
|
|
@@ -3131,6 +3150,7 @@ export declare const coreBlocksCapability: {
|
|
|
3131
3150
|
status: z.ZodEnum<{
|
|
3132
3151
|
degraded: "degraded";
|
|
3133
3152
|
failed: "failed";
|
|
3153
|
+
incomplete: "incomplete";
|
|
3134
3154
|
running: "running";
|
|
3135
3155
|
starting: "starting";
|
|
3136
3156
|
stopped: "stopped";
|
|
@@ -3285,6 +3305,7 @@ export declare const coreBlocksCapability: {
|
|
|
3285
3305
|
status: z.ZodEnum<{
|
|
3286
3306
|
degraded: "degraded";
|
|
3287
3307
|
failed: "failed";
|
|
3308
|
+
incomplete: "incomplete";
|
|
3288
3309
|
running: "running";
|
|
3289
3310
|
starting: "starting";
|
|
3290
3311
|
stopped: "stopped";
|
|
@@ -3335,6 +3356,7 @@ export declare const coreBlocksCapability: {
|
|
|
3335
3356
|
status: z.ZodEnum<{
|
|
3336
3357
|
degraded: "degraded";
|
|
3337
3358
|
failed: "failed";
|
|
3359
|
+
incomplete: "incomplete";
|
|
3338
3360
|
running: "running";
|
|
3339
3361
|
starting: "starting";
|
|
3340
3362
|
stopped: "stopped";
|
|
@@ -3489,6 +3511,7 @@ export declare const coreBlocksCapability: {
|
|
|
3489
3511
|
status: z.ZodEnum<{
|
|
3490
3512
|
degraded: "degraded";
|
|
3491
3513
|
failed: "failed";
|
|
3514
|
+
incomplete: "incomplete";
|
|
3492
3515
|
running: "running";
|
|
3493
3516
|
starting: "starting";
|
|
3494
3517
|
stopped: "stopped";
|
|
@@ -3546,6 +3569,7 @@ export declare const coreBlocksCapability: {
|
|
|
3546
3569
|
status: z.ZodEnum<{
|
|
3547
3570
|
degraded: "degraded";
|
|
3548
3571
|
failed: "failed";
|
|
3572
|
+
incomplete: "incomplete";
|
|
3549
3573
|
running: "running";
|
|
3550
3574
|
starting: "starting";
|
|
3551
3575
|
stopped: "stopped";
|
|
@@ -3700,6 +3724,7 @@ export declare const coreBlocksCapability: {
|
|
|
3700
3724
|
status: z.ZodEnum<{
|
|
3701
3725
|
degraded: "degraded";
|
|
3702
3726
|
failed: "failed";
|
|
3727
|
+
incomplete: "incomplete";
|
|
3703
3728
|
running: "running";
|
|
3704
3729
|
starting: "starting";
|
|
3705
3730
|
stopped: "stopped";
|
|
@@ -65,8 +65,16 @@ export interface CustomizeCatalogTarget {
|
|
|
65
65
|
readonly sourceReport: CustomizeSourceReport;
|
|
66
66
|
readonly advancedExpression: boolean;
|
|
67
67
|
}
|
|
68
|
+
export interface CustomizeCatalogAdvancedParameter {
|
|
69
|
+
readonly path: string;
|
|
70
|
+
readonly kind: CustomizeCatalogValueKind;
|
|
71
|
+
readonly label: string;
|
|
72
|
+
readonly unit?: string;
|
|
73
|
+
readonly enumValues?: readonly string[];
|
|
74
|
+
}
|
|
68
75
|
export interface CustomizeCatalogEntry {
|
|
69
76
|
readonly version: 1;
|
|
70
77
|
readonly targets: readonly CustomizeCatalogTarget[];
|
|
78
|
+
readonly advancedParameters: readonly CustomizeCatalogAdvancedParameter[];
|
|
71
79
|
}
|
|
72
80
|
export type CustomizeCatalog = Readonly<Record<string, CustomizeCatalogEntry>>;
|
|
@@ -13,6 +13,8 @@ export type CustomizeApplyMode = 'add' | 'replace' | 'add-or-replace';
|
|
|
13
13
|
export interface CapabilityCustomizeSpec {
|
|
14
14
|
readonly version: 1;
|
|
15
15
|
readonly targets: readonly CapabilityCustomizeTarget[];
|
|
16
|
+
/** Opt-in advanced parameters: derive from runtime schema or an explicit path list (D939). */
|
|
17
|
+
readonly advanced?: 'derive' | readonly string[];
|
|
16
18
|
}
|
|
17
19
|
export type CapabilityCustomizeTarget = ScalarCustomizeTarget | KeyedArrayCustomizeTarget | EventCustomizeTarget;
|
|
18
20
|
export interface CustomizeVocabularyRef {
|
|
@@ -60,5 +60,10 @@ export declare const humiditySensorCapability: {
|
|
|
60
60
|
/** Clock fields: written, but excluded from the compare that decides
|
|
61
61
|
* whether persisting is worth a SQLite commit. */
|
|
62
62
|
readonly volatileStateFields: readonly ["lastFetchedAt"];
|
|
63
|
+
readonly customize: {
|
|
64
|
+
readonly version: 1;
|
|
65
|
+
readonly advanced: 'derive';
|
|
66
|
+
readonly targets: readonly [];
|
|
67
|
+
};
|
|
63
68
|
};
|
|
64
69
|
export type IHumiditySensorProvider = InferProvider<typeof humiditySensorCapability>;
|
|
@@ -113,5 +113,10 @@ export declare const powerMeterCapability: {
|
|
|
113
113
|
/** Clock fields: written, but excluded from the compare that decides
|
|
114
114
|
* whether persisting is worth a SQLite commit. */
|
|
115
115
|
readonly volatileStateFields: readonly ["lastFetchedAt"];
|
|
116
|
+
readonly customize: {
|
|
117
|
+
readonly version: 1;
|
|
118
|
+
readonly advanced: 'derive';
|
|
119
|
+
readonly targets: readonly [];
|
|
120
|
+
};
|
|
116
121
|
};
|
|
117
122
|
export type IPowerMeterProvider = InferProvider<typeof powerMeterCapability>;
|
|
@@ -74,6 +74,7 @@ export declare const runningStateCapability: {
|
|
|
74
74
|
readonly volatileStateFields: readonly ["lastFetchedAt"];
|
|
75
75
|
readonly customize: {
|
|
76
76
|
readonly version: 1;
|
|
77
|
+
readonly advanced: 'derive';
|
|
77
78
|
readonly targets: readonly [{
|
|
78
79
|
readonly id: 'running';
|
|
79
80
|
readonly cardinality: 'scalar';
|
|
@@ -82,5 +82,10 @@ export declare const switchCapability: {
|
|
|
82
82
|
};
|
|
83
83
|
}];
|
|
84
84
|
};
|
|
85
|
+
readonly customize: {
|
|
86
|
+
readonly version: 1;
|
|
87
|
+
readonly advanced: 'derive';
|
|
88
|
+
readonly targets: readonly [];
|
|
89
|
+
};
|
|
85
90
|
};
|
|
86
91
|
export type ISwitchProvider = InferProvider<typeof switchCapability>;
|
|
@@ -68,5 +68,10 @@ export declare const temperatureSensorCapability: {
|
|
|
68
68
|
/** Clock fields: written, but excluded from the compare that decides
|
|
69
69
|
* whether persisting is worth a SQLite commit. */
|
|
70
70
|
readonly volatileStateFields: readonly ["lastFetchedAt"];
|
|
71
|
+
readonly customize: {
|
|
72
|
+
readonly version: 1;
|
|
73
|
+
readonly advanced: 'derive';
|
|
74
|
+
readonly targets: readonly [];
|
|
75
|
+
};
|
|
71
76
|
};
|
|
72
77
|
export type ITemperatureSensorProvider = InferProvider<typeof temperatureSensorCapability>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Card editor model for a stored composition (D939).
|
|
3
|
+
*/
|
|
4
|
+
import type { Composition, CompositionExpressionSource, CompositionFieldRead, CompositionFieldsFeature, CompositionPassthroughFeature } from '../composition.js';
|
|
5
|
+
import type { KeyedArrayRead } from '../customize/keyed-array-decode.js';
|
|
6
|
+
import type { PulseDecoded } from '../customize/event-decode.js';
|
|
7
|
+
import type { ScalarDecoded } from '../customize/scalar-decode.js';
|
|
8
|
+
export type FieldAggregateKind = 'avg-round-1' | 'max';
|
|
9
|
+
export interface FromFieldEntry {
|
|
10
|
+
readonly kind: 'from';
|
|
11
|
+
readonly sources: readonly CompositionFieldRead[];
|
|
12
|
+
readonly aggregate: FieldAggregateKind | null;
|
|
13
|
+
}
|
|
14
|
+
export interface CompanionFieldEntry {
|
|
15
|
+
readonly kind: 'companion';
|
|
16
|
+
readonly companion: 'now';
|
|
17
|
+
}
|
|
18
|
+
export interface FormulaFieldEntry {
|
|
19
|
+
readonly kind: 'formula';
|
|
20
|
+
readonly expr: string;
|
|
21
|
+
readonly bindings: CompositionExpressionSource['bindings'];
|
|
22
|
+
}
|
|
23
|
+
/** Publish this field converted from its declared unit to `to` (D939). */
|
|
24
|
+
export interface ConvertUnitFieldEntry {
|
|
25
|
+
readonly kind: 'convert-unit';
|
|
26
|
+
readonly bindingName: string;
|
|
27
|
+
readonly from: string;
|
|
28
|
+
readonly to: string;
|
|
29
|
+
readonly source: CompositionFieldRead;
|
|
30
|
+
}
|
|
31
|
+
export type CompositionCardFieldEntry = FromFieldEntry | CompanionFieldEntry | FormulaFieldEntry | ConvertUnitFieldEntry;
|
|
32
|
+
export interface CompositionFieldsCard {
|
|
33
|
+
readonly cardKind: 'fields';
|
|
34
|
+
readonly cap: string;
|
|
35
|
+
readonly enabled: boolean | undefined;
|
|
36
|
+
readonly entries: Readonly<Record<string, CompositionCardFieldEntry>>;
|
|
37
|
+
readonly items: CompositionFieldsFeature['items'];
|
|
38
|
+
}
|
|
39
|
+
export interface CompositionPulseCard {
|
|
40
|
+
readonly cardKind: 'pulse';
|
|
41
|
+
readonly cap: string;
|
|
42
|
+
readonly targetId: string;
|
|
43
|
+
readonly decoded: PulseDecoded;
|
|
44
|
+
}
|
|
45
|
+
export interface CompositionScalarCard {
|
|
46
|
+
readonly cardKind: 'scalar';
|
|
47
|
+
readonly cap: string;
|
|
48
|
+
readonly targetId: string;
|
|
49
|
+
readonly decoded: ScalarDecoded;
|
|
50
|
+
}
|
|
51
|
+
export interface CompositionKeyedArrayCard {
|
|
52
|
+
readonly cardKind: 'keyedArray';
|
|
53
|
+
readonly cap: string;
|
|
54
|
+
readonly targetId: string;
|
|
55
|
+
readonly decoded: KeyedArrayRead;
|
|
56
|
+
}
|
|
57
|
+
export type CompositionCard = CompositionFieldsCard | CompositionPulseCard | CompositionScalarCard | CompositionKeyedArrayCard;
|
|
58
|
+
export interface CompositionPassthroughSlot {
|
|
59
|
+
readonly featureIndex: number;
|
|
60
|
+
readonly feature: CompositionPassthroughFeature;
|
|
61
|
+
}
|
|
62
|
+
export interface CompositionCardSlot {
|
|
63
|
+
readonly featureIndex: number;
|
|
64
|
+
readonly card: CompositionCard;
|
|
65
|
+
}
|
|
66
|
+
export interface CompositionCardEditorModel {
|
|
67
|
+
readonly original: Composition;
|
|
68
|
+
readonly passthroughFeatures: readonly CompositionPassthroughSlot[];
|
|
69
|
+
readonly cards: readonly CompositionCardSlot[];
|
|
70
|
+
/** Field paths edited on a `fields` card, keyed by cap. */
|
|
71
|
+
readonly editedFieldPaths: Readonly<Record<string, readonly string[]>>;
|
|
72
|
+
/** Whole-card overrides (pulse / scalar / keyed) marked edited. */
|
|
73
|
+
readonly editedCards: Readonly<Record<string, true>>;
|
|
74
|
+
}
|
|
75
|
+
export interface DecodedCompositionCards {
|
|
76
|
+
readonly model: CompositionCardEditorModel;
|
|
77
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Classify one composition field into a card entry.
|
|
3
|
+
*/
|
|
4
|
+
import type { CompositionFieldRead, CompositionFieldSource } from '../composition.js';
|
|
5
|
+
import type { CompositionCardFieldEntry } from './card-types.js';
|
|
6
|
+
declare function sameRead(a: CompositionFieldRead, b: CompositionFieldRead): boolean;
|
|
7
|
+
export declare function classifyFieldSource(source: CompositionFieldSource): CompositionCardFieldEntry;
|
|
8
|
+
export declare function fieldEntryToSource(entry: CompositionCardFieldEntry, original: CompositionFieldSource | undefined): CompositionFieldSource;
|
|
9
|
+
export { sameRead };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function convertUnitTargets(from: string): readonly string[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Immutable edits on the card editor model (D939).
|
|
3
|
+
*/
|
|
4
|
+
import type { CompositionCardEditorModel } from './card-types.js';
|
|
5
|
+
export declare function markFieldEdited(model: CompositionCardEditorModel, cap: string, fieldPath: string): CompositionCardEditorModel;
|
|
6
|
+
export declare function setFormulaExpr(model: CompositionCardEditorModel, cap: string, fieldPath: string, expr: string): CompositionCardEditorModel;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a composition still needs required value fields (D939).
|
|
3
|
+
*/
|
|
4
|
+
import type { CompositionProblem } from '../composition-report.js';
|
|
5
|
+
export type CompositionFillStatus = 'complete' | 'incomplete';
|
|
6
|
+
export declare function isUnfilledRequiredProblem(problem: CompositionProblem): boolean;
|
|
7
|
+
export declare function compositionFillStatus(problems: readonly CompositionProblem[]): CompositionFillStatus;
|
|
8
|
+
/** True when the only problems are unfilled required fields — save may proceed. */
|
|
9
|
+
export declare function problemsBlockSave(problems: readonly CompositionProblem[]): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './card-types.js';
|
|
2
|
+
export * from './classify-field.js';
|
|
3
|
+
export * from './convert-unit.js';
|
|
4
|
+
export * from './decode.js';
|
|
5
|
+
export * from './encode.js';
|
|
6
|
+
export * from './edit.js';
|
|
7
|
+
export * from './formula-problem.js';
|
|
8
|
+
export * from './role-cap.js';
|
|
9
|
+
export * from './fill-status.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function primaryCapForRole(role: string | null): string | null;
|
|
@@ -308,6 +308,7 @@ export type CompositionValidation = z.infer<typeof CompositionValidationSchema>;
|
|
|
308
308
|
export declare const CompositionRunStatusSchema: z.ZodEnum<{
|
|
309
309
|
degraded: "degraded";
|
|
310
310
|
failed: "failed";
|
|
311
|
+
incomplete: "incomplete";
|
|
311
312
|
running: "running";
|
|
312
313
|
starting: "starting";
|
|
313
314
|
stopped: "stopped";
|
|
@@ -342,6 +343,7 @@ export declare const CompositionBlockStateSchema: z.ZodObject<{
|
|
|
342
343
|
status: z.ZodEnum<{
|
|
343
344
|
degraded: "degraded";
|
|
344
345
|
failed: "failed";
|
|
346
|
+
incomplete: "incomplete";
|
|
345
347
|
running: "running";
|
|
346
348
|
starting: "starting";
|
|
347
349
|
stopped: "stopped";
|
|
@@ -16,4 +16,6 @@ export interface ConvertPresetInput {
|
|
|
16
16
|
/** Cap top-level `unit` field replaced with `to`; null when the cap has none. */
|
|
17
17
|
readonly unitField: string | null;
|
|
18
18
|
}
|
|
19
|
+
/** `unit` when converting that cap's primary numeric field; otherwise none. */
|
|
20
|
+
export declare function unitCompanionField(cap: string, fieldPath: string): string | null;
|
|
19
21
|
export declare function convertPresetFeature(input: ConvertPresetInput): CompositionFieldsFeature | null;
|