@protolabsai/proto 0.26.23 → 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 +315 -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 */;
|
|
@@ -482383,101 +482256,9 @@ ${verifyResult}` });
|
|
|
482383
482256
|
};
|
|
482384
482257
|
}, "useGeminiStream");
|
|
482385
482258
|
|
|
482386
|
-
// packages/cli/src/ui/hooks/useRecap.ts
|
|
482387
|
-
init_esbuild_shims();
|
|
482388
|
-
var import_react150 = __toESM(require_react(), 1);
|
|
482389
|
-
init_dist4();
|
|
482390
|
-
function countToolGroupsSince(history, startIndex) {
|
|
482391
|
-
let count = 0;
|
|
482392
|
-
for (let i4 = startIndex; i4 < history.length; i4++) {
|
|
482393
|
-
if (history[i4]?.type === "tool_group") count++;
|
|
482394
|
-
}
|
|
482395
|
-
return count;
|
|
482396
|
-
}
|
|
482397
|
-
__name(countToolGroupsSince, "countToolGroupsSince");
|
|
482398
|
-
function hasRecapSinceLastUserTurn(history) {
|
|
482399
|
-
for (let i4 = history.length - 1; i4 >= 0; i4--) {
|
|
482400
|
-
const item = history[i4];
|
|
482401
|
-
if (!item) continue;
|
|
482402
|
-
if (item.type === "user" /* USER */) return false;
|
|
482403
|
-
if (item.type === "recap") return true;
|
|
482404
|
-
}
|
|
482405
|
-
return false;
|
|
482406
|
-
}
|
|
482407
|
-
__name(hasRecapSinceLastUserTurn, "hasRecapSinceLastUserTurn");
|
|
482408
|
-
function useRecap(opts) {
|
|
482409
|
-
const {
|
|
482410
|
-
config: config2,
|
|
482411
|
-
geminiClient,
|
|
482412
|
-
streamingState,
|
|
482413
|
-
history,
|
|
482414
|
-
addItem,
|
|
482415
|
-
enabled,
|
|
482416
|
-
thresholdSeconds,
|
|
482417
|
-
thresholdToolCalls
|
|
482418
|
-
} = opts;
|
|
482419
|
-
const turnRef = (0, import_react150.useRef)(null);
|
|
482420
|
-
const prevStateRef = (0, import_react150.useRef)(streamingState);
|
|
482421
|
-
const abortRef = (0, import_react150.useRef)(null);
|
|
482422
|
-
(0, import_react150.useEffect)(() => {
|
|
482423
|
-
const prev = prevStateRef.current;
|
|
482424
|
-
prevStateRef.current = streamingState;
|
|
482425
|
-
if (prev === "idle" /* Idle */ && streamingState !== "idle" /* Idle */) {
|
|
482426
|
-
turnRef.current = {
|
|
482427
|
-
startTime: Date.now(),
|
|
482428
|
-
historyLengthAtStart: history.length
|
|
482429
|
-
};
|
|
482430
|
-
return;
|
|
482431
|
-
}
|
|
482432
|
-
if (prev !== "idle" /* Idle */ && streamingState === "idle" /* Idle */) {
|
|
482433
|
-
const turn = turnRef.current;
|
|
482434
|
-
turnRef.current = null;
|
|
482435
|
-
if (!enabled || !config2 || !geminiClient || !turn) return;
|
|
482436
|
-
const durationSec = (Date.now() - turn.startTime) / 1e3;
|
|
482437
|
-
const toolCount = countToolGroupsSince(
|
|
482438
|
-
history,
|
|
482439
|
-
turn.historyLengthAtStart
|
|
482440
|
-
);
|
|
482441
|
-
const longEnough = durationSec > thresholdSeconds || toolCount > thresholdToolCalls;
|
|
482442
|
-
if (!longEnough) return;
|
|
482443
|
-
if (hasRecapSinceLastUserTurn(history)) return;
|
|
482444
|
-
const conversation = geminiClient.getHistory?.() ?? [];
|
|
482445
|
-
const hasModelHistory = conversation.some((c4) => c4.role === "model");
|
|
482446
|
-
const hasUserHistory = conversation.some((c4) => c4.role === "user");
|
|
482447
|
-
if (!hasModelHistory || !hasUserHistory) return;
|
|
482448
|
-
abortRef.current?.abort();
|
|
482449
|
-
const controller = new AbortController();
|
|
482450
|
-
abortRef.current = controller;
|
|
482451
|
-
void generateRecap(config2, conversation, controller.signal).then(
|
|
482452
|
-
(text) => {
|
|
482453
|
-
if (controller.signal.aborted || !text) return;
|
|
482454
|
-
addItem({ type: "recap" /* RECAP */, text }, Date.now());
|
|
482455
|
-
}
|
|
482456
|
-
);
|
|
482457
|
-
}
|
|
482458
|
-
}, [
|
|
482459
|
-
streamingState,
|
|
482460
|
-
history,
|
|
482461
|
-
enabled,
|
|
482462
|
-
thresholdSeconds,
|
|
482463
|
-
thresholdToolCalls,
|
|
482464
|
-
config2,
|
|
482465
|
-
geminiClient,
|
|
482466
|
-
addItem
|
|
482467
|
-
]);
|
|
482468
|
-
(0, import_react150.useEffect)(
|
|
482469
|
-
() => () => {
|
|
482470
|
-
abortRef.current?.abort();
|
|
482471
|
-
abortRef.current = null;
|
|
482472
|
-
},
|
|
482473
|
-
[]
|
|
482474
|
-
);
|
|
482475
|
-
}
|
|
482476
|
-
__name(useRecap, "useRecap");
|
|
482477
|
-
|
|
482478
482259
|
// packages/cli/src/ui/hooks/vim.ts
|
|
482479
482260
|
init_esbuild_shims();
|
|
482480
|
-
var
|
|
482261
|
+
var import_react150 = __toESM(require_react(), 1);
|
|
482481
482262
|
init_dist4();
|
|
482482
482263
|
var DIGIT_MULTIPLIER = 10;
|
|
482483
482264
|
var DEFAULT_COUNT = 1;
|
|
@@ -482542,22 +482323,22 @@ var vimReducer = /* @__PURE__ */ __name((state, action) => {
|
|
|
482542
482323
|
}, "vimReducer");
|
|
482543
482324
|
function useVim(buffer, onSubmit) {
|
|
482544
482325
|
const { vimEnabled, vimMode, setVimMode } = useVimMode();
|
|
482545
|
-
const [state, dispatch] = (0,
|
|
482546
|
-
(0,
|
|
482326
|
+
const [state, dispatch] = (0, import_react150.useReducer)(vimReducer, initialVimState);
|
|
482327
|
+
(0, import_react150.useEffect)(() => {
|
|
482547
482328
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
482548
482329
|
}, [vimMode]);
|
|
482549
|
-
const updateMode = (0,
|
|
482330
|
+
const updateMode = (0, import_react150.useCallback)(
|
|
482550
482331
|
(mode) => {
|
|
482551
482332
|
setVimMode(mode);
|
|
482552
482333
|
dispatch({ type: "SET_MODE", mode });
|
|
482553
482334
|
},
|
|
482554
482335
|
[setVimMode]
|
|
482555
482336
|
);
|
|
482556
|
-
const getCurrentCount = (0,
|
|
482337
|
+
const getCurrentCount = (0, import_react150.useCallback)(
|
|
482557
482338
|
() => state.count || DEFAULT_COUNT,
|
|
482558
482339
|
[state.count]
|
|
482559
482340
|
);
|
|
482560
|
-
const executeCommand = (0,
|
|
482341
|
+
const executeCommand = (0, import_react150.useCallback)(
|
|
482561
482342
|
(cmdType, count) => {
|
|
482562
482343
|
switch (cmdType) {
|
|
482563
482344
|
case CMD_TYPES.DELETE_WORD_FORWARD: {
|
|
@@ -482633,7 +482414,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482633
482414
|
},
|
|
482634
482415
|
[buffer, updateMode]
|
|
482635
482416
|
);
|
|
482636
|
-
const handleInsertModeInput = (0,
|
|
482417
|
+
const handleInsertModeInput = (0, import_react150.useCallback)(
|
|
482637
482418
|
(normalizedKey) => {
|
|
482638
482419
|
if (normalizedKey.name === "escape") {
|
|
482639
482420
|
buffer.vimEscapeInsertMode();
|
|
@@ -482664,7 +482445,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482664
482445
|
},
|
|
482665
482446
|
[buffer, dispatch, updateMode, onSubmit]
|
|
482666
482447
|
);
|
|
482667
|
-
const normalizeKey = (0,
|
|
482448
|
+
const normalizeKey = (0, import_react150.useCallback)(
|
|
482668
482449
|
(key) => ({
|
|
482669
482450
|
name: key.name || "",
|
|
482670
482451
|
sequence: key.sequence || "",
|
|
@@ -482675,7 +482456,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482675
482456
|
}),
|
|
482676
482457
|
[]
|
|
482677
482458
|
);
|
|
482678
|
-
const handleChangeMovement = (0,
|
|
482459
|
+
const handleChangeMovement = (0, import_react150.useCallback)(
|
|
482679
482460
|
(movement) => {
|
|
482680
482461
|
const count = getCurrentCount();
|
|
482681
482462
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -482696,7 +482477,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482696
482477
|
},
|
|
482697
482478
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
482698
482479
|
);
|
|
482699
|
-
const handleOperatorMotion = (0,
|
|
482480
|
+
const handleOperatorMotion = (0, import_react150.useCallback)(
|
|
482700
482481
|
(operator2, motion) => {
|
|
482701
482482
|
const count = getCurrentCount();
|
|
482702
482483
|
const commandMap = {
|
|
@@ -482723,7 +482504,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482723
482504
|
},
|
|
482724
482505
|
[getCurrentCount, executeCommand, dispatch]
|
|
482725
482506
|
);
|
|
482726
|
-
const handleInput = (0,
|
|
482507
|
+
const handleInput = (0, import_react150.useCallback)(
|
|
482727
482508
|
(key) => {
|
|
482728
482509
|
if (!vimEnabled) {
|
|
482729
482510
|
return false;
|
|
@@ -483023,14 +482804,14 @@ __name(useVim, "useVim");
|
|
|
483023
482804
|
|
|
483024
482805
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
483025
482806
|
init_esbuild_shims();
|
|
483026
|
-
var
|
|
482807
|
+
var import_react151 = __toESM(require_react(), 1);
|
|
483027
482808
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
483028
482809
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
483029
482810
|
var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
483030
482811
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
483031
482812
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
483032
482813
|
}, "cleanup");
|
|
483033
|
-
(0,
|
|
482814
|
+
(0, import_react151.useEffect)(() => {
|
|
483034
482815
|
process.stdout.write(`\x1B[?2026h${ENABLE_BRACKETED_PASTE}\x1B[?2026l`);
|
|
483035
482816
|
process.on("exit", cleanup);
|
|
483036
482817
|
process.on("SIGINT", cleanup);
|
|
@@ -483046,7 +482827,7 @@ var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
|
483046
482827
|
|
|
483047
482828
|
// packages/cli/src/ui/hooks/useKeyboardHandling.ts
|
|
483048
482829
|
init_esbuild_shims();
|
|
483049
|
-
var
|
|
482830
|
+
var import_react152 = __toESM(require_react(), 1);
|
|
483050
482831
|
init_dist4();
|
|
483051
482832
|
var CTRL_EXIT_PROMPT_DURATION_MS = 1e3;
|
|
483052
482833
|
function useKeyboardHandling(params) {
|
|
@@ -483069,20 +482850,20 @@ function useKeyboardHandling(params) {
|
|
|
483069
482850
|
debugKeystrokeLogging,
|
|
483070
482851
|
onBackgroundSession
|
|
483071
482852
|
} = params;
|
|
483072
|
-
const [showToolDescriptions, setShowToolDescriptions] = (0,
|
|
483073
|
-
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0,
|
|
483074
|
-
const ctrlCTimerRef = (0,
|
|
483075
|
-
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0,
|
|
483076
|
-
const ctrlDTimerRef = (0,
|
|
483077
|
-
const [escapePressedOnce, setEscapePressedOnce] = (0,
|
|
483078
|
-
const escapeTimerRef = (0,
|
|
483079
|
-
const dialogsVisibleRef = (0,
|
|
483080
|
-
const [constrainHeight, setConstrainHeight] = (0,
|
|
483081
|
-
const [showEscapePrompt, setShowEscapePrompt] = (0,
|
|
483082
|
-
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) => {
|
|
483083
482864
|
setShowEscapePrompt(showPrompt);
|
|
483084
482865
|
}, []);
|
|
483085
|
-
const globalKeypressHandlerRef = (0,
|
|
482866
|
+
const globalKeypressHandlerRef = (0, import_react152.useRef)(() => {
|
|
483086
482867
|
});
|
|
483087
482868
|
globalKeypressHandlerRef.current = (key) => {
|
|
483088
482869
|
if (debugKeystrokeLogging) {
|
|
@@ -483192,7 +482973,7 @@ function useKeyboardHandling(params) {
|
|
|
483192
482973
|
return;
|
|
483193
482974
|
}
|
|
483194
482975
|
};
|
|
483195
|
-
const handleGlobalKeypress = (0,
|
|
482976
|
+
const handleGlobalKeypress = (0, import_react152.useCallback)(
|
|
483196
482977
|
(key) => globalKeypressHandlerRef.current(key),
|
|
483197
482978
|
[]
|
|
483198
482979
|
);
|
|
@@ -483217,22 +482998,22 @@ init_esbuild_shims();
|
|
|
483217
482998
|
|
|
483218
482999
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
483219
483000
|
init_esbuild_shims();
|
|
483220
|
-
var
|
|
483001
|
+
var import_react153 = __toESM(require_react(), 1);
|
|
483221
483002
|
var WITTY_LOADING_PHRASES = ["I'm Feeling Lucky"];
|
|
483222
483003
|
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
483223
483004
|
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
483224
|
-
const loadingPhrases = (0,
|
|
483005
|
+
const loadingPhrases = (0, import_react153.useMemo)(() => {
|
|
483225
483006
|
if (customPhrases && customPhrases.length > 0) {
|
|
483226
483007
|
return customPhrases;
|
|
483227
483008
|
}
|
|
483228
483009
|
const translatedPhrases = ta("WITTY_LOADING_PHRASES");
|
|
483229
483010
|
return translatedPhrases.length > 0 ? translatedPhrases : WITTY_LOADING_PHRASES;
|
|
483230
483011
|
}, [customPhrases]);
|
|
483231
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0,
|
|
483012
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react153.useState)(
|
|
483232
483013
|
loadingPhrases[0]
|
|
483233
483014
|
);
|
|
483234
|
-
const phraseIntervalRef = (0,
|
|
483235
|
-
(0,
|
|
483015
|
+
const phraseIntervalRef = (0, import_react153.useRef)(null);
|
|
483016
|
+
(0, import_react153.useEffect)(() => {
|
|
483236
483017
|
if (isWaiting) {
|
|
483237
483018
|
setCurrentLoadingPhrase(t4("Waiting for user confirmation..."));
|
|
483238
483019
|
if (phraseIntervalRef.current) {
|
|
@@ -483269,9 +483050,9 @@ var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases
|
|
|
483269
483050
|
}, "usePhraseCycler");
|
|
483270
483051
|
|
|
483271
483052
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
483272
|
-
var
|
|
483053
|
+
var import_react154 = __toESM(require_react(), 1);
|
|
483273
483054
|
var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhrases, currentCandidatesTokens) => {
|
|
483274
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
483055
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react154.useState)(0);
|
|
483275
483056
|
const isTimerActive = streamingState === "responding" /* Responding */;
|
|
483276
483057
|
const elapsedTimeFromTimer = useTimer(isTimerActive, timerResetKey);
|
|
483277
483058
|
const isPhraseCyclingActive = streamingState === "responding" /* Responding */;
|
|
@@ -483281,10 +483062,10 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
483281
483062
|
isWaiting,
|
|
483282
483063
|
customWittyPhrases
|
|
483283
483064
|
);
|
|
483284
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
483285
|
-
const [taskStartTokens, setTaskStartTokens] = (0,
|
|
483286
|
-
const prevStreamingStateRef = (0,
|
|
483287
|
-
(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)(() => {
|
|
483288
483069
|
if (prevStreamingStateRef.current === "waiting_for_confirmation" /* WaitingForConfirmation */ && streamingState === "responding" /* Responding */) {
|
|
483289
483070
|
setTimerResetKey((prevKey) => prevKey + 1);
|
|
483290
483071
|
setRetainedElapsedTime(0);
|
|
@@ -483309,20 +483090,20 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
483309
483090
|
|
|
483310
483091
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
483311
483092
|
init_esbuild_shims();
|
|
483312
|
-
var
|
|
483093
|
+
var import_react155 = __toESM(require_react(), 1);
|
|
483313
483094
|
import * as process36 from "node:process";
|
|
483314
483095
|
var useFolderTrust = /* @__PURE__ */ __name((settings2, onTrustChange) => {
|
|
483315
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
483316
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
483317
|
-
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);
|
|
483318
483099
|
const folderTrust = settings2.merged.security?.folderTrust?.enabled;
|
|
483319
|
-
(0,
|
|
483100
|
+
(0, import_react155.useEffect)(() => {
|
|
483320
483101
|
const { isTrusted: trusted } = isWorkspaceTrusted(settings2.merged);
|
|
483321
483102
|
setIsTrusted(trusted);
|
|
483322
483103
|
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
483323
483104
|
onTrustChange(trusted);
|
|
483324
483105
|
}, [folderTrust, onTrustChange, settings2.merged]);
|
|
483325
|
-
const handleFolderTrustSelect = (0,
|
|
483106
|
+
const handleFolderTrustSelect = (0, import_react155.useCallback)(
|
|
483326
483107
|
(choice2) => {
|
|
483327
483108
|
const trustedFolders = loadTrustedFolders();
|
|
483328
483109
|
const cwd6 = process36.cwd();
|
|
@@ -483365,7 +483146,7 @@ var useFolderTrust = /* @__PURE__ */ __name((settings2, onTrustChange) => {
|
|
|
483365
483146
|
|
|
483366
483147
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
483367
483148
|
init_esbuild_shims();
|
|
483368
|
-
var
|
|
483149
|
+
var import_react156 = __toESM(require_react(), 1);
|
|
483369
483150
|
init_dist4();
|
|
483370
483151
|
|
|
483371
483152
|
// packages/cli/src/services/command-migration-tool.ts
|
|
@@ -483439,9 +483220,9 @@ __name(migrateTomlCommands, "migrateTomlCommands");
|
|
|
483439
483220
|
|
|
483440
483221
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
483441
483222
|
function useCommandMigration(settings2, storage) {
|
|
483442
|
-
const [showMigrationNudge, setShowMigrationNudge] = (0,
|
|
483443
|
-
const [tomlFiles, setTomlFiles] = (0,
|
|
483444
|
-
(0,
|
|
483223
|
+
const [showMigrationNudge, setShowMigrationNudge] = (0, import_react156.useState)(false);
|
|
483224
|
+
const [tomlFiles, setTomlFiles] = (0, import_react156.useState)([]);
|
|
483225
|
+
(0, import_react156.useEffect)(() => {
|
|
483445
483226
|
const checkTomlCommands = /* @__PURE__ */ __name(async () => {
|
|
483446
483227
|
const allFiles = [];
|
|
483447
483228
|
const workspaceCommandsDir = storage.getProjectCommandsDir();
|
|
@@ -483467,9 +483248,9 @@ __name(useCommandMigration, "useCommandMigration");
|
|
|
483467
483248
|
|
|
483468
483249
|
// packages/cli/src/ui/hooks/useIdleMessageDrain.ts
|
|
483469
483250
|
init_esbuild_shims();
|
|
483470
|
-
var
|
|
483251
|
+
var import_react157 = __toESM(require_react(), 1);
|
|
483471
483252
|
function useIdleMessageDrain(isConfigInitialized, streamingState, messageQueue, drain, submitQuery) {
|
|
483472
|
-
(0,
|
|
483253
|
+
(0, import_react157.useEffect)(() => {
|
|
483473
483254
|
if (isConfigInitialized && streamingState === "idle" /* Idle */ && messageQueue.length > 0) {
|
|
483474
483255
|
const combined = messageQueue.join("\n\n");
|
|
483475
483256
|
drain();
|
|
@@ -483481,7 +483262,7 @@ __name(useIdleMessageDrain, "useIdleMessageDrain");
|
|
|
483481
483262
|
|
|
483482
483263
|
// packages/cli/src/ui/hooks/useWindowTitle.ts
|
|
483483
483264
|
init_esbuild_shims();
|
|
483484
|
-
var
|
|
483265
|
+
var import_react158 = __toESM(require_react(), 1);
|
|
483485
483266
|
import { basename as basename31 } from "node:path";
|
|
483486
483267
|
|
|
483487
483268
|
// packages/cli/src/utils/windowTitle.ts
|
|
@@ -483498,9 +483279,9 @@ __name(computeWindowTitle, "computeWindowTitle");
|
|
|
483498
483279
|
|
|
483499
483280
|
// packages/cli/src/ui/hooks/useWindowTitle.ts
|
|
483500
483281
|
function useWindowTitle(streamingState, thought, settings2, stdout3, targetDir) {
|
|
483501
|
-
const originalTitleRef = (0,
|
|
483502
|
-
const lastTitleRef = (0,
|
|
483503
|
-
(0,
|
|
483282
|
+
const originalTitleRef = (0, import_react158.useRef)(computeWindowTitle(basename31(targetDir)));
|
|
483283
|
+
const lastTitleRef = (0, import_react158.useRef)(null);
|
|
483284
|
+
(0, import_react158.useEffect)(() => {
|
|
483504
483285
|
if (!settings2.merged.ui?.showStatusInTitle || settings2.merged.ui?.hideWindowTitle)
|
|
483505
483286
|
return;
|
|
483506
483287
|
let title;
|
|
@@ -483527,11 +483308,11 @@ __name(useWindowTitle, "useWindowTitle");
|
|
|
483527
483308
|
|
|
483528
483309
|
// packages/cli/src/ui/hooks/useInitializationEffects.ts
|
|
483529
483310
|
init_esbuild_shims();
|
|
483530
|
-
var
|
|
483311
|
+
var import_react159 = __toESM(require_react(), 1);
|
|
483531
483312
|
init_dist4();
|
|
483532
483313
|
var debugLogger155 = createDebugLogger("APP_CONTAINER");
|
|
483533
483314
|
function useInitializationEffects(config2, historyManager, setConfigInitialized) {
|
|
483534
|
-
(0,
|
|
483315
|
+
(0, import_react159.useEffect)(() => {
|
|
483535
483316
|
(async () => {
|
|
483536
483317
|
await config2.initialize();
|
|
483537
483318
|
setConfigInitialized(true);
|
|
@@ -483599,7 +483380,7 @@ __name(useInitializationEffects, "useInitializationEffects");
|
|
|
483599
483380
|
|
|
483600
483381
|
// packages/cli/src/ui/hooks/usePromptSuggestions.ts
|
|
483601
483382
|
init_esbuild_shims();
|
|
483602
|
-
var
|
|
483383
|
+
var import_react160 = __toESM(require_react(), 1);
|
|
483603
483384
|
init_dist4();
|
|
483604
483385
|
function usePromptSuggestions(params) {
|
|
483605
483386
|
const {
|
|
@@ -483615,17 +483396,17 @@ function usePromptSuggestions(params) {
|
|
|
483615
483396
|
settingInputRequests,
|
|
483616
483397
|
pendingGeminiHistoryItems
|
|
483617
483398
|
} = params;
|
|
483618
|
-
const [promptSuggestion, setPromptSuggestion] = (0,
|
|
483619
|
-
const prevStreamingStateRef = (0,
|
|
483620
|
-
const speculationRef = (0,
|
|
483621
|
-
const suggestionAbortRef = (0,
|
|
483622
|
-
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)(() => {
|
|
483623
483404
|
setPromptSuggestion(null);
|
|
483624
483405
|
suggestionAbortRef.current?.abort();
|
|
483625
483406
|
suggestionAbortRef.current = null;
|
|
483626
483407
|
}, []);
|
|
483627
483408
|
const followupSuggestionsEnabled = settings2.merged.ui?.enableFollowupSuggestions !== false;
|
|
483628
|
-
(0,
|
|
483409
|
+
(0, import_react160.useEffect)(() => {
|
|
483629
483410
|
if (!followupSuggestionsEnabled) {
|
|
483630
483411
|
suggestionAbortRef.current?.abort();
|
|
483631
483412
|
setPromptSuggestion(null);
|
|
@@ -483698,7 +483479,7 @@ function usePromptSuggestions(params) {
|
|
|
483698
483479
|
isPermissionsDialogOpen,
|
|
483699
483480
|
settingInputRequests
|
|
483700
483481
|
]);
|
|
483701
|
-
(0,
|
|
483482
|
+
(0, import_react160.useEffect)(() => {
|
|
483702
483483
|
if (!promptSuggestion && speculationRef.current.status !== "idle") {
|
|
483703
483484
|
abortSpeculation(speculationRef.current).catch(() => {
|
|
483704
483485
|
});
|
|
@@ -483716,7 +483497,7 @@ __name(usePromptSuggestions, "usePromptSuggestions");
|
|
|
483716
483497
|
|
|
483717
483498
|
// packages/cli/src/ui/hooks/useExitHandling.ts
|
|
483718
483499
|
init_esbuild_shims();
|
|
483719
|
-
var
|
|
483500
|
+
var import_react161 = __toESM(require_react(), 1);
|
|
483720
483501
|
function useExitHandling(params) {
|
|
483721
483502
|
const {
|
|
483722
483503
|
isAuthDialogOpen,
|
|
@@ -483726,7 +483507,7 @@ function useExitHandling(params) {
|
|
|
483726
483507
|
cancelOngoingRequest,
|
|
483727
483508
|
buffer
|
|
483728
483509
|
} = params;
|
|
483729
|
-
const handleExit = (0,
|
|
483510
|
+
const handleExit = (0, import_react161.useCallback)(
|
|
483730
483511
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
483731
483512
|
if (pressedOnce) {
|
|
483732
483513
|
if (timerRef.current) {
|
|
@@ -486869,7 +486650,7 @@ __name(setUpdateHandler, "setUpdateHandler");
|
|
|
486869
486650
|
|
|
486870
486651
|
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
486871
486652
|
init_esbuild_shims();
|
|
486872
|
-
var
|
|
486653
|
+
var import_react162 = __toESM(require_react(), 1);
|
|
486873
486654
|
var MessageQueueStore = class {
|
|
486874
486655
|
static {
|
|
486875
486656
|
__name(this, "MessageQueueStore");
|
|
@@ -486923,15 +486704,15 @@ var MessageQueueStore = class {
|
|
|
486923
486704
|
}
|
|
486924
486705
|
};
|
|
486925
486706
|
function useMessageQueue() {
|
|
486926
|
-
const store = (0,
|
|
486927
|
-
const messageQueue = (0,
|
|
486928
|
-
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)(
|
|
486929
486710
|
(message) => store.addMessage(message),
|
|
486930
486711
|
[store]
|
|
486931
486712
|
);
|
|
486932
|
-
const clearQueue = (0,
|
|
486933
|
-
const popLast = (0,
|
|
486934
|
-
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]);
|
|
486935
486716
|
return { messageQueue, addMessage, clearQueue, popLast, drain };
|
|
486936
486717
|
}
|
|
486937
486718
|
__name(useMessageQueue, "useMessageQueue");
|
|
@@ -486939,7 +486720,7 @@ __name(useMessageQueue, "useMessageQueue");
|
|
|
486939
486720
|
// packages/cli/src/ui/hooks/useAutoAcceptIndicator.ts
|
|
486940
486721
|
init_esbuild_shims();
|
|
486941
486722
|
init_dist4();
|
|
486942
|
-
var
|
|
486723
|
+
var import_react163 = __toESM(require_react(), 1);
|
|
486943
486724
|
function useAutoAcceptIndicator({
|
|
486944
486725
|
config: config2,
|
|
486945
486726
|
addItem,
|
|
@@ -486948,8 +486729,8 @@ function useAutoAcceptIndicator({
|
|
|
486948
486729
|
disabled
|
|
486949
486730
|
}) {
|
|
486950
486731
|
const currentConfigValue = config2.getApprovalMode();
|
|
486951
|
-
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0,
|
|
486952
|
-
(0,
|
|
486732
|
+
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0, import_react163.useState)(currentConfigValue);
|
|
486733
|
+
(0, import_react163.useEffect)(() => {
|
|
486953
486734
|
setShowAutoAcceptIndicator(currentConfigValue);
|
|
486954
486735
|
}, [currentConfigValue]);
|
|
486955
486736
|
useKeypress(
|
|
@@ -486987,7 +486768,7 @@ __name(useAutoAcceptIndicator, "useAutoAcceptIndicator");
|
|
|
486987
486768
|
|
|
486988
486769
|
// packages/cli/src/ui/hooks/useExtensionUpdates.ts
|
|
486989
486770
|
init_esbuild_shims();
|
|
486990
|
-
var
|
|
486771
|
+
var import_react164 = __toESM(require_react(), 1);
|
|
486991
486772
|
function confirmationRequestsReducer(state, action) {
|
|
486992
486773
|
switch (action.type) {
|
|
486993
486774
|
case "add":
|
|
@@ -487004,8 +486785,8 @@ var useConfirmUpdateRequests = /* @__PURE__ */ __name(() => {
|
|
|
487004
486785
|
const [
|
|
487005
486786
|
confirmUpdateExtensionRequests,
|
|
487006
486787
|
dispatchConfirmUpdateExtensionRequests
|
|
487007
|
-
] = (0,
|
|
487008
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
486788
|
+
] = (0, import_react164.useReducer)(confirmationRequestsReducer, []);
|
|
486789
|
+
const addConfirmUpdateExtensionRequest = (0, import_react164.useCallback)(
|
|
487009
486790
|
(original) => {
|
|
487010
486791
|
const wrappedRequest = {
|
|
487011
486792
|
prompt: original.prompt,
|
|
@@ -487043,11 +486824,11 @@ function settingInputRequestsReducer(state, action) {
|
|
|
487043
486824
|
}
|
|
487044
486825
|
__name(settingInputRequestsReducer, "settingInputRequestsReducer");
|
|
487045
486826
|
var useSettingInputRequests = /* @__PURE__ */ __name(() => {
|
|
487046
|
-
const [settingInputRequests, dispatchSettingInputRequests] = (0,
|
|
486827
|
+
const [settingInputRequests, dispatchSettingInputRequests] = (0, import_react164.useReducer)(
|
|
487047
486828
|
settingInputRequestsReducer,
|
|
487048
486829
|
[]
|
|
487049
486830
|
);
|
|
487050
|
-
const addSettingInputRequest = (0,
|
|
486831
|
+
const addSettingInputRequest = (0, import_react164.useCallback)(
|
|
487051
486832
|
(original) => {
|
|
487052
486833
|
const wrappedRequest = {
|
|
487053
486834
|
settingName: original.settingName,
|
|
@@ -487094,11 +486875,11 @@ function pluginChoiceRequestsReducer(state, action) {
|
|
|
487094
486875
|
}
|
|
487095
486876
|
__name(pluginChoiceRequestsReducer, "pluginChoiceRequestsReducer");
|
|
487096
486877
|
var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
487097
|
-
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0,
|
|
486878
|
+
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0, import_react164.useReducer)(
|
|
487098
486879
|
pluginChoiceRequestsReducer,
|
|
487099
486880
|
[]
|
|
487100
486881
|
);
|
|
487101
|
-
const addPluginChoiceRequest = (0,
|
|
486882
|
+
const addPluginChoiceRequest = (0, import_react164.useCallback)(
|
|
487102
486883
|
(original) => {
|
|
487103
486884
|
const wrappedRequest = {
|
|
487104
486885
|
marketplaceName: original.marketplaceName,
|
|
@@ -487132,12 +486913,12 @@ var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
|
487132
486913
|
};
|
|
487133
486914
|
}, "usePluginChoiceRequests");
|
|
487134
486915
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd6) => {
|
|
487135
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
486916
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react164.useReducer)(
|
|
487136
486917
|
extensionUpdatesReducer,
|
|
487137
486918
|
initialExtensionUpdatesState
|
|
487138
486919
|
);
|
|
487139
486920
|
const extensions = extensionManager.getLoadedExtensions();
|
|
487140
|
-
(0,
|
|
486921
|
+
(0, import_react164.useEffect)(() => {
|
|
487141
486922
|
(async () => {
|
|
487142
486923
|
const extensionsToCheck = extensions.filter((extension) => {
|
|
487143
486924
|
const currentStatus = extensionsUpdateState.extensionStatuses.get(
|
|
@@ -487165,7 +486946,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
487165
486946
|
extensionsUpdateState.extensionStatuses,
|
|
487166
486947
|
dispatchExtensionStateUpdate
|
|
487167
486948
|
]);
|
|
487168
|
-
(0,
|
|
486949
|
+
(0, import_react164.useEffect)(() => {
|
|
487169
486950
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
487170
486951
|
return;
|
|
487171
486952
|
}
|
|
@@ -487224,7 +487005,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
487224
487005
|
);
|
|
487225
487006
|
}
|
|
487226
487007
|
}, [extensions, extensionManager, extensionsUpdateState, addItem, cwd6]);
|
|
487227
|
-
const extensionsUpdateStateComputed = (0,
|
|
487008
|
+
const extensionsUpdateStateComputed = (0, import_react164.useMemo)(() => {
|
|
487228
487009
|
const result = /* @__PURE__ */ new Map();
|
|
487229
487010
|
for (const [
|
|
487230
487011
|
key,
|
|
@@ -487243,15 +487024,15 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
487243
487024
|
|
|
487244
487025
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
487245
487026
|
init_esbuild_shims();
|
|
487246
|
-
var
|
|
487027
|
+
var import_react165 = __toESM(require_react(), 1);
|
|
487247
487028
|
init_dist4();
|
|
487248
487029
|
function useWelcomeBack(config2, submitQuery, buffer, settings2) {
|
|
487249
|
-
const [welcomeBackInfo, setWelcomeBackInfo] = (0,
|
|
487250
|
-
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0,
|
|
487251
|
-
const [welcomeBackChoice, setWelcomeBackChoice] = (0,
|
|
487252
|
-
const [shouldFillInput, setShouldFillInput] = (0,
|
|
487253
|
-
const [inputFillText, setInputFillText] = (0,
|
|
487254
|
-
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 () => {
|
|
487255
487036
|
if (settings2.ui?.enableWelcomeBack === false) {
|
|
487256
487037
|
return;
|
|
487257
487038
|
}
|
|
@@ -487265,7 +487046,7 @@ function useWelcomeBack(config2, submitQuery, buffer, settings2) {
|
|
|
487265
487046
|
config2.getDebugLogger().debug("Welcome back check failed:", error40);
|
|
487266
487047
|
}
|
|
487267
487048
|
}, [config2, settings2.ui?.enableWelcomeBack]);
|
|
487268
|
-
const handleWelcomeBackSelection = (0,
|
|
487049
|
+
const handleWelcomeBackSelection = (0, import_react165.useCallback)(
|
|
487269
487050
|
(choice2) => {
|
|
487270
487051
|
setWelcomeBackChoice(choice2);
|
|
487271
487052
|
setShowWelcomeBackDialog(false);
|
|
@@ -487277,21 +487058,21 @@ function useWelcomeBack(config2, submitQuery, buffer, settings2) {
|
|
|
487277
487058
|
},
|
|
487278
487059
|
[welcomeBackInfo]
|
|
487279
487060
|
);
|
|
487280
|
-
const handleWelcomeBackClose = (0,
|
|
487061
|
+
const handleWelcomeBackClose = (0, import_react165.useCallback)(() => {
|
|
487281
487062
|
setWelcomeBackChoice("restart");
|
|
487282
487063
|
setShowWelcomeBackDialog(false);
|
|
487283
487064
|
}, []);
|
|
487284
|
-
const clearInputFill = (0,
|
|
487065
|
+
const clearInputFill = (0, import_react165.useCallback)(() => {
|
|
487285
487066
|
setShouldFillInput(false);
|
|
487286
487067
|
setInputFillText(null);
|
|
487287
487068
|
}, []);
|
|
487288
|
-
(0,
|
|
487069
|
+
(0, import_react165.useEffect)(() => {
|
|
487289
487070
|
if (shouldFillInput && inputFillText) {
|
|
487290
487071
|
buffer.setText(inputFillText);
|
|
487291
487072
|
clearInputFill();
|
|
487292
487073
|
}
|
|
487293
487074
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
487294
|
-
(0,
|
|
487075
|
+
(0, import_react165.useEffect)(() => {
|
|
487295
487076
|
checkWelcomeBack();
|
|
487296
487077
|
}, [checkWelcomeBack]);
|
|
487297
487078
|
return {
|
|
@@ -487312,9 +487093,9 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
487312
487093
|
|
|
487313
487094
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
487314
487095
|
init_esbuild_shims();
|
|
487315
|
-
var
|
|
487096
|
+
var import_react166 = __toESM(require_react(), 1);
|
|
487316
487097
|
function useDialogClose(options2) {
|
|
487317
|
-
const closeAnyOpenDialog = (0,
|
|
487098
|
+
const closeAnyOpenDialog = (0, import_react166.useCallback)(() => {
|
|
487318
487099
|
if (options2.isThemeDialogOpen) {
|
|
487319
487100
|
options2.handleThemeSelect(void 0, "User" /* User */);
|
|
487320
487101
|
return true;
|
|
@@ -487350,14 +487131,14 @@ __name(useDialogClose, "useDialogClose");
|
|
|
487350
487131
|
|
|
487351
487132
|
// packages/cli/src/ui/hooks/useInitializationAuthError.ts
|
|
487352
487133
|
init_esbuild_shims();
|
|
487353
|
-
var
|
|
487134
|
+
var import_react167 = __toESM(require_react(), 1);
|
|
487354
487135
|
var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError) => {
|
|
487355
|
-
const hasHandled = (0,
|
|
487356
|
-
const authErrorRef = (0,
|
|
487357
|
-
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);
|
|
487358
487139
|
authErrorRef.current = authError;
|
|
487359
487140
|
onAuthErrorRef.current = onAuthError;
|
|
487360
|
-
(0,
|
|
487141
|
+
(0, import_react167.useEffect)(() => {
|
|
487361
487142
|
if (hasHandled.current) {
|
|
487362
487143
|
return;
|
|
487363
487144
|
}
|
|
@@ -487370,13 +487151,13 @@ var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError)
|
|
|
487370
487151
|
|
|
487371
487152
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
487372
487153
|
init_esbuild_shims();
|
|
487373
|
-
var
|
|
487154
|
+
var import_react168 = __toESM(require_react(), 1);
|
|
487374
487155
|
function useSubagentCreateDialog() {
|
|
487375
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
487376
|
-
const openSubagentCreateDialog = (0,
|
|
487156
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react168.useState)(false);
|
|
487157
|
+
const openSubagentCreateDialog = (0, import_react168.useCallback)(() => {
|
|
487377
487158
|
setIsSubagentCreateDialogOpen(true);
|
|
487378
487159
|
}, []);
|
|
487379
|
-
const closeSubagentCreateDialog = (0,
|
|
487160
|
+
const closeSubagentCreateDialog = (0, import_react168.useCallback)(() => {
|
|
487380
487161
|
setIsSubagentCreateDialogOpen(false);
|
|
487381
487162
|
}, []);
|
|
487382
487163
|
return {
|
|
@@ -487389,13 +487170,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
487389
487170
|
|
|
487390
487171
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
487391
487172
|
init_esbuild_shims();
|
|
487392
|
-
var
|
|
487173
|
+
var import_react169 = __toESM(require_react(), 1);
|
|
487393
487174
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
487394
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
487395
|
-
const openAgentsManagerDialog = (0,
|
|
487175
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react169.useState)(false);
|
|
487176
|
+
const openAgentsManagerDialog = (0, import_react169.useCallback)(() => {
|
|
487396
487177
|
setIsAgentsManagerDialogOpen(true);
|
|
487397
487178
|
}, []);
|
|
487398
|
-
const closeAgentsManagerDialog = (0,
|
|
487179
|
+
const closeAgentsManagerDialog = (0, import_react169.useCallback)(() => {
|
|
487399
487180
|
setIsAgentsManagerDialogOpen(false);
|
|
487400
487181
|
}, []);
|
|
487401
487182
|
return {
|
|
@@ -487407,13 +487188,13 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
487407
487188
|
|
|
487408
487189
|
// packages/cli/src/ui/hooks/useExtensionsManagerDialog.ts
|
|
487409
487190
|
init_esbuild_shims();
|
|
487410
|
-
var
|
|
487191
|
+
var import_react170 = __toESM(require_react(), 1);
|
|
487411
487192
|
var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
487412
|
-
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0,
|
|
487413
|
-
const openExtensionsManagerDialog = (0,
|
|
487193
|
+
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0, import_react170.useState)(false);
|
|
487194
|
+
const openExtensionsManagerDialog = (0, import_react170.useCallback)(() => {
|
|
487414
487195
|
setIsExtensionsManagerDialogOpen(true);
|
|
487415
487196
|
}, []);
|
|
487416
|
-
const closeExtensionsManagerDialog = (0,
|
|
487197
|
+
const closeExtensionsManagerDialog = (0, import_react170.useCallback)(() => {
|
|
487417
487198
|
setIsExtensionsManagerDialogOpen(false);
|
|
487418
487199
|
}, []);
|
|
487419
487200
|
return {
|
|
@@ -487425,13 +487206,13 @@ var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
487425
487206
|
|
|
487426
487207
|
// packages/cli/src/ui/hooks/useMcpDialog.ts
|
|
487427
487208
|
init_esbuild_shims();
|
|
487428
|
-
var
|
|
487209
|
+
var import_react171 = __toESM(require_react(), 1);
|
|
487429
487210
|
var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
487430
|
-
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0,
|
|
487431
|
-
const openMcpDialog = (0,
|
|
487211
|
+
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0, import_react171.useState)(false);
|
|
487212
|
+
const openMcpDialog = (0, import_react171.useCallback)(() => {
|
|
487432
487213
|
setIsMcpDialogOpen(true);
|
|
487433
487214
|
}, []);
|
|
487434
|
-
const closeMcpDialog = (0,
|
|
487215
|
+
const closeMcpDialog = (0, import_react171.useCallback)(() => {
|
|
487435
487216
|
setIsMcpDialogOpen(false);
|
|
487436
487217
|
}, []);
|
|
487437
487218
|
return {
|
|
@@ -487443,13 +487224,13 @@ var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
|
487443
487224
|
|
|
487444
487225
|
// packages/cli/src/ui/hooks/useHooksDialog.ts
|
|
487445
487226
|
init_esbuild_shims();
|
|
487446
|
-
var
|
|
487227
|
+
var import_react172 = __toESM(require_react(), 1);
|
|
487447
487228
|
var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
487448
|
-
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0,
|
|
487449
|
-
const openHooksDialog = (0,
|
|
487229
|
+
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0, import_react172.useState)(false);
|
|
487230
|
+
const openHooksDialog = (0, import_react172.useCallback)(() => {
|
|
487450
487231
|
setIsHooksDialogOpen(true);
|
|
487451
487232
|
}, []);
|
|
487452
|
-
const closeHooksDialog = (0,
|
|
487233
|
+
const closeHooksDialog = (0, import_react172.useCallback)(() => {
|
|
487453
487234
|
setIsHooksDialogOpen(false);
|
|
487454
487235
|
}, []);
|
|
487455
487236
|
return {
|
|
@@ -487461,7 +487242,7 @@ var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
|
487461
487242
|
|
|
487462
487243
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
487463
487244
|
init_esbuild_shims();
|
|
487464
|
-
var
|
|
487245
|
+
var import_react173 = __toESM(require_react(), 1);
|
|
487465
487246
|
|
|
487466
487247
|
// packages/cli/src/utils/attentionNotification.ts
|
|
487467
487248
|
init_esbuild_shims();
|
|
@@ -487498,10 +487279,10 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
487498
487279
|
config: config2
|
|
487499
487280
|
}) => {
|
|
487500
487281
|
const terminalBellEnabled = settings2?.merged?.general?.terminalBell ?? true;
|
|
487501
|
-
const awaitingNotificationSentRef = (0,
|
|
487502
|
-
const respondingElapsedRef = (0,
|
|
487503
|
-
const idleNotificationSentRef = (0,
|
|
487504
|
-
(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)(() => {
|
|
487505
487286
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current) {
|
|
487506
487287
|
notifyTerminalAttention("tool_approval" /* ToolApproval */, {
|
|
487507
487288
|
enabled: terminalBellEnabled
|
|
@@ -487512,7 +487293,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
487512
487293
|
awaitingNotificationSentRef.current = false;
|
|
487513
487294
|
}
|
|
487514
487295
|
}, [isFocused, streamingState, terminalBellEnabled]);
|
|
487515
|
-
(0,
|
|
487296
|
+
(0, import_react173.useEffect)(() => {
|
|
487516
487297
|
if (streamingState === "responding" /* Responding */) {
|
|
487517
487298
|
respondingElapsedRef.current = elapsedTime;
|
|
487518
487299
|
idleNotificationSentRef.current = false;
|
|
@@ -487548,7 +487329,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
487548
487329
|
|
|
487549
487330
|
// packages/cli/src/ui/hooks/useVoice.ts
|
|
487550
487331
|
init_esbuild_shims();
|
|
487551
|
-
var
|
|
487332
|
+
var import_react174 = __toESM(require_react(), 1);
|
|
487552
487333
|
import os46 from "node:os";
|
|
487553
487334
|
import path149 from "node:path";
|
|
487554
487335
|
import fs134 from "node:fs";
|
|
@@ -487583,12 +487364,12 @@ __name(transcribe, "transcribe");
|
|
|
487583
487364
|
|
|
487584
487365
|
// packages/cli/src/ui/hooks/useVoice.ts
|
|
487585
487366
|
function useVoice(sttEndpoint, sttApiKey) {
|
|
487586
|
-
const [voiceState, setVoiceState] = (0,
|
|
487587
|
-
const [error40, setError] = (0,
|
|
487588
|
-
const procRef = (0,
|
|
487589
|
-
const audioPathRef = (0,
|
|
487590
|
-
const backend = (0,
|
|
487591
|
-
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 () => {
|
|
487592
487373
|
if (voiceState !== "idle") return;
|
|
487593
487374
|
const tmpPath = path149.join(os46.tmpdir(), `proto-voice-${Date.now()}.wav`);
|
|
487594
487375
|
audioPathRef.current = tmpPath;
|
|
@@ -487601,7 +487382,7 @@ function useVoice(sttEndpoint, sttApiKey) {
|
|
|
487601
487382
|
setError(e4 instanceof Error ? e4.message : String(e4));
|
|
487602
487383
|
}
|
|
487603
487384
|
}, [voiceState, backend]);
|
|
487604
|
-
const stop3 = (0,
|
|
487385
|
+
const stop3 = (0, import_react174.useCallback)(async () => {
|
|
487605
487386
|
if (voiceState !== "recording" || !procRef.current || !audioPathRef.current) {
|
|
487606
487387
|
return "";
|
|
487607
487388
|
}
|
|
@@ -487634,7 +487415,7 @@ function useVoice(sttEndpoint, sttApiKey) {
|
|
|
487634
487415
|
return "";
|
|
487635
487416
|
}
|
|
487636
487417
|
}, [voiceState, sttEndpoint, sttApiKey]);
|
|
487637
|
-
const reset = (0,
|
|
487418
|
+
const reset = (0, import_react174.useCallback)(() => {
|
|
487638
487419
|
setVoiceState("idle");
|
|
487639
487420
|
setError(null);
|
|
487640
487421
|
}, []);
|
|
@@ -487669,21 +487450,21 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487669
487450
|
const { settings: settings2, config: config2, initializationResult } = props;
|
|
487670
487451
|
const historyManager = useHistory();
|
|
487671
487452
|
useMemoryMonitor(historyManager);
|
|
487672
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
487673
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
487674
|
-
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)(
|
|
487675
487456
|
initializationResult.themeError
|
|
487676
487457
|
);
|
|
487677
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
487678
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
487679
|
-
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)(
|
|
487680
487461
|
initializationResult.geminiMdFileCount
|
|
487681
487462
|
);
|
|
487682
|
-
const [shellModeActive, setShellModeActive] = (0,
|
|
487683
|
-
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0,
|
|
487684
|
-
const [historyRemountKey, setHistoryRemountKey] = (0,
|
|
487685
|
-
const [updateInfo, setUpdateInfo] = (0,
|
|
487686
|
-
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)(
|
|
487687
487468
|
config2.isTrustedFolder()
|
|
487688
487469
|
);
|
|
487689
487470
|
const extensionManager = config2.getExtensionManager();
|
|
@@ -487738,38 +487519,38 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487738
487519
|
config2.getWorkingDir()
|
|
487739
487520
|
);
|
|
487740
487521
|
const { codingPlanUpdateRequest, dismissCodingPlanUpdate } = useCodingPlanUpdates(settings2, config2, historyManager.addItem);
|
|
487741
|
-
const [isTrustDialogOpen, setTrustDialogOpen] = (0,
|
|
487742
|
-
const openTrustDialog = (0,
|
|
487743
|
-
const closeTrustDialog = (0,
|
|
487744
|
-
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0,
|
|
487745
|
-
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)(
|
|
487746
487527
|
() => setPermissionsDialogOpen(true),
|
|
487747
487528
|
[]
|
|
487748
487529
|
);
|
|
487749
|
-
const closePermissionsDialog = (0,
|
|
487530
|
+
const closePermissionsDialog = (0, import_react175.useCallback)(
|
|
487750
487531
|
() => setPermissionsDialogOpen(false),
|
|
487751
487532
|
[]
|
|
487752
487533
|
);
|
|
487753
|
-
const getCurrentModel = (0,
|
|
487754
|
-
const [currentModel, setCurrentModel] = (0,
|
|
487755
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
487756
|
-
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)([]);
|
|
487757
487538
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
487758
487539
|
const { stdin: stdin3, setRawMode } = use_stdin_default();
|
|
487759
487540
|
const { stdout: stdout3 } = use_stdout_default();
|
|
487760
487541
|
const { stats: sessionStats, startNewSession } = useSessionStats();
|
|
487761
487542
|
const logger10 = useLogger(config2.storage, sessionStats.sessionId);
|
|
487762
487543
|
const branchName = useGitBranchName(config2.getTargetDir());
|
|
487763
|
-
const mainControlsRef = (0,
|
|
487544
|
+
const mainControlsRef = (0, import_react175.useRef)(null);
|
|
487764
487545
|
const staticExtraHeight = 3;
|
|
487765
487546
|
useInitializationEffects(config2, historyManager, setConfigInitialized);
|
|
487766
|
-
(0,
|
|
487547
|
+
(0, import_react175.useEffect)(
|
|
487767
487548
|
() => setUpdateHandler(historyManager.addItem, setUpdateInfo),
|
|
487768
487549
|
[historyManager.addItem]
|
|
487769
487550
|
);
|
|
487770
487551
|
const { lastFinished } = useBackgroundAgentProgress();
|
|
487771
487552
|
const addHistoryItem = historyManager.addItem;
|
|
487772
|
-
(0,
|
|
487553
|
+
(0, import_react175.useEffect)(() => {
|
|
487773
487554
|
if (!lastFinished?.hitLimit) return;
|
|
487774
487555
|
addHistoryItem(
|
|
487775
487556
|
{
|
|
@@ -487779,7 +487560,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487779
487560
|
Date.now()
|
|
487780
487561
|
);
|
|
487781
487562
|
}, [lastFinished, addHistoryItem]);
|
|
487782
|
-
(0,
|
|
487563
|
+
(0, import_react175.useEffect)(() => {
|
|
487783
487564
|
const interval = setInterval(() => {
|
|
487784
487565
|
const model = getCurrentModel();
|
|
487785
487566
|
if (model !== currentModel) {
|
|
@@ -487788,13 +487569,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487788
487569
|
}, 1e3);
|
|
487789
487570
|
return () => clearInterval(interval);
|
|
487790
487571
|
}, [config2, currentModel, getCurrentModel]);
|
|
487791
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
487572
|
+
const { inputWidth, suggestionsWidth } = (0, import_react175.useMemo)(() => {
|
|
487792
487573
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
487793
487574
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
487794
487575
|
}, [terminalWidth]);
|
|
487795
487576
|
const mainAreaWidth = Math.min(terminalWidth - 4, 100);
|
|
487796
487577
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
487797
|
-
const isValidPath = (0,
|
|
487578
|
+
const isValidPath = (0, import_react175.useCallback)((filePath) => {
|
|
487798
487579
|
try {
|
|
487799
487580
|
return fs135.existsSync(filePath) && fs135.statSync(filePath).isFile();
|
|
487800
487581
|
} catch (_e2) {
|
|
@@ -487809,7 +487590,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487809
487590
|
isValidPath,
|
|
487810
487591
|
shellModeActive
|
|
487811
487592
|
});
|
|
487812
|
-
(0,
|
|
487593
|
+
(0, import_react175.useEffect)(() => {
|
|
487813
487594
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
487814
487595
|
const pastMessagesRaw = await logger10?.getPreviousUserMessages() || [];
|
|
487815
487596
|
const currentSessionUserMessages = historyManager.history.filter(
|
|
@@ -487832,7 +487613,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487832
487613
|
}, "fetchUserMessages");
|
|
487833
487614
|
fetchUserMessages();
|
|
487834
487615
|
}, [historyManager.history, logger10]);
|
|
487835
|
-
const refreshStatic = (0,
|
|
487616
|
+
const refreshStatic = (0, import_react175.useCallback)(() => {
|
|
487836
487617
|
stdout3.write("\x1B[?2026h");
|
|
487837
487618
|
stdout3.write(base_exports.clearTerminal);
|
|
487838
487619
|
stdout3.write("\x1B[?2026l");
|
|
@@ -487868,7 +487649,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487868
487649
|
cancelAuthentication
|
|
487869
487650
|
} = useAuthCommand(settings2, config2, historyManager.addItem, refreshStatic);
|
|
487870
487651
|
useInitializationAuthError(initializationResult.authError, onAuthError);
|
|
487871
|
-
(0,
|
|
487652
|
+
(0, import_react175.useEffect)(() => {
|
|
487872
487653
|
const currentAuthType = config2.getModelsConfig().getCurrentAuthType();
|
|
487873
487654
|
if (settings2.merged.security?.auth?.enforcedType && currentAuthType && settings2.merged.security?.auth.enforcedType !== currentAuthType) {
|
|
487874
487655
|
onAuthError(
|
|
@@ -487894,7 +487675,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487894
487675
|
config2,
|
|
487895
487676
|
onAuthError
|
|
487896
487677
|
]);
|
|
487897
|
-
const [editorError, setEditorError] = (0,
|
|
487678
|
+
const [editorError, setEditorError] = (0, import_react175.useState)(null);
|
|
487898
487679
|
const {
|
|
487899
487680
|
isEditorDialogOpen,
|
|
487900
487681
|
openEditorDialog,
|
|
@@ -487938,10 +487719,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487938
487719
|
} = useExtensionsManagerDialog();
|
|
487939
487720
|
const { isMcpDialogOpen, openMcpDialog, closeMcpDialog } = useMcpDialog();
|
|
487940
487721
|
const { isHooksDialogOpen, openHooksDialog, closeHooksDialog } = useHooksDialog();
|
|
487941
|
-
const [isRewindDialogOpen, setIsRewindDialogOpen] = (0,
|
|
487942
|
-
const openRewindDialog = (0,
|
|
487943
|
-
const closeRewindDialog = (0,
|
|
487944
|
-
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)(
|
|
487945
487726
|
() => ({
|
|
487946
487727
|
openAuthDialog,
|
|
487947
487728
|
openThemeDialog,
|
|
@@ -488019,14 +487800,14 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488019
487800
|
isConfigInitialized,
|
|
488020
487801
|
logger10
|
|
488021
487802
|
);
|
|
488022
|
-
const onDebugMessage = (0,
|
|
487803
|
+
const onDebugMessage = (0, import_react175.useCallback)(
|
|
488023
487804
|
(message) => {
|
|
488024
487805
|
config2.getDebugLogger().debug(message);
|
|
488025
487806
|
},
|
|
488026
487807
|
[config2]
|
|
488027
487808
|
);
|
|
488028
487809
|
const stableAddItem = historyManager.addItem;
|
|
488029
|
-
const performMemoryRefresh = (0,
|
|
487810
|
+
const performMemoryRefresh = (0, import_react175.useCallback)(async () => {
|
|
488030
487811
|
stableAddItem(
|
|
488031
487812
|
{
|
|
488032
487813
|
type: "info" /* INFO */,
|
|
@@ -488072,7 +487853,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488072
487853
|
debugLogger159.error("Error refreshing memory:", error40);
|
|
488073
487854
|
}
|
|
488074
487855
|
}, [config2, stableAddItem, settings2.merged]);
|
|
488075
|
-
const cancelHandlerRef = (0,
|
|
487856
|
+
const cancelHandlerRef = (0, import_react175.useRef)(() => {
|
|
488076
487857
|
});
|
|
488077
487858
|
const { messageQueue, addMessage, popLast, drain } = useMessageQueue();
|
|
488078
487859
|
const voiceEnabled = settings2.merged.voice?.enabled ?? false;
|
|
@@ -488124,7 +487905,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488124
487905
|
drain,
|
|
488125
487906
|
submitQuery
|
|
488126
487907
|
);
|
|
488127
|
-
const [hasSuggestionsVisible, setHasSuggestionsVisible] = (0,
|
|
487908
|
+
const [hasSuggestionsVisible, setHasSuggestionsVisible] = (0, import_react175.useState)(false);
|
|
488128
487909
|
const agentViewState = useAgentViewState();
|
|
488129
487910
|
const geminiClient = config2.getGeminiClient();
|
|
488130
487911
|
const showAutoAcceptIndicator = useAutoAcceptIndicator({
|
|
@@ -488152,17 +487933,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488152
487933
|
settingInputRequests,
|
|
488153
487934
|
pendingGeminiHistoryItems
|
|
488154
487935
|
});
|
|
488155
|
-
|
|
488156
|
-
config: config2,
|
|
488157
|
-
geminiClient,
|
|
488158
|
-
streamingState,
|
|
488159
|
-
history: historyManager.history,
|
|
488160
|
-
addItem: historyManager.addItem,
|
|
488161
|
-
enabled: settings2.merged.recap?.enabled ?? true,
|
|
488162
|
-
thresholdSeconds: settings2.merged.recap?.thresholdSeconds ?? 300,
|
|
488163
|
-
thresholdToolCalls: settings2.merged.recap?.thresholdToolCalls ?? 15
|
|
488164
|
-
});
|
|
488165
|
-
const handleFinalSubmit = (0, import_react176.useCallback)(
|
|
487936
|
+
const handleFinalSubmit = (0, import_react175.useCallback)(
|
|
488166
487937
|
(submittedValue) => {
|
|
488167
487938
|
if (agentViewState.activeView !== "main") {
|
|
488168
487939
|
const agent = agentViewState.agents.get(agentViewState.activeView);
|
|
@@ -488270,7 +488041,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488270
488041
|
speculationRef
|
|
488271
488042
|
]
|
|
488272
488043
|
);
|
|
488273
|
-
const handleArenaModelsSelected = (0,
|
|
488044
|
+
const handleArenaModelsSelected = (0, import_react175.useCallback)(
|
|
488274
488045
|
(models) => {
|
|
488275
488046
|
const value = models.join(",");
|
|
488276
488047
|
buffer.setText(`/arena start --models ${value} `);
|
|
@@ -488285,7 +488056,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488285
488056
|
handleWelcomeBackSelection,
|
|
488286
488057
|
handleWelcomeBackClose
|
|
488287
488058
|
} = useWelcomeBack(config2, handleFinalSubmit, buffer, settings2.merged);
|
|
488288
|
-
cancelHandlerRef.current = (0,
|
|
488059
|
+
cancelHandlerRef.current = (0, import_react175.useCallback)(() => {
|
|
488289
488060
|
const pendingHistoryItems2 = [
|
|
488290
488061
|
...pendingSlashCommandHistoryItems,
|
|
488291
488062
|
...pendingGeminiHistoryItems
|
|
@@ -488310,15 +488081,15 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488310
488081
|
pendingSlashCommandHistoryItems,
|
|
488311
488082
|
pendingGeminiHistoryItems
|
|
488312
488083
|
]);
|
|
488313
|
-
const handleClearScreen = (0,
|
|
488084
|
+
const handleClearScreen = (0, import_react175.useCallback)(() => {
|
|
488314
488085
|
historyManager.clearItems();
|
|
488315
488086
|
clearScreen2();
|
|
488316
488087
|
refreshStatic();
|
|
488317
488088
|
}, [historyManager, refreshStatic]);
|
|
488318
488089
|
const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
|
|
488319
488090
|
const isInputActive = !initError && !isProcessing && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */);
|
|
488320
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
488321
|
-
(0,
|
|
488091
|
+
const [controlsHeight, setControlsHeight] = (0, import_react175.useState)(0);
|
|
488092
|
+
(0, import_react175.useLayoutEffect)(() => {
|
|
488322
488093
|
if (mainControlsRef.current) {
|
|
488323
488094
|
const fullFooterMeasurement = measure_element_default(mainControlsRef.current);
|
|
488324
488095
|
if (fullFooterMeasurement.height > 0) {
|
|
@@ -488342,13 +488113,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488342
488113
|
});
|
|
488343
488114
|
const isFocused = useFocus();
|
|
488344
488115
|
useBracketedPaste();
|
|
488345
|
-
const contextFileNames = (0,
|
|
488116
|
+
const contextFileNames = (0, import_react175.useMemo)(() => {
|
|
488346
488117
|
const fromSettings = settings2.merged.context?.fileName;
|
|
488347
488118
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllGeminiMdFilenames();
|
|
488348
488119
|
}, [settings2.merged.context?.fileName]);
|
|
488349
|
-
const initialPrompt = (0,
|
|
488350
|
-
const initialPromptSubmitted = (0,
|
|
488351
|
-
(0,
|
|
488120
|
+
const initialPrompt = (0, import_react175.useMemo)(() => config2.getQuestion(), [config2]);
|
|
488121
|
+
const initialPromptSubmitted = (0, import_react175.useRef)(false);
|
|
488122
|
+
(0, import_react175.useEffect)(() => {
|
|
488352
488123
|
if (activePtyId) {
|
|
488353
488124
|
ShellExecutionService.resizePty(
|
|
488354
488125
|
activePtyId,
|
|
@@ -488357,7 +488128,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488357
488128
|
);
|
|
488358
488129
|
}
|
|
488359
488130
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
488360
|
-
(0,
|
|
488131
|
+
(0, import_react175.useEffect)(() => {
|
|
488361
488132
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && welcomeBackChoice !== "restart" && geminiClient?.isInitialized?.()) {
|
|
488362
488133
|
handleFinalSubmit(initialPrompt);
|
|
488363
488134
|
initialPromptSubmitted.current = true;
|
|
@@ -488374,9 +488145,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488374
488145
|
welcomeBackChoice,
|
|
488375
488146
|
geminiClient
|
|
488376
488147
|
]);
|
|
488377
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
488378
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
488379
|
-
(0,
|
|
488148
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react175.useState)(false);
|
|
488149
|
+
const [currentIDE, setCurrentIDE] = (0, import_react175.useState)(null);
|
|
488150
|
+
(0, import_react175.useEffect)(() => {
|
|
488380
488151
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
488381
488152
|
const ideClient = await IdeClient.getInstance();
|
|
488382
488153
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -488392,20 +488163,20 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488392
488163
|
tomlFiles: commandMigrationTomlFiles,
|
|
488393
488164
|
setShowMigrationNudge: setShowCommandMigrationNudge
|
|
488394
488165
|
} = useCommandMigration(settings2, config2.storage);
|
|
488395
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
488396
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
488166
|
+
const [ideContextState, setIdeContextState] = (0, import_react175.useState)();
|
|
488167
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react175.useState)(false);
|
|
488397
488168
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings2, setIsTrustedFolder);
|
|
488398
488169
|
const {
|
|
488399
488170
|
needsRestart: ideNeedsRestart,
|
|
488400
488171
|
restartReason: ideTrustRestartReason
|
|
488401
488172
|
} = useIdeTrustListener();
|
|
488402
|
-
const isInitialMount = (0,
|
|
488403
|
-
(0,
|
|
488173
|
+
const isInitialMount = (0, import_react175.useRef)(true);
|
|
488174
|
+
(0, import_react175.useEffect)(() => {
|
|
488404
488175
|
if (ideNeedsRestart) {
|
|
488405
488176
|
setShowIdeRestartPrompt(true);
|
|
488406
488177
|
}
|
|
488407
488178
|
}, [ideNeedsRestart]);
|
|
488408
|
-
(0,
|
|
488179
|
+
(0, import_react175.useEffect)(() => {
|
|
488409
488180
|
if (isInitialMount.current) {
|
|
488410
488181
|
isInitialMount.current = false;
|
|
488411
488182
|
return;
|
|
@@ -488417,12 +488188,12 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488417
488188
|
clearTimeout(handler);
|
|
488418
488189
|
};
|
|
488419
488190
|
}, [terminalWidth, refreshStatic]);
|
|
488420
|
-
(0,
|
|
488191
|
+
(0, import_react175.useEffect)(() => {
|
|
488421
488192
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
488422
488193
|
setIdeContextState(ideContextStore.get());
|
|
488423
488194
|
return unsubscribe;
|
|
488424
488195
|
}, []);
|
|
488425
|
-
const handleIdePromptComplete = (0,
|
|
488196
|
+
const handleIdePromptComplete = (0, import_react175.useCallback)(
|
|
488426
488197
|
(result) => {
|
|
488427
488198
|
if (result.userSelection === "yes") {
|
|
488428
488199
|
if (result.isExtensionPreInstalled) {
|
|
@@ -488438,7 +488209,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488438
488209
|
},
|
|
488439
488210
|
[handleSlashCommand2, settings2]
|
|
488440
488211
|
);
|
|
488441
|
-
const handleCommandMigrationComplete = (0,
|
|
488212
|
+
const handleCommandMigrationComplete = (0, import_react175.useCallback)(
|
|
488442
488213
|
async (result) => {
|
|
488443
488214
|
setShowCommandMigrationNudge(false);
|
|
488444
488215
|
if (result.userSelection === "yes") {
|
|
@@ -488597,11 +488368,11 @@ ${migrationResult.failedFiles.map((f5) => ` \u2022 ${f5.file}: ${f5.error}`).jo
|
|
|
488597
488368
|
history: historyManager.history,
|
|
488598
488369
|
sessionStats
|
|
488599
488370
|
});
|
|
488600
|
-
const pendingHistoryItems = (0,
|
|
488371
|
+
const pendingHistoryItems = (0, import_react175.useMemo)(
|
|
488601
488372
|
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
|
|
488602
488373
|
[pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]
|
|
488603
488374
|
);
|
|
488604
|
-
const uiState = (0,
|
|
488375
|
+
const uiState = (0, import_react175.useMemo)(
|
|
488605
488376
|
() => ({
|
|
488606
488377
|
history: historyManager.history,
|
|
488607
488378
|
historyManager,
|
|
@@ -488826,7 +488597,7 @@ ${migrationResult.failedFiles.map((f5) => ` \u2022 ${f5.file}: ${f5.error}`).jo
|
|
|
488826
488597
|
dismissPromptSuggestion
|
|
488827
488598
|
]
|
|
488828
488599
|
);
|
|
488829
|
-
const uiActions = (0,
|
|
488600
|
+
const uiActions = (0, import_react175.useMemo)(
|
|
488830
488601
|
() => ({
|
|
488831
488602
|
openThemeDialog,
|
|
488832
488603
|
openEditorDialog,
|
|
@@ -488977,9 +488748,9 @@ ${migrationResult.failedFiles.map((f5) => ` \u2022 ${f5.file}: ${f5.error}`).jo
|
|
|
488977
488748
|
|
|
488978
488749
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
488979
488750
|
init_esbuild_shims();
|
|
488980
|
-
var
|
|
488751
|
+
var import_react176 = __toESM(require_react(), 1);
|
|
488981
488752
|
function useKittyKeyboardProtocol() {
|
|
488982
|
-
const [status] = (0,
|
|
488753
|
+
const [status] = (0, import_react176.useState)({
|
|
488983
488754
|
supported: isKittyProtocolSupported(),
|
|
488984
488755
|
enabled: isKittyProtocolEnabled(),
|
|
488985
488756
|
checking: false
|
|
@@ -489959,7 +489730,7 @@ __name(validateNonInteractiveAuth, "validateNonInteractiveAuth");
|
|
|
489959
489730
|
|
|
489960
489731
|
// packages/cli/src/ui/components/StandaloneSessionPicker.tsx
|
|
489961
489732
|
init_esbuild_shims();
|
|
489962
|
-
var
|
|
489733
|
+
var import_react177 = __toESM(require_react(), 1);
|
|
489963
489734
|
init_dist4();
|
|
489964
489735
|
var import_jsx_runtime141 = __toESM(require_jsx_runtime(), 1);
|
|
489965
489736
|
function StandalonePickerScreen({
|
|
@@ -489969,7 +489740,7 @@ function StandalonePickerScreen({
|
|
|
489969
489740
|
currentBranch
|
|
489970
489741
|
}) {
|
|
489971
489742
|
const { exit } = use_app_default();
|
|
489972
|
-
const [isExiting, setIsExiting] = (0,
|
|
489743
|
+
const [isExiting, setIsExiting] = (0, import_react177.useState)(false);
|
|
489973
489744
|
const handleExit = /* @__PURE__ */ __name(() => {
|
|
489974
489745
|
setIsExiting(true);
|
|
489975
489746
|
exit();
|
|
@@ -493071,7 +492842,7 @@ var QwenAgent = class {
|
|
|
493071
492842
|
async initialize(args2) {
|
|
493072
492843
|
this.clientCapabilities = args2.clientCapabilities;
|
|
493073
492844
|
const authMethods = buildAuthMethods();
|
|
493074
|
-
const version2 = "0.26.
|
|
492845
|
+
const version2 = "0.26.24";
|
|
493075
492846
|
return {
|
|
493076
492847
|
protocolVersion: PROTOCOL_VERSION,
|
|
493077
492848
|
agentInfo: {
|
|
@@ -493745,7 +493516,7 @@ async function startInteractiveUI(config2, settings2, startupWarnings, workspace
|
|
|
493745
493516
|
) });
|
|
493746
493517
|
}, "AppWrapper");
|
|
493747
493518
|
const instance2 = render_default(
|
|
493748
|
-
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, {}),
|
|
493749
493520
|
{
|
|
493750
493521
|
exitOnCtrlC: false,
|
|
493751
493522
|
patchConsole: false,
|
|
@@ -494366,20 +494137,6 @@ main().catch((error40) => {
|
|
|
494366
494137
|
* Copyright 2025 ProtoLabs
|
|
494367
494138
|
* SPDX-License-Identifier: Apache-2.0
|
|
494368
494139
|
*/
|
|
494369
|
-
/**
|
|
494370
|
-
* @license
|
|
494371
|
-
* Copyright 2025 protoLabs Studio
|
|
494372
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
494373
|
-
*
|
|
494374
|
-
* useRecap — appends a "where we left off" card after long agent turns.
|
|
494375
|
-
*
|
|
494376
|
-
* Trigger: streamingState transitions from non-Idle to Idle, AND either
|
|
494377
|
-
* - turn wall-clock duration > recap.thresholdSeconds, OR
|
|
494378
|
-
* - tool calls during the turn > recap.thresholdToolCalls
|
|
494379
|
-
*
|
|
494380
|
-
* Settings: recap.enabled (default true), recap.thresholdSeconds (300),
|
|
494381
|
-
* recap.thresholdToolCalls (15). All in user settings.
|
|
494382
|
-
*/
|
|
494383
494140
|
/*! Bundled license information:
|
|
494384
494141
|
|
|
494385
494142
|
undici/lib/web/fetch/body.js:
|