@coreyuan/vector-mind 1.0.52 → 1.0.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/README.md +13 -14
- package/dist/fix-patterns.d.ts +58 -0
- package/dist/fix-patterns.js +347 -0
- package/dist/fix-patterns.js.map +1 -0
- package/dist/memory-recall.js +5 -0
- package/dist/memory-recall.js.map +1 -1
- package/dist/operation-scope.d.ts +63 -0
- package/dist/operation-scope.js +438 -0
- package/dist/operation-scope.js.map +1 -0
- package/dist/server-instructions.js +4 -0
- package/dist/server-instructions.js.map +1 -1
- package/dist/tool-catalog.js +11 -5
- package/dist/tool-catalog.js.map +1 -1
- package/dist/tool-handlers/memory-diagnostics.js +53 -4
- package/dist/tool-handlers/memory-diagnostics.js.map +1 -1
- package/dist/tool-handlers/memory.js +20 -2
- package/dist/tool-handlers/memory.js.map +1 -1
- package/dist/tool-handlers/operations.d.ts +4 -0
- package/dist/tool-handlers/operations.js +62 -0
- package/dist/tool-handlers/operations.js.map +1 -0
- package/dist/tool-handlers/requirements.js +43 -1
- package/dist/tool-handlers/requirements.js.map +1 -1
- package/dist/tool-handlers.js +2 -0
- package/dist/tool-handlers.js.map +1 -1
- package/dist/tool-output.d.ts +53 -0
- package/dist/tool-output.js +50 -0
- package/dist/tool-output.js.map +1 -1
- package/dist/tool-schemas.d.ts +26 -0
- package/dist/tool-schemas.js +22 -0
- package/dist/tool-schemas.js.map +1 -1
- package/package.json +1 -1
- package/skills/vector-mind-autopilot/SKILL.md +24 -0
- package/skills/vector-mind-autopilot/references/claude-project-instructions.md +4 -0
- package/skills/vector-mind-autopilot/references/universal-system-prompt.md +4 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { MemoryItemRow, RequirementRow } from "./types.js";
|
|
2
|
+
export type CurrentConstraint = {
|
|
3
|
+
id: number;
|
|
4
|
+
kind: string;
|
|
5
|
+
title: string | null;
|
|
6
|
+
source: "current_decision" | "convention" | "active_requirement" | "recent_note";
|
|
7
|
+
priority: number;
|
|
8
|
+
preview: string;
|
|
9
|
+
file_path: string | null;
|
|
10
|
+
req_id: number | null;
|
|
11
|
+
updated_at: string;
|
|
12
|
+
};
|
|
13
|
+
export type OperationPlanInput = {
|
|
14
|
+
operation: string;
|
|
15
|
+
intent?: string;
|
|
16
|
+
commands?: string[];
|
|
17
|
+
files?: string[];
|
|
18
|
+
targets?: string[];
|
|
19
|
+
script_hints?: string[];
|
|
20
|
+
};
|
|
21
|
+
export type OperationScopeWarning = {
|
|
22
|
+
code: "operation_constraint_conflict" | "stale_default_conflict" | "operation_scope_unmapped";
|
|
23
|
+
severity: "info" | "warning" | "blocker";
|
|
24
|
+
message: string;
|
|
25
|
+
evidence?: Array<{
|
|
26
|
+
constraint_id: number;
|
|
27
|
+
kind: string;
|
|
28
|
+
title: string | null;
|
|
29
|
+
source: CurrentConstraint["source"];
|
|
30
|
+
preview: string;
|
|
31
|
+
}>;
|
|
32
|
+
details?: Record<string, unknown>;
|
|
33
|
+
};
|
|
34
|
+
export type OperationScopeResult = {
|
|
35
|
+
ok: boolean;
|
|
36
|
+
safe_to_proceed: boolean;
|
|
37
|
+
read_only: true;
|
|
38
|
+
advisory_only: true;
|
|
39
|
+
does_not_control_model_reasoning: true;
|
|
40
|
+
does_not_control_host_runtime: true;
|
|
41
|
+
does_not_replace_model_judgment: true;
|
|
42
|
+
operation: string;
|
|
43
|
+
intent: string;
|
|
44
|
+
planned_commands: string[];
|
|
45
|
+
planned_files: string[];
|
|
46
|
+
planned_targets: string[];
|
|
47
|
+
current_constraints: CurrentConstraint[];
|
|
48
|
+
warnings: OperationScopeWarning[];
|
|
49
|
+
recommended_action: string;
|
|
50
|
+
};
|
|
51
|
+
export declare function buildCurrentConstraints(args: {
|
|
52
|
+
currentDecisions: MemoryItemRow[];
|
|
53
|
+
conventions: MemoryItemRow[];
|
|
54
|
+
activeRequirements: Array<{
|
|
55
|
+
requirement: RequirementRow;
|
|
56
|
+
memory?: MemoryItemRow;
|
|
57
|
+
}>;
|
|
58
|
+
recentNotes: MemoryItemRow[];
|
|
59
|
+
limit?: number;
|
|
60
|
+
previewChars?: number;
|
|
61
|
+
}): CurrentConstraint[];
|
|
62
|
+
export declare function evaluateOperationScope(plan: OperationPlanInput, currentConstraints: CurrentConstraint[]): OperationScopeResult;
|
|
63
|
+
export declare function expandOperationQuery(query: string): string;
|
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
import { isHiddenFromDefaultRecall, metadataStatus, toMemoryItemPreview } from "./memory-recall.js";
|
|
2
|
+
import { oneLine } from "./tool-output.js";
|
|
3
|
+
const NEGATION_PATTERNS = [
|
|
4
|
+
/\bdo\s+not\b/i,
|
|
5
|
+
/\bdon't\b/i,
|
|
6
|
+
/\bmust\s+not\b/i,
|
|
7
|
+
/\bnever\b/i,
|
|
8
|
+
/\bavoid\b/i,
|
|
9
|
+
/\bforbid(?:den)?\b/i,
|
|
10
|
+
/\bdeny\b/i,
|
|
11
|
+
/\bdisallow\b/i,
|
|
12
|
+
/\bno\s+longer\b/i,
|
|
13
|
+
/\bnot\s+use\b/i,
|
|
14
|
+
/\bwithout\b/i,
|
|
15
|
+
/\bskip\b/i,
|
|
16
|
+
/不得/,
|
|
17
|
+
/不能/,
|
|
18
|
+
/禁止/,
|
|
19
|
+
/不要/,
|
|
20
|
+
/不再/,
|
|
21
|
+
/不用/,
|
|
22
|
+
/不使用/,
|
|
23
|
+
/无需/,
|
|
24
|
+
/避免/,
|
|
25
|
+
/不要再/,
|
|
26
|
+
];
|
|
27
|
+
const STALE_DEFAULT_HINT_PATTERNS = [
|
|
28
|
+
/\blegacy\b/i,
|
|
29
|
+
/\bold\b/i,
|
|
30
|
+
/\bprevious\b/i,
|
|
31
|
+
/\bfallback\b/i,
|
|
32
|
+
/\bstale\b/i,
|
|
33
|
+
/\bdeprecated\b/i,
|
|
34
|
+
/\bobsolete\b/i,
|
|
35
|
+
/旧/,
|
|
36
|
+
/历史/,
|
|
37
|
+
/回退/,
|
|
38
|
+
/过时/,
|
|
39
|
+
/废弃/,
|
|
40
|
+
/老/,
|
|
41
|
+
];
|
|
42
|
+
const CURRENT_ALTERNATIVE_PATTERNS = [
|
|
43
|
+
/\binstead\b/i,
|
|
44
|
+
/\bcurrent\b/i,
|
|
45
|
+
/\bnow\b/i,
|
|
46
|
+
/\bonly\b/i,
|
|
47
|
+
/\bsingle\b/i,
|
|
48
|
+
/\bswitch(?:ed)?\s+to\b/i,
|
|
49
|
+
/\bmigrat(?:e|ed|ing)\s+to\b/i,
|
|
50
|
+
/\breplac(?:e|ed|ing)\s+(?:with|by|to)\b/i,
|
|
51
|
+
/\bchanged?\s+to\b/i,
|
|
52
|
+
/当前/,
|
|
53
|
+
/现在/,
|
|
54
|
+
/只保留/,
|
|
55
|
+
/仅保留/,
|
|
56
|
+
/改成/,
|
|
57
|
+
/改为/,
|
|
58
|
+
/改用/,
|
|
59
|
+
/替换/,
|
|
60
|
+
/迁移到/,
|
|
61
|
+
/统一/,
|
|
62
|
+
/最新/,
|
|
63
|
+
/新的/,
|
|
64
|
+
];
|
|
65
|
+
const DEFAULT_HINT_PATTERNS = [
|
|
66
|
+
/\bdefault\b/i,
|
|
67
|
+
/\bfallback\b/i,
|
|
68
|
+
/\bprefer(?:red)?\b/i,
|
|
69
|
+
/\bauto(?:matic)?\b/i,
|
|
70
|
+
/\blegacy\b/i,
|
|
71
|
+
/\bold\b/i,
|
|
72
|
+
/\bprevious\b/i,
|
|
73
|
+
/默认/,
|
|
74
|
+
/旧/,
|
|
75
|
+
/历史/,
|
|
76
|
+
/自动/,
|
|
77
|
+
/优先/,
|
|
78
|
+
/回退/,
|
|
79
|
+
];
|
|
80
|
+
const OPERATION_WORDS = [
|
|
81
|
+
"deploy",
|
|
82
|
+
"publish",
|
|
83
|
+
"release",
|
|
84
|
+
"start",
|
|
85
|
+
"stop",
|
|
86
|
+
"restart",
|
|
87
|
+
"run",
|
|
88
|
+
"build",
|
|
89
|
+
"test",
|
|
90
|
+
"migrate",
|
|
91
|
+
"seed",
|
|
92
|
+
"sync",
|
|
93
|
+
"clean",
|
|
94
|
+
"delete",
|
|
95
|
+
"remove",
|
|
96
|
+
"reset",
|
|
97
|
+
"rollback",
|
|
98
|
+
"commit",
|
|
99
|
+
"push",
|
|
100
|
+
"pull",
|
|
101
|
+
"merge",
|
|
102
|
+
"rebase",
|
|
103
|
+
"部署",
|
|
104
|
+
"发布",
|
|
105
|
+
"上线",
|
|
106
|
+
"启动",
|
|
107
|
+
"停止",
|
|
108
|
+
"重启",
|
|
109
|
+
"构建",
|
|
110
|
+
"测试",
|
|
111
|
+
"迁移",
|
|
112
|
+
"同步",
|
|
113
|
+
"清理",
|
|
114
|
+
"删除",
|
|
115
|
+
"重置",
|
|
116
|
+
"回滚",
|
|
117
|
+
"提交",
|
|
118
|
+
"推送",
|
|
119
|
+
];
|
|
120
|
+
const TOKEN_STOPWORDS = new Set([
|
|
121
|
+
"operation",
|
|
122
|
+
"operations",
|
|
123
|
+
"command",
|
|
124
|
+
"commands",
|
|
125
|
+
"script",
|
|
126
|
+
"scripts",
|
|
127
|
+
"target",
|
|
128
|
+
"targets",
|
|
129
|
+
"current",
|
|
130
|
+
"rule",
|
|
131
|
+
"rules",
|
|
132
|
+
"path",
|
|
133
|
+
"instead",
|
|
134
|
+
"using",
|
|
135
|
+
"run",
|
|
136
|
+
"use",
|
|
137
|
+
"release",
|
|
138
|
+
"deploy",
|
|
139
|
+
"build",
|
|
140
|
+
"test",
|
|
141
|
+
"操作",
|
|
142
|
+
"执行",
|
|
143
|
+
"命令",
|
|
144
|
+
"脚本",
|
|
145
|
+
"目标",
|
|
146
|
+
"当前",
|
|
147
|
+
"规则",
|
|
148
|
+
"路径",
|
|
149
|
+
"使用",
|
|
150
|
+
"运行",
|
|
151
|
+
"发布",
|
|
152
|
+
"部署",
|
|
153
|
+
"构建",
|
|
154
|
+
"测试",
|
|
155
|
+
]);
|
|
156
|
+
function normalizeText(input) {
|
|
157
|
+
return (input ?? "").normalize("NFKC").toLowerCase();
|
|
158
|
+
}
|
|
159
|
+
function tokenize(input) {
|
|
160
|
+
const text = normalizeText(input);
|
|
161
|
+
const tokens = new Set();
|
|
162
|
+
const addToken = (token) => {
|
|
163
|
+
if (token.length >= 2 && !TOKEN_STOPWORDS.has(token))
|
|
164
|
+
tokens.add(token);
|
|
165
|
+
};
|
|
166
|
+
for (const token of text.match(/[a-z0-9_./:@#-]{2,}/g) ?? []) {
|
|
167
|
+
addToken(token);
|
|
168
|
+
for (const part of token.split(/[^a-z0-9]+/)) {
|
|
169
|
+
addToken(part);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
for (const seq of text.match(/\p{Script=Han}+/gu) ?? []) {
|
|
173
|
+
if (seq.length >= 2 && seq.length <= 18)
|
|
174
|
+
addToken(seq);
|
|
175
|
+
for (const n of [2, 3, 4]) {
|
|
176
|
+
if (seq.length < n)
|
|
177
|
+
continue;
|
|
178
|
+
for (let i = 0; i <= seq.length - n; i++)
|
|
179
|
+
addToken(seq.slice(i, i + n));
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return Array.from(tokens).filter((t) => t.length >= 2).slice(0, 80);
|
|
183
|
+
}
|
|
184
|
+
function hasNegation(text) {
|
|
185
|
+
return NEGATION_PATTERNS.some((pattern) => pattern.test(text));
|
|
186
|
+
}
|
|
187
|
+
function hasDefaultHint(text) {
|
|
188
|
+
return DEFAULT_HINT_PATTERNS.some((pattern) => pattern.test(text));
|
|
189
|
+
}
|
|
190
|
+
function hasStaleDefaultHint(text) {
|
|
191
|
+
return STALE_DEFAULT_HINT_PATTERNS.some((pattern) => pattern.test(text));
|
|
192
|
+
}
|
|
193
|
+
function hasCurrentAlternativeHint(text) {
|
|
194
|
+
return CURRENT_ALTERNATIVE_PATTERNS.some((pattern) => pattern.test(text));
|
|
195
|
+
}
|
|
196
|
+
function operationText(input) {
|
|
197
|
+
return [
|
|
198
|
+
input.operation,
|
|
199
|
+
input.intent,
|
|
200
|
+
...(input.commands ?? []),
|
|
201
|
+
...(input.files ?? []),
|
|
202
|
+
...(input.targets ?? []),
|
|
203
|
+
...(input.script_hints ?? []),
|
|
204
|
+
].filter(Boolean).join("\n");
|
|
205
|
+
}
|
|
206
|
+
function concreteOperationText(input) {
|
|
207
|
+
return [
|
|
208
|
+
...(input.commands ?? []),
|
|
209
|
+
...(input.files ?? []),
|
|
210
|
+
...(input.targets ?? []),
|
|
211
|
+
...(input.script_hints ?? []),
|
|
212
|
+
].filter(Boolean).join("\n");
|
|
213
|
+
}
|
|
214
|
+
function negatedConstraintText(text) {
|
|
215
|
+
const chunks = text
|
|
216
|
+
.split(/[\n.;。;,,]/)
|
|
217
|
+
.map((part) => part.trim())
|
|
218
|
+
.filter(Boolean);
|
|
219
|
+
const negated = chunks.filter(hasNegation);
|
|
220
|
+
return negated.length ? negated.join("\n") : text;
|
|
221
|
+
}
|
|
222
|
+
function tokenOverlapScore(a, b) {
|
|
223
|
+
const aTokens = tokenize(a);
|
|
224
|
+
const bText = normalizeText(b);
|
|
225
|
+
let score = 0;
|
|
226
|
+
for (const token of aTokens) {
|
|
227
|
+
if (bText.includes(token))
|
|
228
|
+
score += Math.min(4, Math.max(1, token.length / 3));
|
|
229
|
+
}
|
|
230
|
+
return score;
|
|
231
|
+
}
|
|
232
|
+
function rowPriority(row, source) {
|
|
233
|
+
if (source === "current_decision")
|
|
234
|
+
return 100;
|
|
235
|
+
if (source === "active_requirement")
|
|
236
|
+
return 80;
|
|
237
|
+
if (source === "convention")
|
|
238
|
+
return 70;
|
|
239
|
+
return 35;
|
|
240
|
+
}
|
|
241
|
+
function toConstraint(row, source, previewChars) {
|
|
242
|
+
const preview = toMemoryItemPreview(row, false, previewChars, 0);
|
|
243
|
+
return {
|
|
244
|
+
id: row.id,
|
|
245
|
+
kind: row.kind,
|
|
246
|
+
title: row.title,
|
|
247
|
+
source,
|
|
248
|
+
priority: rowPriority(row, source),
|
|
249
|
+
preview: preview.preview,
|
|
250
|
+
file_path: row.file_path,
|
|
251
|
+
req_id: row.req_id,
|
|
252
|
+
updated_at: row.updated_at,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
function requirementToMemoryRow(req, memoryRow) {
|
|
256
|
+
if (memoryRow)
|
|
257
|
+
return memoryRow;
|
|
258
|
+
return {
|
|
259
|
+
id: -req.id,
|
|
260
|
+
kind: "requirement",
|
|
261
|
+
title: req.title,
|
|
262
|
+
content: `${req.title}\n\n${req.context_data}`,
|
|
263
|
+
file_path: null,
|
|
264
|
+
start_line: null,
|
|
265
|
+
end_line: null,
|
|
266
|
+
req_id: req.id,
|
|
267
|
+
metadata_json: null,
|
|
268
|
+
content_hash: "",
|
|
269
|
+
created_at: req.created_at,
|
|
270
|
+
updated_at: req.created_at,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
export function buildCurrentConstraints(args) {
|
|
274
|
+
const limit = args.limit ?? 12;
|
|
275
|
+
const previewChars = args.previewChars ?? 180;
|
|
276
|
+
const constraints = new Map();
|
|
277
|
+
const add = (row, source) => {
|
|
278
|
+
if (!row)
|
|
279
|
+
return;
|
|
280
|
+
if (isHiddenFromDefaultRecall(row))
|
|
281
|
+
return;
|
|
282
|
+
const existing = constraints.get(row.id);
|
|
283
|
+
const next = toConstraint(row, source, previewChars);
|
|
284
|
+
if (!existing || next.priority > existing.priority)
|
|
285
|
+
constraints.set(row.id, next);
|
|
286
|
+
};
|
|
287
|
+
for (const row of args.currentDecisions) {
|
|
288
|
+
if (metadataStatus(row) === "superseded")
|
|
289
|
+
continue;
|
|
290
|
+
add(row, "current_decision");
|
|
291
|
+
}
|
|
292
|
+
for (const row of args.conventions)
|
|
293
|
+
add(row, "convention");
|
|
294
|
+
for (const item of args.activeRequirements)
|
|
295
|
+
add(requirementToMemoryRow(item.requirement, item.memory), "active_requirement");
|
|
296
|
+
for (const row of args.recentNotes)
|
|
297
|
+
add(row, "recent_note");
|
|
298
|
+
return Array.from(constraints.values())
|
|
299
|
+
.sort((a, b) => b.priority - a.priority || Date.parse(b.updated_at) - Date.parse(a.updated_at) || b.id - a.id)
|
|
300
|
+
.slice(0, limit);
|
|
301
|
+
}
|
|
302
|
+
function classifyConstraintConflict(plan, constraint) {
|
|
303
|
+
const constraintText = `${constraint.title ?? ""}\n${constraint.preview}`;
|
|
304
|
+
if (!hasNegation(constraintText))
|
|
305
|
+
return null;
|
|
306
|
+
const deniedText = negatedConstraintText(constraintText);
|
|
307
|
+
const concreteText = concreteOperationText(plan);
|
|
308
|
+
const concreteScore = tokenOverlapScore(concreteText, deniedText);
|
|
309
|
+
const fullPlanText = operationText(plan);
|
|
310
|
+
const fullScore = tokenOverlapScore(fullPlanText, deniedText);
|
|
311
|
+
const naturalPlanText = `${plan.operation}\n${plan.intent ?? ""}`;
|
|
312
|
+
const naturalPlanAlreadyAligned = hasNegation(naturalPlanText);
|
|
313
|
+
const hasConcreteDetails = concreteText.trim().length > 0;
|
|
314
|
+
if (hasConcreteDetails ? concreteScore < 5 : (fullScore < 7 || naturalPlanAlreadyAligned))
|
|
315
|
+
return null;
|
|
316
|
+
const score = Math.max(concreteScore, fullScore);
|
|
317
|
+
return {
|
|
318
|
+
code: "operation_constraint_conflict",
|
|
319
|
+
severity: constraint.source === "current_decision" || constraint.source === "active_requirement" ? "blocker" : "warning",
|
|
320
|
+
message: "The planned operation appears related to a current constraint that contains a deny/avoid/no-longer rule. Re-check the plan against the current user requirement before running commands.",
|
|
321
|
+
evidence: [{
|
|
322
|
+
constraint_id: constraint.id,
|
|
323
|
+
kind: constraint.kind,
|
|
324
|
+
title: constraint.title,
|
|
325
|
+
source: constraint.source,
|
|
326
|
+
preview: oneLine(constraint.preview, 220),
|
|
327
|
+
}],
|
|
328
|
+
details: { overlap_score: score },
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
function classifyStaleDefaultConflict(plan, constraint) {
|
|
332
|
+
const scriptText = [...(plan.commands ?? []), ...(plan.targets ?? []), ...(plan.script_hints ?? [])].join("\n");
|
|
333
|
+
if (!scriptText)
|
|
334
|
+
return null;
|
|
335
|
+
const constraintText = `${constraint.title ?? ""}\n${constraint.preview}`;
|
|
336
|
+
const hasStaleRisk = hasStaleDefaultHint(scriptText) ||
|
|
337
|
+
(hasDefaultHint(scriptText) && (hasNegation(constraintText) || hasCurrentAlternativeHint(constraintText)));
|
|
338
|
+
if (!hasStaleRisk)
|
|
339
|
+
return null;
|
|
340
|
+
const score = tokenOverlapScore(scriptText, constraintText);
|
|
341
|
+
if (score < 4)
|
|
342
|
+
return null;
|
|
343
|
+
return {
|
|
344
|
+
code: "stale_default_conflict",
|
|
345
|
+
severity: constraint.source === "current_decision" ? "blocker" : "warning",
|
|
346
|
+
message: "A script/default/fallback mentioned in the operation overlaps with a newer current constraint. Treat repository defaults as possibly stale until aligned with the current decision or requirement.",
|
|
347
|
+
evidence: [{
|
|
348
|
+
constraint_id: constraint.id,
|
|
349
|
+
kind: constraint.kind,
|
|
350
|
+
title: constraint.title,
|
|
351
|
+
source: constraint.source,
|
|
352
|
+
preview: oneLine(constraint.preview, 220),
|
|
353
|
+
}],
|
|
354
|
+
details: { overlap_score: score },
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
export function evaluateOperationScope(plan, currentConstraints) {
|
|
358
|
+
const text = operationText(plan);
|
|
359
|
+
const warnings = [];
|
|
360
|
+
if (!text.trim()) {
|
|
361
|
+
warnings.push({
|
|
362
|
+
code: "operation_scope_unmapped",
|
|
363
|
+
severity: "warning",
|
|
364
|
+
message: "No concrete operation intent, command, target, or file was provided. Provide the planned operation before executing so it can be checked against current constraints.",
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
const planHasOperationWord = OPERATION_WORDS.some((word) => normalizeText(text).includes(normalizeText(word)));
|
|
368
|
+
if (!planHasOperationWord && (plan.commands?.length || plan.targets?.length || plan.files?.length)) {
|
|
369
|
+
warnings.push({
|
|
370
|
+
code: "operation_scope_unmapped",
|
|
371
|
+
severity: "info",
|
|
372
|
+
message: "The plan includes commands/files/targets but does not clearly name the operation type. This is advisory only; add a concise operation label for better constraint matching.",
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
for (const constraint of currentConstraints) {
|
|
376
|
+
const conflict = classifyConstraintConflict(plan, constraint);
|
|
377
|
+
if (conflict)
|
|
378
|
+
warnings.push(conflict);
|
|
379
|
+
const staleDefault = classifyStaleDefaultConflict(plan, constraint);
|
|
380
|
+
if (staleDefault)
|
|
381
|
+
warnings.push(staleDefault);
|
|
382
|
+
}
|
|
383
|
+
const deduped = new Map();
|
|
384
|
+
for (const warning of warnings) {
|
|
385
|
+
const key = `${warning.code}:${warning.evidence?.[0]?.constraint_id ?? ""}:${warning.message}`;
|
|
386
|
+
const prev = deduped.get(key);
|
|
387
|
+
if (!prev || (prev.severity !== "blocker" && warning.severity === "blocker"))
|
|
388
|
+
deduped.set(key, warning);
|
|
389
|
+
}
|
|
390
|
+
const finalWarnings = Array.from(deduped.values());
|
|
391
|
+
const blocking = finalWarnings.some((w) => w.severity === "blocker");
|
|
392
|
+
return {
|
|
393
|
+
ok: !blocking,
|
|
394
|
+
safe_to_proceed: !blocking,
|
|
395
|
+
read_only: true,
|
|
396
|
+
advisory_only: true,
|
|
397
|
+
does_not_control_model_reasoning: true,
|
|
398
|
+
does_not_control_host_runtime: true,
|
|
399
|
+
does_not_replace_model_judgment: true,
|
|
400
|
+
operation: plan.operation,
|
|
401
|
+
intent: plan.intent ?? "",
|
|
402
|
+
planned_commands: plan.commands ?? [],
|
|
403
|
+
planned_files: plan.files ?? [],
|
|
404
|
+
planned_targets: plan.targets ?? [],
|
|
405
|
+
current_constraints: currentConstraints,
|
|
406
|
+
warnings: finalWarnings,
|
|
407
|
+
recommended_action: blocking
|
|
408
|
+
? "Stop before executing. Align the operation with current constraints, choose a narrower target/command, or ask the user to explicitly expand or override the constraint."
|
|
409
|
+
: finalWarnings.length
|
|
410
|
+
? "Proceed only after checking the warnings against the current user request and directly observed repository facts."
|
|
411
|
+
: "No operation-scope conflicts detected from current constraints.",
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
export function expandOperationQuery(query) {
|
|
415
|
+
const q = normalizeText(query);
|
|
416
|
+
if (!OPERATION_WORDS.some((word) => q.includes(normalizeText(word))))
|
|
417
|
+
return query;
|
|
418
|
+
const genericTerms = [
|
|
419
|
+
"operation",
|
|
420
|
+
"command",
|
|
421
|
+
"script",
|
|
422
|
+
"target",
|
|
423
|
+
"default",
|
|
424
|
+
"fallback",
|
|
425
|
+
"current decision",
|
|
426
|
+
"constraint",
|
|
427
|
+
"convention",
|
|
428
|
+
"执行",
|
|
429
|
+
"命令",
|
|
430
|
+
"脚本",
|
|
431
|
+
"目标",
|
|
432
|
+
"默认",
|
|
433
|
+
"当前决策",
|
|
434
|
+
"约束",
|
|
435
|
+
];
|
|
436
|
+
return Array.from(new Set([query, ...genericTerms])).join(" ");
|
|
437
|
+
}
|
|
438
|
+
//# sourceMappingURL=operation-scope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-scope.js","sourceRoot":"","sources":["../src/operation-scope.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,yBAAyB,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACpG,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAuD3C,MAAM,iBAAiB,GAAG;IACxB,eAAe;IACf,YAAY;IACZ,iBAAiB;IACjB,YAAY;IACZ,YAAY;IACZ,qBAAqB;IACrB,WAAW;IACX,eAAe;IACf,kBAAkB;IAClB,gBAAgB;IAChB,cAAc;IACd,WAAW;IACX,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,KAAK;IACL,IAAI;IACJ,IAAI;IACJ,KAAK;CACN,CAAC;AAEF,MAAM,2BAA2B,GAAG;IAClC,aAAa;IACb,UAAU;IACV,eAAe;IACf,eAAe;IACf,YAAY;IACZ,iBAAiB;I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AC,eAAe,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACnF,MAAM,YAAY,GAAG;QACnB,WAAW;QACX,SAAS;QACT,QAAQ;QACR,QAAQ;QACR,SAAS;QACT,UAAU;QACV,kBAAkB;QAClB,YAAY;QACZ,YAAY;QACZ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,IAAI;QACJ,MAAM;QACN,IAAI;KACL,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -52,6 +52,9 @@ export function buildServerInstructions() {
|
|
|
52
52
|
" - bootstrap_context/get_brain_dump always include a small recency anchor named current_context (latest active requirements, recent notes, and recent change intents) in addition to query matches; tune output size with: requirements_limit/changes_limit/notes_limit/decisions_limit/current_context_limit, preview_chars, pending_limit/pending_offset.",
|
|
53
53
|
" - Prefer read_memory_item({ project_root, id, offset, limit }) to fetch full text on demand instead of returning large content in other tool outputs.",
|
|
54
54
|
"- For pure execution-first tasks with explicit targets (for example compile/build/run/launch/package/publish/test rerun), you may skip retrieval and go straight to the minimum necessary shell or host tools unless code/context lookup is actually needed to unblock execution.",
|
|
55
|
+
"- Before running concrete operation commands where a stale default could matter (deploy/publish/build/test/migrate/service/git/batch scripts), call preflight_operation_scope({ project_root, operation, intent, commands?, files?, targets?, script_hints? }) to compare the plan with current_constraints. Treat stale_default_conflict/operation_constraint_conflict as advisory quality signals; they do not control host execution or model reasoning.",
|
|
56
|
+
"- bootstrap_context/get_brain_dump include current_constraints derived from current decisions, conventions, active requirements, and recent durable notes, not arbitrary old completed requirements. Current user instructions and directly observed repository facts still win over stale memory.",
|
|
57
|
+
"- bootstrap_context/preflight_change_scope may include quality_signals.relevant_fix_patterns from explicitly recorded fix_pattern memories. These are advisory regression reminders only: they must not change ok/safe_to_edit, must not control host execution, must not replace model judgment, and must not expand the current requirement scope. VectorMind does not infer fix patterns automatically; sync_change_intent only stores one when the caller explicitly provides fix_pattern.",
|
|
55
58
|
"- If rtk is installed or VectorMind's bundled RTK shim is verified (detect_rtk with gain_ok=true), prefix shell commands with the command returned by detect_rtk. Usually this is rtk (rtk git status, rtk npm run build, rtk rg ...); in npx/MCP-only installs it may be a package shim command such as node <...>/rtk-shim.js.",
|
|
56
59
|
"- If rtk is missing and the user asks to install it, use install_rtk first with dry_run=true to show the exact commands; execute with dry_run=false only when the user explicitly asks to install/init.",
|
|
57
60
|
"- To read local Codex skill/prompt/rule files (for example SKILL.md under CODEX_HOME or AGENTS_HOME), prefer read_codex_text_file({ path }) instead of assuming another local-file MCP resource server exists.",
|
|
@@ -69,6 +72,7 @@ export function buildServerInstructions() {
|
|
|
69
72
|
"- Do not keep piling new feature code into a large single file. Prefer small modules/services/components; if an implementation file is already large, split it before adding more responsibilities.",
|
|
70
73
|
"- If preflight_change_scope/read_file_lines/grep/query_codebase/get_pending_changes/sync_change_intent returns huge_file_modularization_required, do not continue normal feature work. Call plan_large_file_split, perform mechanical modularization with real module names/directories, never create generated/parts/partN files, then call record_large_file_split before resuming normal feature work. Only use preflight_change_scope(change_mode='mechanical_modularization') for the split itself; use change_mode='emergency_hotfix' only for the smallest urgent fix and still record why the split was deferred.",
|
|
71
74
|
"- AFTER editing + saving: call get_pending_changes({ project_root }) to see unsynced files, then call sync_change_intent({ project_root, intent, files? }). (You can omit files to auto-link all pending changes.)",
|
|
75
|
+
" - If the edit fixed a recurring class of defect and the root cause is known, optionally include fix_pattern with symptom/root_cause/invariant/applies_when/avoid_regression plus verification fields. Keep it generic and project-agnostic; do not record business-specific one-off rules.",
|
|
72
76
|
"- If preflight_change_scope, read_file_lines, grep, query_codebase, get_pending_changes, or sync_change_intent returns development_warnings, address those warnings before continuing or explain why the current requirement truly needs that scope.",
|
|
73
77
|
"- After major milestones/decisions: call upsert_project_summary({ project_root, summary }) and/or add_note({ project_root, ... }) to persist durable context locally.",
|
|
74
78
|
"- When a requirement or user decision changes/reverses an older behavior, call upsert_decision({ project_root, key, title, content, supersedes_req_ids?/supersedes_memory_ids? }) and/or supersede_memory({ project_root, ... }). Current decisions are shown in bootstrap_context/get_brain_dump and superseded memories are hidden from default semantic recall so stale requirements do not override newer facts.",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../src/server-instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uDAAuD,EACvD,gDAAgD,EAChD,2CAA2C,EAC3C,uCAAuC,EACvC,0CAA0C,EAC1C,kCAAkC,EAClC,8BAA8B,EAC9B,wDAAwD,EACxD,0CAA0C,EAC1C,iCAAiC,GAClC,MAAM,2BAA2B,CAAC;AACnC,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,wFAAwF;QACxF,oLAAoL;QACpL,sTAAsT;QACtT,2UAA2U;QAC3U,oHAAoH;QACpH,EAAE;QACF,0CAA0C;QAC1C,iCAAiC;QACjC,EAAE;QACF,gDAAgD;QAChD,8BAA8B;QAC9B,EAAE;QACF,+CAA+C;QAC/C,gDAAgD;QAChD,EAAE;QACF,6DAA6D;QAC7D,uDAAuD;QACvD,EAAE;QACF,8DAA8D;QAC9D,wDAAwD;QACxD,EAAE;QACF,iDAAiD;QACjD,2CAA2C;QAC3C,EAAE;QACF,6CAA6C;QAC7C,uCAAuC;QACvC,EAAE;QACF,kEAAkE;QAClE,0CAA0C;QAC1C,EAAE;QACF,oDAAoD;QACpD,kCAAkC;QAClC,EAAE;QACF,uDAAuD;QACvD,0CAA0C;QAC1C,EAAE;QACF,sDAAsD;QACtD,yJAAyJ;QACzJ,6JAA6J;QAC7J,0PAA0P;QAC1P,6FAA6F;QAC7F,6LAA6L;QAC7L,kIAAkI;QAClI,EAAE;QACF,sBAAsB;QACtB,kGAAkG;QAClG,uSAAuS;QACvS,sHAAsH;QACtH,8VAA8V;QAC9V,yJAAyJ;QACzJ,mRAAmR;QACnR,kUAAkU;QAClU,yMAAyM;QACzM,gNAAgN;QAChN,4MAA4M;QAC5M,iQAAiQ;QACjQ,2QAA2Q;QAC3Q,4JAA4J;QAC5J,mHAAmH;QACnH,gNAAgN;QAChN,kLAAkL;QAClL,8VAA8V;QAC9V,6NAA6N;QAC7N,2RAA2R;QAC3R,kPAAkP;QAClP,qMAAqM;QACrM,2lBAA2lB;QAC3lB,oNAAoN;QACpN,sPAAsP;QACtP,uKAAuK;QACvK,sZAAsZ;QACtZ,+MAA+M;QAC/M,8IAA8I;QAC9I,sHAAsH;QACtH,4QAA4Q;QAC5Q,4NAA4N;QAC5N,qPAAqP;QACrP,oXAAoX;QACpX,qUAAqU;QACrU,0HAA0H;QAC1H,EAAE;QACF,uNAAuN;KACxN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
|
1
|
+
{"version":3,"file":"server-instructions.js","sourceRoot":"","sources":["../src/server-instructions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uDAAuD,EACvD,gDAAgD,EAChD,2CAA2C,EAC3C,uCAAuC,EACvC,0CAA0C,EAC1C,kCAAkC,EAClC,8BAA8B,EAC9B,wDAAwD,EACxD,0CAA0C,EAC1C,iCAAiC,GAClC,MAAM,2BAA2B,CAAC;AACnC,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,wFAAwF;QACxF,oLAAoL;QACpL,sTAAsT;QACtT,2UAA2U;QAC3U,oHAAoH;QACpH,EAAE;QACF,0CAA0C;QAC1C,iCAAiC;QACjC,EAAE;QACF,gDAAgD;QAChD,8BAA8B;QAC9B,EAAE;QACF,+CAA+C;QAC/C,gDAAgD;QAChD,EAAE;QACF,6DAA6D;QAC7D,uDAAuD;QACvD,EAAE;QACF,8DAA8D;QAC9D,wDAAwD;QACxD,EAAE;QACF,iDAAiD;QACjD,2CAA2C;QAC3C,EAAE;QACF,6CAA6C;QAC7C,uCAAuC;QACvC,EAAE;QACF,kEAAkE;QAClE,0CAA0C;QAC1C,EAAE;QACF,oDAAoD;QACpD,kCAAkC;QAClC,EAAE;QACF,uDAAuD;QACvD,0CAA0C;QAC1C,EAAE;QACF,sDAAsD;QACtD,yJAAyJ;QACzJ,6JAA6J;QAC7J,0PAA0P;QAC1P,6FAA6F;QAC7F,6LAA6L;QAC7L,kIAAkI;QAClI,EAAE;QACF,sBAAsB;QACtB,kGAAkG;QAClG,uSAAuS;QACvS,sHAAsH;QACtH,8VAA8V;QAC9V,yJAAyJ;QACzJ,mRAAmR;QACnR,6bAA6b;QAC7b,oSAAoS;QACpS,geAAge;QAChe,kUAAkU;QAClU,yMAAyM;QACzM,gNAAgN;QAChN,4MAA4M;QAC5M,iQAAiQ;QACjQ,2QAA2Q;QAC3Q,4JAA4J;QAC5J,mHAAmH;QACnH,gNAAgN;QAChN,kLAAkL;QAClL,8VAA8V;QAC9V,6NAA6N;QAC7N,2RAA2R;QAC3R,kPAAkP;QAClP,qMAAqM;QACrM,2lBAA2lB;QAC3lB,oNAAoN;QACpN,8RAA8R;QAC9R,sPAAsP;QACtP,uKAAuK;QACvK,sZAAsZ;QACtZ,+MAA+M;QAC/M,8IAA8I;QAC9I,sHAAsH;QACtH,4QAA4Q;QAC5Q,4NAA4N;QAC5N,qPAAqP;QACrP,oXAAoX;QACpX,qUAAqU;QACrU,0HAA0H;QAC1H,EAAE;QACF,uNAAuN;KACxN,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
package/dist/tool-catalog.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { toJsonSchemaCompat } from "@modelcontextprotocol/sdk/server/zod-json-schema-compat.js";
|
|
2
|
-
import { AddNoteArgsSchema, AnalyzeMemoryConflictsArgsSchema, BootstrapContextArgsSchema, ClearActivityLogArgsSchema, CompareCheckpointContextArgsSchema, CompleteRequirementArgsSchema, CreateCheckpointArgsSchema, DetectRtkArgsSchema, GetActivityLogArgsSchema, GetActivitySummaryArgsSchema, GetBrainDumpArgsSchema, GetPendingChangesArgsSchema, GetTokenSavingsArgsSchema, GrepArgsSchema, InstallRtkArgsSchema, ListCheckpointsArgsSchema, ListProjectFilesArgsSchema, MaintainMemoryArgsSchema, MemoryTimelineArgsSchema, MemoryQualityReportArgsSchema, PlanLargeFileSplitArgsSchema, PreflightChangeScopeArgsSchema, PruneIndexArgsSchema, QueryCodebaseArgsSchema, ReadCodexTextFileArgsSchema, ReadFileLinesArgsSchema, ReadFileTextArgsSchema, ReadMemoryItemArgsSchema, RecordLargeFileSplitArgsSchema, RestoreCheckpointContextArgsSchema, SemanticSearchArgsSchema, StartRequirementArgsSchema, SupersedeMemoryArgsSchema, SyncChangeIntentArgsSchema, UpsertConventionArgsSchema, UpsertDecisionArgsSchema, UpsertProjectSummaryArgsSchema, } from "./tool-schemas.js";
|
|
2
|
+
import { AddNoteArgsSchema, AnalyzeMemoryConflictsArgsSchema, BootstrapContextArgsSchema, ClearActivityLogArgsSchema, CompareCheckpointContextArgsSchema, CompleteRequirementArgsSchema, CreateCheckpointArgsSchema, DetectRtkArgsSchema, GetActivityLogArgsSchema, GetActivitySummaryArgsSchema, GetBrainDumpArgsSchema, GetPendingChangesArgsSchema, GetTokenSavingsArgsSchema, GrepArgsSchema, InstallRtkArgsSchema, ListCheckpointsArgsSchema, ListProjectFilesArgsSchema, MaintainMemoryArgsSchema, MemoryTimelineArgsSchema, MemoryQualityReportArgsSchema, PlanLargeFileSplitArgsSchema, PreflightChangeScopeArgsSchema, PreflightOperationScopeArgsSchema, PruneIndexArgsSchema, QueryCodebaseArgsSchema, ReadCodexTextFileArgsSchema, ReadFileLinesArgsSchema, ReadFileTextArgsSchema, ReadMemoryItemArgsSchema, RecordLargeFileSplitArgsSchema, RestoreCheckpointContextArgsSchema, SemanticSearchArgsSchema, StartRequirementArgsSchema, SupersedeMemoryArgsSchema, SyncChangeIntentArgsSchema, UpsertConventionArgsSchema, UpsertDecisionArgsSchema, UpsertProjectSummaryArgsSchema, } from "./tool-schemas.js";
|
|
3
3
|
const DEFAULT_READ_ONLY_BEHAVIOR = {
|
|
4
4
|
tags: ["read_only", "advisory_only", "bounded_output"],
|
|
5
5
|
readOnlyHint: true,
|
|
@@ -8,7 +8,8 @@ const DEFAULT_READ_ONLY_BEHAVIOR = {
|
|
|
8
8
|
};
|
|
9
9
|
const TOOL_BEHAVIOR = {
|
|
10
10
|
start_requirement: { tags: ["write_memory", "requirement_boundary", "advisory_only"], readOnlyHint: false, idempotentHint: false },
|
|
11
|
-
sync_change_intent: { tags: ["write_memory", "change_intent", "advisory_only"], readOnlyHint: false, idempotentHint: false },
|
|
11
|
+
sync_change_intent: { tags: ["write_memory", "change_intent", "fix_pattern", "advisory_only"], readOnlyHint: false, idempotentHint: false },
|
|
12
|
+
preflight_operation_scope: { tags: ["read_only", "operation_scope", "current_constraints", "advisory_only"], readOnlyHint: true, idempotentHint: true },
|
|
12
13
|
record_large_file_split: { tags: ["write_memory", "large_file_tracking", "advisory_only"], readOnlyHint: false, idempotentHint: false },
|
|
13
14
|
complete_requirement: { tags: ["write_memory", "requirement_lifecycle", "advisory_only"], readOnlyHint: false, idempotentHint: false },
|
|
14
15
|
clear_activity_log: { tags: ["diagnostic_state", "non_project_memory"], readOnlyHint: false, idempotentHint: true },
|
|
@@ -57,14 +58,19 @@ export async function listToolDefinitions() {
|
|
|
57
58
|
},
|
|
58
59
|
{
|
|
59
60
|
name: "sync_change_intent",
|
|
60
|
-
description: "MUST call AFTER you edit code and save files. Archives the intent summary, links affected files to the current active requirement, and returns development_warnings for oversized files, broad change scope, or missing file targets.",
|
|
61
|
+
description: "MUST call AFTER you edit code and save files. Archives the intent summary, links affected files to the current active requirement, and returns development_warnings for oversized files, broad change scope, or missing file targets. Optionally stores an explicit fix_pattern as advisory regression-memory; VectorMind does not infer fix patterns automatically.",
|
|
61
62
|
inputSchema: toJsonSchemaCompat(SyncChangeIntentArgsSchema),
|
|
62
63
|
},
|
|
63
64
|
{
|
|
64
65
|
name: "preflight_change_scope",
|
|
65
|
-
description: "MUST call BEFORE editing once you know the intended files/modules. Checks planned files against the active requirement, optional generic scope_allow/scope_deny/allowed_paths/denied_paths, and optional requirement_items/planned_changes mapping. If ok=false/safe_to_edit=false, stop before editing and narrow the plan or scope contract. For huge files, use change_mode='mechanical_modularization' only when the task is to split the file.",
|
|
66
|
+
description: "MUST call BEFORE editing once you know the intended files/modules. Checks planned files against the active requirement, optional generic scope_allow/scope_deny/allowed_paths/denied_paths, and optional requirement_items/planned_changes mapping. Also returns relevant fix_pattern quality_signals as advisory-only regression reminders that must not change ok/safe_to_edit or expand scope. If ok=false/safe_to_edit=false, stop before editing and narrow the plan or scope contract. For huge files, use change_mode='mechanical_modularization' only when the task is to split the file.",
|
|
66
67
|
inputSchema: toJsonSchemaCompat(PreflightChangeScopeArgsSchema),
|
|
67
68
|
},
|
|
69
|
+
{
|
|
70
|
+
name: "preflight_operation_scope",
|
|
71
|
+
description: "Call BEFORE running concrete operation commands such as deploy/publish/build/test/migrate/service/git/batch scripts. It compares the planned operation/commands/files/targets against current_constraints from decisions, conventions, active requirements, and recent notes. Reports stale_default_conflict or operation_constraint_conflict as advisory quality signals only; it does not control host execution or model reasoning.",
|
|
72
|
+
inputSchema: toJsonSchemaCompat(PreflightOperationScopeArgsSchema),
|
|
73
|
+
},
|
|
68
74
|
{
|
|
69
75
|
name: "plan_large_file_split",
|
|
70
76
|
description: "Plan a mechanical modularization split for a huge implementation file. Produces real module names/directories and explicitly forbids generated/parts/partN files. Use this before normal feature work when preflight_change_scope returns huge_file_modularization_required.",
|
|
@@ -82,7 +88,7 @@ export async function listToolDefinitions() {
|
|
|
82
88
|
},
|
|
83
89
|
{
|
|
84
90
|
name: "bootstrap_context",
|
|
85
|
-
description: "MUST call at the start of every new chat/session. Returns brain dump + pending changes + development_warnings, and (if you pass query) matches from the local memory store to avoid guessing.",
|
|
91
|
+
description: "MUST call at the start of every new chat/session. Returns brain dump + pending changes + development_warnings, advisory quality_signals such as relevant fix_pattern reminders, and (if you pass query) matches from the local memory store to avoid guessing.",
|
|
86
92
|
inputSchema: toJsonSchemaCompat(BootstrapContextArgsSchema),
|
|
87
93
|
},
|
|
88
94
|
{
|
package/dist/tool-catalog.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-catalog.js","sourceRoot":"","sources":["../src/tool-catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,4DAA4D,CAAC;AAChG,OAAO,EACL,iBAAiB,EACjB,gCAAgC,EAChC,0BAA0B,EAC1B,0BAA0B,EAC1B,kCAAkC,EAClC,6BAA6B,EAC7B,0BAA0B,EAC1B,mBAAmB,EACnB,wBAAwB,EACxB,4BAA4B,EAC5B,sBAAsB,EACtB,2BAA2B,EAC3B,yBAAyB,EACzB,cAAc,EACd,oBAAoB,EACpB,yBAAyB,EACzB,0BAA0B,EAC1B,wBAAwB,EACxB,wBAAwB,EACxB,6BAA6B,EAC7B,4BAA4B,EAC5B,8BAA8B,EAC9B,oBAAoB,EACpB,uBAAuB,EACvB,2BAA2B,EAC3B,uBAAuB,EACvB,sBAAsB,EACtB,wBAAwB,EACxB,8BAA8B,EAC9B,kCAAkC,EAClC,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,0BAA0B,EAC1B,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,mBAAmB,CAAC;AAuB3B,MAAM,0BAA0B,GAAiB;IAC/C,IAAI,EAAE,CAAC,WAAW,EAAE,eAAe,EAAE,gBAAgB,CAAC;IACtD,YAAY,EAAE,IAAI;IAClB,cAAc,EAAE,IAAI;IACpB,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF,MAAM,aAAa,GAAiC;IAClD,iBAAiB,EAAE,EAAE,IAAI,EAAE,CAAC,cAAc,EAAE,s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