repomind 0.11.0 → 0.13.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.
- package/dist/index.js +185 -31
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -77415,16 +77415,45 @@ var PlanLimitError = class extends Error {
|
|
|
77415
77415
|
this.name = "PlanLimitError";
|
|
77416
77416
|
}
|
|
77417
77417
|
};
|
|
77418
|
-
|
|
77418
|
+
var OutdatedCliError = class extends Error {
|
|
77419
|
+
constructor(currentVersion, minVersion, latestVersion) {
|
|
77420
|
+
super(`CLI desatualizado: ${currentVersion} < ${minVersion}`);
|
|
77421
|
+
this.currentVersion = currentVersion;
|
|
77422
|
+
this.minVersion = minVersion;
|
|
77423
|
+
this.latestVersion = latestVersion;
|
|
77424
|
+
this.name = "OutdatedCliError";
|
|
77425
|
+
}
|
|
77426
|
+
};
|
|
77427
|
+
var CLI_VERSION_HEADER = "X-RepoMind-CLI-Version";
|
|
77428
|
+
var CLI_LATEST_HEADER = "X-RepoMind-CLI-Latest";
|
|
77429
|
+
function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch, cliVersion = "0.13.1") {
|
|
77430
|
+
let latestCliVersion = null;
|
|
77431
|
+
function baseHeaders(token) {
|
|
77432
|
+
return {
|
|
77433
|
+
"Content-Type": "application/json",
|
|
77434
|
+
[CLI_VERSION_HEADER]: cliVersion,
|
|
77435
|
+
...token ? { Authorization: `Bearer ${token}` } : {}
|
|
77436
|
+
};
|
|
77437
|
+
}
|
|
77438
|
+
function captureLatest(res) {
|
|
77439
|
+
const latest = res.headers.get(CLI_LATEST_HEADER);
|
|
77440
|
+
if (latest) latestCliVersion = latest;
|
|
77441
|
+
}
|
|
77442
|
+
function throwIfOutdated(status, errBody) {
|
|
77443
|
+
if (status === 426 && errBody.error === "cli_outdated") {
|
|
77444
|
+
throw new OutdatedCliError(
|
|
77445
|
+
cliVersion,
|
|
77446
|
+
String(errBody.minVersion ?? ""),
|
|
77447
|
+
String(errBody.latestVersion ?? "")
|
|
77448
|
+
);
|
|
77449
|
+
}
|
|
77450
|
+
}
|
|
77419
77451
|
async function request2(method, path2, token, body, timeoutMs) {
|
|
77420
77452
|
let res;
|
|
77421
77453
|
try {
|
|
77422
77454
|
res = await fetchFn(`${baseUrl}${path2}`, {
|
|
77423
77455
|
method,
|
|
77424
|
-
headers:
|
|
77425
|
-
"Content-Type": "application/json",
|
|
77426
|
-
...token ? { Authorization: `Bearer ${token}` } : {}
|
|
77427
|
-
},
|
|
77456
|
+
headers: baseHeaders(token),
|
|
77428
77457
|
...body !== void 0 ? { body: JSON.stringify(body) } : {},
|
|
77429
77458
|
signal: AbortSignal.timeout(timeoutMs ?? FETCH_TIMEOUT_MS)
|
|
77430
77459
|
});
|
|
@@ -77435,6 +77464,7 @@ function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch) {
|
|
|
77435
77464
|
err instanceof Error ? err.message : "network error"
|
|
77436
77465
|
);
|
|
77437
77466
|
}
|
|
77467
|
+
captureLatest(res);
|
|
77438
77468
|
if (!res.ok) {
|
|
77439
77469
|
const errBody = await res.json().catch(() => ({}));
|
|
77440
77470
|
if (DEBUG)
|
|
@@ -77452,6 +77482,7 @@ function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch) {
|
|
|
77452
77482
|
Number(errBody.limit ?? 0)
|
|
77453
77483
|
);
|
|
77454
77484
|
}
|
|
77485
|
+
throwIfOutdated(res.status, errBody);
|
|
77455
77486
|
const msg = errBody.detail ? `${errBody.error}: ${errBody.detail}` : String(errBody.error ?? "request failed");
|
|
77456
77487
|
throw new ApiError(res.status, msg);
|
|
77457
77488
|
}
|
|
@@ -77463,9 +77494,8 @@ function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch) {
|
|
|
77463
77494
|
res = await fetchFn(`${baseUrl}${path2}`, {
|
|
77464
77495
|
method: "POST",
|
|
77465
77496
|
headers: {
|
|
77466
|
-
|
|
77467
|
-
Accept: "text/event-stream"
|
|
77468
|
-
...token ? { Authorization: `Bearer ${token}` } : {}
|
|
77497
|
+
...baseHeaders(token),
|
|
77498
|
+
Accept: "text/event-stream"
|
|
77469
77499
|
},
|
|
77470
77500
|
body: JSON.stringify(body),
|
|
77471
77501
|
signal: AbortSignal.timeout(timeoutMs ?? STREAM_TIMEOUT_MS)
|
|
@@ -77477,6 +77507,7 @@ function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch) {
|
|
|
77477
77507
|
err instanceof Error ? err.message : "network error"
|
|
77478
77508
|
);
|
|
77479
77509
|
}
|
|
77510
|
+
captureLatest(res);
|
|
77480
77511
|
if (!res.ok) {
|
|
77481
77512
|
const errBody = await res.json().catch(() => ({}));
|
|
77482
77513
|
if (DEBUG)
|
|
@@ -77488,6 +77519,7 @@ function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch) {
|
|
|
77488
77519
|
Number(errBody.limit ?? 0)
|
|
77489
77520
|
);
|
|
77490
77521
|
}
|
|
77522
|
+
throwIfOutdated(res.status, errBody);
|
|
77491
77523
|
const msg = errBody.detail ? `${errBody.error}: ${errBody.detail}` : String(errBody.error ?? "request failed");
|
|
77492
77524
|
throw new ApiError(res.status, msg);
|
|
77493
77525
|
}
|
|
@@ -77500,7 +77532,10 @@ function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch) {
|
|
|
77500
77532
|
get(path2, token) {
|
|
77501
77533
|
return request2("GET", path2, token);
|
|
77502
77534
|
},
|
|
77503
|
-
postStream
|
|
77535
|
+
postStream,
|
|
77536
|
+
getLatestCliVersion() {
|
|
77537
|
+
return latestCliVersion;
|
|
77538
|
+
}
|
|
77504
77539
|
};
|
|
77505
77540
|
}
|
|
77506
77541
|
var apiClient = createApiClient();
|
|
@@ -86148,6 +86183,17 @@ async function readRepoConfig(cwd2 = process.cwd()) {
|
|
|
86148
86183
|
}
|
|
86149
86184
|
}
|
|
86150
86185
|
|
|
86186
|
+
// src/lib/update-check.ts
|
|
86187
|
+
function getUpdateInfo() {
|
|
86188
|
+
const latest = apiClient.getLatestCliVersion();
|
|
86189
|
+
if (!latest) return void 0;
|
|
86190
|
+
const current = "0.13.1";
|
|
86191
|
+
return { current, latest };
|
|
86192
|
+
}
|
|
86193
|
+
|
|
86194
|
+
// src/lib/update-hint.ts
|
|
86195
|
+
var UPDATE_COMMAND = "npm i -g repomind (ou bun add -g repomind)";
|
|
86196
|
+
|
|
86151
86197
|
// ../../node_modules/.bun/@inkjs+ui@2.0.0+4d0808a67a30d5ab/node_modules/@inkjs/ui/build/components/badge/badge.js
|
|
86152
86198
|
var import_react32 = __toESM(require_react(), 1);
|
|
86153
86199
|
|
|
@@ -89341,6 +89387,9 @@ function CommitApp({
|
|
|
89341
89387
|
deps.instructionsOverride ?? null
|
|
89342
89388
|
);
|
|
89343
89389
|
const committedMessageRef = (0, import_react64.useRef)("");
|
|
89390
|
+
const lastRejectedRef = (0, import_react64.useRef)("");
|
|
89391
|
+
const flowIdRef = (0, import_react64.useRef)("");
|
|
89392
|
+
const editedRef = (0, import_react64.useRef)(false);
|
|
89344
89393
|
const [phase, setPhase] = (0, import_react64.useState)("analyzing");
|
|
89345
89394
|
const [message, setMessage] = (0, import_react64.useState)("");
|
|
89346
89395
|
const [issueRef, setIssueRef] = (0, import_react64.useState)("");
|
|
@@ -89357,15 +89406,32 @@ function CommitApp({
|
|
|
89357
89406
|
);
|
|
89358
89407
|
const streamOptions = streamPayload && phase === "streaming" ? {
|
|
89359
89408
|
path: streamPayload.path,
|
|
89360
|
-
body:
|
|
89409
|
+
body: retryCount > 0 ? {
|
|
89410
|
+
...streamPayload.body,
|
|
89411
|
+
regeneration: {
|
|
89412
|
+
attempt: retryCount,
|
|
89413
|
+
...lastRejectedRef.current ? { previousMessage: lastRejectedRef.current } : {}
|
|
89414
|
+
}
|
|
89415
|
+
} : streamPayload.body,
|
|
89361
89416
|
token: streamPayload.token,
|
|
89362
89417
|
postStream: deps.postStream,
|
|
89363
89418
|
stepLabels: STEP_LABELS,
|
|
89364
89419
|
retryKey: retryCount
|
|
89365
89420
|
} : null;
|
|
89366
|
-
const stream = usePipelineStream(
|
|
89367
|
-
|
|
89368
|
-
|
|
89421
|
+
const stream = usePipelineStream(streamOptions);
|
|
89422
|
+
const sendFeedback = (outcome, editedMessage) => {
|
|
89423
|
+
if (!flowIdRef.current || !streamPayload?.token) return;
|
|
89424
|
+
deps.apiPost(
|
|
89425
|
+
"/commit/feedback",
|
|
89426
|
+
{
|
|
89427
|
+
flowId: flowIdRef.current,
|
|
89428
|
+
outcome,
|
|
89429
|
+
...editedMessage ? { editedMessage } : {}
|
|
89430
|
+
},
|
|
89431
|
+
streamPayload.token
|
|
89432
|
+
).catch(() => {
|
|
89433
|
+
});
|
|
89434
|
+
};
|
|
89369
89435
|
(0, import_react64.useEffect)(() => {
|
|
89370
89436
|
if (!TERMINAL_PHASES.includes(phase)) return;
|
|
89371
89437
|
const code = phase === "done" || phase === "aborted" ? 0 : 1;
|
|
@@ -89381,12 +89447,20 @@ function CommitApp({
|
|
|
89381
89447
|
if (stream.result) {
|
|
89382
89448
|
setMessage(stream.result.message);
|
|
89383
89449
|
if (stream.result.commitId) setCommitId(stream.result.commitId);
|
|
89450
|
+
if (stream.result.flowId) flowIdRef.current = stream.result.flowId;
|
|
89451
|
+
editedRef.current = false;
|
|
89384
89452
|
setPhase("confirm");
|
|
89385
89453
|
return;
|
|
89386
89454
|
}
|
|
89387
89455
|
if (stream.error) {
|
|
89388
89456
|
const e = stream.errorRaw;
|
|
89389
|
-
if (e instanceof
|
|
89457
|
+
if (e instanceof OutdatedCliError) {
|
|
89458
|
+
setErrorMsg(
|
|
89459
|
+
`Sua vers\xE3o do CLI (${e.currentVersion}) \xE9 antiga demais.
|
|
89460
|
+
\u2192 Atualize com: ${UPDATE_COMMAND}`
|
|
89461
|
+
);
|
|
89462
|
+
setPhase("error-api");
|
|
89463
|
+
} else if (e instanceof PlanLimitError) {
|
|
89390
89464
|
setErrorMsg(
|
|
89391
89465
|
`Limite do plano atingido (${e.used}/${e.limit} commits este m\xEAs)
|
|
89392
89466
|
\u2192 ${terminalLink("Fa\xE7a upgrade", `${WEB_BASE_URL}/dashboard/plano`)}`
|
|
@@ -89480,7 +89554,13 @@ ${hookResult.output}` : "";
|
|
|
89480
89554
|
setStreamPayload({ path: "/commit/generate", body, token });
|
|
89481
89555
|
setPhase("streaming");
|
|
89482
89556
|
} catch (e) {
|
|
89483
|
-
if (e instanceof
|
|
89557
|
+
if (e instanceof OutdatedCliError) {
|
|
89558
|
+
setErrorMsg(
|
|
89559
|
+
`Sua vers\xE3o do CLI (${e.currentVersion}) \xE9 antiga demais.
|
|
89560
|
+
\u2192 Atualize com: ${UPDATE_COMMAND}`
|
|
89561
|
+
);
|
|
89562
|
+
setPhase("error-api");
|
|
89563
|
+
} else if (e instanceof PlanLimitError) {
|
|
89484
89564
|
setErrorMsg(
|
|
89485
89565
|
`Limite do plano atingido (${e.used}/${e.limit} commits este m\xEAs)
|
|
89486
89566
|
\u2192 ${terminalLink("Fa\xE7a upgrade", `${WEB_BASE_URL}/dashboard/plano`)}`
|
|
@@ -89534,6 +89614,7 @@ ${prefixed}`);
|
|
|
89534
89614
|
if (phase !== "confirm") return;
|
|
89535
89615
|
if (confirmingAbort) {
|
|
89536
89616
|
if (input.toLowerCase() === "y") {
|
|
89617
|
+
sendFeedback("discarded");
|
|
89537
89618
|
setConfirmingAbort(false);
|
|
89538
89619
|
setPhase("aborted");
|
|
89539
89620
|
return;
|
|
@@ -89546,6 +89627,8 @@ ${prefixed}`);
|
|
|
89546
89627
|
}
|
|
89547
89628
|
const parsed2 = parseCommitType(message);
|
|
89548
89629
|
if (input === "r") {
|
|
89630
|
+
sendFeedback("regenerated");
|
|
89631
|
+
lastRejectedRef.current = message;
|
|
89549
89632
|
setMessage("");
|
|
89550
89633
|
setCommitId("");
|
|
89551
89634
|
setIssueRef("");
|
|
@@ -89554,6 +89637,7 @@ ${prefixed}`);
|
|
|
89554
89637
|
return;
|
|
89555
89638
|
}
|
|
89556
89639
|
if (input === "e") {
|
|
89640
|
+
editedRef.current = true;
|
|
89557
89641
|
setPhase("editing");
|
|
89558
89642
|
return;
|
|
89559
89643
|
}
|
|
@@ -89617,6 +89701,10 @@ ${prefixed}`);
|
|
|
89617
89701
|
).catch(() => {
|
|
89618
89702
|
});
|
|
89619
89703
|
}
|
|
89704
|
+
sendFeedback(
|
|
89705
|
+
editedRef.current ? "edited" : "accepted",
|
|
89706
|
+
editedRef.current ? message : void 0
|
|
89707
|
+
);
|
|
89620
89708
|
committedMessageRef.current = message;
|
|
89621
89709
|
setPhase("done");
|
|
89622
89710
|
} else if (denied) {
|
|
@@ -89803,10 +89891,23 @@ function parseType(msg) {
|
|
|
89803
89891
|
const match = msg.match(/^(\w+)(?:\([^)]+\))?!?:\s*(.+)/);
|
|
89804
89892
|
return { type: match?.[1] ?? "chore", description: match?.[2] ?? msg };
|
|
89805
89893
|
}
|
|
89894
|
+
function UpdateBanner({ update }) {
|
|
89895
|
+
if (!update) return null;
|
|
89896
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Box_default, { marginTop: 1, paddingLeft: 1, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { color: C.dim, children: [
|
|
89897
|
+
"Nova vers\xE3o dispon\xEDvel: ",
|
|
89898
|
+
update.current,
|
|
89899
|
+
" \u2192 ",
|
|
89900
|
+
update.latest,
|
|
89901
|
+
" \xB7",
|
|
89902
|
+
" ",
|
|
89903
|
+
UPDATE_COMMAND
|
|
89904
|
+
] }) });
|
|
89905
|
+
}
|
|
89806
89906
|
function SplitDoneSummary({
|
|
89807
89907
|
commits,
|
|
89808
89908
|
durationMs,
|
|
89809
|
-
totalFiles
|
|
89909
|
+
totalFiles,
|
|
89910
|
+
updateAvailable
|
|
89810
89911
|
}) {
|
|
89811
89912
|
const { exit } = use_app_default();
|
|
89812
89913
|
(0, import_react65.useEffect)(() => {
|
|
@@ -89835,27 +89936,32 @@ function SplitDoneSummary({
|
|
|
89835
89936
|
durationMs != null ? ` em ${(durationMs / 1e3).toFixed(1)}s` : "",
|
|
89836
89937
|
totalFiles != null ? ` \xB7 ${totalFiles} arquivo${totalFiles !== 1 ? "s" : ""}` : ""
|
|
89837
89938
|
] })
|
|
89838
|
-
] })
|
|
89939
|
+
] }),
|
|
89940
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(UpdateBanner, { update: updateAvailable })
|
|
89839
89941
|
] });
|
|
89840
89942
|
}
|
|
89841
89943
|
function CommitDoneSummary({
|
|
89842
89944
|
message,
|
|
89843
|
-
durationMs
|
|
89945
|
+
durationMs,
|
|
89946
|
+
updateAvailable
|
|
89844
89947
|
}) {
|
|
89845
89948
|
const { exit } = use_app_default();
|
|
89846
89949
|
(0, import_react65.useEffect)(() => {
|
|
89847
89950
|
exit();
|
|
89848
89951
|
}, []);
|
|
89849
89952
|
const { type, description } = parseType(message);
|
|
89850
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Box_default, {
|
|
89851
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
89852
|
-
|
|
89853
|
-
|
|
89854
|
-
|
|
89855
|
-
|
|
89856
|
-
|
|
89857
|
-
|
|
89858
|
-
|
|
89953
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
89954
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Box_default, { paddingLeft: 1, gap: 1, alignItems: "center", children: [
|
|
89955
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { color: C.green, children: "\u2713" }),
|
|
89956
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TypeBadge, { type }),
|
|
89957
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Text, { color: C.green, children: description }),
|
|
89958
|
+
durationMs != null && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Text, { color: C.dim, children: [
|
|
89959
|
+
"\xB7 ",
|
|
89960
|
+
(durationMs / 1e3).toFixed(1),
|
|
89961
|
+
"s"
|
|
89962
|
+
] })
|
|
89963
|
+
] }),
|
|
89964
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(UpdateBanner, { update: updateAvailable })
|
|
89859
89965
|
] });
|
|
89860
89966
|
}
|
|
89861
89967
|
|
|
@@ -89894,6 +90000,12 @@ async function commitCommand() {
|
|
|
89894
90000
|
console.log(`\u2713 ${result.message}`);
|
|
89895
90001
|
console.log(" Onboarding concluido! Volte ao dashboard.");
|
|
89896
90002
|
} catch (e) {
|
|
90003
|
+
if (e instanceof OutdatedCliError) {
|
|
90004
|
+
console.error(
|
|
90005
|
+
`\u2717 Sua vers\xE3o do CLI (${e.currentVersion}) \xE9 antiga demais. Atualize: ${UPDATE_COMMAND}`
|
|
90006
|
+
);
|
|
90007
|
+
process.exit(1);
|
|
90008
|
+
}
|
|
89897
90009
|
const detail = e instanceof Error ? e.message : "";
|
|
89898
90010
|
console.error(
|
|
89899
90011
|
`\u2717 Falha ao criar commit demo.${detail ? ` ${detail}` : ""}`
|
|
@@ -89941,7 +90053,10 @@ async function commitCommand() {
|
|
|
89941
90053
|
}
|
|
89942
90054
|
if (completedMessage) {
|
|
89943
90055
|
const { waitUntilExit: waitUntilExit2 } = render_default(
|
|
89944
|
-
import_react66.default.createElement(CommitDoneSummary, {
|
|
90056
|
+
import_react66.default.createElement(CommitDoneSummary, {
|
|
90057
|
+
message: completedMessage,
|
|
90058
|
+
updateAvailable: getUpdateInfo()
|
|
90059
|
+
})
|
|
89945
90060
|
);
|
|
89946
90061
|
await waitUntilExit2();
|
|
89947
90062
|
}
|
|
@@ -90737,7 +90852,13 @@ function PrApp({
|
|
|
90737
90852
|
setPrBody(result.body);
|
|
90738
90853
|
setPhase("result");
|
|
90739
90854
|
} catch (e) {
|
|
90740
|
-
if (e instanceof
|
|
90855
|
+
if (e instanceof OutdatedCliError) {
|
|
90856
|
+
setErrorMsg(
|
|
90857
|
+
`Sua vers\xE3o do CLI (${e.currentVersion}) \xE9 antiga demais.
|
|
90858
|
+
\u2192 Atualize com: ${UPDATE_COMMAND}`
|
|
90859
|
+
);
|
|
90860
|
+
setPhase("error-api");
|
|
90861
|
+
} else if (e instanceof PlanLimitError) {
|
|
90741
90862
|
setErrorMsg(
|
|
90742
90863
|
`Limite do plano atingido (${e.used}/${e.limit} commits este m\xEAs)
|
|
90743
90864
|
\u2192 ${terminalLink("Fa\xE7a upgrade", `${WEB_BASE_URL}/dashboard/plano`)}`
|
|
@@ -91166,6 +91287,8 @@ function SplitApp({
|
|
|
91166
91287
|
const [regenGroupIndex, setRegenGroupIndex] = (0, import_react76.useState)(null);
|
|
91167
91288
|
const [regenBody, setRegenBody] = (0, import_react76.useState)(null);
|
|
91168
91289
|
const [regenRetryCount, setRegenRetryCount] = (0, import_react76.useState)(0);
|
|
91290
|
+
const flowIdRef = (0, import_react76.useRef)("");
|
|
91291
|
+
const editedAnyRef = (0, import_react76.useRef)(false);
|
|
91169
91292
|
const [streamPayload, setStreamPayload] = (0, import_react76.useState)(
|
|
91170
91293
|
null
|
|
91171
91294
|
);
|
|
@@ -91195,6 +91318,15 @@ function SplitApp({
|
|
|
91195
91318
|
const regenStream = usePipelineStream(
|
|
91196
91319
|
regenStreamOptions
|
|
91197
91320
|
);
|
|
91321
|
+
const sendFeedback = (outcome) => {
|
|
91322
|
+
if (!flowIdRef.current || !authToken) return;
|
|
91323
|
+
deps.apiPost(
|
|
91324
|
+
"/commit/feedback",
|
|
91325
|
+
{ flowId: flowIdRef.current, outcome },
|
|
91326
|
+
authToken
|
|
91327
|
+
).catch(() => {
|
|
91328
|
+
});
|
|
91329
|
+
};
|
|
91198
91330
|
(0, import_react76.useEffect)(() => {
|
|
91199
91331
|
if (!TERMINAL_PHASES4.includes(phase)) return;
|
|
91200
91332
|
const code = phase === "done" || phase === "aborted" ? 0 : 1;
|
|
@@ -91215,12 +91347,19 @@ function SplitApp({
|
|
|
91215
91347
|
if (stream.result.orphans?.length) {
|
|
91216
91348
|
setOrphanCount(stream.result.orphans.length);
|
|
91217
91349
|
}
|
|
91350
|
+
if (stream.result.flowId) flowIdRef.current = stream.result.flowId;
|
|
91218
91351
|
setPhase("review");
|
|
91219
91352
|
return;
|
|
91220
91353
|
}
|
|
91221
91354
|
if (stream.error) {
|
|
91222
91355
|
const e = stream.errorRaw;
|
|
91223
|
-
if (e instanceof
|
|
91356
|
+
if (e instanceof OutdatedCliError) {
|
|
91357
|
+
setErrorMsg(
|
|
91358
|
+
`Sua versao do CLI (${e.currentVersion}) e antiga demais.
|
|
91359
|
+
\u2192 Atualize com: ${UPDATE_COMMAND}`
|
|
91360
|
+
);
|
|
91361
|
+
setPhase("error-api");
|
|
91362
|
+
} else if (e instanceof PlanLimitError) {
|
|
91224
91363
|
setErrorMsg(
|
|
91225
91364
|
`Limite do plano atingido (${e.used}/${e.limit} commits este mes)`
|
|
91226
91365
|
);
|
|
@@ -91249,6 +91388,9 @@ function SplitApp({
|
|
|
91249
91388
|
(0, import_react76.useEffect)(() => {
|
|
91250
91389
|
if (phase !== "regenerating") return;
|
|
91251
91390
|
if (regenStream.result) {
|
|
91391
|
+
if (regenStream.result.flowId) {
|
|
91392
|
+
flowIdRef.current = regenStream.result.flowId;
|
|
91393
|
+
}
|
|
91252
91394
|
const newMessage = regenStream.result.message;
|
|
91253
91395
|
if (regenGroupIndex !== null) {
|
|
91254
91396
|
setGroups((prev) => {
|
|
@@ -91378,6 +91520,7 @@ ${hookResult.output}` : "";
|
|
|
91378
91520
|
if (phase !== "review") return;
|
|
91379
91521
|
if (confirmingAbort) {
|
|
91380
91522
|
if (input.toLowerCase() === "y") {
|
|
91523
|
+
sendFeedback("discarded");
|
|
91381
91524
|
setConfirmingAbort(false);
|
|
91382
91525
|
setPhase("aborted");
|
|
91383
91526
|
return;
|
|
@@ -91401,17 +91544,23 @@ ${hookResult.output}` : "";
|
|
|
91401
91544
|
return;
|
|
91402
91545
|
}
|
|
91403
91546
|
if (input === "e") {
|
|
91547
|
+
editedAnyRef.current = true;
|
|
91404
91548
|
setPhase("editing");
|
|
91405
91549
|
return;
|
|
91406
91550
|
}
|
|
91407
91551
|
if (input === "r") {
|
|
91408
91552
|
const group = groups[selectedIndex];
|
|
91409
91553
|
if (!group || !authToken) return;
|
|
91554
|
+
sendFeedback("regenerated");
|
|
91410
91555
|
const combinedPatch = group.files.map((f) => patchMap.get(f.path) ?? "").filter(Boolean).join("\n");
|
|
91411
91556
|
const body = { diff: combinedPatch };
|
|
91412
91557
|
if (Object.keys(activeFileConfig).length > 0) {
|
|
91413
91558
|
body.config = activeFileConfig;
|
|
91414
91559
|
}
|
|
91560
|
+
body.regeneration = {
|
|
91561
|
+
attempt: regenRetryCount + 1,
|
|
91562
|
+
previousMessage: group.message
|
|
91563
|
+
};
|
|
91415
91564
|
setRegenGroupIndex(selectedIndex);
|
|
91416
91565
|
setRegenBody(body);
|
|
91417
91566
|
setRegenRetryCount((c) => c + 1);
|
|
@@ -91564,6 +91713,7 @@ ${body}`;
|
|
|
91564
91713
|
});
|
|
91565
91714
|
}
|
|
91566
91715
|
}
|
|
91716
|
+
sendFeedback(editedAnyRef.current ? "edited" : "accepted");
|
|
91567
91717
|
committedMessagesRef.current = activeGroups2.map((g) => g.message);
|
|
91568
91718
|
setPhase("done");
|
|
91569
91719
|
} catch (e) {
|
|
@@ -91913,7 +92063,10 @@ async function splitCommand() {
|
|
|
91913
92063
|
exitImmersive();
|
|
91914
92064
|
if (completedCommits.length > 0) {
|
|
91915
92065
|
const { waitUntilExit: waitUntilExit2 } = render_default(
|
|
91916
|
-
import_react77.default.createElement(SplitDoneSummary, {
|
|
92066
|
+
import_react77.default.createElement(SplitDoneSummary, {
|
|
92067
|
+
commits: completedCommits,
|
|
92068
|
+
updateAvailable: getUpdateInfo()
|
|
92069
|
+
})
|
|
91917
92070
|
);
|
|
91918
92071
|
await waitUntilExit2();
|
|
91919
92072
|
}
|
|
@@ -92052,6 +92205,7 @@ function CommandHelp({
|
|
|
92052
92205
|
|
|
92053
92206
|
// src/index.ts
|
|
92054
92207
|
function getVersion() {
|
|
92208
|
+
if ("0.13.1") return "0.13.1";
|
|
92055
92209
|
try {
|
|
92056
92210
|
const require2 = createRequire(import.meta.url);
|
|
92057
92211
|
const pkg = require2("../package.json");
|