@things-factory/figure-service 10.1.33 → 10.1.34

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/figure-service",
3
- "version": "10.1.33",
3
+ "version": "10.1.34",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "@things-factory:registry": "https://registry.npmjs.org"
@@ -26,12 +26,12 @@
26
26
  "@hatiolab/figure-model": "^0.1.27",
27
27
  "@operato/typeorm-history": "^10.0.0",
28
28
  "@things-factory/ai-client-base": "^10.1.31",
29
- "@things-factory/auth-base": "^10.1.33",
29
+ "@things-factory/auth-base": "^10.1.34",
30
30
  "@things-factory/env": "^10.1.20",
31
- "@things-factory/shell": "^10.1.33",
31
+ "@things-factory/shell": "^10.1.34",
32
32
  "graphql-scalars": "^1.22.4",
33
33
  "graphql-upload": "^15.0.2",
34
34
  "koa-router": "^7.4.0"
35
35
  },
36
- "gitHead": "7fb7b6587846b5ff6ee7a4983652d9561b4d6b2c"
36
+ "gitHead": "5e16fd9f0cbb71c8d395b58a95bd9e99c93975c7"
37
37
  }
@@ -408,15 +408,28 @@ function figureToolSpecs(): ToolSpec[] {
408
408
  hostImage = { data: buf, mediaType: rawImage.mediaType || 'image/png' }
409
409
  }
410
410
 
411
- const result = await proposeFigure({
412
- prompt,
413
- palette,
414
- base,
415
- type: typeof args?.type === 'string' ? args.type : undefined,
416
- feedback,
417
- refine: !!feedback?.length,
418
- image: hostImage
419
- })
411
+ let result: any
412
+ try {
413
+ result = await proposeFigure({
414
+ prompt,
415
+ palette,
416
+ base,
417
+ type: typeof args?.type === 'string' ? args.type : undefined,
418
+ feedback,
419
+ refine: !!feedback?.length,
420
+ image: hostImage
421
+ })
422
+ } catch (error) {
423
+ /*
424
+ * 후보 생성은 세 번의 JSON·형식 검사 끝에 실패할 수 있다. 그 마지막 검사 사유를
425
+ * ProposeFailure.reasons 에만 두면 agentic-loop은 "만들지 못했습니다"만 받아
426
+ * 사용자 화면에는 "응답이 비어있습니다"가 된다. 재시도할 수 있는 말로 경계를
427
+ * 넘긴다. 다른 예외(권한·통신)는 원문을 보존한다.
428
+ */
429
+ const reasons = Array.isArray((error as any)?.reasons) ? (error as any).reasons : []
430
+ if (reasons.length > 0) throw new Error([(error as Error).message, ...reasons].join('\n'))
431
+ throw error
432
+ }
420
433
 
421
434
  /*
422
435
  **`proposed: true` 가 카드를 만든다.** 이 표시가 없으면 후보는 도구 추적 안에 묻히고,