@kymoscope/sdk 0.10.0 → 0.11.1
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/assets/{importer.worker-CLBGjz4d.js → importer.worker-Cgz__4KO.js} +1 -1
- package/dist/assets/liveIngestWorker-BLPTEEc7.js +1 -0
- package/dist/assets/offscreenLineWorker-C-_uNa_H.js +80 -0
- package/dist/{importers-2iwVi4cq.js → importers-D_M42sqZ.js} +1 -1
- package/dist/{keys-DmtCD10T.js → keys-CkI2qrI-.js} +1 -1
- package/dist/kymoscope-embed.js +66 -66
- package/dist/kymoscope-sdk.js +62 -62
- package/dist/types/analysis/ai.d.ts +50 -0
- package/dist/types/analysis/aiCheck.d.ts +54 -0
- package/dist/types/analysis/alertsBefore.d.ts +7 -0
- package/dist/types/analysis/better.d.ts +6 -0
- package/dist/types/analysis/capability.d.ts +10 -0
- package/dist/types/analysis/changes.d.ts +10 -0
- package/dist/types/analysis/containment.d.ts +10 -0
- package/dist/types/analysis/context.d.ts +131 -0
- package/dist/types/analysis/control.d.ts +13 -0
- package/dist/types/analysis/energy.d.ts +4 -0
- package/dist/types/analysis/gap.d.ts +8 -0
- package/dist/types/analysis/golden.d.ts +20 -0
- package/dist/types/analysis/health.d.ts +73 -0
- package/dist/types/analysis/index.d.ts +12 -0
- package/dist/types/analysis/infer.d.ts +68 -0
- package/dist/types/analysis/lines.d.ts +6 -0
- package/dist/types/analysis/losses.d.ts +41 -0
- package/dist/types/analysis/maintenance.d.ts +8 -0
- package/dist/types/analysis/oee.d.ts +30 -0
- package/dist/types/analysis/parts.d.ts +13 -0
- package/dist/types/analysis/presets.d.ts +35 -0
- package/dist/types/analysis/reliability.d.ts +103 -0
- package/dist/types/analysis/report.d.ts +15 -0
- package/dist/types/analysis/shifts.d.ts +7 -0
- package/dist/types/analysis/sinceLast.d.ts +8 -0
- package/dist/types/analysis/stats.d.ts +110 -0
- package/dist/types/analysis/stops.d.ts +34 -0
- package/dist/types/analysis/strip.d.ts +14 -0
- package/dist/types/analysis/text.d.ts +56 -0
- package/dist/types/analysis/types.d.ts +407 -0
- package/dist/types/components/liveWindow.d.ts +6 -2
- package/dist/types/engine/createEngine.d.ts +1 -0
- package/dist/types/engine/liveController.d.ts +7 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/lib/live/liveIngest.d.ts +47 -0
- package/dist/types/lib/live/liveIngestClient.d.ts +9 -0
- package/dist/types/lib/live/liveIngestWorker.d.ts +1 -0
- package/dist/types/lib/live/publisher.d.ts +10 -0
- package/dist/types/lib/live/stream.d.ts +8 -0
- package/dist/types/lib/live/types.d.ts +12 -0
- package/dist/types/lib/render/frames.d.ts +10 -0
- package/dist/types/lib/render/glPoints.d.ts +18 -0
- package/dist/types/lib/render/offscreenLineRenderer.d.ts +15 -1
- package/dist/types/lib/render/sharedGl.d.ts +12 -3
- package/package.json +1 -1
- package/dist/assets/offscreenLineWorker-BQwts3O3.js +0 -80
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { AI_CHARS, AI_SENTENCES, AI_WORDS, type AiSentence } from './aiCheck';
|
|
2
|
+
import { type ProcessContext } from './context';
|
|
3
|
+
import type { ReportDoc, ReportRole, SectionId } from './types';
|
|
4
|
+
/** AI writing (spec 2026-11-10, delivery B). Every number and finding is Kymoscope's; Kymoscope's AI only words them.
|
|
5
|
+
* `aiInput` is everything report-writer is sent: the process in the customer's words, the channels' confirmed roles,
|
|
6
|
+
* and the report's verdicts, findings (text and evidence) and actions — never a sample, never section 14. `applyAi`
|
|
7
|
+
* puts back what report-writer returned, keeping only text that cites findings of this report, is short, and carries
|
|
8
|
+
* no number its sources don't (report-writer has already dropped the rest with the same check, aiCheck.ts; this is the
|
|
9
|
+
* second pass). It can only replace wording: never add a section, chart, finding or action. */
|
|
10
|
+
export { AI_CHARS, AI_SENTENCES, AI_WORDS, type AiSentence };
|
|
11
|
+
export interface AiText {
|
|
12
|
+
sections: Array<{
|
|
13
|
+
id: SectionId;
|
|
14
|
+
verdict: AiSentence | null;
|
|
15
|
+
sentences: AiSentence[];
|
|
16
|
+
}>;
|
|
17
|
+
actions: Array<{
|
|
18
|
+
id: string;
|
|
19
|
+
text: string;
|
|
20
|
+
cites: string[];
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
export interface AiInput {
|
|
24
|
+
process: string;
|
|
25
|
+
channels: Array<{
|
|
26
|
+
name: string;
|
|
27
|
+
role: string;
|
|
28
|
+
unit: string;
|
|
29
|
+
}>;
|
|
30
|
+
sections: Array<{
|
|
31
|
+
id: SectionId;
|
|
32
|
+
title: string;
|
|
33
|
+
verdict: string;
|
|
34
|
+
findings: Array<{
|
|
35
|
+
id: string;
|
|
36
|
+
text: string;
|
|
37
|
+
evidence: string;
|
|
38
|
+
refs: SectionId[];
|
|
39
|
+
}>;
|
|
40
|
+
}>;
|
|
41
|
+
actions: Array<{
|
|
42
|
+
id: string;
|
|
43
|
+
text: string;
|
|
44
|
+
owner: ReportRole;
|
|
45
|
+
refs: string[];
|
|
46
|
+
}>;
|
|
47
|
+
}
|
|
48
|
+
export declare const AI_NOTE: (model: string) => string;
|
|
49
|
+
export declare function aiInput(doc: ReportDoc, given: ProcessContext | null): AiInput;
|
|
50
|
+
export declare function applyAi(doc: ReportDoc, ai: AiText, model: string): ReportDoc;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export interface AiSentence {
|
|
2
|
+
text: string;
|
|
3
|
+
cites: string[];
|
|
4
|
+
}
|
|
5
|
+
/** What the check needs of a report: each section's fixed verdict and findings (with the sections a finding lists,
|
|
6
|
+
* for 00), and the actions with their refs. */
|
|
7
|
+
export interface AiCheckInput {
|
|
8
|
+
sections: Array<{
|
|
9
|
+
id: string;
|
|
10
|
+
verdict: string;
|
|
11
|
+
findings: Array<{
|
|
12
|
+
id: string;
|
|
13
|
+
text: string;
|
|
14
|
+
refs: string[];
|
|
15
|
+
}>;
|
|
16
|
+
}>;
|
|
17
|
+
actions: Array<{
|
|
18
|
+
id: string;
|
|
19
|
+
text: string;
|
|
20
|
+
refs: string[];
|
|
21
|
+
}>;
|
|
22
|
+
}
|
|
23
|
+
/** The AI text that passed: only sections and actions of the input, each with what was kept. */
|
|
24
|
+
export interface AiChecked {
|
|
25
|
+
sections: Array<{
|
|
26
|
+
id: string;
|
|
27
|
+
verdict: AiSentence | null;
|
|
28
|
+
sentences: AiSentence[];
|
|
29
|
+
}>;
|
|
30
|
+
actions: Array<{
|
|
31
|
+
id: string;
|
|
32
|
+
text: string;
|
|
33
|
+
cites: string[];
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
/** Sentences the AI may add under a section's verdict (2026-11-10: concise). */
|
|
37
|
+
export declare const AI_SENTENCES = 2;
|
|
38
|
+
/** Most words in a verdict, a sentence and an action (plan choice 3). */
|
|
39
|
+
export declare const AI_WORDS: {
|
|
40
|
+
readonly verdict: 30;
|
|
41
|
+
readonly sentence: 35;
|
|
42
|
+
readonly action: 30;
|
|
43
|
+
};
|
|
44
|
+
/** Most characters in a verdict, a sentence and an action. */
|
|
45
|
+
export declare const AI_CHARS: {
|
|
46
|
+
readonly verdict: 250;
|
|
47
|
+
readonly sentence: 300;
|
|
48
|
+
readonly action: 250;
|
|
49
|
+
};
|
|
50
|
+
/** Keeps AI text that cites findings it may (a section: its own; 00 also those of the sections it lists; 12 the
|
|
51
|
+
* actions' refs; an action: its refs), fits the word and character caps, and states no number its sources don't (a
|
|
52
|
+
* verdict: the fixed verdict's; a sentence: its cited findings'; an action: its fixed text's and cited findings').
|
|
53
|
+
* Section 14 is never worded. Malformed input never throws. */
|
|
54
|
+
export declare function checkAi(input: AiCheckInput, ai: unknown): AiChecked;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type Classified, type ReportInput, type SectionOut } from './types';
|
|
2
|
+
/** Section 07 (spec 2026-11-10): the project's alert rules, run over the period's recordings, against the batches. An
|
|
3
|
+
* alert comes before a batch when it is raised in the hour before the batch starts or while it runs. Per rule: the
|
|
4
|
+
* share of off-golden batches it came before against the share of the rest (two-proportion test, Fisher's exact test
|
|
5
|
+
* with small counts; Benjamini–Hochberg at q = 0.01 across rules). */
|
|
6
|
+
export declare const LEAD_S = 3600;
|
|
7
|
+
export declare function alertsBefore(input: ReportInput, pop: Classified[]): SectionOut | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Classified, type ReportInput, type SectionOut } from './types';
|
|
2
|
+
/** Section 03 (spec 2026-11-10 decision 1): batches that beat the golden, what they do differently, and per stream the
|
|
3
|
+
* best repeatable batch proposed as the new golden. */
|
|
4
|
+
export declare const MIN_REPEATS = 5;
|
|
5
|
+
export declare const MAX_DIFFERENCES = 5;
|
|
6
|
+
export declare function betterThanGolden(input: ReportInput, pop: Classified[]): SectionOut;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Classified, type Missing, type ReportInput, type SectionOut } from './types';
|
|
2
|
+
/** Section 04.1 (spec 2026-11-10): the capability of each cycle KPI whose channel has specification limits in Process
|
|
3
|
+
* context. Ppk = min(USL − mean, mean − LSL) / 3σ over the period's judged batches (σ: the overall sample standard
|
|
4
|
+
* deviation, so Ppk, not Cpk). With no spread it is ±∞: capable when every batch is inside, not capable otherwise. */
|
|
5
|
+
export declare const MIN_CPK_BATCHES = 30;
|
|
6
|
+
/** Capable from this Ppk unless Process context sets another (`ppkMin`: 1.67 for PPAP). */
|
|
7
|
+
export declare const CPK_OK = 1.33;
|
|
8
|
+
/** Ppk is indicative: it assumes a normal distribution and a stable process, neither of which the report tests. */
|
|
9
|
+
export declare const PPK_NOTE = "Ppk is indicative: it assumes the values are normally distributed and the process stable, which this report does not test.";
|
|
10
|
+
export declare function capability(input: ReportInput, pop: Classified[]): SectionOut | Missing | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Classified, type Missing, type ReportInput, type SectionOut } from './types';
|
|
2
|
+
/** Section 08 (delivery D revised 2026-11-11): changes of the channels marked as adjustable settings, found as
|
|
3
|
+
* consecutive flat runs at different values, each with the value to compare before and after it (Mann–Whitney,
|
|
4
|
+
* Benjamini–Hochberg across the period's changes); and golden changes. What follows a change is a statistical
|
|
5
|
+
* difference afterwards, not a proven cause. */
|
|
6
|
+
export declare const CHANGE_N = 20;
|
|
7
|
+
export declare const CHANGE_NOISE = 3;
|
|
8
|
+
/** The index of the first batch starting at or after `t` (batches sorted by start). */
|
|
9
|
+
export declare function firstAtOrAfter(xs: Classified[], t: number): number;
|
|
10
|
+
export declare function changes(input: ReportInput, pop: Classified[]): SectionOut | Missing | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Part } from './parts';
|
|
2
|
+
import { type Sensor } from './reliability';
|
|
3
|
+
import type { Classified, ReportInput } from './types';
|
|
4
|
+
/** 04.2 (delivery D revised 2026-11-11): the batches made while a sensor the golden compares was stuck (05.1 Replace,
|
|
5
|
+
* its flat runs joined within STUCK_JOIN_S) or read past its band edge (a 05.2 drift already past it, from the day it
|
|
6
|
+
* crossed). A stuck sensor's readings can't be trusted (urgent); past the band edge, the sensor or the process moved:
|
|
7
|
+
* batches to check before they ship either way. */
|
|
8
|
+
export declare const CONTAINMENT_ROWS = 10;
|
|
9
|
+
/** `sensors`: 05.1's, when the report already has them (saves fitting the trends twice). */
|
|
10
|
+
export declare function containment(input: ReportInput, pop: Classified[], sensors?: Sensor[]): Part | null;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { type PresetId } from './presets';
|
|
2
|
+
import { type SectionId } from './types';
|
|
3
|
+
/** The project's Process context (spec 2026-11-10, delivery B): what a report needs that the data can't say — the
|
|
4
|
+
* process in the customer's words (the AI's main context), each channel's role, unit, ranges and limits, the lines,
|
|
5
|
+
* machine units, shifts and planned stops, the costs. Report settings (views, reviewer, approver, schedule) live in the plain `report_settings` row. Stored per project, one version per
|
|
6
|
+
* save, sealed under the project config key in an end-to-end encrypted project. Plain JSON, the same shape in the
|
|
7
|
+
* app, the engine and (delivery C) the report service. */
|
|
8
|
+
export declare const CHANNEL_ROLES: readonly ["setting", "measurement", "quality", "outside", "energy", "ignore"];
|
|
9
|
+
export type ChannelRole = (typeof CHANNEL_ROLES)[number];
|
|
10
|
+
export declare const CHANNEL_ROLE_TEXT: Record<ChannelRole, string>;
|
|
11
|
+
export interface ChannelContext {
|
|
12
|
+
role: ChannelRole | null;
|
|
13
|
+
unit: string;
|
|
14
|
+
/** Expected range (05.1, delivery C/D; learned from the data until then). */
|
|
15
|
+
lo: number | null;
|
|
16
|
+
hi: number | null;
|
|
17
|
+
/** Specification limits and target (04.1). */
|
|
18
|
+
lsl: number | null;
|
|
19
|
+
usl: number | null;
|
|
20
|
+
target: number | null;
|
|
21
|
+
/** The largest offset allowed before the sensor is calibrated, in its units (05.2, later). */
|
|
22
|
+
calibration: number | null;
|
|
23
|
+
/** The role came from Suggest with AI or Fill from data and is not confirmed: the report and the AI ignore it. */
|
|
24
|
+
suggested: boolean;
|
|
25
|
+
/** The unit, or the expected range, came from Fill from data and is not confirmed (ignored the same way). */
|
|
26
|
+
unitSuggested?: true;
|
|
27
|
+
rangeSuggested?: true;
|
|
28
|
+
}
|
|
29
|
+
/** Rows Fill from data proposed carry `suggested` until someone confirms them; the report ignores them until then. */
|
|
30
|
+
export interface Guess {
|
|
31
|
+
suggested?: true;
|
|
32
|
+
}
|
|
33
|
+
/** "HH:MM" local times; a shift whose end is not after its start runs past midnight. */
|
|
34
|
+
export interface Shift extends Guess {
|
|
35
|
+
name: string;
|
|
36
|
+
start: string;
|
|
37
|
+
end: string;
|
|
38
|
+
}
|
|
39
|
+
/** A planned stop: once ("YYYY-MM-DDTHH:MM" local times), or recurring ("HH:MM", every day or only on `days`, Monday 0
|
|
40
|
+
* … Sunday 6; an end not after the start runs past midnight, an equal one makes it the whole day). */
|
|
41
|
+
export interface PlannedStop extends Guess {
|
|
42
|
+
name: string;
|
|
43
|
+
from: string;
|
|
44
|
+
to: string;
|
|
45
|
+
days?: number[];
|
|
46
|
+
}
|
|
47
|
+
export interface ProcessContext {
|
|
48
|
+
v: 1;
|
|
49
|
+
process: string;
|
|
50
|
+
/** The process text is the AI's draft from Fill from data, not confirmed. */
|
|
51
|
+
processSuggested?: true;
|
|
52
|
+
channels: Record<string, ChannelContext>;
|
|
53
|
+
/** Comparable lines (10): a name and the streams that are that line. */
|
|
54
|
+
lines: Array<{
|
|
55
|
+
name: string;
|
|
56
|
+
streams: string[];
|
|
57
|
+
} & Guess>;
|
|
58
|
+
/** Machine units and their channels (05.4, delivery D). */
|
|
59
|
+
units: Array<{
|
|
60
|
+
name: string;
|
|
61
|
+
channels: string[];
|
|
62
|
+
} & Guess>;
|
|
63
|
+
shifts: Shift[];
|
|
64
|
+
/** Planned stops: not lost time in 06. */
|
|
65
|
+
stops: PlannedStop[];
|
|
66
|
+
/** `rework` and `licence` are no longer asked for (2026-11-12: nothing uses them); stored values are kept. */
|
|
67
|
+
costs: {
|
|
68
|
+
currency: string;
|
|
69
|
+
kwh: number | null;
|
|
70
|
+
lineHour: number | null;
|
|
71
|
+
scrap: number | null;
|
|
72
|
+
rework: number | null;
|
|
73
|
+
co2: number | null;
|
|
74
|
+
licence: number | null;
|
|
75
|
+
};
|
|
76
|
+
/** The ideal cycle time in seconds, from one batch's start to the next one's (06's performance). Absent: taken from the data. */
|
|
77
|
+
idealCycleS?: number;
|
|
78
|
+
/** Never compare the shifts with each other (11, 06.2, 02's shift pattern): a comparison of shifts can single out people. */
|
|
79
|
+
hideShifts?: true;
|
|
80
|
+
/** The Ppk a feature is capable from (04.1): 1.33 unless set; 1.67 is what PPAP asks of a new or critical feature. */
|
|
81
|
+
ppkMin?: number;
|
|
82
|
+
/** The industry preset reports are ordered and worded with (presets.ts); absent: the generating person's signup industry. */
|
|
83
|
+
preset?: PresetId;
|
|
84
|
+
}
|
|
85
|
+
export declare const PROCESS_MAX = 4000;
|
|
86
|
+
export declare const emptyChannel: (unit?: string) => ChannelContext;
|
|
87
|
+
export declare const emptyContext: () => ProcessContext;
|
|
88
|
+
/** A channel's role as the report uses it: none until a suggestion is confirmed. */
|
|
89
|
+
export declare const roleOf: (c: ChannelContext | undefined) => ChannelRole | null;
|
|
90
|
+
/** The channel 09 measures energy with: of the confirmed energy channels, the first by name (the engine and the app agree). */
|
|
91
|
+
export declare const energyChannel: (c: ProcessContext | null | undefined) => string | null;
|
|
92
|
+
/** A stored body read back: whatever is unknown or malformed is dropped, so the engine never trusts its shape. */
|
|
93
|
+
export declare function parseContext(raw: unknown): ProcessContext;
|
|
94
|
+
/** The shift `t` falls in, in `tz`; null outside every shift. */
|
|
95
|
+
export declare function shiftOf(t: number, shifts: Shift[], tz: string): string | null;
|
|
96
|
+
/** Monday 0 … Sunday 6 of a "YYYY-MM-DD". */
|
|
97
|
+
export declare const weekday: (day: string) => number;
|
|
98
|
+
/** Planned stops as unix spans in `tz`; a recurring one on each local day of `t0`…`t1` it falls on. */
|
|
99
|
+
export declare function stopSpans(c: ProcessContext, tz: string, t0: number, t1: number): Array<{
|
|
100
|
+
t0: number;
|
|
101
|
+
t1: number;
|
|
102
|
+
}>;
|
|
103
|
+
/** The context reports read: every value Fill from data or Suggest with AI proposed and nobody confirmed left out. */
|
|
104
|
+
export declare function confirmed(c: ProcessContext): ProcessContext;
|
|
105
|
+
/** How many proposed values wait for a confirmation. */
|
|
106
|
+
export declare function suggestedCount(c: ProcessContext): number;
|
|
107
|
+
/** Every proposed value confirmed as it stands. */
|
|
108
|
+
export declare function confirmAll(c: ProcessContext): ProcessContext;
|
|
109
|
+
/** What a missing input keeps out of the report: the section, the short "add …" of the completeness line (null for a
|
|
110
|
+
* part of a section), and the sentence section 14 shows. */
|
|
111
|
+
export interface ContextGap {
|
|
112
|
+
section: SectionId;
|
|
113
|
+
add: string | null;
|
|
114
|
+
needs: string;
|
|
115
|
+
}
|
|
116
|
+
export declare function contextGaps(ctx: ProcessContext | null, alertRules: number): ContextGap[];
|
|
117
|
+
/** What would put money in the reports (the Process context tab's first line): each cost not set yet and what it shows.
|
|
118
|
+
* The scrap cost is asked for only once something says which batches are scrap (a specification limit). */
|
|
119
|
+
export declare function moneyGaps(ctx: ProcessContext | null): Array<{
|
|
120
|
+
add: string;
|
|
121
|
+
shows: string;
|
|
122
|
+
}>;
|
|
123
|
+
/** "7 of 15 report sections ready" and what to add for the rest (the sections a missing input keeps out). */
|
|
124
|
+
export declare function completeness(ctx: ProcessContext | null, alertRules: number): {
|
|
125
|
+
ready: number;
|
|
126
|
+
total: number;
|
|
127
|
+
adds: Array<{
|
|
128
|
+
add: string;
|
|
129
|
+
sections: SectionId[];
|
|
130
|
+
}>;
|
|
131
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Part } from './parts';
|
|
2
|
+
import type { Classified, ReportInput } from './types';
|
|
3
|
+
/** 04.3 (2026-11-13): with no specification limits in Process context there is no capability to compute, so 04 looks
|
|
4
|
+
* at the process's own voice instead: an individuals control chart (Shewhart) per stream of each level KPI (mean,
|
|
5
|
+
* minimum, maximum, at start, at end) of the channels a batch is judged by. Centre line = the mean; σ from the average
|
|
6
|
+
* moving range (MR̄ / 1.128), so a slow drift doesn't widen its own limits; limits = mean ± 3σ. A KPI is named only
|
|
7
|
+
* when its batches leave the limits more than chance would (a stable process leaves 3σ limits 0.27% of the time): more
|
|
8
|
+
* than twice that share, and at least one batch. It says the process moved, never that a batch is bad: only
|
|
9
|
+
* specification limits say that. */
|
|
10
|
+
export declare const CONTROL_MIN = 30;
|
|
11
|
+
export declare const CONTROL_CHANCE = 0.0027;
|
|
12
|
+
export declare const CONTROL_SHOWN = 3;
|
|
13
|
+
export declare function controlPart(input: ReportInput, pop: Classified[]): Part | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Classified, type Missing, type ReportInput, type SectionOut } from './types';
|
|
2
|
+
/** What the CO₂ figure is: purchased electricity at the grid's average factor, as the customer entered it. Never a claim of a certified footprint. */
|
|
3
|
+
export declare const CO2_BASIS = "Scope 2, location-based, factor entered by you";
|
|
4
|
+
export declare function energy(input: ReportInput, pop: Classified[]): SectionOut | Missing | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Classified, type ReportInput, type SectionOut } from './types';
|
|
2
|
+
/** Section 02 (spec 2026-11-10): which deviations from the golden go with the gap, and when batches miss it. The shares
|
|
3
|
+
* are observational (correlation), the patterns tests between groups of batches. */
|
|
4
|
+
export declare const STOP_S = 1800;
|
|
5
|
+
export declare const WARM_S = 2400;
|
|
6
|
+
export declare const MAX_FEATURES = 8;
|
|
7
|
+
export declare const DAYS: string[];
|
|
8
|
+
export declare function whyOff(input: ReportInput, pop: Classified[]): SectionOut;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Classified, GoldenIn, ReportInput } from './types';
|
|
2
|
+
/** Batches against their stream's golden (spec 2026-11-10 decision 1: "every batch at golden level or better"). */
|
|
3
|
+
export declare const OFF_GOLDEN_PCT = 2;
|
|
4
|
+
/** Significance for every difference the report states, and the smallest group it compares. */
|
|
5
|
+
export declare const ALPHA = 0.01;
|
|
6
|
+
export declare const MIN_GROUP = 5;
|
|
7
|
+
/** A golden nobody set is the best value the process reaches again and again: 1 batch in 20, and never fewer than
|
|
8
|
+
* MIN_GROUP. Among a month of a fast machine's cycles the 5th best is a fluke, not a level it holds: every normal cycle
|
|
9
|
+
* would miss it. Up to 100 batches this is the 5th best, as before. */
|
|
10
|
+
export declare const GOLDEN_SHARE = 0.05;
|
|
11
|
+
export declare const goldenRank: (n: number) => number;
|
|
12
|
+
/** Trends are fitted on daily means (batches of one day are not independent), over at least this many days. */
|
|
13
|
+
export declare const MIN_DAYS = 7;
|
|
14
|
+
/** How much worse than the golden a batch may be and still be at golden level: 2 % of the golden's value, or twice
|
|
15
|
+
* the spread of the golden's own batches (an envelope's), whichever is larger, so the golden's noise isn't a miss. */
|
|
16
|
+
export declare const margin: (g: Pick<GoldenIn, "value" | "spread">) => number;
|
|
17
|
+
/** The batches that can be judged (closed, with a value, not excluded, on a stream with a golden), in time order. */
|
|
18
|
+
export declare function classify(input: ReportInput): Classified[];
|
|
19
|
+
/** Only finite numbers (JSON has no NaN or Infinity). */
|
|
20
|
+
export declare const finite: (o: Record<string, number>) => Record<string, number>;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/** Sensor health of one channel in one recording (spec 2026-11-10, section 05.1), measured once in one streaming pass
|
|
2
|
+
* (chunk by chunk, any length) and stored with the recording. Every threshold is a named constant the report's
|
|
3
|
+
* method section quotes. */
|
|
4
|
+
export declare const FLAT_MIN_S = 300;
|
|
5
|
+
export declare const FLAT_MIN_N = 20;
|
|
6
|
+
export declare const FLAT_TOL = 0.2;
|
|
7
|
+
export declare const GAP_FACTOR = 4;
|
|
8
|
+
export declare const NOISE_WINDOW = 64;
|
|
9
|
+
export declare const HAMPEL_HALF = 5;
|
|
10
|
+
export declare const HAMPEL_K = 6;
|
|
11
|
+
export interface ChannelHealth {
|
|
12
|
+
/** Finite samples. */
|
|
13
|
+
n: number;
|
|
14
|
+
/** Samples a second over the time outside gaps (several samples on one timestamp count). */
|
|
15
|
+
rateHz: number;
|
|
16
|
+
/** Time lost in gaps (each gap's step less the usual step) and how many. The usual step is the median of the
|
|
17
|
+
* positive steps among the first 1,000; a gap is a step over 4× it. A later rate change shows as a rate drop
|
|
18
|
+
* across recordings. */
|
|
19
|
+
gapS: number;
|
|
20
|
+
gaps: number;
|
|
21
|
+
/** Runs of one repeated value, within FLAT_TOL of the noise σ (≥ FLAT_MIN_S and FLAT_MIN_N; the first 20 kept), their
|
|
22
|
+
* total and count. */
|
|
23
|
+
flatS: number;
|
|
24
|
+
flatRuns: number;
|
|
25
|
+
flats: Array<{
|
|
26
|
+
t0: number;
|
|
27
|
+
t1: number;
|
|
28
|
+
value: number;
|
|
29
|
+
}>;
|
|
30
|
+
/** The sample noise σ: median over windows that move of MAD(first differences) / √2. */
|
|
31
|
+
noise: number;
|
|
32
|
+
/** Hampel outliers that stand alone (a step is not a spike); the first 20 times kept. */
|
|
33
|
+
spikes: number;
|
|
34
|
+
spikeAt: number[];
|
|
35
|
+
/** Extremes, and the 0.5 %, 50 % and 99.5 % quantiles of ≤ 100,000 samples drawn at random (a reservoir). */
|
|
36
|
+
min: number;
|
|
37
|
+
max: number;
|
|
38
|
+
lo: number;
|
|
39
|
+
hi: number;
|
|
40
|
+
median: number;
|
|
41
|
+
/** The 1 % and 99 % quantiles of the same sample: the observed range Fill from data proposes. Absent in health
|
|
42
|
+
* measured before they were added (readers fall back to lo and hi). */
|
|
43
|
+
p01?: number;
|
|
44
|
+
p99?: number;
|
|
45
|
+
/** The value changes at all (a channel that never moves, a setpoint, can't be stuck). */
|
|
46
|
+
moves: boolean;
|
|
47
|
+
/** A clock, not a sensor: the value never falls and rises with the timestamp (within 1 %), in epoch or elapsed
|
|
48
|
+
* seconds. Absent in health measured before it was added. */
|
|
49
|
+
clock?: boolean;
|
|
50
|
+
/** A counter, not a level: it moves and never falls (an energy meter, a part count). Its offset from a golden only
|
|
51
|
+
* says how long the meter has been counting, so it is never compared, drift-checked or called stuck. Absent in
|
|
52
|
+
* health measured before it was added. */
|
|
53
|
+
counter?: boolean;
|
|
54
|
+
}
|
|
55
|
+
export interface RecordingHealth {
|
|
56
|
+
v: 1;
|
|
57
|
+
channels: Record<string, ChannelHealth>;
|
|
58
|
+
}
|
|
59
|
+
/** One channel's health, fed chunk by chunk in time order (NaN samples skipped). */
|
|
60
|
+
export declare class HealthAcc {
|
|
61
|
+
#private;
|
|
62
|
+
push(t: ArrayLike<number>, y: ArrayLike<number>): void;
|
|
63
|
+
/** The channel's health; call once, after the last chunk. */
|
|
64
|
+
result(): ChannelHealth;
|
|
65
|
+
}
|
|
66
|
+
/** A channel's usual range (05.1's health check), from its health per recording, oldest first:
|
|
67
|
+
* learned from the first third of the recordings (at least 3, so a later drift can't widen it), their median
|
|
68
|
+
* 0.5–99.5 % range widened by half its width on each side. Null when the channel doesn't move. */
|
|
69
|
+
export declare function usualRange(hs: Array<Pick<ChannelHealth, 'lo' | 'hi'>>): {
|
|
70
|
+
lo: number;
|
|
71
|
+
hi: number;
|
|
72
|
+
n: number;
|
|
73
|
+
} | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** Production reports (spec 2026-11-10-production-reports-design, delivery A): the analysis engine. Pure TypeScript,
|
|
2
|
+
* runs in the browser now and in the report service later (delivery C). The SDK root exports it as the `analysis`
|
|
3
|
+
* namespace, plus the few names the app's viewer and PDF use. */
|
|
4
|
+
export { buildReport, listedFindings, viewSections } from './report';
|
|
5
|
+
export { AI_NOTE, AI_SENTENCES, AI_WORDS, aiInput, applyAi, type AiInput, type AiSentence, type AiText } from './ai';
|
|
6
|
+
export { CHANNEL_ROLES, CHANNEL_ROLE_TEXT, PROCESS_MAX, completeness, confirmAll, confirmed, contextGaps, moneyGaps, emptyChannel, emptyContext, energyChannel, parseContext, roleOf, shiftOf, stopSpans, suggestedCount, type PlannedStop, type ChannelContext, type ChannelRole, type ContextGap, type ProcessContext, type Shift, } from './context';
|
|
7
|
+
export { HealthAcc, usualRange, type ChannelHealth, type RecordingHealth } from './health';
|
|
8
|
+
export { applyInferred, assumedSections, inferContext, type InferInput, type InferRecording, type InferStream, type Inferred } from './infer';
|
|
9
|
+
export { classify, goldenRank, ALPHA, GOLDEN_SHARE, MIN_GROUP, OFF_GOLDEN_PCT } from './golden';
|
|
10
|
+
export { dateText, dateTimeText, evidenceLabel, exact, num, pText, pct1, spanText } from './text';
|
|
11
|
+
export { PRESETS, PRESET_IDS, applyPreset, namesOf, presetForIndustry, presetOf, term, type Preset, type PresetId } from './presets';
|
|
12
|
+
export { EVIDENCE_TEXT, REPORT_ROLES, SECTION_ROLES, SECTION_TITLES, type AlertIn, type CycleIn, type Evidence, type Finding, type GoldenIn, type Missing, type RecordingIn, type ReportAction, type ReportChart, type ReportCover, type ReportDoc, type ReportInput, type ReportRole, type ReportSection, type SectionId, } from './types';
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type PlannedStop, type ProcessContext, type Shift } from './context';
|
|
2
|
+
import { type ChannelHealth } from './health';
|
|
3
|
+
/** Fill from data (Process context, delivery B): what the project's recordings already say about the line — units,
|
|
4
|
+
* expected ranges, the energy channel, shifts and planned stops, comparable lines and machine units — proposed from
|
|
5
|
+
* compact summaries (times, channel declarations, stored sensor health), never from samples. Every value it returns is
|
|
6
|
+
* a proposal: `applyInferred` puts it only where the context is empty and marks it suggested. */
|
|
7
|
+
export interface InferRecording {
|
|
8
|
+
streamId: string;
|
|
9
|
+
t0: number;
|
|
10
|
+
t1: number;
|
|
11
|
+
batches: Array<[number, number]>;
|
|
12
|
+
}
|
|
13
|
+
export interface InferStream {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
channels: Array<{
|
|
17
|
+
name: string;
|
|
18
|
+
unit: string;
|
|
19
|
+
}>;
|
|
20
|
+
rule: string | null;
|
|
21
|
+
}
|
|
22
|
+
export interface InferInput {
|
|
23
|
+
tz: string;
|
|
24
|
+
streams: InferStream[];
|
|
25
|
+
recordings: InferRecording[];
|
|
26
|
+
/** Each channel's sensor health per recording, oldest first. */
|
|
27
|
+
health: Record<string, Array<Pick<ChannelHealth, 'lo' | 'hi'> & Partial<Pick<ChannelHealth, 'clock' | 'moves' | 'p01' | 'p99' | 'noise' | 'flatS' | 'flatRuns' | 'n' | 'rateHz'>>>>;
|
|
28
|
+
}
|
|
29
|
+
export interface Inferred {
|
|
30
|
+
units: Record<string, string>;
|
|
31
|
+
ranges: Record<string, {
|
|
32
|
+
lo: number;
|
|
33
|
+
hi: number;
|
|
34
|
+
}>;
|
|
35
|
+
energy: string[];
|
|
36
|
+
/** Adjustable settings: channels with no noise that hold one value nearly all the time (a setpoint, a recipe number). */
|
|
37
|
+
settings: string[];
|
|
38
|
+
shifts: Shift[];
|
|
39
|
+
stops: PlannedStop[];
|
|
40
|
+
lines: Array<{
|
|
41
|
+
name: string;
|
|
42
|
+
streams: string[];
|
|
43
|
+
}>;
|
|
44
|
+
machines: Array<{
|
|
45
|
+
name: string;
|
|
46
|
+
channels: string[];
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
49
|
+
export declare const BIN_S = 300;
|
|
50
|
+
export declare const BRIDGE_S = 600;
|
|
51
|
+
export declare const BUSY = 0.5;
|
|
52
|
+
export declare const CLEAR_BUSY = 0.7;
|
|
53
|
+
export declare const CLEAR_IDLE = 0.25;
|
|
54
|
+
export declare const MIN_DAYS = 3;
|
|
55
|
+
export declare const GAP_MIN_S = 600;
|
|
56
|
+
export declare const GAP_MAX_S: number;
|
|
57
|
+
export declare const MIN_SHIFT_S: number;
|
|
58
|
+
export declare const ENERGY_UNIT: RegExp;
|
|
59
|
+
export declare const SETTING_PER_BATCH = 0.5, SETTING_MIN_BATCHES = 10;
|
|
60
|
+
export declare const SETTING_HELD = 0.9;
|
|
61
|
+
export declare function inferContext(input: InferInput): Inferred;
|
|
62
|
+
/** The proposals put into the context only where it is empty, each marked suggested (the report ignores them until
|
|
63
|
+
* someone confirms them). Nothing anyone set is changed. */
|
|
64
|
+
export declare function applyInferred(ctx: ProcessContext, f: Inferred): ProcessContext;
|
|
65
|
+
/** What a context with Fill from data's proposals (applyInferred) assumes that nobody confirmed, per report section that
|
|
66
|
+
* uses it: shifts (02.4, 05 stops, 06 OEE, 11), planned stops (05, 06), lines (10), machine units (05), the energy
|
|
67
|
+
* channel (09), the adjustable settings (08). The report uses these as set (user 2026-11-12) and says so on each section. */
|
|
68
|
+
export declare function assumedSections(c: ProcessContext): Map<string, string[]>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Classified, type ReportInput, type SectionOut } from './types';
|
|
2
|
+
/** Section 10 (spec 2026-11-10): the lines named in Process context (each a set of this project's streams) side by
|
|
3
|
+
* side, each measured against its own streams' goldens: batches, the share at golden level or better and the share
|
|
4
|
+
* better than the golden; a line that runs off-golden more (or less) often than the other lines (two-proportion
|
|
5
|
+
* test, Benjamini–Hochberg at q = 0.01 across lines). */
|
|
6
|
+
export declare function lines(input: ReportInput, pop: Classified[]): SectionOut | null;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ReportChart, ReportInput, SectionId } from './types';
|
|
2
|
+
/** 00.1 · Where the money goes: every loss the period's sections measured, in one ranked list. Time losses (06's stops,
|
|
3
|
+
* slow batches and off-golden batches; without 06, the stops of 05.4 and the time over the golden) count in money with
|
|
4
|
+
* the cost of an hour of line time, else in hours; the energy off-golden batches use beyond the rest (09's F09-2) at
|
|
5
|
+
* the price per kWh. Bad parts are one row: the line time of the batches outside their limits or flagged bad (06's
|
|
6
|
+
* third loss when the value to compare is the cycle time) plus their material at the cost of a scrapped batch; when
|
|
7
|
+
* that third loss is the off-golden batches, their time is its own row and Bad parts is the material alone. The batches to check before they
|
|
8
|
+
* ship (04.2) are what is at risk, not a loss yet, and off-golden batches counted as scrap for want of limits are an
|
|
9
|
+
* assumption: both are listed last and left out of the total. The total is what running without stops at golden level
|
|
10
|
+
* would recover, so it reads "up to". A row under a minute, under one unit of the currency or, in money, under half a
|
|
11
|
+
* percent of the whole (it would read 0%) is left out. */
|
|
12
|
+
export interface LossesIn {
|
|
13
|
+
/** `bad`: the line time of the batches `scrap` counts (outside their limits or flagged bad): one row with their material. */
|
|
14
|
+
time: Array<{
|
|
15
|
+
label: string;
|
|
16
|
+
s: number;
|
|
17
|
+
owner: string;
|
|
18
|
+
ref: SectionId;
|
|
19
|
+
bad?: true;
|
|
20
|
+
}>;
|
|
21
|
+
/** kWh the off-golden batches used beyond the rest. */
|
|
22
|
+
energyKwh: number | null;
|
|
23
|
+
/** 04.2: the batches made while a sensor was failing, and the time they took. */
|
|
24
|
+
review: {
|
|
25
|
+
batches: number;
|
|
26
|
+
s: number;
|
|
27
|
+
} | null;
|
|
28
|
+
/** Batches to count as scrap: outside their specification limits or flagged bad (measured). `assumed`: nothing says
|
|
29
|
+
* which batches are scrap, so the off-golden ones stand in (never when the value to compare is the cycle time: a slow
|
|
30
|
+
* batch is not scrap). Valued at the Process context's cost of a scrapped batch. */
|
|
31
|
+
scrap?: {
|
|
32
|
+
batches: number;
|
|
33
|
+
assumed: boolean;
|
|
34
|
+
} | null;
|
|
35
|
+
}
|
|
36
|
+
export declare const LOSS_MIN_S = 60;
|
|
37
|
+
export declare const LOSS_MIN_MONEY = 1;
|
|
38
|
+
export declare const LOSS_MIN_SHARE = 0.005;
|
|
39
|
+
export declare function lossesChart(input: ReportInput, o: LossesIn): Extract<ReportChart, {
|
|
40
|
+
kind: 'losses';
|
|
41
|
+
}> | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Part } from './parts';
|
|
2
|
+
import type { Drift, Wear } from './reliability';
|
|
3
|
+
import type { ReportInput } from './types';
|
|
4
|
+
/** 05.5 (delivery D revised 2026-11-11): the drift crossings (05.2) and the wear (05.3) as work to plan, each by the
|
|
5
|
+
* lower bound of its crossing's interval (the conservative date) and placed in the latest planned stop before it. No
|
|
6
|
+
* actions: the 05.2 and 05.3 findings already seed them. */
|
|
7
|
+
export declare const PLAN_AHEAD_D = 90;
|
|
8
|
+
export declare function maintenancePart(input: ReportInput, drifts: Drift[], wear: Wear | null): Part | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ProcessContext } from './context';
|
|
2
|
+
import { type Stop } from './stops';
|
|
3
|
+
import { type Classified, type ReportInput, type SectionOut } from './types';
|
|
4
|
+
/** Section 06 (spec 2026-11-10; the ratios as ISO 22400-2 since 2026-11-12): OEE by day and shift. Planned time is the
|
|
5
|
+
* recorded time inside the shifts, less planned stops, plus the stops with no data between recordings (05.4's, so 05.4,
|
|
6
|
+
* 06 and 11 agree), in 15-minute blocks, each given to the shift and day it starts in.
|
|
7
|
+
* Availability = the time not stopped / planned time, the stops being 05.4's (no data, or no batch for 5 minutes or
|
|
8
|
+
* more). Performance = the ideal cycle × batches / the time not stopped (at most 1); the ideal cycle runs from one
|
|
9
|
+
* batch's start to the next one's: the golden's cycle time plus the shortest wait between batches the line reaches again
|
|
10
|
+
* and again (1 wait in 20), so the handling a machine needs between two strokes is no loss, and a wait longer than that
|
|
11
|
+
* is. An ideal cycle time set in Process context replaces that one, for every stream. Quality = good batches / batches: not flagged bad and inside the specification limits; when the value to compare
|
|
12
|
+
* is not the cycle time, also at golden level or better (a slow batch is a performance loss, not a bad batch).
|
|
13
|
+
* What is lost, in hours of planned time (and money with the cost of an hour). */
|
|
14
|
+
export declare const BLOCK_S = 900;
|
|
15
|
+
/** The channels with specification limits, and whether a batch's KPIs (mean, minimum, maximum, at start, at end of such
|
|
16
|
+
* a channel) fall outside them: what makes a batch bad in 06 and scrap in 00.1. */
|
|
17
|
+
export declare function specCheck(ctx: ProcessContext | null | undefined): {
|
|
18
|
+
limits: [string, import("./context").ChannelContext][];
|
|
19
|
+
outside: (kpis: Record<string, number | null>) => boolean;
|
|
20
|
+
};
|
|
21
|
+
/** What 06 follows, under its title: the ratios are the standard's; a report supports a review, it certifies nothing. */
|
|
22
|
+
export declare const OEE_STANDARD: string;
|
|
23
|
+
/** The three losses of planned time (06.1 and 00.1); the third is `bad` when the value to compare is the cycle time. */
|
|
24
|
+
export declare const LOSS_LABELS: {
|
|
25
|
+
stops: string;
|
|
26
|
+
slow: string;
|
|
27
|
+
bad: string;
|
|
28
|
+
off: string;
|
|
29
|
+
};
|
|
30
|
+
export declare function oee(input: ReportInput, pop: Classified[], gaps?: Stop[]): SectionOut | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ActionSeed, type Finding, type ReportChart, type ReportSection } from './types';
|
|
2
|
+
/** What a sub-section (05.4, 04.2, …) adds to a section made elsewhere. */
|
|
3
|
+
export interface Part {
|
|
4
|
+
findings: Finding[];
|
|
5
|
+
charts: ReportChart[];
|
|
6
|
+
notes: string[];
|
|
7
|
+
actions: ActionSeed[];
|
|
8
|
+
next: string[];
|
|
9
|
+
}
|
|
10
|
+
export declare const emptyPart: () => Part;
|
|
11
|
+
/** The section with the parts' findings, charts and notes after its own (charts ordered by their "NN.N ·" title); past
|
|
12
|
+
* SHOWN_FINDINGS the rest fold, as in makeSection. */
|
|
13
|
+
export declare function withParts(s: ReportSection, parts: Part[]): ReportSection;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReportDoc, ReportInput, ReportRole, SectionId } from './types';
|
|
2
|
+
/** Industry presets (2026-11-13): one engine, read the way an industry reads it. A preset is data: which sections come
|
|
3
|
+
* first, which start folded, who each section is for and the words a report uses. `applyPreset` runs after
|
|
4
|
+
* `buildReport` and never touches a number: the same findings, ids, evidence and amounts, in another order and
|
|
5
|
+
* vocabulary. "generic" is the report as it always was (applying it returns the document unchanged). None of the
|
|
6
|
+
* signup industries (src/lib/industries.ts) is a regulated one, so "regulated" is only ever chosen in Process context. */
|
|
7
|
+
export declare const PRESET_IDS: readonly ["generic", "discrete", "process", "regulated"];
|
|
8
|
+
export type PresetId = (typeof PRESET_IDS)[number];
|
|
9
|
+
export interface Preset {
|
|
10
|
+
id: PresetId;
|
|
11
|
+
label: string;
|
|
12
|
+
/** The sections that lead, in this order, after the summary; the others follow by number. */
|
|
13
|
+
first: SectionId[];
|
|
14
|
+
/** Sections that start as their verdict alone, the rest one press away (in the app; the PDF prints them whole). */
|
|
15
|
+
collapsed: SectionId[];
|
|
16
|
+
/** Who a section is for, where it differs from the engine's (SECTION_ROLES). */
|
|
17
|
+
roles: Partial<Record<SectionId, ReportRole[]>>;
|
|
18
|
+
/** The report's words in this industry, lower case, whole words or phrases ("batches" → "parts"). */
|
|
19
|
+
terms: Record<string, string>;
|
|
20
|
+
/** A regulated industry (pharma, food): a project that takes this style starts with AI writing off (a lead can turn it on). */
|
|
21
|
+
regulated?: true;
|
|
22
|
+
}
|
|
23
|
+
export declare const PRESETS: Record<PresetId, Preset>;
|
|
24
|
+
export declare const presetOf: (id: unknown) => Preset;
|
|
25
|
+
/** The preset a signup industry (src/lib/industries.ts) starts with; a project changes it in its Process context. */
|
|
26
|
+
export declare const presetForIndustry: (industry: unknown) => PresetId;
|
|
27
|
+
/** `text` in the preset's vocabulary: whole words and phrases, a capital kept ("Batches" → "Parts"); never inside a
|
|
28
|
+
* longer name ("batch_temp", "Batch.id"). `keep`: names the customer chose (a stream "Batch reactor", a rule
|
|
29
|
+
* "Batch cycle"), left as they are. */
|
|
30
|
+
export declare function term(text: string, preset: Preset, keep?: string[]): string;
|
|
31
|
+
/** The names a customer chose that a report can print: never reworded. */
|
|
32
|
+
export declare function namesOf(input: ReportInput): string[];
|
|
33
|
+
/** The document as the preset reads it: its sections in the preset's order with its role views and folds, its text in
|
|
34
|
+
* its vocabulary, and the preset's id for the views' own words. Pure; numbers, ids and evidence are never touched. */
|
|
35
|
+
export declare function applyPreset(doc: ReportDoc, preset: Preset, keep?: string[]): ReportDoc;
|