@protolabsai/proto 0.26.22 → 0.26.24
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/cli.js +324 -558
- package/locales/en.js +21 -50
- package/package.json +2 -2
package/cli.js
CHANGED
|
@@ -9126,7 +9126,7 @@ var require_retry_handler = __commonJS({
|
|
|
9126
9126
|
const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout);
|
|
9127
9127
|
setTimeout(() => cb(null), retryTimeout);
|
|
9128
9128
|
}
|
|
9129
|
-
onHeaders(statusCode, rawHeaders, resume,
|
|
9129
|
+
onHeaders(statusCode, rawHeaders, resume, statusMessage2) {
|
|
9130
9130
|
const headers = parseHeaders(rawHeaders);
|
|
9131
9131
|
this.retryCount += 1;
|
|
9132
9132
|
if (statusCode >= 300) {
|
|
@@ -9135,7 +9135,7 @@ var require_retry_handler = __commonJS({
|
|
|
9135
9135
|
statusCode,
|
|
9136
9136
|
rawHeaders,
|
|
9137
9137
|
resume,
|
|
9138
|
-
|
|
9138
|
+
statusMessage2
|
|
9139
9139
|
);
|
|
9140
9140
|
} else {
|
|
9141
9141
|
this.abort(
|
|
@@ -9193,7 +9193,7 @@ var require_retry_handler = __commonJS({
|
|
|
9193
9193
|
statusCode,
|
|
9194
9194
|
rawHeaders,
|
|
9195
9195
|
resume,
|
|
9196
|
-
|
|
9196
|
+
statusMessage2
|
|
9197
9197
|
);
|
|
9198
9198
|
}
|
|
9199
9199
|
const { start: start2, size, end = size - 1 } = range;
|
|
@@ -9223,7 +9223,7 @@ var require_retry_handler = __commonJS({
|
|
|
9223
9223
|
statusCode,
|
|
9224
9224
|
rawHeaders,
|
|
9225
9225
|
resume,
|
|
9226
|
-
|
|
9226
|
+
statusMessage2
|
|
9227
9227
|
);
|
|
9228
9228
|
}
|
|
9229
9229
|
const err2 = new RequestRetryError("Request failed", statusCode, {
|
|
@@ -9644,7 +9644,7 @@ var require_util3 = __commonJS({
|
|
|
9644
9644
|
} = require_errors();
|
|
9645
9645
|
var { chunksDecode } = require_readable();
|
|
9646
9646
|
var CHUNK_LIMIT = 128 * 1024;
|
|
9647
|
-
async function getResolveErrorBodyCallback({ callback, body: body2, contentType, statusCode, statusMessage:
|
|
9647
|
+
async function getResolveErrorBodyCallback({ callback, body: body2, contentType, statusCode, statusMessage: statusMessage2, headers }) {
|
|
9648
9648
|
assert4(body2);
|
|
9649
9649
|
let chunks = [];
|
|
9650
9650
|
let length = 0;
|
|
@@ -9662,7 +9662,7 @@ var require_util3 = __commonJS({
|
|
|
9662
9662
|
chunks = [];
|
|
9663
9663
|
length = 0;
|
|
9664
9664
|
}
|
|
9665
|
-
const message = `Response status code ${statusCode}${
|
|
9665
|
+
const message = `Response status code ${statusCode}${statusMessage2 ? `: ${statusMessage2}` : ""}`;
|
|
9666
9666
|
if (statusCode === 204 || !contentType || !length) {
|
|
9667
9667
|
queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)));
|
|
9668
9668
|
return;
|
|
@@ -9789,7 +9789,7 @@ var require_api_request = __commonJS({
|
|
|
9789
9789
|
this.abort = abort2;
|
|
9790
9790
|
this.context = context2;
|
|
9791
9791
|
}
|
|
9792
|
-
onHeaders(statusCode, rawHeaders, resume,
|
|
9792
|
+
onHeaders(statusCode, rawHeaders, resume, statusMessage2) {
|
|
9793
9793
|
const { callback, opaque, abort: abort2, context: context2, responseHeaders, highWaterMark } = this;
|
|
9794
9794
|
const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders);
|
|
9795
9795
|
if (statusCode < 200) {
|
|
@@ -9818,7 +9818,7 @@ var require_api_request = __commonJS({
|
|
|
9818
9818
|
this.runInAsyncScope(
|
|
9819
9819
|
getResolveErrorBodyCallback,
|
|
9820
9820
|
null,
|
|
9821
|
-
{ callback, body: res, contentType, statusCode, statusMessage:
|
|
9821
|
+
{ callback, body: res, contentType, statusCode, statusMessage: statusMessage2, headers }
|
|
9822
9822
|
);
|
|
9823
9823
|
} else {
|
|
9824
9824
|
this.runInAsyncScope(callback, null, null, {
|
|
@@ -10014,7 +10014,7 @@ var require_api_stream = __commonJS({
|
|
|
10014
10014
|
this.abort = abort2;
|
|
10015
10015
|
this.context = context2;
|
|
10016
10016
|
}
|
|
10017
|
-
onHeaders(statusCode, rawHeaders, resume,
|
|
10017
|
+
onHeaders(statusCode, rawHeaders, resume, statusMessage2) {
|
|
10018
10018
|
const { factory, opaque, context: context2, callback, responseHeaders } = this;
|
|
10019
10019
|
const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders);
|
|
10020
10020
|
if (statusCode < 200) {
|
|
@@ -10033,7 +10033,7 @@ var require_api_stream = __commonJS({
|
|
|
10033
10033
|
this.runInAsyncScope(
|
|
10034
10034
|
getResolveErrorBodyCallback,
|
|
10035
10035
|
null,
|
|
10036
|
-
{ callback, body: res, contentType, statusCode, statusMessage:
|
|
10036
|
+
{ callback, body: res, contentType, statusCode, statusMessage: statusMessage2, headers }
|
|
10037
10037
|
);
|
|
10038
10038
|
} else {
|
|
10039
10039
|
if (factory === null) {
|
|
@@ -11576,7 +11576,7 @@ var require_dump = __commonJS({
|
|
|
11576
11576
|
this.#reason = reason;
|
|
11577
11577
|
}
|
|
11578
11578
|
// TODO: will require adjustment after new hooks are out
|
|
11579
|
-
onHeaders(statusCode, rawHeaders, resume,
|
|
11579
|
+
onHeaders(statusCode, rawHeaders, resume, statusMessage2) {
|
|
11580
11580
|
const headers = util3.parseHeaders(rawHeaders);
|
|
11581
11581
|
const contentLength = headers["content-length"];
|
|
11582
11582
|
if (contentLength != null && contentLength > this.#maxSize) {
|
|
@@ -11591,7 +11591,7 @@ var require_dump = __commonJS({
|
|
|
11591
11591
|
statusCode,
|
|
11592
11592
|
rawHeaders,
|
|
11593
11593
|
resume,
|
|
11594
|
-
|
|
11594
|
+
statusMessage2
|
|
11595
11595
|
);
|
|
11596
11596
|
}
|
|
11597
11597
|
onError(err2) {
|
|
@@ -142216,7 +142216,7 @@ var require_utils12 = __commonJS({
|
|
|
142216
142216
|
return;
|
|
142217
142217
|
}, "getSyntheticType");
|
|
142218
142218
|
var getOutgoingRequestAttributesOnResponse = /* @__PURE__ */ __name((response, semconvStability) => {
|
|
142219
|
-
const { statusCode, statusMessage:
|
|
142219
|
+
const { statusCode, statusMessage: statusMessage2, httpVersion, socket } = response;
|
|
142220
142220
|
const oldAttributes = {};
|
|
142221
142221
|
const stableAttributes = {};
|
|
142222
142222
|
if (statusCode != null) {
|
|
@@ -142233,7 +142233,7 @@ var require_utils12 = __commonJS({
|
|
|
142233
142233
|
(0, exports2.setResponseContentLengthAttribute)(response, oldAttributes);
|
|
142234
142234
|
if (statusCode) {
|
|
142235
142235
|
oldAttributes[semconv_1.ATTR_HTTP_STATUS_CODE] = statusCode;
|
|
142236
|
-
oldAttributes[AttributeNames_1.AttributeNames.HTTP_STATUS_TEXT] = (
|
|
142236
|
+
oldAttributes[AttributeNames_1.AttributeNames.HTTP_STATUS_TEXT] = (statusMessage2 || "").toUpperCase();
|
|
142237
142237
|
}
|
|
142238
142238
|
(0, exports2.setAttributesFromHttpKind)(httpVersion, oldAttributes);
|
|
142239
142239
|
switch (semconvStability) {
|
|
@@ -142461,7 +142461,7 @@ var require_utils12 = __commonJS({
|
|
|
142461
142461
|
exports2.getIncomingRequestMetricAttributes = getIncomingRequestMetricAttributes;
|
|
142462
142462
|
var getIncomingRequestAttributesOnResponse = /* @__PURE__ */ __name((request4, response, semconvStability) => {
|
|
142463
142463
|
const { socket } = request4;
|
|
142464
|
-
const { statusCode, statusMessage:
|
|
142464
|
+
const { statusCode, statusMessage: statusMessage2 } = response;
|
|
142465
142465
|
const newAttributes = {
|
|
142466
142466
|
[semantic_conventions_1.ATTR_HTTP_RESPONSE_STATUS_CODE]: statusCode
|
|
142467
142467
|
};
|
|
@@ -142475,7 +142475,7 @@ var require_utils12 = __commonJS({
|
|
|
142475
142475
|
oldAttributes[semconv_1.ATTR_NET_PEER_PORT] = remotePort;
|
|
142476
142476
|
}
|
|
142477
142477
|
oldAttributes[semconv_1.ATTR_HTTP_STATUS_CODE] = statusCode;
|
|
142478
|
-
oldAttributes[AttributeNames_1.AttributeNames.HTTP_STATUS_TEXT] = (
|
|
142478
|
+
oldAttributes[AttributeNames_1.AttributeNames.HTTP_STATUS_TEXT] = (statusMessage2 || "").toUpperCase();
|
|
142479
142479
|
if (rpcMetadata?.type === core_1.RPCType.HTTP && rpcMetadata.route !== void 0) {
|
|
142480
142480
|
oldAttributes[semantic_conventions_1.ATTR_HTTP_ROUTE] = rpcMetadata.route;
|
|
142481
142481
|
newAttributes[semantic_conventions_1.ATTR_HTTP_ROUTE] = rpcMetadata.route;
|
|
@@ -171130,7 +171130,7 @@ __export(geminiContentGenerator_exports, {
|
|
|
171130
171130
|
createGeminiContentGenerator: () => createGeminiContentGenerator
|
|
171131
171131
|
});
|
|
171132
171132
|
function createGeminiContentGenerator(config2, gcConfig) {
|
|
171133
|
-
const version2 = "0.26.
|
|
171133
|
+
const version2 = "0.26.24";
|
|
171134
171134
|
const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
|
|
171135
171135
|
const baseHeaders = {
|
|
171136
171136
|
"User-Agent": userAgent2
|
|
@@ -173878,7 +173878,7 @@ var init_turn = __esm({
|
|
|
173878
173878
|
init_errors();
|
|
173879
173879
|
init_thoughtUtils();
|
|
173880
173880
|
init_streamStall();
|
|
173881
|
-
STREAM_STALL_TIMEOUT_MS = parseInt(process.env["PROTO_STREAM_STALL_TIMEOUT_MS"] ?? "
|
|
173881
|
+
STREAM_STALL_TIMEOUT_MS = parseInt(process.env["PROTO_STREAM_STALL_TIMEOUT_MS"] ?? "300000", 10);
|
|
173882
173882
|
(function(GeminiEventType2) {
|
|
173883
173883
|
GeminiEventType2["Content"] = "content";
|
|
173884
173884
|
GeminiEventType2["ToolCallRequest"] = "tool_call_request";
|
|
@@ -198631,8 +198631,6 @@ var init_client2 = __esm({
|
|
|
198631
198631
|
init_ideContext();
|
|
198632
198632
|
init_types10();
|
|
198633
198633
|
init_completion_checker();
|
|
198634
|
-
init_builtin_agents();
|
|
198635
|
-
init_agent_headless();
|
|
198636
198634
|
debugLogger39 = createDebugLogger("CLIENT");
|
|
198637
198635
|
MAX_TURNS = 100;
|
|
198638
198636
|
(function(SendMessageType2) {
|
|
@@ -198642,7 +198640,7 @@ var init_client2 = __esm({
|
|
|
198642
198640
|
SendMessageType2["Hook"] = "hook";
|
|
198643
198641
|
SendMessageType2["Cron"] = "cron";
|
|
198644
198642
|
})(SendMessageType || (SendMessageType = {}));
|
|
198645
|
-
GeminiClient = class
|
|
198643
|
+
GeminiClient = class {
|
|
198646
198644
|
static {
|
|
198647
198645
|
__name(this, "GeminiClient");
|
|
198648
198646
|
}
|
|
@@ -198658,12 +198656,6 @@ var init_client2 = __esm({
|
|
|
198658
198656
|
* being forced and did it fail?
|
|
198659
198657
|
*/
|
|
198660
198658
|
hasFailedCompressionAttempt = false;
|
|
198661
|
-
/**
|
|
198662
|
-
* Tracks how many times the verification agent has been invoked
|
|
198663
|
-
* during this session to prevent infinite verification loops.
|
|
198664
|
-
*/
|
|
198665
|
-
verificationAttempts = 0;
|
|
198666
|
-
static MAX_VERIFICATION_ATTEMPTS = 3;
|
|
198667
198659
|
/**
|
|
198668
198660
|
* Maps promptId → history length captured just before the user message for
|
|
198669
198661
|
* that turn is added. Used by trimHistoryToCheckpoint() to restore history
|
|
@@ -199207,51 +199199,6 @@ Please address these issues before finishing.`;
|
|
|
199207
199199
|
return completionResult;
|
|
199208
199200
|
}
|
|
199209
199201
|
}
|
|
199210
|
-
if (!turn.pendingToolCalls.length && signal && !signal.aborted && messageType !== SendMessageType.Hook && this.verificationAttempts < _GeminiClient.MAX_VERIFICATION_ATTEMPTS) {
|
|
199211
|
-
const verifyConfig = BuiltinAgentRegistry.getBuiltinAgent("verify");
|
|
199212
|
-
if (verifyConfig) {
|
|
199213
|
-
this.verificationAttempts++;
|
|
199214
|
-
try {
|
|
199215
|
-
const subagentManager = this.config.getSubagentManager();
|
|
199216
|
-
const verifyAgent = await subagentManager.createAgentHeadless(verifyConfig, this.config);
|
|
199217
|
-
const history2 = this.getHistory();
|
|
199218
|
-
const lastModelMessage = history2.filter((msg) => msg.role === "model").pop();
|
|
199219
|
-
const responseText = lastModelMessage?.parts?.filter((p2) => "text" in p2).map((p2) => p2.text).join("") || "[no response text]";
|
|
199220
|
-
const verifyPrompt = `Review the following assistant response for completeness and correctness. Check that all requested work was done, there are no obvious errors, and no files were left in a broken state.
|
|
199221
|
-
|
|
199222
|
-
Assistant's final response:
|
|
199223
|
-
${responseText}`;
|
|
199224
|
-
const verifyContext = new ContextState();
|
|
199225
|
-
verifyContext.set("task_prompt", verifyPrompt);
|
|
199226
|
-
await verifyAgent.execute(verifyContext, signal);
|
|
199227
|
-
if (!signal.aborted) {
|
|
199228
|
-
const verifyResult = verifyAgent.getFinalText();
|
|
199229
|
-
try {
|
|
199230
|
-
const jsonMatch = verifyResult.match(/\{[\s\S]*"passed"\s*:\s*(true|false)[\s\S]*\}/);
|
|
199231
|
-
if (jsonMatch) {
|
|
199232
|
-
const parsed = JSON.parse(jsonMatch[0]);
|
|
199233
|
-
if (!parsed.passed && parsed.issues && parsed.issues.length > 0) {
|
|
199234
|
-
const issueList = parsed.issues.map((issue2) => `- ${issue2}`).join("\n");
|
|
199235
|
-
const continueReason = `Verification agent found issues that must be addressed before completing:
|
|
199236
|
-
${issueList}
|
|
199237
|
-
|
|
199238
|
-
Please fix these issues now.`;
|
|
199239
|
-
const continueRequest = [{ text: continueReason }];
|
|
199240
|
-
const verifyResult2 = yield* this.sendMessageStream(continueRequest, signal, prompt_id, { type: SendMessageType.Hook }, boundedTurns - 1);
|
|
199241
|
-
if (ownsTurnSpan)
|
|
199242
|
-
endTurnSpan("ok");
|
|
199243
|
-
return verifyResult2;
|
|
199244
|
-
}
|
|
199245
|
-
}
|
|
199246
|
-
} catch {
|
|
199247
|
-
debugLogger39.warn("[Verification] Failed to parse verification agent output, allowing completion");
|
|
199248
|
-
}
|
|
199249
|
-
}
|
|
199250
|
-
} catch (verifyError) {
|
|
199251
|
-
debugLogger39.warn(`[Verification] Verification agent failed, allowing completion: ${verifyError}`);
|
|
199252
|
-
}
|
|
199253
|
-
}
|
|
199254
|
-
}
|
|
199255
199202
|
if (!turn.pendingToolCalls.length && signal && !signal.aborted) {
|
|
199256
199203
|
if (this.config.getSkipNextSpeakerCheck()) {
|
|
199257
199204
|
if (arenaAgentClient) {
|
|
@@ -228167,7 +228114,7 @@ var init_protocol = __esm({
|
|
|
228167
228114
|
getTaskResult: /* @__PURE__ */ __name((taskId) => {
|
|
228168
228115
|
return taskStore.getTaskResult(taskId, sessionId);
|
|
228169
228116
|
}, "getTaskResult"),
|
|
228170
|
-
updateTaskStatus: /* @__PURE__ */ __name(async (taskId, status,
|
|
228117
|
+
updateTaskStatus: /* @__PURE__ */ __name(async (taskId, status, statusMessage2) => {
|
|
228171
228118
|
const task = await taskStore.getTask(taskId, sessionId);
|
|
228172
228119
|
if (!task) {
|
|
228173
228120
|
throw new McpError(ErrorCode.InvalidParams, `Task "${taskId}" not found - it may have been cleaned up`);
|
|
@@ -228175,7 +228122,7 @@ var init_protocol = __esm({
|
|
|
228175
228122
|
if (isTerminal(task.status)) {
|
|
228176
228123
|
throw new McpError(ErrorCode.InvalidParams, `Cannot update task "${taskId}" from terminal status "${task.status}" to "${status}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);
|
|
228177
228124
|
}
|
|
228178
|
-
await taskStore.updateTaskStatus(taskId, status,
|
|
228125
|
+
await taskStore.updateTaskStatus(taskId, status, statusMessage2, sessionId);
|
|
228179
228126
|
const updatedTask = await taskStore.getTask(taskId, sessionId);
|
|
228180
228127
|
if (updatedTask) {
|
|
228181
228128
|
const notification = TaskStatusNotificationSchema.parse({
|
|
@@ -313884,7 +313831,7 @@ var require_backend = __commonJS({
|
|
|
313884
313831
|
});
|
|
313885
313832
|
return a2._currentValue;
|
|
313886
313833
|
}, "useContext"),
|
|
313887
|
-
useEffect: /* @__PURE__ */ __name(function
|
|
313834
|
+
useEffect: /* @__PURE__ */ __name(function useEffect74(a2) {
|
|
313888
313835
|
C3();
|
|
313889
313836
|
x3.push({
|
|
313890
313837
|
primitive: "Effect",
|
|
@@ -313949,7 +313896,7 @@ var require_backend = __commonJS({
|
|
|
313949
313896
|
return [b2, function() {
|
|
313950
313897
|
}];
|
|
313951
313898
|
}, "useReducer"),
|
|
313952
|
-
useRef: /* @__PURE__ */ __name(function
|
|
313899
|
+
useRef: /* @__PURE__ */ __name(function useRef30(a2) {
|
|
313953
313900
|
var b2 = C3();
|
|
313954
313901
|
a2 = null !== b2 ? b2.memoizedState : {
|
|
313955
313902
|
current: a2
|
|
@@ -330812,54 +330759,6 @@ var init_en3 = __esm({
|
|
|
330812
330759
|
"They're heeere",
|
|
330813
330760
|
"Hasta la vista, baby",
|
|
330814
330761
|
"Run, Forrest, run",
|
|
330815
|
-
// Songs
|
|
330816
|
-
"Never gonna give you up",
|
|
330817
|
-
"Living on a prayer",
|
|
330818
|
-
"Wants to know what love is",
|
|
330819
|
-
"Walking on sunshine",
|
|
330820
|
-
"A material girl in a material world",
|
|
330821
|
-
"Just called to say I love you",
|
|
330822
|
-
"Waiting for tonight",
|
|
330823
|
-
"Partying like it's 1999",
|
|
330824
|
-
"Hit me baby one more time",
|
|
330825
|
-
"Bye bye bye",
|
|
330826
|
-
"Too sexy for this code",
|
|
330827
|
-
"Trapped under ice",
|
|
330828
|
-
"Turning Japanese",
|
|
330829
|
-
"Walking like an Egyptian",
|
|
330830
|
-
"Addicted to love",
|
|
330831
|
-
"Running down a dream",
|
|
330832
|
-
"Living la vida loca",
|
|
330833
|
-
"Smooth like butter",
|
|
330834
|
-
"Believes it can fly",
|
|
330835
|
-
"The one that saves you",
|
|
330836
|
-
"Not your stepping stone",
|
|
330837
|
-
"Hungry like the wolf",
|
|
330838
|
-
"Livin' on the edge",
|
|
330839
|
-
"Can't feel its face",
|
|
330840
|
-
"Don't want no scrubs",
|
|
330841
|
-
"Floating down the Liffey",
|
|
330842
|
-
"Losing its religion",
|
|
330843
|
-
"Under pressure",
|
|
330844
|
-
"Should I stay or should I go",
|
|
330845
|
-
"We didn't start the fire",
|
|
330846
|
-
"Don't stop believin'",
|
|
330847
|
-
"Take on me",
|
|
330848
|
-
"Tubthumping",
|
|
330849
|
-
"Africa, blessing the rains",
|
|
330850
|
-
// Observational / Sedaris
|
|
330851
|
-
"An ex tagged me in a photo from 2007",
|
|
330852
|
-
"Translating something rude in a language I don't speak",
|
|
330853
|
-
"Calculating the smallest acceptable tip",
|
|
330854
|
-
"The woman ahead of me is buying eight ice cream sandwiches",
|
|
330855
|
-
"Reading the back of a shampoo bottle for the third time",
|
|
330856
|
-
"Counting the people who have already lapped me",
|
|
330857
|
-
"Wondering if the smell is me",
|
|
330858
|
-
"The neighbor's dog has the same name as my brother",
|
|
330859
|
-
"Trying to find a polite reason to leave",
|
|
330860
|
-
"Pretending I've already eaten",
|
|
330861
|
-
"Watching a stranger pick at their breakfast",
|
|
330862
|
-
"Pretending the question wasn't directed at me",
|
|
330863
330762
|
// Nonsensical / surreal
|
|
330864
330763
|
"Negotiating with the moon",
|
|
330865
330764
|
"Asking the door what year it is",
|
|
@@ -330902,6 +330801,16 @@ var init_en3 = __esm({
|
|
|
330902
330801
|
"Resolving the merge conflict the boring way",
|
|
330903
330802
|
"Pinning the dependency you said wouldn't matter",
|
|
330904
330803
|
"Writing the comment that says what the code already says",
|
|
330804
|
+
"Extracting the function you said was fine inline",
|
|
330805
|
+
"Removing the console.log you called 'temporary'",
|
|
330806
|
+
"Flattening the callback pyramid you were proud of",
|
|
330807
|
+
"Converting the switch statement nobody wanted to touch",
|
|
330808
|
+
"Typing 'any' and feeling nothing",
|
|
330809
|
+
"Splitting the 900-line file into 900-line files",
|
|
330810
|
+
"Closing the tab with the Stack Overflow answer",
|
|
330811
|
+
"Undoing the clever solution that was too clever",
|
|
330812
|
+
"Adding the index you should have added in week one",
|
|
330813
|
+
"Reading the error message this time",
|
|
330905
330814
|
// Tired project manager
|
|
330906
330815
|
"Following up on the ticket you said was almost done",
|
|
330907
330816
|
"Re-opening the ticket you closed prematurely",
|
|
@@ -330944,6 +330853,17 @@ var init_en3 = __esm({
|
|
|
330944
330853
|
"Drafting the reply to 'can we make it more vibrant'",
|
|
330945
330854
|
"Showing GTM the same hex code from three angles",
|
|
330946
330855
|
"Promising the launch banner respects dark mode",
|
|
330856
|
+
"Reconciling the Figma spec with the shipped component",
|
|
330857
|
+
"Nudging the CTA button 4px to the left, per feedback",
|
|
330858
|
+
"Explaining why the font is not Comic Sans, again",
|
|
330859
|
+
"Documenting the component that ships next week",
|
|
330860
|
+
"Finding the brand typeface that's 'almost the same'",
|
|
330861
|
+
"Correcting the corner radius across thirty components",
|
|
330862
|
+
"Translating 'make it pop' into a color stop",
|
|
330863
|
+
"Matching the hover state nobody thought to spec",
|
|
330864
|
+
"Asking which breakpoint is the real breakpoint",
|
|
330865
|
+
"Deciding if this is a variant or a new component",
|
|
330866
|
+
"Writing the accessibility note that won't get read",
|
|
330947
330867
|
// CTO hiding tech debt with toxic positivity
|
|
330948
330868
|
"Celebrating the resilience of our pre-2019 codebase",
|
|
330949
330869
|
"Onboarding the third 'temporary' migration script",
|
|
@@ -366442,7 +366362,7 @@ var require_retry_handler2 = __commonJS({
|
|
|
366442
366362
|
const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout);
|
|
366443
366363
|
setTimeout(() => cb(null), retryTimeout);
|
|
366444
366364
|
}
|
|
366445
|
-
onHeaders(statusCode, rawHeaders, resume,
|
|
366365
|
+
onHeaders(statusCode, rawHeaders, resume, statusMessage2) {
|
|
366446
366366
|
const headers = parseHeaders(rawHeaders);
|
|
366447
366367
|
this.retryCount += 1;
|
|
366448
366368
|
if (statusCode >= 300) {
|
|
@@ -366451,7 +366371,7 @@ var require_retry_handler2 = __commonJS({
|
|
|
366451
366371
|
statusCode,
|
|
366452
366372
|
rawHeaders,
|
|
366453
366373
|
resume,
|
|
366454
|
-
|
|
366374
|
+
statusMessage2
|
|
366455
366375
|
);
|
|
366456
366376
|
} else {
|
|
366457
366377
|
this.abort(
|
|
@@ -366509,7 +366429,7 @@ var require_retry_handler2 = __commonJS({
|
|
|
366509
366429
|
statusCode,
|
|
366510
366430
|
rawHeaders,
|
|
366511
366431
|
resume,
|
|
366512
|
-
|
|
366432
|
+
statusMessage2
|
|
366513
366433
|
);
|
|
366514
366434
|
}
|
|
366515
366435
|
const { start: start2, size, end = size - 1 } = range;
|
|
@@ -366539,7 +366459,7 @@ var require_retry_handler2 = __commonJS({
|
|
|
366539
366459
|
statusCode,
|
|
366540
366460
|
rawHeaders,
|
|
366541
366461
|
resume,
|
|
366542
|
-
|
|
366462
|
+
statusMessage2
|
|
366543
366463
|
);
|
|
366544
366464
|
}
|
|
366545
366465
|
const err2 = new RequestRetryError("Request failed", statusCode, {
|
|
@@ -366960,7 +366880,7 @@ var require_util24 = __commonJS({
|
|
|
366960
366880
|
} = require_errors5();
|
|
366961
366881
|
var { chunksDecode } = require_readable2();
|
|
366962
366882
|
var CHUNK_LIMIT = 128 * 1024;
|
|
366963
|
-
async function getResolveErrorBodyCallback({ callback, body: body2, contentType, statusCode, statusMessage:
|
|
366883
|
+
async function getResolveErrorBodyCallback({ callback, body: body2, contentType, statusCode, statusMessage: statusMessage2, headers }) {
|
|
366964
366884
|
assert4(body2);
|
|
366965
366885
|
let chunks = [];
|
|
366966
366886
|
let length = 0;
|
|
@@ -366978,7 +366898,7 @@ var require_util24 = __commonJS({
|
|
|
366978
366898
|
chunks = [];
|
|
366979
366899
|
length = 0;
|
|
366980
366900
|
}
|
|
366981
|
-
const message = `Response status code ${statusCode}${
|
|
366901
|
+
const message = `Response status code ${statusCode}${statusMessage2 ? `: ${statusMessage2}` : ""}`;
|
|
366982
366902
|
if (statusCode === 204 || !contentType || !length) {
|
|
366983
366903
|
queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)));
|
|
366984
366904
|
return;
|
|
@@ -367105,7 +367025,7 @@ var require_api_request2 = __commonJS({
|
|
|
367105
367025
|
this.abort = abort2;
|
|
367106
367026
|
this.context = context2;
|
|
367107
367027
|
}
|
|
367108
|
-
onHeaders(statusCode, rawHeaders, resume,
|
|
367028
|
+
onHeaders(statusCode, rawHeaders, resume, statusMessage2) {
|
|
367109
367029
|
const { callback, opaque, abort: abort2, context: context2, responseHeaders, highWaterMark } = this;
|
|
367110
367030
|
const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders);
|
|
367111
367031
|
if (statusCode < 200) {
|
|
@@ -367134,7 +367054,7 @@ var require_api_request2 = __commonJS({
|
|
|
367134
367054
|
this.runInAsyncScope(
|
|
367135
367055
|
getResolveErrorBodyCallback,
|
|
367136
367056
|
null,
|
|
367137
|
-
{ callback, body: res, contentType, statusCode, statusMessage:
|
|
367057
|
+
{ callback, body: res, contentType, statusCode, statusMessage: statusMessage2, headers }
|
|
367138
367058
|
);
|
|
367139
367059
|
} else {
|
|
367140
367060
|
this.runInAsyncScope(callback, null, null, {
|
|
@@ -367330,7 +367250,7 @@ var require_api_stream2 = __commonJS({
|
|
|
367330
367250
|
this.abort = abort2;
|
|
367331
367251
|
this.context = context2;
|
|
367332
367252
|
}
|
|
367333
|
-
onHeaders(statusCode, rawHeaders, resume,
|
|
367253
|
+
onHeaders(statusCode, rawHeaders, resume, statusMessage2) {
|
|
367334
367254
|
const { factory, opaque, context: context2, callback, responseHeaders } = this;
|
|
367335
367255
|
const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders);
|
|
367336
367256
|
if (statusCode < 200) {
|
|
@@ -367349,7 +367269,7 @@ var require_api_stream2 = __commonJS({
|
|
|
367349
367269
|
this.runInAsyncScope(
|
|
367350
367270
|
getResolveErrorBodyCallback,
|
|
367351
367271
|
null,
|
|
367352
|
-
{ callback, body: res, contentType, statusCode, statusMessage:
|
|
367272
|
+
{ callback, body: res, contentType, statusCode, statusMessage: statusMessage2, headers }
|
|
367353
367273
|
);
|
|
367354
367274
|
} else {
|
|
367355
367275
|
if (factory === null) {
|
|
@@ -368892,7 +368812,7 @@ var require_dump2 = __commonJS({
|
|
|
368892
368812
|
this.#reason = reason;
|
|
368893
368813
|
}
|
|
368894
368814
|
// TODO: will require adjustment after new hooks are out
|
|
368895
|
-
onHeaders(statusCode, rawHeaders, resume,
|
|
368815
|
+
onHeaders(statusCode, rawHeaders, resume, statusMessage2) {
|
|
368896
368816
|
const headers = util3.parseHeaders(rawHeaders);
|
|
368897
368817
|
const contentLength = headers["content-length"];
|
|
368898
368818
|
if (contentLength != null && contentLength > this.#maxSize) {
|
|
@@ -368907,7 +368827,7 @@ var require_dump2 = __commonJS({
|
|
|
368907
368827
|
statusCode,
|
|
368908
368828
|
rawHeaders,
|
|
368909
368829
|
resume,
|
|
368910
|
-
|
|
368830
|
+
statusMessage2
|
|
368911
368831
|
);
|
|
368912
368832
|
}
|
|
368913
368833
|
onError(err2) {
|
|
@@ -404711,7 +404631,7 @@ var measureElement = /* @__PURE__ */ __name((node) => ({
|
|
|
404711
404631
|
var measure_element_default = measureElement;
|
|
404712
404632
|
|
|
404713
404633
|
// packages/cli/src/gemini.tsx
|
|
404714
|
-
var
|
|
404634
|
+
var import_react178 = __toESM(require_react(), 1);
|
|
404715
404635
|
import dns2 from "node:dns";
|
|
404716
404636
|
import os50 from "node:os";
|
|
404717
404637
|
import { basename as basename32 } from "node:path";
|
|
@@ -407279,44 +407199,6 @@ var SETTINGS_SCHEMA = {
|
|
|
407279
407199
|
}
|
|
407280
407200
|
}
|
|
407281
407201
|
},
|
|
407282
|
-
recap: {
|
|
407283
|
-
type: "object",
|
|
407284
|
-
label: "Recap",
|
|
407285
|
-
category: "Recap",
|
|
407286
|
-
requiresRestart: false,
|
|
407287
|
-
default: {},
|
|
407288
|
-
description: 'After a long agent turn, append a short "where we left off" card to the transcript.',
|
|
407289
|
-
showInDialog: false,
|
|
407290
|
-
properties: {
|
|
407291
|
-
enabled: {
|
|
407292
|
-
type: "boolean",
|
|
407293
|
-
label: "Recap Enabled",
|
|
407294
|
-
category: "Recap",
|
|
407295
|
-
requiresRestart: false,
|
|
407296
|
-
default: true,
|
|
407297
|
-
description: "When enabled, a 1-3 sentence recap is appended after agent turns that exceed thresholdSeconds or thresholdToolCalls. Toggle with /recap enable|disable.",
|
|
407298
|
-
showInDialog: true
|
|
407299
|
-
},
|
|
407300
|
-
thresholdSeconds: {
|
|
407301
|
-
type: "number",
|
|
407302
|
-
label: "Recap Duration Threshold (seconds)",
|
|
407303
|
-
category: "Recap",
|
|
407304
|
-
requiresRestart: false,
|
|
407305
|
-
default: 300,
|
|
407306
|
-
description: "Minimum agent-turn wall-clock duration (seconds) before a recap fires.",
|
|
407307
|
-
showInDialog: true
|
|
407308
|
-
},
|
|
407309
|
-
thresholdToolCalls: {
|
|
407310
|
-
type: "number",
|
|
407311
|
-
label: "Recap Tool-Call Threshold",
|
|
407312
|
-
category: "Recap",
|
|
407313
|
-
requiresRestart: false,
|
|
407314
|
-
default: 15,
|
|
407315
|
-
description: "Minimum tool-call count in a single turn before a recap fires.",
|
|
407316
|
-
showInDialog: true
|
|
407317
|
-
}
|
|
407318
|
-
}
|
|
407319
|
-
},
|
|
407320
407202
|
insight: {
|
|
407321
407203
|
type: "object",
|
|
407322
407204
|
label: "Insight",
|
|
@@ -417044,7 +416926,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
417044
416926
|
// packages/cli/src/utils/version.ts
|
|
417045
416927
|
async function getCliVersion() {
|
|
417046
416928
|
const pkgJson = await getPackageJson();
|
|
417047
|
-
return "0.26.
|
|
416929
|
+
return "0.26.24";
|
|
417048
416930
|
}
|
|
417049
416931
|
__name(getCliVersion, "getCliVersion");
|
|
417050
416932
|
|
|
@@ -419991,7 +419873,7 @@ var Protocol2 = class {
|
|
|
419991
419873
|
getTaskResult: /* @__PURE__ */ __name((taskId) => {
|
|
419992
419874
|
return taskStore.getTaskResult(taskId, sessionId);
|
|
419993
419875
|
}, "getTaskResult"),
|
|
419994
|
-
updateTaskStatus: /* @__PURE__ */ __name(async (taskId, status,
|
|
419876
|
+
updateTaskStatus: /* @__PURE__ */ __name(async (taskId, status, statusMessage2) => {
|
|
419995
419877
|
const task = await taskStore.getTask(taskId, sessionId);
|
|
419996
419878
|
if (!task) {
|
|
419997
419879
|
throw new McpError2(ErrorCode2.InvalidParams, `Task "${taskId}" not found - it may have been cleaned up`);
|
|
@@ -419999,7 +419881,7 @@ var Protocol2 = class {
|
|
|
419999
419881
|
if (isTerminal2(task.status)) {
|
|
420000
419882
|
throw new McpError2(ErrorCode2.InvalidParams, `Cannot update task "${taskId}" from terminal status "${task.status}" to "${status}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);
|
|
420001
419883
|
}
|
|
420002
|
-
await taskStore.updateTaskStatus(taskId, status,
|
|
419884
|
+
await taskStore.updateTaskStatus(taskId, status, statusMessage2, sessionId);
|
|
420003
419885
|
const updatedTask = await taskStore.getTask(taskId, sessionId);
|
|
420004
419886
|
if (updatedTask) {
|
|
420005
419887
|
const notification = TaskStatusNotificationSchema2.parse({
|
|
@@ -424816,7 +424698,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
424816
424698
|
|
|
424817
424699
|
// packages/cli/src/generated/git-commit.ts
|
|
424818
424700
|
init_esbuild_shims();
|
|
424819
|
-
var GIT_COMMIT_INFO = "
|
|
424701
|
+
var GIT_COMMIT_INFO = "50a701200";
|
|
424820
424702
|
|
|
424821
424703
|
// packages/cli/src/utils/systemInfo.ts
|
|
424822
424704
|
async function getNpmVersion() {
|
|
@@ -433626,59 +433508,50 @@ var voiceCommand = {
|
|
|
433626
433508
|
|
|
433627
433509
|
// packages/cli/src/ui/commands/recapCommand.ts
|
|
433628
433510
|
init_esbuild_shims();
|
|
433629
|
-
|
|
433630
|
-
var DEFAULT_THRESHOLD_TOOL_CALLS = 15;
|
|
433631
|
-
function statusMessage2(context2) {
|
|
433632
|
-
const merged = context2.services.settings.merged;
|
|
433633
|
-
const enabled = merged.recap?.enabled ?? true;
|
|
433634
|
-
const seconds = merged.recap?.thresholdSeconds ?? DEFAULT_THRESHOLD_SECONDS;
|
|
433635
|
-
const toolCalls = merged.recap?.thresholdToolCalls ?? DEFAULT_THRESHOLD_TOOL_CALLS;
|
|
433636
|
-
return {
|
|
433637
|
-
type: "message",
|
|
433638
|
-
messageType: "info",
|
|
433639
|
-
content: [
|
|
433640
|
-
`Recap: ${enabled ? "enabled" : "disabled"}`,
|
|
433641
|
-
`Duration threshold: ${seconds}s`,
|
|
433642
|
-
`Tool-call threshold: ${toolCalls}`,
|
|
433643
|
-
enabled ? 'A "where we left off" card will be appended after long agent turns.' : "Run /recap enable to turn it back on."
|
|
433644
|
-
].join("\n")
|
|
433645
|
-
};
|
|
433646
|
-
}
|
|
433647
|
-
__name(statusMessage2, "statusMessage");
|
|
433648
|
-
function setEnabled2(context2, value) {
|
|
433649
|
-
context2.services.settings.setValue("User" /* User */, "recap.enabled", value);
|
|
433650
|
-
return {
|
|
433651
|
-
type: "message",
|
|
433652
|
-
messageType: "info",
|
|
433653
|
-
content: value ? 'Recap enabled. Long-running turns will produce a "where we left off" card.' : "Recap disabled."
|
|
433654
|
-
};
|
|
433655
|
-
}
|
|
433656
|
-
__name(setEnabled2, "setEnabled");
|
|
433511
|
+
init_dist4();
|
|
433657
433512
|
var recapCommand = {
|
|
433658
433513
|
name: "recap",
|
|
433659
|
-
description:
|
|
433514
|
+
description: 'Print a short "where we left off" card summarizing the recent conversation.',
|
|
433660
433515
|
kind: "built-in" /* BUILT_IN */,
|
|
433661
|
-
|
|
433662
|
-
|
|
433663
|
-
|
|
433664
|
-
|
|
433665
|
-
|
|
433666
|
-
|
|
433667
|
-
|
|
433668
|
-
|
|
433669
|
-
|
|
433670
|
-
description: "Enable the long-turn recap card",
|
|
433671
|
-
kind: "built-in" /* BUILT_IN */,
|
|
433672
|
-
action: /* @__PURE__ */ __name((context2) => setEnabled2(context2, true), "action")
|
|
433673
|
-
},
|
|
433674
|
-
{
|
|
433675
|
-
name: "disable",
|
|
433676
|
-
description: "Disable the long-turn recap card",
|
|
433677
|
-
kind: "built-in" /* BUILT_IN */,
|
|
433678
|
-
action: /* @__PURE__ */ __name((context2) => setEnabled2(context2, false), "action")
|
|
433516
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
433517
|
+
const config2 = context2.services.config;
|
|
433518
|
+
const geminiClient = config2?.getGeminiClient();
|
|
433519
|
+
if (!config2 || !geminiClient) {
|
|
433520
|
+
return {
|
|
433521
|
+
type: "message",
|
|
433522
|
+
messageType: "error",
|
|
433523
|
+
content: "Config not loaded."
|
|
433524
|
+
};
|
|
433679
433525
|
}
|
|
433680
|
-
|
|
433681
|
-
|
|
433526
|
+
const conversation = geminiClient.getHistory?.() ?? [];
|
|
433527
|
+
const hasModel = conversation.some((c4) => c4.role === "model");
|
|
433528
|
+
const hasUser = conversation.some((c4) => c4.role === "user");
|
|
433529
|
+
if (!hasModel || !hasUser) {
|
|
433530
|
+
return {
|
|
433531
|
+
type: "message",
|
|
433532
|
+
messageType: "info",
|
|
433533
|
+
content: "No conversation to recap yet."
|
|
433534
|
+
};
|
|
433535
|
+
}
|
|
433536
|
+
const controller = new AbortController();
|
|
433537
|
+
const onUpstreamAbort = /* @__PURE__ */ __name(() => controller.abort(), "onUpstreamAbort");
|
|
433538
|
+
context2.abortSignal?.addEventListener("abort", onUpstreamAbort);
|
|
433539
|
+
try {
|
|
433540
|
+
const text = await generateRecap(config2, conversation, controller.signal);
|
|
433541
|
+
if (controller.signal.aborted) return void 0;
|
|
433542
|
+
if (!text) {
|
|
433543
|
+
return {
|
|
433544
|
+
type: "message",
|
|
433545
|
+
messageType: "info",
|
|
433546
|
+
content: "Recap returned no content."
|
|
433547
|
+
};
|
|
433548
|
+
}
|
|
433549
|
+
context2.ui.addItem({ type: "recap" /* RECAP */, text }, Date.now());
|
|
433550
|
+
return void 0;
|
|
433551
|
+
} finally {
|
|
433552
|
+
context2.abortSignal?.removeEventListener("abort", onUpstreamAbort);
|
|
433553
|
+
}
|
|
433554
|
+
}, "action")
|
|
433682
433555
|
};
|
|
433683
433556
|
|
|
433684
433557
|
// packages/cli/src/ui/commands/bgCommand.ts
|
|
@@ -438764,7 +438637,7 @@ __name(runNonInteractiveStreamJson, "runNonInteractiveStreamJson");
|
|
|
438764
438637
|
|
|
438765
438638
|
// packages/cli/src/ui/AppContainer.tsx
|
|
438766
438639
|
init_esbuild_shims();
|
|
438767
|
-
var
|
|
438640
|
+
var import_react175 = __toESM(require_react(), 1);
|
|
438768
438641
|
|
|
438769
438642
|
// packages/cli/src/ui/App.tsx
|
|
438770
438643
|
init_esbuild_shims();
|
|
@@ -481689,7 +481562,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
481689
481562
|
case GeminiEventType.UserCancelled:
|
|
481690
481563
|
flushBufferedStreamEvents();
|
|
481691
481564
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
481692
|
-
|
|
481565
|
+
return 1 /* UserCancelled */;
|
|
481693
481566
|
case GeminiEventType.Error:
|
|
481694
481567
|
flushBufferedStreamEvents();
|
|
481695
481568
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
@@ -481757,7 +481630,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
481757
481630
|
discardBufferedStreamEvents();
|
|
481758
481631
|
flushBufferedStreamEventsRef.current.delete(flushBufferedStreamEvents);
|
|
481759
481632
|
}
|
|
481760
|
-
if (toolCallRequests.length > 0) {
|
|
481633
|
+
if (toolCallRequests.length > 0 && !signal.aborted) {
|
|
481761
481634
|
scheduleToolCalls(toolCallRequests, signal);
|
|
481762
481635
|
}
|
|
481763
481636
|
return 0 /* Completed */;
|
|
@@ -482073,6 +481946,15 @@ ${preview}`
|
|
|
482073
481946
|
);
|
|
482074
481947
|
return;
|
|
482075
481948
|
}
|
|
481949
|
+
if (turnCancelledRef.current) {
|
|
481950
|
+
const terminalCallIds = completedToolCallsFromScheduler.filter(
|
|
481951
|
+
(tc) => tc.status === "success" || tc.status === "error" || tc.status === "cancelled"
|
|
481952
|
+
).map((tc) => tc.request.callId);
|
|
481953
|
+
if (terminalCallIds.length > 0) {
|
|
481954
|
+
markToolsAsSubmitted(terminalCallIds);
|
|
481955
|
+
}
|
|
481956
|
+
return;
|
|
481957
|
+
}
|
|
482076
481958
|
const completedAndReadyToSubmitTools = completedToolCallsFromScheduler.filter(
|
|
482077
481959
|
(tc) => {
|
|
482078
481960
|
const isTerminalState = tc.status === "success" || tc.status === "error" || tc.status === "cancelled";
|
|
@@ -482374,101 +482256,9 @@ ${verifyResult}` });
|
|
|
482374
482256
|
};
|
|
482375
482257
|
}, "useGeminiStream");
|
|
482376
482258
|
|
|
482377
|
-
// packages/cli/src/ui/hooks/useRecap.ts
|
|
482378
|
-
init_esbuild_shims();
|
|
482379
|
-
var import_react150 = __toESM(require_react(), 1);
|
|
482380
|
-
init_dist4();
|
|
482381
|
-
function countToolGroupsSince(history, startIndex) {
|
|
482382
|
-
let count = 0;
|
|
482383
|
-
for (let i4 = startIndex; i4 < history.length; i4++) {
|
|
482384
|
-
if (history[i4]?.type === "tool_group") count++;
|
|
482385
|
-
}
|
|
482386
|
-
return count;
|
|
482387
|
-
}
|
|
482388
|
-
__name(countToolGroupsSince, "countToolGroupsSince");
|
|
482389
|
-
function hasRecapSinceLastUserTurn(history) {
|
|
482390
|
-
for (let i4 = history.length - 1; i4 >= 0; i4--) {
|
|
482391
|
-
const item = history[i4];
|
|
482392
|
-
if (!item) continue;
|
|
482393
|
-
if (item.type === "user" /* USER */) return false;
|
|
482394
|
-
if (item.type === "recap") return true;
|
|
482395
|
-
}
|
|
482396
|
-
return false;
|
|
482397
|
-
}
|
|
482398
|
-
__name(hasRecapSinceLastUserTurn, "hasRecapSinceLastUserTurn");
|
|
482399
|
-
function useRecap(opts) {
|
|
482400
|
-
const {
|
|
482401
|
-
config: config2,
|
|
482402
|
-
geminiClient,
|
|
482403
|
-
streamingState,
|
|
482404
|
-
history,
|
|
482405
|
-
addItem,
|
|
482406
|
-
enabled,
|
|
482407
|
-
thresholdSeconds,
|
|
482408
|
-
thresholdToolCalls
|
|
482409
|
-
} = opts;
|
|
482410
|
-
const turnRef = (0, import_react150.useRef)(null);
|
|
482411
|
-
const prevStateRef = (0, import_react150.useRef)(streamingState);
|
|
482412
|
-
const abortRef = (0, import_react150.useRef)(null);
|
|
482413
|
-
(0, import_react150.useEffect)(() => {
|
|
482414
|
-
const prev = prevStateRef.current;
|
|
482415
|
-
prevStateRef.current = streamingState;
|
|
482416
|
-
if (prev === "idle" /* Idle */ && streamingState !== "idle" /* Idle */) {
|
|
482417
|
-
turnRef.current = {
|
|
482418
|
-
startTime: Date.now(),
|
|
482419
|
-
historyLengthAtStart: history.length
|
|
482420
|
-
};
|
|
482421
|
-
return;
|
|
482422
|
-
}
|
|
482423
|
-
if (prev !== "idle" /* Idle */ && streamingState === "idle" /* Idle */) {
|
|
482424
|
-
const turn = turnRef.current;
|
|
482425
|
-
turnRef.current = null;
|
|
482426
|
-
if (!enabled || !config2 || !geminiClient || !turn) return;
|
|
482427
|
-
const durationSec = (Date.now() - turn.startTime) / 1e3;
|
|
482428
|
-
const toolCount = countToolGroupsSince(
|
|
482429
|
-
history,
|
|
482430
|
-
turn.historyLengthAtStart
|
|
482431
|
-
);
|
|
482432
|
-
const longEnough = durationSec > thresholdSeconds || toolCount > thresholdToolCalls;
|
|
482433
|
-
if (!longEnough) return;
|
|
482434
|
-
if (hasRecapSinceLastUserTurn(history)) return;
|
|
482435
|
-
const conversation = geminiClient.getHistory?.() ?? [];
|
|
482436
|
-
const hasModelHistory = conversation.some((c4) => c4.role === "model");
|
|
482437
|
-
const hasUserHistory = conversation.some((c4) => c4.role === "user");
|
|
482438
|
-
if (!hasModelHistory || !hasUserHistory) return;
|
|
482439
|
-
abortRef.current?.abort();
|
|
482440
|
-
const controller = new AbortController();
|
|
482441
|
-
abortRef.current = controller;
|
|
482442
|
-
void generateRecap(config2, conversation, controller.signal).then(
|
|
482443
|
-
(text) => {
|
|
482444
|
-
if (controller.signal.aborted || !text) return;
|
|
482445
|
-
addItem({ type: "recap" /* RECAP */, text }, Date.now());
|
|
482446
|
-
}
|
|
482447
|
-
);
|
|
482448
|
-
}
|
|
482449
|
-
}, [
|
|
482450
|
-
streamingState,
|
|
482451
|
-
history,
|
|
482452
|
-
enabled,
|
|
482453
|
-
thresholdSeconds,
|
|
482454
|
-
thresholdToolCalls,
|
|
482455
|
-
config2,
|
|
482456
|
-
geminiClient,
|
|
482457
|
-
addItem
|
|
482458
|
-
]);
|
|
482459
|
-
(0, import_react150.useEffect)(
|
|
482460
|
-
() => () => {
|
|
482461
|
-
abortRef.current?.abort();
|
|
482462
|
-
abortRef.current = null;
|
|
482463
|
-
},
|
|
482464
|
-
[]
|
|
482465
|
-
);
|
|
482466
|
-
}
|
|
482467
|
-
__name(useRecap, "useRecap");
|
|
482468
|
-
|
|
482469
482259
|
// packages/cli/src/ui/hooks/vim.ts
|
|
482470
482260
|
init_esbuild_shims();
|
|
482471
|
-
var
|
|
482261
|
+
var import_react150 = __toESM(require_react(), 1);
|
|
482472
482262
|
init_dist4();
|
|
482473
482263
|
var DIGIT_MULTIPLIER = 10;
|
|
482474
482264
|
var DEFAULT_COUNT = 1;
|
|
@@ -482533,22 +482323,22 @@ var vimReducer = /* @__PURE__ */ __name((state, action) => {
|
|
|
482533
482323
|
}, "vimReducer");
|
|
482534
482324
|
function useVim(buffer, onSubmit) {
|
|
482535
482325
|
const { vimEnabled, vimMode, setVimMode } = useVimMode();
|
|
482536
|
-
const [state, dispatch] = (0,
|
|
482537
|
-
(0,
|
|
482326
|
+
const [state, dispatch] = (0, import_react150.useReducer)(vimReducer, initialVimState);
|
|
482327
|
+
(0, import_react150.useEffect)(() => {
|
|
482538
482328
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
482539
482329
|
}, [vimMode]);
|
|
482540
|
-
const updateMode = (0,
|
|
482330
|
+
const updateMode = (0, import_react150.useCallback)(
|
|
482541
482331
|
(mode) => {
|
|
482542
482332
|
setVimMode(mode);
|
|
482543
482333
|
dispatch({ type: "SET_MODE", mode });
|
|
482544
482334
|
},
|
|
482545
482335
|
[setVimMode]
|
|
482546
482336
|
);
|
|
482547
|
-
const getCurrentCount = (0,
|
|
482337
|
+
const getCurrentCount = (0, import_react150.useCallback)(
|
|
482548
482338
|
() => state.count || DEFAULT_COUNT,
|
|
482549
482339
|
[state.count]
|
|
482550
482340
|
);
|
|
482551
|
-
const executeCommand = (0,
|
|
482341
|
+
const executeCommand = (0, import_react150.useCallback)(
|
|
482552
482342
|
(cmdType, count) => {
|
|
482553
482343
|
switch (cmdType) {
|
|
482554
482344
|
case CMD_TYPES.DELETE_WORD_FORWARD: {
|
|
@@ -482624,7 +482414,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482624
482414
|
},
|
|
482625
482415
|
[buffer, updateMode]
|
|
482626
482416
|
);
|
|
482627
|
-
const handleInsertModeInput = (0,
|
|
482417
|
+
const handleInsertModeInput = (0, import_react150.useCallback)(
|
|
482628
482418
|
(normalizedKey) => {
|
|
482629
482419
|
if (normalizedKey.name === "escape") {
|
|
482630
482420
|
buffer.vimEscapeInsertMode();
|
|
@@ -482655,7 +482445,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482655
482445
|
},
|
|
482656
482446
|
[buffer, dispatch, updateMode, onSubmit]
|
|
482657
482447
|
);
|
|
482658
|
-
const normalizeKey = (0,
|
|
482448
|
+
const normalizeKey = (0, import_react150.useCallback)(
|
|
482659
482449
|
(key) => ({
|
|
482660
482450
|
name: key.name || "",
|
|
482661
482451
|
sequence: key.sequence || "",
|
|
@@ -482666,7 +482456,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482666
482456
|
}),
|
|
482667
482457
|
[]
|
|
482668
482458
|
);
|
|
482669
|
-
const handleChangeMovement = (0,
|
|
482459
|
+
const handleChangeMovement = (0, import_react150.useCallback)(
|
|
482670
482460
|
(movement) => {
|
|
482671
482461
|
const count = getCurrentCount();
|
|
482672
482462
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -482687,7 +482477,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482687
482477
|
},
|
|
482688
482478
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
482689
482479
|
);
|
|
482690
|
-
const handleOperatorMotion = (0,
|
|
482480
|
+
const handleOperatorMotion = (0, import_react150.useCallback)(
|
|
482691
482481
|
(operator2, motion) => {
|
|
482692
482482
|
const count = getCurrentCount();
|
|
482693
482483
|
const commandMap = {
|
|
@@ -482714,7 +482504,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482714
482504
|
},
|
|
482715
482505
|
[getCurrentCount, executeCommand, dispatch]
|
|
482716
482506
|
);
|
|
482717
|
-
const handleInput = (0,
|
|
482507
|
+
const handleInput = (0, import_react150.useCallback)(
|
|
482718
482508
|
(key) => {
|
|
482719
482509
|
if (!vimEnabled) {
|
|
482720
482510
|
return false;
|
|
@@ -483014,14 +482804,14 @@ __name(useVim, "useVim");
|
|
|
483014
482804
|
|
|
483015
482805
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
483016
482806
|
init_esbuild_shims();
|
|
483017
|
-
var
|
|
482807
|
+
var import_react151 = __toESM(require_react(), 1);
|
|
483018
482808
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
483019
482809
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
483020
482810
|
var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
483021
482811
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
483022
482812
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
483023
482813
|
}, "cleanup");
|
|
483024
|
-
(0,
|
|
482814
|
+
(0, import_react151.useEffect)(() => {
|
|
483025
482815
|
process.stdout.write(`\x1B[?2026h${ENABLE_BRACKETED_PASTE}\x1B[?2026l`);
|
|
483026
482816
|
process.on("exit", cleanup);
|
|
483027
482817
|
process.on("SIGINT", cleanup);
|
|
@@ -483037,7 +482827,7 @@ var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
|
483037
482827
|
|
|
483038
482828
|
// packages/cli/src/ui/hooks/useKeyboardHandling.ts
|
|
483039
482829
|
init_esbuild_shims();
|
|
483040
|
-
var
|
|
482830
|
+
var import_react152 = __toESM(require_react(), 1);
|
|
483041
482831
|
init_dist4();
|
|
483042
482832
|
var CTRL_EXIT_PROMPT_DURATION_MS = 1e3;
|
|
483043
482833
|
function useKeyboardHandling(params) {
|
|
@@ -483060,20 +482850,20 @@ function useKeyboardHandling(params) {
|
|
|
483060
482850
|
debugKeystrokeLogging,
|
|
483061
482851
|
onBackgroundSession
|
|
483062
482852
|
} = params;
|
|
483063
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
483064
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
483065
|
-
const ctrlCTimerRef = (0,
|
|
483066
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
483067
|
-
const ctrlDTimerRef = (0,
|
|
483068
|
-
const [escapePressedOnce, setEscapePressedOnce] = (0,
|
|
483069
|
-
const escapeTimerRef = (0,
|
|
483070
|
-
const dialogsVisibleRef = (0,
|
|
483071
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
483072
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
483073
|
-
const handleEscapePromptChange = (0,
|
|
482853
|
+
const [showToolDescriptions, setShowToolDescriptions] = (0, import_react152.useState)(false);
|
|
482854
|
+
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react152.useState)(false);
|
|
482855
|
+
const ctrlCTimerRef = (0, import_react152.useRef)(null);
|
|
482856
|
+
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0, import_react152.useState)(false);
|
|
482857
|
+
const ctrlDTimerRef = (0, import_react152.useRef)(null);
|
|
482858
|
+
const [escapePressedOnce, setEscapePressedOnce] = (0, import_react152.useState)(false);
|
|
482859
|
+
const escapeTimerRef = (0, import_react152.useRef)(null);
|
|
482860
|
+
const dialogsVisibleRef = (0, import_react152.useRef)(false);
|
|
482861
|
+
const [constrainHeight, setConstrainHeight] = (0, import_react152.useState)(true);
|
|
482862
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react152.useState)(false);
|
|
482863
|
+
const handleEscapePromptChange = (0, import_react152.useCallback)((showPrompt) => {
|
|
483074
482864
|
setShowEscapePrompt(showPrompt);
|
|
483075
482865
|
}, []);
|
|
483076
|
-
const globalKeypressHandlerRef = (0,
|
|
482866
|
+
const globalKeypressHandlerRef = (0, import_react152.useRef)(() => {
|
|
483077
482867
|
});
|
|
483078
482868
|
globalKeypressHandlerRef.current = (key) => {
|
|
483079
482869
|
if (debugKeystrokeLogging) {
|
|
@@ -483183,7 +482973,7 @@ function useKeyboardHandling(params) {
|
|
|
483183
482973
|
return;
|
|
483184
482974
|
}
|
|
483185
482975
|
};
|
|
483186
|
-
const handleGlobalKeypress = (0,
|
|
482976
|
+
const handleGlobalKeypress = (0, import_react152.useCallback)(
|
|
483187
482977
|
(key) => globalKeypressHandlerRef.current(key),
|
|
483188
482978
|
[]
|
|
483189
482979
|
);
|
|
@@ -483208,22 +482998,22 @@ init_esbuild_shims();
|
|
|
483208
482998
|
|
|
483209
482999
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
483210
483000
|
init_esbuild_shims();
|
|
483211
|
-
var
|
|
483001
|
+
var import_react153 = __toESM(require_react(), 1);
|
|
483212
483002
|
var WITTY_LOADING_PHRASES = ["I'm Feeling Lucky"];
|
|
483213
483003
|
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
483214
483004
|
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
483215
|
-
const loadingPhrases = (0,
|
|
483005
|
+
const loadingPhrases = (0, import_react153.useMemo)(() => {
|
|
483216
483006
|
if (customPhrases && customPhrases.length > 0) {
|
|
483217
483007
|
return customPhrases;
|
|
483218
483008
|
}
|
|
483219
483009
|
const translatedPhrases = ta("WITTY_LOADING_PHRASES");
|
|
483220
483010
|
return translatedPhrases.length > 0 ? translatedPhrases : WITTY_LOADING_PHRASES;
|
|
483221
483011
|
}, [customPhrases]);
|
|
483222
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0,
|
|
483012
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react153.useState)(
|
|
483223
483013
|
loadingPhrases[0]
|
|
483224
483014
|
);
|
|
483225
|
-
const phraseIntervalRef = (0,
|
|
483226
|
-
(0,
|
|
483015
|
+
const phraseIntervalRef = (0, import_react153.useRef)(null);
|
|
483016
|
+
(0, import_react153.useEffect)(() => {
|
|
483227
483017
|
if (isWaiting) {
|
|
483228
483018
|
setCurrentLoadingPhrase(t4("Waiting for user confirmation..."));
|
|
483229
483019
|
if (phraseIntervalRef.current) {
|
|
@@ -483260,9 +483050,9 @@ var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases
|
|
|
483260
483050
|
}, "usePhraseCycler");
|
|
483261
483051
|
|
|
483262
483052
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
483263
|
-
var
|
|
483053
|
+
var import_react154 = __toESM(require_react(), 1);
|
|
483264
483054
|
var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhrases, currentCandidatesTokens) => {
|
|
483265
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
483055
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react154.useState)(0);
|
|
483266
483056
|
const isTimerActive = streamingState === "responding" /* Responding */;
|
|
483267
483057
|
const elapsedTimeFromTimer = useTimer(isTimerActive, timerResetKey);
|
|
483268
483058
|
const isPhraseCyclingActive = streamingState === "responding" /* Responding */;
|
|
@@ -483272,10 +483062,10 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
483272
483062
|
isWaiting,
|
|
483273
483063
|
customWittyPhrases
|
|
483274
483064
|
);
|
|
483275
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
483276
|
-
const [taskStartTokens, setTaskStartTokens] = (0,
|
|
483277
|
-
const prevStreamingStateRef = (0,
|
|
483278
|
-
(0,
|
|
483065
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = (0, import_react154.useState)(0);
|
|
483066
|
+
const [taskStartTokens, setTaskStartTokens] = (0, import_react154.useState)(0);
|
|
483067
|
+
const prevStreamingStateRef = (0, import_react154.useRef)(null);
|
|
483068
|
+
(0, import_react154.useEffect)(() => {
|
|
483279
483069
|
if (prevStreamingStateRef.current === "waiting_for_confirmation" /* WaitingForConfirmation */ && streamingState === "responding" /* Responding */) {
|
|
483280
483070
|
setTimerResetKey((prevKey) => prevKey + 1);
|
|
483281
483071
|
setRetainedElapsedTime(0);
|
|
@@ -483300,20 +483090,20 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
483300
483090
|
|
|
483301
483091
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
483302
483092
|
init_esbuild_shims();
|
|
483303
|
-
var
|
|
483093
|
+
var import_react155 = __toESM(require_react(), 1);
|
|
483304
483094
|
import * as process36 from "node:process";
|
|
483305
483095
|
var useFolderTrust = /* @__PURE__ */ __name((settings2, onTrustChange) => {
|
|
483306
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
483307
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
483308
|
-
const [isRestarting, setIsRestarting] = (0,
|
|
483096
|
+
const [isTrusted, setIsTrusted] = (0, import_react155.useState)(void 0);
|
|
483097
|
+
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0, import_react155.useState)(false);
|
|
483098
|
+
const [isRestarting, setIsRestarting] = (0, import_react155.useState)(false);
|
|
483309
483099
|
const folderTrust = settings2.merged.security?.folderTrust?.enabled;
|
|
483310
|
-
(0,
|
|
483100
|
+
(0, import_react155.useEffect)(() => {
|
|
483311
483101
|
const { isTrusted: trusted } = isWorkspaceTrusted(settings2.merged);
|
|
483312
483102
|
setIsTrusted(trusted);
|
|
483313
483103
|
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
483314
483104
|
onTrustChange(trusted);
|
|
483315
483105
|
}, [folderTrust, onTrustChange, settings2.merged]);
|
|
483316
|
-
const handleFolderTrustSelect = (0,
|
|
483106
|
+
const handleFolderTrustSelect = (0, import_react155.useCallback)(
|
|
483317
483107
|
(choice2) => {
|
|
483318
483108
|
const trustedFolders = loadTrustedFolders();
|
|
483319
483109
|
const cwd6 = process36.cwd();
|
|
@@ -483356,7 +483146,7 @@ var useFolderTrust = /* @__PURE__ */ __name((settings2, onTrustChange) => {
|
|
|
483356
483146
|
|
|
483357
483147
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
483358
483148
|
init_esbuild_shims();
|
|
483359
|
-
var
|
|
483149
|
+
var import_react156 = __toESM(require_react(), 1);
|
|
483360
483150
|
init_dist4();
|
|
483361
483151
|
|
|
483362
483152
|
// packages/cli/src/services/command-migration-tool.ts
|
|
@@ -483430,9 +483220,9 @@ __name(migrateTomlCommands, "migrateTomlCommands");
|
|
|
483430
483220
|
|
|
483431
483221
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
483432
483222
|
function useCommandMigration(settings2, storage) {
|
|
483433
|
-
const [showMigrationNudge, setShowMigrationNudge] = (0,
|
|
483434
|
-
const [tomlFiles, setTomlFiles] = (0,
|
|
483435
|
-
(0,
|
|
483223
|
+
const [showMigrationNudge, setShowMigrationNudge] = (0, import_react156.useState)(false);
|
|
483224
|
+
const [tomlFiles, setTomlFiles] = (0, import_react156.useState)([]);
|
|
483225
|
+
(0, import_react156.useEffect)(() => {
|
|
483436
483226
|
const checkTomlCommands = /* @__PURE__ */ __name(async () => {
|
|
483437
483227
|
const allFiles = [];
|
|
483438
483228
|
const workspaceCommandsDir = storage.getProjectCommandsDir();
|
|
@@ -483458,9 +483248,9 @@ __name(useCommandMigration, "useCommandMigration");
|
|
|
483458
483248
|
|
|
483459
483249
|
// packages/cli/src/ui/hooks/useIdleMessageDrain.ts
|
|
483460
483250
|
init_esbuild_shims();
|
|
483461
|
-
var
|
|
483251
|
+
var import_react157 = __toESM(require_react(), 1);
|
|
483462
483252
|
function useIdleMessageDrain(isConfigInitialized, streamingState, messageQueue, drain, submitQuery) {
|
|
483463
|
-
(0,
|
|
483253
|
+
(0, import_react157.useEffect)(() => {
|
|
483464
483254
|
if (isConfigInitialized && streamingState === "idle" /* Idle */ && messageQueue.length > 0) {
|
|
483465
483255
|
const combined = messageQueue.join("\n\n");
|
|
483466
483256
|
drain();
|
|
@@ -483472,7 +483262,7 @@ __name(useIdleMessageDrain, "useIdleMessageDrain");
|
|
|
483472
483262
|
|
|
483473
483263
|
// packages/cli/src/ui/hooks/useWindowTitle.ts
|
|
483474
483264
|
init_esbuild_shims();
|
|
483475
|
-
var
|
|
483265
|
+
var import_react158 = __toESM(require_react(), 1);
|
|
483476
483266
|
import { basename as basename31 } from "node:path";
|
|
483477
483267
|
|
|
483478
483268
|
// packages/cli/src/utils/windowTitle.ts
|
|
@@ -483489,9 +483279,9 @@ __name(computeWindowTitle, "computeWindowTitle");
|
|
|
483489
483279
|
|
|
483490
483280
|
// packages/cli/src/ui/hooks/useWindowTitle.ts
|
|
483491
483281
|
function useWindowTitle(streamingState, thought, settings2, stdout3, targetDir) {
|
|
483492
|
-
const originalTitleRef = (0,
|
|
483493
|
-
const lastTitleRef = (0,
|
|
483494
|
-
(0,
|
|
483282
|
+
const originalTitleRef = (0, import_react158.useRef)(computeWindowTitle(basename31(targetDir)));
|
|
483283
|
+
const lastTitleRef = (0, import_react158.useRef)(null);
|
|
483284
|
+
(0, import_react158.useEffect)(() => {
|
|
483495
483285
|
if (!settings2.merged.ui?.showStatusInTitle || settings2.merged.ui?.hideWindowTitle)
|
|
483496
483286
|
return;
|
|
483497
483287
|
let title;
|
|
@@ -483518,11 +483308,11 @@ __name(useWindowTitle, "useWindowTitle");
|
|
|
483518
483308
|
|
|
483519
483309
|
// packages/cli/src/ui/hooks/useInitializationEffects.ts
|
|
483520
483310
|
init_esbuild_shims();
|
|
483521
|
-
var
|
|
483311
|
+
var import_react159 = __toESM(require_react(), 1);
|
|
483522
483312
|
init_dist4();
|
|
483523
483313
|
var debugLogger155 = createDebugLogger("APP_CONTAINER");
|
|
483524
483314
|
function useInitializationEffects(config2, historyManager, setConfigInitialized) {
|
|
483525
|
-
(0,
|
|
483315
|
+
(0, import_react159.useEffect)(() => {
|
|
483526
483316
|
(async () => {
|
|
483527
483317
|
await config2.initialize();
|
|
483528
483318
|
setConfigInitialized(true);
|
|
@@ -483590,7 +483380,7 @@ __name(useInitializationEffects, "useInitializationEffects");
|
|
|
483590
483380
|
|
|
483591
483381
|
// packages/cli/src/ui/hooks/usePromptSuggestions.ts
|
|
483592
483382
|
init_esbuild_shims();
|
|
483593
|
-
var
|
|
483383
|
+
var import_react160 = __toESM(require_react(), 1);
|
|
483594
483384
|
init_dist4();
|
|
483595
483385
|
function usePromptSuggestions(params) {
|
|
483596
483386
|
const {
|
|
@@ -483606,17 +483396,17 @@ function usePromptSuggestions(params) {
|
|
|
483606
483396
|
settingInputRequests,
|
|
483607
483397
|
pendingGeminiHistoryItems
|
|
483608
483398
|
} = params;
|
|
483609
|
-
const [promptSuggestion, setPromptSuggestion] = (0,
|
|
483610
|
-
const prevStreamingStateRef = (0,
|
|
483611
|
-
const speculationRef = (0,
|
|
483612
|
-
const suggestionAbortRef = (0,
|
|
483613
|
-
const dismissPromptSuggestion = (0,
|
|
483399
|
+
const [promptSuggestion, setPromptSuggestion] = (0, import_react160.useState)(null);
|
|
483400
|
+
const prevStreamingStateRef = (0, import_react160.useRef)("idle" /* Idle */);
|
|
483401
|
+
const speculationRef = (0, import_react160.useRef)(IDLE_SPECULATION);
|
|
483402
|
+
const suggestionAbortRef = (0, import_react160.useRef)(null);
|
|
483403
|
+
const dismissPromptSuggestion = (0, import_react160.useCallback)(() => {
|
|
483614
483404
|
setPromptSuggestion(null);
|
|
483615
483405
|
suggestionAbortRef.current?.abort();
|
|
483616
483406
|
suggestionAbortRef.current = null;
|
|
483617
483407
|
}, []);
|
|
483618
483408
|
const followupSuggestionsEnabled = settings2.merged.ui?.enableFollowupSuggestions !== false;
|
|
483619
|
-
(0,
|
|
483409
|
+
(0, import_react160.useEffect)(() => {
|
|
483620
483410
|
if (!followupSuggestionsEnabled) {
|
|
483621
483411
|
suggestionAbortRef.current?.abort();
|
|
483622
483412
|
setPromptSuggestion(null);
|
|
@@ -483689,7 +483479,7 @@ function usePromptSuggestions(params) {
|
|
|
483689
483479
|
isPermissionsDialogOpen,
|
|
483690
483480
|
settingInputRequests
|
|
483691
483481
|
]);
|
|
483692
|
-
(0,
|
|
483482
|
+
(0, import_react160.useEffect)(() => {
|
|
483693
483483
|
if (!promptSuggestion && speculationRef.current.status !== "idle") {
|
|
483694
483484
|
abortSpeculation(speculationRef.current).catch(() => {
|
|
483695
483485
|
});
|
|
@@ -483707,7 +483497,7 @@ __name(usePromptSuggestions, "usePromptSuggestions");
|
|
|
483707
483497
|
|
|
483708
483498
|
// packages/cli/src/ui/hooks/useExitHandling.ts
|
|
483709
483499
|
init_esbuild_shims();
|
|
483710
|
-
var
|
|
483500
|
+
var import_react161 = __toESM(require_react(), 1);
|
|
483711
483501
|
function useExitHandling(params) {
|
|
483712
483502
|
const {
|
|
483713
483503
|
isAuthDialogOpen,
|
|
@@ -483717,7 +483507,7 @@ function useExitHandling(params) {
|
|
|
483717
483507
|
cancelOngoingRequest,
|
|
483718
483508
|
buffer
|
|
483719
483509
|
} = params;
|
|
483720
|
-
const handleExit = (0,
|
|
483510
|
+
const handleExit = (0, import_react161.useCallback)(
|
|
483721
483511
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
483722
483512
|
if (pressedOnce) {
|
|
483723
483513
|
if (timerRef.current) {
|
|
@@ -486860,7 +486650,7 @@ __name(setUpdateHandler, "setUpdateHandler");
|
|
|
486860
486650
|
|
|
486861
486651
|
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
486862
486652
|
init_esbuild_shims();
|
|
486863
|
-
var
|
|
486653
|
+
var import_react162 = __toESM(require_react(), 1);
|
|
486864
486654
|
var MessageQueueStore = class {
|
|
486865
486655
|
static {
|
|
486866
486656
|
__name(this, "MessageQueueStore");
|
|
@@ -486914,15 +486704,15 @@ var MessageQueueStore = class {
|
|
|
486914
486704
|
}
|
|
486915
486705
|
};
|
|
486916
486706
|
function useMessageQueue() {
|
|
486917
|
-
const store = (0,
|
|
486918
|
-
const messageQueue = (0,
|
|
486919
|
-
const addMessage = (0,
|
|
486707
|
+
const store = (0, import_react162.useMemo)(() => new MessageQueueStore(), []);
|
|
486708
|
+
const messageQueue = (0, import_react162.useSyncExternalStore)(store.subscribe, store.getSnapshot);
|
|
486709
|
+
const addMessage = (0, import_react162.useCallback)(
|
|
486920
486710
|
(message) => store.addMessage(message),
|
|
486921
486711
|
[store]
|
|
486922
486712
|
);
|
|
486923
|
-
const clearQueue = (0,
|
|
486924
|
-
const popLast = (0,
|
|
486925
|
-
const drain = (0,
|
|
486713
|
+
const clearQueue = (0, import_react162.useCallback)(() => store.clearQueue(), [store]);
|
|
486714
|
+
const popLast = (0, import_react162.useCallback)(() => store.popLast(), [store]);
|
|
486715
|
+
const drain = (0, import_react162.useCallback)(() => store.drain(), [store]);
|
|
486926
486716
|
return { messageQueue, addMessage, clearQueue, popLast, drain };
|
|
486927
486717
|
}
|
|
486928
486718
|
__name(useMessageQueue, "useMessageQueue");
|
|
@@ -486930,7 +486720,7 @@ __name(useMessageQueue, "useMessageQueue");
|
|
|
486930
486720
|
// packages/cli/src/ui/hooks/useAutoAcceptIndicator.ts
|
|
486931
486721
|
init_esbuild_shims();
|
|
486932
486722
|
init_dist4();
|
|
486933
|
-
var
|
|
486723
|
+
var import_react163 = __toESM(require_react(), 1);
|
|
486934
486724
|
function useAutoAcceptIndicator({
|
|
486935
486725
|
config: config2,
|
|
486936
486726
|
addItem,
|
|
@@ -486939,8 +486729,8 @@ function useAutoAcceptIndicator({
|
|
|
486939
486729
|
disabled
|
|
486940
486730
|
}) {
|
|
486941
486731
|
const currentConfigValue = config2.getApprovalMode();
|
|
486942
|
-
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0,
|
|
486943
|
-
(0,
|
|
486732
|
+
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0, import_react163.useState)(currentConfigValue);
|
|
486733
|
+
(0, import_react163.useEffect)(() => {
|
|
486944
486734
|
setShowAutoAcceptIndicator(currentConfigValue);
|
|
486945
486735
|
}, [currentConfigValue]);
|
|
486946
486736
|
useKeypress(
|
|
@@ -486978,7 +486768,7 @@ __name(useAutoAcceptIndicator, "useAutoAcceptIndicator");
|
|
|
486978
486768
|
|
|
486979
486769
|
// packages/cli/src/ui/hooks/useExtensionUpdates.ts
|
|
486980
486770
|
init_esbuild_shims();
|
|
486981
|
-
var
|
|
486771
|
+
var import_react164 = __toESM(require_react(), 1);
|
|
486982
486772
|
function confirmationRequestsReducer(state, action) {
|
|
486983
486773
|
switch (action.type) {
|
|
486984
486774
|
case "add":
|
|
@@ -486995,8 +486785,8 @@ var useConfirmUpdateRequests = /* @__PURE__ */ __name(() => {
|
|
|
486995
486785
|
const [
|
|
486996
486786
|
confirmUpdateExtensionRequests,
|
|
486997
486787
|
dispatchConfirmUpdateExtensionRequests
|
|
486998
|
-
] = (0,
|
|
486999
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
486788
|
+
] = (0, import_react164.useReducer)(confirmationRequestsReducer, []);
|
|
486789
|
+
const addConfirmUpdateExtensionRequest = (0, import_react164.useCallback)(
|
|
487000
486790
|
(original) => {
|
|
487001
486791
|
const wrappedRequest = {
|
|
487002
486792
|
prompt: original.prompt,
|
|
@@ -487034,11 +486824,11 @@ function settingInputRequestsReducer(state, action) {
|
|
|
487034
486824
|
}
|
|
487035
486825
|
__name(settingInputRequestsReducer, "settingInputRequestsReducer");
|
|
487036
486826
|
var useSettingInputRequests = /* @__PURE__ */ __name(() => {
|
|
487037
|
-
const [settingInputRequests, dispatchSettingInputRequests] = (0,
|
|
486827
|
+
const [settingInputRequests, dispatchSettingInputRequests] = (0, import_react164.useReducer)(
|
|
487038
486828
|
settingInputRequestsReducer,
|
|
487039
486829
|
[]
|
|
487040
486830
|
);
|
|
487041
|
-
const addSettingInputRequest = (0,
|
|
486831
|
+
const addSettingInputRequest = (0, import_react164.useCallback)(
|
|
487042
486832
|
(original) => {
|
|
487043
486833
|
const wrappedRequest = {
|
|
487044
486834
|
settingName: original.settingName,
|
|
@@ -487085,11 +486875,11 @@ function pluginChoiceRequestsReducer(state, action) {
|
|
|
487085
486875
|
}
|
|
487086
486876
|
__name(pluginChoiceRequestsReducer, "pluginChoiceRequestsReducer");
|
|
487087
486877
|
var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
487088
|
-
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0,
|
|
486878
|
+
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0, import_react164.useReducer)(
|
|
487089
486879
|
pluginChoiceRequestsReducer,
|
|
487090
486880
|
[]
|
|
487091
486881
|
);
|
|
487092
|
-
const addPluginChoiceRequest = (0,
|
|
486882
|
+
const addPluginChoiceRequest = (0, import_react164.useCallback)(
|
|
487093
486883
|
(original) => {
|
|
487094
486884
|
const wrappedRequest = {
|
|
487095
486885
|
marketplaceName: original.marketplaceName,
|
|
@@ -487123,12 +486913,12 @@ var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
|
487123
486913
|
};
|
|
487124
486914
|
}, "usePluginChoiceRequests");
|
|
487125
486915
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd6) => {
|
|
487126
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
486916
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react164.useReducer)(
|
|
487127
486917
|
extensionUpdatesReducer,
|
|
487128
486918
|
initialExtensionUpdatesState
|
|
487129
486919
|
);
|
|
487130
486920
|
const extensions = extensionManager.getLoadedExtensions();
|
|
487131
|
-
(0,
|
|
486921
|
+
(0, import_react164.useEffect)(() => {
|
|
487132
486922
|
(async () => {
|
|
487133
486923
|
const extensionsToCheck = extensions.filter((extension) => {
|
|
487134
486924
|
const currentStatus = extensionsUpdateState.extensionStatuses.get(
|
|
@@ -487156,7 +486946,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
487156
486946
|
extensionsUpdateState.extensionStatuses,
|
|
487157
486947
|
dispatchExtensionStateUpdate
|
|
487158
486948
|
]);
|
|
487159
|
-
(0,
|
|
486949
|
+
(0, import_react164.useEffect)(() => {
|
|
487160
486950
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
487161
486951
|
return;
|
|
487162
486952
|
}
|
|
@@ -487215,7 +487005,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
487215
487005
|
);
|
|
487216
487006
|
}
|
|
487217
487007
|
}, [extensions, extensionManager, extensionsUpdateState, addItem, cwd6]);
|
|
487218
|
-
const extensionsUpdateStateComputed = (0,
|
|
487008
|
+
const extensionsUpdateStateComputed = (0, import_react164.useMemo)(() => {
|
|
487219
487009
|
const result = /* @__PURE__ */ new Map();
|
|
487220
487010
|
for (const [
|
|
487221
487011
|
key,
|
|
@@ -487234,15 +487024,15 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
487234
487024
|
|
|
487235
487025
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
487236
487026
|
init_esbuild_shims();
|
|
487237
|
-
var
|
|
487027
|
+
var import_react165 = __toESM(require_react(), 1);
|
|
487238
487028
|
init_dist4();
|
|
487239
487029
|
function useWelcomeBack(config2, submitQuery, buffer, settings2) {
|
|
487240
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
487241
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
487242
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
487243
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
487244
|
-
const [inputFillText, setInputFillText] = (0,
|
|
487245
|
-
const checkWelcomeBack = (0,
|
|
487030
|
+
const [welcomeBackInfo, setWelcomeBackInfo] = (0, import_react165.useState)(null);
|
|
487031
|
+
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0, import_react165.useState)(false);
|
|
487032
|
+
const [welcomeBackChoice, setWelcomeBackChoice] = (0, import_react165.useState)(null);
|
|
487033
|
+
const [shouldFillInput, setShouldFillInput] = (0, import_react165.useState)(false);
|
|
487034
|
+
const [inputFillText, setInputFillText] = (0, import_react165.useState)(null);
|
|
487035
|
+
const checkWelcomeBack = (0, import_react165.useCallback)(async () => {
|
|
487246
487036
|
if (settings2.ui?.enableWelcomeBack === false) {
|
|
487247
487037
|
return;
|
|
487248
487038
|
}
|
|
@@ -487256,7 +487046,7 @@ function useWelcomeBack(config2, submitQuery, buffer, settings2) {
|
|
|
487256
487046
|
config2.getDebugLogger().debug("Welcome back check failed:", error40);
|
|
487257
487047
|
}
|
|
487258
487048
|
}, [config2, settings2.ui?.enableWelcomeBack]);
|
|
487259
|
-
const handleWelcomeBackSelection = (0,
|
|
487049
|
+
const handleWelcomeBackSelection = (0, import_react165.useCallback)(
|
|
487260
487050
|
(choice2) => {
|
|
487261
487051
|
setWelcomeBackChoice(choice2);
|
|
487262
487052
|
setShowWelcomeBackDialog(false);
|
|
@@ -487268,21 +487058,21 @@ function useWelcomeBack(config2, submitQuery, buffer, settings2) {
|
|
|
487268
487058
|
},
|
|
487269
487059
|
[welcomeBackInfo]
|
|
487270
487060
|
);
|
|
487271
|
-
const handleWelcomeBackClose = (0,
|
|
487061
|
+
const handleWelcomeBackClose = (0, import_react165.useCallback)(() => {
|
|
487272
487062
|
setWelcomeBackChoice("restart");
|
|
487273
487063
|
setShowWelcomeBackDialog(false);
|
|
487274
487064
|
}, []);
|
|
487275
|
-
const clearInputFill = (0,
|
|
487065
|
+
const clearInputFill = (0, import_react165.useCallback)(() => {
|
|
487276
487066
|
setShouldFillInput(false);
|
|
487277
487067
|
setInputFillText(null);
|
|
487278
487068
|
}, []);
|
|
487279
|
-
(0,
|
|
487069
|
+
(0, import_react165.useEffect)(() => {
|
|
487280
487070
|
if (shouldFillInput && inputFillText) {
|
|
487281
487071
|
buffer.setText(inputFillText);
|
|
487282
487072
|
clearInputFill();
|
|
487283
487073
|
}
|
|
487284
487074
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
487285
|
-
(0,
|
|
487075
|
+
(0, import_react165.useEffect)(() => {
|
|
487286
487076
|
checkWelcomeBack();
|
|
487287
487077
|
}, [checkWelcomeBack]);
|
|
487288
487078
|
return {
|
|
@@ -487303,9 +487093,9 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
487303
487093
|
|
|
487304
487094
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
487305
487095
|
init_esbuild_shims();
|
|
487306
|
-
var
|
|
487096
|
+
var import_react166 = __toESM(require_react(), 1);
|
|
487307
487097
|
function useDialogClose(options2) {
|
|
487308
|
-
const closeAnyOpenDialog = (0,
|
|
487098
|
+
const closeAnyOpenDialog = (0, import_react166.useCallback)(() => {
|
|
487309
487099
|
if (options2.isThemeDialogOpen) {
|
|
487310
487100
|
options2.handleThemeSelect(void 0, "User" /* User */);
|
|
487311
487101
|
return true;
|
|
@@ -487341,14 +487131,14 @@ __name(useDialogClose, "useDialogClose");
|
|
|
487341
487131
|
|
|
487342
487132
|
// packages/cli/src/ui/hooks/useInitializationAuthError.ts
|
|
487343
487133
|
init_esbuild_shims();
|
|
487344
|
-
var
|
|
487134
|
+
var import_react167 = __toESM(require_react(), 1);
|
|
487345
487135
|
var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError) => {
|
|
487346
|
-
const hasHandled = (0,
|
|
487347
|
-
const authErrorRef = (0,
|
|
487348
|
-
const onAuthErrorRef = (0,
|
|
487136
|
+
const hasHandled = (0, import_react167.useRef)(false);
|
|
487137
|
+
const authErrorRef = (0, import_react167.useRef)(authError);
|
|
487138
|
+
const onAuthErrorRef = (0, import_react167.useRef)(onAuthError);
|
|
487349
487139
|
authErrorRef.current = authError;
|
|
487350
487140
|
onAuthErrorRef.current = onAuthError;
|
|
487351
|
-
(0,
|
|
487141
|
+
(0, import_react167.useEffect)(() => {
|
|
487352
487142
|
if (hasHandled.current) {
|
|
487353
487143
|
return;
|
|
487354
487144
|
}
|
|
@@ -487361,13 +487151,13 @@ var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError)
|
|
|
487361
487151
|
|
|
487362
487152
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
487363
487153
|
init_esbuild_shims();
|
|
487364
|
-
var
|
|
487154
|
+
var import_react168 = __toESM(require_react(), 1);
|
|
487365
487155
|
function useSubagentCreateDialog() {
|
|
487366
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
487367
|
-
const openSubagentCreateDialog = (0,
|
|
487156
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react168.useState)(false);
|
|
487157
|
+
const openSubagentCreateDialog = (0, import_react168.useCallback)(() => {
|
|
487368
487158
|
setIsSubagentCreateDialogOpen(true);
|
|
487369
487159
|
}, []);
|
|
487370
|
-
const closeSubagentCreateDialog = (0,
|
|
487160
|
+
const closeSubagentCreateDialog = (0, import_react168.useCallback)(() => {
|
|
487371
487161
|
setIsSubagentCreateDialogOpen(false);
|
|
487372
487162
|
}, []);
|
|
487373
487163
|
return {
|
|
@@ -487380,13 +487170,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
487380
487170
|
|
|
487381
487171
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
487382
487172
|
init_esbuild_shims();
|
|
487383
|
-
var
|
|
487173
|
+
var import_react169 = __toESM(require_react(), 1);
|
|
487384
487174
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
487385
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
487386
|
-
const openAgentsManagerDialog = (0,
|
|
487175
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react169.useState)(false);
|
|
487176
|
+
const openAgentsManagerDialog = (0, import_react169.useCallback)(() => {
|
|
487387
487177
|
setIsAgentsManagerDialogOpen(true);
|
|
487388
487178
|
}, []);
|
|
487389
|
-
const closeAgentsManagerDialog = (0,
|
|
487179
|
+
const closeAgentsManagerDialog = (0, import_react169.useCallback)(() => {
|
|
487390
487180
|
setIsAgentsManagerDialogOpen(false);
|
|
487391
487181
|
}, []);
|
|
487392
487182
|
return {
|
|
@@ -487398,13 +487188,13 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
487398
487188
|
|
|
487399
487189
|
// packages/cli/src/ui/hooks/useExtensionsManagerDialog.ts
|
|
487400
487190
|
init_esbuild_shims();
|
|
487401
|
-
var
|
|
487191
|
+
var import_react170 = __toESM(require_react(), 1);
|
|
487402
487192
|
var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
487403
|
-
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0,
|
|
487404
|
-
const openExtensionsManagerDialog = (0,
|
|
487193
|
+
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0, import_react170.useState)(false);
|
|
487194
|
+
const openExtensionsManagerDialog = (0, import_react170.useCallback)(() => {
|
|
487405
487195
|
setIsExtensionsManagerDialogOpen(true);
|
|
487406
487196
|
}, []);
|
|
487407
|
-
const closeExtensionsManagerDialog = (0,
|
|
487197
|
+
const closeExtensionsManagerDialog = (0, import_react170.useCallback)(() => {
|
|
487408
487198
|
setIsExtensionsManagerDialogOpen(false);
|
|
487409
487199
|
}, []);
|
|
487410
487200
|
return {
|
|
@@ -487416,13 +487206,13 @@ var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
487416
487206
|
|
|
487417
487207
|
// packages/cli/src/ui/hooks/useMcpDialog.ts
|
|
487418
487208
|
init_esbuild_shims();
|
|
487419
|
-
var
|
|
487209
|
+
var import_react171 = __toESM(require_react(), 1);
|
|
487420
487210
|
var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
487421
|
-
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0,
|
|
487422
|
-
const openMcpDialog = (0,
|
|
487211
|
+
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0, import_react171.useState)(false);
|
|
487212
|
+
const openMcpDialog = (0, import_react171.useCallback)(() => {
|
|
487423
487213
|
setIsMcpDialogOpen(true);
|
|
487424
487214
|
}, []);
|
|
487425
|
-
const closeMcpDialog = (0,
|
|
487215
|
+
const closeMcpDialog = (0, import_react171.useCallback)(() => {
|
|
487426
487216
|
setIsMcpDialogOpen(false);
|
|
487427
487217
|
}, []);
|
|
487428
487218
|
return {
|
|
@@ -487434,13 +487224,13 @@ var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
|
487434
487224
|
|
|
487435
487225
|
// packages/cli/src/ui/hooks/useHooksDialog.ts
|
|
487436
487226
|
init_esbuild_shims();
|
|
487437
|
-
var
|
|
487227
|
+
var import_react172 = __toESM(require_react(), 1);
|
|
487438
487228
|
var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
487439
|
-
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0,
|
|
487440
|
-
const openHooksDialog = (0,
|
|
487229
|
+
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0, import_react172.useState)(false);
|
|
487230
|
+
const openHooksDialog = (0, import_react172.useCallback)(() => {
|
|
487441
487231
|
setIsHooksDialogOpen(true);
|
|
487442
487232
|
}, []);
|
|
487443
|
-
const closeHooksDialog = (0,
|
|
487233
|
+
const closeHooksDialog = (0, import_react172.useCallback)(() => {
|
|
487444
487234
|
setIsHooksDialogOpen(false);
|
|
487445
487235
|
}, []);
|
|
487446
487236
|
return {
|
|
@@ -487452,7 +487242,7 @@ var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
|
487452
487242
|
|
|
487453
487243
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
487454
487244
|
init_esbuild_shims();
|
|
487455
|
-
var
|
|
487245
|
+
var import_react173 = __toESM(require_react(), 1);
|
|
487456
487246
|
|
|
487457
487247
|
// packages/cli/src/utils/attentionNotification.ts
|
|
487458
487248
|
init_esbuild_shims();
|
|
@@ -487489,10 +487279,10 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
487489
487279
|
config: config2
|
|
487490
487280
|
}) => {
|
|
487491
487281
|
const terminalBellEnabled = settings2?.merged?.general?.terminalBell ?? true;
|
|
487492
|
-
const awaitingNotificationSentRef = (0,
|
|
487493
|
-
const respondingElapsedRef = (0,
|
|
487494
|
-
const idleNotificationSentRef = (0,
|
|
487495
|
-
(0,
|
|
487282
|
+
const awaitingNotificationSentRef = (0, import_react173.useRef)(false);
|
|
487283
|
+
const respondingElapsedRef = (0, import_react173.useRef)(0);
|
|
487284
|
+
const idleNotificationSentRef = (0, import_react173.useRef)(false);
|
|
487285
|
+
(0, import_react173.useEffect)(() => {
|
|
487496
487286
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current) {
|
|
487497
487287
|
notifyTerminalAttention("tool_approval" /* ToolApproval */, {
|
|
487498
487288
|
enabled: terminalBellEnabled
|
|
@@ -487503,7 +487293,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
487503
487293
|
awaitingNotificationSentRef.current = false;
|
|
487504
487294
|
}
|
|
487505
487295
|
}, [isFocused, streamingState, terminalBellEnabled]);
|
|
487506
|
-
(0,
|
|
487296
|
+
(0, import_react173.useEffect)(() => {
|
|
487507
487297
|
if (streamingState === "responding" /* Responding */) {
|
|
487508
487298
|
respondingElapsedRef.current = elapsedTime;
|
|
487509
487299
|
idleNotificationSentRef.current = false;
|
|
@@ -487539,7 +487329,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
487539
487329
|
|
|
487540
487330
|
// packages/cli/src/ui/hooks/useVoice.ts
|
|
487541
487331
|
init_esbuild_shims();
|
|
487542
|
-
var
|
|
487332
|
+
var import_react174 = __toESM(require_react(), 1);
|
|
487543
487333
|
import os46 from "node:os";
|
|
487544
487334
|
import path149 from "node:path";
|
|
487545
487335
|
import fs134 from "node:fs";
|
|
@@ -487574,12 +487364,12 @@ __name(transcribe, "transcribe");
|
|
|
487574
487364
|
|
|
487575
487365
|
// packages/cli/src/ui/hooks/useVoice.ts
|
|
487576
487366
|
function useVoice(sttEndpoint, sttApiKey) {
|
|
487577
|
-
const [voiceState, setVoiceState] = (0,
|
|
487578
|
-
const [error40, setError] = (0,
|
|
487579
|
-
const procRef = (0,
|
|
487580
|
-
const audioPathRef = (0,
|
|
487581
|
-
const backend = (0,
|
|
487582
|
-
const start2 = (0,
|
|
487367
|
+
const [voiceState, setVoiceState] = (0, import_react174.useState)("idle");
|
|
487368
|
+
const [error40, setError] = (0, import_react174.useState)(null);
|
|
487369
|
+
const procRef = (0, import_react174.useRef)(null);
|
|
487370
|
+
const audioPathRef = (0, import_react174.useRef)(null);
|
|
487371
|
+
const backend = (0, import_react174.useMemo)(() => detectBackend2(), []);
|
|
487372
|
+
const start2 = (0, import_react174.useCallback)(async () => {
|
|
487583
487373
|
if (voiceState !== "idle") return;
|
|
487584
487374
|
const tmpPath = path149.join(os46.tmpdir(), `proto-voice-${Date.now()}.wav`);
|
|
487585
487375
|
audioPathRef.current = tmpPath;
|
|
@@ -487592,7 +487382,7 @@ function useVoice(sttEndpoint, sttApiKey) {
|
|
|
487592
487382
|
setError(e4 instanceof Error ? e4.message : String(e4));
|
|
487593
487383
|
}
|
|
487594
487384
|
}, [voiceState, backend]);
|
|
487595
|
-
const stop3 = (0,
|
|
487385
|
+
const stop3 = (0, import_react174.useCallback)(async () => {
|
|
487596
487386
|
if (voiceState !== "recording" || !procRef.current || !audioPathRef.current) {
|
|
487597
487387
|
return "";
|
|
487598
487388
|
}
|
|
@@ -487625,7 +487415,7 @@ function useVoice(sttEndpoint, sttApiKey) {
|
|
|
487625
487415
|
return "";
|
|
487626
487416
|
}
|
|
487627
487417
|
}, [voiceState, sttEndpoint, sttApiKey]);
|
|
487628
|
-
const reset = (0,
|
|
487418
|
+
const reset = (0, import_react174.useCallback)(() => {
|
|
487629
487419
|
setVoiceState("idle");
|
|
487630
487420
|
setError(null);
|
|
487631
487421
|
}, []);
|
|
@@ -487660,21 +487450,21 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487660
487450
|
const { settings: settings2, config: config2, initializationResult } = props;
|
|
487661
487451
|
const historyManager = useHistory();
|
|
487662
487452
|
useMemoryMonitor(historyManager);
|
|
487663
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
487664
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
487665
|
-
const [themeError, setThemeError] = (0,
|
|
487453
|
+
const [debugMessage, setDebugMessage] = (0, import_react175.useState)("");
|
|
487454
|
+
const [quittingMessages, setQuittingMessages] = (0, import_react175.useState)(null);
|
|
487455
|
+
const [themeError, setThemeError] = (0, import_react175.useState)(
|
|
487666
487456
|
initializationResult.themeError
|
|
487667
487457
|
);
|
|
487668
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
487669
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
487670
|
-
const [geminiMdFileCount, setGeminiMdFileCount] = (0,
|
|
487458
|
+
const [isProcessing, setIsProcessing] = (0, import_react175.useState)(false);
|
|
487459
|
+
const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react175.useState)(false);
|
|
487460
|
+
const [geminiMdFileCount, setGeminiMdFileCount] = (0, import_react175.useState)(
|
|
487671
487461
|
initializationResult.geminiMdFileCount
|
|
487672
487462
|
);
|
|
487673
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
487674
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
487675
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
487676
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
487677
|
-
const [isTrustedFolder, setIsTrustedFolder] = (0,
|
|
487463
|
+
const [shellModeActive, setShellModeActive] = (0, import_react175.useState)(false);
|
|
487464
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react175.useState)(false);
|
|
487465
|
+
const [historyRemountKey, setHistoryRemountKey] = (0, import_react175.useState)(0);
|
|
487466
|
+
const [updateInfo, setUpdateInfo] = (0, import_react175.useState)(null);
|
|
487467
|
+
const [isTrustedFolder, setIsTrustedFolder] = (0, import_react175.useState)(
|
|
487678
487468
|
config2.isTrustedFolder()
|
|
487679
487469
|
);
|
|
487680
487470
|
const extensionManager = config2.getExtensionManager();
|
|
@@ -487729,38 +487519,38 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487729
487519
|
config2.getWorkingDir()
|
|
487730
487520
|
);
|
|
487731
487521
|
const { codingPlanUpdateRequest, dismissCodingPlanUpdate } = useCodingPlanUpdates(settings2, config2, historyManager.addItem);
|
|
487732
|
-
const [isTrustDialogOpen, setTrustDialogOpen] = (0,
|
|
487733
|
-
const openTrustDialog = (0,
|
|
487734
|
-
const closeTrustDialog = (0,
|
|
487735
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
487736
|
-
const openPermissionsDialog = (0,
|
|
487522
|
+
const [isTrustDialogOpen, setTrustDialogOpen] = (0, import_react175.useState)(false);
|
|
487523
|
+
const openTrustDialog = (0, import_react175.useCallback)(() => setTrustDialogOpen(true), []);
|
|
487524
|
+
const closeTrustDialog = (0, import_react175.useCallback)(() => setTrustDialogOpen(false), []);
|
|
487525
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react175.useState)(false);
|
|
487526
|
+
const openPermissionsDialog = (0, import_react175.useCallback)(
|
|
487737
487527
|
() => setPermissionsDialogOpen(true),
|
|
487738
487528
|
[]
|
|
487739
487529
|
);
|
|
487740
|
-
const closePermissionsDialog = (0,
|
|
487530
|
+
const closePermissionsDialog = (0, import_react175.useCallback)(
|
|
487741
487531
|
() => setPermissionsDialogOpen(false),
|
|
487742
487532
|
[]
|
|
487743
487533
|
);
|
|
487744
|
-
const getCurrentModel = (0,
|
|
487745
|
-
const [currentModel, setCurrentModel] = (0,
|
|
487746
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
487747
|
-
const [userMessages, setUserMessages] = (0,
|
|
487534
|
+
const getCurrentModel = (0, import_react175.useCallback)(() => config2.getModel(), [config2]);
|
|
487535
|
+
const [currentModel, setCurrentModel] = (0, import_react175.useState)(getCurrentModel());
|
|
487536
|
+
const [isConfigInitialized, setConfigInitialized] = (0, import_react175.useState)(false);
|
|
487537
|
+
const [userMessages, setUserMessages] = (0, import_react175.useState)([]);
|
|
487748
487538
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
487749
487539
|
const { stdin: stdin3, setRawMode } = use_stdin_default();
|
|
487750
487540
|
const { stdout: stdout3 } = use_stdout_default();
|
|
487751
487541
|
const { stats: sessionStats, startNewSession } = useSessionStats();
|
|
487752
487542
|
const logger10 = useLogger(config2.storage, sessionStats.sessionId);
|
|
487753
487543
|
const branchName = useGitBranchName(config2.getTargetDir());
|
|
487754
|
-
const mainControlsRef = (0,
|
|
487544
|
+
const mainControlsRef = (0, import_react175.useRef)(null);
|
|
487755
487545
|
const staticExtraHeight = 3;
|
|
487756
487546
|
useInitializationEffects(config2, historyManager, setConfigInitialized);
|
|
487757
|
-
(0,
|
|
487547
|
+
(0, import_react175.useEffect)(
|
|
487758
487548
|
() => setUpdateHandler(historyManager.addItem, setUpdateInfo),
|
|
487759
487549
|
[historyManager.addItem]
|
|
487760
487550
|
);
|
|
487761
487551
|
const { lastFinished } = useBackgroundAgentProgress();
|
|
487762
487552
|
const addHistoryItem = historyManager.addItem;
|
|
487763
|
-
(0,
|
|
487553
|
+
(0, import_react175.useEffect)(() => {
|
|
487764
487554
|
if (!lastFinished?.hitLimit) return;
|
|
487765
487555
|
addHistoryItem(
|
|
487766
487556
|
{
|
|
@@ -487770,7 +487560,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487770
487560
|
Date.now()
|
|
487771
487561
|
);
|
|
487772
487562
|
}, [lastFinished, addHistoryItem]);
|
|
487773
|
-
(0,
|
|
487563
|
+
(0, import_react175.useEffect)(() => {
|
|
487774
487564
|
const interval = setInterval(() => {
|
|
487775
487565
|
const model = getCurrentModel();
|
|
487776
487566
|
if (model !== currentModel) {
|
|
@@ -487779,13 +487569,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487779
487569
|
}, 1e3);
|
|
487780
487570
|
return () => clearInterval(interval);
|
|
487781
487571
|
}, [config2, currentModel, getCurrentModel]);
|
|
487782
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
487572
|
+
const { inputWidth, suggestionsWidth } = (0, import_react175.useMemo)(() => {
|
|
487783
487573
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
487784
487574
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
487785
487575
|
}, [terminalWidth]);
|
|
487786
487576
|
const mainAreaWidth = Math.min(terminalWidth - 4, 100);
|
|
487787
487577
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
487788
|
-
const isValidPath = (0,
|
|
487578
|
+
const isValidPath = (0, import_react175.useCallback)((filePath) => {
|
|
487789
487579
|
try {
|
|
487790
487580
|
return fs135.existsSync(filePath) && fs135.statSync(filePath).isFile();
|
|
487791
487581
|
} catch (_e2) {
|
|
@@ -487800,7 +487590,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487800
487590
|
isValidPath,
|
|
487801
487591
|
shellModeActive
|
|
487802
487592
|
});
|
|
487803
|
-
(0,
|
|
487593
|
+
(0, import_react175.useEffect)(() => {
|
|
487804
487594
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
487805
487595
|
const pastMessagesRaw = await logger10?.getPreviousUserMessages() || [];
|
|
487806
487596
|
const currentSessionUserMessages = historyManager.history.filter(
|
|
@@ -487823,7 +487613,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487823
487613
|
}, "fetchUserMessages");
|
|
487824
487614
|
fetchUserMessages();
|
|
487825
487615
|
}, [historyManager.history, logger10]);
|
|
487826
|
-
const refreshStatic = (0,
|
|
487616
|
+
const refreshStatic = (0, import_react175.useCallback)(() => {
|
|
487827
487617
|
stdout3.write("\x1B[?2026h");
|
|
487828
487618
|
stdout3.write(base_exports.clearTerminal);
|
|
487829
487619
|
stdout3.write("\x1B[?2026l");
|
|
@@ -487859,7 +487649,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487859
487649
|
cancelAuthentication
|
|
487860
487650
|
} = useAuthCommand(settings2, config2, historyManager.addItem, refreshStatic);
|
|
487861
487651
|
useInitializationAuthError(initializationResult.authError, onAuthError);
|
|
487862
|
-
(0,
|
|
487652
|
+
(0, import_react175.useEffect)(() => {
|
|
487863
487653
|
const currentAuthType = config2.getModelsConfig().getCurrentAuthType();
|
|
487864
487654
|
if (settings2.merged.security?.auth?.enforcedType && currentAuthType && settings2.merged.security?.auth.enforcedType !== currentAuthType) {
|
|
487865
487655
|
onAuthError(
|
|
@@ -487885,7 +487675,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487885
487675
|
config2,
|
|
487886
487676
|
onAuthError
|
|
487887
487677
|
]);
|
|
487888
|
-
const [editorError, setEditorError] = (0,
|
|
487678
|
+
const [editorError, setEditorError] = (0, import_react175.useState)(null);
|
|
487889
487679
|
const {
|
|
487890
487680
|
isEditorDialogOpen,
|
|
487891
487681
|
openEditorDialog,
|
|
@@ -487929,10 +487719,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487929
487719
|
} = useExtensionsManagerDialog();
|
|
487930
487720
|
const { isMcpDialogOpen, openMcpDialog, closeMcpDialog } = useMcpDialog();
|
|
487931
487721
|
const { isHooksDialogOpen, openHooksDialog, closeHooksDialog } = useHooksDialog();
|
|
487932
|
-
const [isRewindDialogOpen, setIsRewindDialogOpen] = (0,
|
|
487933
|
-
const openRewindDialog = (0,
|
|
487934
|
-
const closeRewindDialog = (0,
|
|
487935
|
-
const slashCommandActions = (0,
|
|
487722
|
+
const [isRewindDialogOpen, setIsRewindDialogOpen] = (0, import_react175.useState)(false);
|
|
487723
|
+
const openRewindDialog = (0, import_react175.useCallback)(() => setIsRewindDialogOpen(true), []);
|
|
487724
|
+
const closeRewindDialog = (0, import_react175.useCallback)(() => setIsRewindDialogOpen(false), []);
|
|
487725
|
+
const slashCommandActions = (0, import_react175.useMemo)(
|
|
487936
487726
|
() => ({
|
|
487937
487727
|
openAuthDialog,
|
|
487938
487728
|
openThemeDialog,
|
|
@@ -488010,14 +487800,14 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488010
487800
|
isConfigInitialized,
|
|
488011
487801
|
logger10
|
|
488012
487802
|
);
|
|
488013
|
-
const onDebugMessage = (0,
|
|
487803
|
+
const onDebugMessage = (0, import_react175.useCallback)(
|
|
488014
487804
|
(message) => {
|
|
488015
487805
|
config2.getDebugLogger().debug(message);
|
|
488016
487806
|
},
|
|
488017
487807
|
[config2]
|
|
488018
487808
|
);
|
|
488019
487809
|
const stableAddItem = historyManager.addItem;
|
|
488020
|
-
const performMemoryRefresh = (0,
|
|
487810
|
+
const performMemoryRefresh = (0, import_react175.useCallback)(async () => {
|
|
488021
487811
|
stableAddItem(
|
|
488022
487812
|
{
|
|
488023
487813
|
type: "info" /* INFO */,
|
|
@@ -488063,7 +487853,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488063
487853
|
debugLogger159.error("Error refreshing memory:", error40);
|
|
488064
487854
|
}
|
|
488065
487855
|
}, [config2, stableAddItem, settings2.merged]);
|
|
488066
|
-
const cancelHandlerRef = (0,
|
|
487856
|
+
const cancelHandlerRef = (0, import_react175.useRef)(() => {
|
|
488067
487857
|
});
|
|
488068
487858
|
const { messageQueue, addMessage, popLast, drain } = useMessageQueue();
|
|
488069
487859
|
const voiceEnabled = settings2.merged.voice?.enabled ?? false;
|
|
@@ -488115,7 +487905,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488115
487905
|
drain,
|
|
488116
487906
|
submitQuery
|
|
488117
487907
|
);
|
|
488118
|
-
const [hasSuggestionsVisible, setHasSuggestionsVisible] = (0,
|
|
487908
|
+
const [hasSuggestionsVisible, setHasSuggestionsVisible] = (0, import_react175.useState)(false);
|
|
488119
487909
|
const agentViewState = useAgentViewState();
|
|
488120
487910
|
const geminiClient = config2.getGeminiClient();
|
|
488121
487911
|
const showAutoAcceptIndicator = useAutoAcceptIndicator({
|
|
@@ -488143,17 +487933,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488143
487933
|
settingInputRequests,
|
|
488144
487934
|
pendingGeminiHistoryItems
|
|
488145
487935
|
});
|
|
488146
|
-
|
|
488147
|
-
config: config2,
|
|
488148
|
-
geminiClient,
|
|
488149
|
-
streamingState,
|
|
488150
|
-
history: historyManager.history,
|
|
488151
|
-
addItem: historyManager.addItem,
|
|
488152
|
-
enabled: settings2.merged.recap?.enabled ?? true,
|
|
488153
|
-
thresholdSeconds: settings2.merged.recap?.thresholdSeconds ?? 300,
|
|
488154
|
-
thresholdToolCalls: settings2.merged.recap?.thresholdToolCalls ?? 15
|
|
488155
|
-
});
|
|
488156
|
-
const handleFinalSubmit = (0, import_react176.useCallback)(
|
|
487936
|
+
const handleFinalSubmit = (0, import_react175.useCallback)(
|
|
488157
487937
|
(submittedValue) => {
|
|
488158
487938
|
if (agentViewState.activeView !== "main") {
|
|
488159
487939
|
const agent = agentViewState.agents.get(agentViewState.activeView);
|
|
@@ -488261,7 +488041,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488261
488041
|
speculationRef
|
|
488262
488042
|
]
|
|
488263
488043
|
);
|
|
488264
|
-
const handleArenaModelsSelected = (0,
|
|
488044
|
+
const handleArenaModelsSelected = (0, import_react175.useCallback)(
|
|
488265
488045
|
(models) => {
|
|
488266
488046
|
const value = models.join(",");
|
|
488267
488047
|
buffer.setText(`/arena start --models ${value} `);
|
|
@@ -488276,7 +488056,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488276
488056
|
handleWelcomeBackSelection,
|
|
488277
488057
|
handleWelcomeBackClose
|
|
488278
488058
|
} = useWelcomeBack(config2, handleFinalSubmit, buffer, settings2.merged);
|
|
488279
|
-
cancelHandlerRef.current = (0,
|
|
488059
|
+
cancelHandlerRef.current = (0, import_react175.useCallback)(() => {
|
|
488280
488060
|
const pendingHistoryItems2 = [
|
|
488281
488061
|
...pendingSlashCommandHistoryItems,
|
|
488282
488062
|
...pendingGeminiHistoryItems
|
|
@@ -488301,15 +488081,15 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488301
488081
|
pendingSlashCommandHistoryItems,
|
|
488302
488082
|
pendingGeminiHistoryItems
|
|
488303
488083
|
]);
|
|
488304
|
-
const handleClearScreen = (0,
|
|
488084
|
+
const handleClearScreen = (0, import_react175.useCallback)(() => {
|
|
488305
488085
|
historyManager.clearItems();
|
|
488306
488086
|
clearScreen2();
|
|
488307
488087
|
refreshStatic();
|
|
488308
488088
|
}, [historyManager, refreshStatic]);
|
|
488309
488089
|
const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
|
|
488310
488090
|
const isInputActive = !initError && !isProcessing && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */);
|
|
488311
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
488312
|
-
(0,
|
|
488091
|
+
const [controlsHeight, setControlsHeight] = (0, import_react175.useState)(0);
|
|
488092
|
+
(0, import_react175.useLayoutEffect)(() => {
|
|
488313
488093
|
if (mainControlsRef.current) {
|
|
488314
488094
|
const fullFooterMeasurement = measure_element_default(mainControlsRef.current);
|
|
488315
488095
|
if (fullFooterMeasurement.height > 0) {
|
|
@@ -488333,13 +488113,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488333
488113
|
});
|
|
488334
488114
|
const isFocused = useFocus();
|
|
488335
488115
|
useBracketedPaste();
|
|
488336
|
-
const contextFileNames = (0,
|
|
488116
|
+
const contextFileNames = (0, import_react175.useMemo)(() => {
|
|
488337
488117
|
const fromSettings = settings2.merged.context?.fileName;
|
|
488338
488118
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllGeminiMdFilenames();
|
|
488339
488119
|
}, [settings2.merged.context?.fileName]);
|
|
488340
|
-
const initialPrompt = (0,
|
|
488341
|
-
const initialPromptSubmitted = (0,
|
|
488342
|
-
(0,
|
|
488120
|
+
const initialPrompt = (0, import_react175.useMemo)(() => config2.getQuestion(), [config2]);
|
|
488121
|
+
const initialPromptSubmitted = (0, import_react175.useRef)(false);
|
|
488122
|
+
(0, import_react175.useEffect)(() => {
|
|
488343
488123
|
if (activePtyId) {
|
|
488344
488124
|
ShellExecutionService.resizePty(
|
|
488345
488125
|
activePtyId,
|
|
@@ -488348,7 +488128,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488348
488128
|
);
|
|
488349
488129
|
}
|
|
488350
488130
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
488351
|
-
(0,
|
|
488131
|
+
(0, import_react175.useEffect)(() => {
|
|
488352
488132
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && welcomeBackChoice !== "restart" && geminiClient?.isInitialized?.()) {
|
|
488353
488133
|
handleFinalSubmit(initialPrompt);
|
|
488354
488134
|
initialPromptSubmitted.current = true;
|
|
@@ -488365,9 +488145,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488365
488145
|
welcomeBackChoice,
|
|
488366
488146
|
geminiClient
|
|
488367
488147
|
]);
|
|
488368
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
488369
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
488370
|
-
(0,
|
|
488148
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react175.useState)(false);
|
|
488149
|
+
const [currentIDE, setCurrentIDE] = (0, import_react175.useState)(null);
|
|
488150
|
+
(0, import_react175.useEffect)(() => {
|
|
488371
488151
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
488372
488152
|
const ideClient = await IdeClient.getInstance();
|
|
488373
488153
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -488383,20 +488163,20 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488383
488163
|
tomlFiles: commandMigrationTomlFiles,
|
|
488384
488164
|
setShowMigrationNudge: setShowCommandMigrationNudge
|
|
488385
488165
|
} = useCommandMigration(settings2, config2.storage);
|
|
488386
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
488387
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
488166
|
+
const [ideContextState, setIdeContextState] = (0, import_react175.useState)();
|
|
488167
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react175.useState)(false);
|
|
488388
488168
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings2, setIsTrustedFolder);
|
|
488389
488169
|
const {
|
|
488390
488170
|
needsRestart: ideNeedsRestart,
|
|
488391
488171
|
restartReason: ideTrustRestartReason
|
|
488392
488172
|
} = useIdeTrustListener();
|
|
488393
|
-
const isInitialMount = (0,
|
|
488394
|
-
(0,
|
|
488173
|
+
const isInitialMount = (0, import_react175.useRef)(true);
|
|
488174
|
+
(0, import_react175.useEffect)(() => {
|
|
488395
488175
|
if (ideNeedsRestart) {
|
|
488396
488176
|
setShowIdeRestartPrompt(true);
|
|
488397
488177
|
}
|
|
488398
488178
|
}, [ideNeedsRestart]);
|
|
488399
|
-
(0,
|
|
488179
|
+
(0, import_react175.useEffect)(() => {
|
|
488400
488180
|
if (isInitialMount.current) {
|
|
488401
488181
|
isInitialMount.current = false;
|
|
488402
488182
|
return;
|
|
@@ -488408,12 +488188,12 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488408
488188
|
clearTimeout(handler);
|
|
488409
488189
|
};
|
|
488410
488190
|
}, [terminalWidth, refreshStatic]);
|
|
488411
|
-
(0,
|
|
488191
|
+
(0, import_react175.useEffect)(() => {
|
|
488412
488192
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
488413
488193
|
setIdeContextState(ideContextStore.get());
|
|
488414
488194
|
return unsubscribe;
|
|
488415
488195
|
}, []);
|
|
488416
|
-
const handleIdePromptComplete = (0,
|
|
488196
|
+
const handleIdePromptComplete = (0, import_react175.useCallback)(
|
|
488417
488197
|
(result) => {
|
|
488418
488198
|
if (result.userSelection === "yes") {
|
|
488419
488199
|
if (result.isExtensionPreInstalled) {
|
|
@@ -488429,7 +488209,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488429
488209
|
},
|
|
488430
488210
|
[handleSlashCommand2, settings2]
|
|
488431
488211
|
);
|
|
488432
|
-
const handleCommandMigrationComplete = (0,
|
|
488212
|
+
const handleCommandMigrationComplete = (0, import_react175.useCallback)(
|
|
488433
488213
|
async (result) => {
|
|
488434
488214
|
setShowCommandMigrationNudge(false);
|
|
488435
488215
|
if (result.userSelection === "yes") {
|
|
@@ -488588,11 +488368,11 @@ ${migrationResult.failedFiles.map((f5) => ` \u2022 ${f5.file}: ${f5.error}`).jo
|
|
|
488588
488368
|
history: historyManager.history,
|
|
488589
488369
|
sessionStats
|
|
488590
488370
|
});
|
|
488591
|
-
const pendingHistoryItems = (0,
|
|
488371
|
+
const pendingHistoryItems = (0, import_react175.useMemo)(
|
|
488592
488372
|
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
|
|
488593
488373
|
[pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]
|
|
488594
488374
|
);
|
|
488595
|
-
const uiState = (0,
|
|
488375
|
+
const uiState = (0, import_react175.useMemo)(
|
|
488596
488376
|
() => ({
|
|
488597
488377
|
history: historyManager.history,
|
|
488598
488378
|
historyManager,
|
|
@@ -488817,7 +488597,7 @@ ${migrationResult.failedFiles.map((f5) => ` \u2022 ${f5.file}: ${f5.error}`).jo
|
|
|
488817
488597
|
dismissPromptSuggestion
|
|
488818
488598
|
]
|
|
488819
488599
|
);
|
|
488820
|
-
const uiActions = (0,
|
|
488600
|
+
const uiActions = (0, import_react175.useMemo)(
|
|
488821
488601
|
() => ({
|
|
488822
488602
|
openThemeDialog,
|
|
488823
488603
|
openEditorDialog,
|
|
@@ -488968,9 +488748,9 @@ ${migrationResult.failedFiles.map((f5) => ` \u2022 ${f5.file}: ${f5.error}`).jo
|
|
|
488968
488748
|
|
|
488969
488749
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
488970
488750
|
init_esbuild_shims();
|
|
488971
|
-
var
|
|
488751
|
+
var import_react176 = __toESM(require_react(), 1);
|
|
488972
488752
|
function useKittyKeyboardProtocol() {
|
|
488973
|
-
const [status] = (0,
|
|
488753
|
+
const [status] = (0, import_react176.useState)({
|
|
488974
488754
|
supported: isKittyProtocolSupported(),
|
|
488975
488755
|
enabled: isKittyProtocolEnabled(),
|
|
488976
488756
|
checking: false
|
|
@@ -489950,7 +489730,7 @@ __name(validateNonInteractiveAuth, "validateNonInteractiveAuth");
|
|
|
489950
489730
|
|
|
489951
489731
|
// packages/cli/src/ui/components/StandaloneSessionPicker.tsx
|
|
489952
489732
|
init_esbuild_shims();
|
|
489953
|
-
var
|
|
489733
|
+
var import_react177 = __toESM(require_react(), 1);
|
|
489954
489734
|
init_dist4();
|
|
489955
489735
|
var import_jsx_runtime141 = __toESM(require_jsx_runtime(), 1);
|
|
489956
489736
|
function StandalonePickerScreen({
|
|
@@ -489960,7 +489740,7 @@ function StandalonePickerScreen({
|
|
|
489960
489740
|
currentBranch
|
|
489961
489741
|
}) {
|
|
489962
489742
|
const { exit } = use_app_default();
|
|
489963
|
-
const [isExiting, setIsExiting] = (0,
|
|
489743
|
+
const [isExiting, setIsExiting] = (0, import_react177.useState)(false);
|
|
489964
489744
|
const handleExit = /* @__PURE__ */ __name(() => {
|
|
489965
489745
|
setIsExiting(true);
|
|
489966
489746
|
exit();
|
|
@@ -493062,7 +492842,7 @@ var QwenAgent = class {
|
|
|
493062
492842
|
async initialize(args2) {
|
|
493063
492843
|
this.clientCapabilities = args2.clientCapabilities;
|
|
493064
492844
|
const authMethods = buildAuthMethods();
|
|
493065
|
-
const version2 = "0.26.
|
|
492845
|
+
const version2 = "0.26.24";
|
|
493066
492846
|
return {
|
|
493067
492847
|
protocolVersion: PROTOCOL_VERSION,
|
|
493068
492848
|
agentInfo: {
|
|
@@ -493736,7 +493516,7 @@ async function startInteractiveUI(config2, settings2, startupWarnings, workspace
|
|
|
493736
493516
|
) });
|
|
493737
493517
|
}, "AppWrapper");
|
|
493738
493518
|
const instance2 = render_default(
|
|
493739
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
493519
|
+
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_react178.default.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(AppWrapper, {}) }) : /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(AppWrapper, {}),
|
|
493740
493520
|
{
|
|
493741
493521
|
exitOnCtrlC: false,
|
|
493742
493522
|
patchConsole: false,
|
|
@@ -494357,20 +494137,6 @@ main().catch((error40) => {
|
|
|
494357
494137
|
* Copyright 2025 ProtoLabs
|
|
494358
494138
|
* SPDX-License-Identifier: Apache-2.0
|
|
494359
494139
|
*/
|
|
494360
|
-
/**
|
|
494361
|
-
* @license
|
|
494362
|
-
* Copyright 2025 protoLabs Studio
|
|
494363
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
494364
|
-
*
|
|
494365
|
-
* useRecap — appends a "where we left off" card after long agent turns.
|
|
494366
|
-
*
|
|
494367
|
-
* Trigger: streamingState transitions from non-Idle to Idle, AND either
|
|
494368
|
-
* - turn wall-clock duration > recap.thresholdSeconds, OR
|
|
494369
|
-
* - tool calls during the turn > recap.thresholdToolCalls
|
|
494370
|
-
*
|
|
494371
|
-
* Settings: recap.enabled (default true), recap.thresholdSeconds (300),
|
|
494372
|
-
* recap.thresholdToolCalls (15). All in user settings.
|
|
494373
|
-
*/
|
|
494374
494140
|
/*! Bundled license information:
|
|
494375
494141
|
|
|
494376
494142
|
undici/lib/web/fetch/body.js:
|