agdi 2.8.0 → 2.8.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.
Files changed (2) hide show
  1. package/dist/index.js +56 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -392,6 +392,12 @@ var flags = {
392
392
  function setFlags(newFlags) {
393
393
  Object.assign(flags, newFlags);
394
394
  }
395
+ var GracefulExitError = class extends Error {
396
+ constructor() {
397
+ super("Process exiting");
398
+ this.name = "GracefulExitError";
399
+ }
400
+ };
395
401
  function safeExit(code = 0) {
396
402
  if (activeReadlineInterface) {
397
403
  try {
@@ -404,7 +410,7 @@ function safeExit(code = 0) {
404
410
  setImmediate(() => {
405
411
  process.exit(code);
406
412
  });
407
- throw new Error("Process exiting");
413
+ throw new GracefulExitError();
408
414
  }
409
415
  async function smartConfirm(message, defaultValue = false) {
410
416
  if (flags.yes || flags.headless || process.env.CI === "true" || process.env.CI === "1") {
@@ -4866,7 +4872,7 @@ ${chalk15.cyan(`/_/ |_|\\_, /\\__,_//_/ `)}
4866
4872
  ${chalk15.cyan(` /____/ `)}
4867
4873
  `;
4868
4874
  var program = new Command();
4869
- program.name("agdi").description(chalk15.cyan("\u{1F680} AI-powered coding assistant")).version("2.8.0").option("-y, --yes", "Auto-approve all prompts (headless/CI mode)").option("-m, --minimal", "Generate only the requested file(s), not a full app").option("-d, --dry-run", "Show what would be created without writing files");
4875
+ program.name("agdi").description(chalk15.cyan("\u{1F680} AI-powered coding assistant")).version("2.8.1").option("-y, --yes", "Auto-approve all prompts (headless/CI mode)").option("-m, --minimal", "Generate only the requested file(s), not a full app").option("-d, --dry-run", "Show what would be created without writing files");
4870
4876
  program.hook("preAction", (thisCommand) => {
4871
4877
  const opts = thisCommand.opts();
4872
4878
  if (opts.yes) {
@@ -4892,7 +4898,14 @@ program.action(async () => {
4892
4898
  } catch (error) {
4893
4899
  if (error.name === "ExitPromptError") {
4894
4900
  console.log(chalk15.gray("\n\n\u{1F44B} Goodbye!\n"));
4895
- ui.safeExit(0);
4901
+ try {
4902
+ ui.safeExit(0);
4903
+ } catch {
4904
+ }
4905
+ return;
4906
+ }
4907
+ if (error.name === "GracefulExitError") {
4908
+ return;
4896
4909
  }
4897
4910
  throw error;
4898
4911
  }
@@ -4907,7 +4920,14 @@ program.command("auth").description("Configure API keys").option("--status", "Sh
4907
4920
  } catch (error) {
4908
4921
  if (error.name === "ExitPromptError") {
4909
4922
  console.log(chalk15.gray("\n\n\u{1F44B} Cancelled.\n"));
4910
- ui.safeExit(0);
4923
+ try {
4924
+ ui.safeExit(0);
4925
+ } catch {
4926
+ }
4927
+ return;
4928
+ }
4929
+ if (error.name === "GracefulExitError") {
4930
+ return;
4911
4931
  }
4912
4932
  throw error;
4913
4933
  }
@@ -4918,7 +4938,14 @@ program.command("model").alias("models").description("Change AI model").action(a
4918
4938
  } catch (error) {
4919
4939
  if (error.name === "ExitPromptError") {
4920
4940
  console.log(chalk15.gray("\n\n\u{1F44B} Cancelled.\n"));
4921
- ui.safeExit(0);
4941
+ try {
4942
+ ui.safeExit(0);
4943
+ } catch {
4944
+ }
4945
+ return;
4946
+ }
4947
+ if (error.name === "GracefulExitError") {
4948
+ return;
4922
4949
  }
4923
4950
  throw error;
4924
4951
  }
@@ -4932,7 +4959,14 @@ program.command("chat").description("Start a chat session").action(async () => {
4932
4959
  } catch (error) {
4933
4960
  if (error.name === "ExitPromptError") {
4934
4961
  console.log(chalk15.gray("\n\n\u{1F44B} Goodbye!\n"));
4935
- ui.safeExit(0);
4962
+ try {
4963
+ ui.safeExit(0);
4964
+ } catch {
4965
+ }
4966
+ return;
4967
+ }
4968
+ if (error.name === "GracefulExitError") {
4969
+ return;
4936
4970
  }
4937
4971
  throw error;
4938
4972
  }
@@ -4943,7 +4977,14 @@ program.command("run [directory]").description("Run a generated project").action
4943
4977
  } catch (error) {
4944
4978
  if (error.name === "ExitPromptError") {
4945
4979
  console.log(chalk15.gray("\n\n\u{1F44B} Cancelled.\n"));
4946
- ui.safeExit(0);
4980
+ try {
4981
+ ui.safeExit(0);
4982
+ } catch {
4983
+ }
4984
+ return;
4985
+ }
4986
+ if (error.name === "GracefulExitError") {
4987
+ return;
4947
4988
  }
4948
4989
  throw error;
4949
4990
  }
@@ -5003,7 +5044,14 @@ program.command("build <prompt>").alias("b").description("Generate an app from a
5003
5044
  } catch (error) {
5004
5045
  if (error.name === "ExitPromptError") {
5005
5046
  console.log(chalk15.gray("\n\n\u{1F44B} Cancelled.\n"));
5006
- ui.safeExit(0);
5047
+ try {
5048
+ ui.safeExit(0);
5049
+ } catch {
5050
+ }
5051
+ return;
5052
+ }
5053
+ if (error.name === "GracefulExitError") {
5054
+ return;
5007
5055
  }
5008
5056
  throw error;
5009
5057
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agdi",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "AI-powered app generator - build full-stack apps from natural language in your terminal",
5
5
  "type": "module",
6
6
  "bin": {