@vincentwei1021/synapse-openclaw-plugin 0.5.4 → 0.5.6
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 -10
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.6",
|
|
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
|
@@ -330,22 +330,27 @@ Proposed experiments will enter "pending_review" status and require human approv
|
|
|
330
330
|
const projectUuid = n.projectUuid ?? n.researchProjectUuid ?? "";
|
|
331
331
|
const hasCustomPrompt = n.message !== SynapseEventRouter.DEFAULT_DEEP_RESEARCH_MSG;
|
|
332
332
|
|
|
333
|
-
const
|
|
333
|
+
const basePrompt = `[Synapse] Deep research literature review requested for project (projectUuid: ${projectUuid}).
|
|
334
|
+
|
|
335
|
+
1. Use synapse_get_related_works with researchProjectUuid "${projectUuid}" to read all collected papers
|
|
334
336
|
2. Use synapse_get_project_full_context with researchProjectUuid "${projectUuid}" to understand the research objectives
|
|
335
337
|
3. Analyze how each paper relates to the project's goals — identify key methods, findings, and gaps in the literature
|
|
336
338
|
4. Create a comprehensive literature review document summarizing your analysis`;
|
|
337
339
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
340
|
+
const prompt = hasCustomPrompt
|
|
341
|
+
? `${basePrompt}\n\nAdditional instructions from the user:\n${n.message}`
|
|
342
|
+
: basePrompt;
|
|
343
|
+
|
|
344
|
+
this.triggerAgent(prompt, { notificationUuid: n.uuid, action: "deep_research_requested", entityUuid: n.entityUuid, projectUuid, timeoutSeconds: 1800 });
|
|
342
345
|
}
|
|
343
346
|
|
|
344
347
|
private handleAutoSearchTriggered(n: NotificationDetail): void {
|
|
345
348
|
const projectUuid = n.projectUuid ?? n.researchProjectUuid ?? "";
|
|
346
349
|
const hasCustomPrompt = n.message !== SynapseEventRouter.DEFAULT_AUTO_SEARCH_MSG;
|
|
347
350
|
|
|
348
|
-
const
|
|
351
|
+
const basePrompt = `[Synapse] Paper search requested for project "${n.entityTitle}" (projectUuid: ${projectUuid}).
|
|
352
|
+
|
|
353
|
+
Search for academic papers related to this research project:
|
|
349
354
|
1. Use synapse_get_related_works with researchProjectUuid "${projectUuid}" to see what papers are already collected — avoid searching for topics already well-covered
|
|
350
355
|
2. Use synapse_get_project_full_context with researchProjectUuid "${projectUuid}" to understand the research objectives, datasets, and methods
|
|
351
356
|
3. Based on the project context and gaps in existing papers, use synapse_search_papers to find new relevant academic papers
|
|
@@ -353,10 +358,11 @@ Proposed experiments will enter "pending_review" status and require human approv
|
|
|
353
358
|
5. Search with multiple query variations to maximize coverage, but call synapse_search_papers sequentially (one at a time) to avoid rate limits
|
|
354
359
|
6. Focus on papers that fill gaps not covered by existing related works`;
|
|
355
360
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
361
|
+
const prompt = hasCustomPrompt
|
|
362
|
+
? `${basePrompt}\n\nAdditional instructions from the user:\n${n.message}`
|
|
363
|
+
: basePrompt;
|
|
364
|
+
|
|
365
|
+
this.triggerAgent(prompt, { notificationUuid: n.uuid, action: "auto_search_triggered", entityUuid: n.entityUuid, projectUuid, timeoutSeconds: 600 });
|
|
360
366
|
}
|
|
361
367
|
|
|
362
368
|
private handleExperimentReportRequested(n: NotificationDetail): void {
|