@things-factory/board-ai 10.0.9 → 10.0.13

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.
@@ -317,6 +317,18 @@ export class OxBoardAIChat extends LitElement {
317
317
  @state()
318
318
  private input = ''
319
319
 
320
+ /**
321
+ * 밖에서 질문을 넣어 **자동으로 보내게** 하는 진입점.
322
+ *
323
+ * 오류 토스트의 "AI에게 묻기" 처럼, 사용자가 타이핑하지 않고 곧바로 답을 받아야 하는 경로가 있다.
324
+ * 값이 들어오면 그 문장을 입력으로 삼아 한 번 전송하고 비운다(같은 질문이 반복 전송되지 않게).
325
+ */
326
+ @property({ attribute: false })
327
+ autoAsk?: string
328
+
329
+ /** autoAsk 를 이미 보냈는지 — 재렌더마다 다시 보내지 않기 위한 표식. */
330
+ private _autoAsked?: string
331
+
320
332
  /** 마지막 send 실패 시 보존 — 다시 시도 버튼 클릭 시 사용 */
321
333
  @state()
322
334
  private lastFailedInput?: string
@@ -1740,6 +1752,18 @@ export class OxBoardAIChat extends LitElement {
1740
1752
  }
1741
1753
 
1742
1754
  updated(changed: Map<string, any>) {
1755
+ /*
1756
+ * 밖에서 넣어 준 질문을 자동 전송한다(오류 토스트의 "AI에게 묻기" 등).
1757
+ *
1758
+ * sessionId 가 붙기 전에 보내면 대화에 남지 않으므로 세션이 준비될 때까지 기다린다.
1759
+ * 같은 문장을 두 번 보내지 않도록 보낸 값을 기억한다 — 재렌더마다 updated 가 다시 돌기 때문이다.
1760
+ */
1761
+ if (this.autoAsk && this.autoAsk !== this._autoAsked && this.sessionId && !this.busy) {
1762
+ this._autoAsked = this.autoAsk
1763
+ this.input = this.autoAsk
1764
+ this.send()
1765
+ }
1766
+
1743
1767
  if (changed.has('sessionId')) {
1744
1768
  // sessionId 가 바뀌면 (set / unset / 다른 보드 전환) 이전 세션의 모든 클라이언트
1745
1769
  // 컨텍스트 정리 — lines / pickedMentions / errorMessage / input 모두 새지 않도록.
@@ -125,6 +125,15 @@ export declare class OxBoardAIChat extends LitElement {
125
125
  placeholder: string;
126
126
  private lines;
127
127
  private input;
128
+ /**
129
+ * 밖에서 질문을 넣어 **자동으로 보내게** 하는 진입점.
130
+ *
131
+ * 오류 토스트의 "AI에게 묻기" 처럼, 사용자가 타이핑하지 않고 곧바로 답을 받아야 하는 경로가 있다.
132
+ * 값이 들어오면 그 문장을 입력으로 삼아 한 번 전송하고 비운다(같은 질문이 반복 전송되지 않게).
133
+ */
134
+ autoAsk?: string;
135
+ /** autoAsk 를 이미 보냈는지 — 재렌더마다 다시 보내지 않기 위한 표식. */
136
+ private _autoAsked?;
128
137
  /** 마지막 send 실패 시 보존 — 다시 시도 버튼 클릭 시 사용 */
129
138
  private lastFailedInput?;
130
139
  /** 되돌려진 patch id 들 — 한 번 revert 한 patch 는 버튼 비활성 */
@@ -1545,6 +1545,17 @@ let OxBoardAIChat = class OxBoardAIChat extends LitElement {
1545
1545
  // 동시 fetch race 발생).
1546
1546
  }
1547
1547
  updated(changed) {
1548
+ /*
1549
+ * 밖에서 넣어 준 질문을 자동 전송한다(오류 토스트의 "AI에게 묻기" 등).
1550
+ *
1551
+ * sessionId 가 붙기 전에 보내면 대화에 남지 않으므로 세션이 준비될 때까지 기다린다.
1552
+ * 같은 문장을 두 번 보내지 않도록 보낸 값을 기억한다 — 재렌더마다 updated 가 다시 돌기 때문이다.
1553
+ */
1554
+ if (this.autoAsk && this.autoAsk !== this._autoAsked && this.sessionId && !this.busy) {
1555
+ this._autoAsked = this.autoAsk;
1556
+ this.input = this.autoAsk;
1557
+ this.send();
1558
+ }
1548
1559
  if (changed.has('sessionId')) {
1549
1560
  // sessionId 가 바뀌면 (set / unset / 다른 보드 전환) 이전 세션의 모든 클라이언트
1550
1561
  // 컨텍스트 정리 — lines / pickedMentions / errorMessage / input 모두 새지 않도록.
@@ -2918,6 +2929,10 @@ __decorate([
2918
2929
  state(),
2919
2930
  __metadata("design:type", Object)
2920
2931
  ], OxBoardAIChat.prototype, "input", void 0);
2932
+ __decorate([
2933
+ property({ attribute: false }),
2934
+ __metadata("design:type", String)
2935
+ ], OxBoardAIChat.prototype, "autoAsk", void 0);
2921
2936
  __decorate([
2922
2937
  state(),
2923
2938
  __metadata("design:type", String)