@things-factory/board-ai 10.1.52 → 10.1.58
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;
|
|
@@ -55,6 +55,16 @@ function enrichLastUserWithMentions(messages, currentBoard, picks) {
|
|
|
55
55
|
out[lastIdx] = { ...last, content: step2 };
|
|
56
56
|
return out;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Said to the model when the person's rights turned the editing tools off (`boardToolsWithheld`). The editing
|
|
60
|
+
* guide above still describes the tools, so without this the model calls them anyway, fails on each, and
|
|
61
|
+
* writes the calls out as its answer.
|
|
62
|
+
*/
|
|
63
|
+
export const BOARD_EDIT_WITHHELD = '==== BOARD EDITING IS OFF FOR THIS PERSON ====\n' +
|
|
64
|
+
'This person has no permission to change boards (board-ai mutation), so this conversation has no editing tool - ' +
|
|
65
|
+
'the editing instructions above do not apply. Never call an editing tool and never write a tool call out as text. ' +
|
|
66
|
+
'When asked to change the board, say it cannot be changed from this conversation because changing boards needs the ' +
|
|
67
|
+
'board edit permission, which an administrator can grant. You can still answer questions about the board.';
|
|
58
68
|
export class DefaultBoardAIAssistant {
|
|
59
69
|
constructor(base, options = {}) {
|
|
60
70
|
this.base = base;
|
|
@@ -96,7 +106,8 @@ export class DefaultBoardAIAssistant {
|
|
|
96
106
|
const surface = (options.surfacePrompt ?? '').trim();
|
|
97
107
|
const systemPrompt = this.buildSystemPromptForTools(knownTypes, categories, schemas) +
|
|
98
108
|
(surface ? `\n\n==== THIS SURFACE (declared by the app) ====\n${surface}` : '') +
|
|
99
|
-
(guidance.length ? `\n\n==== TOOL USE RULES (from the tools exposed to this conversation) ====\n${guidance.join('\n')}` : '')
|
|
109
|
+
(guidance.length ? `\n\n==== TOOL USE RULES (from the tools exposed to this conversation) ====\n${guidance.join('\n')}` : '') +
|
|
110
|
+
(!gate.coreOn && options.boardToolsWithheld ? `\n\n${BOARD_EDIT_WITHHELD}` : '');
|
|
100
111
|
const selectedRefids = (options.selectedRefids ?? []).filter((n) => typeof n === 'number' && Number.isFinite(n));
|
|
101
112
|
// selection 정보는 항상 포함 (비어 있어도) — LLM 이 "선택된 게 뭐냐" 류 질문에
|
|
102
113
|
// getSelection 을 호출할지 판단하는 데 필요.
|