@bacnh85/pi-serena 0.1.4 → 0.2.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.
Files changed (2) hide show
  1. package/index.ts +10 -1
  2. package/package.json +1 -1
package/index.ts CHANGED
@@ -577,7 +577,7 @@ export default function serenaToolsExtension(pi: ExtensionAPI) {
577
577
 
578
578
  pi.on("before_agent_start", async (event) => {
579
579
  const prompt = event.prompt.toLowerCase();
580
- if (/\b(find references|rename|refactor|symbol|declaration|implementation|diagnostic|large repo|semantic|class|method|function)\b/.test(prompt)) {
580
+ if (/\b(find references|rename|refactor|symbol|declaration|implementation|diagnostic|large repo|semantic|class|method|function|investigate|understand|explore|search for|look at|find where|navigate|trace|examine|where is|what does)\b/.test(prompt)) {
581
581
  return {
582
582
  systemPrompt:
583
583
  event.systemPrompt +
@@ -586,6 +586,15 @@ export default function serenaToolsExtension(pi: ExtensionAPI) {
586
586
  }
587
587
  });
588
588
 
589
+ // Unconditional Serena guidance on every session (like pi-subagent's agent-list hook)
590
+ pi.on("before_agent_start", async (event) => {
591
+ return {
592
+ systemPrompt:
593
+ event.systemPrompt +
594
+ "\n\nSerena semantic tools are available for code-symbol work: serena_find_symbol, serena_get_symbols_overview, serena_find_referencing_symbols, and more. Prefer these over repeated grep/read for exploring code structure, finding symbols, navigating references, and whole-symbol edits. Normal read/search tools remain appropriate for Markdown, JSON/YAML, docs, and exact text edits.",
595
+ };
596
+ });
597
+
589
598
  pi.on("tool_call", async (event) => {
590
599
  if (event.toolName.startsWith("serena_")) {
591
600
  semanticMissCount = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bacnh85/pi-serena",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "Pi extension that provides Serena semantic code tools through a persistent worker.",
5
5
  "license": "MIT",
6
6
  "publishConfig": {