@algolia/wizard 0.121.0 → 0.122.0

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/main.js +13 -5
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -2572,7 +2572,7 @@ function rateLimitMessage(retryAfterSeconds) {
2572
2572
  // package.json
2573
2573
  var package_default = {
2574
2574
  name: "@algolia/wizard",
2575
- version: "0.121.0",
2575
+ version: "0.122.0",
2576
2576
  description: "Magically implement Algolia functionality in your codebase",
2577
2577
  type: "module",
2578
2578
  engines: {
@@ -5684,11 +5684,19 @@ function incompleteCauseOf(stepCount, maxSteps, finishReason) {
5684
5684
  if (finishReason !== "stop") return "stopped";
5685
5685
  return null;
5686
5686
  }
5687
+ var NO_FRONTEND_REASON = "no_frontend";
5688
+ var NO_FRONTEND_MESSAGE = "No frontend found in this folder. `cd` into the directory where your frontend lives (in a monorepo, the app folder, usually the one with that app's `package.json`), then rerun the Wizard.";
5689
+ function userFacingAgentFailure(reason) {
5690
+ if (reason?.trim().toLowerCase() === NO_FRONTEND_REASON) {
5691
+ return NO_FRONTEND_MESSAGE;
5692
+ }
5693
+ return `Agent reported failure: ${reason ?? "no reason given"}`;
5694
+ }
5687
5695
  var AgentReportedFailureError = class extends Error {
5688
5696
  reason;
5689
5697
  output;
5690
5698
  constructor(reason, output) {
5691
- super(`Agent reported failure: ${reason ?? "no reason given"}`);
5699
+ super(userFacingAgentFailure(reason));
5692
5700
  this.reason = reason;
5693
5701
  this.output = output;
5694
5702
  }
@@ -6623,7 +6631,7 @@ async function assertGitRepoWithHead(repoRoot) {
6623
6631
  await git(["-C", repoRoot, "rev-parse", "HEAD"]);
6624
6632
  } catch {
6625
6633
  throw new Error(
6626
- "implement requires a git repository with at least one commit. Initialize git and commit before running the wizard."
6634
+ "This folder must be a Git repository with at least one commit so you can review and revert Wizard changes. Run `git init`, commit your project files, then rerun."
6627
6635
  );
6628
6636
  }
6629
6637
  }
@@ -7424,7 +7432,7 @@ function searchInstructions(input) {
7424
7432
  "Match the application styles closely, including light, dark, and high-contrast themes the project already supports.",
7425
7433
  "Give the search input frame the same height, corner radius, border color and width, background, and focus style as the input it replaces. When it replaces nothing, copy them from the form controls beside it. Read these values from their source (the theme, the component props, or the CSS). Do not keep the widget theme defaults, for example a 44px height and 4px corners, and do not invent colors. When the app theme exists only in code, take the values from that theme object.",
7426
7434
  "When you add UI text to a localized dictionary or message file, add the same keys, translated, to every locale the project supports.",
7427
- "Before reporting, mount the component. Do not run a type check, build, or test command unless a later instruction allows it: the validation pass runs the type check, after the developer agrees to it. If a tool limit is reached or an error remains unresolved, keep the implementation, report status=success, and name the remaining issue in the summary so validation can drive the next pass. Report status=fail only when no search implementation can be written, with the concrete blocker as the reason.",
7435
+ `Before reporting, mount the component. Do not run a type check, build, or test command unless a later instruction allows it: the validation pass runs the type check, after the developer agrees to it. If a tool limit is reached or an error remains unresolved, keep the implementation, report status=success, and name the remaining issue in the summary so validation can drive the next pass. Report status=fail only when no search implementation can be written. When this folder has no frontend to build search UI in (for example a monorepo root or a backend-only package), use reason exactly \`${NO_FRONTEND_REASON}\`. For any other blocker, use a short concrete reason.`,
7428
7436
  "The summary should be extremely concise; do not mention manual testing steps.",
7429
7437
  ...input.uiTemplate ? [
7430
7438
  "For the playbook recap, report uiFiles as every file you created or edited for this UI. Each entry needs a short action label and its repo-relative path. Report devCommand only when you found the project\u2019s existing command for starting the app locally. Do not invent a command, host, or port."
@@ -11659,7 +11667,7 @@ async function promptResumeOrStartNew(session, next) {
11659
11667
  // package.json with { type: 'json' }
11660
11668
  var package_default2 = {
11661
11669
  name: "@algolia/wizard",
11662
- version: "0.121.0",
11670
+ version: "0.122.0",
11663
11671
  description: "Magically implement Algolia functionality in your codebase",
11664
11672
  type: "module",
11665
11673
  engines: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/wizard",
3
- "version": "0.121.0",
3
+ "version": "0.122.0",
4
4
  "description": "Magically implement Algolia functionality in your codebase",
5
5
  "type": "module",
6
6
  "engines": {