pi-agents-switch 0.2.0 → 0.2.1
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/frontmatter.ts +21 -3
- package/package.json +1 -1
package/frontmatter.ts
CHANGED
|
@@ -57,10 +57,10 @@ export function parseFrontmatter(content: string): FrontmatterResult {
|
|
|
57
57
|
continue;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
// Array item:
|
|
61
|
-
const arrayMatch = line.match(/^\s*-\s
|
|
60
|
+
// Array item: `- value`, `- "value"`, or `-value`
|
|
61
|
+
const arrayMatch = line.match(/^\s*-\s*(.+)$/);
|
|
62
62
|
if (arrayMatch) {
|
|
63
|
-
currentArray.push(arrayMatch[1]
|
|
63
|
+
currentArray.push(parseArrayItem(arrayMatch[1]));
|
|
64
64
|
continue;
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -94,6 +94,24 @@ export function parseFrontmatter(content: string): FrontmatterResult {
|
|
|
94
94
|
return { frontmatter: fm, body, keyOrder };
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
/**
|
|
98
|
+
* Parse an array item value (always a string).
|
|
99
|
+
* Strips surrounding whitespace and optional YAML quotes.
|
|
100
|
+
*/
|
|
101
|
+
function parseArrayItem(raw: string): string {
|
|
102
|
+
const trimmed = raw.trim();
|
|
103
|
+
|
|
104
|
+
// Quoted strings
|
|
105
|
+
if (
|
|
106
|
+
(trimmed.startsWith('"') && trimmed.endsWith('"')) ||
|
|
107
|
+
(trimmed.startsWith("'") && trimmed.endsWith("'"))
|
|
108
|
+
) {
|
|
109
|
+
return trimmed.slice(1, -1);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return trimmed;
|
|
113
|
+
}
|
|
114
|
+
|
|
97
115
|
/**
|
|
98
116
|
* Parse a scalar YAML value.
|
|
99
117
|
* Handles: unquoted strings, quoted strings, booleans, numbers.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agents-switch",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Tab to switch primary agents in Pi — like OpenCode's agent switching. Each agent gets an isolated profile with its own AGENTS.md, extensions, skills, and settings.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"pi": {
|