@algolia/wizard 0.28.0 → 0.29.0-rc.118.223

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 +16 -24
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -1938,8 +1938,20 @@ function reconcileWorkflowState(state, workflow) {
1938
1938
  const definedIds = workflow.steps.map((s) => s.id).join("\n");
1939
1939
  if (persistedIds !== definedIds) return null;
1940
1940
  for (let i = 0; i < state.steps.length; i++) {
1941
- state.steps[i].title = workflow.steps[i].title;
1942
- state.steps[i].visible = workflow.steps[i].visible;
1941
+ const record = state.steps[i];
1942
+ const step = workflow.steps[i];
1943
+ if (record.status === "done") {
1944
+ const parsed = step.outputSchema.safeParse(record.output);
1945
+ if (!parsed.success) {
1946
+ logger.warn(
1947
+ { stepId: step.id, issues: parsed.error.issues },
1948
+ "reconcileWorkflowState: persisted output for a completed step no longer matches its schema; restarting the run from scratch"
1949
+ );
1950
+ return null;
1951
+ }
1952
+ }
1953
+ record.title = step.title;
1954
+ record.visible = step.visible;
1943
1955
  }
1944
1956
  return state;
1945
1957
  }
@@ -3277,28 +3289,9 @@ import { tool as tool9 } from "ai";
3277
3289
  import z16 from "zod";
3278
3290
  import { stat as stat2 } from "node:fs/promises";
3279
3291
  import { relative as relative5 } from "node:path";
3280
-
3281
- // src/lib/editor.ts
3282
- import { spawn as spawn3 } from "node:child_process";
3283
- function openInEditor(filePath) {
3284
- const { command, args } = process.platform === "darwin" ? (
3285
- // -t forces the default *text* editor; plain `open` on an extension
3286
- // with no handler (.mjs, .py) pops a "choose an application" dialog.
3287
- { command: "open", args: ["-t", filePath] }
3288
- ) : process.platform === "win32" ? { command: "cmd", args: ["/c", "start", "", filePath] } : { command: "xdg-open", args: [filePath] };
3289
- try {
3290
- const child = spawn3(command, args, { stdio: "ignore", detached: true });
3291
- child.on("error", () => {
3292
- });
3293
- child.unref();
3294
- } catch {
3295
- }
3296
- }
3297
-
3298
- // src/lib/tools/reviewScript.ts
3299
3292
  function reviewScriptTool(ctx) {
3300
3293
  return tool9({
3301
- description: "Show a script you have written to the user and wait while they read it. Call this as soon as the script is finished and before you run it for the first time, so nothing with a side effect happens behind their back. It opens the file in their editor and returns once they have confirmed.",
3294
+ description: "Call this as soon as the ingestion script is finished and before you run it, so the user can review it.It shows the file path and returns once they have confirmed reviewing it.",
3302
3295
  inputSchema: z16.object({
3303
3296
  filePath: z16.string().describe(
3304
3297
  "Path to the script to review, relative to the project root."
@@ -3316,7 +3309,6 @@ function reviewScriptTool(ctx) {
3316
3309
  return `Refused: ${filePath} is not a file. Write the script first, then review the path you wrote.`;
3317
3310
  }
3318
3311
  return serializePrompt(async () => {
3319
- openInEditor(resolved2.target);
3320
3312
  await useWizard.getState().requestUserInput({
3321
3313
  prompt: "",
3322
3314
  promptType: "enterToContinue",
@@ -3764,7 +3756,7 @@ async function runAnalysis(mode, extraInstructions = []) {
3764
3756
  // package.json
3765
3757
  var package_default = {
3766
3758
  name: "@algolia/wizard",
3767
- version: "0.28.0",
3759
+ version: "0.29.0-rc.118.223",
3768
3760
  description: "Magically implement Algolia functionality in your codebase",
3769
3761
  type: "module",
3770
3762
  engines: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/wizard",
3
- "version": "0.28.0",
3
+ "version": "0.29.0-rc.118.223",
4
4
  "description": "Magically implement Algolia functionality in your codebase",
5
5
  "type": "module",
6
6
  "engines": {