mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-31 13:42:50 +00:00
* feat(workspaces): align agent and schedule automation Make workspace identity the shared placement boundary for MCP and CLI, while caller identity determines parentage. Keep heartbeats minimal and cron-based without changing legacy rolling interval semantics. * test(cli): expect canonical schedule cadence * fix(automation): preserve workspace and schedule compatibility * fix(automation): preserve compatibility edges * fix(workspaces): align MCP lifecycle resolution * fix(workspaces): preserve creation intent * fix(workspaces): preserve branch and schedule identity
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import type { Command } from "commander";
|
|
import type { SingleResult } from "../../output/index.js";
|
|
import { scheduleSchema } from "./schema.js";
|
|
import {
|
|
connectScheduleClient,
|
|
requireNewAgentSchedule,
|
|
toScheduleCommandError,
|
|
toScheduleRow,
|
|
type ScheduleCommandOptions,
|
|
type ScheduleRow,
|
|
} from "./shared.js";
|
|
|
|
export async function runPauseCommand(
|
|
id: string,
|
|
options: ScheduleCommandOptions,
|
|
_command: Command,
|
|
): Promise<SingleResult<ScheduleRow>> {
|
|
const { client } = await connectScheduleClient(options.host);
|
|
try {
|
|
await requireNewAgentSchedule(client, id);
|
|
const payload = await client.schedulePause({ id });
|
|
if (payload.error || !payload.schedule) {
|
|
throw new Error(payload.error ?? `Failed to pause schedule: ${id}`);
|
|
}
|
|
return {
|
|
type: "single",
|
|
data: toScheduleRow(payload.schedule),
|
|
schema: scheduleSchema,
|
|
};
|
|
} catch (error) {
|
|
throw toScheduleCommandError("SCHEDULE_PAUSE_FAILED", "pause schedule", error);
|
|
} finally {
|
|
await client.close().catch(() => {});
|
|
}
|
|
}
|