@fcg-labs/cx-agent-hook 0.5.0 → 0.5.1

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 (3) hide show
  1. package/package.json +1 -1
  2. package/styles.css +2 -0
  3. package/view.js +6 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fcg-labs/cx-agent-hook",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "FCG CX Agent 후킹 SDK — 서빙 답변 수신 + CS팀 교정(점수·수정·발송) 후킹. 의존성 0, CMS에 install만으로 이식",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/styles.css CHANGED
@@ -151,6 +151,8 @@
151
151
  .fcx-act-status[data-state="failed"] { color: var(--fcx-danger, #b42318); }
152
152
  .fcx-act-status[data-state="unknown"] { color: var(--fcx-warn, #9a6a12); }
153
153
  .fcx-act-status[data-state="unavailable"] { color: var(--fcx-muted, #5b6b7d); font-style: italic; }
154
+ .fcx-act-success-copy { margin-top: 4px; padding: 6px 8px; font-size: 13px; border-radius: 6px;
155
+ background: var(--fcx-success-bg, #e8f5ec); color: var(--fcx-success, #1f7a3f); }
154
156
  .fcx-act-locked {
155
157
  color: var(--fcx-success, #1f7a3f);
156
158
  padding: 4px 8px; border-radius: 6px;
package/view.js CHANGED
@@ -130,6 +130,7 @@ export const ACTION_CLS = {
130
130
  status: "fcx-act-status",
131
131
  locked: "fcx-act-locked",
132
132
  resend: "fcx-act-resend",
133
+ successCopy: "fcx-act-success-copy",
133
134
  };
134
135
 
135
136
  const RISK_KEY = { low: "ui_action_risk_low", medium: "ui_action_risk_medium", high: "ui_action_risk_high" };
@@ -164,6 +165,9 @@ export function actionOffersView({ offers = [], pending = [], enabled = true, co
164
165
  else if (state === "failed") statusText = `${messages.ui_action_failed}${p && p.message ? " — " + p.message : ""}`;
165
166
  else if (state === "unknown") statusText = messages.ui_action_unknown;
166
167
  if (p && p.unreported) statusText = `${statusText} · ${messages.ui_action_unreported}`;
168
+ // success_copy 는 실행이 실제로 성공한 뒤에만 — 절차 자산의 "실행 성공 후 문구"
169
+ // (실행 전 카드·답변에 실으면 완료 사칭이 된다. 서버도 같은 이유로 승인 게이트를 둔다.)
170
+ const successCopy = state === "succeeded" ? String(o.success_copy || "") : "";
167
171
  let lockedText = "";
168
172
  if (locked) {
169
173
  const who = o.lock && o.lock.actorClaimed ? ` · ${o.lock.actorClaimed}` : "";
@@ -184,7 +188,7 @@ export function actionOffersView({ offers = [], pending = [], enabled = true, co
184
188
  ackLabel: messages.ui_action_ack,
185
189
  okLabel: messages.ui_action_confirm_ok,
186
190
  cancelLabel: messages.ui_action_confirm_cancel,
187
- state, statusText, terminal,
191
+ state, statusText, terminal, successCopy,
188
192
  // 미보고만 "결과 다시 보고" — 재실행 버튼은 없다 (unknown 은 확인 필요로 남는다)
189
193
  canResend: Boolean(p && p.unreported),
190
194
  resendLabel: messages.ui_action_resend,
@@ -224,6 +228,7 @@ export function actionOffersTree(input) {
224
228
  children.push({ tag: "button", cls: ACTION_CLS.button, type: "button", text: it.buttonLabel, action: "confirm", offerId: it.offerId });
225
229
  }
226
230
  if (it.statusText) children.push({ tag: "div", cls: ACTION_CLS.status, text: it.statusText, state: it.state, live: true });
231
+ if (it.successCopy) children.push({ tag: "div", cls: ACTION_CLS.successCopy, text: it.successCopy });
227
232
  if (it.canResend) {
228
233
  children.push({ tag: "button", cls: ACTION_CLS.resend, type: "button", text: it.resendLabel, action: "resend", requestId: it.requestId });
229
234
  }