@operato/twin-kernel 0.11.29 → 0.11.30
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/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/mes-kernel.d.ts +5 -0
- package/dist/mes-kernel.js +11 -2
- package/dist-cjs/index.cjs +8 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export * from './runtime.ts';
|
|
|
13
13
|
export * from './flow-engine.ts';
|
|
14
14
|
export { WmsKernel } from './kernel.ts';
|
|
15
15
|
export { YmsKernel } from './yms-kernel.ts';
|
|
16
|
-
export { MesKernel } from './mes-kernel.ts';
|
|
16
|
+
export { MesKernel, TWIN_MODEL_NO_PRODUCTION_SPEC } from './mes-kernel.ts';
|
|
17
17
|
export { EmsKernel, DEMAND_WINDOW_MS, demandWindowStart } from './ems-kernel.ts';
|
|
18
18
|
export * from './energy-attribution.ts';
|
|
19
19
|
export * from './make-to-order.ts';
|
package/dist/index.js
CHANGED
|
@@ -27,7 +27,7 @@ export * from "./runtime.js";
|
|
|
27
27
|
export * from "./flow-engine.js";
|
|
28
28
|
export { WmsKernel } from "./kernel.js";
|
|
29
29
|
export { YmsKernel } from "./yms-kernel.js";
|
|
30
|
-
export { MesKernel } from "./mes-kernel.js";
|
|
30
|
+
export { MesKernel, TWIN_MODEL_NO_PRODUCTION_SPEC } from "./mes-kernel.js";
|
|
31
31
|
export { EmsKernel, DEMAND_WINDOW_MS, demandWindowStart } from "./ems-kernel.js";
|
|
32
32
|
export * from "./energy-attribution.js";
|
|
33
33
|
export * from "./make-to-order.js";
|
package/dist/mes-kernel.d.ts
CHANGED
|
@@ -3,6 +3,11 @@ import type { AllocationPolicy } from './allocation-policy.ts';
|
|
|
3
3
|
import { FlowEngine } from './flow-engine.ts';
|
|
4
4
|
import type { FlowOrder, FlowTask } from './flow-engine.ts';
|
|
5
5
|
import { type OpMaterialSpecification } from '@operato/ops-contract';
|
|
6
|
+
/**
|
|
7
|
+
* A MES twin model without a production declaration. The kernel refuses to load it, carrying this code
|
|
8
|
+
* and `params` on the error so a host can turn it into a sentence the reader can read (ADR-0054).
|
|
9
|
+
*/
|
|
10
|
+
export declare const TWIN_MODEL_NO_PRODUCTION_SPEC = "twin-model-no-production-spec";
|
|
6
11
|
export declare class MesKernel extends FlowEngine {
|
|
7
12
|
private wipSeq;
|
|
8
13
|
private prodSeq;
|
package/dist/mes-kernel.js
CHANGED
|
@@ -22,6 +22,11 @@ const DEFAULT_SETUP_MS = 15_000; // 체인지오버(제품 전환) 셋업 — OE
|
|
|
22
22
|
// MES 도메인 커맨드(Tier 2, 무방언 — MES 어휘는 MES 커널 소유). handleCommand 로 처리.
|
|
23
23
|
const MES_CMD = { changeover: 'mes.changeover' };
|
|
24
24
|
const DEFAULT_YIELD = 0.8; // 양품률 기본값 — 현장 값은 OperationDef.parameters(OP_PARAM.yield) 로 온다
|
|
25
|
+
/**
|
|
26
|
+
* A MES twin model without a production declaration. The kernel refuses to load it, carrying this code
|
|
27
|
+
* and `params` on the error so a host can turn it into a sentence the reader can read (ADR-0054).
|
|
28
|
+
*/
|
|
29
|
+
export const TWIN_MODEL_NO_PRODUCTION_SPEC = 'twin-model-no-production-spec';
|
|
25
30
|
/*
|
|
26
31
|
* 정의-구동 모드 스펙은 **계약의 `ProductionSpec`** 이다(`contract.ts`).
|
|
27
32
|
*
|
|
@@ -269,8 +274,12 @@ export class MesKernel extends FlowEngine {
|
|
|
269
274
|
* 그 상수가 모델에 없는 품목을 만들어 냈다. 그 경로를 제거했으므로 선언은 이제 필수다.
|
|
270
275
|
*/
|
|
271
276
|
if (!this.productionSpec) {
|
|
272
|
-
|
|
273
|
-
|
|
277
|
+
/*
|
|
278
|
+
* A refusal with a name, not a crash: the model is what is wrong, and the host has to be able to
|
|
279
|
+
* say so in the reader's language (ADR-0054). The English sentence is the fallback and the log line.
|
|
280
|
+
*/
|
|
281
|
+
throw Object.assign(new Error('MES twin requires a production declaration (ProductionSpec): materials, routes and recipes. ' +
|
|
282
|
+
'The kernel no longer carries a built-in demo product — what is made is decided by the model.'), { code: TWIN_MODEL_NO_PRODUCTION_SPEC, params: {} });
|
|
274
283
|
}
|
|
275
284
|
const have = new Set([...this.locations.values()].map(l => l.type));
|
|
276
285
|
const decl = this.productionSpec.definition;
|
package/dist-cjs/index.cjs
CHANGED
|
@@ -32,6 +32,7 @@ __export(index_exports, {
|
|
|
32
32
|
OPERATION_PROPERTY: () => OPERATION_PROPERTY,
|
|
33
33
|
ObservedReducer: () => ObservedReducer,
|
|
34
34
|
StateProjector: () => ObservedReducer,
|
|
35
|
+
TWIN_MODEL_NO_PRODUCTION_SPEC: () => TWIN_MODEL_NO_PRODUCTION_SPEC,
|
|
35
36
|
TwinHistory: () => TwinHistory,
|
|
36
37
|
TwinObserver: () => TwinObserver,
|
|
37
38
|
TwinRuntime: () => TwinRuntime,
|
|
@@ -8205,6 +8206,7 @@ var DEFAULT_CYCLE_MS = 4e4;
|
|
|
8205
8206
|
var DEFAULT_SETUP_MS = 15e3;
|
|
8206
8207
|
var MES_CMD = { changeover: "mes.changeover" };
|
|
8207
8208
|
var DEFAULT_YIELD = 0.8;
|
|
8209
|
+
var TWIN_MODEL_NO_PRODUCTION_SPEC = "twin-model-no-production-spec";
|
|
8208
8210
|
var MesKernel = class extends FlowEngine {
|
|
8209
8211
|
wipSeq = 0;
|
|
8210
8212
|
prodSeq = 0;
|
|
@@ -8393,8 +8395,11 @@ The steps are the source of truth for execution order; the hierarchy only names
|
|
|
8393
8395
|
loadTwinModel(def) {
|
|
8394
8396
|
super.loadTwinModel(def);
|
|
8395
8397
|
if (!this.productionSpec) {
|
|
8396
|
-
throw
|
|
8397
|
-
|
|
8398
|
+
throw Object.assign(
|
|
8399
|
+
new Error(
|
|
8400
|
+
"MES twin requires a production declaration (ProductionSpec): materials, routes and recipes. The kernel no longer carries a built-in demo product \u2014 what is made is decided by the model."
|
|
8401
|
+
),
|
|
8402
|
+
{ code: TWIN_MODEL_NO_PRODUCTION_SPEC, params: {} }
|
|
8398
8403
|
);
|
|
8399
8404
|
}
|
|
8400
8405
|
const have = new Set([...this.locations.values()].map((l) => l.type));
|
|
@@ -10628,6 +10633,7 @@ function electricityCost(input) {
|
|
|
10628
10633
|
OPERATION_PROPERTY,
|
|
10629
10634
|
ObservedReducer,
|
|
10630
10635
|
StateProjector,
|
|
10636
|
+
TWIN_MODEL_NO_PRODUCTION_SPEC,
|
|
10631
10637
|
TwinHistory,
|
|
10632
10638
|
TwinObserver,
|
|
10633
10639
|
TwinRuntime,
|
package/package.json
CHANGED