Files
oh-my-pi/packages/coding-agent/src/commands/grievances.ts
T
can1357 0bb385f8ab feat(grievances): added consent gate & push
- Added `dev.autoqa.consent` setting and single-flight popup handler wired through `InteractiveMode`.
- Added `flushGrievances` to batch-POST unpushed rows to `dev.autoqaPush.endpoint` with cooldown and single-flight deduplication.
- Added `omp grievances push` subcommand with TTY progress bar for manual draining.
- Migrated shared DB logic to `openAutoQaDb` (with `pushed` column migration) exported from `report-tool-issue`.
2026-05-17 01:47:24 +02:00

52 lines
1.8 KiB
TypeScript

/**
* View, clean, and push reported tool issues from automated QA.
*/
import { Args, Command, Flags } from "@oh-my-pi/pi-utils/cli";
import { cleanGrievances, listGrievances, pushGrievances } from "../cli/grievances-cli";
export default class Grievances extends Command {
static description = "View, clean, or push reported tool issues (auto-QA grievances)";
static args = {
// Positional action: "list" (default), "clean", or "push". A positional
// arg keeps the historical `omp grievances` invocation working unchanged
// while reusing the same command surface for the clean/push verbs.
action: Args.string({
description: "list (default), clean, or push",
required: false,
options: ["list", "clean", "push"],
default: "list",
}),
};
static flags = {
limit: Flags.integer({ char: "n", description: "Number of recent issues to show (list)", default: 20 }),
tool: Flags.string({ char: "t", description: "Filter by tool name (list, clean)" }),
json: Flags.boolean({ char: "j", description: "Output as JSON", default: false }),
id: Flags.integer({ description: "Delete a single grievance by id (clean)" }),
all: Flags.boolean({ description: "Delete every grievance (clean)", default: false }),
};
static examples = [
"omp grievances",
"omp grievances list --tool find",
"omp grievances clean --id 209",
"omp grievances clean --tool find",
"omp grievances clean --all",
"omp grievances push",
];
async run(): Promise<void> {
const { args, flags } = await this.parse(Grievances);
if (args.action === "clean") {
await cleanGrievances({ id: flags.id, tool: flags.tool, all: flags.all, json: flags.json });
return;
}
if (args.action === "push") {
await pushGrievances({ json: flags.json });
return;
}
await listGrievances({ limit: flags.limit, tool: flags.tool, json: flags.json });
}
}