@dssp/supervision 1.0.23 → 1.0.24

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.
@@ -1,4 +1,4 @@
1
- import { __decorate, __metadata } from "tslib";
1
+ import { __decorate, __metadata, __rest } from "tslib";
2
2
  /**
3
3
  * 검측 관리 상세 - AI 자동 검측 (동영상 세트 + 측정 모델 2종)
4
4
  *
@@ -843,10 +843,25 @@ let BuildingInspectionAiMeasurement = class BuildingInspectionAiMeasurement exte
843
843
  headers: { Authorization: ENGINE_AUTH },
844
844
  body: form
845
845
  });
846
- const raw = await response.json();
846
+ // 러너/프록시가 에러를 낼 때는 JSON 이 아닐 수 있다(502 HTML 등) — 본문을 그대로 보여준다
847
+ const text = await response.text();
848
+ let raw;
849
+ try {
850
+ raw = JSON.parse(text);
851
+ }
852
+ catch (_a) {
853
+ throw new Error(`AI 엔진 응답 오류 (HTTP ${response.status}) ${text.slice(0, 200)}`);
854
+ }
847
855
  const data = (raw === null || raw === void 0 ? void 0 : raw.result) || {};
848
856
  if ((data === null || data === void 0 ? void 0 : data.status) !== 'success') {
849
- throw new Error((data === null || data === void 0 ? void 0 : data.error) || (raw === null || raw === void 0 ? void 0 : raw.error) || 'AI 엔진 호출에 실패했습니다.');
857
+ // raw.detail: 러너가 요청을 거부한 사유(예: 파일/필드 크기 초과)
858
+ // raw.stderr: 모듈이 죽은 경우의 파이썬 트레이스백 — 원인이 여기 있다
859
+ const stderr = ((raw === null || raw === void 0 ? void 0 : raw.stderr) || '').trim().split('\n').slice(-3).join(' ');
860
+ throw new Error((data === null || data === void 0 ? void 0 : data.error) ||
861
+ (raw === null || raw === void 0 ? void 0 : raw.error) ||
862
+ (raw === null || raw === void 0 ? void 0 : raw.detail) ||
863
+ stderr ||
864
+ `AI 엔진 호출에 실패했습니다. (HTTP ${response.status})`);
850
865
  }
851
866
  return data.result;
852
867
  }
@@ -1464,14 +1479,19 @@ let BuildingInspectionAiMeasurement = class BuildingInspectionAiMeasurement exte
1464
1479
  try {
1465
1480
  this.loading = true;
1466
1481
  this.loadingText = '판정 확정 중...';
1467
- // 측정 서버 응답을 가공 없이 그대로 전달 — 품질 게이트/hold 승격은 엔진이 처리한다
1482
+ // 측정값·판정 근거는 그대로 전달한다 — 품질 게이트/hold 승격은 엔진이 처리한다.
1483
+ // 다만 근거 이미지(base64)는 빼고 보낸다: 엔진은 이 값을 판정에 쓰지 않고 그대로
1484
+ // 되돌려줄 뿐인데(engine.apply_measurement), 러너의 multipart 단일 필드 한도가
1485
+ // 1MB 라서 실어 보내면 400 "Part exceeded maximum size of 1024KB" 가 난다.
1486
+ // 화면 표시·첨부에 쓰는 값이므로 판정 결과에 다시 붙여 준다.
1487
+ const _b = this.measureResult, { image_data, image, map_png, overlay_b64, result_image } = _b, slimResult = __rest(_b, ["image_data", "image", "map_png", "overlay_b64", "result_image"]);
1468
1488
  const result = await this._callEngine({
1469
1489
  action: 'apply-measurement',
1470
1490
  item: { item_id: item.item_id, text: item.text, category: item.category },
1471
1491
  model_id: ((_a = item.measure) === null || _a === void 0 ? void 0 : _a.model_id) || this.measureResult.model_id,
1472
- result: this.measureResult
1492
+ result: slimResult
1473
1493
  });
1474
- const judged = Object.assign(Object.assign({}, item), result.item);
1494
+ const judged = Object.assign(Object.assign(Object.assign({}, item), result.item), (image_data ? { image_data } : {}));
1475
1495
  this._mergeItems([judged]);
1476
1496
  // 확정 즉시 체크리스트에 기록한다. 「검사 등록」까지 미루면 그 사이에 화면을 벗어나거나
1477
1497
  // 재판정이 일어났을 때 측정 판정만 유실된다 (VLM 항목은 inspect 결과에 남아 있어 티가 안 남).