Merge pull request 'fix(cli): disable YAML anchor/alias in output' (#437) from fix/yaml-no-alias into main
This commit is contained in:
@@ -141,7 +141,7 @@ function apiKeyEnvName(providerName: string): string {
|
|||||||
* Discover uwf-* agent binaries in PATH.
|
* Discover uwf-* agent binaries in PATH.
|
||||||
* Returns sorted list of binary names (e.g., ["uwf-hermes", "uwf-claude-code"]).
|
* Returns sorted list of binary names (e.g., ["uwf-hermes", "uwf-claude-code"]).
|
||||||
*/
|
*/
|
||||||
async function discoverAgents(): Promise<string[]> {
|
async function _discoverAgents(): Promise<string[]> {
|
||||||
try {
|
try {
|
||||||
// Use which -a to find all uwf-* binaries in PATH
|
// Use which -a to find all uwf-* binaries in PATH
|
||||||
const proc = Bun.spawn(["which", "-a", "uwf-hermes", "uwf-claude-code", "uwf-cursor"], {
|
const proc = Bun.spawn(["which", "-a", "uwf-hermes", "uwf-claude-code", "uwf-cursor"], {
|
||||||
@@ -186,12 +186,15 @@ async function discoverAgents(): Promise<string[]> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Parse which output - each line is a path to a binary
|
// Parse which output - each line is a path to a binary
|
||||||
const paths = text.trim().split("\n").filter((line) => line.length > 0);
|
const paths = text
|
||||||
|
.trim()
|
||||||
|
.split("\n")
|
||||||
|
.filter((line) => line.length > 0);
|
||||||
const agents = new Set<string>();
|
const agents = new Set<string>();
|
||||||
|
|
||||||
for (const path of paths) {
|
for (const path of paths) {
|
||||||
const basename = path.split("/").pop();
|
const basename = path.split("/").pop();
|
||||||
if (basename && basename.startsWith("uwf-") && basename !== "uwf") {
|
if (basename?.startsWith("uwf-") && basename !== "uwf") {
|
||||||
agents.add(basename);
|
agents.add(basename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -440,7 +440,7 @@ function collectOrderedSteps(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function formatYaml(value: unknown): string {
|
function formatYaml(value: unknown): string {
|
||||||
return stringify(value).trimEnd();
|
return stringify(value, { aliasDuplicateObjects: false }).trimEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatCompactStep(index: number, item: OrderedStepItem, outputYaml: string): string {
|
function formatCompactStep(index: number, item: OrderedStepItem, outputYaml: string): string {
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ export function formatOutput(data: unknown, format: OutputFormat): string {
|
|||||||
case "json":
|
case "json":
|
||||||
return JSON.stringify(data);
|
return JSON.stringify(data);
|
||||||
case "yaml":
|
case "yaml":
|
||||||
return stringify(data).trimEnd();
|
return stringify(data, { aliasDuplicateObjects: false }).trimEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user