feat: add uwf log subcommands (list, show, clean)
- uwf log list: list log files with sizes - uwf log show --thread <id>: filter by thread ID - uwf log show --process <pid>: filter by process ID - uwf log clean --before <date>: delete old log files - Tests: 12 new tests covering all subcommands Implemented by solve-issue workflow, biome fixes applied manually. Closes #413 Refs #411, #410
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
cmdCasSchemaList,
|
||||
cmdCasWalk,
|
||||
} from "./commands/cas.js";
|
||||
import { cmdLogClean, cmdLogList, cmdLogShow } from "./commands/log.js";
|
||||
import { cmdSetup, cmdSetupInteractive } from "./commands/setup.js";
|
||||
import { cmdSkillCli } from "./commands/skill.js";
|
||||
import {
|
||||
@@ -29,7 +30,6 @@ import {
|
||||
THREAD_READ_DEFAULT_QUOTA,
|
||||
} from "./commands/thread.js";
|
||||
import { cmdWorkflowList, cmdWorkflowPut, cmdWorkflowShow } from "./commands/workflow.js";
|
||||
import { cmdLogClean, cmdLogList, cmdLogShow } from "./commands/log.js";
|
||||
import { formatOutput, type OutputFormat } from "./format.js";
|
||||
import { resolveStorageRoot } from "./store.js";
|
||||
|
||||
@@ -399,17 +399,23 @@ log
|
||||
.option("--thread <thread-id>", "Filter by thread ID")
|
||||
.option("--process <pid>", "Filter by process ID")
|
||||
.option("--date <date>", "Filter by date (YYYY-MM-DD)")
|
||||
.action((opts: { thread: string | undefined; process: string | undefined; date: string | undefined }) => {
|
||||
const storageRoot = resolveStorageRoot();
|
||||
runAction(async () => {
|
||||
const result = await cmdLogShow(storageRoot, {
|
||||
thread: opts.thread ?? null,
|
||||
process: opts.process ?? null,
|
||||
date: opts.date ?? null,
|
||||
.action(
|
||||
(opts: {
|
||||
thread: string | undefined;
|
||||
process: string | undefined;
|
||||
date: string | undefined;
|
||||
}) => {
|
||||
const storageRoot = resolveStorageRoot();
|
||||
runAction(async () => {
|
||||
const result = await cmdLogShow(storageRoot, {
|
||||
thread: opts.thread ?? null,
|
||||
process: opts.process ?? null,
|
||||
date: opts.date ?? null,
|
||||
});
|
||||
writeOutput(result);
|
||||
});
|
||||
writeOutput(result);
|
||||
});
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
log
|
||||
.command("clean")
|
||||
|
||||
Reference in New Issue
Block a user