@things-factory/board-ai 10.1.52 → 10.1.53
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 +6 -0
- package/dist-client/server/service/assistant.js +12 -1
- package/dist-client/server/service/assistant.js.map +1 -1
- package/dist-client/server/service/types.d.ts +6 -0
- package/dist-client/server/service/types.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/assistant.d.ts +6 -0
- package/dist-server/service/assistant.js +13 -2
- package/dist-server/service/assistant.js.map +1 -1
- package/dist-server/service/board-ai-resolver.js +5 -1
- package/dist-server/service/board-ai-resolver.js.map +1 -1
- package/dist-server/service/types.d.ts +6 -0
- package/dist-server/service/types.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/server/service/assistant.ts +14 -1
- package/server/service/board-ai-resolver.ts +6 -1
- package/server/service/dock-contract.test.ts +26 -1
- package/server/service/types.ts +6 -0
|
@@ -13,6 +13,12 @@ export interface BoardAIAssistantOptions {
|
|
|
13
13
|
knownTypes?: string[];
|
|
14
14
|
categories?: ComponentCategory[];
|
|
15
15
|
}
|
|
16
|
+
/**
|
|
17
|
+
* Said to the model when the person's rights turned the editing tools off (`boardToolsWithheld`). The editing
|
|
18
|
+
* guide above still describes the tools, so without this the model calls them anyway, fails on each, and
|
|
19
|
+
* writes the calls out as its answer.
|
|
20
|
+
*/
|
|
21
|
+
export declare const BOARD_EDIT_WITHHELD: string;
|
|
16
22
|
export declare class DefaultBoardAIAssistant implements BoardAIAssistant {
|
|
17
23
|
private base;
|
|
18
24
|
private options;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.summarizeToolResult = exports.formatAbortNotice = exports.DefaultBoardAIAssistant = void 0;
|
|
3
|
+
exports.summarizeToolResult = exports.formatAbortNotice = exports.DefaultBoardAIAssistant = exports.BOARD_EDIT_WITHHELD = void 0;
|
|
4
4
|
exports.buildBoardEditTools = buildBoardEditTools;
|
|
5
5
|
exports.executeReadTool = executeReadTool;
|
|
6
6
|
exports.isReadTool = isReadTool;
|
|
@@ -72,6 +72,16 @@ function enrichLastUserWithMentions(messages, currentBoard, picks) {
|
|
|
72
72
|
out[lastIdx] = { ...last, content: step2 };
|
|
73
73
|
return out;
|
|
74
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Said to the model when the person's rights turned the editing tools off (`boardToolsWithheld`). The editing
|
|
77
|
+
* guide above still describes the tools, so without this the model calls them anyway, fails on each, and
|
|
78
|
+
* writes the calls out as its answer.
|
|
79
|
+
*/
|
|
80
|
+
exports.BOARD_EDIT_WITHHELD = '==== BOARD EDITING IS OFF FOR THIS PERSON ====\n' +
|
|
81
|
+
'This person has no permission to change boards (board-ai mutation), so this conversation has no editing tool - ' +
|
|
82
|
+
'the editing instructions above do not apply. Never call an editing tool and never write a tool call out as text. ' +
|
|
83
|
+
'When asked to change the board, say it cannot be changed from this conversation because changing boards needs the ' +
|
|
84
|
+
'board edit permission, which an administrator can grant. You can still answer questions about the board.';
|
|
75
85
|
class DefaultBoardAIAssistant {
|
|
76
86
|
constructor(base, options = {}) {
|
|
77
87
|
this.base = base;
|
|
@@ -113,7 +123,8 @@ class DefaultBoardAIAssistant {
|
|
|
113
123
|
const surface = (options.surfacePrompt ?? '').trim();
|
|
114
124
|
const systemPrompt = this.buildSystemPromptForTools(knownTypes, categories, schemas) +
|
|
115
125
|
(surface ? `\n\n==== THIS SURFACE (declared by the app) ====\n${surface}` : '') +
|
|
116
|
-
(guidance.length ? `\n\n==== TOOL USE RULES (from the tools exposed to this conversation) ====\n${guidance.join('\n')}` : '')
|
|
126
|
+
(guidance.length ? `\n\n==== TOOL USE RULES (from the tools exposed to this conversation) ====\n${guidance.join('\n')}` : '') +
|
|
127
|
+
(!gate.coreOn && options.boardToolsWithheld ? `\n\n${exports.BOARD_EDIT_WITHHELD}` : '');
|
|
117
128
|
const selectedRefids = (options.selectedRefids ?? []).filter((n) => typeof n === 'number' && Number.isFinite(n));
|
|
118
129
|
// selection 정보는 항상 포함 (비어 있어도) — LLM 이 "선택된 게 뭐냐" 류 질문에
|
|
119
130
|
// getSelection 을 호출할지 판단하는 데 필요.
|