@sage-protocol/pi-adapter 0.3.4 → 0.3.5

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.
@@ -98,15 +98,26 @@ class SageWidgetState {
98
98
  }
99
99
  }
100
100
 
101
- /** Extract skill keys from Sage suggestion output. */
101
+ /** Extract skill keys from Sage suggestion output.
102
+ *
103
+ * Handles two output formats:
104
+ * 1. Codex (-prefixed): "- code-audit" or "- code-audit (code-audit)"
105
+ * 2. Content (headers): "# Skill: code-audit (from zenith)"
106
+ */
102
107
  function parseSuggestionKeys(text: string): string[] {
103
108
  const keys: string[] = [];
104
109
  for (const line of text.split('\n')) {
105
110
  const trimmed = line.trim();
106
- if (!trimmed.startsWith('-')) continue;
107
- // Match patterns like: "- code-audit" or "- code-audit (code-audit)" or "- code-audit - desc"
108
- const m = trimmed.match(/^-\s+(\S+?)(?:\s+\(|$|\s+-)/);
109
- if (m) keys.push(m[1]);
111
+ // Codex format: "- key" or "- key (key)" or "- key - desc"
112
+ if (trimmed.startsWith('-')) {
113
+ const m = trimmed.match(/^-\s+(\S+?)(?:\s+\(|$|\s+-)/);
114
+ if (m) { keys.push(m[1]); continue; }
115
+ }
116
+ // Content format: "# Skill: name (from library)" or "# Prompt: name (from ...)"
117
+ if (trimmed.startsWith('#') && /\b(?:Skill|Prompt|Behavior):/i.test(trimmed)) {
118
+ const m = trimmed.match(/^#\s+(?:Skill|Prompt|Behavior):\s+(\S+?)(?:\s+\(from|$)/i);
119
+ if (m) keys.push(m[1]);
120
+ }
110
121
  }
111
122
  return keys;
112
123
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sage-protocol/pi-adapter",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Sage Protocol MCP integration for pi coding agent",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",