repomind 0.5.0 → 0.5.1

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/index.js +39 -23
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -39427,24 +39427,28 @@ function usePipelineStream(options) {
39427
39427
  );
39428
39428
  }, 100);
39429
39429
  }
39430
+ const optionsRef = (0, import_react30.useRef)(options);
39431
+ optionsRef.current = options;
39432
+ const triggerKey = options ? `${options.path}:${options.token}` : null;
39430
39433
  (0, import_react30.useEffect)(() => {
39431
- if (!options) return;
39434
+ const opts = optionsRef.current;
39435
+ if (!opts) return;
39432
39436
  let cancelled = false;
39433
39437
  const controller = new AbortController();
39434
39438
  abortRef.current = controller;
39435
39439
  setIsStreaming(true);
39436
- setSteps([]);
39437
- setResult(null);
39438
- setError(null);
39440
+ setSteps((prev) => prev.length > 0 ? [] : prev);
39441
+ setResult((prev) => prev !== null ? null : prev);
39442
+ setError((prev) => prev !== null ? null : prev);
39439
39443
  async function run2() {
39440
- if (!options) return;
39444
+ if (!opts) return;
39441
39445
  let response;
39442
39446
  try {
39443
- response = await options.postStream(
39444
- options.path,
39445
- options.body,
39446
- options.token,
39447
- options.timeoutMs
39447
+ response = await opts.postStream(
39448
+ opts.path,
39449
+ opts.body,
39450
+ opts.token,
39451
+ opts.timeoutMs
39448
39452
  );
39449
39453
  } catch (err) {
39450
39454
  if (cancelled) return;
@@ -39483,27 +39487,33 @@ function usePipelineStream(options) {
39483
39487
  if (cancelled) break;
39484
39488
  if (event.type === "step:start") {
39485
39489
  const newStep = {
39486
- label: options.stepLabels[event.step] ?? event.step,
39490
+ label: opts.stepLabels[event.step] ?? event.step,
39487
39491
  status: "active"
39488
39492
  };
39489
39493
  setSteps((prev) => {
39490
39494
  const updated = prev.map(
39491
39495
  (s) => s.status === "active" ? { ...s, status: "done" } : s
39492
39496
  );
39497
+ startElapsedTimer(updated.length);
39493
39498
  return [...updated, newStep];
39494
39499
  });
39495
- startElapsedTimer(event.index);
39496
39500
  } else if (event.type === "step:complete") {
39497
39501
  clearElapsedInterval();
39498
39502
  activeStepIndexRef.current = null;
39499
39503
  const detail = `${(event.durationMs / 1e3).toFixed(1)}s`;
39504
+ const idx = event.index - 1;
39500
39505
  setSteps(
39501
39506
  (prev) => prev.map(
39502
- (s, i) => i === event.index ? { ...s, status: "done", detail } : s
39507
+ (s, i) => i === idx ? { ...s, status: "done", detail } : s
39503
39508
  )
39504
39509
  );
39505
39510
  } else if (event.type === "result") {
39506
39511
  clearElapsedInterval();
39512
+ setSteps(
39513
+ (prev) => prev.map(
39514
+ (s) => s.status === "active" ? { ...s, status: "done" } : s
39515
+ )
39516
+ );
39507
39517
  setResult(event.data);
39508
39518
  setIsStreaming(false);
39509
39519
  } else if (event.type === "error") {
@@ -39532,8 +39542,11 @@ function usePipelineStream(options) {
39532
39542
  controller.abort();
39533
39543
  abortRef.current = null;
39534
39544
  };
39535
- }, [options]);
39536
- return { steps, result, error, isStreaming };
39545
+ }, [triggerKey]);
39546
+ return (0, import_react30.useMemo)(
39547
+ () => ({ steps, result, error, isStreaming }),
39548
+ [steps, result, error, isStreaming]
39549
+ );
39537
39550
  }
39538
39551
 
39539
39552
  // src/ui/colors.ts
@@ -41014,14 +41027,17 @@ function SplitApp({
41014
41027
  const [streamPayload, setStreamPayload] = (0, import_react41.useState)(
41015
41028
  null
41016
41029
  );
41017
- const streamOptions = streamPayload && phase === "analyzing" ? {
41018
- path: streamPayload.path,
41019
- body: streamPayload.body,
41020
- token: streamPayload.token,
41021
- postStream: deps.postStream,
41022
- stepLabels: STEP_LABELS2,
41023
- timeoutMs: 3e5
41024
- } : null;
41030
+ const streamOptions = (0, import_react41.useMemo)(
41031
+ () => streamPayload && phase === "analyzing" ? {
41032
+ path: streamPayload.path,
41033
+ body: streamPayload.body,
41034
+ token: streamPayload.token,
41035
+ postStream: deps.postStream,
41036
+ stepLabels: STEP_LABELS2,
41037
+ timeoutMs: 3e5
41038
+ } : null,
41039
+ [streamPayload, phase, deps.postStream]
41040
+ );
41025
41041
  const stream = usePipelineStream(streamOptions);
41026
41042
  (0, import_react41.useEffect)(() => {
41027
41043
  if (!TERMINAL_PHASES4.includes(phase)) return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repomind",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "type": "module",
5
5
  "description": "AI-powered git commit messages and repository insights",
6
6
  "keywords": ["git", "ai", "commit", "cli"],