@things-factory/board-ai 10.0.18 → 10.1.0
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/dist-client/server/service/assistant.d.ts +1 -1
- package/dist-client/server/service/assistant.js +13 -6
- package/dist-client/server/service/assistant.js.map +1 -1
- package/dist-client/server/service/types.d.ts +5 -29
- package/dist-client/server/service/types.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/assistant.d.ts +1 -1
- package/dist-server/service/assistant.js +24 -17
- package/dist-server/service/assistant.js.map +1 -1
- package/dist-server/service/types.d.ts +5 -29
- package/dist-server/service/types.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/server/service/assistant.ts +18 -7
- package/server/service/types.ts +6 -29
- package/dist-client/server/service/agentic-loop.d.ts +0 -121
- package/dist-client/server/service/agentic-loop.js +0 -349
- package/dist-client/server/service/agentic-loop.js.map +0 -1
- package/dist-server/service/agentic-loop.d.ts +0 -121
- package/dist-server/service/agentic-loop.js +0 -354
- package/dist-server/service/agentic-loop.js.map +0 -1
- package/server/service/agentic-loop.test.ts +0 -859
- package/server/service/agentic-loop.ts +0 -533
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import type { AIClient, AITool, AIToolCall, AIToolChatResult } from '@things-factory/ai-client-base';
|
|
5
5
|
import { type BoardModel, type ComponentCategory } from '@things-factory/board-import';
|
|
6
6
|
import type { BoardAIAssistant, BoardEditOp, ChatOptions, ChatResponse, LLMMessage } from './types.js';
|
|
7
|
-
import { type AgenticLoopResult } from '
|
|
7
|
+
import { type AgenticLoopResult } from '@things-factory/ai-client-base';
|
|
8
8
|
import { type ToolSpec, type ToolCategoryFilter } from '@things-factory/ai-client-base';
|
|
9
9
|
export interface BoardAIAssistantOptions {
|
|
10
10
|
/** 기본 scope (chat 호출 시 옵션이 없으면 사용) */
|
|
@@ -5,7 +5,14 @@ import { resolveCatalogMentions } from './catalog-resolver';
|
|
|
5
5
|
// styling write tool builder 들은 registry (./styling/registry.ts) 에서 등록 + dispatch.
|
|
6
6
|
// 직접 import 안 함 — 신규 styling tool 추가 시 registry 에만 spec 추가하면 됨.
|
|
7
7
|
import { buildComponentStyleSummary } from './styling/read-tools';
|
|
8
|
-
|
|
8
|
+
/*
|
|
9
|
+
* 도구 루프는 **계약 층이 소유한다**(2026-09-05). 전에는 이 패키지 안에 있었고, twin-ai 에 같은
|
|
10
|
+
* 모양이 한 벌 더 있었다 — 그래서 안전 장치가 서로 반대로 갈렸다(여기는 중단·조기종료, 저쪽은
|
|
11
|
+
* 접지 가드). 합친 것이 `@things-factory/ai-client-base` 에 있다.
|
|
12
|
+
*
|
|
13
|
+
* board 의 것(문서·선택 refid·편집 op)은 타입 매개변수로 넘긴다 — 루프는 그 모양을 모른다.
|
|
14
|
+
*/
|
|
15
|
+
import { runAgenticLoop } from '@things-factory/ai-client-base';
|
|
9
16
|
import { checkReplyGrounding } from './grounding';
|
|
10
17
|
import { collectAllComponents, findComponentByRefid } from './component-tree';
|
|
11
18
|
import { isStylingTool, dispatchStylingTool, buildStylingToolDefinitions } from './styling/registry.js';
|
|
@@ -156,13 +163,13 @@ export class DefaultBoardAIAssistant {
|
|
|
156
163
|
isReadTool: gate.isRead,
|
|
157
164
|
isWriteTool: gate.isWrite,
|
|
158
165
|
isActionTool: gate.isAction,
|
|
159
|
-
executeReadTool: wrappedExecuteReadTool,
|
|
160
|
-
|
|
161
|
-
|
|
166
|
+
executeReadTool: (tc, ctx) => wrappedExecuteReadTool(tc, ctx.board, ctx.selectedRefids),
|
|
167
|
+
/* 문서에서 부품을 꺼내는 일은 **여기서** 한다 — 루프는 board 의 모양을 모른다. */
|
|
168
|
+
validateWriteToolCall: (tc, ctx) => validateWriteToolCall(tc, (ctx.board?.components ?? [])),
|
|
169
|
+
toolCallToOp: toolCallToBoardActionOp,
|
|
162
170
|
summarizeToolResult
|
|
163
171
|
},
|
|
164
|
-
currentBoard,
|
|
165
|
-
selectedRefids
|
|
172
|
+
context: { board: currentBoard, selectedRefids }
|
|
166
173
|
});
|
|
167
174
|
const accumulatedWriteCalls = loopResult.accumulatedWriteCalls;
|
|
168
175
|
const accumulatedActions = loopResult.accumulatedActions;
|