repomind 0.11.0 → 0.12.0

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 +57 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -89341,6 +89341,9 @@ function CommitApp({
89341
89341
  deps.instructionsOverride ?? null
89342
89342
  );
89343
89343
  const committedMessageRef = (0, import_react64.useRef)("");
89344
+ const lastRejectedRef = (0, import_react64.useRef)("");
89345
+ const flowIdRef = (0, import_react64.useRef)("");
89346
+ const editedRef = (0, import_react64.useRef)(false);
89344
89347
  const [phase, setPhase] = (0, import_react64.useState)("analyzing");
89345
89348
  const [message, setMessage] = (0, import_react64.useState)("");
89346
89349
  const [issueRef, setIssueRef] = (0, import_react64.useState)("");
@@ -89357,15 +89360,32 @@ function CommitApp({
89357
89360
  );
89358
89361
  const streamOptions = streamPayload && phase === "streaming" ? {
89359
89362
  path: streamPayload.path,
89360
- body: streamPayload.body,
89363
+ body: retryCount > 0 ? {
89364
+ ...streamPayload.body,
89365
+ regeneration: {
89366
+ attempt: retryCount,
89367
+ ...lastRejectedRef.current ? { previousMessage: lastRejectedRef.current } : {}
89368
+ }
89369
+ } : streamPayload.body,
89361
89370
  token: streamPayload.token,
89362
89371
  postStream: deps.postStream,
89363
89372
  stepLabels: STEP_LABELS,
89364
89373
  retryKey: retryCount
89365
89374
  } : null;
89366
- const stream = usePipelineStream(
89367
- streamOptions
89368
- );
89375
+ const stream = usePipelineStream(streamOptions);
89376
+ const sendFeedback = (outcome, editedMessage) => {
89377
+ if (!flowIdRef.current || !streamPayload?.token) return;
89378
+ deps.apiPost(
89379
+ "/commit/feedback",
89380
+ {
89381
+ flowId: flowIdRef.current,
89382
+ outcome,
89383
+ ...editedMessage ? { editedMessage } : {}
89384
+ },
89385
+ streamPayload.token
89386
+ ).catch(() => {
89387
+ });
89388
+ };
89369
89389
  (0, import_react64.useEffect)(() => {
89370
89390
  if (!TERMINAL_PHASES.includes(phase)) return;
89371
89391
  const code = phase === "done" || phase === "aborted" ? 0 : 1;
@@ -89381,6 +89401,8 @@ function CommitApp({
89381
89401
  if (stream.result) {
89382
89402
  setMessage(stream.result.message);
89383
89403
  if (stream.result.commitId) setCommitId(stream.result.commitId);
89404
+ if (stream.result.flowId) flowIdRef.current = stream.result.flowId;
89405
+ editedRef.current = false;
89384
89406
  setPhase("confirm");
89385
89407
  return;
89386
89408
  }
@@ -89534,6 +89556,7 @@ ${prefixed}`);
89534
89556
  if (phase !== "confirm") return;
89535
89557
  if (confirmingAbort) {
89536
89558
  if (input.toLowerCase() === "y") {
89559
+ sendFeedback("discarded");
89537
89560
  setConfirmingAbort(false);
89538
89561
  setPhase("aborted");
89539
89562
  return;
@@ -89546,6 +89569,8 @@ ${prefixed}`);
89546
89569
  }
89547
89570
  const parsed2 = parseCommitType(message);
89548
89571
  if (input === "r") {
89572
+ sendFeedback("regenerated");
89573
+ lastRejectedRef.current = message;
89549
89574
  setMessage("");
89550
89575
  setCommitId("");
89551
89576
  setIssueRef("");
@@ -89554,6 +89579,7 @@ ${prefixed}`);
89554
89579
  return;
89555
89580
  }
89556
89581
  if (input === "e") {
89582
+ editedRef.current = true;
89557
89583
  setPhase("editing");
89558
89584
  return;
89559
89585
  }
@@ -89617,6 +89643,10 @@ ${prefixed}`);
89617
89643
  ).catch(() => {
89618
89644
  });
89619
89645
  }
89646
+ sendFeedback(
89647
+ editedRef.current ? "edited" : "accepted",
89648
+ editedRef.current ? message : void 0
89649
+ );
89620
89650
  committedMessageRef.current = message;
89621
89651
  setPhase("done");
89622
89652
  } else if (denied) {
@@ -91166,6 +91196,8 @@ function SplitApp({
91166
91196
  const [regenGroupIndex, setRegenGroupIndex] = (0, import_react76.useState)(null);
91167
91197
  const [regenBody, setRegenBody] = (0, import_react76.useState)(null);
91168
91198
  const [regenRetryCount, setRegenRetryCount] = (0, import_react76.useState)(0);
91199
+ const flowIdRef = (0, import_react76.useRef)("");
91200
+ const editedAnyRef = (0, import_react76.useRef)(false);
91169
91201
  const [streamPayload, setStreamPayload] = (0, import_react76.useState)(
91170
91202
  null
91171
91203
  );
@@ -91195,6 +91227,15 @@ function SplitApp({
91195
91227
  const regenStream = usePipelineStream(
91196
91228
  regenStreamOptions
91197
91229
  );
91230
+ const sendFeedback = (outcome) => {
91231
+ if (!flowIdRef.current || !authToken) return;
91232
+ deps.apiPost(
91233
+ "/commit/feedback",
91234
+ { flowId: flowIdRef.current, outcome },
91235
+ authToken
91236
+ ).catch(() => {
91237
+ });
91238
+ };
91198
91239
  (0, import_react76.useEffect)(() => {
91199
91240
  if (!TERMINAL_PHASES4.includes(phase)) return;
91200
91241
  const code = phase === "done" || phase === "aborted" ? 0 : 1;
@@ -91215,6 +91256,7 @@ function SplitApp({
91215
91256
  if (stream.result.orphans?.length) {
91216
91257
  setOrphanCount(stream.result.orphans.length);
91217
91258
  }
91259
+ if (stream.result.flowId) flowIdRef.current = stream.result.flowId;
91218
91260
  setPhase("review");
91219
91261
  return;
91220
91262
  }
@@ -91249,6 +91291,9 @@ function SplitApp({
91249
91291
  (0, import_react76.useEffect)(() => {
91250
91292
  if (phase !== "regenerating") return;
91251
91293
  if (regenStream.result) {
91294
+ if (regenStream.result.flowId) {
91295
+ flowIdRef.current = regenStream.result.flowId;
91296
+ }
91252
91297
  const newMessage = regenStream.result.message;
91253
91298
  if (regenGroupIndex !== null) {
91254
91299
  setGroups((prev) => {
@@ -91378,6 +91423,7 @@ ${hookResult.output}` : "";
91378
91423
  if (phase !== "review") return;
91379
91424
  if (confirmingAbort) {
91380
91425
  if (input.toLowerCase() === "y") {
91426
+ sendFeedback("discarded");
91381
91427
  setConfirmingAbort(false);
91382
91428
  setPhase("aborted");
91383
91429
  return;
@@ -91401,17 +91447,23 @@ ${hookResult.output}` : "";
91401
91447
  return;
91402
91448
  }
91403
91449
  if (input === "e") {
91450
+ editedAnyRef.current = true;
91404
91451
  setPhase("editing");
91405
91452
  return;
91406
91453
  }
91407
91454
  if (input === "r") {
91408
91455
  const group = groups[selectedIndex];
91409
91456
  if (!group || !authToken) return;
91457
+ sendFeedback("regenerated");
91410
91458
  const combinedPatch = group.files.map((f) => patchMap.get(f.path) ?? "").filter(Boolean).join("\n");
91411
91459
  const body = { diff: combinedPatch };
91412
91460
  if (Object.keys(activeFileConfig).length > 0) {
91413
91461
  body.config = activeFileConfig;
91414
91462
  }
91463
+ body.regeneration = {
91464
+ attempt: regenRetryCount + 1,
91465
+ previousMessage: group.message
91466
+ };
91415
91467
  setRegenGroupIndex(selectedIndex);
91416
91468
  setRegenBody(body);
91417
91469
  setRegenRetryCount((c) => c + 1);
@@ -91564,6 +91616,7 @@ ${body}`;
91564
91616
  });
91565
91617
  }
91566
91618
  }
91619
+ sendFeedback(editedAnyRef.current ? "edited" : "accepted");
91567
91620
  committedMessagesRef.current = activeGroups2.map((g) => g.message);
91568
91621
  setPhase("done");
91569
91622
  } catch (e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repomind",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "description": "AI-powered git commit messages and repository insights",
6
6
  "keywords": [