repomind 0.5.3 → 0.5.4

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 +36 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -39386,6 +39386,10 @@ async function* parseSSEStream(stream) {
39386
39386
  try {
39387
39387
  yield JSON.parse(data);
39388
39388
  } catch {
39389
+ yield {
39390
+ type: "error",
39391
+ message: `SSE JSON parse error: ${data.slice(0, 100)}`
39392
+ };
39389
39393
  }
39390
39394
  }
39391
39395
  }
@@ -40177,6 +40181,7 @@ ${bodyParts.join("\n\n")}` : newMsg
40177
40181
  var import_react33 = __toESM(require_react(), 1);
40178
40182
  var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
40179
40183
  function parseType(msg) {
40184
+ if (!msg) return { type: "chore", description: msg ?? "" };
40180
40185
  const match = msg.match(/^(\w+)(?:\([^)]+\))?!?:\s*(.+)/);
40181
40186
  return { type: match?.[1] ?? "chore", description: match?.[2] ?? msg };
40182
40187
  }
@@ -41020,6 +41025,7 @@ function SplitApp({
41020
41025
  const [skippedGroups, setSkippedGroups] = (0, import_react41.useState)(/* @__PURE__ */ new Set());
41021
41026
  const [commitProgress, setCommitProgress] = (0, import_react41.useState)(0);
41022
41027
  const [errorMsg, setErrorMsg] = (0, import_react41.useState)("");
41028
+ const [orphanCount, setOrphanCount] = (0, import_react41.useState)(0);
41023
41029
  const [originalFiles, setOriginalFiles] = (0, import_react41.useState)([]);
41024
41030
  const [hunksMap, setHunksMap] = (0, import_react41.useState)(/* @__PURE__ */ new Map());
41025
41031
  const [patchMap, setPatchMap] = (0, import_react41.useState)(/* @__PURE__ */ new Map());
@@ -41052,6 +41058,9 @@ function SplitApp({
41052
41058
  (a, b) => a.order - b.order
41053
41059
  );
41054
41060
  setGroups(sortedGroups);
41061
+ if (stream.result.orphans?.length) {
41062
+ setOrphanCount(stream.result.orphans.length);
41063
+ }
41055
41064
  setPhase("review");
41056
41065
  return;
41057
41066
  }
@@ -41199,7 +41208,7 @@ function SplitApp({
41199
41208
  }
41200
41209
  const currentHunks = deps.parseHunks(currentDiff);
41201
41210
  const originalHunks = hunksMap.get(fileRef.path) ?? [];
41202
- const lineSelections = [];
41211
+ const allLineSelections = [];
41203
41212
  for (const hs of fileRef.selection) {
41204
41213
  const origHunk = originalHunks.find(
41205
41214
  (h) => h.index === hs.hunkIndex
@@ -41219,20 +41228,29 @@ function SplitApp({
41219
41228
  }
41220
41229
  }
41221
41230
  if (matchedIndices.length > 0) {
41222
- lineSelections.push({
41231
+ allLineSelections.push({
41223
41232
  hunkIndex: curHunk.index,
41224
41233
  lineIndices: matchedIndices
41225
41234
  });
41226
41235
  }
41227
41236
  }
41228
- if (lineSelections.length > 0) {
41229
- await deps.stageLines(currentDiff, lineSelections);
41230
- }
41237
+ }
41238
+ if (allLineSelections.length > 0) {
41239
+ await deps.stageLines(currentDiff, allLineSelections);
41231
41240
  }
41232
41241
  }
41233
41242
  }
41243
+ if (!group.message) {
41244
+ await deps.resetStaging();
41245
+ setErrorMsg(
41246
+ `Mensagem vazia no grupo ${i + 1}/${activeGroups2.length}. Abortando.`
41247
+ );
41248
+ setPhase("error-commit");
41249
+ return;
41250
+ }
41234
41251
  const code = await deps.runGitCommit(group.message);
41235
41252
  if (code !== 0) {
41253
+ await deps.resetStaging();
41236
41254
  setErrorMsg(
41237
41255
  `git commit falhou no grupo ${i + 1}/${activeGroups2.length}: "${group.message}"`
41238
41256
  );
@@ -41246,6 +41264,8 @@ function SplitApp({
41246
41264
  }
41247
41265
  setCommitProgress(i + 1);
41248
41266
  } catch (e) {
41267
+ await deps.resetStaging().catch(() => {
41268
+ });
41249
41269
  const detail = e instanceof Error ? e.message : "Erro desconhecido";
41250
41270
  setErrorMsg(`Erro no grupo ${i + 1}/${activeGroups2.length}: ${detail}`);
41251
41271
  setPhase("error-commit");
@@ -41339,6 +41359,17 @@ function SplitApp({
41339
41359
  group.groupId
41340
41360
  );
41341
41361
  }),
41362
+ orphanCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Box_default, { marginTop: 1, gap: 1, children: [
41363
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Text, { color: C.yellow, children: "\u25B2" }),
41364
+ /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(Text, { color: C.yellow, children: [
41365
+ orphanCount,
41366
+ " linha",
41367
+ orphanCount !== 1 ? "s" : "",
41368
+ " n\xE3o agrupada",
41369
+ orphanCount !== 1 ? "s" : "",
41370
+ " (ser\xE3o preservadas no working tree)"
41371
+ ] })
41372
+ ] }),
41342
41373
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
41343
41374
  KeyHints,
41344
41375
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repomind",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "type": "module",
5
5
  "description": "AI-powered git commit messages and repository insights",
6
6
  "keywords": ["git", "ai", "commit", "cli"],