
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="987a67f4-785a-5568-96ea-74ccb9ddb7c1")}catch(e){}}();
function resolveNodeCommandPrefix(context) {
    const execArgv = context.execArgv ?? [];
    if (execArgv.length === 0) {
        return [context.execPath];
    }
    return [context.execPath, ...execArgv];
}
function isLikelyTsxCliEntrypoint(value) {
    const normalized = value.replaceAll("\\", "/").toLowerCase();
    if (normalized.endsWith("/tsx") || normalized.endsWith("/tsx.js")) {
        return true;
    }
    return normalized.includes("/tsx/") && normalized.endsWith("/cli.mjs");
}
function looksLikeEntrypointPath(value) {
    if (!value) {
        return false;
    }
    if (value.includes("/") || value.includes("\\")) {
        return true;
    }
    if (/\.(?:mjs|cjs|js|ts|mts|cts)$/iu.test(value)) {
        return true;
    }
    return /kanban(?:\.(?:cmd|ps1|exe))?$/iu.test(value);
}
export function resolveKanbanCommandParts(context = {
    execPath: process.execPath,
    argv: process.argv,
    execArgv: process.execArgv,
}) {
    const commandPrefix = resolveNodeCommandPrefix(context);
    const entrypoint = context.argv[1];
    if (!entrypoint || !looksLikeEntrypointPath(entrypoint)) {
        return commandPrefix;
    }
    const tsxTarget = context.argv[2];
    if (tsxTarget && isLikelyTsxCliEntrypoint(entrypoint) && looksLikeEntrypointPath(tsxTarget)) {
        return [...commandPrefix, entrypoint, tsxTarget];
    }
    return [...commandPrefix, entrypoint];
}
export function buildKanbanCommandParts(args, context = {
    execPath: process.execPath,
    argv: process.argv,
    execArgv: process.execArgv,
}) {
    return [...resolveKanbanCommandParts(context), ...args];
}
//# sourceMappingURL=kanban-command.js.map
//# debugId=987a67f4-785a-5568-96ea-74ccb9ddb7c1
