busroot-sdk 0.0.8-dev.2794844917 → 0.0.8-dev.2797946662

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.
Files changed (2) hide show
  1. package/build/index.js +15 -9
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -762,14 +762,14 @@ var require_base_station = __commonJS({
762
762
  idleCostPerMinute: zod_1.z.number().gte(0).lte(99999).nullish().describe("Idle Cost Per Minute: Cost per minute during idle time in account currency. Used for calculating scheduling losses, planned non-production losses, and downtime losses when SKU doesn't have a specific value."),
763
763
  // Downtime Settings
764
764
  downtimeDetectionMode: zod_1.z.nativeEnum(enums_1.DOWNTIME_DETECTION_MODE).default(enums_1.DOWNTIME_DETECTION_MODE.UTILISATION).nullish().describe("Downtime Detection Mode: How to detect when the station is down. Options: 'off' (no detection), 'production' (use production cycle data), 'utilisation' (use utilisation signals - most common), 'line_speed' (use line speed monitoring). Default: 'utilisation'"),
765
- utilisationDowntimeThreshold: zod_1.z.number().int().gte(0).nullish().describe("Utilisation Downtime Threshold: Minimum period in minutes before registering downtime. Only stops longer than this threshold will be recorded. Defaults to 1 hour when not set; see DEFAULT_UTILISATION_DOWNTIME_THRESHOLD in cache-builder."),
765
+ utilisationDowntimeThreshold: zod_1.z.number().int().gte(0).nullish().describe("Utilisation Downtime Threshold: Minimum stop duration in milliseconds before registering downtime \u2014 only stops longer than this are recorded. Example: 120000 (2 minutes), 900000 (15 minutes). The admin UI presents this value in minutes. Defaults to 1 hour when not set; see DEFAULT_UTILISATION_DOWNTIME_THRESHOLD in cache-builder."),
766
766
  slowDurationThreshold: zod_1.z.number().int().gte(0).nullish().describe("Slow Duration Threshold: Duration threshold in milliseconds for detecting slow operation"),
767
767
  forceAllShiftTimeAsPlannedProduction: zod_1.z.boolean().nullish().describe("Force All Shift Time As Planned Production: Treat all shift time as planned production time"),
768
768
  // Productive Settings
769
769
  productiveStatusMode: zod_1.z.nativeEnum(enums_1.PRODUCTIVE_STATUS_MODE).default(enums_1.PRODUCTIVE_STATUS_MODE.PRODUCTIVE_SIGNAL).nullish().describe("Productive Status Mode: How to measure when the station is engaged in value-adding activity. Options: 'productive_signal' (use productive signal input), 'electrical_usage' (use electrical consumption), 'line_speed' (use line speed value). Default: 'productive_signal'"),
770
770
  electricalUsageStoppedThresholdKw: zod_1.z.number().gte(0).nullish().describe("Electrical Usage Stopped Threshold (kW): Minimum power consumption in kilowatts that indicates the station is active. Below this threshold, Busroot will regard the station as stopped/downtime. Example: 2.0, 1.0, 5.0"),
771
771
  lineSpeedStoppedThreshold: zod_1.z.number().gte(0).nullish().describe("Line Speed Stopped Threshold: Minimum speed value that indicates the station is running. Below this threshold, Busroot will regard the station as stopped/downtime. Example: 10, 5, 20"),
772
- productiveHoldOnTime: zod_1.z.number().int().gte(0).lte(time_1.TimeIntervals["1d"].ms).nullish().describe("Productive Hold On Time: Time in minutes to consider station active after a productive signal. Each new signal restarts the hold-on timer."),
772
+ productiveHoldOnTime: zod_1.z.number().int().gte(0).lte(time_1.TimeIntervals["1d"].ms).nullish().describe("Productive Hold On Time: Time in milliseconds to keep considering the station active after a productive signal. Each new signal restarts the hold-on timer. Example: 300000 (5 minutes). The admin UI presents this value in minutes."),
773
773
  // Feature flags (allowManualProduction, allowQuickScheduleStart,
774
774
  // allowScheduleCutShort, allowRejectProduction, allowEditPartsPerCycle, schedulingOnly) are now
775
775
  // registry-managed tri-state `enable*` fields, added below via flagSchemaFieldsForLevel("station").
@@ -2472,7 +2472,7 @@ var require_shared = __commonJS({
2472
2472
  production_count: zod_1.z.number().optional().describe("Alias for production_count_good."),
2473
2473
  production_count_bad: zod_1.z.number().optional().describe("The cumulative number of bad production cycles complete."),
2474
2474
  bad_production_count: zod_1.z.number().optional().describe("Alias for production_count_bad."),
2475
- bad_production_reason: zod_1.z.string().optional().describe("Quality reason code for the bad production reported in this message. Must match a reason code of type 'quality' configured on the account; unknown or missing codes are recorded as bad production with no reason."),
2475
+ bad_production_reason: zod_1.z.string().optional().describe("Quality reason code for the bad production reported in this message. Should match a reason code of type 'quality' configured on the account, but an unrecognised code is still recorded verbatim and displayed as the raw code; a missing code records the bad production with no reason ('Unknown')."),
2476
2476
  non_production_reason: zod_1.z.string().optional().describe("Declares that this station is currently in a period of non-production, and gives the reason code for it. The presence of this field is the assertion - there is no separate boolean and no end signal; the sender simply stops sending it. Each message re-asserts non-production for the one-minute window it lands in, so senders must publish at least once per minute for continuous coverage. Should match a reason code of type 'non-production' configured on the account; unknown codes are still honoured and displayed as the raw code."),
2477
2477
  productive: zod_1.z.number().optional().describe("An indication that this station is productive. Any number greater than 0 is considered true."),
2478
2478
  line_speed: zod_1.z.number().optional().describe("A number indicating the speed of the station. No units are assumed, so could be percentage or speed such as m/s."),
@@ -7796,6 +7796,7 @@ var require_reason4 = __commonJS({
7796
7796
  exports2.reasonByCode = reasonByCode;
7797
7797
  exports2.subtreeReasonCodes = subtreeReasonCodes;
7798
7798
  exports2.reasonBreadcrumb = reasonBreadcrumb;
7799
+ exports2.withReasonCodeFallbackBreadcrumbs = withReasonCodeFallbackBreadcrumbs;
7799
7800
  exports2.withAncestorReasons = withAncestorReasons;
7800
7801
  var reason_1 = require_reason3();
7801
7802
  function flattenReasons(reasons, parentReasonCode, inheritedRequireNotes) {
@@ -7885,6 +7886,9 @@ var require_reason4 = __commonJS({
7885
7886
  }
7886
7887
  return chain;
7887
7888
  }
7889
+ function withReasonCodeFallbackBreadcrumbs(items) {
7890
+ return items.map((item) => item.reasonCode != null && !item.reasonBreadcrumb?.length ? { ...item, reasonBreadcrumb: [{ code: item.reasonCode, description: item.reasonCode }] } : item);
7891
+ }
7888
7892
  function withAncestorReasons(visible, allReasons) {
7889
7893
  const present = new Map(visible.map((r) => [r.code, r]));
7890
7894
  const result = [...visible];
@@ -9154,12 +9158,13 @@ var require_oee2 = __commonJS({
9154
9158
  i = j;
9155
9159
  } while (j < stationWindows.length);
9156
9160
  if (duration) {
9161
+ const fallbackDescription = s === exports2.UNKNOWN_DATA.key ? exports2.UNKNOWN_DATA.value : s;
9157
9162
  const breadcrumb = nonProductionCauseService != null ? nonProductionCauseService.getCauseBreadcrumb(s) : [];
9158
- const description = nonProductionCauseService != null ? breadcrumb.map((c) => c.description).join(" | ") || exports2.UNKNOWN_DATA.value : "";
9163
+ const description = breadcrumb.map((c) => c.description).join(" | ") || fallbackDescription;
9159
9164
  results.push({
9160
9165
  code: s,
9161
9166
  description,
9162
- reasonBreadcrumb: breadcrumb.length > 0 ? breadcrumb : [{ code: s, description: description || exports2.UNKNOWN_DATA.value }],
9167
+ reasonBreadcrumb: breadcrumb.length > 0 ? breadcrumb : [{ code: s, description: fallbackDescription }],
9163
9168
  duration,
9164
9169
  cost: 0,
9165
9170
  percent: 0,
@@ -9209,12 +9214,13 @@ var require_oee2 = __commonJS({
9209
9214
  i = j;
9210
9215
  } while (j < stationWindows.length);
9211
9216
  if (duration) {
9217
+ const fallbackDescription = s === exports2.UNKNOWN_DATA.key ? exports2.UNKNOWN_DATA.value : s;
9212
9218
  const breadcrumb = reasonCauseService != null ? reasonCauseService.getCauseBreadcrumb(s) : [];
9213
- const description = reasonCauseService != null ? breadcrumb.map((c) => c.description).join(" | ") || exports2.UNKNOWN_DATA.value : "";
9219
+ const description = breadcrumb.map((c) => c.description).join(" | ") || fallbackDescription;
9214
9220
  results.push({
9215
9221
  code: s,
9216
9222
  description,
9217
- reasonBreadcrumb: breadcrumb.length > 0 ? breadcrumb : [{ code: s, description: description || exports2.UNKNOWN_DATA.value }],
9223
+ reasonBreadcrumb: breadcrumb.length > 0 ? breadcrumb : [{ code: s, description: fallbackDescription }],
9218
9224
  duration,
9219
9225
  cost: issueDowntimeCost,
9220
9226
  energy: energyDowntime,
@@ -10247,14 +10253,14 @@ var require_station4 = __commonJS({
10247
10253
  if (station.lastStationWindow != null) {
10248
10254
  if ((station.lastStationWindow.shiftMs || 0) === 0) {
10249
10255
  state = exports2.StationStates.out_of_shift;
10250
- } else if (!station.lastStationWindow.isAlive) {
10251
- state = exports2.StationStates.disconnected;
10252
10256
  } else if ((station.lastStationWindow.downtimeMs || 0) > 0) {
10253
10257
  state = exports2.StationStates.stopped;
10254
10258
  } else if (station.activeSchedule?.nonProductionReasonCode != null) {
10255
10259
  state = exports2.StationStates.non_production;
10256
10260
  } else if ((0, station_windows_1.signalNonProductionReasonCode)(station.lastStationWindow) != null) {
10257
10261
  state = exports2.StationStates.non_production;
10262
+ } else if (!station.lastStationWindow.isAlive) {
10263
+ state = exports2.StationStates.disconnected;
10258
10264
  } else if (station.activeSchedule?.skuCode != null) {
10259
10265
  state = exports2.StationStates.running;
10260
10266
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "busroot-sdk",
3
- "version": "0.0.8-dev.2794844917",
3
+ "version": "0.0.8-dev.2797946662",
4
4
  "description": "An SDK for accessing Busroot from output.industries",
5
5
  "homepage": "https://www.output.industries",
6
6
  "main": "./build/index.js",