@seedtactics/insight-client 17.0.1-beta.9 → 17.0.2

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 (62) hide show
  1. package/README.md +16 -4
  2. package/dist/assets/ProgramHighlight-mKbZxoXO.js +3 -0
  3. package/dist/assets/index-Cjt4dPv7.js +367 -0
  4. package/dist/cell-status/current-status.d.ts +1 -0
  5. package/dist/cell-status/current-status.js +46 -51
  6. package/dist/cell-status/loading.d.ts +13 -2
  7. package/dist/cell-status/loading.js +39 -7
  8. package/dist/cell-status/material-details.d.ts +2 -2
  9. package/dist/cell-status/material-details.js +33 -14
  10. package/dist/components/App.d.ts +0 -5
  11. package/dist/components/App.js +1 -1
  12. package/dist/components/ChooseMode.js +15 -3
  13. package/dist/components/ErrorsAndLoading.js +2 -1
  14. package/dist/components/LoadingIcon.js +3 -1
  15. package/dist/components/analysis/BufferChart.js +3 -2
  16. package/dist/components/operations/AllMaterial.js +9 -12
  17. package/dist/components/operations/RecentCycleChart.js +16 -21
  18. package/dist/components/quality/QualityMaterial.js +3 -12
  19. package/dist/components/station-monitor/BasketLoadStationWork.d.ts +4 -7
  20. package/dist/components/station-monitor/BasketLoadStationWork.js +97 -44
  21. package/dist/components/station-monitor/CancelLoadButton.js +8 -3
  22. package/dist/components/station-monitor/InvalidateCycle.js +26 -25
  23. package/dist/components/station-monitor/LoadStation.d.ts +0 -5
  24. package/dist/components/station-monitor/LoadStation.js +88 -115
  25. package/dist/components/station-monitor/Material.d.ts +6 -1
  26. package/dist/components/station-monitor/Material.js +22 -9
  27. package/dist/components/station-monitor/MoveMaterialArrows.js +9 -0
  28. package/dist/components/station-monitor/PrintedLabel.js +15 -19
  29. package/dist/components/station-monitor/QuarantineButton.js +21 -29
  30. package/dist/components/station-monitor/QueuesAddMaterial.js +2 -5
  31. package/dist/components/station-monitor/SystemOverview.js +59 -19
  32. package/dist/components/station-monitor/Whiteboard.js +14 -15
  33. package/dist/data/material-operation-policy.d.ts +6 -0
  34. package/dist/data/material-operation-policy.js +26 -2
  35. package/dist/data/move-arrows.d.ts +7 -0
  36. package/dist/data/move-arrows.js +107 -24
  37. package/dist/data/queue-material.d.ts +1 -0
  38. package/dist/data/queue-material.js +55 -48
  39. package/dist/extension.d.ts +1 -1
  40. package/dist/extension.js +1 -0
  41. package/dist/index.html +2 -39
  42. package/dist/index.js +1 -6
  43. package/dist/network/api-errors.d.ts +8 -0
  44. package/dist/network/api-errors.js +77 -0
  45. package/dist/network/api.d.ts +20 -34
  46. package/dist/network/api.js +68 -64
  47. package/dist/network/backend-mock.js +3 -0
  48. package/dist/network/backend.d.ts +3 -2
  49. package/dist/network/current-status-session.d.ts +27 -0
  50. package/dist/network/current-status-session.js +65 -0
  51. package/dist/network/websocket.d.ts +4 -0
  52. package/dist/network/websocket.js +176 -37
  53. package/dist/util/parseISODuration.js +10 -9
  54. package/docs/material-quarantine.md +5 -4
  55. package/docs/mazak.md +11 -14
  56. package/docs/operator-procedures.md +14 -0
  57. package/docs/server-config.md +20 -12
  58. package/package.json +25 -20
  59. package/dist/assets/ProgramHighlight-C6zSEXCX.js +0 -3
  60. package/dist/assets/index-MFZreX-b.js +0 -388
  61. package/dist/components/station-monitor/BasketMovementArrival.d.ts +0 -40
  62. package/dist/components/station-monitor/BasketMovementArrival.js +0 -165
