mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-07 00:44:49 +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
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
import type { Command } from "commander";
|
|
import type { ListResult } from "../../output/index.js";
|
|
import {
|
|
createScheduleInspectRows,
|
|
createScheduleInspectSchema,
|
|
type ScheduleInspectRow,
|
|
} from "./schema.js";
|
|
import {
|
|
connectScheduleClient,
|
|
toScheduleCommandError,
|
|
type ScheduleCommandOptions,
|
|
} from "./shared.js";
|
|
|
|
export async function runInspectCommand(
|
|
id: string,
|
|
options: ScheduleCommandOptions,
|
|
_command: Command,
|
|
): Promise<ListResult<ScheduleInspectRow>> {
|
|
const { client } = await connectScheduleClient(options.host);
|
|
try {
|
|
const payload = await client.scheduleInspect({ id });
|
|
if (payload.error || !payload.schedule) {
|
|
throw new Error(payload.error ?? `Schedule not found: ${id}`);
|
|
}
|
|
if (payload.schedule.target.type !== "new-agent") {
|
|
throw new Error(`Schedule not found: ${id}`);
|
|
}
|
|
const rows = createScheduleInspectRows(payload.schedule);
|
|
return {
|
|
type: "list",
|
|
data: rows,
|
|
schema: createScheduleInspectSchema(payload.schedule),
|
|
};
|
|
} catch (error) {
|
|
throw toScheduleCommandError("SCHEDULE_INSPECT_FAILED", "inspect schedule", error);
|
|
} finally {
|
|
await client.close().catch(() => {});
|
|
}
|
|
}
|