Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7ca3ad5d65 | |||
| 52879c0028 | |||
| 9e4527bb89 | |||
| 5209cfa7ac |
@@ -141,7 +141,7 @@ function apiKeyEnvName(providerName: string): string {
|
||||
* Discover uwf-* agent binaries in PATH.
|
||||
* Returns sorted list of binary names (e.g., ["uwf-hermes", "uwf-claude-code"]).
|
||||
*/
|
||||
async function discoverAgents(): Promise<string[]> {
|
||||
async function _discoverAgents(): Promise<string[]> {
|
||||
try {
|
||||
// Use which -a to find all uwf-* binaries in PATH
|
||||
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
|
||||
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>();
|
||||
|
||||
for (const path of paths) {
|
||||
const basename = path.split("/").pop();
|
||||
if (basename && basename.startsWith("uwf-") && basename !== "uwf") {
|
||||
if (basename?.startsWith("uwf-") && basename !== "uwf") {
|
||||
agents.add(basename);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -539,7 +539,7 @@ function collectOrderedSteps(
|
||||
}
|
||||
|
||||
function formatYaml(value: unknown): string {
|
||||
return stringify(value).trimEnd();
|
||||
return stringify(value, { aliasDuplicateObjects: false }).trimEnd();
|
||||
}
|
||||
|
||||
function formatCompactStep(index: number, item: OrderedStepItem, outputYaml: string): string {
|
||||
|
||||
@@ -7,6 +7,6 @@ export function formatOutput(data: unknown, format: OutputFormat): string {
|
||||
case "json":
|
||||
return JSON.stringify(data);
|
||||
case "yaml":
|
||||
return stringify(data).trimEnd();
|
||||
return stringify(data, { aliasDuplicateObjects: false }).trimEnd();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { spawn } from "node:child_process";
|
||||
import { mkdirSync, writeFileSync } from "node:fs";
|
||||
import type { Store } from "@uncaged/json-cas";
|
||||
import {
|
||||
type AgentContext,
|
||||
@@ -117,7 +118,17 @@ function spawnClaudeResume(
|
||||
]);
|
||||
}
|
||||
|
||||
const NDJSON_DUMP_DIR = "/tmp/uwf-ndjson-dump";
|
||||
|
||||
async function processClaudeOutput(stdout: string, store: Store): Promise<AgentRunResult> {
|
||||
// Debug dump: save raw NDJSON for issue #439 investigation
|
||||
try {
|
||||
mkdirSync(NDJSON_DUMP_DIR, { recursive: true });
|
||||
writeFileSync(`${NDJSON_DUMP_DIR}/${Date.now()}.ndjson`, stdout);
|
||||
} catch {
|
||||
// ignore dump failures
|
||||
}
|
||||
|
||||
const parsed = parseClaudeCodeStreamOutput(stdout);
|
||||
|
||||
if (parsed !== null) {
|
||||
|
||||
Reference in New Issue
Block a user