nodebench-mcp 2.4.0 → 2.6.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.
@@ -0,0 +1,573 @@
1
+ /**
2
+ * Research writing tools — AI-powered academic paper polishing, translation,
3
+ * logic checking, and reviewer simulation.
4
+ *
5
+ * Adapted from battle-tested prompts in awesome-ai-research-writing
6
+ * (https://github.com/Leey21/awesome-ai-research-writing) — used at MSRA,
7
+ * Bytedance Seed, SH AI Lab, and top Chinese universities.
8
+ *
9
+ * Provider fallback: Gemini → OpenAI → Anthropic (same as llmTools.ts)
10
+ */
11
+ async function getGeminiProvider() {
12
+ const apiKey = process.env.GEMINI_API_KEY || process.env.GOOGLE_AI_API_KEY;
13
+ if (!apiKey)
14
+ return null;
15
+ try {
16
+ const { GoogleGenAI } = await import("@google/genai");
17
+ const ai = new GoogleGenAI({ apiKey });
18
+ return {
19
+ name: "gemini",
20
+ available: true,
21
+ call: async ({ system, prompt, maxTokens, temperature }) => {
22
+ const model = "gemini-2.0-flash";
23
+ const result = await ai.models.generateContent({
24
+ model,
25
+ contents: [{ role: "user", parts: [{ text: system ? `${system}\n\n${prompt}` : prompt }] }],
26
+ config: { maxOutputTokens: maxTokens ?? 2048, temperature: temperature ?? 0.3 },
27
+ });
28
+ const text = typeof result.text === "string" ? result.text : "";
29
+ const usage = result.usageMetadata;
30
+ return {
31
+ response: text,
32
+ model,
33
+ tokensUsed: { input: usage?.promptTokenCount ?? 0, output: usage?.candidatesTokenCount ?? 0 },
34
+ };
35
+ },
36
+ };
37
+ }
38
+ catch {
39
+ return null;
40
+ }
41
+ }
42
+ async function getOpenAIProvider() {
43
+ if (!process.env.OPENAI_API_KEY)
44
+ return null;
45
+ try {
46
+ const OpenAI = (await import("openai")).default;
47
+ const client = new OpenAI();
48
+ return {
49
+ name: "openai",
50
+ available: true,
51
+ call: async ({ system, prompt, maxTokens, temperature }) => {
52
+ const model = "gpt-4o-mini";
53
+ const messages = [];
54
+ if (system)
55
+ messages.push({ role: "system", content: system });
56
+ messages.push({ role: "user", content: prompt });
57
+ const result = await client.chat.completions.create({
58
+ model,
59
+ messages,
60
+ max_tokens: maxTokens ?? 2048,
61
+ temperature: temperature ?? 0.3,
62
+ });
63
+ const text = result.choices?.[0]?.message?.content ?? "";
64
+ return {
65
+ response: text,
66
+ model,
67
+ tokensUsed: { input: result.usage?.prompt_tokens ?? 0, output: result.usage?.completion_tokens ?? 0 },
68
+ };
69
+ },
70
+ };
71
+ }
72
+ catch {
73
+ return null;
74
+ }
75
+ }
76
+ async function getAnthropicProvider() {
77
+ if (!process.env.ANTHROPIC_API_KEY)
78
+ return null;
79
+ try {
80
+ const Anthropic = (await import("@anthropic-ai/sdk")).default;
81
+ const client = new Anthropic();
82
+ return {
83
+ name: "anthropic",
84
+ available: true,
85
+ call: async ({ system, prompt, maxTokens, temperature }) => {
86
+ const model = "claude-haiku-4-5-20251001";
87
+ const result = await client.messages.create({
88
+ model,
89
+ max_tokens: maxTokens ?? 2048,
90
+ system: system ?? "",
91
+ messages: [{ role: "user", content: prompt }],
92
+ temperature: temperature ?? 0.3,
93
+ });
94
+ const text = result.content.filter((b) => b.type === "text").map((b) => b.text).join("");
95
+ return {
96
+ response: text,
97
+ model,
98
+ tokensUsed: { input: result.usage?.input_tokens ?? 0, output: result.usage?.output_tokens ?? 0 },
99
+ };
100
+ },
101
+ };
102
+ }
103
+ catch {
104
+ return null;
105
+ }
106
+ }
107
+ async function getProvider() {
108
+ return (await getGeminiProvider()) ?? (await getOpenAIProvider()) ?? (await getAnthropicProvider());
109
+ }
110
+ function noProvider() {
111
+ return {
112
+ error: true,
113
+ message: "No LLM provider available. Set GEMINI_API_KEY, OPENAI_API_KEY, or ANTHROPIC_API_KEY.",
114
+ };
115
+ }
116
+ // ─── Tools ──────────────────────────────────────────────────────────────────
117
+ export const researchWritingTools = [
118
+ {
119
+ name: "polish_academic_text",
120
+ description: "Deep-polish academic text for top-venue quality (NeurIPS, ICLR, ICML, ACL). Handles English and Chinese papers. Fixes grammar, enhances clarity, enforces formal academic tone, removes contractions and AI-style vocabulary. Preserves LaTeX commands, citations, and math. Returns polished text + modification log.",
121
+ inputSchema: {
122
+ type: "object",
123
+ properties: {
124
+ text: { type: "string", description: "The academic text to polish" },
125
+ targetVenue: {
126
+ type: "string",
127
+ enum: ["NeurIPS", "ICLR", "ICML", "ACL", "AAAI", "CVPR", "general"],
128
+ description: "Target venue for style calibration (default: general)",
129
+ },
130
+ language: {
131
+ type: "string",
132
+ enum: ["en", "zh"],
133
+ description: "Language of the input text (default: en)",
134
+ },
135
+ },
136
+ required: ["text"],
137
+ },
138
+ handler: async (args) => {
139
+ const text = String(args.text ?? "");
140
+ const venue = String(args.targetVenue ?? "general");
141
+ const lang = String(args.language ?? "en");
142
+ if (!text.trim())
143
+ return { error: true, message: "text is required" };
144
+ const provider = await getProvider();
145
+ if (!provider)
146
+ return noProvider();
147
+ const system = lang === "zh"
148
+ ? `You are a senior Chinese academic editor for top CS journals. Rewrite the input into polished, formal Chinese academic prose. Rules: (1) Output pure text — no Markdown bold/italic. (2) Use full-width Chinese punctuation. (3) Replace colloquial phrasing with formal academic language. (4) Preserve English technical terms (Transformer, CNN, etc.) without forced translation. Output Part 1 [Refined Text] and Part 2 [Review Comments] only.`
149
+ : `You are a senior academic editor for ${venue} papers. Deep-polish the input to publication standard. Rules: (1) No bold/italic/quotes in LaTeX. (2) No dashes (—) — use clauses or appositions. (3) No \\item lists — use coherent paragraphs. (4) Present tense for methods and conclusions. (5) Remove contractions (it's → it is). (6) Use common precise words, avoid obscure vocabulary. (7) Preserve all \\cite{}, \\ref{}, math ($...$). (8) Escape special chars (% → \\%, _ → \\_). Output Part 1 [LaTeX] and Part 2 [Translation] and Part 3 [Modification Log] only.`;
150
+ const start = Date.now();
151
+ try {
152
+ const result = await provider.call({ system, prompt: text.slice(0, 12000), maxTokens: 4096, temperature: 0.2 });
153
+ return {
154
+ polishedText: result.response,
155
+ venue,
156
+ language: lang,
157
+ provider: provider.name,
158
+ model: result.model,
159
+ tokensUsed: result.tokensUsed,
160
+ latencyMs: Date.now() - start,
161
+ };
162
+ }
163
+ catch (err) {
164
+ return { error: true, message: `Polish failed: ${err.message ?? String(err)}`, latencyMs: Date.now() - start };
165
+ }
166
+ },
167
+ },
168
+ {
169
+ name: "translate_academic",
170
+ description: "Translate academic text between Chinese and English, preserving LaTeX commands, citations, equations, and technical terminology. Returns translated text plus a terminology dictionary for consistency checking across sections.",
171
+ inputSchema: {
172
+ type: "object",
173
+ properties: {
174
+ text: { type: "string", description: "The text to translate" },
175
+ from: { type: "string", enum: ["en", "zh"], description: "Source language" },
176
+ to: { type: "string", enum: ["en", "zh"], description: "Target language" },
177
+ domain: { type: "string", description: "Research domain for terminology, e.g. 'computer vision', 'NLP', 'reinforcement learning'" },
178
+ },
179
+ required: ["text", "from", "to"],
180
+ },
181
+ handler: async (args) => {
182
+ const text = String(args.text ?? "");
183
+ const from = String(args.from ?? "");
184
+ const to = String(args.to ?? "");
185
+ const domain = String(args.domain ?? "computer science");
186
+ if (!text.trim() || !from || !to)
187
+ return { error: true, message: "text, from, and to are required" };
188
+ if (from === to)
189
+ return { error: true, message: "Source and target language must differ" };
190
+ const provider = await getProvider();
191
+ if (!provider)
192
+ return noProvider();
193
+ const system = from === "zh" && to === "en"
194
+ ? `You are an expert academic translator (Chinese → English) specializing in ${domain}. Translate the Chinese draft into polished English academic prose. Rules: (1) Rigorous logic, precise wording, concise and coherent. Use common words, avoid obscure terms. (2) No dashes (—). Use clauses or appositions. (3) No \\item lists. (4) Remove AI flavor. (5) Use present tense for methods/conclusions. (6) Escape LaTeX special chars (% → \\%, _ → \\_). Preserve math ($...$). Output: Part 1 [LaTeX]: English text only. Part 2 [Translation]: Chinese back-translation for verification. Part 3 [Terminology]: JSON dict of key term translations.`
195
+ : `You are an expert academic translator (English → Chinese) specializing in ${domain}. Translate the LaTeX snippet into fluent Chinese. Rules: (1) Delete all \\cite{}, \\ref{}, \\label{}. (2) For \\textbf{text}, \\emph{text}, translate only the inner text. (3) Convert math to readable text (e.g. $\\alpha$ → alpha, \\frac{a}{b} → a/b). (4) Strict direct translation — do not polish or optimize. (5) Maintain sentence order for easy cross-referencing. Output: Part 1 [Translation]: Pure Chinese text. Part 2 [Terminology]: JSON dict of key terms.`;
196
+ const start = Date.now();
197
+ try {
198
+ const result = await provider.call({ system, prompt: text.slice(0, 12000), maxTokens: 4096, temperature: 0.2 });
199
+ return {
200
+ translation: result.response,
201
+ direction: `${from} → ${to}`,
202
+ domain,
203
+ provider: provider.name,
204
+ model: result.model,
205
+ tokensUsed: result.tokensUsed,
206
+ latencyMs: Date.now() - start,
207
+ };
208
+ }
209
+ catch (err) {
210
+ return { error: true, message: `Translation failed: ${err.message ?? String(err)}`, latencyMs: Date.now() - start };
211
+ }
212
+ },
213
+ },
214
+ {
215
+ name: "compress_or_expand_text",
216
+ description: "Precisely compress or expand academic text by a target word count. Compress mode: remove filler words, convert clauses to phrases, passive to active. Expand mode: add logical connectors, explicit reasoning, implicit conclusions. Preserves all core information and LaTeX formatting.",
217
+ inputSchema: {
218
+ type: "object",
219
+ properties: {
220
+ text: { type: "string", description: "The academic text to adjust" },
221
+ mode: { type: "string", enum: ["compress", "expand"], description: "Whether to shorten or lengthen the text" },
222
+ targetDelta: { type: "number", description: "Target word count change (default: 10 words)" },
223
+ },
224
+ required: ["text", "mode"],
225
+ },
226
+ handler: async (args) => {
227
+ const text = String(args.text ?? "");
228
+ const mode = String(args.mode ?? "");
229
+ const delta = Number(args.targetDelta ?? 10);
230
+ if (!text.trim() || !mode)
231
+ return { error: true, message: "text and mode are required" };
232
+ const provider = await getProvider();
233
+ if (!provider)
234
+ return noProvider();
235
+ const system = mode === "compress"
236
+ ? `You are a top academic editor specializing in conciseness. Reduce the text by approximately ${delta} words. Rules: (1) Preserve ALL core information, technical details, and experimental parameters. (2) Convert clauses to phrases, passive to active where shorter. (3) Remove filler ("in order to" → "to"). (4) Keep LaTeX clean — no bold/italic/dashes. (5) Escape special chars. Output: Part 1 [LaTeX]: compressed text. Part 2 [Translation]: Chinese back-translation. Part 3 [Modification Log]: what was removed/shortened.`
237
+ : `You are a top academic editor specializing in logical depth. Expand the text by approximately ${delta} words. Rules: (1) Do NOT add filler or repeat content. (2) Make implicit conclusions explicit. (3) Add necessary logical connectors (Furthermore, Notably). (4) Upgrade simple descriptions to precise academic expressions. (5) Keep LaTeX clean. Output: Part 1 [LaTeX]: expanded text. Part 2 [Translation]: Chinese back-translation. Part 3 [Modification Log]: what was added and why.`;
238
+ const start = Date.now();
239
+ const originalWords = text.split(/\s+/).length;
240
+ try {
241
+ const result = await provider.call({ system, prompt: text.slice(0, 12000), maxTokens: 4096, temperature: 0.2 });
242
+ return {
243
+ adjustedText: result.response,
244
+ mode,
245
+ targetDelta: delta,
246
+ originalWordCount: originalWords,
247
+ provider: provider.name,
248
+ model: result.model,
249
+ tokensUsed: result.tokensUsed,
250
+ latencyMs: Date.now() - start,
251
+ };
252
+ }
253
+ catch (err) {
254
+ return { error: true, message: `${mode} failed: ${err.message ?? String(err)}`, latencyMs: Date.now() - start };
255
+ }
256
+ },
257
+ },
258
+ {
259
+ name: "remove_ai_signatures",
260
+ description: "Detect and remove AI-generated writing signatures from academic text. First runs pattern matching for known AI vocabulary (leverage, delve, tapestry, mechanical connectors), then uses LLM to rewrite flagged sections naturally. Returns cleaned text and a list of AI patterns found.",
261
+ inputSchema: {
262
+ type: "object",
263
+ properties: {
264
+ text: { type: "string", description: "The text to de-AI-ify" },
265
+ },
266
+ required: ["text"],
267
+ },
268
+ handler: async (args) => {
269
+ const text = String(args.text ?? "");
270
+ if (!text.trim())
271
+ return { error: true, message: "text is required" };
272
+ // Phase 1: Pattern-match known AI signatures
273
+ const patterns = [
274
+ { regex: /\b(leverage|leveraging|leveraged)\b/gi, label: "leverage → use" },
275
+ { regex: /\b(delve|delving|delves)\b/gi, label: "delve → investigate/examine" },
276
+ { regex: /\btapestry\b/gi, label: "tapestry → context/landscape" },
277
+ { regex: /\b(utilize|utilizing|utilization)\b/gi, label: "utilize → use" },
278
+ { regex: /\b(furthermore|moreover|additionally),?\s/gi, label: "mechanical connector" },
279
+ { regex: /\bit is worth noting that\b/gi, label: "filler phrase" },
280
+ { regex: /\bfirst and foremost\b/gi, label: "filler phrase" },
281
+ { regex: /\bin conclusion,?\s/gi, label: "mechanical transition" },
282
+ { regex: /\bplays a (?:crucial|pivotal|vital) role\b/gi, label: "cliche" },
283
+ { regex: /\b(comprehensive|robust|holistic|multifaceted)\b/gi, label: "AI-overused adjective" },
284
+ { regex: /\bIt is important to (?:note|emphasize|highlight)\b/gi, label: "filler" },
285
+ { regex: /\b(realm|landscape|paradigm)\b/gi, label: "AI-overused noun" },
286
+ ];
287
+ const detectedPatterns = [];
288
+ for (const { regex, label } of patterns) {
289
+ const matches = text.match(regex);
290
+ if (matches && matches.length > 0) {
291
+ detectedPatterns.push({ pattern: matches[0], count: matches.length, label });
292
+ }
293
+ }
294
+ // Phase 2: LLM rewrite if patterns found
295
+ if (detectedPatterns.length === 0) {
296
+ return {
297
+ cleanedText: text,
298
+ patternsFound: 0,
299
+ detectedPatterns: [],
300
+ verdict: "No significant AI signatures detected. Text appears natural.",
301
+ };
302
+ }
303
+ const provider = await getProvider();
304
+ if (!provider) {
305
+ return {
306
+ cleanedText: text,
307
+ patternsFound: detectedPatterns.length,
308
+ detectedPatterns,
309
+ verdict: "AI patterns detected but no LLM provider available for rewrite. Manual review recommended.",
310
+ };
311
+ }
312
+ const system = `You are a senior academic editor removing AI-generated writing patterns. Rewrite the text to sound natural and human-authored. Rules: (1) Replace overused words: leverage→use, delve→investigate, utilize→use, tapestry→context, etc. (2) Remove mechanical connectors (First and foremost, It is worth noting). Let sentences connect through logical flow. (3) Reduce dashes (—). Use commas, parentheses, or clauses. (4) No bold/italic emphasis in academic text. (5) If the text is already natural in parts, preserve those parts exactly. (6) Output Part 1 [LaTeX]: rewritten text. Part 2 [Modification Log]: what changed and why. If minimal changes needed, say so.`;
313
+ const start = Date.now();
314
+ try {
315
+ const result = await provider.call({ system, prompt: text.slice(0, 12000), maxTokens: 4096, temperature: 0.3 });
316
+ return {
317
+ cleanedText: result.response,
318
+ patternsFound: detectedPatterns.length,
319
+ detectedPatterns,
320
+ provider: provider.name,
321
+ model: result.model,
322
+ tokensUsed: result.tokensUsed,
323
+ latencyMs: Date.now() - start,
324
+ };
325
+ }
326
+ catch (err) {
327
+ return {
328
+ cleanedText: text,
329
+ patternsFound: detectedPatterns.length,
330
+ detectedPatterns,
331
+ error: true,
332
+ message: `Rewrite failed: ${err.message ?? String(err)}`,
333
+ };
334
+ }
335
+ },
336
+ },
337
+ {
338
+ name: "check_paper_logic",
339
+ description: "Check academic text for logical issues: contradictions between statements, undefined terms, terminology inconsistency, and Chinglish patterns. Uses a high-tolerance threshold — only flags issues that genuinely impede comprehension. Returns structured issues with severity and location.",
340
+ inputSchema: {
341
+ type: "object",
342
+ properties: {
343
+ text: { type: "string", description: "The academic text to check" },
344
+ checkType: {
345
+ type: "string",
346
+ enum: ["contradictions", "terminology", "grammar", "all"],
347
+ description: "Type of logic check (default: all)",
348
+ },
349
+ },
350
+ required: ["text"],
351
+ },
352
+ handler: async (args) => {
353
+ const text = String(args.text ?? "");
354
+ const checkType = String(args.checkType ?? "all");
355
+ if (!text.trim())
356
+ return { error: true, message: "text is required" };
357
+ const provider = await getProvider();
358
+ if (!provider)
359
+ return noProvider();
360
+ const system = `You are an academic proofreader performing a final "red-line review" of a near-final manuscript. CRITICAL: Assume the draft has been through multiple revisions and is high quality. Only flag issues that BLOCK reader comprehension.
361
+
362
+ Check dimensions:
363
+ ${checkType === "contradictions" || checkType === "all" ? "- Fatal logic: completely contradictory statements across sections" : ""}
364
+ ${checkType === "terminology" || checkType === "all" ? "- Terminology consistency: core concepts renamed without explanation" : ""}
365
+ ${checkType === "grammar" || checkType === "all" ? "- Severe grammar: Chinglish or structural errors that make meaning unclear" : ""}
366
+
367
+ Rules:
368
+ (1) Do NOT flag style preferences or "could be better" suggestions.
369
+ (2) Do NOT suggest word replacements that are merely "more elegant."
370
+ (3) If no real issues exist, output: [检测通过,无实质性问题] / [No substantive issues found]
371
+
372
+ Output format: If issues found, return a JSON array:
373
+ [{"location":"paragraph/section","issue":"description","severity":"critical|high|medium","suggestion":"fix"}]
374
+ If no issues: {"passed":true,"message":"No substantive issues found"}`;
375
+ const start = Date.now();
376
+ try {
377
+ const result = await provider.call({ system, prompt: text.slice(0, 12000), maxTokens: 2048, temperature: 0.1 });
378
+ let parsed;
379
+ try {
380
+ const cleaned = result.response.replace(/^```(?:json)?\s*\n?/m, "").replace(/\n?```\s*$/m, "").trim();
381
+ parsed = JSON.parse(cleaned);
382
+ }
383
+ catch {
384
+ parsed = { rawResponse: result.response };
385
+ }
386
+ return {
387
+ result: parsed,
388
+ checkType,
389
+ provider: provider.name,
390
+ model: result.model,
391
+ tokensUsed: result.tokensUsed,
392
+ latencyMs: Date.now() - start,
393
+ };
394
+ }
395
+ catch (err) {
396
+ return { error: true, message: `Logic check failed: ${err.message ?? String(err)}`, latencyMs: Date.now() - start };
397
+ }
398
+ },
399
+ },
400
+ {
401
+ name: "generate_academic_caption",
402
+ description: "Generate academic figure or table captions following top-venue conventions. Handles Title Case for noun phrases, Sentence case for full sentences. Removes filler (no 'This figure shows...'). Returns both short and detailed caption versions.",
403
+ inputSchema: {
404
+ type: "object",
405
+ properties: {
406
+ description: { type: "string", description: "What the figure/table shows — describe content, axes, data" },
407
+ figureType: { type: "string", enum: ["figure", "table"], description: "Whether this is a figure or table caption" },
408
+ style: {
409
+ type: "string",
410
+ enum: ["title_case", "sentence_case", "auto"],
411
+ description: "Capitalization style (default: auto — noun phrases get Title Case, sentences get Sentence case)",
412
+ },
413
+ },
414
+ required: ["description", "figureType"],
415
+ },
416
+ handler: async (args) => {
417
+ const description = String(args.description ?? "");
418
+ const figureType = String(args.figureType ?? "figure");
419
+ const style = String(args.style ?? "auto");
420
+ if (!description.trim())
421
+ return { error: true, message: "description is required" };
422
+ const provider = await getProvider();
423
+ if (!provider)
424
+ return noProvider();
425
+ const system = figureType === "table"
426
+ ? `You are a senior academic editor writing table captions. Rules: (1) Use standard patterns: "Comparison with...", "Ablation study on...", "Results on...". (2) Avoid: showcase, depict. Use: show, compare, present. (3) Noun phrases → Title Case, no period. Full sentences → Sentence case, with period. (4) Do NOT include "Table 1:" prefix. (5) Escape LaTeX special chars (%, _, &). Preserve math ($...$). Output: {"short":"brief caption","detailed":"extended caption with methodology notes"}`
427
+ : `You are a senior academic editor writing figure captions. Rules: (1) Start directly with content — NO "This figure shows" or "This diagram illustrates". (2) Noun phrases → Title Case, no period. Full sentences → Sentence case, with period. (3) Escape LaTeX special chars (%, _, &). Preserve math ($...$). (4) Do NOT include "Figure 1:" prefix. Output: {"short":"brief caption","detailed":"extended caption with methodology notes"}`;
428
+ const start = Date.now();
429
+ try {
430
+ const result = await provider.call({ system, prompt: description.slice(0, 4000), maxTokens: 1024, temperature: 0.2 });
431
+ let parsed;
432
+ try {
433
+ const cleaned = result.response.replace(/^```(?:json)?\s*\n?/m, "").replace(/\n?```\s*$/m, "").trim();
434
+ parsed = JSON.parse(cleaned);
435
+ }
436
+ catch {
437
+ parsed = { short: result.response.trim(), detailed: result.response.trim() };
438
+ }
439
+ return {
440
+ caption: parsed,
441
+ figureType,
442
+ style,
443
+ provider: provider.name,
444
+ model: result.model,
445
+ tokensUsed: result.tokensUsed,
446
+ latencyMs: Date.now() - start,
447
+ };
448
+ }
449
+ catch (err) {
450
+ return { error: true, message: `Caption generation failed: ${err.message ?? String(err)}`, latencyMs: Date.now() - start };
451
+ }
452
+ },
453
+ },
454
+ {
455
+ name: "analyze_experiment_data",
456
+ description: "Analyze experiment data (CSV or JSON) and generate publication-ready analysis paragraphs. Uses \\paragraph{Conclusion} + analysis structure. Strict: all conclusions must be grounded in the provided data — no fabrication. Returns LaTeX or Markdown formatted analysis.",
457
+ inputSchema: {
458
+ type: "object",
459
+ properties: {
460
+ data: { type: "string", description: "Experiment data as CSV text or JSON string" },
461
+ goal: { type: "string", description: "What you want the analysis to demonstrate, e.g. 'our method outperforms baselines on all metrics'" },
462
+ format: { type: "string", enum: ["latex", "markdown"], description: "Output format (default: latex)" },
463
+ },
464
+ required: ["data", "goal"],
465
+ },
466
+ handler: async (args) => {
467
+ const data = String(args.data ?? "");
468
+ const goal = String(args.goal ?? "");
469
+ const format = String(args.format ?? "latex");
470
+ if (!data.trim() || !goal.trim())
471
+ return { error: true, message: "data and goal are required" };
472
+ const provider = await getProvider();
473
+ if (!provider)
474
+ return noProvider();
475
+ const system = `You are a senior data scientist writing experiment analysis for a top-tier CS conference paper. Rules:
476
+ (1) Data truthfulness: ALL conclusions must strictly come from the provided data. Never fabricate numbers, exaggerate improvements, or invent phenomena.
477
+ (2) No simple "accounting" (Method A is 0.5, B is 0.6). Focus on comparisons, trends, and insights.
478
+ (3) Analysis targets: effectiveness (SOTA comparison), sensitivity, efficiency trade-offs, ablation contributions.
479
+ (4) ${format === "latex" ? "Use \\paragraph{Conclusion Title} + analysis paragraph structure. No \\textbf or \\emph. Escape special chars (%, _, &). Separate conclusion blocks with blank lines." : "Use ### Conclusion Title + analysis paragraph structure."}
480
+ (5) If data shows no clear advantage, describe honestly — do not force a positive narrative.
481
+
482
+ Output: Part 1 [Analysis]: The formatted analysis. Part 2 [Translation]: Chinese back-translation for verification.`;
483
+ const prompt = `Goal: ${goal}\n\nExperiment Data:\n${data.slice(0, 8000)}`;
484
+ const start = Date.now();
485
+ try {
486
+ const result = await provider.call({ system, prompt, maxTokens: 4096, temperature: 0.2 });
487
+ return {
488
+ analysis: result.response,
489
+ format,
490
+ goal,
491
+ provider: provider.name,
492
+ model: result.model,
493
+ tokensUsed: result.tokensUsed,
494
+ latencyMs: Date.now() - start,
495
+ };
496
+ }
497
+ catch (err) {
498
+ return { error: true, message: `Analysis failed: ${err.message ?? String(err)}`, latencyMs: Date.now() - start };
499
+ }
500
+ },
501
+ },
502
+ {
503
+ name: "review_paper_as_reviewer",
504
+ description: "Simulate a peer reviewer evaluating a paper for a top venue. Default: harsh mode with rejection mindset — only strong contributions change the verdict. Returns structured review: summary, strengths, critical weaknesses, rating (1-10), and strategic revision advice.",
505
+ inputSchema: {
506
+ type: "object",
507
+ properties: {
508
+ text: { type: "string", description: "The paper text (abstract + sections, or full paper)" },
509
+ venue: { type: "string", description: "Target venue, e.g. 'ICML 2026', 'NeurIPS 2025', 'ICLR 2026'" },
510
+ strictness: {
511
+ type: "string",
512
+ enum: ["lenient", "moderate", "harsh"],
513
+ description: "Review strictness (default: harsh)",
514
+ },
515
+ },
516
+ required: ["text", "venue"],
517
+ },
518
+ handler: async (args) => {
519
+ const text = String(args.text ?? "");
520
+ const venue = String(args.venue ?? "");
521
+ const strictness = String(args.strictness ?? "harsh");
522
+ if (!text.trim() || !venue.trim())
523
+ return { error: true, message: "text and venue are required" };
524
+ const provider = await getProvider();
525
+ if (!provider)
526
+ return noProvider();
527
+ const strictnessPrompt = strictness === "harsh"
528
+ ? "Default attitude: assume rejection unless the paper's strengths are compelling enough to change your mind. Skip pleasantries — cut directly to core flaws."
529
+ : strictness === "moderate"
530
+ ? "Balanced approach: acknowledge strengths but do not shy from pointing out weaknesses."
531
+ : "Constructive approach: focus on helping authors improve. Still flag critical issues.";
532
+ const system = `You are a senior reviewer for ${venue}, known for rigorous and precise reviews. ${strictnessPrompt}
533
+
534
+ Review dimensions:
535
+ - Originality: real breakthrough or incremental?
536
+ - Rigor: math sound? experiments fair (baselines complete)? ablations support claims?
537
+ - Consistency: do intro claims match experimental evidence?
538
+
539
+ Rules:
540
+ (1) Be SPECIFIC. Not "experiments insufficient" but "missing robustness evaluation on ImageNet-C".
541
+ (2) No lists for complex arguments — use coherent paragraphs.
542
+ (3) Keep LaTeX clean.
543
+
544
+ Output format:
545
+ Part 1 [Review]:
546
+ - Summary: one-sentence core contribution
547
+ - Strengths: 1-2 genuinely valuable points
548
+ - Weaknesses (Critical): 3-5 issues that could cause rejection
549
+ - Rating: X/10 (top 5% = 8+)
550
+
551
+ Part 2 [Strategic Advice]:
552
+ - What experiments to add, which logic to rewrite, how to reduce reviewer attack surface
553
+ - Use clear, actionable language`;
554
+ const start = Date.now();
555
+ try {
556
+ const result = await provider.call({ system, prompt: text.slice(0, 12000), maxTokens: 4096, temperature: 0.3 });
557
+ return {
558
+ review: result.response,
559
+ venue,
560
+ strictness,
561
+ provider: provider.name,
562
+ model: result.model,
563
+ tokensUsed: result.tokensUsed,
564
+ latencyMs: Date.now() - start,
565
+ };
566
+ }
567
+ catch (err) {
568
+ return { error: true, message: `Review failed: ${err.message ?? String(err)}`, latencyMs: Date.now() - start };
569
+ }
570
+ },
571
+ },
572
+ ];
573
+ //# sourceMappingURL=researchWritingTools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"researchWritingTools.js","sourceRoot":"","sources":["../../src/tools/researchWritingTools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAgBH,KAAK,UAAU,iBAAiB;IAC9B,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,cAAc,IAAI,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IAC3E,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IACzB,IAAI,CAAC;QACH,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,MAAM,CAAC,eAAe,CAAC,CAAC;QACtD,MAAM,EAAE,GAAG,IAAI,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC;QACvC,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,IAAI;YACf,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,EAAE;gBACzD,MAAM,KAAK,GAAG,kBAAkB,CAAC;gBACjC,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC;oBAC7C,KAAK;oBACL,QAAQ,EAAE,CAAC,EAAE,IAAI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