-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Description
Summary
The installer parses agent-manifest.csv using line.split(','), which does not handle RFC 4180 quoted CSV fields. Fields like capabilities and principles contain commas within double-quoted values, causing the naive comma-split to produce too many columns and shift all subsequent column indices.
Impact
cols[10] is intended to read the module column but instead picks up a fragment from a different field. This produces incorrect agent-command values in the merged bmad-help.csv.
For example, the analyst row generates:
bmad:competitive analysis:agent:analyst
instead of the correct:
bmad:bmm:agent:analyst
Location
tools/installer/core/installer.js — the enrichAgentInfo method, around the line:
const cols = line.split(',');Suggested Fix
Replace the naive line.split(',') with a proper CSV field parser that respects double-quoted fields (RFC 4180). A minimal approach:
function parseCSVLine(line) {
const fields = [];
let current = '';
let inQuotes = false;
for (let i = 0; i < line.length; i++) {
const ch = line[i];
if (inQuotes) {
if (ch === '"' && line[i + 1] === '"') { current += '"'; i++; }
else if (ch === '"') { inQuotes = false; }
else { current += ch; }
} else {
if (ch === '"') { inQuotes = true; }
else if (ch === ',') { fields.push(current); current = ''; }
else { current += ch; }
}
}
fields.push(current);
return fields;
}Additionally, cols[10] should likely be cols[9] — the module column is at index 9 in the header (name,displayName,title,icon,capabilities,role,identity,communicationStyle,principles,module,path,canonicalId).