repomind 0.13.1 → 0.15.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.
- package/dist/index.js +1058 -525
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -55614,14 +55614,14 @@ var require_react_reconciler_production = __commonJS({
|
|
|
55614
55614
|
}
|
|
55615
55615
|
var exports2 = {};
|
|
55616
55616
|
"use strict";
|
|
55617
|
-
var
|
|
55617
|
+
var React41 = require_react(), Scheduler2 = require_scheduler(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
55618
55618
|
Symbol.for("react.scope");
|
|
55619
55619
|
var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
|
|
55620
55620
|
Symbol.for("react.legacy_hidden");
|
|
55621
55621
|
Symbol.for("react.tracing_marker");
|
|
55622
55622
|
var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
|
55623
55623
|
Symbol.for("react.view_transition");
|
|
55624
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals =
|
|
55624
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals = React41.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, rendererVersion = $$$config.rendererVersion, rendererPackageName = $$$config.rendererPackageName, extraDevToolsConfig = $$$config.extraDevToolsConfig, getPublicInstance = $$$config.getPublicInstance, getRootHostContext = $$$config.getRootHostContext, getChildHostContext = $$$config.getChildHostContext, prepareForCommit = $$$config.prepareForCommit, resetAfterCommit = $$$config.resetAfterCommit, createInstance = $$$config.createInstance;
|
|
55625
55625
|
$$$config.cloneMutableInstance;
|
|
55626
55626
|
var appendInitialChild = $$$config.appendInitialChild, finalizeInitialChildren = $$$config.finalizeInitialChildren, shouldSetTextContent = $$$config.shouldSetTextContent, createTextInstance = $$$config.createTextInstance;
|
|
55627
55627
|
$$$config.cloneMutableTextInstance;
|
|
@@ -68214,14 +68214,14 @@ var require_react_reconciler_development = __commonJS({
|
|
|
68214
68214
|
}
|
|
68215
68215
|
var exports2 = {};
|
|
68216
68216
|
"use strict";
|
|
68217
|
-
var
|
|
68217
|
+
var React41 = require_react(), Scheduler2 = require_scheduler(), assign = Object.assign, REACT_LEGACY_ELEMENT_TYPE = Symbol.for("react.element"), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
68218
68218
|
Symbol.for("react.scope");
|
|
68219
68219
|
var REACT_ACTIVITY_TYPE = Symbol.for("react.activity");
|
|
68220
68220
|
Symbol.for("react.legacy_hidden");
|
|
68221
68221
|
Symbol.for("react.tracing_marker");
|
|
68222
68222
|
var REACT_MEMO_CACHE_SENTINEL = Symbol.for("react.memo_cache_sentinel");
|
|
68223
68223
|
Symbol.for("react.view_transition");
|
|
68224
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals =
|
|
68224
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator, REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), isArrayImpl = Array.isArray, ReactSharedInternals = React41.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, rendererVersion = $$$config.rendererVersion, rendererPackageName = $$$config.rendererPackageName, extraDevToolsConfig = $$$config.extraDevToolsConfig, getPublicInstance = $$$config.getPublicInstance, getRootHostContext = $$$config.getRootHostContext, getChildHostContext = $$$config.getChildHostContext, prepareForCommit = $$$config.prepareForCommit, resetAfterCommit = $$$config.resetAfterCommit, createInstance = $$$config.createInstance;
|
|
68225
68225
|
$$$config.cloneMutableInstance;
|
|
68226
68226
|
var appendInitialChild = $$$config.appendInitialChild, finalizeInitialChildren = $$$config.finalizeInitialChildren, shouldSetTextContent = $$$config.shouldSetTextContent, createTextInstance = $$$config.createTextInstance;
|
|
68227
68227
|
$$$config.cloneMutableTextInstance;
|
|
@@ -74628,18 +74628,18 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
74628
74628
|
function isValidElement2(object) {
|
|
74629
74629
|
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
74630
74630
|
}
|
|
74631
|
-
var
|
|
74631
|
+
var React41 = require_react(), REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React41.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
|
|
74632
74632
|
return null;
|
|
74633
74633
|
};
|
|
74634
|
-
|
|
74634
|
+
React41 = {
|
|
74635
74635
|
react_stack_bottom_frame: function(callStackForError) {
|
|
74636
74636
|
return callStackForError();
|
|
74637
74637
|
}
|
|
74638
74638
|
};
|
|
74639
74639
|
var specialPropKeyWarningShown;
|
|
74640
74640
|
var didWarnAboutElementRef = {};
|
|
74641
|
-
var unknownOwnerDebugStack =
|
|
74642
|
-
|
|
74641
|
+
var unknownOwnerDebugStack = React41.react_stack_bottom_frame.bind(
|
|
74642
|
+
React41,
|
|
74643
74643
|
UnknownOwner
|
|
74644
74644
|
)();
|
|
74645
74645
|
var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
|
|
@@ -77407,14 +77407,41 @@ var TokenExpiredError = class extends Error {
|
|
|
77407
77407
|
}
|
|
77408
77408
|
};
|
|
77409
77409
|
var PlanLimitError = class extends Error {
|
|
77410
|
-
|
|
77411
|
-
|
|
77412
|
-
|
|
77413
|
-
|
|
77414
|
-
|
|
77410
|
+
plan;
|
|
77411
|
+
used;
|
|
77412
|
+
limit;
|
|
77413
|
+
// Codigo de maquina do motivo (no_plan/past_due/canceled/quota_exceeded), quando
|
|
77414
|
+
// a API o envia. Permite UX propria sem fazer parse de string.
|
|
77415
|
+
reason;
|
|
77416
|
+
// Mensagem pronta para exibir. Preferir esta a montar cópia no cliente.
|
|
77417
|
+
displayMessage;
|
|
77418
|
+
action;
|
|
77419
|
+
constructor(info3) {
|
|
77420
|
+
super(`Plan limit reached: ${info3.used}/${info3.limit}`);
|
|
77415
77421
|
this.name = "PlanLimitError";
|
|
77422
|
+
this.plan = info3.plan;
|
|
77423
|
+
this.used = info3.used;
|
|
77424
|
+
this.limit = info3.limit;
|
|
77425
|
+
this.reason = info3.reason;
|
|
77426
|
+
this.displayMessage = info3.displayMessage;
|
|
77427
|
+
this.action = info3.action;
|
|
77416
77428
|
}
|
|
77417
77429
|
};
|
|
77430
|
+
function planLimitErrorFromBody(errBody) {
|
|
77431
|
+
const used = Number(errBody.used ?? 0);
|
|
77432
|
+
const limit = Number(errBody.limit ?? 0);
|
|
77433
|
+
const rawAction = errBody.action;
|
|
77434
|
+
const action = rawAction && typeof rawAction.label === "string" && typeof rawAction.url === "string" ? { label: rawAction.label, url: rawAction.url } : { label: "Fa\xE7a upgrade", url: `${WEB_BASE_URL}/dashboard/plano` };
|
|
77435
|
+
const displayMessage = typeof errBody.message === "string" && errBody.message.length > 0 ? errBody.message : `Limite do plano atingido (${used}/${limit} commits este m\xEAs)`;
|
|
77436
|
+
return new PlanLimitError({
|
|
77437
|
+
plan: String(errBody.plan ?? "unknown"),
|
|
77438
|
+
used,
|
|
77439
|
+
limit,
|
|
77440
|
+
reason: typeof errBody.reason === "string" ? errBody.reason : void 0,
|
|
77441
|
+
displayMessage,
|
|
77442
|
+
action
|
|
77443
|
+
});
|
|
77444
|
+
}
|
|
77418
77445
|
var OutdatedCliError = class extends Error {
|
|
77419
77446
|
constructor(currentVersion, minVersion, latestVersion) {
|
|
77420
77447
|
super(`CLI desatualizado: ${currentVersion} < ${minVersion}`);
|
|
@@ -77426,7 +77453,7 @@ var OutdatedCliError = class extends Error {
|
|
|
77426
77453
|
};
|
|
77427
77454
|
var CLI_VERSION_HEADER = "X-RepoMind-CLI-Version";
|
|
77428
77455
|
var CLI_LATEST_HEADER = "X-RepoMind-CLI-Latest";
|
|
77429
|
-
function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch, cliVersion = "0.
|
|
77456
|
+
function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch, cliVersion = "0.15.0") {
|
|
77430
77457
|
let latestCliVersion = null;
|
|
77431
77458
|
function baseHeaders(token) {
|
|
77432
77459
|
return {
|
|
@@ -77476,11 +77503,7 @@ function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch, cliVersio
|
|
|
77476
77503
|
throw new TokenExpiredError();
|
|
77477
77504
|
}
|
|
77478
77505
|
if (res.status === 402 && errBody.error === "plan_limit_reached") {
|
|
77479
|
-
throw
|
|
77480
|
-
String(errBody.plan ?? "unknown"),
|
|
77481
|
-
Number(errBody.used ?? 0),
|
|
77482
|
-
Number(errBody.limit ?? 0)
|
|
77483
|
-
);
|
|
77506
|
+
throw planLimitErrorFromBody(errBody);
|
|
77484
77507
|
}
|
|
77485
77508
|
throwIfOutdated(res.status, errBody);
|
|
77486
77509
|
const msg = errBody.detail ? `${errBody.error}: ${errBody.detail}` : String(errBody.error ?? "request failed");
|
|
@@ -77513,11 +77536,7 @@ function createApiClient(baseUrl = DEFAULT_BASE_URL2, fetchFn = fetch, cliVersio
|
|
|
77513
77536
|
if (DEBUG)
|
|
77514
77537
|
console.error(`[api-client] POST ${path2} \u2192 ${res.status}`, errBody);
|
|
77515
77538
|
if (res.status === 402 && errBody.error === "plan_limit_reached") {
|
|
77516
|
-
throw
|
|
77517
|
-
String(errBody.plan ?? "unknown"),
|
|
77518
|
-
Number(errBody.used ?? 0),
|
|
77519
|
-
Number(errBody.limit ?? 0)
|
|
77520
|
-
);
|
|
77539
|
+
throw planLimitErrorFromBody(errBody);
|
|
77521
77540
|
}
|
|
77522
77541
|
throwIfOutdated(res.status, errBody);
|
|
77523
77542
|
const msg = errBody.detail ? `${errBody.error}: ${errBody.detail}` : String(errBody.error ?? "request failed");
|
|
@@ -85728,7 +85747,7 @@ var import_react27 = __toESM(require_react(), 1);
|
|
|
85728
85747
|
var import_react28 = __toESM(require_react(), 1);
|
|
85729
85748
|
|
|
85730
85749
|
// src/commands/commit.ts
|
|
85731
|
-
var
|
|
85750
|
+
var import_react67 = __toESM(require_react(), 1);
|
|
85732
85751
|
|
|
85733
85752
|
// src/lib/auth.ts
|
|
85734
85753
|
import { mkdirSync, readFileSync as readFileSync3, rmSync, writeFileSync } from "node:fs";
|
|
@@ -86187,7 +86206,7 @@ async function readRepoConfig(cwd2 = process.cwd()) {
|
|
|
86187
86206
|
function getUpdateInfo() {
|
|
86188
86207
|
const latest = apiClient.getLatestCliVersion();
|
|
86189
86208
|
if (!latest) return void 0;
|
|
86190
|
-
const current = "0.
|
|
86209
|
+
const current = "0.15.0";
|
|
86191
86210
|
return { current, latest };
|
|
86192
86211
|
}
|
|
86193
86212
|
|
|
@@ -88730,8 +88749,8 @@ var import_react59 = __toESM(require_react(), 1);
|
|
|
88730
88749
|
var import_react60 = __toESM(require_react(), 1);
|
|
88731
88750
|
var cursor3 = source_default.inverse(" ");
|
|
88732
88751
|
|
|
88733
|
-
// src/ui/commit-app.tsx
|
|
88734
|
-
var
|
|
88752
|
+
// src/ui/commit/commit-app.tsx
|
|
88753
|
+
var import_react65 = __toESM(require_react(), 1);
|
|
88735
88754
|
|
|
88736
88755
|
// ../../node_modules/.bun/supports-hyperlinks@4.4.0/node_modules/supports-hyperlinks/index.js
|
|
88737
88756
|
init_supports_color();
|
|
@@ -88917,6 +88936,14 @@ async function* parseSSEStream(stream) {
|
|
|
88917
88936
|
}
|
|
88918
88937
|
|
|
88919
88938
|
// src/hooks/use-pipeline-stream.ts
|
|
88939
|
+
function tryParsePlanLimitBody(message) {
|
|
88940
|
+
try {
|
|
88941
|
+
const parsed = JSON.parse(message);
|
|
88942
|
+
return parsed.error === "plan_limit_reached" ? parsed : null;
|
|
88943
|
+
} catch {
|
|
88944
|
+
return null;
|
|
88945
|
+
}
|
|
88946
|
+
}
|
|
88920
88947
|
function usePipelineStream(options) {
|
|
88921
88948
|
const [steps, setSteps] = (0, import_react62.useState)([]);
|
|
88922
88949
|
const [resultBundle, setResultBundle] = (0, import_react62.useState)(null);
|
|
@@ -89057,9 +89084,14 @@ function usePipelineStream(options) {
|
|
|
89057
89084
|
(s) => s.status === "active" ? { ...s, status: "error" } : s
|
|
89058
89085
|
)
|
|
89059
89086
|
);
|
|
89087
|
+
const planLimitBody = tryParsePlanLimitBody(event.message);
|
|
89088
|
+
const raw = planLimitBody ? planLimitErrorFromBody(planLimitBody) : null;
|
|
89060
89089
|
setErrorBundle({
|
|
89061
89090
|
key: currentKey,
|
|
89062
|
-
value: {
|
|
89091
|
+
value: {
|
|
89092
|
+
message: raw ? raw.displayMessage : event.message,
|
|
89093
|
+
raw
|
|
89094
|
+
}
|
|
89063
89095
|
});
|
|
89064
89096
|
setIsStreaming(false);
|
|
89065
89097
|
}
|
|
@@ -89130,7 +89162,7 @@ function deriveRepoName(remoteUrl) {
|
|
|
89130
89162
|
return repo;
|
|
89131
89163
|
}
|
|
89132
89164
|
|
|
89133
|
-
// src/ui/commit-app.tsx
|
|
89165
|
+
// src/ui/commit/commit-app.tsx
|
|
89134
89166
|
init_sentry();
|
|
89135
89167
|
|
|
89136
89168
|
// src/ui/commit-utils.ts
|
|
@@ -89367,25 +89399,71 @@ function TypeBadge({ type }) {
|
|
|
89367
89399
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Text, { backgroundColor: bg, color: fg, bold: true, children: ` ${type} ` });
|
|
89368
89400
|
}
|
|
89369
89401
|
|
|
89370
|
-
// src/ui/commit-
|
|
89371
|
-
|
|
89372
|
-
var STEP_LABELS = {
|
|
89373
|
-
"parse-instructions": "Interpretando instru\xE7\xF5es",
|
|
89374
|
-
understand: "Entendendo diff",
|
|
89375
|
-
classify: "Classificando mudan\xE7as",
|
|
89376
|
-
group: "Agrupando commits",
|
|
89377
|
-
generate: "Gerando mensagem",
|
|
89378
|
-
"fast-split": "Analisando e agrupando"
|
|
89379
|
-
};
|
|
89380
|
-
function CommitApp({
|
|
89402
|
+
// src/ui/commit/hooks/use-commit-actions.ts
|
|
89403
|
+
function makeCommitActions({
|
|
89381
89404
|
deps,
|
|
89382
|
-
|
|
89405
|
+
message,
|
|
89406
|
+
rawDiff,
|
|
89407
|
+
commitId,
|
|
89408
|
+
editedRef,
|
|
89409
|
+
streamPayload,
|
|
89410
|
+
setPhase,
|
|
89411
|
+
setErrorMsg,
|
|
89412
|
+
sendFeedback,
|
|
89413
|
+
committedMessageRef
|
|
89383
89414
|
}) {
|
|
89384
|
-
|
|
89385
|
-
|
|
89386
|
-
deps.
|
|
89387
|
-
|
|
89388
|
-
|
|
89415
|
+
async function confirmCommit() {
|
|
89416
|
+
setPhase("committing");
|
|
89417
|
+
const code = await deps.runGitCommit(message);
|
|
89418
|
+
if (code !== 0) {
|
|
89419
|
+
setErrorMsg("git commit falhou. Verifique os hooks do repositorio.");
|
|
89420
|
+
setPhase("error-commit");
|
|
89421
|
+
return;
|
|
89422
|
+
}
|
|
89423
|
+
if (!deps.skipVerification && deps.captureCommittedDiff && deps.verifyCommitIntegrity && deps.getRepoRoot && deps.runGitReset) {
|
|
89424
|
+
setPhase("verifying");
|
|
89425
|
+
try {
|
|
89426
|
+
const repoRoot = await deps.getRepoRoot();
|
|
89427
|
+
const committedDiff = await deps.captureCommittedDiff(
|
|
89428
|
+
repoRoot,
|
|
89429
|
+
1,
|
|
89430
|
+
repoRoot
|
|
89431
|
+
);
|
|
89432
|
+
const verification = deps.verifyCommitIntegrity(rawDiff, committedDiff);
|
|
89433
|
+
if (!verification.match) {
|
|
89434
|
+
await deps.runGitReset(["--soft", "HEAD~1"]);
|
|
89435
|
+
setErrorMsg(
|
|
89436
|
+
`Verificacao falhou: ${verification.details ?? "diff mismatch"}. Commit desfeito.`
|
|
89437
|
+
);
|
|
89438
|
+
setPhase("error-commit");
|
|
89439
|
+
return;
|
|
89440
|
+
}
|
|
89441
|
+
} catch (verifyErr) {
|
|
89442
|
+
const verbose2 = process.argv.includes("--verbose") || !!process.env.REPOMIND_DEBUG;
|
|
89443
|
+
if (verbose2) {
|
|
89444
|
+
console.error("[verify] Verificacao pos-commit falhou:", verifyErr);
|
|
89445
|
+
}
|
|
89446
|
+
}
|
|
89447
|
+
}
|
|
89448
|
+
if (commitId && streamPayload?.token) {
|
|
89449
|
+
getLastCommitHash().then(
|
|
89450
|
+
(hash) => deps.apiPost(`/commits/${commitId}`, { hash }, streamPayload.token)
|
|
89451
|
+
).catch(() => {
|
|
89452
|
+
});
|
|
89453
|
+
}
|
|
89454
|
+
sendFeedback(
|
|
89455
|
+
editedRef.current ? "edited" : "accepted",
|
|
89456
|
+
editedRef.current ? message : void 0
|
|
89457
|
+
);
|
|
89458
|
+
committedMessageRef.current = message;
|
|
89459
|
+
setPhase("done");
|
|
89460
|
+
}
|
|
89461
|
+
return { confirmCommit };
|
|
89462
|
+
}
|
|
89463
|
+
|
|
89464
|
+
// src/ui/commit/hooks/use-commit-phase.ts
|
|
89465
|
+
var import_react64 = __toESM(require_react(), 1);
|
|
89466
|
+
function useCommitPhase() {
|
|
89389
89467
|
const committedMessageRef = (0, import_react64.useRef)("");
|
|
89390
89468
|
const lastRejectedRef = (0, import_react64.useRef)("");
|
|
89391
89469
|
const flowIdRef = (0, import_react64.useRef)("");
|
|
@@ -89404,6 +89482,89 @@ function CommitApp({
|
|
|
89404
89482
|
const [streamPayload, setStreamPayload] = (0, import_react64.useState)(
|
|
89405
89483
|
null
|
|
89406
89484
|
);
|
|
89485
|
+
return {
|
|
89486
|
+
// refs
|
|
89487
|
+
committedMessageRef,
|
|
89488
|
+
lastRejectedRef,
|
|
89489
|
+
flowIdRef,
|
|
89490
|
+
editedRef,
|
|
89491
|
+
// state
|
|
89492
|
+
phase,
|
|
89493
|
+
setPhase,
|
|
89494
|
+
message,
|
|
89495
|
+
setMessage,
|
|
89496
|
+
issueRef,
|
|
89497
|
+
setIssueRef,
|
|
89498
|
+
errorMsg,
|
|
89499
|
+
setErrorMsg,
|
|
89500
|
+
fileCount,
|
|
89501
|
+
setFileCount,
|
|
89502
|
+
additions,
|
|
89503
|
+
setAdditions,
|
|
89504
|
+
deletions,
|
|
89505
|
+
setDeletions,
|
|
89506
|
+
rawDiff,
|
|
89507
|
+
setRawDiff,
|
|
89508
|
+
commitId,
|
|
89509
|
+
setCommitId,
|
|
89510
|
+
confirmingAbort,
|
|
89511
|
+
setConfirmingAbort,
|
|
89512
|
+
retryCount,
|
|
89513
|
+
setRetryCount,
|
|
89514
|
+
streamPayload,
|
|
89515
|
+
setStreamPayload
|
|
89516
|
+
};
|
|
89517
|
+
}
|
|
89518
|
+
|
|
89519
|
+
// src/ui/commit/commit-app.tsx
|
|
89520
|
+
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
|
|
89521
|
+
var STEP_LABELS = {
|
|
89522
|
+
"parse-instructions": "Interpretando instru\xE7\xF5es",
|
|
89523
|
+
understand: "Entendendo diff",
|
|
89524
|
+
classify: "Classificando mudan\xE7as",
|
|
89525
|
+
group: "Agrupando commits",
|
|
89526
|
+
generate: "Gerando mensagem",
|
|
89527
|
+
"fast-split": "Analisando e agrupando"
|
|
89528
|
+
};
|
|
89529
|
+
function CommitApp({
|
|
89530
|
+
deps,
|
|
89531
|
+
onExit
|
|
89532
|
+
}) {
|
|
89533
|
+
const { exit } = use_app_default();
|
|
89534
|
+
const activeFileConfig = mergeInstructionsWithRepoConfig(
|
|
89535
|
+
deps.fileConfig ?? {},
|
|
89536
|
+
deps.instructionsOverride ?? null
|
|
89537
|
+
);
|
|
89538
|
+
const {
|
|
89539
|
+
committedMessageRef,
|
|
89540
|
+
lastRejectedRef,
|
|
89541
|
+
flowIdRef,
|
|
89542
|
+
editedRef,
|
|
89543
|
+
phase,
|
|
89544
|
+
setPhase,
|
|
89545
|
+
message,
|
|
89546
|
+
setMessage,
|
|
89547
|
+
issueRef,
|
|
89548
|
+
setIssueRef,
|
|
89549
|
+
errorMsg,
|
|
89550
|
+
setErrorMsg,
|
|
89551
|
+
fileCount,
|
|
89552
|
+
setFileCount,
|
|
89553
|
+
additions,
|
|
89554
|
+
setAdditions,
|
|
89555
|
+
deletions,
|
|
89556
|
+
setDeletions,
|
|
89557
|
+
rawDiff,
|
|
89558
|
+
setRawDiff,
|
|
89559
|
+
commitId,
|
|
89560
|
+
setCommitId,
|
|
89561
|
+
confirmingAbort,
|
|
89562
|
+
setConfirmingAbort,
|
|
89563
|
+
retryCount,
|
|
89564
|
+
setRetryCount,
|
|
89565
|
+
streamPayload,
|
|
89566
|
+
setStreamPayload
|
|
89567
|
+
} = useCommitPhase();
|
|
89407
89568
|
const streamOptions = streamPayload && phase === "streaming" ? {
|
|
89408
89569
|
path: streamPayload.path,
|
|
89409
89570
|
body: retryCount > 0 ? {
|
|
@@ -89432,7 +89593,19 @@ function CommitApp({
|
|
|
89432
89593
|
).catch(() => {
|
|
89433
89594
|
});
|
|
89434
89595
|
};
|
|
89435
|
-
|
|
89596
|
+
const { confirmCommit } = makeCommitActions({
|
|
89597
|
+
deps,
|
|
89598
|
+
message,
|
|
89599
|
+
rawDiff,
|
|
89600
|
+
commitId,
|
|
89601
|
+
editedRef,
|
|
89602
|
+
streamPayload,
|
|
89603
|
+
setPhase,
|
|
89604
|
+
setErrorMsg,
|
|
89605
|
+
sendFeedback,
|
|
89606
|
+
committedMessageRef
|
|
89607
|
+
});
|
|
89608
|
+
(0, import_react65.useEffect)(() => {
|
|
89436
89609
|
if (!TERMINAL_PHASES.includes(phase)) return;
|
|
89437
89610
|
const code = phase === "done" || phase === "aborted" ? 0 : 1;
|
|
89438
89611
|
exit();
|
|
@@ -89442,7 +89615,7 @@ function CommitApp({
|
|
|
89442
89615
|
code !== 0 ? errorMsg : void 0
|
|
89443
89616
|
);
|
|
89444
89617
|
}, [phase]);
|
|
89445
|
-
(0,
|
|
89618
|
+
(0, import_react65.useEffect)(() => {
|
|
89446
89619
|
if (phase !== "streaming") return;
|
|
89447
89620
|
if (stream.result) {
|
|
89448
89621
|
setMessage(stream.result.message);
|
|
@@ -89462,8 +89635,8 @@ function CommitApp({
|
|
|
89462
89635
|
setPhase("error-api");
|
|
89463
89636
|
} else if (e instanceof PlanLimitError) {
|
|
89464
89637
|
setErrorMsg(
|
|
89465
|
-
|
|
89466
|
-
\u2192 ${terminalLink(
|
|
89638
|
+
`${e.displayMessage}
|
|
89639
|
+
\u2192 ${terminalLink(e.action.label, e.action.url)}`
|
|
89467
89640
|
);
|
|
89468
89641
|
setPhase("error-plan");
|
|
89469
89642
|
} else if (e instanceof ApiError && e.status === 403) {
|
|
@@ -89490,7 +89663,7 @@ function CommitApp({
|
|
|
89490
89663
|
}
|
|
89491
89664
|
}
|
|
89492
89665
|
}, [stream.result, stream.error, stream.errorRaw, phase]);
|
|
89493
|
-
(0,
|
|
89666
|
+
(0, import_react65.useEffect)(() => {
|
|
89494
89667
|
async function run2() {
|
|
89495
89668
|
const token = deps.readToken();
|
|
89496
89669
|
if (!token) {
|
|
@@ -89562,8 +89735,8 @@ ${hookResult.output}` : "";
|
|
|
89562
89735
|
setPhase("error-api");
|
|
89563
89736
|
} else if (e instanceof PlanLimitError) {
|
|
89564
89737
|
setErrorMsg(
|
|
89565
|
-
|
|
89566
|
-
\u2192 ${terminalLink(
|
|
89738
|
+
`${e.displayMessage}
|
|
89739
|
+
\u2192 ${terminalLink(e.action.label, e.action.url)}`
|
|
89567
89740
|
);
|
|
89568
89741
|
setPhase("error-plan");
|
|
89569
89742
|
} else if (e instanceof ApiError && e.status === 403) {
|
|
@@ -89625,7 +89798,6 @@ ${prefixed}`);
|
|
|
89625
89798
|
}
|
|
89626
89799
|
return;
|
|
89627
89800
|
}
|
|
89628
|
-
const parsed2 = parseCommitType(message);
|
|
89629
89801
|
if (input === "r") {
|
|
89630
89802
|
sendFeedback("regenerated");
|
|
89631
89803
|
lastRejectedRef.current = message;
|
|
@@ -89653,60 +89825,7 @@ ${prefixed}`);
|
|
|
89653
89825
|
const confirmed = key.return || input.toLowerCase() === "y";
|
|
89654
89826
|
const denied = input.toLowerCase() === "q" || input.toLowerCase() === "n";
|
|
89655
89827
|
if (confirmed) {
|
|
89656
|
-
|
|
89657
|
-
const code = await deps.runGitCommit(message);
|
|
89658
|
-
if (code !== 0) {
|
|
89659
|
-
setErrorMsg("git commit falhou. Verifique os hooks do repositorio.");
|
|
89660
|
-
setPhase("error-commit");
|
|
89661
|
-
return;
|
|
89662
|
-
}
|
|
89663
|
-
if (!deps.skipVerification && deps.captureCommittedDiff && deps.verifyCommitIntegrity && deps.getRepoRoot && deps.runGitReset) {
|
|
89664
|
-
setPhase("verifying");
|
|
89665
|
-
try {
|
|
89666
|
-
const repoRoot = await deps.getRepoRoot();
|
|
89667
|
-
const committedDiff = await deps.captureCommittedDiff(
|
|
89668
|
-
repoRoot,
|
|
89669
|
-
1,
|
|
89670
|
-
repoRoot
|
|
89671
|
-
);
|
|
89672
|
-
const verification = deps.verifyCommitIntegrity(
|
|
89673
|
-
rawDiff,
|
|
89674
|
-
committedDiff
|
|
89675
|
-
);
|
|
89676
|
-
if (!verification.match) {
|
|
89677
|
-
await deps.runGitReset(["--soft", "HEAD~1"]);
|
|
89678
|
-
setErrorMsg(
|
|
89679
|
-
`Verificacao falhou: ${verification.details ?? "diff mismatch"}. Commit desfeito.`
|
|
89680
|
-
);
|
|
89681
|
-
setPhase("error-commit");
|
|
89682
|
-
return;
|
|
89683
|
-
}
|
|
89684
|
-
} catch (verifyErr) {
|
|
89685
|
-
const verbose2 = process.argv.includes("--verbose") || !!process.env.REPOMIND_DEBUG;
|
|
89686
|
-
if (verbose2) {
|
|
89687
|
-
console.error(
|
|
89688
|
-
"[verify] Verificacao pos-commit falhou:",
|
|
89689
|
-
verifyErr
|
|
89690
|
-
);
|
|
89691
|
-
}
|
|
89692
|
-
}
|
|
89693
|
-
}
|
|
89694
|
-
if (commitId && streamPayload?.token) {
|
|
89695
|
-
getLastCommitHash().then(
|
|
89696
|
-
(hash) => deps.apiPost(
|
|
89697
|
-
`/commits/${commitId}`,
|
|
89698
|
-
{ hash },
|
|
89699
|
-
streamPayload.token
|
|
89700
|
-
)
|
|
89701
|
-
).catch(() => {
|
|
89702
|
-
});
|
|
89703
|
-
}
|
|
89704
|
-
sendFeedback(
|
|
89705
|
-
editedRef.current ? "edited" : "accepted",
|
|
89706
|
-
editedRef.current ? message : void 0
|
|
89707
|
-
);
|
|
89708
|
-
committedMessageRef.current = message;
|
|
89709
|
-
setPhase("done");
|
|
89828
|
+
await confirmCommit();
|
|
89710
89829
|
} else if (denied) {
|
|
89711
89830
|
setConfirmingAbort(true);
|
|
89712
89831
|
}
|
|
@@ -89884,7 +90003,7 @@ ${prefixed}`);
|
|
|
89884
90003
|
}
|
|
89885
90004
|
|
|
89886
90005
|
// src/ui/done-summary.tsx
|
|
89887
|
-
var
|
|
90006
|
+
var import_react66 = __toESM(require_react(), 1);
|
|
89888
90007
|
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
|
|
89889
90008
|
function parseType(msg) {
|
|
89890
90009
|
if (!msg) return { type: "chore", description: msg ?? "" };
|
|
@@ -89910,7 +90029,7 @@ function SplitDoneSummary({
|
|
|
89910
90029
|
updateAvailable
|
|
89911
90030
|
}) {
|
|
89912
90031
|
const { exit } = use_app_default();
|
|
89913
|
-
(0,
|
|
90032
|
+
(0, import_react66.useEffect)(() => {
|
|
89914
90033
|
exit();
|
|
89915
90034
|
}, []);
|
|
89916
90035
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Box_default, { flexDirection: "column", paddingLeft: 1, children: [
|
|
@@ -89946,7 +90065,7 @@ function CommitDoneSummary({
|
|
|
89946
90065
|
updateAvailable
|
|
89947
90066
|
}) {
|
|
89948
90067
|
const { exit } = use_app_default();
|
|
89949
|
-
(0,
|
|
90068
|
+
(0, import_react66.useEffect)(() => {
|
|
89950
90069
|
exit();
|
|
89951
90070
|
}, []);
|
|
89952
90071
|
const { type, description } = parseType(message);
|
|
@@ -90022,7 +90141,7 @@ async function commitCommand() {
|
|
|
90022
90141
|
let errorMessage = "";
|
|
90023
90142
|
enterImmersive();
|
|
90024
90143
|
const { waitUntilExit } = render_default(
|
|
90025
|
-
|
|
90144
|
+
import_react67.default.createElement(CommitApp, {
|
|
90026
90145
|
deps: {
|
|
90027
90146
|
readToken,
|
|
90028
90147
|
getStagedChanges,
|
|
@@ -90053,7 +90172,7 @@ async function commitCommand() {
|
|
|
90053
90172
|
}
|
|
90054
90173
|
if (completedMessage) {
|
|
90055
90174
|
const { waitUntilExit: waitUntilExit2 } = render_default(
|
|
90056
|
-
|
|
90175
|
+
import_react67.default.createElement(CommitDoneSummary, {
|
|
90057
90176
|
message: completedMessage,
|
|
90058
90177
|
updateAvailable: getUpdateInfo()
|
|
90059
90178
|
})
|
|
@@ -90063,96 +90182,151 @@ async function commitCommand() {
|
|
|
90063
90182
|
process.exit(exitCode);
|
|
90064
90183
|
}
|
|
90065
90184
|
|
|
90185
|
+
// src/lib/open-browser.ts
|
|
90186
|
+
async function openBrowser(url) {
|
|
90187
|
+
const platform3 = process.platform;
|
|
90188
|
+
let args2;
|
|
90189
|
+
if (platform3 === "darwin") {
|
|
90190
|
+
args2 = ["open", url];
|
|
90191
|
+
} else if (platform3 === "linux") {
|
|
90192
|
+
args2 = ["xdg-open", url];
|
|
90193
|
+
} else if (platform3 === "win32") {
|
|
90194
|
+
args2 = ["cmd", "/c", "start", url];
|
|
90195
|
+
} else {
|
|
90196
|
+
return;
|
|
90197
|
+
}
|
|
90198
|
+
try {
|
|
90199
|
+
Bun.spawn(args2, { stdio: ["ignore", "ignore", "ignore"] });
|
|
90200
|
+
} catch {
|
|
90201
|
+
}
|
|
90202
|
+
}
|
|
90203
|
+
|
|
90204
|
+
// src/commands/dashboard.ts
|
|
90205
|
+
async function dashboardCommand() {
|
|
90206
|
+
const url = `${WEB_BASE_URL}/dashboard`;
|
|
90207
|
+
console.log(`Abrindo ${url}`);
|
|
90208
|
+
await openBrowser(url);
|
|
90209
|
+
}
|
|
90210
|
+
|
|
90066
90211
|
// src/commands/help.tsx
|
|
90067
|
-
var
|
|
90212
|
+
var import_react68 = __toESM(require_react(), 1);
|
|
90068
90213
|
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
|
|
90069
|
-
var
|
|
90214
|
+
var GROUPS = [
|
|
90070
90215
|
{
|
|
90071
|
-
|
|
90072
|
-
|
|
90073
|
-
|
|
90074
|
-
|
|
90075
|
-
|
|
90076
|
-
|
|
90077
|
-
|
|
90078
|
-
|
|
90079
|
-
|
|
90080
|
-
|
|
90081
|
-
|
|
90082
|
-
|
|
90083
|
-
|
|
90084
|
-
|
|
90085
|
-
|
|
90086
|
-
color: C.green
|
|
90216
|
+
label: "GERA\xC7\xC3O",
|
|
90217
|
+
commands: [
|
|
90218
|
+
{
|
|
90219
|
+
name: "commit",
|
|
90220
|
+
icon: "\u2726",
|
|
90221
|
+
color: C.cyan,
|
|
90222
|
+
description: "Mensagem de commit gerada por IA"
|
|
90223
|
+
},
|
|
90224
|
+
{
|
|
90225
|
+
name: "split",
|
|
90226
|
+
icon: "\u25C8",
|
|
90227
|
+
color: "#c084fc",
|
|
90228
|
+
description: "Divide staged em commits at\xF4micos"
|
|
90229
|
+
}
|
|
90230
|
+
]
|
|
90087
90231
|
},
|
|
90088
90232
|
{
|
|
90089
|
-
|
|
90090
|
-
|
|
90091
|
-
|
|
90092
|
-
|
|
90233
|
+
label: "CONTA",
|
|
90234
|
+
commands: [
|
|
90235
|
+
{
|
|
90236
|
+
name: "login",
|
|
90237
|
+
icon: "\u2192",
|
|
90238
|
+
color: C.green,
|
|
90239
|
+
description: "Autenticar com sua conta RepoMind"
|
|
90240
|
+
},
|
|
90241
|
+
{
|
|
90242
|
+
name: "logout",
|
|
90243
|
+
icon: "\u2190",
|
|
90244
|
+
color: C.yellow,
|
|
90245
|
+
description: "Encerrar sess\xE3o atual"
|
|
90246
|
+
},
|
|
90247
|
+
{
|
|
90248
|
+
name: "whoami",
|
|
90249
|
+
icon: "\u25CF",
|
|
90250
|
+
color: C.dim,
|
|
90251
|
+
description: "Exibir usu\xE1rio autenticado"
|
|
90252
|
+
},
|
|
90253
|
+
{
|
|
90254
|
+
name: "status",
|
|
90255
|
+
icon: "\u25C6",
|
|
90256
|
+
color: C.cyan,
|
|
90257
|
+
description: "Plano e uso de commits"
|
|
90258
|
+
},
|
|
90259
|
+
{
|
|
90260
|
+
name: "dashboard",
|
|
90261
|
+
icon: "\u229E",
|
|
90262
|
+
color: C.dim,
|
|
90263
|
+
description: "Abrir dashboard no navegador"
|
|
90264
|
+
}
|
|
90265
|
+
]
|
|
90093
90266
|
},
|
|
90094
90267
|
{
|
|
90095
|
-
|
|
90096
|
-
|
|
90097
|
-
|
|
90098
|
-
|
|
90268
|
+
label: "PROJETO",
|
|
90269
|
+
commands: [
|
|
90270
|
+
{
|
|
90271
|
+
name: "init",
|
|
90272
|
+
icon: "\u2699",
|
|
90273
|
+
color: C.dim,
|
|
90274
|
+
description: "Criar .repomind.json no diret\xF3rio"
|
|
90275
|
+
}
|
|
90276
|
+
]
|
|
90099
90277
|
}
|
|
90100
90278
|
];
|
|
90279
|
+
function Rule() {
|
|
90280
|
+
const cols = Math.max(20, (process.stdout.columns ?? 80) - 3);
|
|
90281
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "\u2500".repeat(cols) });
|
|
90282
|
+
}
|
|
90283
|
+
function SectionLabel({ label }) {
|
|
90284
|
+
const cols = Math.max(20, (process.stdout.columns ?? 80) - 3);
|
|
90285
|
+
const dashes = Math.max(0, cols - label.length - 3);
|
|
90286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { gap: 1, children: [
|
|
90287
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, bold: true, children: label }),
|
|
90288
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "\u2500".repeat(dashes) })
|
|
90289
|
+
] });
|
|
90290
|
+
}
|
|
90101
90291
|
function HelpApp() {
|
|
90102
|
-
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
90292
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
90103
90293
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Header, { title: "RepoMind" }),
|
|
90104
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.
|
|
90105
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "
|
|
90106
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { bold: true, children: "
|
|
90107
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.cyan, children: "<comando>" }),
|
|
90294
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { paddingLeft: 2, paddingTop: 1, paddingBottom: 1, gap: 1, children: [
|
|
90295
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "repomind" }),
|
|
90296
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.cyan, bold: true, children: "<comando>" }),
|
|
90108
90297
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "[op\xE7\xF5es]" })
|
|
90109
|
-
] }) }),
|
|
90110
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
90111
|
-
Box_default,
|
|
90112
|
-
{
|
|
90113
|
-
flexDirection: "column",
|
|
90114
|
-
paddingLeft: 1,
|
|
90115
|
-
marginBottom: 1,
|
|
90116
|
-
borderStyle: "round",
|
|
90117
|
-
borderColor: C.dim,
|
|
90118
|
-
paddingX: 2,
|
|
90119
|
-
paddingY: 0,
|
|
90120
|
-
children: COMMANDS.map((cmd) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { gap: 1, children: [
|
|
90121
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: cmd.color, children: cmd.icon }),
|
|
90122
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { width: 10, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { bold: true, color: cmd.color, children: cmd.name }) }),
|
|
90123
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: cmd.description })
|
|
90124
|
-
] }, cmd.name))
|
|
90125
|
-
}
|
|
90126
|
-
),
|
|
90127
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { paddingLeft: 1, flexDirection: "column", gap: 0, children: [
|
|
90128
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { gap: 1, children: [
|
|
90129
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { backgroundColor: C.grayBg, color: C.white, bold: true, children: [
|
|
90130
|
-
" ",
|
|
90131
|
-
"--version",
|
|
90132
|
-
" "
|
|
90133
|
-
] }),
|
|
90134
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "Exibir vers\xE3o instalada" })
|
|
90135
|
-
] }),
|
|
90136
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { gap: 1, children: [
|
|
90137
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { backgroundColor: C.grayBg, color: C.white, bold: true, children: [
|
|
90138
|
-
" ",
|
|
90139
|
-
"--verbose",
|
|
90140
|
-
" "
|
|
90141
|
-
] }),
|
|
90142
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "Exibir detalhes de erro" })
|
|
90143
|
-
] })
|
|
90144
90298
|
] }),
|
|
90145
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.
|
|
90146
|
-
|
|
90147
|
-
|
|
90148
|
-
|
|
90149
|
-
|
|
90150
|
-
|
|
90151
|
-
|
|
90299
|
+
GROUPS.map((group) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
90300
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SectionLabel, { label: group.label }) }),
|
|
90301
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { flexDirection: "column", paddingLeft: 2, paddingTop: 1, children: group.commands.map((cmd) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { gap: 2, children: [
|
|
90302
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: cmd.color, children: cmd.icon }),
|
|
90303
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { width: 12, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { bold: true, color: cmd.color, children: cmd.name }) }),
|
|
90304
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: cmd.description })
|
|
90305
|
+
] }, cmd.name)) })
|
|
90306
|
+
] }, group.label)),
|
|
90307
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { paddingLeft: 2, paddingTop: 0, paddingBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Rule, {}) }),
|
|
90308
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { paddingLeft: 2, gap: 2, children: [
|
|
90309
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "git add ." }),
|
|
90310
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "\u2192" }),
|
|
90311
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.cyan, bold: true, children: "repomind commit" }),
|
|
90312
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "\u2192" }),
|
|
90313
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "git push" })
|
|
90314
|
+
] }),
|
|
90315
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Box_default, { paddingLeft: 2, paddingTop: 1, paddingBottom: 0, children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Rule, {}) }),
|
|
90316
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Box_default, { paddingLeft: 2, paddingTop: 1, gap: 2, children: [
|
|
90317
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "--version" }),
|
|
90318
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "\xB7" }),
|
|
90319
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Text, { color: C.dim, children: [
|
|
90320
|
+
"<cmd>",
|
|
90321
|
+
" --help"
|
|
90322
|
+
] }),
|
|
90323
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: "\xB7" }),
|
|
90324
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { color: C.dim, children: WEB_BASE_URL })
|
|
90325
|
+
] })
|
|
90152
90326
|
] });
|
|
90153
90327
|
}
|
|
90154
90328
|
async function helpCommand() {
|
|
90155
|
-
const { waitUntilExit } = render_default(
|
|
90329
|
+
const { waitUntilExit } = render_default(import_react68.default.createElement(HelpApp));
|
|
90156
90330
|
setTimeout(() => process.exit(0), 50);
|
|
90157
90331
|
await waitUntilExit();
|
|
90158
90332
|
}
|
|
@@ -90160,7 +90334,7 @@ async function helpCommand() {
|
|
|
90160
90334
|
// src/commands/init.ts
|
|
90161
90335
|
import { access, writeFile as writeFile2 } from "node:fs/promises";
|
|
90162
90336
|
import { join as join8 } from "node:path";
|
|
90163
|
-
var
|
|
90337
|
+
var import_react70 = __toESM(require_react(), 1);
|
|
90164
90338
|
|
|
90165
90339
|
// src/lib/init-config.ts
|
|
90166
90340
|
import { readFile as readFile3, writeFile } from "node:fs/promises";
|
|
@@ -90247,7 +90421,7 @@ var LANGUAGE_OPTIONS = SUPPORTED_LANGUAGES.map((code) => ({
|
|
|
90247
90421
|
}));
|
|
90248
90422
|
|
|
90249
90423
|
// src/ui/init-app.tsx
|
|
90250
|
-
var
|
|
90424
|
+
var import_react69 = __toESM(require_react(), 1);
|
|
90251
90425
|
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
|
|
90252
90426
|
function SelectList({
|
|
90253
90427
|
items,
|
|
@@ -90278,19 +90452,19 @@ function InitApp({
|
|
|
90278
90452
|
onExit
|
|
90279
90453
|
}) {
|
|
90280
90454
|
const { exit } = use_app_default();
|
|
90281
|
-
const [overwriteConfirmed, setOverwriteConfirmed] = (0,
|
|
90455
|
+
const [overwriteConfirmed, setOverwriteConfirmed] = (0, import_react69.useState)(!alreadyExists);
|
|
90282
90456
|
const langCodes = LANGUAGE_OPTIONS.map((l) => l.code);
|
|
90283
|
-
const [langIndex, setLangIndex] = (0,
|
|
90284
|
-
const [body, setBody] = (0,
|
|
90285
|
-
const [footer, setFooter] = (0,
|
|
90286
|
-
const [breaking, setBreaking] = (0,
|
|
90287
|
-
const [addToGitignore, setAddToGitignore] = (0,
|
|
90288
|
-
const [boolCursor, setBoolCursor] = (0,
|
|
90289
|
-
const [step, setStep] = (0,
|
|
90290
|
-
const [writing, setWriting] = (0,
|
|
90291
|
-
const [written, setWritten] = (0,
|
|
90292
|
-
const [error4, setError] = (0,
|
|
90293
|
-
const [askOverwrite, setAskOverwrite] = (0,
|
|
90457
|
+
const [langIndex, setLangIndex] = (0, import_react69.useState)(0);
|
|
90458
|
+
const [body, setBody] = (0, import_react69.useState)(null);
|
|
90459
|
+
const [footer, setFooter] = (0, import_react69.useState)(null);
|
|
90460
|
+
const [breaking, setBreaking] = (0, import_react69.useState)(null);
|
|
90461
|
+
const [addToGitignore, setAddToGitignore] = (0, import_react69.useState)(null);
|
|
90462
|
+
const [boolCursor, setBoolCursor] = (0, import_react69.useState)(true);
|
|
90463
|
+
const [step, setStep] = (0, import_react69.useState)("language");
|
|
90464
|
+
const [writing, setWriting] = (0, import_react69.useState)(false);
|
|
90465
|
+
const [written, setWritten] = (0, import_react69.useState)(false);
|
|
90466
|
+
const [error4, setError] = (0, import_react69.useState)(null);
|
|
90467
|
+
const [askOverwrite, setAskOverwrite] = (0, import_react69.useState)(alreadyExists);
|
|
90294
90468
|
function advanceBool(setter, next) {
|
|
90295
90469
|
setter(boolCursor);
|
|
90296
90470
|
setBoolCursor(true);
|
|
@@ -90505,7 +90679,7 @@ async function initCommand() {
|
|
|
90505
90679
|
const alreadyExists = await fileExists(configPath);
|
|
90506
90680
|
let exitCode = 0;
|
|
90507
90681
|
const { waitUntilExit } = render_default(
|
|
90508
|
-
|
|
90682
|
+
import_react70.default.createElement(InitApp, {
|
|
90509
90683
|
alreadyExists,
|
|
90510
90684
|
onWrite: async (config3, options) => {
|
|
90511
90685
|
await writeFile2(
|
|
@@ -90530,35 +90704,16 @@ async function initCommand() {
|
|
|
90530
90704
|
process.exit(exitCode);
|
|
90531
90705
|
}
|
|
90532
90706
|
|
|
90533
|
-
// src/lib/open-browser.ts
|
|
90534
|
-
async function openBrowser(url) {
|
|
90535
|
-
const platform3 = process.platform;
|
|
90536
|
-
let args2;
|
|
90537
|
-
if (platform3 === "darwin") {
|
|
90538
|
-
args2 = ["open", url];
|
|
90539
|
-
} else if (platform3 === "linux") {
|
|
90540
|
-
args2 = ["xdg-open", url];
|
|
90541
|
-
} else if (platform3 === "win32") {
|
|
90542
|
-
args2 = ["cmd", "/c", "start", url];
|
|
90543
|
-
} else {
|
|
90544
|
-
return;
|
|
90545
|
-
}
|
|
90546
|
-
try {
|
|
90547
|
-
Bun.spawn(args2, { stdio: ["ignore", "ignore", "ignore"] });
|
|
90548
|
-
} catch {
|
|
90549
|
-
}
|
|
90550
|
-
}
|
|
90551
|
-
|
|
90552
90707
|
// src/commands/login.ts
|
|
90553
|
-
var
|
|
90708
|
+
var import_react73 = __toESM(require_react(), 1);
|
|
90554
90709
|
|
|
90555
90710
|
// ../../node_modules/.bun/ink-spinner@5.0.0+4d0808a67a30d5ab/node_modules/ink-spinner/build/index.js
|
|
90556
|
-
var
|
|
90711
|
+
var import_react71 = __toESM(require_react(), 1);
|
|
90557
90712
|
var import_cli_spinners2 = __toESM(require_cli_spinners(), 1);
|
|
90558
90713
|
function Spinner2({ type = "dots" }) {
|
|
90559
|
-
const [frame, setFrame] = (0,
|
|
90714
|
+
const [frame, setFrame] = (0, import_react71.useState)(0);
|
|
90560
90715
|
const spinner = import_cli_spinners2.default[type];
|
|
90561
|
-
(0,
|
|
90716
|
+
(0, import_react71.useEffect)(() => {
|
|
90562
90717
|
const timer = setInterval(() => {
|
|
90563
90718
|
setFrame((previousFrame) => {
|
|
90564
90719
|
const isLastFrame = previousFrame === spinner.frames.length - 1;
|
|
@@ -90569,12 +90724,12 @@ function Spinner2({ type = "dots" }) {
|
|
|
90569
90724
|
clearInterval(timer);
|
|
90570
90725
|
};
|
|
90571
90726
|
}, [spinner]);
|
|
90572
|
-
return
|
|
90727
|
+
return import_react71.default.createElement(Text, null, spinner.frames[frame]);
|
|
90573
90728
|
}
|
|
90574
90729
|
var build_default = Spinner2;
|
|
90575
90730
|
|
|
90576
90731
|
// src/ui/login-app.tsx
|
|
90577
|
-
var
|
|
90732
|
+
var import_react72 = __toESM(require_react(), 1);
|
|
90578
90733
|
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
|
|
90579
90734
|
var TERMINAL_PHASES2 = ["done", "error"];
|
|
90580
90735
|
function LoginApp({
|
|
@@ -90585,19 +90740,19 @@ function LoginApp({
|
|
|
90585
90740
|
onExit
|
|
90586
90741
|
}) {
|
|
90587
90742
|
const { exit } = use_app_default();
|
|
90588
|
-
const [phase, setPhase] = (0,
|
|
90589
|
-
const [userCode, setUserCode] = (0,
|
|
90590
|
-
const [verificationUrl, setVerificationUrl] = (0,
|
|
90591
|
-
const [email, setEmail] = (0,
|
|
90592
|
-
const [tokenName, setTokenName] = (0,
|
|
90593
|
-
const [errorMsg, setErrorMsg] = (0,
|
|
90594
|
-
(0,
|
|
90743
|
+
const [phase, setPhase] = (0, import_react72.useState)("init");
|
|
90744
|
+
const [userCode, setUserCode] = (0, import_react72.useState)("");
|
|
90745
|
+
const [verificationUrl, setVerificationUrl] = (0, import_react72.useState)("");
|
|
90746
|
+
const [email, setEmail] = (0, import_react72.useState)("");
|
|
90747
|
+
const [tokenName, setTokenName] = (0, import_react72.useState)(null);
|
|
90748
|
+
const [errorMsg, setErrorMsg] = (0, import_react72.useState)("");
|
|
90749
|
+
(0, import_react72.useEffect)(() => {
|
|
90595
90750
|
if (!TERMINAL_PHASES2.includes(phase)) return;
|
|
90596
90751
|
const code = phase === "done" ? 0 : 1;
|
|
90597
90752
|
exit();
|
|
90598
90753
|
onExit(code);
|
|
90599
90754
|
}, [phase]);
|
|
90600
|
-
(0,
|
|
90755
|
+
(0, import_react72.useEffect)(() => {
|
|
90601
90756
|
if (tokenArg) {
|
|
90602
90757
|
runTokenLogin();
|
|
90603
90758
|
} else {
|
|
@@ -90720,7 +90875,7 @@ async function loginCommand() {
|
|
|
90720
90875
|
const noBrowser = process.argv.includes("--no-browser");
|
|
90721
90876
|
let exitCode = 0;
|
|
90722
90877
|
const { waitUntilExit } = render_default(
|
|
90723
|
-
|
|
90878
|
+
import_react73.default.createElement(LoginApp, {
|
|
90724
90879
|
deps: {
|
|
90725
90880
|
apiPost: (path2, body) => apiClient2.post(path2, body),
|
|
90726
90881
|
apiGet: (path2, token) => apiClient2.get(path2, token),
|
|
@@ -90741,12 +90896,12 @@ async function loginCommand() {
|
|
|
90741
90896
|
}
|
|
90742
90897
|
|
|
90743
90898
|
// src/commands/logout.tsx
|
|
90744
|
-
var
|
|
90899
|
+
var import_react74 = __toESM(require_react(), 1);
|
|
90745
90900
|
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
|
|
90746
90901
|
function LogoutApp({ onExit }) {
|
|
90747
90902
|
const wasLoggedIn = readToken() !== null;
|
|
90748
90903
|
const deleted = deleteToken();
|
|
90749
|
-
(0,
|
|
90904
|
+
(0, import_react74.useEffect)(() => {
|
|
90750
90905
|
onExit(0);
|
|
90751
90906
|
}, [onExit]);
|
|
90752
90907
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(Box_default, { flexDirection: "column", paddingTop: 1, marginBottom: 1, children: [
|
|
@@ -90763,7 +90918,7 @@ function LogoutApp({ onExit }) {
|
|
|
90763
90918
|
async function logoutCommand() {
|
|
90764
90919
|
let exitCode = 0;
|
|
90765
90920
|
const { waitUntilExit } = render_default(
|
|
90766
|
-
|
|
90921
|
+
import_react74.default.createElement(LogoutApp, {
|
|
90767
90922
|
onExit: (code) => {
|
|
90768
90923
|
exitCode = code;
|
|
90769
90924
|
}
|
|
@@ -90774,10 +90929,10 @@ async function logoutCommand() {
|
|
|
90774
90929
|
}
|
|
90775
90930
|
|
|
90776
90931
|
// src/commands/pr.ts
|
|
90777
|
-
var
|
|
90932
|
+
var import_react76 = __toESM(require_react(), 1);
|
|
90778
90933
|
|
|
90779
90934
|
// src/ui/pr-app.tsx
|
|
90780
|
-
var
|
|
90935
|
+
var import_react75 = __toESM(require_react(), 1);
|
|
90781
90936
|
init_sentry();
|
|
90782
90937
|
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
|
|
90783
90938
|
var TERMINAL_PHASES3 = [
|
|
@@ -90806,18 +90961,18 @@ function PrApp({
|
|
|
90806
90961
|
onExit
|
|
90807
90962
|
}) {
|
|
90808
90963
|
const { exit } = use_app_default();
|
|
90809
|
-
const [phase, setPhase] = (0,
|
|
90810
|
-
const [prTitle, setPrTitle] = (0,
|
|
90811
|
-
const [prBody, setPrBody] = (0,
|
|
90812
|
-
const [errorMsg, setErrorMsg] = (0,
|
|
90813
|
-
(0,
|
|
90964
|
+
const [phase, setPhase] = (0, import_react75.useState)("collecting");
|
|
90965
|
+
const [prTitle, setPrTitle] = (0, import_react75.useState)("");
|
|
90966
|
+
const [prBody, setPrBody] = (0, import_react75.useState)("");
|
|
90967
|
+
const [errorMsg, setErrorMsg] = (0, import_react75.useState)("");
|
|
90968
|
+
(0, import_react75.useEffect)(() => {
|
|
90814
90969
|
if (!TERMINAL_PHASES3.includes(phase) && phase !== "copied" && phase !== "aborted")
|
|
90815
90970
|
return;
|
|
90816
90971
|
const code = phase === "copied" || phase === "aborted" ? 0 : 1;
|
|
90817
90972
|
exit();
|
|
90818
90973
|
onExit(code);
|
|
90819
90974
|
}, [phase]);
|
|
90820
|
-
(0,
|
|
90975
|
+
(0, import_react75.useEffect)(() => {
|
|
90821
90976
|
async function run2() {
|
|
90822
90977
|
const token = deps.readToken();
|
|
90823
90978
|
if (!token) {
|
|
@@ -90860,8 +91015,8 @@ function PrApp({
|
|
|
90860
91015
|
setPhase("error-api");
|
|
90861
91016
|
} else if (e instanceof PlanLimitError) {
|
|
90862
91017
|
setErrorMsg(
|
|
90863
|
-
|
|
90864
|
-
\u2192 ${terminalLink(
|
|
91018
|
+
`${e.displayMessage}
|
|
91019
|
+
\u2192 ${terminalLink(e.action.label, e.action.url)}`
|
|
90865
91020
|
);
|
|
90866
91021
|
setPhase("error-plan");
|
|
90867
91022
|
} else if (e instanceof ApiError && e.status === 403) {
|
|
@@ -91007,7 +91162,7 @@ async function prCommand() {
|
|
|
91007
91162
|
let exitCode = 0;
|
|
91008
91163
|
enterImmersive();
|
|
91009
91164
|
const { waitUntilExit } = render_default(
|
|
91010
|
-
|
|
91165
|
+
import_react76.default.createElement(PrApp, {
|
|
91011
91166
|
deps: {
|
|
91012
91167
|
readToken,
|
|
91013
91168
|
getDiffBetweenBranches,
|
|
@@ -91025,10 +91180,10 @@ async function prCommand() {
|
|
|
91025
91180
|
}
|
|
91026
91181
|
|
|
91027
91182
|
// src/commands/split.ts
|
|
91028
|
-
var
|
|
91183
|
+
var import_react80 = __toESM(require_react(), 1);
|
|
91029
91184
|
|
|
91030
|
-
// src/ui/split-app.tsx
|
|
91031
|
-
var
|
|
91185
|
+
// src/ui/split/split-app.tsx
|
|
91186
|
+
var import_react79 = __toESM(require_react(), 1);
|
|
91032
91187
|
init_sentry();
|
|
91033
91188
|
|
|
91034
91189
|
// src/lib/worktree-groups.ts
|
|
@@ -91210,13 +91365,154 @@ function CommitRow(props) {
|
|
|
91210
91365
|
] });
|
|
91211
91366
|
}
|
|
91212
91367
|
|
|
91213
|
-
// src/ui/split-
|
|
91214
|
-
|
|
91215
|
-
|
|
91216
|
-
|
|
91217
|
-
|
|
91218
|
-
|
|
91368
|
+
// src/ui/split/hooks/use-split-keyboard.ts
|
|
91369
|
+
function useSplitKeyboard({
|
|
91370
|
+
phase,
|
|
91371
|
+
groups,
|
|
91372
|
+
selectedIndex,
|
|
91373
|
+
setSelectedIndex,
|
|
91374
|
+
skippedGroups,
|
|
91375
|
+
setSkippedGroups,
|
|
91376
|
+
issueRef,
|
|
91377
|
+
setIssueRef,
|
|
91378
|
+
confirmingAbort,
|
|
91379
|
+
setConfirmingAbort,
|
|
91380
|
+
setPhase,
|
|
91381
|
+
setGroups,
|
|
91382
|
+
patchMap,
|
|
91383
|
+
authToken,
|
|
91384
|
+
regenRetryCount,
|
|
91385
|
+
setRegenGroupIndex,
|
|
91386
|
+
setRegenBody,
|
|
91387
|
+
setRegenRetryCount,
|
|
91388
|
+
editedAnyRef,
|
|
91389
|
+
activeFileConfig,
|
|
91390
|
+
sendFeedback,
|
|
91391
|
+
startCommitting
|
|
91392
|
+
}) {
|
|
91393
|
+
use_input_default(
|
|
91394
|
+
(input, key) => {
|
|
91395
|
+
if (phase !== "review") return;
|
|
91396
|
+
if (confirmingAbort) {
|
|
91397
|
+
if (input.toLowerCase() === "y") {
|
|
91398
|
+
sendFeedback("discarded");
|
|
91399
|
+
setConfirmingAbort(false);
|
|
91400
|
+
setPhase("aborted");
|
|
91401
|
+
return;
|
|
91402
|
+
}
|
|
91403
|
+
if (input.toLowerCase() === "n" || key.escape) {
|
|
91404
|
+
setConfirmingAbort(false);
|
|
91405
|
+
return;
|
|
91406
|
+
}
|
|
91407
|
+
return;
|
|
91408
|
+
}
|
|
91409
|
+
if (key.upArrow || input === "k") {
|
|
91410
|
+
setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
91411
|
+
return;
|
|
91412
|
+
}
|
|
91413
|
+
if (key.downArrow || input === "j") {
|
|
91414
|
+
setSelectedIndex((prev) => Math.min(groups.length - 1, prev + 1));
|
|
91415
|
+
return;
|
|
91416
|
+
}
|
|
91417
|
+
if (input === "d") {
|
|
91418
|
+
setPhase("viewing-diff");
|
|
91419
|
+
return;
|
|
91420
|
+
}
|
|
91421
|
+
if (input === "e") {
|
|
91422
|
+
editedAnyRef.current = true;
|
|
91423
|
+
setPhase("editing");
|
|
91424
|
+
return;
|
|
91425
|
+
}
|
|
91426
|
+
if (input === "r") {
|
|
91427
|
+
const group = groups[selectedIndex];
|
|
91428
|
+
if (!group || !authToken) return;
|
|
91429
|
+
sendFeedback("regenerated");
|
|
91430
|
+
const combinedPatch = group.files.map((f) => patchMap.get(f.path) ?? "").filter(Boolean).join("\n");
|
|
91431
|
+
const body = { diff: combinedPatch };
|
|
91432
|
+
if (Object.keys(activeFileConfig).length > 0) {
|
|
91433
|
+
body.config = activeFileConfig;
|
|
91434
|
+
}
|
|
91435
|
+
body.regeneration = {
|
|
91436
|
+
attempt: regenRetryCount + 1,
|
|
91437
|
+
previousMessage: group.message
|
|
91438
|
+
};
|
|
91439
|
+
setRegenGroupIndex(selectedIndex);
|
|
91440
|
+
setRegenBody(body);
|
|
91441
|
+
setRegenRetryCount((c) => c + 1);
|
|
91442
|
+
setPhase("regenerating");
|
|
91443
|
+
return;
|
|
91444
|
+
}
|
|
91445
|
+
if (input === "l") {
|
|
91446
|
+
setIssueRef(() => "");
|
|
91447
|
+
setPhase("link-issue");
|
|
91448
|
+
return;
|
|
91449
|
+
}
|
|
91450
|
+
if (input === "s") {
|
|
91451
|
+
const groupId = groups[selectedIndex]?.groupId;
|
|
91452
|
+
if (groupId) {
|
|
91453
|
+
setSkippedGroups((prev) => {
|
|
91454
|
+
const next = new Set(prev);
|
|
91455
|
+
if (next.has(groupId)) {
|
|
91456
|
+
next.delete(groupId);
|
|
91457
|
+
} else {
|
|
91458
|
+
next.add(groupId);
|
|
91459
|
+
}
|
|
91460
|
+
return next;
|
|
91461
|
+
});
|
|
91462
|
+
}
|
|
91463
|
+
return;
|
|
91464
|
+
}
|
|
91465
|
+
if (key.return || input === "a") {
|
|
91466
|
+
startCommitting();
|
|
91467
|
+
return;
|
|
91468
|
+
}
|
|
91469
|
+
if (input === "q") {
|
|
91470
|
+
setConfirmingAbort(true);
|
|
91471
|
+
}
|
|
91472
|
+
},
|
|
91473
|
+
{ isActive: phase === "review" }
|
|
91474
|
+
);
|
|
91475
|
+
use_input_default(
|
|
91476
|
+
(input, key) => {
|
|
91477
|
+
if (key.return) {
|
|
91478
|
+
const ref = issueRef.trim();
|
|
91479
|
+
if (ref) {
|
|
91480
|
+
const prefixed = /^refs:/i.test(ref) ? ref : `Refs: ${ref}`;
|
|
91481
|
+
setGroups((prev) => {
|
|
91482
|
+
const next = [...prev];
|
|
91483
|
+
const g = next[selectedIndex];
|
|
91484
|
+
if (!g) return prev;
|
|
91485
|
+
const body = g.body ? `${g.body}
|
|
91486
|
+
|
|
91487
|
+
${prefixed}` : prefixed;
|
|
91488
|
+
const newMessage = `${g.message.split("\n\n")[0]}
|
|
91489
|
+
|
|
91490
|
+
${body}`;
|
|
91491
|
+
next[selectedIndex] = { ...g, body, message: newMessage };
|
|
91492
|
+
return next;
|
|
91493
|
+
});
|
|
91494
|
+
}
|
|
91495
|
+
setPhase("review");
|
|
91496
|
+
return;
|
|
91497
|
+
}
|
|
91498
|
+
if (key.escape) {
|
|
91499
|
+
setPhase("review");
|
|
91500
|
+
return;
|
|
91501
|
+
}
|
|
91502
|
+
if (key.backspace || key.delete) {
|
|
91503
|
+
setIssueRef((prev) => prev.slice(0, -1));
|
|
91504
|
+
return;
|
|
91505
|
+
}
|
|
91506
|
+
if (input && !key.ctrl && !key.meta) {
|
|
91507
|
+
setIssueRef((prev) => prev + input);
|
|
91508
|
+
}
|
|
91509
|
+
},
|
|
91510
|
+
{ isActive: phase === "link-issue" }
|
|
91511
|
+
);
|
|
91219
91512
|
}
|
|
91513
|
+
|
|
91514
|
+
// src/ui/split/hooks/use-split-pipeline.ts
|
|
91515
|
+
var import_react77 = __toESM(require_react(), 1);
|
|
91220
91516
|
var STEP_LABELS2 = {
|
|
91221
91517
|
"parse-instructions": "Interpretando instru\xE7\xF5es",
|
|
91222
91518
|
understand: "Entendendo altera\xE7\xF5es",
|
|
@@ -91233,6 +91529,45 @@ var COMMIT_STEP_LABELS = {
|
|
|
91233
91529
|
generate: "Gerando mensagem",
|
|
91234
91530
|
"fast-split": "Analisando e agrupando"
|
|
91235
91531
|
};
|
|
91532
|
+
function useSplitPipeline({
|
|
91533
|
+
phase,
|
|
91534
|
+
streamPayload,
|
|
91535
|
+
regenBody,
|
|
91536
|
+
regenRetryCount,
|
|
91537
|
+
authToken,
|
|
91538
|
+
postStream
|
|
91539
|
+
}) {
|
|
91540
|
+
const streamOptions = (0, import_react77.useMemo)(
|
|
91541
|
+
() => streamPayload && phase === "analyzing" ? {
|
|
91542
|
+
path: streamPayload.path,
|
|
91543
|
+
body: streamPayload.body,
|
|
91544
|
+
token: streamPayload.token,
|
|
91545
|
+
postStream,
|
|
91546
|
+
stepLabels: STEP_LABELS2,
|
|
91547
|
+
timeoutMs: 3e5
|
|
91548
|
+
} : null,
|
|
91549
|
+
[streamPayload, phase, postStream]
|
|
91550
|
+
);
|
|
91551
|
+
const stream = usePipelineStream(streamOptions);
|
|
91552
|
+
const regenStreamOptions = (0, import_react77.useMemo)(
|
|
91553
|
+
() => regenBody && phase === "regenerating" ? {
|
|
91554
|
+
path: "/commit/generate",
|
|
91555
|
+
body: regenBody,
|
|
91556
|
+
token: authToken,
|
|
91557
|
+
postStream,
|
|
91558
|
+
stepLabels: COMMIT_STEP_LABELS,
|
|
91559
|
+
retryKey: regenRetryCount
|
|
91560
|
+
} : null,
|
|
91561
|
+
[regenBody, phase, authToken, postStream, regenRetryCount]
|
|
91562
|
+
);
|
|
91563
|
+
const regenStream = usePipelineStream(
|
|
91564
|
+
regenStreamOptions
|
|
91565
|
+
);
|
|
91566
|
+
return { stream, regenStream };
|
|
91567
|
+
}
|
|
91568
|
+
|
|
91569
|
+
// src/ui/split/hooks/use-split-state.ts
|
|
91570
|
+
var import_react78 = __toESM(require_react(), 1);
|
|
91236
91571
|
var TERMINAL_PHASES4 = [
|
|
91237
91572
|
"done",
|
|
91238
91573
|
"aborted",
|
|
@@ -91244,6 +91579,82 @@ var TERMINAL_PHASES4 = [
|
|
|
91244
91579
|
"error-hook",
|
|
91245
91580
|
"error-commit"
|
|
91246
91581
|
];
|
|
91582
|
+
function useSplitState() {
|
|
91583
|
+
const committedMessagesRef = (0, import_react78.useRef)([]);
|
|
91584
|
+
const flowIdRef = (0, import_react78.useRef)("");
|
|
91585
|
+
const editedAnyRef = (0, import_react78.useRef)(false);
|
|
91586
|
+
const [phase, setPhase] = (0, import_react78.useState)("collecting");
|
|
91587
|
+
const [groups, setGroups] = (0, import_react78.useState)([]);
|
|
91588
|
+
const [selectedIndex, setSelectedIndex] = (0, import_react78.useState)(0);
|
|
91589
|
+
const [skippedGroups, setSkippedGroups] = (0, import_react78.useState)(/* @__PURE__ */ new Set());
|
|
91590
|
+
const [commitProgress, setCommitProgress] = (0, import_react78.useState)(0);
|
|
91591
|
+
const [errorMsg, setErrorMsg] = (0, import_react78.useState)("");
|
|
91592
|
+
const [orphanCount, setOrphanCount] = (0, import_react78.useState)(0);
|
|
91593
|
+
const [originalFiles, setOriginalFiles] = (0, import_react78.useState)([]);
|
|
91594
|
+
const [hunksMap, setHunksMap] = (0, import_react78.useState)(/* @__PURE__ */ new Map());
|
|
91595
|
+
const [patchMap, setPatchMap] = (0, import_react78.useState)(/* @__PURE__ */ new Map());
|
|
91596
|
+
const [authToken, setAuthToken] = (0, import_react78.useState)("");
|
|
91597
|
+
const [originalRawDiff, setOriginalRawDiff] = (0, import_react78.useState)("");
|
|
91598
|
+
const [issueRef, setIssueRef] = (0, import_react78.useState)("");
|
|
91599
|
+
const [confirmingAbort, setConfirmingAbort] = (0, import_react78.useState)(false);
|
|
91600
|
+
const [regenGroupIndex, setRegenGroupIndex] = (0, import_react78.useState)(null);
|
|
91601
|
+
const [regenBody, setRegenBody] = (0, import_react78.useState)(null);
|
|
91602
|
+
const [regenRetryCount, setRegenRetryCount] = (0, import_react78.useState)(0);
|
|
91603
|
+
const [streamPayload, setStreamPayload] = (0, import_react78.useState)(
|
|
91604
|
+
null
|
|
91605
|
+
);
|
|
91606
|
+
return {
|
|
91607
|
+
// refs
|
|
91608
|
+
committedMessagesRef,
|
|
91609
|
+
flowIdRef,
|
|
91610
|
+
editedAnyRef,
|
|
91611
|
+
// state
|
|
91612
|
+
phase,
|
|
91613
|
+
setPhase,
|
|
91614
|
+
groups,
|
|
91615
|
+
setGroups,
|
|
91616
|
+
selectedIndex,
|
|
91617
|
+
setSelectedIndex,
|
|
91618
|
+
skippedGroups,
|
|
91619
|
+
setSkippedGroups,
|
|
91620
|
+
commitProgress,
|
|
91621
|
+
setCommitProgress,
|
|
91622
|
+
errorMsg,
|
|
91623
|
+
setErrorMsg,
|
|
91624
|
+
orphanCount,
|
|
91625
|
+
setOrphanCount,
|
|
91626
|
+
originalFiles,
|
|
91627
|
+
setOriginalFiles,
|
|
91628
|
+
hunksMap,
|
|
91629
|
+
setHunksMap,
|
|
91630
|
+
patchMap,
|
|
91631
|
+
setPatchMap,
|
|
91632
|
+
authToken,
|
|
91633
|
+
setAuthToken,
|
|
91634
|
+
originalRawDiff,
|
|
91635
|
+
setOriginalRawDiff,
|
|
91636
|
+
issueRef,
|
|
91637
|
+
setIssueRef,
|
|
91638
|
+
confirmingAbort,
|
|
91639
|
+
setConfirmingAbort,
|
|
91640
|
+
regenGroupIndex,
|
|
91641
|
+
setRegenGroupIndex,
|
|
91642
|
+
regenBody,
|
|
91643
|
+
setRegenBody,
|
|
91644
|
+
regenRetryCount,
|
|
91645
|
+
setRegenRetryCount,
|
|
91646
|
+
streamPayload,
|
|
91647
|
+
setStreamPayload
|
|
91648
|
+
};
|
|
91649
|
+
}
|
|
91650
|
+
|
|
91651
|
+
// src/ui/split/split-app.tsx
|
|
91652
|
+
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
|
|
91653
|
+
function getCliInvocation() {
|
|
91654
|
+
const script = process.argv[1] ?? "";
|
|
91655
|
+
if (script.endsWith(".ts")) return "bun run repomind";
|
|
91656
|
+
return "repomind";
|
|
91657
|
+
}
|
|
91247
91658
|
function computeGroupStats(files, originalFiles) {
|
|
91248
91659
|
let additions = 0;
|
|
91249
91660
|
let deletions = 0;
|
|
@@ -91269,55 +91680,56 @@ function SplitApp({
|
|
|
91269
91680
|
deps.fileConfig ?? {},
|
|
91270
91681
|
deps.instructionsOverride ?? null
|
|
91271
91682
|
);
|
|
91272
|
-
const
|
|
91273
|
-
const
|
|
91274
|
-
|
|
91275
|
-
|
|
91276
|
-
|
|
91277
|
-
|
|
91278
|
-
|
|
91279
|
-
|
|
91280
|
-
|
|
91281
|
-
|
|
91282
|
-
|
|
91283
|
-
|
|
91284
|
-
|
|
91285
|
-
|
|
91286
|
-
|
|
91287
|
-
|
|
91288
|
-
|
|
91289
|
-
|
|
91290
|
-
|
|
91291
|
-
|
|
91292
|
-
|
|
91293
|
-
|
|
91294
|
-
|
|
91295
|
-
|
|
91296
|
-
|
|
91297
|
-
|
|
91298
|
-
|
|
91299
|
-
|
|
91300
|
-
|
|
91301
|
-
|
|
91302
|
-
|
|
91303
|
-
|
|
91304
|
-
|
|
91305
|
-
|
|
91306
|
-
|
|
91307
|
-
|
|
91308
|
-
|
|
91309
|
-
|
|
91310
|
-
|
|
91311
|
-
|
|
91312
|
-
|
|
91313
|
-
|
|
91314
|
-
|
|
91315
|
-
|
|
91316
|
-
|
|
91317
|
-
|
|
91318
|
-
|
|
91319
|
-
|
|
91320
|
-
|
|
91683
|
+
const state = useSplitState();
|
|
91684
|
+
const {
|
|
91685
|
+
committedMessagesRef,
|
|
91686
|
+
flowIdRef,
|
|
91687
|
+
editedAnyRef,
|
|
91688
|
+
phase,
|
|
91689
|
+
setPhase,
|
|
91690
|
+
groups,
|
|
91691
|
+
setGroups,
|
|
91692
|
+
selectedIndex,
|
|
91693
|
+
setSelectedIndex,
|
|
91694
|
+
skippedGroups,
|
|
91695
|
+
setSkippedGroups,
|
|
91696
|
+
commitProgress,
|
|
91697
|
+
setCommitProgress,
|
|
91698
|
+
errorMsg,
|
|
91699
|
+
setErrorMsg,
|
|
91700
|
+
orphanCount,
|
|
91701
|
+
setOrphanCount,
|
|
91702
|
+
originalFiles,
|
|
91703
|
+
setOriginalFiles,
|
|
91704
|
+
hunksMap,
|
|
91705
|
+
setHunksMap,
|
|
91706
|
+
patchMap,
|
|
91707
|
+
setPatchMap,
|
|
91708
|
+
authToken,
|
|
91709
|
+
setAuthToken,
|
|
91710
|
+
originalRawDiff,
|
|
91711
|
+
setOriginalRawDiff,
|
|
91712
|
+
issueRef,
|
|
91713
|
+
setIssueRef,
|
|
91714
|
+
confirmingAbort,
|
|
91715
|
+
setConfirmingAbort,
|
|
91716
|
+
regenGroupIndex,
|
|
91717
|
+
setRegenGroupIndex,
|
|
91718
|
+
regenBody,
|
|
91719
|
+
setRegenBody,
|
|
91720
|
+
regenRetryCount,
|
|
91721
|
+
setRegenRetryCount,
|
|
91722
|
+
streamPayload,
|
|
91723
|
+
setStreamPayload
|
|
91724
|
+
} = state;
|
|
91725
|
+
const { stream, regenStream } = useSplitPipeline({
|
|
91726
|
+
phase,
|
|
91727
|
+
streamPayload,
|
|
91728
|
+
regenBody,
|
|
91729
|
+
regenRetryCount,
|
|
91730
|
+
authToken,
|
|
91731
|
+
postStream: deps.postStream
|
|
91732
|
+
});
|
|
91321
91733
|
const sendFeedback = (outcome) => {
|
|
91322
91734
|
if (!flowIdRef.current || !authToken) return;
|
|
91323
91735
|
deps.apiPost(
|
|
@@ -91327,7 +91739,7 @@ function SplitApp({
|
|
|
91327
91739
|
).catch(() => {
|
|
91328
91740
|
});
|
|
91329
91741
|
};
|
|
91330
|
-
(0,
|
|
91742
|
+
(0, import_react79.useEffect)(() => {
|
|
91331
91743
|
if (!TERMINAL_PHASES4.includes(phase)) return;
|
|
91332
91744
|
const code = phase === "done" || phase === "aborted" ? 0 : 1;
|
|
91333
91745
|
exit();
|
|
@@ -91337,7 +91749,7 @@ function SplitApp({
|
|
|
91337
91749
|
code !== 0 ? errorMsg : void 0
|
|
91338
91750
|
);
|
|
91339
91751
|
}, [phase]);
|
|
91340
|
-
(0,
|
|
91752
|
+
(0, import_react79.useEffect)(() => {
|
|
91341
91753
|
if (phase !== "analyzing") return;
|
|
91342
91754
|
if (stream.result) {
|
|
91343
91755
|
const sortedGroups = stream.result.groups.sort(
|
|
@@ -91345,9 +91757,14 @@ function SplitApp({
|
|
|
91345
91757
|
);
|
|
91346
91758
|
setGroups(sortedGroups);
|
|
91347
91759
|
if (stream.result.orphans?.length) {
|
|
91348
|
-
setOrphanCount(
|
|
91760
|
+
setOrphanCount(
|
|
91761
|
+
stream.result.orphans?.length ?? 0
|
|
91762
|
+
);
|
|
91763
|
+
}
|
|
91764
|
+
const flowId = stream.result.flowId;
|
|
91765
|
+
if (flowId) {
|
|
91766
|
+
flowIdRef.current = flowId;
|
|
91349
91767
|
}
|
|
91350
|
-
if (stream.result.flowId) flowIdRef.current = stream.result.flowId;
|
|
91351
91768
|
setPhase("review");
|
|
91352
91769
|
return;
|
|
91353
91770
|
}
|
|
@@ -91361,7 +91778,8 @@ function SplitApp({
|
|
|
91361
91778
|
setPhase("error-api");
|
|
91362
91779
|
} else if (e instanceof PlanLimitError) {
|
|
91363
91780
|
setErrorMsg(
|
|
91364
|
-
|
|
91781
|
+
`${e.displayMessage}
|
|
91782
|
+
\u2192 ${terminalLink(e.action.label, e.action.url)}`
|
|
91365
91783
|
);
|
|
91366
91784
|
setPhase("error-plan");
|
|
91367
91785
|
} else if (e instanceof ApiError && e.status === 403) {
|
|
@@ -91385,7 +91803,7 @@ function SplitApp({
|
|
|
91385
91803
|
}
|
|
91386
91804
|
}
|
|
91387
91805
|
}, [stream.result, stream.error, stream.errorRaw, phase]);
|
|
91388
|
-
(0,
|
|
91806
|
+
(0, import_react79.useEffect)(() => {
|
|
91389
91807
|
if (phase !== "regenerating") return;
|
|
91390
91808
|
if (regenStream.result) {
|
|
91391
91809
|
if (regenStream.result.flowId) {
|
|
@@ -91417,7 +91835,7 @@ function SplitApp({
|
|
|
91417
91835
|
setPhase("review");
|
|
91418
91836
|
}
|
|
91419
91837
|
}, [regenStream.result, regenStream.error, phase, regenGroupIndex]);
|
|
91420
|
-
(0,
|
|
91838
|
+
(0, import_react79.useEffect)(() => {
|
|
91421
91839
|
async function run2() {
|
|
91422
91840
|
const token = deps.readToken();
|
|
91423
91841
|
if (!token) {
|
|
@@ -91515,144 +91933,6 @@ ${hookResult.output}` : "";
|
|
|
91515
91933
|
}
|
|
91516
91934
|
run2();
|
|
91517
91935
|
}, []);
|
|
91518
|
-
use_input_default(
|
|
91519
|
-
(input, key) => {
|
|
91520
|
-
if (phase !== "review") return;
|
|
91521
|
-
if (confirmingAbort) {
|
|
91522
|
-
if (input.toLowerCase() === "y") {
|
|
91523
|
-
sendFeedback("discarded");
|
|
91524
|
-
setConfirmingAbort(false);
|
|
91525
|
-
setPhase("aborted");
|
|
91526
|
-
return;
|
|
91527
|
-
}
|
|
91528
|
-
if (input.toLowerCase() === "n" || key.escape) {
|
|
91529
|
-
setConfirmingAbort(false);
|
|
91530
|
-
return;
|
|
91531
|
-
}
|
|
91532
|
-
return;
|
|
91533
|
-
}
|
|
91534
|
-
if (key.upArrow || input === "k") {
|
|
91535
|
-
setSelectedIndex((prev) => Math.max(0, prev - 1));
|
|
91536
|
-
return;
|
|
91537
|
-
}
|
|
91538
|
-
if (key.downArrow || input === "j") {
|
|
91539
|
-
setSelectedIndex((prev) => Math.min(groups.length - 1, prev + 1));
|
|
91540
|
-
return;
|
|
91541
|
-
}
|
|
91542
|
-
if (input === "d") {
|
|
91543
|
-
setPhase("viewing-diff");
|
|
91544
|
-
return;
|
|
91545
|
-
}
|
|
91546
|
-
if (input === "e") {
|
|
91547
|
-
editedAnyRef.current = true;
|
|
91548
|
-
setPhase("editing");
|
|
91549
|
-
return;
|
|
91550
|
-
}
|
|
91551
|
-
if (input === "r") {
|
|
91552
|
-
const group = groups[selectedIndex];
|
|
91553
|
-
if (!group || !authToken) return;
|
|
91554
|
-
sendFeedback("regenerated");
|
|
91555
|
-
const combinedPatch = group.files.map((f) => patchMap.get(f.path) ?? "").filter(Boolean).join("\n");
|
|
91556
|
-
const body = { diff: combinedPatch };
|
|
91557
|
-
if (Object.keys(activeFileConfig).length > 0) {
|
|
91558
|
-
body.config = activeFileConfig;
|
|
91559
|
-
}
|
|
91560
|
-
body.regeneration = {
|
|
91561
|
-
attempt: regenRetryCount + 1,
|
|
91562
|
-
previousMessage: group.message
|
|
91563
|
-
};
|
|
91564
|
-
setRegenGroupIndex(selectedIndex);
|
|
91565
|
-
setRegenBody(body);
|
|
91566
|
-
setRegenRetryCount((c) => c + 1);
|
|
91567
|
-
setPhase("regenerating");
|
|
91568
|
-
return;
|
|
91569
|
-
}
|
|
91570
|
-
if (input === "l") {
|
|
91571
|
-
setIssueRef("");
|
|
91572
|
-
setPhase("link-issue");
|
|
91573
|
-
return;
|
|
91574
|
-
}
|
|
91575
|
-
if (input === "s") {
|
|
91576
|
-
const groupId = groups[selectedIndex]?.groupId;
|
|
91577
|
-
if (groupId) {
|
|
91578
|
-
setSkippedGroups((prev) => {
|
|
91579
|
-
const next = new Set(prev);
|
|
91580
|
-
if (next.has(groupId)) {
|
|
91581
|
-
next.delete(groupId);
|
|
91582
|
-
} else {
|
|
91583
|
-
next.add(groupId);
|
|
91584
|
-
}
|
|
91585
|
-
return next;
|
|
91586
|
-
});
|
|
91587
|
-
}
|
|
91588
|
-
return;
|
|
91589
|
-
}
|
|
91590
|
-
if (key.return || input === "a") {
|
|
91591
|
-
startCommitting();
|
|
91592
|
-
return;
|
|
91593
|
-
}
|
|
91594
|
-
if (input === "q") {
|
|
91595
|
-
setConfirmingAbort(true);
|
|
91596
|
-
}
|
|
91597
|
-
},
|
|
91598
|
-
{ isActive: phase === "review" }
|
|
91599
|
-
);
|
|
91600
|
-
use_input_default(
|
|
91601
|
-
(input, key) => {
|
|
91602
|
-
if (key.return) {
|
|
91603
|
-
const ref = issueRef.trim();
|
|
91604
|
-
if (ref) {
|
|
91605
|
-
const prefixed = /^refs:/i.test(ref) ? ref : `Refs: ${ref}`;
|
|
91606
|
-
setGroups((prev) => {
|
|
91607
|
-
const next = [...prev];
|
|
91608
|
-
const g = next[selectedIndex];
|
|
91609
|
-
if (!g) return prev;
|
|
91610
|
-
const body = g.body ? `${g.body}
|
|
91611
|
-
|
|
91612
|
-
${prefixed}` : prefixed;
|
|
91613
|
-
const newMessage = `${g.message.split("\n\n")[0]}
|
|
91614
|
-
|
|
91615
|
-
${body}`;
|
|
91616
|
-
next[selectedIndex] = { ...g, body, message: newMessage };
|
|
91617
|
-
return next;
|
|
91618
|
-
});
|
|
91619
|
-
}
|
|
91620
|
-
setPhase("review");
|
|
91621
|
-
return;
|
|
91622
|
-
}
|
|
91623
|
-
if (key.escape) {
|
|
91624
|
-
setPhase("review");
|
|
91625
|
-
return;
|
|
91626
|
-
}
|
|
91627
|
-
if (key.backspace || key.delete) {
|
|
91628
|
-
setIssueRef((prev) => prev.slice(0, -1));
|
|
91629
|
-
return;
|
|
91630
|
-
}
|
|
91631
|
-
if (input && !key.ctrl && !key.meta) {
|
|
91632
|
-
setIssueRef((prev) => prev + input);
|
|
91633
|
-
}
|
|
91634
|
-
},
|
|
91635
|
-
{ isActive: phase === "link-issue" }
|
|
91636
|
-
);
|
|
91637
|
-
function applyEditedMessage(newMessage) {
|
|
91638
|
-
setGroups((prev) => {
|
|
91639
|
-
const next = [...prev];
|
|
91640
|
-
const g = next[selectedIndex];
|
|
91641
|
-
if (!g) return prev;
|
|
91642
|
-
const [header, ...bodyParts] = newMessage.split("\n\n");
|
|
91643
|
-
const parsed = parseCommitType(header);
|
|
91644
|
-
next[selectedIndex] = {
|
|
91645
|
-
...g,
|
|
91646
|
-
type: parsed.type,
|
|
91647
|
-
scope: parsed.scope,
|
|
91648
|
-
description: parsed.description,
|
|
91649
|
-
body: bodyParts.length > 0 ? bodyParts.join("\n\n") : null,
|
|
91650
|
-
message: newMessage
|
|
91651
|
-
};
|
|
91652
|
-
return next;
|
|
91653
|
-
});
|
|
91654
|
-
setPhase("review");
|
|
91655
|
-
}
|
|
91656
91936
|
async function startCommitting() {
|
|
91657
91937
|
const debug4 = process.argv.includes("--verbose") || process.argv.includes("-v") || !!process.env.REPOMIND_DEBUG;
|
|
91658
91938
|
const log4 = debug4 ? (msg) => console.error(`[split-commit] ${msg}`) : () => {
|
|
@@ -91724,6 +92004,49 @@ ${body}`;
|
|
|
91724
92004
|
setPhase("error-commit");
|
|
91725
92005
|
}
|
|
91726
92006
|
}
|
|
92007
|
+
function applyEditedMessage(newMessage) {
|
|
92008
|
+
setGroups((prev) => {
|
|
92009
|
+
const next = [...prev];
|
|
92010
|
+
const g = next[selectedIndex];
|
|
92011
|
+
if (!g) return prev;
|
|
92012
|
+
const [header, ...bodyParts] = newMessage.split("\n\n");
|
|
92013
|
+
const parsed = parseCommitType(header);
|
|
92014
|
+
next[selectedIndex] = {
|
|
92015
|
+
...g,
|
|
92016
|
+
type: parsed.type,
|
|
92017
|
+
scope: parsed.scope,
|
|
92018
|
+
description: parsed.description,
|
|
92019
|
+
body: bodyParts.length > 0 ? bodyParts.join("\n\n") : null,
|
|
92020
|
+
message: newMessage
|
|
92021
|
+
};
|
|
92022
|
+
return next;
|
|
92023
|
+
});
|
|
92024
|
+
setPhase("review");
|
|
92025
|
+
}
|
|
92026
|
+
useSplitKeyboard({
|
|
92027
|
+
phase,
|
|
92028
|
+
groups,
|
|
92029
|
+
selectedIndex,
|
|
92030
|
+
setSelectedIndex,
|
|
92031
|
+
skippedGroups,
|
|
92032
|
+
setSkippedGroups,
|
|
92033
|
+
issueRef,
|
|
92034
|
+
setIssueRef,
|
|
92035
|
+
confirmingAbort,
|
|
92036
|
+
setConfirmingAbort,
|
|
92037
|
+
setPhase,
|
|
92038
|
+
setGroups,
|
|
92039
|
+
patchMap,
|
|
92040
|
+
authToken,
|
|
92041
|
+
regenRetryCount,
|
|
92042
|
+
setRegenGroupIndex,
|
|
92043
|
+
setRegenBody,
|
|
92044
|
+
setRegenRetryCount,
|
|
92045
|
+
editedAnyRef,
|
|
92046
|
+
activeFileConfig,
|
|
92047
|
+
sendFeedback,
|
|
92048
|
+
startCommitting
|
|
92049
|
+
});
|
|
91727
92050
|
const activeGroups = groups.filter((g) => !skippedGroups.has(g.groupId));
|
|
91728
92051
|
const activeGroupCount = activeGroups.length;
|
|
91729
92052
|
if (phase === "viewing-diff") {
|
|
@@ -92025,7 +92348,7 @@ async function splitCommand() {
|
|
|
92025
92348
|
let errorMessage = "";
|
|
92026
92349
|
enterImmersive();
|
|
92027
92350
|
const { waitUntilExit } = render_default(
|
|
92028
|
-
|
|
92351
|
+
import_react80.default.createElement(SplitApp, {
|
|
92029
92352
|
deps: {
|
|
92030
92353
|
readToken,
|
|
92031
92354
|
getAllChanges,
|
|
@@ -92063,7 +92386,7 @@ async function splitCommand() {
|
|
|
92063
92386
|
exitImmersive();
|
|
92064
92387
|
if (completedCommits.length > 0) {
|
|
92065
92388
|
const { waitUntilExit: waitUntilExit2 } = render_default(
|
|
92066
|
-
|
|
92389
|
+
import_react80.default.createElement(SplitDoneSummary, {
|
|
92067
92390
|
commits: completedCommits,
|
|
92068
92391
|
updateAvailable: getUpdateInfo()
|
|
92069
92392
|
})
|
|
@@ -92077,63 +92400,226 @@ async function splitCommand() {
|
|
|
92077
92400
|
process.exit(exitCode);
|
|
92078
92401
|
}
|
|
92079
92402
|
|
|
92080
|
-
// src/commands/
|
|
92081
|
-
var
|
|
92403
|
+
// src/commands/status.tsx
|
|
92404
|
+
var import_react81 = __toESM(require_react(), 1);
|
|
92082
92405
|
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
|
|
92083
92406
|
var apiClient3 = createApiClient();
|
|
92084
|
-
function
|
|
92407
|
+
function formatDate(iso) {
|
|
92408
|
+
if (!iso) return "\u2014";
|
|
92409
|
+
return new Date(iso).toLocaleDateString("pt-BR", {
|
|
92410
|
+
day: "2-digit",
|
|
92411
|
+
month: "short",
|
|
92412
|
+
year: "numeric"
|
|
92413
|
+
});
|
|
92414
|
+
}
|
|
92415
|
+
function CommitBar({ used, limit }) {
|
|
92416
|
+
const BAR_WIDTH = 20;
|
|
92417
|
+
const pct = limit > 0 ? Math.min(used / limit, 1) : 0;
|
|
92418
|
+
const filled = Math.round(pct * BAR_WIDTH);
|
|
92419
|
+
const empty = BAR_WIDTH - filled;
|
|
92420
|
+
const bar = "\u2588".repeat(filled) + "\u2591".repeat(empty);
|
|
92421
|
+
const color = pct >= 1 ? C.red : pct >= 0.8 ? C.yellow : C.green;
|
|
92422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { gap: 1, children: [
|
|
92423
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color, children: bar }),
|
|
92424
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: C.dim, children: [
|
|
92425
|
+
used,
|
|
92426
|
+
" / ",
|
|
92427
|
+
limit === -1 ? "\u221E" : limit,
|
|
92428
|
+
" commits"
|
|
92429
|
+
] })
|
|
92430
|
+
] });
|
|
92431
|
+
}
|
|
92432
|
+
function statusLabel(status) {
|
|
92433
|
+
switch (status) {
|
|
92434
|
+
case "active":
|
|
92435
|
+
return { label: "Ativo", color: C.green };
|
|
92436
|
+
case "trialing":
|
|
92437
|
+
return { label: "Trial", color: C.cyan };
|
|
92438
|
+
case "past_due":
|
|
92439
|
+
return { label: "Pagamento pendente", color: C.yellow };
|
|
92440
|
+
case "canceled":
|
|
92441
|
+
return { label: "Cancelado", color: C.red };
|
|
92442
|
+
case "unpaid":
|
|
92443
|
+
return { label: "Inadimplente", color: C.red };
|
|
92444
|
+
default:
|
|
92445
|
+
return { label: "Sem assinatura", color: C.dim };
|
|
92446
|
+
}
|
|
92447
|
+
}
|
|
92448
|
+
function Row({
|
|
92449
|
+
label,
|
|
92450
|
+
children
|
|
92451
|
+
}) {
|
|
92452
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { gap: 1, children: [
|
|
92453
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { width: 14, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.dim, children: label }) }),
|
|
92454
|
+
children
|
|
92455
|
+
] });
|
|
92456
|
+
}
|
|
92457
|
+
function StatusApp({ onExit }) {
|
|
92085
92458
|
const token = readToken();
|
|
92086
|
-
const [me, setMe] = (0,
|
|
92087
|
-
const [
|
|
92088
|
-
const [
|
|
92089
|
-
const [expired, setExpired] = (0,
|
|
92090
|
-
(0,
|
|
92459
|
+
const [me, setMe] = (0, import_react81.useState)(null);
|
|
92460
|
+
const [billing, setBilling] = (0, import_react81.useState)(null);
|
|
92461
|
+
const [loading, setLoading] = (0, import_react81.useState)(!!token);
|
|
92462
|
+
const [expired, setExpired] = (0, import_react81.useState)(false);
|
|
92463
|
+
const [failed, setFailed] = (0, import_react81.useState)(false);
|
|
92464
|
+
(0, import_react81.useEffect)(() => {
|
|
92091
92465
|
if (!token) return;
|
|
92092
|
-
|
|
92466
|
+
Promise.all([
|
|
92467
|
+
apiClient3.get("/auth/me", token),
|
|
92468
|
+
apiClient3.get("/billing/status", token)
|
|
92469
|
+
]).then(([meData, billingData]) => {
|
|
92470
|
+
setMe(meData);
|
|
92471
|
+
setBilling(billingData);
|
|
92472
|
+
}).catch((err) => {
|
|
92093
92473
|
if (err instanceof TokenExpiredError) setExpired(true);
|
|
92094
92474
|
setFailed(true);
|
|
92095
92475
|
}).finally(() => setLoading(false));
|
|
92096
92476
|
}, []);
|
|
92097
92477
|
const done = !loading;
|
|
92098
|
-
|
|
92099
|
-
(0, import_react78.useEffect)(() => {
|
|
92478
|
+
(0, import_react81.useEffect)(() => {
|
|
92100
92479
|
if (!done) return;
|
|
92101
|
-
|
|
92102
|
-
|
|
92480
|
+
const success = !!me && !failed;
|
|
92481
|
+
onExit(success ? 0 : 1);
|
|
92482
|
+
}, [done, me, failed, onExit]);
|
|
92483
|
+
const { label: statusText, color: statusColor } = billing ? statusLabel(billing.subscriptionStatus) : { label: "", color: C.dim };
|
|
92103
92484
|
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { flexDirection: "column", paddingTop: 1, marginBottom: 1, children: [
|
|
92104
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { bold: true, color: C.cyan, children: "RepoMind" }) }),
|
|
92485
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { bold: true, color: C.cyan, children: "RepoMind Status" }) }),
|
|
92105
92486
|
loading && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { gap: 1, children: [
|
|
92106
92487
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.cyan, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(build_default, { type: "dots" }) }),
|
|
92107
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.dim, children: "
|
|
92488
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.dim, children: "Carregando..." })
|
|
92489
|
+
] }),
|
|
92490
|
+
done && !token && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { gap: 1, children: [
|
|
92491
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.yellow, children: "\u25C6" }),
|
|
92492
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: C.dim, children: [
|
|
92493
|
+
"N\xE3o autenticado. Execute ",
|
|
92494
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.white, children: "repomind login" }),
|
|
92495
|
+
"."
|
|
92496
|
+
] })
|
|
92497
|
+
] }),
|
|
92498
|
+
done && token && expired && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { gap: 1, children: [
|
|
92499
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.yellow, children: "\u25C6" }),
|
|
92500
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: C.dim, children: [
|
|
92501
|
+
"Token expirado. Execute ",
|
|
92502
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.white, children: "repomind login" }),
|
|
92503
|
+
" ",
|
|
92504
|
+
"para renovar."
|
|
92505
|
+
] })
|
|
92506
|
+
] }),
|
|
92507
|
+
done && token && failed && !expired && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { gap: 1, children: [
|
|
92508
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.red, children: "\u2717" }),
|
|
92509
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.dim, children: "Falha ao carregar status. Tente novamente." })
|
|
92108
92510
|
] }),
|
|
92109
|
-
done && me && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { flexDirection: "column", gap: 0, children: [
|
|
92110
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { gap: 1, children: [
|
|
92511
|
+
done && me && billing && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { flexDirection: "column", gap: 0, children: [
|
|
92512
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { gap: 1, marginBottom: 1, children: [
|
|
92111
92513
|
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.green, children: "\u2713" }),
|
|
92112
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { children: [
|
|
92514
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: C.dim, children: [
|
|
92515
|
+
"Autenticado como ",
|
|
92516
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.white, children: me.email })
|
|
92517
|
+
] })
|
|
92518
|
+
] }),
|
|
92519
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Box_default, { flexDirection: "column", gap: 0, paddingLeft: 2, children: [
|
|
92520
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Row, { label: "Plano", children: [
|
|
92521
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.white, children: billing.planName || billing.planSlug }),
|
|
92522
|
+
billing.interval && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: C.dim, children: [
|
|
92523
|
+
"(",
|
|
92524
|
+
billing.interval === "month" ? "mensal" : "anual",
|
|
92525
|
+
")"
|
|
92526
|
+
] })
|
|
92527
|
+
] }),
|
|
92528
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Row, { label: "Status", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: statusColor, children: statusText }) }),
|
|
92529
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Row, { label: "Uso", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
92530
|
+
CommitBar,
|
|
92531
|
+
{
|
|
92532
|
+
used: billing.commitsUsed,
|
|
92533
|
+
limit: billing.commitsLimit
|
|
92534
|
+
}
|
|
92535
|
+
) }),
|
|
92536
|
+
billing.subscriptionStatus === "trialing" && billing.trialEnd && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Row, { label: "Trial at\xE9", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.cyan, children: formatDate(billing.trialEnd) }) }),
|
|
92537
|
+
billing.subscriptionStatus !== "trialing" && billing.currentPeriodEnd && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Row, { label: "Renova\xE7\xE3o", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.dim, children: formatDate(billing.currentPeriodEnd) }) }),
|
|
92538
|
+
billing.cancelAtPeriodEnd && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Row, { label: "", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: C.yellow, children: [
|
|
92539
|
+
"\u25C6 Cancela em ",
|
|
92540
|
+
formatDate(billing.currentPeriodEnd)
|
|
92541
|
+
] }) }),
|
|
92542
|
+
billing.pendingPlanChange && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Row, { label: "", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(Text, { color: C.yellow, children: [
|
|
92543
|
+
"\u25C6 Mudan\xE7a para",
|
|
92544
|
+
" ",
|
|
92545
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(Text, { color: C.white, children: billing.pendingPlanChange.planName ?? "novo plano" }),
|
|
92546
|
+
" ",
|
|
92547
|
+
"no pr\xF3ximo ciclo"
|
|
92548
|
+
] }) })
|
|
92549
|
+
] })
|
|
92550
|
+
] })
|
|
92551
|
+
] });
|
|
92552
|
+
}
|
|
92553
|
+
async function statusCommand() {
|
|
92554
|
+
let exitCode = 0;
|
|
92555
|
+
const { waitUntilExit } = render_default(
|
|
92556
|
+
import_react81.default.createElement(StatusApp, {
|
|
92557
|
+
onExit: (code) => {
|
|
92558
|
+
exitCode = code;
|
|
92559
|
+
}
|
|
92560
|
+
})
|
|
92561
|
+
);
|
|
92562
|
+
await waitUntilExit();
|
|
92563
|
+
process.exit(exitCode);
|
|
92564
|
+
}
|
|
92565
|
+
|
|
92566
|
+
// src/commands/whoami.tsx
|
|
92567
|
+
var import_react82 = __toESM(require_react(), 1);
|
|
92568
|
+
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
|
|
92569
|
+
var apiClient4 = createApiClient();
|
|
92570
|
+
function WhoamiApp({ onExit }) {
|
|
92571
|
+
const token = readToken();
|
|
92572
|
+
const [me, setMe] = (0, import_react82.useState)(null);
|
|
92573
|
+
const [loading, setLoading] = (0, import_react82.useState)(!!token);
|
|
92574
|
+
const [failed, setFailed] = (0, import_react82.useState)(false);
|
|
92575
|
+
const [expired, setExpired] = (0, import_react82.useState)(false);
|
|
92576
|
+
(0, import_react82.useEffect)(() => {
|
|
92577
|
+
if (!token) return;
|
|
92578
|
+
apiClient4.get("/auth/me", token).then(setMe).catch((err) => {
|
|
92579
|
+
if (err instanceof TokenExpiredError) setExpired(true);
|
|
92580
|
+
setFailed(true);
|
|
92581
|
+
}).finally(() => setLoading(false));
|
|
92582
|
+
}, []);
|
|
92583
|
+
const done = !loading;
|
|
92584
|
+
const authenticated = !!me && !failed;
|
|
92585
|
+
(0, import_react82.useEffect)(() => {
|
|
92586
|
+
if (!done) return;
|
|
92587
|
+
onExit(authenticated ? 0 : 1);
|
|
92588
|
+
}, [done, authenticated, onExit]);
|
|
92589
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { flexDirection: "column", paddingTop: 1, marginBottom: 1, children: [
|
|
92590
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { marginBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { bold: true, color: C.cyan, children: "RepoMind" }) }),
|
|
92591
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { gap: 1, children: [
|
|
92592
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: C.cyan, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(build_default, { type: "dots" }) }),
|
|
92593
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: C.dim, children: "Verificando..." })
|
|
92594
|
+
] }),
|
|
92595
|
+
done && me && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { flexDirection: "column", gap: 0, children: [
|
|
92596
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { gap: 1, children: [
|
|
92597
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: C.green, children: "\u2713" }),
|
|
92598
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { children: [
|
|
92113
92599
|
"Autenticado como",
|
|
92114
92600
|
" ",
|
|
92115
|
-
/* @__PURE__ */ (0,
|
|
92601
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { bold: true, color: C.white, children: me.email })
|
|
92116
92602
|
] })
|
|
92117
92603
|
] }),
|
|
92118
|
-
me.tokenName && /* @__PURE__ */ (0,
|
|
92604
|
+
me.tokenName && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Box_default, { gap: 1, paddingLeft: 2, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: C.dim, children: [
|
|
92119
92605
|
"Token: ",
|
|
92120
92606
|
me.tokenName
|
|
92121
92607
|
] }) })
|
|
92122
92608
|
] }),
|
|
92123
|
-
done && !me && expired && /* @__PURE__ */ (0,
|
|
92124
|
-
/* @__PURE__ */ (0,
|
|
92125
|
-
/* @__PURE__ */ (0,
|
|
92609
|
+
done && !me && expired && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { gap: 1, children: [
|
|
92610
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: C.yellow, children: "\u25C6" }),
|
|
92611
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: C.dim, children: [
|
|
92126
92612
|
"Token expirado. Execute ",
|
|
92127
|
-
/* @__PURE__ */ (0,
|
|
92613
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: C.white, children: "repomind login" }),
|
|
92128
92614
|
" ",
|
|
92129
92615
|
"para renovar."
|
|
92130
92616
|
] })
|
|
92131
92617
|
] }),
|
|
92132
|
-
done && !me && !expired && /* @__PURE__ */ (0,
|
|
92133
|
-
/* @__PURE__ */ (0,
|
|
92134
|
-
/* @__PURE__ */ (0,
|
|
92618
|
+
done && !me && !expired && /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Box_default, { gap: 1, children: [
|
|
92619
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: C.yellow, children: "\u25C6" }),
|
|
92620
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(Text, { color: C.dim, children: [
|
|
92135
92621
|
"Nao autenticado. Execute ",
|
|
92136
|
-
/* @__PURE__ */ (0,
|
|
92622
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Text, { color: C.white, children: "repomind login" }),
|
|
92137
92623
|
"."
|
|
92138
92624
|
] })
|
|
92139
92625
|
] })
|
|
@@ -92142,7 +92628,7 @@ function WhoamiApp({ onExit }) {
|
|
|
92142
92628
|
async function whoamiCommand() {
|
|
92143
92629
|
let exitCode = 0;
|
|
92144
92630
|
const { waitUntilExit } = render_default(
|
|
92145
|
-
|
|
92631
|
+
import_react82.default.createElement(WhoamiApp, {
|
|
92146
92632
|
onExit: (code) => {
|
|
92147
92633
|
exitCode = code;
|
|
92148
92634
|
}
|
|
@@ -92154,58 +92640,69 @@ async function whoamiCommand() {
|
|
|
92154
92640
|
|
|
92155
92641
|
// src/index.ts
|
|
92156
92642
|
import { createRequire } from "node:module";
|
|
92157
|
-
var
|
|
92643
|
+
var import_react83 = __toESM(require_react(), 1);
|
|
92158
92644
|
|
|
92159
92645
|
// src/ui/components/command-help.tsx
|
|
92160
|
-
var
|
|
92646
|
+
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
|
|
92647
|
+
function SectionLabel2({ label }) {
|
|
92648
|
+
const cols = Math.max(20, (process.stdout.columns ?? 80) - 3);
|
|
92649
|
+
const dashes = Math.max(0, cols - label.length - 3);
|
|
92650
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Box_default, { gap: 1, children: [
|
|
92651
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: C.dim, bold: true, children: label }),
|
|
92652
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: C.dim, children: "\u2500".repeat(dashes) })
|
|
92653
|
+
] });
|
|
92654
|
+
}
|
|
92161
92655
|
function CommandHelp({
|
|
92162
92656
|
command: command2,
|
|
92163
92657
|
usage,
|
|
92164
92658
|
description,
|
|
92165
92659
|
details,
|
|
92166
|
-
flags
|
|
92660
|
+
flags,
|
|
92661
|
+
examples
|
|
92167
92662
|
}) {
|
|
92168
|
-
|
|
92169
|
-
|
|
92170
|
-
|
|
92171
|
-
|
|
92172
|
-
|
|
92173
|
-
|
|
92174
|
-
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
92663
|
+
const visibleFlags = flags?.filter(
|
|
92664
|
+
(f) => f.name !== "--help" && f.name !== "--verbose"
|
|
92665
|
+
);
|
|
92666
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Box_default, { flexDirection: "column", marginBottom: 1, children: [
|
|
92667
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Header, { title: `RepoMind ${command2}` }),
|
|
92668
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
92175
92669
|
Box_default,
|
|
92176
92670
|
{
|
|
92177
|
-
paddingLeft:
|
|
92178
|
-
|
|
92179
|
-
|
|
92180
|
-
borderColor: C.dim,
|
|
92181
|
-
paddingX: 2,
|
|
92182
|
-
paddingY: 0,
|
|
92671
|
+
paddingLeft: 2,
|
|
92672
|
+
paddingTop: 1,
|
|
92673
|
+
paddingBottom: 1,
|
|
92183
92674
|
flexDirection: "column",
|
|
92184
92675
|
children: [
|
|
92185
|
-
/* @__PURE__ */ (0,
|
|
92186
|
-
details?.map((
|
|
92676
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: C.white, children: description }),
|
|
92677
|
+
details?.map((d) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: C.dim, children: d }, d))
|
|
92187
92678
|
]
|
|
92188
92679
|
}
|
|
92189
92680
|
),
|
|
92190
|
-
|
|
92191
|
-
|
|
92192
|
-
|
|
92193
|
-
|
|
92194
|
-
|
|
92195
|
-
|
|
92681
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { paddingLeft: 2, paddingBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SectionLabel2, { label: "USO" }) }),
|
|
92682
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { paddingLeft: 2, paddingBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: C.cyan, bold: true, children: usage }) }),
|
|
92683
|
+
visibleFlags && visibleFlags.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
92684
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { paddingLeft: 2, paddingBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SectionLabel2, { label: "OP\xC7\xD5ES" }) }),
|
|
92685
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { flexDirection: "column", paddingLeft: 2, paddingBottom: 1, children: visibleFlags.map((flag) => /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Box_default, { gap: 1, children: [
|
|
92686
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Box_default, { width: 26, children: [
|
|
92687
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: C.cyan, children: flag.name }),
|
|
92688
|
+
flag.alias && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(Text, { color: C.dim, children: [
|
|
92196
92689
|
", ",
|
|
92197
92690
|
flag.alias
|
|
92198
92691
|
] })
|
|
92199
92692
|
] }),
|
|
92200
|
-
/* @__PURE__ */ (0,
|
|
92693
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: C.dim, children: flag.description })
|
|
92201
92694
|
] }, flag.name)) })
|
|
92695
|
+
] }),
|
|
92696
|
+
examples && examples.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [
|
|
92697
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { paddingLeft: 2, paddingBottom: 1, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(SectionLabel2, { label: "EXEMPLO" }) }),
|
|
92698
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Box_default, { flexDirection: "column", paddingLeft: 2, children: examples.map((ex) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Text, { color: C.white, children: ex }, ex)) })
|
|
92202
92699
|
] })
|
|
92203
92700
|
] });
|
|
92204
92701
|
}
|
|
92205
92702
|
|
|
92206
92703
|
// src/index.ts
|
|
92207
92704
|
function getVersion() {
|
|
92208
|
-
if ("0.
|
|
92705
|
+
if ("0.15.0") return "0.15.0";
|
|
92209
92706
|
try {
|
|
92210
92707
|
const require2 = createRequire(import.meta.url);
|
|
92211
92708
|
const pkg = require2("../package.json");
|
|
@@ -92240,16 +92737,15 @@ var COMMAND_HELP = {
|
|
|
92240
92737
|
"Se o arquivo j\xE1 existir, pergunta se deseja sobrescrever.",
|
|
92241
92738
|
"Configura idioma, corpo, rodap\xE9 e rastreamento de breaking changes."
|
|
92242
92739
|
],
|
|
92243
|
-
|
|
92740
|
+
examples: ["cd meu-projeto", "repomind init"]
|
|
92244
92741
|
},
|
|
92245
92742
|
commit: {
|
|
92246
|
-
usage: "repomind commit",
|
|
92743
|
+
usage: "repomind commit [op\xE7\xF5es]",
|
|
92247
92744
|
description: "Gera uma mensagem de commit inteligente a partir do git diff --staged.",
|
|
92248
|
-
details: ["Requer arquivos staged (git add)."],
|
|
92249
92745
|
flags: [
|
|
92250
92746
|
{
|
|
92251
92747
|
name: "--instructions [texto]",
|
|
92252
|
-
description:
|
|
92748
|
+
description: "Instru\xE7\xE3o pontual para esta gera\xE7\xE3o. Sem texto abre editor interativo."
|
|
92253
92749
|
},
|
|
92254
92750
|
{
|
|
92255
92751
|
name: "--no-verify",
|
|
@@ -92261,17 +92757,21 @@ var COMMAND_HELP = {
|
|
|
92261
92757
|
description: "Exibir detalhes de erro"
|
|
92262
92758
|
},
|
|
92263
92759
|
{ name: "--help", alias: "-h", description: "Exibir esta ajuda" }
|
|
92760
|
+
],
|
|
92761
|
+
examples: [
|
|
92762
|
+
"git add src/auth.ts",
|
|
92763
|
+
"repomind commit",
|
|
92764
|
+
'repomind commit --instructions "foca na parte de auth"'
|
|
92264
92765
|
]
|
|
92265
92766
|
},
|
|
92266
92767
|
split: {
|
|
92267
|
-
usage: "repomind split [
|
|
92768
|
+
usage: "repomind split [op\xE7\xF5es]",
|
|
92268
92769
|
description: "Analisa altera\xE7\xF5es staged e divide em commits at\xF4micos.",
|
|
92269
|
-
details: ["Por padr\xE3o analisa apenas altera\xE7\xF5es staged (git add)."],
|
|
92270
92770
|
flags: [
|
|
92271
92771
|
{ name: "--all", description: "Incluir altera\xE7\xF5es unstaged + untracked" },
|
|
92272
92772
|
{
|
|
92273
92773
|
name: "--instructions [texto]",
|
|
92274
|
-
description:
|
|
92774
|
+
description: "Instru\xE7\xE3o pontual para esta gera\xE7\xE3o. Sem texto abre editor interativo."
|
|
92275
92775
|
},
|
|
92276
92776
|
{
|
|
92277
92777
|
name: "--no-verify",
|
|
@@ -92283,6 +92783,11 @@ var COMMAND_HELP = {
|
|
|
92283
92783
|
description: "Exibir detalhes de erro"
|
|
92284
92784
|
},
|
|
92285
92785
|
{ name: "--help", alias: "-h", description: "Exibir esta ajuda" }
|
|
92786
|
+
],
|
|
92787
|
+
examples: [
|
|
92788
|
+
"git add .",
|
|
92789
|
+
"repomind split",
|
|
92790
|
+
"repomind split --all # inclui unstaged"
|
|
92286
92791
|
]
|
|
92287
92792
|
},
|
|
92288
92793
|
pr: {
|
|
@@ -92296,37 +92801,59 @@ var COMMAND_HELP = {
|
|
|
92296
92801
|
description: "Exibir detalhes de erro"
|
|
92297
92802
|
},
|
|
92298
92803
|
{ name: "--help", alias: "-h", description: "Exibir esta ajuda" }
|
|
92804
|
+
],
|
|
92805
|
+
examples: [
|
|
92806
|
+
"git checkout -b feat/nova-feature",
|
|
92807
|
+
"# faz commits...",
|
|
92808
|
+
"repomind pr"
|
|
92299
92809
|
]
|
|
92300
92810
|
},
|
|
92301
92811
|
login: {
|
|
92302
92812
|
usage: "repomind login [--token <token>]",
|
|
92303
92813
|
description: "Autenticar com sua conta RepoMind.",
|
|
92304
92814
|
details: [
|
|
92305
|
-
"Sem flags: usa Device Flow (
|
|
92815
|
+
"Sem flags: usa Device Flow (c\xF3digo + browser).",
|
|
92306
92816
|
"Com --token: autentica com um Personal Access Token."
|
|
92307
92817
|
],
|
|
92308
92818
|
flags: [
|
|
92309
|
-
{
|
|
92310
|
-
|
|
92819
|
+
{
|
|
92820
|
+
name: "--token <token>",
|
|
92821
|
+
description: "Autenticar com Personal Access Token"
|
|
92822
|
+
}
|
|
92823
|
+
],
|
|
92824
|
+
examples: ["repomind login", "repomind login --token rm_pat_xxxx"]
|
|
92311
92825
|
},
|
|
92312
92826
|
logout: {
|
|
92313
92827
|
usage: "repomind logout",
|
|
92314
|
-
description: "Encerrar sess\xE3o atual e remover token local."
|
|
92828
|
+
description: "Encerrar sess\xE3o atual e remover token local.",
|
|
92829
|
+
examples: ["repomind logout"]
|
|
92315
92830
|
},
|
|
92316
92831
|
whoami: {
|
|
92317
92832
|
usage: "repomind whoami",
|
|
92318
|
-
description: "Exibir o usu\xE1rio autenticado atualmente."
|
|
92833
|
+
description: "Exibir o usu\xE1rio autenticado atualmente.",
|
|
92834
|
+
examples: ["repomind whoami"]
|
|
92835
|
+
},
|
|
92836
|
+
status: {
|
|
92837
|
+
usage: "repomind status",
|
|
92838
|
+
description: "Exibir status da conta: plano, uso de commits e per\xEDodo atual.",
|
|
92839
|
+
examples: ["repomind status"]
|
|
92840
|
+
},
|
|
92841
|
+
dashboard: {
|
|
92842
|
+
usage: "repomind dashboard",
|
|
92843
|
+
description: "Abrir o dashboard RepoMind no navegador.",
|
|
92844
|
+
examples: ["repomind dashboard"]
|
|
92319
92845
|
}
|
|
92320
92846
|
};
|
|
92321
92847
|
if (wantsHelp && command && COMMAND_HELP[command]) {
|
|
92322
92848
|
const def = COMMAND_HELP[command];
|
|
92323
92849
|
const { waitUntilExit } = render_default(
|
|
92324
|
-
|
|
92850
|
+
import_react83.default.createElement(CommandHelp, {
|
|
92325
92851
|
command,
|
|
92326
92852
|
usage: def.usage,
|
|
92327
92853
|
description: def.description,
|
|
92328
92854
|
details: def.details,
|
|
92329
|
-
flags: def.flags
|
|
92855
|
+
flags: def.flags,
|
|
92856
|
+
examples: def.examples
|
|
92330
92857
|
})
|
|
92331
92858
|
);
|
|
92332
92859
|
setTimeout(() => process.exit(0), 50);
|
|
@@ -92354,6 +92881,12 @@ switch (command) {
|
|
|
92354
92881
|
case "pr":
|
|
92355
92882
|
run(prCommand);
|
|
92356
92883
|
break;
|
|
92884
|
+
case "dashboard":
|
|
92885
|
+
run(dashboardCommand);
|
|
92886
|
+
break;
|
|
92887
|
+
case "status":
|
|
92888
|
+
run(statusCommand);
|
|
92889
|
+
break;
|
|
92357
92890
|
default:
|
|
92358
92891
|
run(helpCommand);
|
|
92359
92892
|
break;
|