@@ -54,7 +54,7 @@ export function uniqueIdForNodeKind(kind) {
54
54
  case MoveMaterialNodeKindType.CompletedExpandedMaterialZone:
55
55
  return "CompletedExpandedMaterialZone";
56
56
  case MoveMaterialNodeKindType.PalletFaceZone:
57
- return "PalletFaceZone-" + kind.face.toString();
57
+ return `PalletFaceZone-${kind.palletNum}-${kind.face}`;
58
58
  case MoveMaterialNodeKindType.QueueZone:
59
59
  return "QueueZone-" + kind.queue;
60
60
  case MoveMaterialNodeKindType.BasketZone:
@@ -72,7 +72,7 @@ export function memoPropsForNodeKind(kind) {
72
72
  case MoveMaterialNodeKindType.CompletedExpandedMaterialZone:
73
73
  return [kind.type, null];
74
74
  case MoveMaterialNodeKindType.PalletFaceZone:
75
- return [kind.type, kind.face];
75
+ return [kind.type, kind.palletNum, kind.face];
76
76
  case MoveMaterialNodeKindType.QueueZone:
77
77
  return [kind.type, kind.queue];
78
78
  case MoveMaterialNodeKindType.BasketZone:
@@ -81,6 +81,9 @@ export function memoPropsForNodeKind(kind) {
81
81
  return [kind.type, kind.basketId, kind.slot];
82
82
  }
83
83
  }
84
+ function faceKey(palletNum, face) {
85
+ return `${palletNum ?? ""}:${face}`;
86
+ }
84
87
  function groupMatByKind(allNodes) {
85
88
  let freeMaterial;
86
89
  let completedMaterial;
@@ -99,7 +102,7 @@ function groupMatByKind(allNodes) {
99
102
  completedMaterial = node.elem;
100
103
  break;
101
104
  case MoveMaterialNodeKindType.PalletFaceZone:
102
- faces.set(node.face, node.elem);
105
+ faces.set(faceKey(node.palletNum, node.face), node.elem);
103
106
  break;
104
107
  case MoveMaterialNodeKindType.QueueZone:
105
108
  queues.set(node.queue, node.elem);
@@ -119,6 +122,45 @@ function groupMatByKind(allNodes) {
119
122
  }
120
123
  return { freeMaterial, completedMaterial, faces, queues, baskets, basketSlots, material };
121
124
  }
125
+ // All material in a basket slot moves together, so material leaving or staying in a slot draws a
126
+ // single arrow from the combined rectangle of the slot's material. Material arriving from
127
+ // elsewhere keeps an arrow per piece.
128
+ function basketSlotGroup(mat) {
129
+ if (mat.location.type === api.LocType.InBasket &&
130
+ mat.location.basketId !== undefined &&
131
+ mat.location.basketSlot !== undefined) {
132
+ return `${mat.location.basketId}:${mat.location.basketSlot}`;
133
+ }
134
+ return null;
135
+ }
136
+ function unionRect(a, b) {
137
+ const left = Math.min(a.left, b.left);
138
+ const top = Math.min(a.top, b.top);
139
+ const right = Math.max(a.right, b.right);
140
+ const bottom = Math.max(a.bottom, b.bottom);
141
+ return { left, top, right, bottom, width: right - left, height: bottom - top };
142
+ }
143
+ function arrowSources(material) {
144
+ const sorted = LazySeq.of(material)
145
+ .sortBy(([box]) => box.left, ([box]) => box.top)
146
+ .toRArray();
147
+ const slotRects = LazySeq.of(sorted)
148
+ .collect(([rect, mat]) => {
149
+ const group = basketSlotGroup(mat);
150
+ return group === null ? null : [group, rect];
151
+ })
152
+ .buildHashMap(([group]) => group, (prev, [, rect]) => (prev ? unionRect(prev, rect) : rect));
153
+ const seen = new Set();
154
+ return sorted.flatMap(([rect, mat]) => {
155
+ const group = basketSlotGroup(mat);
156
+ if (group === null)
157
+ return [[rect, mat]];
158
+ if (seen.has(group))
159
+ return [];
160
+ seen.add(group);
161
+ return [[slotRects.get(group) ?? rect, mat]];
162
+ });
163
+ }
122
164
  export function computeArrows(container, allNodes) {
123
165
  if (!container) {
124
166
  return [];
@@ -128,11 +170,19 @@ export function computeArrows(container, allNodes) {
128
170
  return [];
129
171
  }
130
172
  const arrows = [];
173
+ const loops = [];
131
174
  const faceDestUsed = new Map();
132
175
  const queueDestUsed = new Map();
133
176
  const basketDestUsed = new Map();
177
+ const slotDestUsed = new Map();
134
178
  let lastFreeUsed = 0;
135
- for (const [rect, mat] of LazySeq.of(byKind.material).sortBy(([box]) => box.left, ([box]) => box.top)) {
179
+ const sources = arrowSources(byKind.material);
180
+ const slotLoadCounts = LazySeq.of(sources)
181
+ .filter(([, mat]) => mat.action.type === api.ActionType.LoadingToBasket &&
182
+ basketSlotGroup(mat) !== `${mat.action.loadToBasketId}:${mat.action.loadToBasketSlot}`)
183
+ .groupBy(([, mat]) => `${mat.action.loadToBasketId}:${mat.action.loadToBasketSlot}`)
184
+ .toHashMap(([slot, loads]) => [slot, loads.length]);
185
+ for (const [rect, mat] of sources) {
136
186
  switch (mat.action.type) {
137
187
  case api.ActionType.UnloadToCompletedMaterial:
138
188
  case api.ActionType.UnloadToInProcess:
@@ -185,10 +235,11 @@ export function computeArrows(container, allNodes) {
185
235
  case api.ActionType.Loading:
186
236
  if (mat.action.loadFromBasketId && mat.action.loadOntoFace) {
187
237
  // loading from basket onto pallet face
188
- const face = byKind.faces.get(mat.action.loadOntoFace);
238
+ const key = faceKey(mat.action.loadOntoPalletNum, mat.action.loadOntoFace);
239
+ const face = byKind.faces.get(key);
189
240
  if (face !== undefined) {
190
- const faceSpotsUsed = faceDestUsed.get(mat.action.loadOntoFace) ?? 0;
191
- faceDestUsed.set(mat.action.loadOntoFace, faceSpotsUsed + 1);
241
+ const faceSpotsUsed = faceDestUsed.get(key) ?? 0;
242
+ faceDestUsed.set(key, faceSpotsUsed + 1);
192
243
  arrows.push({
193
244
  fromX: rect.right,
194
245
  fromY: rect.top + rect.height / 2,
@@ -226,7 +277,7 @@ export function computeArrows(container, allNodes) {
226
277
  }
227
278
  else {
228
279
  // move to different face
229
- const face = byKind.faces.get(mat.action.loadOntoFace);
280
+ const face = byKind.faces.get(faceKey(mat.action.loadOntoPalletNum, mat.action.loadOntoFace));
230
281
  if (face) {
231
282
  if (mat.action.loadOntoFace < (mat.location.face ?? 0)) {
232
283
  arrows.push({
@@ -251,10 +302,11 @@ export function computeArrows(container, allNodes) {
251
302
  }
252
303
  else {
253
304
  // loading from queues or free Material
254
- const face = byKind.faces.get(mat.action.loadOntoFace);
305
+ const key = faceKey(mat.action.loadOntoPalletNum, mat.action.loadOntoFace);
306
+ const face = byKind.faces.get(key);
255
307
  if (face !== undefined) {
256
- const faceSpotsUsed = faceDestUsed.get(mat.action.loadOntoFace) ?? 0;
257
- faceDestUsed.set(mat.action.loadOntoFace, faceSpotsUsed + 1);
308
+ const faceSpotsUsed = faceDestUsed.get(key) ?? 0;
309
+ faceDestUsed.set(key, faceSpotsUsed + 1);
258
310
  arrows.push({
259
311
  fromX: rect.right,
260
312
  fromY: rect.top + rect.height / 2,
@@ -270,28 +322,59 @@ export function computeArrows(container, allNodes) {
270
322
  const basketId = mat.action.loadToBasketId;
271
323
  if (basketId === undefined)
272
324
  break;
273
- const dest = mat.action.loadToBasketSlot === undefined
274
- ? byKind.baskets.get(basketId)
275
- : (byKind.basketSlots.get(`${basketId}:${mat.action.loadToBasketSlot}`) ??
276
- byKind.baskets.get(basketId));
325
+ if (mat.location.type === api.LocType.InBasket &&
326
+ mat.location.basketId === basketId &&
327
+ mat.location.basketSlot === mat.action.loadToBasketSlot) {
328
+ loops.push({
329
+ type: "loop",
330
+ centerX: rect.left - 20 - container.left,
331
+ centerY: rect.top + rect.height / 2 - container.top,
332
+ radius: 12,
333
+ });
334
+ break;
335
+ }
336
+ const slotKey = `${basketId}:${mat.action.loadToBasketSlot}`;
337
+ const slotDest = mat.action.loadToBasketSlot === undefined ? undefined : byKind.basketSlots.get(slotKey);
338
+ if (slotDest !== undefined) {
339
+ // Keep arrowheads in the margin before the row so cards cannot cover them. Multiple
340
+ // arrivals are spread vertically within the row's height.
341
+ const spotsUsed = slotDestUsed.get(slotKey) ?? 0;
342
+ slotDestUsed.set(slotKey, spotsUsed + 1);
343
+ arrows.push({
344
+ fromX: rect.right,
345
+ fromY: rect.top + rect.height / 2,
346
+ toX: slotDest.left - 20,
347
+ toY: slotDest.top +
348
+ (slotDest.height * (spotsUsed + 1)) / ((slotLoadCounts.get(slotKey) ?? 1) + 1),
349
+ curveDirection: -1,
350
+ });
351
+ break;
352
+ }
353
+ const dest = byKind.baskets.get(basketId);
354
+ if (dest === undefined)
355
+ break;
277
356
  const lastSlotUsed = basketDestUsed.get(basketId) ?? 0;
278
357
  basketDestUsed.set(basketId, lastSlotUsed + 1);
279
358
  arrows.push({
280
359
  fromX: rect.right,
281
360
  fromY: rect.top + rect.height / 2,
282
- toX: dest !== undefined ? dest.left + 20 : container.right - 10,
283
- toY: dest !== undefined ? dest.top + 50 + 20 * lastSlotUsed : rect.top + rect.height / 2,
361
+ toX: dest.left + 20,
362
+ toY: dest.top + 50 + 20 * lastSlotUsed,
284
363
  curveDirection: -1,
285
364
  });
286
365
  break;
287
366
  }
288
367
  }
289
368
  }
290
- return arrows.map((arr) => ({
291
- fromX: arr.fromX - container.left,
292
- fromY: arr.fromY - container.top,
293
- toX: arr.toX - container.left,
294
- toY: arr.toY - container.top,
295
- curveDirection: arr.curveDirection,
296
- }));
369
+ return [
370
+ ...arrows.map((arr) => ({
371
+ type: "curve",
372
+ fromX: arr.fromX - container.left,
373
+ fromY: arr.fromY - container.top,
374
+ toX: arr.toX - container.left,
375
+ toY: arr.toY - container.top,
376
+ curveDirection: arr.curveDirection,
377
+ })),
378
+ ...loops,
379
+ ];
297
380
  }
@@ -30,6 +30,7 @@ export declare function extractJobRawMaterial(jobs: {
30
30
  [key: string]: Readonly<api.IActiveJob>;
31
31
  }, mats: Iterable<Readonly<api.IInProcessMaterial>>, queue: string): ReadonlyArray<JobRawMaterialData>;
32
32
  export type MaterialList = ReadonlyArray<Readonly<api.IInProcessMaterial>>;
33
+ export declare function groupInterchangeableMaterial(material: MaterialList, canGroup: (m: Readonly<api.IInProcessMaterial>) => boolean): ReadonlyArray<MaterialList>;
33
34
  export interface QueueRawMaterialGroup {
34
35
  readonly partOrCasting: string;
35
36
  readonly assignedJobUnique: string | null;
@@ -31,7 +31,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31
31
  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
32
  */
33
33
  import * as api from "../network/api.js";
34
- import { LazySeq, OrderedMap } from "@seedtactics/immutable-collections";
34
+ import { LazySeq } from "@seedtactics/immutable-collections";
35
35
  import { LogBackend } from "../network/backend.js";
36
36
  import { differenceInSeconds } from "date-fns";
37
37
  import { useAtomValue } from "jotai";
@@ -152,6 +152,46 @@ export function extractJobRawMaterial(jobs, mats, queue) {
152
152
  return prec;
153
153
  });
154
154
  }
155
+ function hasSerial(m) {
156
+ return m.serial !== undefined && m.serial !== null && m.serial !== "";
157
+ }
158
+ function interchangeableKey(m) {
159
+ return [
160
+ m.partName,
161
+ m.jobUnique,
162
+ m.process,
163
+ m.action.type,
164
+ m.action.loadOntoPalletNum,
165
+ m.action.loadOntoFace,
166
+ m.action.loadToBasketId,
167
+ m.action.loadToBasketSlot,
168
+ m.action.processAfterLoad,
169
+ m.action.pathAfterLoad,
170
+ ].join("|");
171
+ }
172
+ // Material without a serial is interchangeable with others of the same part, job, process, and
173
+ // destination, so it is displayed as one card with a count. Groups the material selected by
174
+ // canGroup in order of first appearance; other material is returned individually.
175
+ export function groupInterchangeableMaterial(material, canGroup) {
176
+ const groupKey = (m) => canGroup(m) && !hasSerial(m) ? interchangeableKey(m) : null;
177
+ const groups = LazySeq.of(material)
178
+ .collect((m) => {
179
+ const key = groupKey(m);
180
+ return key === null ? null : [key, m];
181
+ })
182
+ .groupBy(([key]) => key)
183
+ .toHashMap(([key, entries]) => [key, entries.map(([, m]) => m)]);
184
+ const seen = new Set();
185
+ return material.flatMap((m) => {
186
+ const key = groupKey(m);
187
+ if (key === null)
188
+ return [[m]];
189
+ if (seen.has(key))
190
+ return [];
191
+ seen.add(key);
192
+ return [groups.get(key) ?? [m]];
193
+ });
194
+ }
155
195
  export function selectQueueData(queuesToCheck, curSt, rawMatQueues, inProcQueues) {
156
196
  const queues = [];
157
197
  const queueNames = [...queuesToCheck];
@@ -159,58 +199,25 @@ export function selectQueueData(queuesToCheck, curSt, rawMatQueues, inProcQueues
159
199
  for (const queueName of queueNames) {
160
200
  const isRawMat = rawMatQueues.has(queueName);
161
201
  if (isRawMat) {
162
- let materialByPos = OrderedMap.empty();
163
- const matByPartThenUniq = new Map();
164
- for (const m of curSt.material) {
165
- if (m.location.type === api.LocType.InQueue &&
166
- m.location.currentQueue === queueName &&
167
- m.location.queuePosition !== undefined) {
168
- if ((m.serial && m.serial !== "") || m.action.type !== api.ActionType.Waiting) {
169
- materialByPos = materialByPos.set(m.location.queuePosition, m);
170
- }
171
- else {
172
- let matsForPart = matByPartThenUniq.get(m.partName);
173
- if (!matsForPart) {
174
- matsForPart = new Map();
175
- matByPartThenUniq.set(m.partName, matsForPart);
176
- }
177
- const uniq = m.jobUnique || null;
178
- const matsForJob = matsForPart.get(uniq);
179
- if (matsForJob) {
180
- matsForJob.push(m);
181
- }
182
- else {
183
- matsForPart.set(uniq, [m]);
184
- }
185
- }
186
- }
187
- }
188
- const matGroups = [];
189
- for (const [partName, matsForPart] of matByPartThenUniq) {
190
- for (const [uniq, mats] of matsForPart) {
191
- matGroups.push({
192
- partOrCasting: partName,
193
- assignedJobUnique: uniq,
194
- material: mats,
195
- });
196
- }
197
- }
198
- matGroups.sort((x, y) => {
199
- const c1 = x.partOrCasting.localeCompare(y.partOrCasting);
200
- if (c1 === 0) {
201
- return (x.assignedJobUnique || "").localeCompare(y.assignedJobUnique || "");
202
- }
203
- else {
204
- return c1;
205
- }
206
- });
202
+ const inQueue = LazySeq.of(curSt.material)
203
+ .filter((m) => m.location.type === api.LocType.InQueue &&
204
+ m.location.currentQueue === queueName &&
205
+ m.location.queuePosition !== undefined)
206
+ .toSortedArray((m) => m.location.queuePosition ?? 0);
207
+ // material with a serial or an action keeps its own card and queue position
208
+ const waitingWithoutSerial = (m) => !hasSerial(m) && m.action.type === api.ActionType.Waiting;
209
+ const matGroups = LazySeq.of(groupInterchangeableMaterial(inQueue.filter(waitingWithoutSerial), () => true)).toSortedArray((g) => g[0].partName, (g) => g[0].jobUnique ?? "");
207
210
  queues.push({
208
211
  label: queueName,
209
212
  free: false,
210
213
  rawMaterialQueue: true,
211
214
  inProcQueue: false,
212
- material: [...materialByPos.values()],
213
- groupedRawMat: matGroups,
215
+ material: inQueue.filter((m) => !waitingWithoutSerial(m)),
216
+ groupedRawMat: matGroups.map((material) => ({
217
+ partOrCasting: material[0].partName,
218
+ assignedJobUnique: material[0].jobUnique || null,
219
+ material,
220
+ })),
214
221
  });
215
222
  }
216
223
  else {
@@ -4,9 +4,9 @@ import type { AppProps } from "./components/App.js";
4
4
  */
5
5
  export declare function bootstrapInsight(appProps?: AppProps, rootElement?: HTMLElement): Promise<void>;
6
6
  export { customState } from "./cell-status/custom-state.js";
7
+ export { currentStatusIsLive, refreshCurrentStatus } from "./network/websocket.js";
7
8
  export type { AppProps };
8
9
  export { defaultChooseModes } from "./components/ChooseMode.js";
9
10
  export type { ChooseModeItem } from "./components/ChooseMode.js";
10
11
  export { RouteLocation } from "./components/routes.js";
11
12
  export { authenticatedFetch } from "./network/backend.js";
12
- export type { BasketMovementCompletionCommand, BasketMovementCompletionReceipt, BasketLocationCorrectionCommand, SubmitBasketLocationCorrection, SubmitBasketMovementCompletion, } from "./components/station-monitor/BasketMovementArrival.js";
package/dist/extension.js CHANGED
@@ -16,6 +16,7 @@ export async function bootstrapInsight(appProps = {}, rootElement) {
16
16
  render(appProps, root, store);
17
17
  }
18
18
  export { customState } from "./cell-status/custom-state.js";
19
+ export { currentStatusIsLive, refreshCurrentStatus } from "./network/websocket.js";
19
20
  export { defaultChooseModes } from "./components/ChooseMode.js";
20
21
  export { RouteLocation } from "./components/routes.js";
21
22
  export { authenticatedFetch } from "./network/backend.js";
package/dist/index.html CHANGED
@@ -5,45 +5,8 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
6
6
  <link rel="shortcut icon" href="/assets/favicon-gWFxiJK2.ico" />
7
7
  <title>SeedTactic FMS Insight</title>
8
- <style type="text/css">
9
- .download-loader {
10
- width: 100px;
11
- height: 100px;
12
- display: inline-block;
13
- }
14
- .download-circular {
15
- width: 100px;
16
- height: 100px;
17
- animation: rotate 2s linear infinite;
18
- }
19
- .download-path {
20
- stroke-dasharray: 1, 200;
21
- stroke-dashoffset: 0;
22
- animation: dash 1.5s ease-out infinite;
23
- stroke-linecap: round;
24
- stroke: #8d6e63;
25
- }
26
- @keyframes rotate {
27
- 100% {
28
- transform: rotate(360deg);
29
- }
30
- }
31
- @keyframes dash {
32
- 0% {
33
- stroke-dasharray: 1, 200;
34
- stroke-dashoffset: 0;
35
- }
36
- 50% {
37
- stroke-dasharray: 89, 200;
38
- stroke-dashoffset: -35px;
39
- }
40
- 100% {
41
- stroke-dasharray: 89, 200;
42
- stroke-dashoffset: -124px;
43
- }
44
- }
45
- </style>
46
- <script type="module" crossorigin src="/assets/index-MFZreX-b.js"></script>
8
+ <style type="text/css">.download-loader{width:100px;height:100px;display:inline-block}.download-circular{width:100px;height:100px;animation:2s linear infinite rotate}.download-path{stroke-dasharray:1 200;stroke-dashoffset:0;stroke-linecap:round;stroke:#8d6e63;animation:1.5s ease-out infinite dash}@keyframes rotate{to{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1 200;stroke-dashoffset:0}50%{stroke-dasharray:89 200;stroke-dashoffset:-35px}to{stroke-dasharray:89 200;stroke-dashoffset:-124px}}</style>
9
+ <script type="module" crossorigin src="/assets/index-Cjt4dPv7.js"></script>
47
10
  <link rel="stylesheet" crossorigin href="/assets/index-DXfAwuj-.css">
48
11
  </head>
49
12
  <body>
package/dist/index.js CHANGED
@@ -33,12 +33,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
33
  import { bootstrapInsight } from "./extension.js";
34
34
  import { ApiException } from "./network/api.js";
35
35
  async function main() {
36
- const developmentProps = import.meta.env.DEV
37
- ? {
38
- submitBasketLoadStationCommand: async () => "accepted",
39
- }
40
- : {};
41
- await bootstrapInsight(developmentProps);
36
+ await bootstrapInsight();
42
37
  }
43
38
  main().catch((e) => {
44
39
  console.log(e);
@@ -0,0 +1,8 @@
1
+ /**
2
+ * The server's explanation for a failed request: the detail of a JSON problem or a plain-text
3
+ * message (also assumed without a content type). Null when the server gave none, including HTML
4
+ * from a proxy.
5
+ */
6
+ export declare function serverErrorMessage(error: unknown): string | null;
7
+ /** The server's explanation for a failed request, otherwise the request error's own message. */
8
+ export declare function apiErrorMessage(error: unknown, fallback?: string): string;
@@ -0,0 +1,77 @@
1
+ /* Copyright (c) 2026, John Lenz
2
+
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ * Redistributions of source code must retain the above copyright
9
+ notice, this list of conditions and the following disclaimer.
10
+
11
+ * Redistributions in binary form must reproduce the above
12
+ copyright notice, this list of conditions and the following
13
+ disclaimer in the documentation and/or other materials provided
14
+ with the distribution.
15
+
16
+ * Neither the name of John Lenz, Black Maple Software, SeedTactics,
17
+ nor the names of other contributors may be used to endorse or
18
+ promote products derived from this software without specific
19
+ prior written permission.
20
+
21
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+ */
33
+ import { ApiException } from "./api.js";
34
+ function mediaType(headers) {
35
+ const value = headers["content-type"];
36
+ return typeof value === "string" ? (value.split(";")[0] ?? "").trim().toLowerCase() : "";
37
+ }
38
+ function nonBlank(value) {
39
+ return typeof value === "string" && value.trim() !== "" ? value : null;
40
+ }
41
+ function problemMessage(response) {
42
+ try {
43
+ const problem = JSON.parse(response);
44
+ if (problem === null || typeof problem !== "object")
45
+ return null;
46
+ return (("detail" in problem ? nonBlank(problem.detail) : null) ??
47
+ ("title" in problem ? nonBlank(problem.title) : null));
48
+ }
49
+ catch {
50
+ return null;
51
+ }
52
+ }
53
+ /**
54
+ * The server's explanation for a failed request: the detail of a JSON problem or a plain-text
55
+ * message (also assumed without a content type). Null when the server gave none, including HTML
56
+ * from a proxy.
57
+ */
58
+ export function serverErrorMessage(error) {
59
+ if (error === null || typeof error !== "object" || !ApiException.isApiException(error)) {
60
+ return null;
61
+ }
62
+ const type = mediaType(error.headers);
63
+ return type === "application/problem+json" || type === "application/json"
64
+ ? problemMessage(error.response)
65
+ : type === "text/plain" || type === ""
66
+ ? nonBlank(error.response)
67
+ : null;
68
+ }
69
+ /** The server's explanation for a failed request, otherwise the request error's own message. */
70
+ export function apiErrorMessage(error, fallback = "Error") {
71
+ const message = serverErrorMessage(error);
72
+ if (message !== null)
73
+ return message;
74
+ if (error instanceof Error)
75
+ return error.message;
76
+ return nonBlank(error) ?? fallback;
77
+ }
@@ -31,6 +31,8 @@ export declare class JobsClient {
31
31
  protected processRecent(response: Response): Promise<RecentHistoricData>;
32
32
  latestSchedule(signal?: AbortSignal): Promise<MostRecentSchedule>;
33
33
  protected processLatestSchedule(response: Response): Promise<MostRecentSchedule>;
34
+ completeBasketLoadStation(completion: BasketLoadStationCompletion, signal?: AbortSignal): Promise<void>;
35
+ protected processCompleteBasketLoadStation(response: Response): Promise<void>;
34
36
  currentStatus(signal?: AbortSignal): Promise<CurrentStatus>;
35
37
  protected processCurrentStatus(response: Response): Promise<CurrentStatus>;
36
38
  unscheduledRebookings(signal?: AbortSignal): Promise<Rebooking[]>;
@@ -693,6 +695,7 @@ export interface INewProgramContent {
693
695
  revision: number;
694
696
  }
695
697
  export declare class CurrentStatus implements ICurrentStatus {
698
+ revision: number;
696
699
  timeOfCurrentStatusUTC: Date;
697
700
  jobs: {
698
701
  [key: string]: ActiveJob;
@@ -710,7 +713,6 @@ export declare class CurrentStatus implements ICurrentStatus {
710
713
  baskets?: {
711
714
  [key: string]: BasketStatus;
712
715
  } | undefined;
713
- basketMoveInstructions?: BasketMoveInstruction[] | undefined;
714
716
  customState?: any | undefined;
715
717
  constructor(data?: ICurrentStatus);
716
718
  init(_data?: any): void;
@@ -718,6 +720,7 @@ export declare class CurrentStatus implements ICurrentStatus {
718
720
  toJSON(data?: any): any;
719
721
  }
720
722
  export interface ICurrentStatus {
723
+ revision: number;
721
724
  timeOfCurrentStatusUTC: Date;
722
725
  jobs: {
723
726
  [key: string]: ActiveJob;
@@ -735,7 +738,6 @@ export interface ICurrentStatus {
735
738
  baskets?: {
736
739
  [key: string]: BasketStatus;
737
740
  } | undefined;
738
- basketMoveInstructions?: BasketMoveInstruction[] | undefined;
739
741
  customState?: any | undefined;
740
742
  }
741
743
  export declare class HistoricJob extends Job implements IHistoricJob {
@@ -893,6 +895,7 @@ export declare enum LocType {
893
895
  }
894
896
  export declare class InProcessMaterialAction implements IInProcessMaterialAction {
895
897
  type: ActionType;
898
+ automatedTransfer?: boolean;
896
899
  workId?: string | undefined;
897
900
  loadCancellationId?: string | undefined;
898
901
  loadOntoPalletNum?: number | undefined;
@@ -916,6 +919,7 @@ export declare class InProcessMaterialAction implements IInProcessMaterialAction
916
919
  }
917
920
  export interface IInProcessMaterialAction {
918
921
  type: ActionType;
922
+ automatedTransfer?: boolean;
919
923
  workId?: string | undefined;
920
924
  loadCancellationId?: string | undefined;
921
925
  loadOntoPalletNum?: number | undefined;
@@ -1054,6 +1058,7 @@ export declare enum WorkorderSerialCloseout {
1054
1058
  }
1055
1059
  export declare class BasketStatus implements IBasketStatus {
1056
1060
  basketId: number;
1061
+ slotCount?: number | undefined;
1057
1062
  loadStationWork?: BasketLoadStationWork | undefined;
1058
1063
  position?: BasketPosition | undefined;
1059
1064
  emptySlots?: number[];
@@ -1065,6 +1070,7 @@ export declare class BasketStatus implements IBasketStatus {
1065
1070
  }
1066
1071
  export interface IBasketStatus {
1067
1072
  basketId: number;
1073
+ slotCount?: number | undefined;
1068
1074
  loadStationWork?: BasketLoadStationWork | undefined;
1069
1075
  position?: BasketPosition | undefined;
1070
1076
  emptySlots?: number[];
@@ -1075,6 +1081,7 @@ export declare class BasketLoadStationWork implements IBasketLoadStationWork {
1075
1081
  type: BasketLoadStationWorkType;
1076
1082
  readyToConfirm: boolean;
1077
1083
  confirmationBlockedReason?: string | undefined;
1084
+ instructionWarning?: string | undefined;
1078
1085
  awaitingMaterialSlots?: number[];
1079
1086
  constructor(data?: IBasketLoadStationWork);
1080
1087
  init(_data?: any): void;
@@ -1086,6 +1093,7 @@ export interface IBasketLoadStationWork {
1086
1093
  type: BasketLoadStationWorkType;
1087
1094
  readyToConfirm: boolean;
1088
1095
  confirmationBlockedReason?: string | undefined;
1096
+ instructionWarning?: string | undefined;
1089
1097
  awaitingMaterialSlots?: number[];
1090
1098
  }
1091
1099
  export declare enum BasketLoadStationWorkType {
@@ -1114,38 +1122,6 @@ export declare enum BasketLocationEnum {
1114
1122
  Storage = "Storage",
1115
1123
  InTransit = "InTransit"
1116
1124
  }
1117
- export declare class BasketMoveInstruction implements IBasketMoveInstruction {
1118
- instructionId: string;
1119
- basketId: number;
1120
- source?: BasketPosition | undefined;
1121
- destination: BasketPosition;
1122
- reason: BasketMoveReason;
1123
- displayText: string;
1124
- prerequisiteInstructionId?: string | undefined;
1125
- constructor(data?: IBasketMoveInstruction);
1126
- init(_data?: any): void;
1127
- static fromJS(data: any): BasketMoveInstruction;
1128
- toJSON(data?: any): any;
1129
- }
1130
- export interface IBasketMoveInstruction {
1131
- instructionId: string;
1132
- basketId: number;
1133
- source?: BasketPosition | undefined;
1134
- destination: BasketPosition;
1135
- reason: BasketMoveReason;
1136
- displayText: string;
1137
- prerequisiteInstructionId?: string | undefined;
1138
- }
1139
- export declare enum BasketMoveReason {
1140
- LoadMaterial = "LoadMaterial",
1141
- UnloadMaterial = "UnloadMaterial",
1142
- ProcessTransfer = "ProcessTransfer",
1143
- SupplyMaterialToCell = "SupplyMaterialToCell",
1144
- SupplyEmptyBasket = "SupplyEmptyBasket",
1145
- ReturnToStorage = "ReturnToStorage",
1146
- RemoveForCorrection = "RemoveForCorrection",
1147
- Other = "Other"
1148
- }
1149
1125
  export declare class ProblemDetails implements IProblemDetails {
1150
1126
  type?: string | undefined;
1151
1127
  title?: string | undefined;
@@ -1328,6 +1304,16 @@ export interface IRebooking {
1328
1304
  notes?: string | undefined;
1329
1305
  workorder?: string | undefined;
1330
1306
  }
1307
+ export declare class BasketLoadStationCompletion implements IBasketLoadStationCompletion {
1308
+ workId: string;
1309
+ constructor(data?: IBasketLoadStationCompletion);
1310
+ init(_data?: any): void;
1311
+ static fromJS(data: any): BasketLoadStationCompletion;
1312
+ toJSON(data?: any): any;
1313
+ }
1314
+ export interface IBasketLoadStationCompletion {
1315
+ workId: string;
1316
+ }
1331
1317
  export declare class SimulationResults implements ISimulationResults {
1332
1318
  scheduleId: string;
1333
1319
  jobs: Job[];