@perceo/perceo 0.3.1 → 0.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.
Files changed (2) hide show
  1. package/dist/index.js +15 -4
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -373,6 +373,17 @@ import os from "os";
373
373
  var CONFIG_DIR2 = ".perceo";
374
374
  var CONFIG_FILE = "config.json";
375
375
  var SUPPORTED_FRAMEWORKS = ["nextjs", "react", "remix"];
376
+ function formatDbError(err) {
377
+ if (err instanceof Error) return err.message;
378
+ const o = err;
379
+ if (o && typeof o.message === "string") {
380
+ const parts = [o.message];
381
+ if (typeof o.code === "string") parts.push(`(code: ${o.code})`);
382
+ if (typeof o.details === "string") parts.push(o.details);
383
+ return parts.join(" ");
384
+ }
385
+ return String(err);
386
+ }
376
387
  var initCommand = new Command("init").description("Initialize Perceo in your project and discover flows").option("-d, --dir <directory>", "Project directory", process.cwd()).option("--skip-github", "Skip GitHub Actions setup", false).option("-y, --yes", "Skip confirmation prompt (e.g. for CI)", false).option("-b, --branch <branch>", "Main branch name (default: auto-detect)").option("--configure-personas", "Configure custom user personas instead of auto-generating them", false).action(async (options) => {
377
388
  const projectDir = path3.resolve(options.dir || process.cwd());
378
389
  const loggedIn = await isLoggedIn(projectDir);
@@ -467,7 +478,7 @@ var initCommand = new Command("init").description("Initialize Perceo in your pro
467
478
  } catch (dbError) {
468
479
  spinner.fail("Failed to query project");
469
480
  console.error(chalk3.red("\nDatabase error details:"));
470
- console.error(chalk3.gray(` Error: ${dbError instanceof Error ? dbError.message : String(dbError)}`));
481
+ console.error(chalk3.gray(` ${formatDbError(dbError)}`));
471
482
  throw new Error("Failed to query project from database");
472
483
  }
473
484
  if (!tempProject) {
@@ -482,7 +493,7 @@ var initCommand = new Command("init").description("Initialize Perceo in your pro
482
493
  } catch (createError) {
483
494
  spinner.fail("Failed to create project");
484
495
  console.error(chalk3.red("\nDatabase error details:"));
485
- console.error(chalk3.gray(` Error: ${createError instanceof Error ? createError.message : String(createError)}`));
496
+ console.error(chalk3.gray(` ${formatDbError(createError)}`));
486
497
  throw new Error("Failed to create project in database");
487
498
  }
488
499
  } else {
@@ -747,7 +758,7 @@ Persona ${personaIndex}:`));
747
758
  } catch (dbError) {
748
759
  spinner.fail("Failed to query project");
749
760
  console.error(chalk3.red("\nDatabase error details:"));
750
- console.error(chalk3.gray(` Error: ${dbError instanceof Error ? dbError.message : String(dbError)}`));
761
+ console.error(chalk3.gray(` ${formatDbError(dbError)}`));
751
762
  throw new Error("Failed to query project from database");
752
763
  }
753
764
  if (!project) {
@@ -762,7 +773,7 @@ Persona ${personaIndex}:`));
762
773
  } catch (createError) {
763
774
  spinner.fail("Failed to create project");
764
775
  console.error(chalk3.red("\nDatabase error details:"));
765
- console.error(chalk3.gray(` Error: ${createError instanceof Error ? createError.message : String(createError)}`));
776
+ console.error(chalk3.gray(` ${formatDbError(createError)}`));
766
777
  throw new Error("Failed to create project in database");
767
778
  }
768
779
  } else if (gitRemoteUrl && project.git_remote_url !== gitRemoteUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perceo/perceo",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Intelligent regression testing through multi-agent simulation",
5
5
  "keywords": [
6
6
  "testing",
@@ -37,8 +37,8 @@
37
37
  "commander": "^12.0.0",
38
38
  "ora": "^8.0.1",
39
39
  "tweetnacl": "^1.0.3",
40
- "@perceo/observer-engine": "2.0.1",
41
- "@perceo/supabase": "0.2.0"
40
+ "@perceo/observer-engine": "2.0.2",
41
+ "@perceo/supabase": "0.2.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@changesets/cli": "^2.29.8",