import { AttachService } from "../services/attach/attachService.js";
export function resolveRunId(args, context) {
    const trimmed = args.trim();
    if (trimmed && trimmed !== "attached" && trimmed !== "current")
        return trimmed;
    const attached = new AttachService(context.state, context.config.projectPath).current().runId;
    if (attached)
        return attached;
    return context.state.listRuns(1)[0]?.id;
}
export function stripRunAlias(args) {
    const trimmed = args.trim();
    return trimmed === "attached" || trimmed === "current" ? "" : trimmed;
}
