@vincentwei1021/synapse-openclaw-plugin 0.5.1 → 0.5.3
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/package.json +1 -1
- package/src/event-router.ts +16 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vincentwei1021/synapse-openclaw-plugin",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
4
4
|
"description": "OpenClaw plugin for Synapse research orchestration — SSE notifications, MCP tools, experiment lifecycle, autonomous loop",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
package/src/event-router.ts
CHANGED
|
@@ -325,30 +325,33 @@ Proposed experiments will enter "pending_review" status and require human approv
|
|
|
325
325
|
|
|
326
326
|
private handleDeepResearchRequested(n: NotificationDetail): void {
|
|
327
327
|
const projectUuid = n.projectUuid ?? n.researchProjectUuid ?? "";
|
|
328
|
+
const hasCustomPrompt = n.message.length > 100;
|
|
328
329
|
|
|
329
|
-
|
|
330
|
-
`[Synapse] Deep research literature review requested for project (projectUuid: ${projectUuid}).
|
|
331
|
-
|
|
332
|
-
1. Use synapse_get_related_works with researchProjectUuid "${projectUuid}" to read all collected papers
|
|
330
|
+
const defaultPrompt = `1. Use synapse_get_related_works with researchProjectUuid "${projectUuid}" to read all collected papers
|
|
333
331
|
2. Use synapse_get_project_full_context with researchProjectUuid "${projectUuid}" to understand the research objectives
|
|
334
332
|
3. Analyze how each paper relates to the project's goals — identify key methods, findings, and gaps in the literature
|
|
335
|
-
4. Create a comprehensive literature review document summarizing your analysis
|
|
333
|
+
4. Create a comprehensive literature review document summarizing your analysis`;
|
|
334
|
+
|
|
335
|
+
this.triggerAgent(
|
|
336
|
+
`[Synapse] Deep research literature review requested for project (projectUuid: ${projectUuid}).\n\n${hasCustomPrompt ? n.message : defaultPrompt}`,
|
|
336
337
|
{ notificationUuid: n.uuid, action: "deep_research_requested", entityUuid: n.entityUuid, projectUuid }
|
|
337
338
|
);
|
|
338
339
|
}
|
|
339
340
|
|
|
340
341
|
private handleAutoSearchTriggered(n: NotificationDetail): void {
|
|
341
342
|
const projectUuid = n.projectUuid ?? n.researchProjectUuid ?? "";
|
|
343
|
+
const hasCustomPrompt = n.message.length > 100;
|
|
344
|
+
|
|
345
|
+
const defaultPrompt = `Search for academic papers related to this research project:
|
|
346
|
+
1. Use synapse_get_related_works with researchProjectUuid "${projectUuid}" to see what papers are already collected — avoid searching for topics already well-covered
|
|
347
|
+
2. Use synapse_get_project_full_context with researchProjectUuid "${projectUuid}" to understand the research objectives, datasets, and methods
|
|
348
|
+
3. Based on the project context and gaps in existing papers, use synapse_search_papers to find new relevant academic papers
|
|
349
|
+
4. For each relevant paper found, use synapse_add_related_work with researchProjectUuid "${projectUuid}" to add it (duplicates are automatically skipped — if isNew=false, the paper already existed)
|
|
350
|
+
5. Search with multiple query variations to maximize coverage, but call synapse_search_papers sequentially (one at a time) to avoid rate limits
|
|
351
|
+
6. Focus on papers that fill gaps not covered by existing related works`;
|
|
342
352
|
|
|
343
353
|
this.triggerAgent(
|
|
344
|
-
`[Synapse]
|
|
345
|
-
|
|
346
|
-
Search for academic papers related to this research project:
|
|
347
|
-
1. Use synapse_get_project_full_context with researchProjectUuid "${projectUuid}" to understand the research objectives, datasets, and methods
|
|
348
|
-
2. Based on the project description, research questions, and keywords, use synapse_search_papers to find relevant academic papers
|
|
349
|
-
3. For each relevant paper found, use synapse_add_related_work with researchProjectUuid "${projectUuid}" to add it to the project's related works collection
|
|
350
|
-
4. Focus on papers that are directly relevant to the project's research questions and methodology
|
|
351
|
-
5. Search with multiple query variations to maximize coverage (e.g. different keyword combinations, related terms)`,
|
|
354
|
+
`[Synapse] Paper search requested for project "${n.entityTitle}" (projectUuid: ${projectUuid}).\n\n${hasCustomPrompt ? n.message : defaultPrompt}`,
|
|
352
355
|
{ notificationUuid: n.uuid, action: "auto_search_triggered", entityUuid: n.entityUuid, projectUuid }
|
|
353
356
|
);
|
|
354
357
|
}
|