@inteeka/task-cli 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -2067,13 +2067,27 @@ async function pickNextEligible(projectId) {
2067
2067
  const result = await apiCall("GET", "/api/v1/cli/me/tickets", {
2068
2068
  query: { project_id: projectId, limit: 1 }
2069
2069
  });
2070
- if (!result.ok || !result.data || result.data.length === 0) return null;
2070
+ if (!result.ok) {
2071
+ throw new CliError(
2072
+ CLI_EXIT_CODES.GENERIC_ERROR,
2073
+ `Server error fetching eligible tickets (HTTP ${result.status})${result.error?.message ? `: ${result.error.message}` : ""}`,
2074
+ "Check the dashboard server logs (or restart its dev server) and retry."
2075
+ );
2076
+ }
2077
+ if (!result.data || result.data.length === 0) return null;
2071
2078
  const first = result.data[0];
2072
2079
  return first?.id ?? null;
2073
2080
  }
2074
2081
  async function promptForTicket(projectId) {
2075
2082
  const result = await apiCall("GET", "/api/v1/cli/me/tickets", { query: { project_id: projectId, limit: 25 } });
2076
- if (!result.ok || !result.data || result.data.length === 0) return null;
2083
+ if (!result.ok) {
2084
+ throw new CliError(
2085
+ CLI_EXIT_CODES.GENERIC_ERROR,
2086
+ `Server error fetching eligible tickets (HTTP ${result.status})${result.error?.message ? `: ${result.error.message}` : ""}`,
2087
+ "Check the dashboard server logs (or restart its dev server) and retry."
2088
+ );
2089
+ }
2090
+ if (!result.data || result.data.length === 0) return null;
2077
2091
  const answer = await inquirer2.prompt([
2078
2092
  {
2079
2093
  type: "list",
@@ -4115,7 +4129,7 @@ function checkBinary(name, command) {
4115
4129
  }
4116
4130
 
4117
4131
  // src/commands/version.ts
4118
- var CLI_VERSION = true ? "0.2.0" : "0.0.0-dev";
4132
+ var CLI_VERSION = true ? "0.2.1" : "0.0.0-dev";
4119
4133
  function registerVersion(program2) {
4120
4134
  program2.command("version").description("Print the CLI version").action(() => {
4121
4135
  process.stdout.write(CLI_VERSION + "\n");