@haposoft/cafekit 0.11.9 → 0.11.10

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.
@@ -82,23 +82,26 @@ function venvValid(skillsDir) {
82
82
  return fs.existsSync(venvPython(skillsDir));
83
83
  }
84
84
 
85
- /** Create the venv (idempotent: skips if already valid). Returns true on success. */
86
- function createVenv(skillsDir, py) {
85
+ /** Create the venv (idempotent: skips if already valid). Async — keeps spinner alive. */
86
+ async function createVenv(skillsDir, py) {
87
87
  if (venvValid(skillsDir)) return true;
88
88
  fs.mkdirSync(skillsDir, { recursive: true });
89
- return run(py, ['-m', 'venv', venvDir(skillsDir)]).ok;
89
+ const r = await runAsync(py, ['-m', 'venv', venvDir(skillsDir)]);
90
+ return r.ok;
90
91
  }
91
92
 
92
- /** Upgrade pip inside the venv (best-effort). */
93
- function pipUpgrade(skillsDir) {
94
- return run(venvPython(skillsDir), ['-m', 'pip', 'install', '--upgrade', 'pip', '--prefer-binary']).ok;
93
+ /** Upgrade pip inside the venv (best-effort). Async — keeps spinner alive. */
94
+ async function pipUpgrade(skillsDir) {
95
+ const r = await runAsync(venvPython(skillsDir), ['-m', 'pip', 'install', '--upgrade', 'pip', '--prefer-binary']);
96
+ return r.ok;
95
97
  }
96
98
 
97
- /** Install or upgrade pip requirements in the venv. */
98
- function pipInstall(skillsDir, requirementsPath, upgrade = false) {
99
+ /** Install or upgrade pip requirements in the venv. Async — keeps spinner alive. */
100
+ async function pipInstall(skillsDir, requirementsPath, upgrade = false) {
99
101
  const args = ['-m', 'pip', 'install', '-r', requirementsPath, '--prefer-binary'];
100
102
  if (upgrade) args.push('--upgrade');
101
- return run(venvPython(skillsDir), args).ok;
103
+ const r = await runAsync(venvPython(skillsDir), args);
104
+ return r.ok;
102
105
  }
103
106
 
104
107
  /** `npm install` (fresh) or `npm update` (existing) in a skill scripts dir. Async — keeps spinner alive. */
@@ -31,7 +31,7 @@ async function shouldRun(ctx) {
31
31
  }
32
32
 
33
33
  /** Provision or upgrade Python venv + pip requirements for a platform's skills. */
34
- function setupPython(ctx, skillsDir) {
34
+ async function setupPython(ctx, skillsDir) {
35
35
  const reqs = dep.collectRequirements(skillsDir);
36
36
  if (reqs.length === 0) return;
37
37
 
@@ -43,19 +43,20 @@ function setupPython(ctx, skillsDir) {
43
43
 
44
44
  const alreadyExists = dep.venvValid(skillsDir);
45
45
  ctx.ui.startSpinner(ctx.t('venvCreating'));
46
- if (!dep.createVenv(skillsDir, py)) {
46
+ const venvOk = await dep.createVenv(skillsDir, py);
47
+ if (!venvOk) {
47
48
  ctx.ui.stopSpinner(ctx.t('venvFailed'));
48
49
  ctx.ui.warn(ctx.t('venvFailed'));
49
50
  return;
50
51
  }
51
- dep.pipUpgrade(skillsDir);
52
+ await dep.pipUpgrade(skillsDir);
52
53
  ctx.ui.stopSpinner(`${ctx.t('venvReady')} (${dep.venvDir(skillsDir)})`);
53
54
 
54
55
  // Upgrade packages if venv already existed (update run), install fresh otherwise.
55
56
  const upgrade = alreadyExists;
56
57
  for (const { skill, file } of reqs) {
57
58
  ctx.ui.startSpinner(ctx.t(upgrade ? 'pipInstalling' : 'pipInstalling', { skill }));
58
- const ok = dep.pipInstall(skillsDir, file, upgrade);
59
+ const ok = await dep.pipInstall(skillsDir, file, upgrade);
59
60
  if (ok) {
60
61
  ctx.ui.stopSpinner(ctx.t('pipInstalled', { skill }));
61
62
  } else {
@@ -127,7 +128,7 @@ async function setupSkillDeps(ctx) {
127
128
  }
128
129
 
129
130
  for (const key of ctx.platforms) {
130
- setupPython(ctx, PLATFORMS[key].skillsDir);
131
+ await setupPython(ctx, PLATFORMS[key].skillsDir);
131
132
  await setupNode(ctx, PLATFORMS[key].skillsDir);
132
133
  }
133
134
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haposoft/cafekit",
3
- "version": "0.11.9",
3
+ "version": "0.11.10",
4
4
  "description": "Claude Code-first spec-driven workflow for AI coding assistants. Bundles CafeKit hapo: skills, runtime hooks, agents, and installer scaffolding.",
5
5
  "author": "Haposoft <nghialt@haposoft.com>",
6
6
  "license": "MIT",