cli4ai 1.1.2 → 1.1.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cli4ai",
3
- "version": "1.1.2",
3
+ "version": "1.1.4",
4
4
  "description": "The package manager for AI CLI tools - cli4ai.com",
5
5
  "type": "module",
6
6
  "bin": {
@@ -151,8 +151,12 @@ async function downloadFromNpm(packageName: string, targetDir: string): Promise<
151
151
  encoding: 'utf-8'
152
152
  });
153
153
 
154
+ if (packResult.error) {
155
+ throw new Error(`npm not found or failed to execute: ${packResult.error.message}`);
156
+ }
157
+
154
158
  if (packResult.status !== 0) {
155
- throw new Error(`Failed to download package: ${packResult.stderr || 'npm pack failed'}`);
159
+ throw new Error(`npm pack failed: ${packResult.stderr || packResult.stdout || 'unknown error'}`);
156
160
  }
157
161
 
158
162
  // Find the tarball (it will be named like cli4ai-slack-1.0.2.tgz)
@@ -501,17 +505,19 @@ async function resolvePackage(
501
505
 
502
506
  // Auto-resolve to @cli4ai/ scope and try npm
503
507
  const scopedName = `@cli4ai/${pkg}`;
508
+ let npmError: string | undefined;
504
509
  try {
505
510
  log(`Resolving ${pkg} as ${scopedName}...`);
506
511
  const pkgPath = await downloadFromNpm(scopedName, targetDir);
507
512
  const manifest = loadManifest(pkgPath);
508
513
  return { manifest, path: pkgPath, fromNpm: true };
509
- } catch {
510
- // Fall through to error
514
+ } catch (err) {
515
+ npmError = err instanceof Error ? err.message : String(err);
511
516
  }
512
517
 
513
518
  outputError('NOT_FOUND', `Package not found: ${pkg}`, {
514
- hint: `Tried @cli4ai/${pkg} on npm. Use --local flag for local paths, or add a local registry with "cli4ai config --add-registry <path>"`
519
+ hint: `Tried @cli4ai/${pkg} on npm. Use --local flag for local paths, or add a local registry with "cli4ai config --add-registry <path>"`,
520
+ npmError
515
521
  });
516
522
  }
517
523
 
@@ -1,11 +1,11 @@
1
- #!/usr/bin/env bun
1
+ #!/usr/bin/env npx tsx
2
2
  /**
3
3
  * Scheduler daemon entry point.
4
4
  *
5
5
  * This script runs as a background process and manages scheduled routine execution.
6
6
  * It's spawned by `cli4ai scheduler start` with detached mode.
7
7
  *
8
- * Usage: bun scheduler-daemon.ts [--project-dir <dir>]
8
+ * Usage: npx tsx scheduler-daemon.ts [--project-dir <dir>]
9
9
  */
10
10
 
11
11
  import { Scheduler, writeDaemonPid, removeDaemonPid, appendSchedulerLog, SCHEDULER_LOG_FILE, ensureSchedulerDirs } from './scheduler.js';