Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/commands/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ function buildCreateBody(opts: {
webhookEvents?: string[];
emailRecipients?: string[];
retentionDays?: number;
goal?: string;
}): unknown {
if (!opts.name) {
throw new Error('--name is required (or pass a JSON file / stdin payload)');
Expand Down Expand Up @@ -190,6 +191,7 @@ function buildCreateBody(opts: {
}

if (opts.retentionDays !== undefined) body.retentionDays = opts.retentionDays;
if (opts.goal !== undefined) body.goal = opts.goal;

return body;
}
Expand Down Expand Up @@ -247,6 +249,10 @@ export function createMonitorCommand(): Command {
parseCommaList
)
.option('--retention-days <n>', 'Snapshot retention window', parseInt)
.option(
'--goal <text>',
'Plain-language goal for the AI change judge (auto-enables the judge)'
)
).action(async (file: string | undefined, options) => {
try {
const fromJson = await readJsonPayload(file);
Expand All @@ -263,6 +269,7 @@ export function createMonitorCommand(): Command {
webhookEvents: options.webhookEvents,
emailRecipients: options.email,
retentionDays: options.retentionDays,
goal: options.goal,
});
const payload = await monitorRequest('/monitor', options, {
method: 'POST',
Expand Down
Loading