@alexkroman1/aai-cli 1.3.0 → 1.3.2

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.
@@ -4,6 +4,7 @@ import { existsSync } from "node:fs";
4
4
  import path from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import fs from "node:fs/promises";
7
+ import os from "node:os";
7
8
  import { downloadTemplate } from "giget";
8
9
  //#region _templates.ts
9
10
  const GIGET_SOURCE = "github:alexkroman/agent/packages/aai-templates";
@@ -21,7 +22,9 @@ function resolveLocalTemplatesDir() {
21
22
  async function resolveTemplatesDir() {
22
23
  if (process.env.AAI_TEMPLATES_DIR) return process.env.AAI_TEMPLATES_DIR;
23
24
  if (isDevMode()) return resolveLocalTemplatesDir();
25
+ const extractDir = await fs.mkdtemp(path.join(os.tmpdir(), "aai-templates-"));
24
26
  const { dir } = await downloadTemplate(`${GIGET_SOURCE}#${GIGET_REF}`, {
27
+ dir: extractDir,
25
28
  force: true,
26
29
  forceClean: true
27
30
  });
package/dist/cli.mjs CHANGED
@@ -113,7 +113,7 @@ const init = defineCommand({
113
113
  },
114
114
  async run({ args }) {
115
115
  await runCommand(args, async (mode) => {
116
- const { executeInit } = await import("./init-DsqJBro6.mjs");
116
+ const { executeInit } = await import("./init-GWTdzrrm.mjs");
117
117
  return executeInit({
118
118
  dir: args.dir,
119
119
  force: args.force,
@@ -4,13 +4,26 @@ import { r as log$1 } from "./_ui-nOp7hFVy.mjs";
4
4
  import { n as resolveCwd, t as fileExists } from "./_utils-DZo3_J_v.mjs";
5
5
  import { getMonorepoRoot, isDevMode } from "./_agent-De8f1JdZ.mjs";
6
6
  import path from "node:path";
7
- import { errorMessage } from "@alexkroman1/aai";
8
7
  import * as p from "@clack/prompts";
9
8
  import { colorize } from "consola/utils";
10
9
  import fs from "node:fs/promises";
11
10
  import { execFile } from "node:child_process";
12
11
  import { promisify } from "node:util";
13
12
  //#region init.ts
13
+ /**
14
+ * Format an install error so the user sees what actually went wrong.
15
+ * pnpm writes failures to stdout (not stderr), and Node's execFile error
16
+ * message is only "Command failed: ..." — so we append both streams.
17
+ */
18
+ function formatInstallError(err) {
19
+ if (!(err instanceof Error)) return String(err);
20
+ const parts = [err.message];
21
+ const stderr = err.stderr?.trim();
22
+ const stdout = err.stdout?.trim();
23
+ if (stderr) parts.push(stderr);
24
+ if (stdout) parts.push(stdout);
25
+ return parts.join("\n");
26
+ }
14
27
  const execFileAsync = promisify(execFile);
15
28
  const DEFAULT_PROJECT_NAME = "my-voice-agent";
16
29
  /** Prompt for project name or return default when --yes is set. */
@@ -80,7 +93,7 @@ async function installDeps(cwd, silent) {
80
93
  await runPnpmInstall(cwd);
81
94
  return true;
82
95
  } catch (err) {
83
- log$1.warn(`pnpm install failed: ${errorMessage(err)}`);
96
+ log$1.warn(`pnpm install failed: ${formatInstallError(err)}`);
84
97
  log$1.warn("Run `corepack enable && pnpm install` manually in the project directory.");
85
98
  return false;
86
99
  }
@@ -92,7 +105,7 @@ async function installDeps(cwd, silent) {
92
105
  return true;
93
106
  } catch (err) {
94
107
  s.stop("Dependency install failed");
95
- log$1.warn(`pnpm install failed: ${errorMessage(err)}`);
108
+ log$1.warn(`pnpm install failed: ${formatInstallError(err)}`);
96
109
  log$1.warn("Run `corepack enable && pnpm install` manually in the project directory.");
97
110
  return false;
98
111
  }
@@ -120,7 +133,7 @@ async function tryDeploy(cwd, server, monorepoRoot) {
120
133
  }
121
134
  /** Scaffold the project, optionally showing a spinner. */
122
135
  async function scaffoldProject(dir, cwd, template, silent) {
123
- const { runInit } = await import("./_init-CkoOBaYG.mjs");
136
+ const { runInit } = await import("./_init-Bh5etNEh.mjs");
124
137
  if (silent) {
125
138
  await runInit({
126
139
  targetDir: cwd,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexkroman1/aai-cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "aai": "dist/cli.mjs"
@@ -23,8 +23,8 @@
23
23
  "p-debounce": "^5.1.0",
24
24
  "vite": "^8.0.8",
25
25
  "zod": "^4.3.6",
26
- "@alexkroman1/aai": "1.3.0",
27
- "@alexkroman1/aai-ui": "1.3.0"
26
+ "@alexkroman1/aai-ui": "1.3.2",
27
+ "@alexkroman1/aai": "1.3.2"
28
28
  },
29
29
  "devDependencies": {
30
30
  "get-port": "^7.2.0",