@algolia/wizard 0.3.0-rc.43.5 → 0.3.0-rc.43.6

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 +17 -19
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -271,9 +271,9 @@ var useWizard = create((set, get) => ({
271
271
  }));
272
272
  return id;
273
273
  },
274
- logEnd: (id, { status, output }) => set((s) => ({
274
+ logEnd: (id, status) => set((s) => ({
275
275
  logs: s.logs.map(
276
- (t) => t.id === id ? { ...t, status, output, durationMs: Date.now() - t.startedAt } : t
276
+ (t) => t.id === id ? { ...t, status, durationMs: Date.now() - t.startedAt } : t
277
277
  )
278
278
  })),
279
279
  requestUserInput: (req) => new Promise((resolve4) => {
@@ -291,7 +291,7 @@ var useWizard = create((set, get) => ({
291
291
  get()._resolve?.(value);
292
292
  set({ inputReq: null, _resolve: null, phase: "running" });
293
293
  const id = get().logStart("prompt", `User input: ${describeInputValue(value)}`);
294
- get().logEnd(id, { status: "success" });
294
+ get().logEnd(id, "success");
295
295
  },
296
296
  setDone: () => set({ phase: "done" }),
297
297
  setError: (message) => set({ phase: "error", error: message }),
@@ -1124,6 +1124,13 @@ var KIND_COLOR = {
1124
1124
  tool: COLORS.primary,
1125
1125
  prompt: COLORS.badge
1126
1126
  };
1127
+ var STATUS_COLOR = {
1128
+ running: COLORS.status.running,
1129
+ error: COLORS.danger
1130
+ };
1131
+ function logNameColor(entry) {
1132
+ return STATUS_COLOR[entry.status] ?? KIND_COLOR[entry.kind];
1133
+ }
1127
1134
  var ROW_GAP = 1;
1128
1135
  function truncate2(str, maxWidth) {
1129
1136
  if (maxWidth <= 0) return "";
@@ -1199,7 +1206,7 @@ function Logs() {
1199
1206
  const preview = rawPreview ? truncate2(rawPreview, budget) : "";
1200
1207
  return /* @__PURE__ */ jsxs11(Box12, { flexDirection: "row", gap: ROW_GAP, children: [
1201
1208
  /* @__PURE__ */ jsx12(Text12, { color: COLORS.dim, children: timestamp }),
1202
- /* @__PURE__ */ jsx12(Text12, { color: KIND_COLOR[entry.kind], wrap: "truncate", children: name }),
1209
+ /* @__PURE__ */ jsx12(Text12, { color: logNameColor(entry), wrap: "truncate", children: name }),
1203
1210
  preview && /* @__PURE__ */ jsx12(Text12, { color: COLORS.dim, wrap: "truncate", children: preview }),
1204
1211
  durationText && /* @__PURE__ */ jsx12(Text12, { color: COLORS.dim, children: durationText })
1205
1212
  ] }, entry.id);
@@ -1577,7 +1584,7 @@ async function makeContext(state) {
1577
1584
  notify: (notice) => useWizard.getState().pushNotice(notice),
1578
1585
  clearNotices: () => useWizard.getState().clearNotices(),
1579
1586
  logStart: (name, input) => useWizard.getState().logStart("tool", name, input),
1580
- logEnd: (id, result) => useWizard.getState().logEnd(id, result),
1587
+ logEnd: (id, status) => useWizard.getState().logEnd(id, status),
1581
1588
  updateAlgoliaState: (key, value) => {
1582
1589
  state.algoliaState[key] = value;
1583
1590
  },
@@ -2367,13 +2374,10 @@ function withLogging(name, def) {
2367
2374
  const id = useWizard.getState().logStart("tool", name, input);
2368
2375
  try {
2369
2376
  const output = await execute(input, options);
2370
- useWizard.getState().logEnd(id, { status: "success", output });
2377
+ useWizard.getState().logEnd(id, "success");
2371
2378
  return output;
2372
2379
  } catch (err) {
2373
- useWizard.getState().logEnd(id, {
2374
- status: "error",
2375
- output: err instanceof Error ? err.message : String(err)
2376
- });
2380
+ useWizard.getState().logEnd(id, "error");
2377
2381
  throw err;
2378
2382
  }
2379
2383
  }
@@ -2619,7 +2623,7 @@ async function runAnalysis(mode, extraInstructions = []) {
2619
2623
  // package.json
2620
2624
  var package_default = {
2621
2625
  name: "@algolia/wizard",
2622
- version: "0.3.0-rc.43.5",
2626
+ version: "0.3.0-rc.43.6",
2623
2627
  description: "Magically implement Algolia functionality in your codebase",
2624
2628
  type: "module",
2625
2629
  engines: {
@@ -3805,10 +3809,7 @@ async function implement(ctx, useCases = DEFAULT_IMPLEMENT_USE_CASES, existingWo
3805
3809
  useCase: currentUseCase
3806
3810
  });
3807
3811
  const install = await installWorktreeDeps(worktree);
3808
- ctx.logEnd(installLogId, {
3809
- status: install.ok ? "success" : "error",
3810
- output: install.output
3811
- });
3812
+ ctx.logEnd(installLogId, install.ok ? "success" : "error");
3812
3813
  if (!install.ok) {
3813
3814
  installFailed = true;
3814
3815
  logger.warn(
@@ -3857,10 +3858,7 @@ async function implement(ctx, useCases = DEFAULT_IMPLEMENT_USE_CASES, existingWo
3857
3858
  [API_KEY_VAR]: profile2.apiKey
3858
3859
  }
3859
3860
  );
3860
- ctx.logEnd(scriptLogId, {
3861
- status: run.ok ? "success" : "error",
3862
- output: run.output
3863
- });
3861
+ ctx.logEnd(scriptLogId, run.ok ? "success" : "error");
3864
3862
  ingestScriptRan = run.ran && run.ok;
3865
3863
  if (ingestScriptRan) {
3866
3864
  ingestDurationMs = Date.now() - startedAt;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@algolia/wizard",
3
- "version": "0.3.0-rc.43.5",
3
+ "version": "0.3.0-rc.43.6",
4
4
  "description": "Magically implement Algolia functionality in your codebase",
5
5
  "type": "module",
6
6
  "engines": {