@algolia/wizard 0.25.0 → 0.26.0-rc.118.217
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/dist/main.js +16 -24
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1922,8 +1922,20 @@ function reconcileWorkflowState(state, workflow) {
|
|
|
1922
1922
|
const definedIds = workflow.steps.map((s) => s.id).join("\n");
|
|
1923
1923
|
if (persistedIds !== definedIds) return null;
|
|
1924
1924
|
for (let i = 0; i < state.steps.length; i++) {
|
|
1925
|
-
|
|
1926
|
-
|
|
1925
|
+
const record = state.steps[i];
|
|
1926
|
+
const step = workflow.steps[i];
|
|
1927
|
+
if (record.status === "done") {
|
|
1928
|
+
const parsed = step.outputSchema.safeParse(record.output);
|
|
1929
|
+
if (!parsed.success) {
|
|
1930
|
+
logger.warn(
|
|
1931
|
+
{ stepId: step.id, issues: parsed.error.issues },
|
|
1932
|
+
"reconcileWorkflowState: persisted output for a completed step no longer matches its schema; restarting the run from scratch"
|
|
1933
|
+
);
|
|
1934
|
+
return null;
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
record.title = step.title;
|
|
1938
|
+
record.visible = step.visible;
|
|
1927
1939
|
}
|
|
1928
1940
|
return state;
|
|
1929
1941
|
}
|
|
@@ -3260,28 +3272,9 @@ import { tool as tool9 } from "ai";
|
|
|
3260
3272
|
import z16 from "zod";
|
|
3261
3273
|
import { stat as stat2 } from "node:fs/promises";
|
|
3262
3274
|
import { relative as relative5 } from "node:path";
|
|
3263
|
-
|
|
3264
|
-
// src/lib/editor.ts
|
|
3265
|
-
import { spawn as spawn3 } from "node:child_process";
|
|
3266
|
-
function openInEditor(filePath) {
|
|
3267
|
-
const { command, args } = process.platform === "darwin" ? (
|
|
3268
|
-
// -t forces the default *text* editor; plain `open` on an extension
|
|
3269
|
-
// with no handler (.mjs, .py) pops a "choose an application" dialog.
|
|
3270
|
-
{ command: "open", args: ["-t", filePath] }
|
|
3271
|
-
) : process.platform === "win32" ? { command: "cmd", args: ["/c", "start", "", filePath] } : { command: "xdg-open", args: [filePath] };
|
|
3272
|
-
try {
|
|
3273
|
-
const child = spawn3(command, args, { stdio: "ignore", detached: true });
|
|
3274
|
-
child.on("error", () => {
|
|
3275
|
-
});
|
|
3276
|
-
child.unref();
|
|
3277
|
-
} catch {
|
|
3278
|
-
}
|
|
3279
|
-
}
|
|
3280
|
-
|
|
3281
|
-
// src/lib/tools/reviewScript.ts
|
|
3282
3275
|
function reviewScriptTool(ctx) {
|
|
3283
3276
|
return tool9({
|
|
3284
|
-
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
|
|
3277
|
+
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 shows the file path and returns once they have confirmed reviewing it.",
|
|
3285
3278
|
inputSchema: z16.object({
|
|
3286
3279
|
filePath: z16.string().describe(
|
|
3287
3280
|
"Path to the script to review, relative to the project root."
|
|
@@ -3299,7 +3292,6 @@ function reviewScriptTool(ctx) {
|
|
|
3299
3292
|
return `Refused: ${filePath} is not a file. Write the script first, then review the path you wrote.`;
|
|
3300
3293
|
}
|
|
3301
3294
|
return serializePrompt(async () => {
|
|
3302
|
-
openInEditor(resolved2.target);
|
|
3303
3295
|
await useWizard.getState().requestUserInput({
|
|
3304
3296
|
prompt: "",
|
|
3305
3297
|
promptType: "enterToContinue",
|
|
@@ -3747,7 +3739,7 @@ async function runAnalysis(mode, extraInstructions = []) {
|
|
|
3747
3739
|
// package.json
|
|
3748
3740
|
var package_default = {
|
|
3749
3741
|
name: "@algolia/wizard",
|
|
3750
|
-
version: "0.
|
|
3742
|
+
version: "0.26.0-rc.118.217",
|
|
3751
3743
|
description: "Magically implement Algolia functionality in your codebase",
|
|
3752
3744
|
type: "module",
|
|
3753
3745
|
engines: {
|