@things-factory/board-ai 10.1.7 → 10.1.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.
@@ -223,6 +223,21 @@ class DefaultBoardAIAssistant {
223
223
  messages: messages.map(m => (typeof m.content === 'string' ? m.content : '')),
224
224
  toolResults: loopResult.groundedTexts
225
225
  });
226
+ const analysis = (toolUsages.length || patch || accumulatedActions.length || loopResult.proposals.length)
227
+ ? {
228
+ kind: 'board.analysis.v1',
229
+ scope: { boardId: currentBoard?.id },
230
+ window: { turn: messages.length },
231
+ confidence: { level: warnings.length ? 'low' : 'medium', reasons: warnings.length ? ['grounding-warning'] : ['tool-or-board-context'] },
232
+ limitations: warnings.map(code => ({ code })),
233
+ claims: [{ code: patch ? 'board.patch-proposed' : 'board.context-reviewed', severity: 'info', evidence: { toolCalls: toolUsages.length, componentCount: components.length }, method: 'board-agentic-loop', assumptions: ['Board context is current for this turn.'] }],
234
+ facts: { board: boardContext, toolUsages },
235
+ ...(patch ? { proposal: patch } : accumulatedActions.length ? { proposal: accumulatedActions } : {}),
236
+ approvalRequired: true,
237
+ approval: { required: true, mode: 'confirm', reason: patch || accumulatedActions.length ? 'Board or scene change requires user confirmation.' : 'Analysis is advisory.' },
238
+ trace: { source: 'board-ai', generatedAt: new Date().toISOString(), version: '1' }
239
+ }
240
+ : undefined;
226
241
  return {
227
242
  reply,
228
243
  patch,
@@ -231,7 +246,8 @@ class DefaultBoardAIAssistant {
231
246
  actions: accumulatedActions.length > 0 ? accumulatedActions : undefined,
232
247
  /* 제안은 실행 전 상태다 — 대화면이 확인 버튼을 그린다. 서버는 실행하지 않는다. */
233
248
  proposals: loopResult.proposals.length > 0 ? loopResult.proposals : undefined,
234
- groundingWarnings: warnings.length > 0 ? warnings : undefined
249
+ groundingWarnings: warnings.length > 0 ? warnings : undefined,
250
+ analysis
235
251
  };
236
252
  }
237
253
  resolveTypesAndCategories(options) {