@algolia/wizard 0.9.0-rc.93.91 → 0.9.0-rc.93.95

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 +5 -20
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -662,10 +662,9 @@ function CommandApproval({
662
662
  command,
663
663
  onDecide
664
664
  }) {
665
- useInput((input, key) => {
665
+ useInput((_input, key) => {
666
666
  if (key.return) onDecide("approve");
667
667
  else if (key.escape) onDecide("reject");
668
- else if (input.toLowerCase() === "a") onDecide("always");
669
668
  });
670
669
  return /* @__PURE__ */ jsxs4(Box5, { flexDirection: "column", gap: 1, children: [
671
670
  /* @__PURE__ */ jsx4(Text5, { color: COLORS.primary, bold: true, children: "Run this command?" }),
@@ -698,15 +697,7 @@ function CommandApproval({
698
697
  ),
699
698
  /* @__PURE__ */ jsxs4(Box5, { flexDirection: "column", children: [
700
699
  /* @__PURE__ */ jsx4(NextAction, { action: "approve", keyHint: "enter" }),
701
- /* @__PURE__ */ jsx4(NextAction, { action: "reject", keyHint: "esc", hierarchy: "secondary" }),
702
- /* @__PURE__ */ jsx4(
703
- NextAction,
704
- {
705
- action: "approve, and don't ask again for this command",
706
- keyHint: "a",
707
- hierarchy: "secondary"
708
- }
709
- )
700
+ /* @__PURE__ */ jsx4(NextAction, { action: "reject", keyHint: "esc", hierarchy: "secondary" })
710
701
  ] })
711
702
  ] });
712
703
  }
@@ -2733,7 +2724,6 @@ function createShellContext(overrides = {}) {
2733
2724
  return {
2734
2725
  env: async () => ({}),
2735
2726
  timeoutMs: DEFAULT_SHELL_TIMEOUT_MS,
2736
- approved: /* @__PURE__ */ new Set(),
2737
2727
  executions: [],
2738
2728
  approve: refuseByDefault,
2739
2729
  ...overrides
@@ -2808,9 +2798,6 @@ function runShell(command, opts) {
2808
2798
  }
2809
2799
 
2810
2800
  // src/lib/tools/runShell.ts
2811
- function approvalKey(cwd, command) {
2812
- return `${cwd}\0${command}`;
2813
- }
2814
2801
  function storeApproval(root) {
2815
2802
  return async (req) => {
2816
2803
  const rel = relative2(root, req.cwd);
@@ -2823,7 +2810,7 @@ function storeApproval(root) {
2823
2810
  cwd: rel === "" || rel.startsWith("..") ? req.cwd : rel
2824
2811
  }
2825
2812
  });
2826
- return answer === "approve" || answer === "always" ? answer : "reject";
2813
+ return answer === "approve" ? "approve" : "reject";
2827
2814
  };
2828
2815
  }
2829
2816
  function runShellTool(ctx) {
@@ -2847,8 +2834,7 @@ function runShellTool(ctx) {
2847
2834
  const resolved2 = resolveInRoot(ctx, cwd ?? ".");
2848
2835
  if (!resolved2.ok) return resolved2.error;
2849
2836
  logger.info({ command, cwd: resolved2.target }, "called runShell tool");
2850
- const key = approvalKey(resolved2.target, command);
2851
- const decision = ctx.shell.approved.has(key) ? "approve" : await ctx.shell.approve({
2837
+ const decision = await ctx.shell.approve({
2852
2838
  command,
2853
2839
  cwd: resolved2.target,
2854
2840
  explanation
@@ -2862,7 +2848,6 @@ function runShellTool(ctx) {
2862
2848
  logger.info({ command }, "runShell: user rejected the command");
2863
2849
  return "The user rejected this command. Do not retry it. Propose a different command, or report the limitation via reportStatus.";
2864
2850
  }
2865
- if (decision === "always") ctx.shell.approved.add(key);
2866
2851
  useWizard.getState().pushNotice({ messages: [`Running: ${command}`] });
2867
2852
  const env = await ctx.shell.env().catch((err) => {
2868
2853
  logger.warn({ err, command }, "runShell: could not resolve command env");
@@ -3275,7 +3260,7 @@ async function runAnalysis(mode, extraInstructions = []) {
3275
3260
  // package.json
3276
3261
  var package_default = {
3277
3262
  name: "@algolia/wizard",
3278
- version: "0.9.0-rc.93.91",
3263
+ version: "0.9.0-rc.93.95",
3279
3264
  description: "Magically implement Algolia functionality in your codebase",
3280
3265
  type: "module",
3281
3266
  engines: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/wizard",
3
- "version": "0.9.0-rc.93.91",
3
+ "version": "0.9.0-rc.93.95",
4
4
  "description": "Magically implement Algolia functionality in your codebase",
5
5
  "type": "module",
6
6
  "engines": {