@protolabsai/proto 0.26.23 → 0.26.25
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 +349 -564
- 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;
|
|
@@ -158294,13 +158294,36 @@ var init_pipeline = __esm({
|
|
|
158294
158294
|
baseRequest.stream = true;
|
|
158295
158295
|
baseRequest.stream_options = { include_usage: true };
|
|
158296
158296
|
}
|
|
158297
|
-
if (request4.config?.tools) {
|
|
158297
|
+
if (request4.config?.tools && request4.config.tools.length > 0) {
|
|
158298
158298
|
baseRequest.tools = await this.converter.convertGeminiToolsToOpenAI(request4.config.tools);
|
|
158299
158299
|
} else {
|
|
158300
|
-
|
|
158301
|
-
|
|
158302
|
-
|
|
158303
|
-
|
|
158300
|
+
baseRequest.messages = baseRequest.messages.flatMap((m3) => {
|
|
158301
|
+
if (m3.role === "tool") {
|
|
158302
|
+
const content = typeof m3.content === "string" ? m3.content : Array.isArray(m3.content) ? m3.content.map((p2) => typeof p2 === "string" ? p2 : "text" in p2 && typeof p2.text === "string" ? p2.text : "").join("") : "";
|
|
158303
|
+
if (!content)
|
|
158304
|
+
return [];
|
|
158305
|
+
const truncated = content.length > 2e3 ? content.slice(0, 2e3) + "\u2026" : content;
|
|
158306
|
+
return [
|
|
158307
|
+
{
|
|
158308
|
+
role: "assistant",
|
|
158309
|
+
content: `[tool result] ${truncated}`
|
|
158310
|
+
}
|
|
158311
|
+
];
|
|
158312
|
+
}
|
|
158313
|
+
if (m3.role === "assistant" && Array.isArray(m3.tool_calls) && (m3.tool_calls?.length ?? 0) > 0) {
|
|
158314
|
+
const { tool_calls: _toolCalls, ...rest } = m3;
|
|
158315
|
+
if (!rest.content || Array.isArray(rest.content) && rest.content.length === 0) {
|
|
158316
|
+
return [
|
|
158317
|
+
{
|
|
158318
|
+
...rest,
|
|
158319
|
+
content: "[tool call elided]"
|
|
158320
|
+
}
|
|
158321
|
+
];
|
|
158322
|
+
}
|
|
158323
|
+
return [rest];
|
|
158324
|
+
}
|
|
158325
|
+
return [m3];
|
|
158326
|
+
});
|
|
158304
158327
|
}
|
|
158305
158328
|
return this.config.provider.buildRequest(baseRequest, userPromptId);
|
|
158306
158329
|
}
|
|
@@ -171130,7 +171153,7 @@ __export(geminiContentGenerator_exports, {
|
|
|
171130
171153
|
createGeminiContentGenerator: () => createGeminiContentGenerator
|
|
171131
171154
|
});
|
|
171132
171155
|
function createGeminiContentGenerator(config2, gcConfig) {
|
|
171133
|
-
const version2 = "0.26.
|
|
171156
|
+
const version2 = "0.26.25";
|
|
171134
171157
|
const userAgent2 = config2.userAgent || `QwenCode/${version2} (${process.platform}; ${process.arch})`;
|
|
171135
171158
|
const baseHeaders = {
|
|
171136
171159
|
"User-Agent": userAgent2
|
|
@@ -173878,7 +173901,7 @@ var init_turn = __esm({
|
|
|
173878
173901
|
init_errors();
|
|
173879
173902
|
init_thoughtUtils();
|
|
173880
173903
|
init_streamStall();
|
|
173881
|
-
STREAM_STALL_TIMEOUT_MS = parseInt(process.env["PROTO_STREAM_STALL_TIMEOUT_MS"] ?? "
|
|
173904
|
+
STREAM_STALL_TIMEOUT_MS = parseInt(process.env["PROTO_STREAM_STALL_TIMEOUT_MS"] ?? "300000", 10);
|
|
173882
173905
|
(function(GeminiEventType2) {
|
|
173883
173906
|
GeminiEventType2["Content"] = "content";
|
|
173884
173907
|
GeminiEventType2["ToolCallRequest"] = "tool_call_request";
|
|
@@ -198631,8 +198654,6 @@ var init_client2 = __esm({
|
|
|
198631
198654
|
init_ideContext();
|
|
198632
198655
|
init_types10();
|
|
198633
198656
|
init_completion_checker();
|
|
198634
|
-
init_builtin_agents();
|
|
198635
|
-
init_agent_headless();
|
|
198636
198657
|
debugLogger39 = createDebugLogger("CLIENT");
|
|
198637
198658
|
MAX_TURNS = 100;
|
|
198638
198659
|
(function(SendMessageType2) {
|
|
@@ -198642,7 +198663,7 @@ var init_client2 = __esm({
|
|
|
198642
198663
|
SendMessageType2["Hook"] = "hook";
|
|
198643
198664
|
SendMessageType2["Cron"] = "cron";
|
|
198644
198665
|
})(SendMessageType || (SendMessageType = {}));
|
|
198645
|
-
GeminiClient = class
|
|
198666
|
+
GeminiClient = class {
|
|
198646
198667
|
static {
|
|
198647
198668
|
__name(this, "GeminiClient");
|
|
198648
198669
|
}
|
|
@@ -198658,12 +198679,6 @@ var init_client2 = __esm({
|
|
|
198658
198679
|
* being forced and did it fail?
|
|
198659
198680
|
*/
|
|
198660
198681
|
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
198682
|
/**
|
|
198668
198683
|
* Maps promptId → history length captured just before the user message for
|
|
198669
198684
|
* that turn is added. Used by trimHistoryToCheckpoint() to restore history
|
|
@@ -199207,51 +199222,6 @@ Please address these issues before finishing.`;
|
|
|
199207
199222
|
return completionResult;
|
|
199208
199223
|
}
|
|
199209
199224
|
}
|
|
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
199225
|
if (!turn.pendingToolCalls.length && signal && !signal.aborted) {
|
|
199256
199226
|
if (this.config.getSkipNextSpeakerCheck()) {
|
|
199257
199227
|
if (arenaAgentClient) {
|
|
@@ -228167,7 +228137,7 @@ var init_protocol = __esm({
|
|
|
228167
228137
|
getTaskResult: /* @__PURE__ */ __name((taskId) => {
|
|
228168
228138
|
return taskStore.getTaskResult(taskId, sessionId);
|
|
228169
228139
|
}, "getTaskResult"),
|
|
228170
|
-
updateTaskStatus: /* @__PURE__ */ __name(async (taskId, status,
|
|
228140
|
+
updateTaskStatus: /* @__PURE__ */ __name(async (taskId, status, statusMessage2) => {
|
|
228171
228141
|
const task = await taskStore.getTask(taskId, sessionId);
|
|
228172
228142
|
if (!task) {
|
|
228173
228143
|
throw new McpError(ErrorCode.InvalidParams, `Task "${taskId}" not found - it may have been cleaned up`);
|
|
@@ -228175,7 +228145,7 @@ var init_protocol = __esm({
|
|
|
228175
228145
|
if (isTerminal(task.status)) {
|
|
228176
228146
|
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
228147
|
}
|
|
228178
|
-
await taskStore.updateTaskStatus(taskId, status,
|
|
228148
|
+
await taskStore.updateTaskStatus(taskId, status, statusMessage2, sessionId);
|
|
228179
228149
|
const updatedTask = await taskStore.getTask(taskId, sessionId);
|
|
228180
228150
|
if (updatedTask) {
|
|
228181
228151
|
const notification = TaskStatusNotificationSchema.parse({
|
|
@@ -287032,7 +287002,12 @@ async function generateRecap(config2, conversationHistory, abortSignal) {
|
|
|
287032
287002
|
contents,
|
|
287033
287003
|
config: {
|
|
287034
287004
|
abortSignal,
|
|
287035
|
-
thinkingConfig: { includeThoughts: false }
|
|
287005
|
+
thinkingConfig: { includeThoughts: false },
|
|
287006
|
+
// Empty tools array (truthy) bypasses pipeline.ts buildRequest's
|
|
287007
|
+
// tool-stripping path. Without this, assistant turns containing
|
|
287008
|
+
// tool_calls — i.e. most of the agent's actual work — are dropped
|
|
287009
|
+
// before the request leaves, starving the recap of context.
|
|
287010
|
+
tools: []
|
|
287036
287011
|
}
|
|
287037
287012
|
}, "recap");
|
|
287038
287013
|
const text = response.candidates?.[0]?.content?.parts?.map((p2) => p2.text ?? "").join("").trim();
|
|
@@ -313884,7 +313859,7 @@ var require_backend = __commonJS({
|
|
|
313884
313859
|
});
|
|
313885
313860
|
return a2._currentValue;
|
|
313886
313861
|
}, "useContext"),
|
|
313887
|
-
useEffect: /* @__PURE__ */ __name(function
|
|
313862
|
+
useEffect: /* @__PURE__ */ __name(function useEffect74(a2) {
|
|
313888
313863
|
C3();
|
|
313889
313864
|
x3.push({
|
|
313890
313865
|
primitive: "Effect",
|
|
@@ -313949,7 +313924,7 @@ var require_backend = __commonJS({
|
|
|
313949
313924
|
return [b2, function() {
|
|
313950
313925
|
}];
|
|
313951
313926
|
}, "useReducer"),
|
|
313952
|
-
useRef: /* @__PURE__ */ __name(function
|
|
313927
|
+
useRef: /* @__PURE__ */ __name(function useRef30(a2) {
|
|
313953
313928
|
var b2 = C3();
|
|
313954
313929
|
a2 = null !== b2 ? b2.memoizedState : {
|
|
313955
313930
|
current: a2
|
|
@@ -330812,54 +330787,6 @@ var init_en3 = __esm({
|
|
|
330812
330787
|
"They're heeere",
|
|
330813
330788
|
"Hasta la vista, baby",
|
|
330814
330789
|
"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
330790
|
// Nonsensical / surreal
|
|
330864
330791
|
"Negotiating with the moon",
|
|
330865
330792
|
"Asking the door what year it is",
|
|
@@ -330902,6 +330829,16 @@ var init_en3 = __esm({
|
|
|
330902
330829
|
"Resolving the merge conflict the boring way",
|
|
330903
330830
|
"Pinning the dependency you said wouldn't matter",
|
|
330904
330831
|
"Writing the comment that says what the code already says",
|
|
330832
|
+
"Extracting the function you said was fine inline",
|
|
330833
|
+
"Removing the console.log you called 'temporary'",
|
|
330834
|
+
"Flattening the callback pyramid you were proud of",
|
|
330835
|
+
"Converting the switch statement nobody wanted to touch",
|
|
330836
|
+
"Typing 'any' and feeling nothing",
|
|
330837
|
+
"Splitting the 900-line file into 900-line files",
|
|
330838
|
+
"Closing the tab with the Stack Overflow answer",
|
|
330839
|
+
"Undoing the clever solution that was too clever",
|
|
330840
|
+
"Adding the index you should have added in week one",
|
|
330841
|
+
"Reading the error message this time",
|
|
330905
330842
|
// Tired project manager
|
|
330906
330843
|
"Following up on the ticket you said was almost done",
|
|
330907
330844
|
"Re-opening the ticket you closed prematurely",
|
|
@@ -330944,6 +330881,17 @@ var init_en3 = __esm({
|
|
|
330944
330881
|
"Drafting the reply to 'can we make it more vibrant'",
|
|
330945
330882
|
"Showing GTM the same hex code from three angles",
|
|
330946
330883
|
"Promising the launch banner respects dark mode",
|
|
330884
|
+
"Reconciling the Figma spec with the shipped component",
|
|
330885
|
+
"Nudging the CTA button 4px to the left, per feedback",
|
|
330886
|
+
"Explaining why the font is not Comic Sans, again",
|
|
330887
|
+
"Documenting the component that ships next week",
|
|
330888
|
+
"Finding the brand typeface that's 'almost the same'",
|
|
330889
|
+
"Correcting the corner radius across thirty components",
|
|
330890
|
+
"Translating 'make it pop' into a color stop",
|
|
330891
|
+
"Matching the hover state nobody thought to spec",
|
|
330892
|
+
"Asking which breakpoint is the real breakpoint",
|
|
330893
|
+
"Deciding if this is a variant or a new component",
|
|
330894
|
+
"Writing the accessibility note that won't get read",
|
|
330947
330895
|
// CTO hiding tech debt with toxic positivity
|
|
330948
330896
|
"Celebrating the resilience of our pre-2019 codebase",
|
|
330949
330897
|
"Onboarding the third 'temporary' migration script",
|
|
@@ -366442,7 +366390,7 @@ var require_retry_handler2 = __commonJS({
|
|
|
366442
366390
|
const retryTimeout = retryAfterHeader > 0 ? Math.min(retryAfterHeader, maxTimeout) : Math.min(minTimeout * timeoutFactor ** (counter - 1), maxTimeout);
|
|
366443
366391
|
setTimeout(() => cb(null), retryTimeout);
|
|
366444
366392
|
}
|
|
366445
|
-
onHeaders(statusCode, rawHeaders, resume,
|
|
366393
|
+
onHeaders(statusCode, rawHeaders, resume, statusMessage2) {
|
|
366446
366394
|
const headers = parseHeaders(rawHeaders);
|
|
366447
366395
|
this.retryCount += 1;
|
|
366448
366396
|
if (statusCode >= 300) {
|
|
@@ -366451,7 +366399,7 @@ var require_retry_handler2 = __commonJS({
|
|
|
366451
366399
|
statusCode,
|
|
366452
366400
|
rawHeaders,
|
|
366453
366401
|
resume,
|
|
366454
|
-
|
|
366402
|
+
statusMessage2
|
|
366455
366403
|
);
|
|
366456
366404
|
} else {
|
|
366457
366405
|
this.abort(
|
|
@@ -366509,7 +366457,7 @@ var require_retry_handler2 = __commonJS({
|
|
|
366509
366457
|
statusCode,
|
|
366510
366458
|
rawHeaders,
|
|
366511
366459
|
resume,
|
|
366512
|
-
|
|
366460
|
+
statusMessage2
|
|
366513
366461
|
);
|
|
366514
366462
|
}
|
|
366515
366463
|
const { start: start2, size, end = size - 1 } = range;
|
|
@@ -366539,7 +366487,7 @@ var require_retry_handler2 = __commonJS({
|
|
|
366539
366487
|
statusCode,
|
|
366540
366488
|
rawHeaders,
|
|
366541
366489
|
resume,
|
|
366542
|
-
|
|
366490
|
+
statusMessage2
|
|
366543
366491
|
);
|
|
366544
366492
|
}
|
|
366545
366493
|
const err2 = new RequestRetryError("Request failed", statusCode, {
|
|
@@ -366960,7 +366908,7 @@ var require_util24 = __commonJS({
|
|
|
366960
366908
|
} = require_errors5();
|
|
366961
366909
|
var { chunksDecode } = require_readable2();
|
|
366962
366910
|
var CHUNK_LIMIT = 128 * 1024;
|
|
366963
|
-
async function getResolveErrorBodyCallback({ callback, body: body2, contentType, statusCode, statusMessage:
|
|
366911
|
+
async function getResolveErrorBodyCallback({ callback, body: body2, contentType, statusCode, statusMessage: statusMessage2, headers }) {
|
|
366964
366912
|
assert4(body2);
|
|
366965
366913
|
let chunks = [];
|
|
366966
366914
|
let length = 0;
|
|
@@ -366978,7 +366926,7 @@ var require_util24 = __commonJS({
|
|
|
366978
366926
|
chunks = [];
|
|
366979
366927
|
length = 0;
|
|
366980
366928
|
}
|
|
366981
|
-
const message = `Response status code ${statusCode}${
|
|
366929
|
+
const message = `Response status code ${statusCode}${statusMessage2 ? `: ${statusMessage2}` : ""}`;
|
|
366982
366930
|
if (statusCode === 204 || !contentType || !length) {
|
|
366983
366931
|
queueMicrotask(() => callback(new ResponseStatusCodeError(message, statusCode, headers)));
|
|
366984
366932
|
return;
|
|
@@ -367105,7 +367053,7 @@ var require_api_request2 = __commonJS({
|
|
|
367105
367053
|
this.abort = abort2;
|
|
367106
367054
|
this.context = context2;
|
|
367107
367055
|
}
|
|
367108
|
-
onHeaders(statusCode, rawHeaders, resume,
|
|
367056
|
+
onHeaders(statusCode, rawHeaders, resume, statusMessage2) {
|
|
367109
367057
|
const { callback, opaque, abort: abort2, context: context2, responseHeaders, highWaterMark } = this;
|
|
367110
367058
|
const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders);
|
|
367111
367059
|
if (statusCode < 200) {
|
|
@@ -367134,7 +367082,7 @@ var require_api_request2 = __commonJS({
|
|
|
367134
367082
|
this.runInAsyncScope(
|
|
367135
367083
|
getResolveErrorBodyCallback,
|
|
367136
367084
|
null,
|
|
367137
|
-
{ callback, body: res, contentType, statusCode, statusMessage:
|
|
367085
|
+
{ callback, body: res, contentType, statusCode, statusMessage: statusMessage2, headers }
|
|
367138
367086
|
);
|
|
367139
367087
|
} else {
|
|
367140
367088
|
this.runInAsyncScope(callback, null, null, {
|
|
@@ -367330,7 +367278,7 @@ var require_api_stream2 = __commonJS({
|
|
|
367330
367278
|
this.abort = abort2;
|
|
367331
367279
|
this.context = context2;
|
|
367332
367280
|
}
|
|
367333
|
-
onHeaders(statusCode, rawHeaders, resume,
|
|
367281
|
+
onHeaders(statusCode, rawHeaders, resume, statusMessage2) {
|
|
367334
367282
|
const { factory, opaque, context: context2, callback, responseHeaders } = this;
|
|
367335
367283
|
const headers = responseHeaders === "raw" ? util3.parseRawHeaders(rawHeaders) : util3.parseHeaders(rawHeaders);
|
|
367336
367284
|
if (statusCode < 200) {
|
|
@@ -367349,7 +367297,7 @@ var require_api_stream2 = __commonJS({
|
|
|
367349
367297
|
this.runInAsyncScope(
|
|
367350
367298
|
getResolveErrorBodyCallback,
|
|
367351
367299
|
null,
|
|
367352
|
-
{ callback, body: res, contentType, statusCode, statusMessage:
|
|
367300
|
+
{ callback, body: res, contentType, statusCode, statusMessage: statusMessage2, headers }
|
|
367353
367301
|
);
|
|
367354
367302
|
} else {
|
|
367355
367303
|
if (factory === null) {
|
|
@@ -368892,7 +368840,7 @@ var require_dump2 = __commonJS({
|
|
|
368892
368840
|
this.#reason = reason;
|
|
368893
368841
|
}
|
|
368894
368842
|
// TODO: will require adjustment after new hooks are out
|
|
368895
|
-
onHeaders(statusCode, rawHeaders, resume,
|
|
368843
|
+
onHeaders(statusCode, rawHeaders, resume, statusMessage2) {
|
|
368896
368844
|
const headers = util3.parseHeaders(rawHeaders);
|
|
368897
368845
|
const contentLength = headers["content-length"];
|
|
368898
368846
|
if (contentLength != null && contentLength > this.#maxSize) {
|
|
@@ -368907,7 +368855,7 @@ var require_dump2 = __commonJS({
|
|
|
368907
368855
|
statusCode,
|
|
368908
368856
|
rawHeaders,
|
|
368909
368857
|
resume,
|
|
368910
|
-
|
|
368858
|
+
statusMessage2
|
|
368911
368859
|
);
|
|
368912
368860
|
}
|
|
368913
368861
|
onError(err2) {
|
|
@@ -404711,7 +404659,7 @@ var measureElement = /* @__PURE__ */ __name((node) => ({
|
|
|
404711
404659
|
var measure_element_default = measureElement;
|
|
404712
404660
|
|
|
404713
404661
|
// packages/cli/src/gemini.tsx
|
|
404714
|
-
var
|
|
404662
|
+
var import_react178 = __toESM(require_react(), 1);
|
|
404715
404663
|
import dns2 from "node:dns";
|
|
404716
404664
|
import os50 from "node:os";
|
|
404717
404665
|
import { basename as basename32 } from "node:path";
|
|
@@ -407279,44 +407227,6 @@ var SETTINGS_SCHEMA = {
|
|
|
407279
407227
|
}
|
|
407280
407228
|
}
|
|
407281
407229
|
},
|
|
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
407230
|
insight: {
|
|
407321
407231
|
type: "object",
|
|
407322
407232
|
label: "Insight",
|
|
@@ -417044,7 +416954,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
417044
416954
|
// packages/cli/src/utils/version.ts
|
|
417045
416955
|
async function getCliVersion() {
|
|
417046
416956
|
const pkgJson = await getPackageJson();
|
|
417047
|
-
return "0.26.
|
|
416957
|
+
return "0.26.25";
|
|
417048
416958
|
}
|
|
417049
416959
|
__name(getCliVersion, "getCliVersion");
|
|
417050
416960
|
|
|
@@ -419991,7 +419901,7 @@ var Protocol2 = class {
|
|
|
419991
419901
|
getTaskResult: /* @__PURE__ */ __name((taskId) => {
|
|
419992
419902
|
return taskStore.getTaskResult(taskId, sessionId);
|
|
419993
419903
|
}, "getTaskResult"),
|
|
419994
|
-
updateTaskStatus: /* @__PURE__ */ __name(async (taskId, status,
|
|
419904
|
+
updateTaskStatus: /* @__PURE__ */ __name(async (taskId, status, statusMessage2) => {
|
|
419995
419905
|
const task = await taskStore.getTask(taskId, sessionId);
|
|
419996
419906
|
if (!task) {
|
|
419997
419907
|
throw new McpError2(ErrorCode2.InvalidParams, `Task "${taskId}" not found - it may have been cleaned up`);
|
|
@@ -419999,7 +419909,7 @@ var Protocol2 = class {
|
|
|
419999
419909
|
if (isTerminal2(task.status)) {
|
|
420000
419910
|
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
419911
|
}
|
|
420002
|
-
await taskStore.updateTaskStatus(taskId, status,
|
|
419912
|
+
await taskStore.updateTaskStatus(taskId, status, statusMessage2, sessionId);
|
|
420003
419913
|
const updatedTask = await taskStore.getTask(taskId, sessionId);
|
|
420004
419914
|
if (updatedTask) {
|
|
420005
419915
|
const notification = TaskStatusNotificationSchema2.parse({
|
|
@@ -424816,7 +424726,7 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
424816
424726
|
|
|
424817
424727
|
// packages/cli/src/generated/git-commit.ts
|
|
424818
424728
|
init_esbuild_shims();
|
|
424819
|
-
var GIT_COMMIT_INFO = "
|
|
424729
|
+
var GIT_COMMIT_INFO = "b5e5da8f6";
|
|
424820
424730
|
|
|
424821
424731
|
// packages/cli/src/utils/systemInfo.ts
|
|
424822
424732
|
async function getNpmVersion() {
|
|
@@ -433626,59 +433536,50 @@ var voiceCommand = {
|
|
|
433626
433536
|
|
|
433627
433537
|
// packages/cli/src/ui/commands/recapCommand.ts
|
|
433628
433538
|
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");
|
|
433539
|
+
init_dist4();
|
|
433657
433540
|
var recapCommand = {
|
|
433658
433541
|
name: "recap",
|
|
433659
|
-
description:
|
|
433542
|
+
description: 'Print a short "where we left off" card summarizing the recent conversation.',
|
|
433660
433543
|
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")
|
|
433544
|
+
action: /* @__PURE__ */ __name(async (context2) => {
|
|
433545
|
+
const config2 = context2.services.config;
|
|
433546
|
+
const geminiClient = config2?.getGeminiClient();
|
|
433547
|
+
if (!config2 || !geminiClient) {
|
|
433548
|
+
return {
|
|
433549
|
+
type: "message",
|
|
433550
|
+
messageType: "error",
|
|
433551
|
+
content: "Config not loaded."
|
|
433552
|
+
};
|
|
433679
433553
|
}
|
|
433680
|
-
|
|
433681
|
-
|
|
433554
|
+
const conversation = geminiClient.getHistory?.() ?? [];
|
|
433555
|
+
const hasModel = conversation.some((c4) => c4.role === "model");
|
|
433556
|
+
const hasUser = conversation.some((c4) => c4.role === "user");
|
|
433557
|
+
if (!hasModel || !hasUser) {
|
|
433558
|
+
return {
|
|
433559
|
+
type: "message",
|
|
433560
|
+
messageType: "info",
|
|
433561
|
+
content: "No conversation to recap yet."
|
|
433562
|
+
};
|
|
433563
|
+
}
|
|
433564
|
+
const controller = new AbortController();
|
|
433565
|
+
const onUpstreamAbort = /* @__PURE__ */ __name(() => controller.abort(), "onUpstreamAbort");
|
|
433566
|
+
context2.abortSignal?.addEventListener("abort", onUpstreamAbort);
|
|
433567
|
+
try {
|
|
433568
|
+
const text = await generateRecap(config2, conversation, controller.signal);
|
|
433569
|
+
if (controller.signal.aborted) return void 0;
|
|
433570
|
+
if (!text) {
|
|
433571
|
+
return {
|
|
433572
|
+
type: "message",
|
|
433573
|
+
messageType: "info",
|
|
433574
|
+
content: "Recap returned no content."
|
|
433575
|
+
};
|
|
433576
|
+
}
|
|
433577
|
+
context2.ui.addItem({ type: "recap" /* RECAP */, text }, Date.now());
|
|
433578
|
+
return void 0;
|
|
433579
|
+
} finally {
|
|
433580
|
+
context2.abortSignal?.removeEventListener("abort", onUpstreamAbort);
|
|
433581
|
+
}
|
|
433582
|
+
}, "action")
|
|
433682
433583
|
};
|
|
433683
433584
|
|
|
433684
433585
|
// packages/cli/src/ui/commands/bgCommand.ts
|
|
@@ -438764,7 +438665,7 @@ __name(runNonInteractiveStreamJson, "runNonInteractiveStreamJson");
|
|
|
438764
438665
|
|
|
438765
438666
|
// packages/cli/src/ui/AppContainer.tsx
|
|
438766
438667
|
init_esbuild_shims();
|
|
438767
|
-
var
|
|
438668
|
+
var import_react175 = __toESM(require_react(), 1);
|
|
438768
438669
|
|
|
438769
438670
|
// packages/cli/src/ui/App.tsx
|
|
438770
438671
|
init_esbuild_shims();
|
|
@@ -481689,7 +481590,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
481689
481590
|
case GeminiEventType.UserCancelled:
|
|
481690
481591
|
flushBufferedStreamEvents();
|
|
481691
481592
|
handleUserCancelledEvent(userMessageTimestamp);
|
|
481692
|
-
|
|
481593
|
+
return 1 /* UserCancelled */;
|
|
481693
481594
|
case GeminiEventType.Error:
|
|
481694
481595
|
flushBufferedStreamEvents();
|
|
481695
481596
|
handleErrorEvent(event.value, userMessageTimestamp);
|
|
@@ -481757,7 +481658,7 @@ var useGeminiStream = /* @__PURE__ */ __name((geminiClient, history, addItem, co
|
|
|
481757
481658
|
discardBufferedStreamEvents();
|
|
481758
481659
|
flushBufferedStreamEventsRef.current.delete(flushBufferedStreamEvents);
|
|
481759
481660
|
}
|
|
481760
|
-
if (toolCallRequests.length > 0) {
|
|
481661
|
+
if (toolCallRequests.length > 0 && !signal.aborted) {
|
|
481761
481662
|
scheduleToolCalls(toolCallRequests, signal);
|
|
481762
481663
|
}
|
|
481763
481664
|
return 0 /* Completed */;
|
|
@@ -482383,101 +482284,9 @@ ${verifyResult}` });
|
|
|
482383
482284
|
};
|
|
482384
482285
|
}, "useGeminiStream");
|
|
482385
482286
|
|
|
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
482287
|
// packages/cli/src/ui/hooks/vim.ts
|
|
482479
482288
|
init_esbuild_shims();
|
|
482480
|
-
var
|
|
482289
|
+
var import_react150 = __toESM(require_react(), 1);
|
|
482481
482290
|
init_dist4();
|
|
482482
482291
|
var DIGIT_MULTIPLIER = 10;
|
|
482483
482292
|
var DEFAULT_COUNT = 1;
|
|
@@ -482542,22 +482351,22 @@ var vimReducer = /* @__PURE__ */ __name((state, action) => {
|
|
|
482542
482351
|
}, "vimReducer");
|
|
482543
482352
|
function useVim(buffer, onSubmit) {
|
|
482544
482353
|
const { vimEnabled, vimMode, setVimMode } = useVimMode();
|
|
482545
|
-
const [state, dispatch] = (0,
|
|
482546
|
-
(0,
|
|
482354
|
+
const [state, dispatch] = (0, import_react150.useReducer)(vimReducer, initialVimState);
|
|
482355
|
+
(0, import_react150.useEffect)(() => {
|
|
482547
482356
|
dispatch({ type: "SET_MODE", mode: vimMode });
|
|
482548
482357
|
}, [vimMode]);
|
|
482549
|
-
const updateMode = (0,
|
|
482358
|
+
const updateMode = (0, import_react150.useCallback)(
|
|
482550
482359
|
(mode) => {
|
|
482551
482360
|
setVimMode(mode);
|
|
482552
482361
|
dispatch({ type: "SET_MODE", mode });
|
|
482553
482362
|
},
|
|
482554
482363
|
[setVimMode]
|
|
482555
482364
|
);
|
|
482556
|
-
const getCurrentCount = (0,
|
|
482365
|
+
const getCurrentCount = (0, import_react150.useCallback)(
|
|
482557
482366
|
() => state.count || DEFAULT_COUNT,
|
|
482558
482367
|
[state.count]
|
|
482559
482368
|
);
|
|
482560
|
-
const executeCommand = (0,
|
|
482369
|
+
const executeCommand = (0, import_react150.useCallback)(
|
|
482561
482370
|
(cmdType, count) => {
|
|
482562
482371
|
switch (cmdType) {
|
|
482563
482372
|
case CMD_TYPES.DELETE_WORD_FORWARD: {
|
|
@@ -482633,7 +482442,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482633
482442
|
},
|
|
482634
482443
|
[buffer, updateMode]
|
|
482635
482444
|
);
|
|
482636
|
-
const handleInsertModeInput = (0,
|
|
482445
|
+
const handleInsertModeInput = (0, import_react150.useCallback)(
|
|
482637
482446
|
(normalizedKey) => {
|
|
482638
482447
|
if (normalizedKey.name === "escape") {
|
|
482639
482448
|
buffer.vimEscapeInsertMode();
|
|
@@ -482664,7 +482473,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482664
482473
|
},
|
|
482665
482474
|
[buffer, dispatch, updateMode, onSubmit]
|
|
482666
482475
|
);
|
|
482667
|
-
const normalizeKey = (0,
|
|
482476
|
+
const normalizeKey = (0, import_react150.useCallback)(
|
|
482668
482477
|
(key) => ({
|
|
482669
482478
|
name: key.name || "",
|
|
482670
482479
|
sequence: key.sequence || "",
|
|
@@ -482675,7 +482484,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482675
482484
|
}),
|
|
482676
482485
|
[]
|
|
482677
482486
|
);
|
|
482678
|
-
const handleChangeMovement = (0,
|
|
482487
|
+
const handleChangeMovement = (0, import_react150.useCallback)(
|
|
482679
482488
|
(movement) => {
|
|
482680
482489
|
const count = getCurrentCount();
|
|
482681
482490
|
dispatch({ type: "CLEAR_COUNT" });
|
|
@@ -482696,7 +482505,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482696
482505
|
},
|
|
482697
482506
|
[getCurrentCount, dispatch, buffer, updateMode]
|
|
482698
482507
|
);
|
|
482699
|
-
const handleOperatorMotion = (0,
|
|
482508
|
+
const handleOperatorMotion = (0, import_react150.useCallback)(
|
|
482700
482509
|
(operator2, motion) => {
|
|
482701
482510
|
const count = getCurrentCount();
|
|
482702
482511
|
const commandMap = {
|
|
@@ -482723,7 +482532,7 @@ function useVim(buffer, onSubmit) {
|
|
|
482723
482532
|
},
|
|
482724
482533
|
[getCurrentCount, executeCommand, dispatch]
|
|
482725
482534
|
);
|
|
482726
|
-
const handleInput = (0,
|
|
482535
|
+
const handleInput = (0, import_react150.useCallback)(
|
|
482727
482536
|
(key) => {
|
|
482728
482537
|
if (!vimEnabled) {
|
|
482729
482538
|
return false;
|
|
@@ -483023,14 +482832,14 @@ __name(useVim, "useVim");
|
|
|
483023
482832
|
|
|
483024
482833
|
// packages/cli/src/ui/hooks/useBracketedPaste.ts
|
|
483025
482834
|
init_esbuild_shims();
|
|
483026
|
-
var
|
|
482835
|
+
var import_react151 = __toESM(require_react(), 1);
|
|
483027
482836
|
var ENABLE_BRACKETED_PASTE = "\x1B[?2004h";
|
|
483028
482837
|
var DISABLE_BRACKETED_PASTE = "\x1B[?2004l";
|
|
483029
482838
|
var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
483030
482839
|
const cleanup = /* @__PURE__ */ __name(() => {
|
|
483031
482840
|
process.stdout.write(DISABLE_BRACKETED_PASTE);
|
|
483032
482841
|
}, "cleanup");
|
|
483033
|
-
(0,
|
|
482842
|
+
(0, import_react151.useEffect)(() => {
|
|
483034
482843
|
process.stdout.write(`\x1B[?2026h${ENABLE_BRACKETED_PASTE}\x1B[?2026l`);
|
|
483035
482844
|
process.on("exit", cleanup);
|
|
483036
482845
|
process.on("SIGINT", cleanup);
|
|
@@ -483046,7 +482855,7 @@ var useBracketedPaste = /* @__PURE__ */ __name(() => {
|
|
|
483046
482855
|
|
|
483047
482856
|
// packages/cli/src/ui/hooks/useKeyboardHandling.ts
|
|
483048
482857
|
init_esbuild_shims();
|
|
483049
|
-
var
|
|
482858
|
+
var import_react152 = __toESM(require_react(), 1);
|
|
483050
482859
|
init_dist4();
|
|
483051
482860
|
var CTRL_EXIT_PROMPT_DURATION_MS = 1e3;
|
|
483052
482861
|
function useKeyboardHandling(params) {
|
|
@@ -483069,20 +482878,20 @@ function useKeyboardHandling(params) {
|
|
|
483069
482878
|
debugKeystrokeLogging,
|
|
483070
482879
|
onBackgroundSession
|
|
483071
482880
|
} = 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,
|
|
482881
|
+
const [showToolDescriptions, setShowToolDescriptions] = (0, import_react152.useState)(false);
|
|
482882
|
+
const [ctrlCPressedOnce, setCtrlCPressedOnce] = (0, import_react152.useState)(false);
|
|
482883
|
+
const ctrlCTimerRef = (0, import_react152.useRef)(null);
|
|
482884
|
+
const [ctrlDPressedOnce, setCtrlDPressedOnce] = (0, import_react152.useState)(false);
|
|
482885
|
+
const ctrlDTimerRef = (0, import_react152.useRef)(null);
|
|
482886
|
+
const [escapePressedOnce, setEscapePressedOnce] = (0, import_react152.useState)(false);
|
|
482887
|
+
const escapeTimerRef = (0, import_react152.useRef)(null);
|
|
482888
|
+
const dialogsVisibleRef = (0, import_react152.useRef)(false);
|
|
482889
|
+
const [constrainHeight, setConstrainHeight] = (0, import_react152.useState)(true);
|
|
482890
|
+
const [showEscapePrompt, setShowEscapePrompt] = (0, import_react152.useState)(false);
|
|
482891
|
+
const handleEscapePromptChange = (0, import_react152.useCallback)((showPrompt) => {
|
|
483083
482892
|
setShowEscapePrompt(showPrompt);
|
|
483084
482893
|
}, []);
|
|
483085
|
-
const globalKeypressHandlerRef = (0,
|
|
482894
|
+
const globalKeypressHandlerRef = (0, import_react152.useRef)(() => {
|
|
483086
482895
|
});
|
|
483087
482896
|
globalKeypressHandlerRef.current = (key) => {
|
|
483088
482897
|
if (debugKeystrokeLogging) {
|
|
@@ -483192,7 +483001,7 @@ function useKeyboardHandling(params) {
|
|
|
483192
483001
|
return;
|
|
483193
483002
|
}
|
|
483194
483003
|
};
|
|
483195
|
-
const handleGlobalKeypress = (0,
|
|
483004
|
+
const handleGlobalKeypress = (0, import_react152.useCallback)(
|
|
483196
483005
|
(key) => globalKeypressHandlerRef.current(key),
|
|
483197
483006
|
[]
|
|
483198
483007
|
);
|
|
@@ -483217,22 +483026,22 @@ init_esbuild_shims();
|
|
|
483217
483026
|
|
|
483218
483027
|
// packages/cli/src/ui/hooks/usePhraseCycler.ts
|
|
483219
483028
|
init_esbuild_shims();
|
|
483220
|
-
var
|
|
483029
|
+
var import_react153 = __toESM(require_react(), 1);
|
|
483221
483030
|
var WITTY_LOADING_PHRASES = ["I'm Feeling Lucky"];
|
|
483222
483031
|
var PHRASE_CHANGE_INTERVAL_MS = 15e3;
|
|
483223
483032
|
var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases) => {
|
|
483224
|
-
const loadingPhrases = (0,
|
|
483033
|
+
const loadingPhrases = (0, import_react153.useMemo)(() => {
|
|
483225
483034
|
if (customPhrases && customPhrases.length > 0) {
|
|
483226
483035
|
return customPhrases;
|
|
483227
483036
|
}
|
|
483228
483037
|
const translatedPhrases = ta("WITTY_LOADING_PHRASES");
|
|
483229
483038
|
return translatedPhrases.length > 0 ? translatedPhrases : WITTY_LOADING_PHRASES;
|
|
483230
483039
|
}, [customPhrases]);
|
|
483231
|
-
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0,
|
|
483040
|
+
const [currentLoadingPhrase, setCurrentLoadingPhrase] = (0, import_react153.useState)(
|
|
483232
483041
|
loadingPhrases[0]
|
|
483233
483042
|
);
|
|
483234
|
-
const phraseIntervalRef = (0,
|
|
483235
|
-
(0,
|
|
483043
|
+
const phraseIntervalRef = (0, import_react153.useRef)(null);
|
|
483044
|
+
(0, import_react153.useEffect)(() => {
|
|
483236
483045
|
if (isWaiting) {
|
|
483237
483046
|
setCurrentLoadingPhrase(t4("Waiting for user confirmation..."));
|
|
483238
483047
|
if (phraseIntervalRef.current) {
|
|
@@ -483269,9 +483078,9 @@ var usePhraseCycler = /* @__PURE__ */ __name((isActive, isWaiting, customPhrases
|
|
|
483269
483078
|
}, "usePhraseCycler");
|
|
483270
483079
|
|
|
483271
483080
|
// packages/cli/src/ui/hooks/useLoadingIndicator.ts
|
|
483272
|
-
var
|
|
483081
|
+
var import_react154 = __toESM(require_react(), 1);
|
|
483273
483082
|
var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhrases, currentCandidatesTokens) => {
|
|
483274
|
-
const [timerResetKey, setTimerResetKey] = (0,
|
|
483083
|
+
const [timerResetKey, setTimerResetKey] = (0, import_react154.useState)(0);
|
|
483275
483084
|
const isTimerActive = streamingState === "responding" /* Responding */;
|
|
483276
483085
|
const elapsedTimeFromTimer = useTimer(isTimerActive, timerResetKey);
|
|
483277
483086
|
const isPhraseCyclingActive = streamingState === "responding" /* Responding */;
|
|
@@ -483281,10 +483090,10 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
483281
483090
|
isWaiting,
|
|
483282
483091
|
customWittyPhrases
|
|
483283
483092
|
);
|
|
483284
|
-
const [retainedElapsedTime, setRetainedElapsedTime] = (0,
|
|
483285
|
-
const [taskStartTokens, setTaskStartTokens] = (0,
|
|
483286
|
-
const prevStreamingStateRef = (0,
|
|
483287
|
-
(0,
|
|
483093
|
+
const [retainedElapsedTime, setRetainedElapsedTime] = (0, import_react154.useState)(0);
|
|
483094
|
+
const [taskStartTokens, setTaskStartTokens] = (0, import_react154.useState)(0);
|
|
483095
|
+
const prevStreamingStateRef = (0, import_react154.useRef)(null);
|
|
483096
|
+
(0, import_react154.useEffect)(() => {
|
|
483288
483097
|
if (prevStreamingStateRef.current === "waiting_for_confirmation" /* WaitingForConfirmation */ && streamingState === "responding" /* Responding */) {
|
|
483289
483098
|
setTimerResetKey((prevKey) => prevKey + 1);
|
|
483290
483099
|
setRetainedElapsedTime(0);
|
|
@@ -483309,20 +483118,20 @@ var useLoadingIndicator = /* @__PURE__ */ __name((streamingState, customWittyPhr
|
|
|
483309
483118
|
|
|
483310
483119
|
// packages/cli/src/ui/hooks/useFolderTrust.ts
|
|
483311
483120
|
init_esbuild_shims();
|
|
483312
|
-
var
|
|
483121
|
+
var import_react155 = __toESM(require_react(), 1);
|
|
483313
483122
|
import * as process36 from "node:process";
|
|
483314
483123
|
var useFolderTrust = /* @__PURE__ */ __name((settings2, onTrustChange) => {
|
|
483315
|
-
const [isTrusted, setIsTrusted] = (0,
|
|
483316
|
-
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0,
|
|
483317
|
-
const [isRestarting, setIsRestarting] = (0,
|
|
483124
|
+
const [isTrusted, setIsTrusted] = (0, import_react155.useState)(void 0);
|
|
483125
|
+
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = (0, import_react155.useState)(false);
|
|
483126
|
+
const [isRestarting, setIsRestarting] = (0, import_react155.useState)(false);
|
|
483318
483127
|
const folderTrust = settings2.merged.security?.folderTrust?.enabled;
|
|
483319
|
-
(0,
|
|
483128
|
+
(0, import_react155.useEffect)(() => {
|
|
483320
483129
|
const { isTrusted: trusted } = isWorkspaceTrusted(settings2.merged);
|
|
483321
483130
|
setIsTrusted(trusted);
|
|
483322
483131
|
setIsFolderTrustDialogOpen(trusted === void 0);
|
|
483323
483132
|
onTrustChange(trusted);
|
|
483324
483133
|
}, [folderTrust, onTrustChange, settings2.merged]);
|
|
483325
|
-
const handleFolderTrustSelect = (0,
|
|
483134
|
+
const handleFolderTrustSelect = (0, import_react155.useCallback)(
|
|
483326
483135
|
(choice2) => {
|
|
483327
483136
|
const trustedFolders = loadTrustedFolders();
|
|
483328
483137
|
const cwd6 = process36.cwd();
|
|
@@ -483365,7 +483174,7 @@ var useFolderTrust = /* @__PURE__ */ __name((settings2, onTrustChange) => {
|
|
|
483365
483174
|
|
|
483366
483175
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
483367
483176
|
init_esbuild_shims();
|
|
483368
|
-
var
|
|
483177
|
+
var import_react156 = __toESM(require_react(), 1);
|
|
483369
483178
|
init_dist4();
|
|
483370
483179
|
|
|
483371
483180
|
// packages/cli/src/services/command-migration-tool.ts
|
|
@@ -483439,9 +483248,9 @@ __name(migrateTomlCommands, "migrateTomlCommands");
|
|
|
483439
483248
|
|
|
483440
483249
|
// packages/cli/src/ui/hooks/useCommandMigration.ts
|
|
483441
483250
|
function useCommandMigration(settings2, storage) {
|
|
483442
|
-
const [showMigrationNudge, setShowMigrationNudge] = (0,
|
|
483443
|
-
const [tomlFiles, setTomlFiles] = (0,
|
|
483444
|
-
(0,
|
|
483251
|
+
const [showMigrationNudge, setShowMigrationNudge] = (0, import_react156.useState)(false);
|
|
483252
|
+
const [tomlFiles, setTomlFiles] = (0, import_react156.useState)([]);
|
|
483253
|
+
(0, import_react156.useEffect)(() => {
|
|
483445
483254
|
const checkTomlCommands = /* @__PURE__ */ __name(async () => {
|
|
483446
483255
|
const allFiles = [];
|
|
483447
483256
|
const workspaceCommandsDir = storage.getProjectCommandsDir();
|
|
@@ -483467,9 +483276,9 @@ __name(useCommandMigration, "useCommandMigration");
|
|
|
483467
483276
|
|
|
483468
483277
|
// packages/cli/src/ui/hooks/useIdleMessageDrain.ts
|
|
483469
483278
|
init_esbuild_shims();
|
|
483470
|
-
var
|
|
483279
|
+
var import_react157 = __toESM(require_react(), 1);
|
|
483471
483280
|
function useIdleMessageDrain(isConfigInitialized, streamingState, messageQueue, drain, submitQuery) {
|
|
483472
|
-
(0,
|
|
483281
|
+
(0, import_react157.useEffect)(() => {
|
|
483473
483282
|
if (isConfigInitialized && streamingState === "idle" /* Idle */ && messageQueue.length > 0) {
|
|
483474
483283
|
const combined = messageQueue.join("\n\n");
|
|
483475
483284
|
drain();
|
|
@@ -483481,7 +483290,7 @@ __name(useIdleMessageDrain, "useIdleMessageDrain");
|
|
|
483481
483290
|
|
|
483482
483291
|
// packages/cli/src/ui/hooks/useWindowTitle.ts
|
|
483483
483292
|
init_esbuild_shims();
|
|
483484
|
-
var
|
|
483293
|
+
var import_react158 = __toESM(require_react(), 1);
|
|
483485
483294
|
import { basename as basename31 } from "node:path";
|
|
483486
483295
|
|
|
483487
483296
|
// packages/cli/src/utils/windowTitle.ts
|
|
@@ -483498,9 +483307,9 @@ __name(computeWindowTitle, "computeWindowTitle");
|
|
|
483498
483307
|
|
|
483499
483308
|
// packages/cli/src/ui/hooks/useWindowTitle.ts
|
|
483500
483309
|
function useWindowTitle(streamingState, thought, settings2, stdout3, targetDir) {
|
|
483501
|
-
const originalTitleRef = (0,
|
|
483502
|
-
const lastTitleRef = (0,
|
|
483503
|
-
(0,
|
|
483310
|
+
const originalTitleRef = (0, import_react158.useRef)(computeWindowTitle(basename31(targetDir)));
|
|
483311
|
+
const lastTitleRef = (0, import_react158.useRef)(null);
|
|
483312
|
+
(0, import_react158.useEffect)(() => {
|
|
483504
483313
|
if (!settings2.merged.ui?.showStatusInTitle || settings2.merged.ui?.hideWindowTitle)
|
|
483505
483314
|
return;
|
|
483506
483315
|
let title;
|
|
@@ -483527,11 +483336,11 @@ __name(useWindowTitle, "useWindowTitle");
|
|
|
483527
483336
|
|
|
483528
483337
|
// packages/cli/src/ui/hooks/useInitializationEffects.ts
|
|
483529
483338
|
init_esbuild_shims();
|
|
483530
|
-
var
|
|
483339
|
+
var import_react159 = __toESM(require_react(), 1);
|
|
483531
483340
|
init_dist4();
|
|
483532
483341
|
var debugLogger155 = createDebugLogger("APP_CONTAINER");
|
|
483533
483342
|
function useInitializationEffects(config2, historyManager, setConfigInitialized) {
|
|
483534
|
-
(0,
|
|
483343
|
+
(0, import_react159.useEffect)(() => {
|
|
483535
483344
|
(async () => {
|
|
483536
483345
|
await config2.initialize();
|
|
483537
483346
|
setConfigInitialized(true);
|
|
@@ -483599,7 +483408,7 @@ __name(useInitializationEffects, "useInitializationEffects");
|
|
|
483599
483408
|
|
|
483600
483409
|
// packages/cli/src/ui/hooks/usePromptSuggestions.ts
|
|
483601
483410
|
init_esbuild_shims();
|
|
483602
|
-
var
|
|
483411
|
+
var import_react160 = __toESM(require_react(), 1);
|
|
483603
483412
|
init_dist4();
|
|
483604
483413
|
function usePromptSuggestions(params) {
|
|
483605
483414
|
const {
|
|
@@ -483615,17 +483424,17 @@ function usePromptSuggestions(params) {
|
|
|
483615
483424
|
settingInputRequests,
|
|
483616
483425
|
pendingGeminiHistoryItems
|
|
483617
483426
|
} = params;
|
|
483618
|
-
const [promptSuggestion, setPromptSuggestion] = (0,
|
|
483619
|
-
const prevStreamingStateRef = (0,
|
|
483620
|
-
const speculationRef = (0,
|
|
483621
|
-
const suggestionAbortRef = (0,
|
|
483622
|
-
const dismissPromptSuggestion = (0,
|
|
483427
|
+
const [promptSuggestion, setPromptSuggestion] = (0, import_react160.useState)(null);
|
|
483428
|
+
const prevStreamingStateRef = (0, import_react160.useRef)("idle" /* Idle */);
|
|
483429
|
+
const speculationRef = (0, import_react160.useRef)(IDLE_SPECULATION);
|
|
483430
|
+
const suggestionAbortRef = (0, import_react160.useRef)(null);
|
|
483431
|
+
const dismissPromptSuggestion = (0, import_react160.useCallback)(() => {
|
|
483623
483432
|
setPromptSuggestion(null);
|
|
483624
483433
|
suggestionAbortRef.current?.abort();
|
|
483625
483434
|
suggestionAbortRef.current = null;
|
|
483626
483435
|
}, []);
|
|
483627
483436
|
const followupSuggestionsEnabled = settings2.merged.ui?.enableFollowupSuggestions !== false;
|
|
483628
|
-
(0,
|
|
483437
|
+
(0, import_react160.useEffect)(() => {
|
|
483629
483438
|
if (!followupSuggestionsEnabled) {
|
|
483630
483439
|
suggestionAbortRef.current?.abort();
|
|
483631
483440
|
setPromptSuggestion(null);
|
|
@@ -483698,7 +483507,7 @@ function usePromptSuggestions(params) {
|
|
|
483698
483507
|
isPermissionsDialogOpen,
|
|
483699
483508
|
settingInputRequests
|
|
483700
483509
|
]);
|
|
483701
|
-
(0,
|
|
483510
|
+
(0, import_react160.useEffect)(() => {
|
|
483702
483511
|
if (!promptSuggestion && speculationRef.current.status !== "idle") {
|
|
483703
483512
|
abortSpeculation(speculationRef.current).catch(() => {
|
|
483704
483513
|
});
|
|
@@ -483716,7 +483525,7 @@ __name(usePromptSuggestions, "usePromptSuggestions");
|
|
|
483716
483525
|
|
|
483717
483526
|
// packages/cli/src/ui/hooks/useExitHandling.ts
|
|
483718
483527
|
init_esbuild_shims();
|
|
483719
|
-
var
|
|
483528
|
+
var import_react161 = __toESM(require_react(), 1);
|
|
483720
483529
|
function useExitHandling(params) {
|
|
483721
483530
|
const {
|
|
483722
483531
|
isAuthDialogOpen,
|
|
@@ -483726,7 +483535,7 @@ function useExitHandling(params) {
|
|
|
483726
483535
|
cancelOngoingRequest,
|
|
483727
483536
|
buffer
|
|
483728
483537
|
} = params;
|
|
483729
|
-
const handleExit = (0,
|
|
483538
|
+
const handleExit = (0, import_react161.useCallback)(
|
|
483730
483539
|
(pressedOnce, setPressedOnce, timerRef) => {
|
|
483731
483540
|
if (pressedOnce) {
|
|
483732
483541
|
if (timerRef.current) {
|
|
@@ -486869,7 +486678,7 @@ __name(setUpdateHandler, "setUpdateHandler");
|
|
|
486869
486678
|
|
|
486870
486679
|
// packages/cli/src/ui/hooks/useMessageQueue.ts
|
|
486871
486680
|
init_esbuild_shims();
|
|
486872
|
-
var
|
|
486681
|
+
var import_react162 = __toESM(require_react(), 1);
|
|
486873
486682
|
var MessageQueueStore = class {
|
|
486874
486683
|
static {
|
|
486875
486684
|
__name(this, "MessageQueueStore");
|
|
@@ -486923,15 +486732,15 @@ var MessageQueueStore = class {
|
|
|
486923
486732
|
}
|
|
486924
486733
|
};
|
|
486925
486734
|
function useMessageQueue() {
|
|
486926
|
-
const store = (0,
|
|
486927
|
-
const messageQueue = (0,
|
|
486928
|
-
const addMessage = (0,
|
|
486735
|
+
const store = (0, import_react162.useMemo)(() => new MessageQueueStore(), []);
|
|
486736
|
+
const messageQueue = (0, import_react162.useSyncExternalStore)(store.subscribe, store.getSnapshot);
|
|
486737
|
+
const addMessage = (0, import_react162.useCallback)(
|
|
486929
486738
|
(message) => store.addMessage(message),
|
|
486930
486739
|
[store]
|
|
486931
486740
|
);
|
|
486932
|
-
const clearQueue = (0,
|
|
486933
|
-
const popLast = (0,
|
|
486934
|
-
const drain = (0,
|
|
486741
|
+
const clearQueue = (0, import_react162.useCallback)(() => store.clearQueue(), [store]);
|
|
486742
|
+
const popLast = (0, import_react162.useCallback)(() => store.popLast(), [store]);
|
|
486743
|
+
const drain = (0, import_react162.useCallback)(() => store.drain(), [store]);
|
|
486935
486744
|
return { messageQueue, addMessage, clearQueue, popLast, drain };
|
|
486936
486745
|
}
|
|
486937
486746
|
__name(useMessageQueue, "useMessageQueue");
|
|
@@ -486939,7 +486748,7 @@ __name(useMessageQueue, "useMessageQueue");
|
|
|
486939
486748
|
// packages/cli/src/ui/hooks/useAutoAcceptIndicator.ts
|
|
486940
486749
|
init_esbuild_shims();
|
|
486941
486750
|
init_dist4();
|
|
486942
|
-
var
|
|
486751
|
+
var import_react163 = __toESM(require_react(), 1);
|
|
486943
486752
|
function useAutoAcceptIndicator({
|
|
486944
486753
|
config: config2,
|
|
486945
486754
|
addItem,
|
|
@@ -486948,8 +486757,8 @@ function useAutoAcceptIndicator({
|
|
|
486948
486757
|
disabled
|
|
486949
486758
|
}) {
|
|
486950
486759
|
const currentConfigValue = config2.getApprovalMode();
|
|
486951
|
-
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0,
|
|
486952
|
-
(0,
|
|
486760
|
+
const [showAutoAcceptIndicator, setShowAutoAcceptIndicator] = (0, import_react163.useState)(currentConfigValue);
|
|
486761
|
+
(0, import_react163.useEffect)(() => {
|
|
486953
486762
|
setShowAutoAcceptIndicator(currentConfigValue);
|
|
486954
486763
|
}, [currentConfigValue]);
|
|
486955
486764
|
useKeypress(
|
|
@@ -486987,7 +486796,7 @@ __name(useAutoAcceptIndicator, "useAutoAcceptIndicator");
|
|
|
486987
486796
|
|
|
486988
486797
|
// packages/cli/src/ui/hooks/useExtensionUpdates.ts
|
|
486989
486798
|
init_esbuild_shims();
|
|
486990
|
-
var
|
|
486799
|
+
var import_react164 = __toESM(require_react(), 1);
|
|
486991
486800
|
function confirmationRequestsReducer(state, action) {
|
|
486992
486801
|
switch (action.type) {
|
|
486993
486802
|
case "add":
|
|
@@ -487004,8 +486813,8 @@ var useConfirmUpdateRequests = /* @__PURE__ */ __name(() => {
|
|
|
487004
486813
|
const [
|
|
487005
486814
|
confirmUpdateExtensionRequests,
|
|
487006
486815
|
dispatchConfirmUpdateExtensionRequests
|
|
487007
|
-
] = (0,
|
|
487008
|
-
const addConfirmUpdateExtensionRequest = (0,
|
|
486816
|
+
] = (0, import_react164.useReducer)(confirmationRequestsReducer, []);
|
|
486817
|
+
const addConfirmUpdateExtensionRequest = (0, import_react164.useCallback)(
|
|
487009
486818
|
(original) => {
|
|
487010
486819
|
const wrappedRequest = {
|
|
487011
486820
|
prompt: original.prompt,
|
|
@@ -487043,11 +486852,11 @@ function settingInputRequestsReducer(state, action) {
|
|
|
487043
486852
|
}
|
|
487044
486853
|
__name(settingInputRequestsReducer, "settingInputRequestsReducer");
|
|
487045
486854
|
var useSettingInputRequests = /* @__PURE__ */ __name(() => {
|
|
487046
|
-
const [settingInputRequests, dispatchSettingInputRequests] = (0,
|
|
486855
|
+
const [settingInputRequests, dispatchSettingInputRequests] = (0, import_react164.useReducer)(
|
|
487047
486856
|
settingInputRequestsReducer,
|
|
487048
486857
|
[]
|
|
487049
486858
|
);
|
|
487050
|
-
const addSettingInputRequest = (0,
|
|
486859
|
+
const addSettingInputRequest = (0, import_react164.useCallback)(
|
|
487051
486860
|
(original) => {
|
|
487052
486861
|
const wrappedRequest = {
|
|
487053
486862
|
settingName: original.settingName,
|
|
@@ -487094,11 +486903,11 @@ function pluginChoiceRequestsReducer(state, action) {
|
|
|
487094
486903
|
}
|
|
487095
486904
|
__name(pluginChoiceRequestsReducer, "pluginChoiceRequestsReducer");
|
|
487096
486905
|
var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
487097
|
-
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0,
|
|
486906
|
+
const [pluginChoiceRequests, dispatchPluginChoiceRequests] = (0, import_react164.useReducer)(
|
|
487098
486907
|
pluginChoiceRequestsReducer,
|
|
487099
486908
|
[]
|
|
487100
486909
|
);
|
|
487101
|
-
const addPluginChoiceRequest = (0,
|
|
486910
|
+
const addPluginChoiceRequest = (0, import_react164.useCallback)(
|
|
487102
486911
|
(original) => {
|
|
487103
486912
|
const wrappedRequest = {
|
|
487104
486913
|
marketplaceName: original.marketplaceName,
|
|
@@ -487132,12 +486941,12 @@ var usePluginChoiceRequests = /* @__PURE__ */ __name(() => {
|
|
|
487132
486941
|
};
|
|
487133
486942
|
}, "usePluginChoiceRequests");
|
|
487134
486943
|
var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd6) => {
|
|
487135
|
-
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0,
|
|
486944
|
+
const [extensionsUpdateState, dispatchExtensionStateUpdate] = (0, import_react164.useReducer)(
|
|
487136
486945
|
extensionUpdatesReducer,
|
|
487137
486946
|
initialExtensionUpdatesState
|
|
487138
486947
|
);
|
|
487139
486948
|
const extensions = extensionManager.getLoadedExtensions();
|
|
487140
|
-
(0,
|
|
486949
|
+
(0, import_react164.useEffect)(() => {
|
|
487141
486950
|
(async () => {
|
|
487142
486951
|
const extensionsToCheck = extensions.filter((extension) => {
|
|
487143
486952
|
const currentStatus = extensionsUpdateState.extensionStatuses.get(
|
|
@@ -487165,7 +486974,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
487165
486974
|
extensionsUpdateState.extensionStatuses,
|
|
487166
486975
|
dispatchExtensionStateUpdate
|
|
487167
486976
|
]);
|
|
487168
|
-
(0,
|
|
486977
|
+
(0, import_react164.useEffect)(() => {
|
|
487169
486978
|
if (extensionsUpdateState.batchChecksInProgress > 0) {
|
|
487170
486979
|
return;
|
|
487171
486980
|
}
|
|
@@ -487224,7 +487033,7 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
487224
487033
|
);
|
|
487225
487034
|
}
|
|
487226
487035
|
}, [extensions, extensionManager, extensionsUpdateState, addItem, cwd6]);
|
|
487227
|
-
const extensionsUpdateStateComputed = (0,
|
|
487036
|
+
const extensionsUpdateStateComputed = (0, import_react164.useMemo)(() => {
|
|
487228
487037
|
const result = /* @__PURE__ */ new Map();
|
|
487229
487038
|
for (const [
|
|
487230
487039
|
key,
|
|
@@ -487243,15 +487052,15 @@ var useExtensionUpdates = /* @__PURE__ */ __name((extensionManager, addItem, cwd
|
|
|
487243
487052
|
|
|
487244
487053
|
// packages/cli/src/ui/hooks/useWelcomeBack.ts
|
|
487245
487054
|
init_esbuild_shims();
|
|
487246
|
-
var
|
|
487055
|
+
var import_react165 = __toESM(require_react(), 1);
|
|
487247
487056
|
init_dist4();
|
|
487248
487057
|
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,
|
|
487058
|
+
const [welcomeBackInfo, setWelcomeBackInfo] = (0, import_react165.useState)(null);
|
|
487059
|
+
const [showWelcomeBackDialog, setShowWelcomeBackDialog] = (0, import_react165.useState)(false);
|
|
487060
|
+
const [welcomeBackChoice, setWelcomeBackChoice] = (0, import_react165.useState)(null);
|
|
487061
|
+
const [shouldFillInput, setShouldFillInput] = (0, import_react165.useState)(false);
|
|
487062
|
+
const [inputFillText, setInputFillText] = (0, import_react165.useState)(null);
|
|
487063
|
+
const checkWelcomeBack = (0, import_react165.useCallback)(async () => {
|
|
487255
487064
|
if (settings2.ui?.enableWelcomeBack === false) {
|
|
487256
487065
|
return;
|
|
487257
487066
|
}
|
|
@@ -487265,7 +487074,7 @@ function useWelcomeBack(config2, submitQuery, buffer, settings2) {
|
|
|
487265
487074
|
config2.getDebugLogger().debug("Welcome back check failed:", error40);
|
|
487266
487075
|
}
|
|
487267
487076
|
}, [config2, settings2.ui?.enableWelcomeBack]);
|
|
487268
|
-
const handleWelcomeBackSelection = (0,
|
|
487077
|
+
const handleWelcomeBackSelection = (0, import_react165.useCallback)(
|
|
487269
487078
|
(choice2) => {
|
|
487270
487079
|
setWelcomeBackChoice(choice2);
|
|
487271
487080
|
setShowWelcomeBackDialog(false);
|
|
@@ -487277,21 +487086,21 @@ function useWelcomeBack(config2, submitQuery, buffer, settings2) {
|
|
|
487277
487086
|
},
|
|
487278
487087
|
[welcomeBackInfo]
|
|
487279
487088
|
);
|
|
487280
|
-
const handleWelcomeBackClose = (0,
|
|
487089
|
+
const handleWelcomeBackClose = (0, import_react165.useCallback)(() => {
|
|
487281
487090
|
setWelcomeBackChoice("restart");
|
|
487282
487091
|
setShowWelcomeBackDialog(false);
|
|
487283
487092
|
}, []);
|
|
487284
|
-
const clearInputFill = (0,
|
|
487093
|
+
const clearInputFill = (0, import_react165.useCallback)(() => {
|
|
487285
487094
|
setShouldFillInput(false);
|
|
487286
487095
|
setInputFillText(null);
|
|
487287
487096
|
}, []);
|
|
487288
|
-
(0,
|
|
487097
|
+
(0, import_react165.useEffect)(() => {
|
|
487289
487098
|
if (shouldFillInput && inputFillText) {
|
|
487290
487099
|
buffer.setText(inputFillText);
|
|
487291
487100
|
clearInputFill();
|
|
487292
487101
|
}
|
|
487293
487102
|
}, [shouldFillInput, inputFillText, buffer, clearInputFill]);
|
|
487294
|
-
(0,
|
|
487103
|
+
(0, import_react165.useEffect)(() => {
|
|
487295
487104
|
checkWelcomeBack();
|
|
487296
487105
|
}, [checkWelcomeBack]);
|
|
487297
487106
|
return {
|
|
@@ -487312,9 +487121,9 @@ __name(useWelcomeBack, "useWelcomeBack");
|
|
|
487312
487121
|
|
|
487313
487122
|
// packages/cli/src/ui/hooks/useDialogClose.ts
|
|
487314
487123
|
init_esbuild_shims();
|
|
487315
|
-
var
|
|
487124
|
+
var import_react166 = __toESM(require_react(), 1);
|
|
487316
487125
|
function useDialogClose(options2) {
|
|
487317
|
-
const closeAnyOpenDialog = (0,
|
|
487126
|
+
const closeAnyOpenDialog = (0, import_react166.useCallback)(() => {
|
|
487318
487127
|
if (options2.isThemeDialogOpen) {
|
|
487319
487128
|
options2.handleThemeSelect(void 0, "User" /* User */);
|
|
487320
487129
|
return true;
|
|
@@ -487350,14 +487159,14 @@ __name(useDialogClose, "useDialogClose");
|
|
|
487350
487159
|
|
|
487351
487160
|
// packages/cli/src/ui/hooks/useInitializationAuthError.ts
|
|
487352
487161
|
init_esbuild_shims();
|
|
487353
|
-
var
|
|
487162
|
+
var import_react167 = __toESM(require_react(), 1);
|
|
487354
487163
|
var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError) => {
|
|
487355
|
-
const hasHandled = (0,
|
|
487356
|
-
const authErrorRef = (0,
|
|
487357
|
-
const onAuthErrorRef = (0,
|
|
487164
|
+
const hasHandled = (0, import_react167.useRef)(false);
|
|
487165
|
+
const authErrorRef = (0, import_react167.useRef)(authError);
|
|
487166
|
+
const onAuthErrorRef = (0, import_react167.useRef)(onAuthError);
|
|
487358
487167
|
authErrorRef.current = authError;
|
|
487359
487168
|
onAuthErrorRef.current = onAuthError;
|
|
487360
|
-
(0,
|
|
487169
|
+
(0, import_react167.useEffect)(() => {
|
|
487361
487170
|
if (hasHandled.current) {
|
|
487362
487171
|
return;
|
|
487363
487172
|
}
|
|
@@ -487370,13 +487179,13 @@ var useInitializationAuthError = /* @__PURE__ */ __name((authError, onAuthError)
|
|
|
487370
487179
|
|
|
487371
487180
|
// packages/cli/src/ui/hooks/useSubagentCreateDialog.ts
|
|
487372
487181
|
init_esbuild_shims();
|
|
487373
|
-
var
|
|
487182
|
+
var import_react168 = __toESM(require_react(), 1);
|
|
487374
487183
|
function useSubagentCreateDialog() {
|
|
487375
|
-
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0,
|
|
487376
|
-
const openSubagentCreateDialog = (0,
|
|
487184
|
+
const [isSubagentCreateDialogOpen, setIsSubagentCreateDialogOpen] = (0, import_react168.useState)(false);
|
|
487185
|
+
const openSubagentCreateDialog = (0, import_react168.useCallback)(() => {
|
|
487377
487186
|
setIsSubagentCreateDialogOpen(true);
|
|
487378
487187
|
}, []);
|
|
487379
|
-
const closeSubagentCreateDialog = (0,
|
|
487188
|
+
const closeSubagentCreateDialog = (0, import_react168.useCallback)(() => {
|
|
487380
487189
|
setIsSubagentCreateDialogOpen(false);
|
|
487381
487190
|
}, []);
|
|
487382
487191
|
return {
|
|
@@ -487389,13 +487198,13 @@ __name(useSubagentCreateDialog, "useSubagentCreateDialog");
|
|
|
487389
487198
|
|
|
487390
487199
|
// packages/cli/src/ui/hooks/useAgentsManagerDialog.ts
|
|
487391
487200
|
init_esbuild_shims();
|
|
487392
|
-
var
|
|
487201
|
+
var import_react169 = __toESM(require_react(), 1);
|
|
487393
487202
|
var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
487394
|
-
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0,
|
|
487395
|
-
const openAgentsManagerDialog = (0,
|
|
487203
|
+
const [isAgentsManagerDialogOpen, setIsAgentsManagerDialogOpen] = (0, import_react169.useState)(false);
|
|
487204
|
+
const openAgentsManagerDialog = (0, import_react169.useCallback)(() => {
|
|
487396
487205
|
setIsAgentsManagerDialogOpen(true);
|
|
487397
487206
|
}, []);
|
|
487398
|
-
const closeAgentsManagerDialog = (0,
|
|
487207
|
+
const closeAgentsManagerDialog = (0, import_react169.useCallback)(() => {
|
|
487399
487208
|
setIsAgentsManagerDialogOpen(false);
|
|
487400
487209
|
}, []);
|
|
487401
487210
|
return {
|
|
@@ -487407,13 +487216,13 @@ var useAgentsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
487407
487216
|
|
|
487408
487217
|
// packages/cli/src/ui/hooks/useExtensionsManagerDialog.ts
|
|
487409
487218
|
init_esbuild_shims();
|
|
487410
|
-
var
|
|
487219
|
+
var import_react170 = __toESM(require_react(), 1);
|
|
487411
487220
|
var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
487412
|
-
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0,
|
|
487413
|
-
const openExtensionsManagerDialog = (0,
|
|
487221
|
+
const [isExtensionsManagerDialogOpen, setIsExtensionsManagerDialogOpen] = (0, import_react170.useState)(false);
|
|
487222
|
+
const openExtensionsManagerDialog = (0, import_react170.useCallback)(() => {
|
|
487414
487223
|
setIsExtensionsManagerDialogOpen(true);
|
|
487415
487224
|
}, []);
|
|
487416
|
-
const closeExtensionsManagerDialog = (0,
|
|
487225
|
+
const closeExtensionsManagerDialog = (0, import_react170.useCallback)(() => {
|
|
487417
487226
|
setIsExtensionsManagerDialogOpen(false);
|
|
487418
487227
|
}, []);
|
|
487419
487228
|
return {
|
|
@@ -487425,13 +487234,13 @@ var useExtensionsManagerDialog = /* @__PURE__ */ __name(() => {
|
|
|
487425
487234
|
|
|
487426
487235
|
// packages/cli/src/ui/hooks/useMcpDialog.ts
|
|
487427
487236
|
init_esbuild_shims();
|
|
487428
|
-
var
|
|
487237
|
+
var import_react171 = __toESM(require_react(), 1);
|
|
487429
487238
|
var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
487430
|
-
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0,
|
|
487431
|
-
const openMcpDialog = (0,
|
|
487239
|
+
const [isMcpDialogOpen, setIsMcpDialogOpen] = (0, import_react171.useState)(false);
|
|
487240
|
+
const openMcpDialog = (0, import_react171.useCallback)(() => {
|
|
487432
487241
|
setIsMcpDialogOpen(true);
|
|
487433
487242
|
}, []);
|
|
487434
|
-
const closeMcpDialog = (0,
|
|
487243
|
+
const closeMcpDialog = (0, import_react171.useCallback)(() => {
|
|
487435
487244
|
setIsMcpDialogOpen(false);
|
|
487436
487245
|
}, []);
|
|
487437
487246
|
return {
|
|
@@ -487443,13 +487252,13 @@ var useMcpDialog = /* @__PURE__ */ __name(() => {
|
|
|
487443
487252
|
|
|
487444
487253
|
// packages/cli/src/ui/hooks/useHooksDialog.ts
|
|
487445
487254
|
init_esbuild_shims();
|
|
487446
|
-
var
|
|
487255
|
+
var import_react172 = __toESM(require_react(), 1);
|
|
487447
487256
|
var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
487448
|
-
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0,
|
|
487449
|
-
const openHooksDialog = (0,
|
|
487257
|
+
const [isHooksDialogOpen, setIsHooksDialogOpen] = (0, import_react172.useState)(false);
|
|
487258
|
+
const openHooksDialog = (0, import_react172.useCallback)(() => {
|
|
487450
487259
|
setIsHooksDialogOpen(true);
|
|
487451
487260
|
}, []);
|
|
487452
|
-
const closeHooksDialog = (0,
|
|
487261
|
+
const closeHooksDialog = (0, import_react172.useCallback)(() => {
|
|
487453
487262
|
setIsHooksDialogOpen(false);
|
|
487454
487263
|
}, []);
|
|
487455
487264
|
return {
|
|
@@ -487461,7 +487270,7 @@ var useHooksDialog = /* @__PURE__ */ __name(() => {
|
|
|
487461
487270
|
|
|
487462
487271
|
// packages/cli/src/ui/hooks/useAttentionNotifications.ts
|
|
487463
487272
|
init_esbuild_shims();
|
|
487464
|
-
var
|
|
487273
|
+
var import_react173 = __toESM(require_react(), 1);
|
|
487465
487274
|
|
|
487466
487275
|
// packages/cli/src/utils/attentionNotification.ts
|
|
487467
487276
|
init_esbuild_shims();
|
|
@@ -487498,10 +487307,10 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
487498
487307
|
config: config2
|
|
487499
487308
|
}) => {
|
|
487500
487309
|
const terminalBellEnabled = settings2?.merged?.general?.terminalBell ?? true;
|
|
487501
|
-
const awaitingNotificationSentRef = (0,
|
|
487502
|
-
const respondingElapsedRef = (0,
|
|
487503
|
-
const idleNotificationSentRef = (0,
|
|
487504
|
-
(0,
|
|
487310
|
+
const awaitingNotificationSentRef = (0, import_react173.useRef)(false);
|
|
487311
|
+
const respondingElapsedRef = (0, import_react173.useRef)(0);
|
|
487312
|
+
const idleNotificationSentRef = (0, import_react173.useRef)(false);
|
|
487313
|
+
(0, import_react173.useEffect)(() => {
|
|
487505
487314
|
if (streamingState === "waiting_for_confirmation" /* WaitingForConfirmation */ && !isFocused && !awaitingNotificationSentRef.current) {
|
|
487506
487315
|
notifyTerminalAttention("tool_approval" /* ToolApproval */, {
|
|
487507
487316
|
enabled: terminalBellEnabled
|
|
@@ -487512,7 +487321,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
487512
487321
|
awaitingNotificationSentRef.current = false;
|
|
487513
487322
|
}
|
|
487514
487323
|
}, [isFocused, streamingState, terminalBellEnabled]);
|
|
487515
|
-
(0,
|
|
487324
|
+
(0, import_react173.useEffect)(() => {
|
|
487516
487325
|
if (streamingState === "responding" /* Responding */) {
|
|
487517
487326
|
respondingElapsedRef.current = elapsedTime;
|
|
487518
487327
|
idleNotificationSentRef.current = false;
|
|
@@ -487548,7 +487357,7 @@ var useAttentionNotifications = /* @__PURE__ */ __name(({
|
|
|
487548
487357
|
|
|
487549
487358
|
// packages/cli/src/ui/hooks/useVoice.ts
|
|
487550
487359
|
init_esbuild_shims();
|
|
487551
|
-
var
|
|
487360
|
+
var import_react174 = __toESM(require_react(), 1);
|
|
487552
487361
|
import os46 from "node:os";
|
|
487553
487362
|
import path149 from "node:path";
|
|
487554
487363
|
import fs134 from "node:fs";
|
|
@@ -487583,12 +487392,12 @@ __name(transcribe, "transcribe");
|
|
|
487583
487392
|
|
|
487584
487393
|
// packages/cli/src/ui/hooks/useVoice.ts
|
|
487585
487394
|
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,
|
|
487395
|
+
const [voiceState, setVoiceState] = (0, import_react174.useState)("idle");
|
|
487396
|
+
const [error40, setError] = (0, import_react174.useState)(null);
|
|
487397
|
+
const procRef = (0, import_react174.useRef)(null);
|
|
487398
|
+
const audioPathRef = (0, import_react174.useRef)(null);
|
|
487399
|
+
const backend = (0, import_react174.useMemo)(() => detectBackend2(), []);
|
|
487400
|
+
const start2 = (0, import_react174.useCallback)(async () => {
|
|
487592
487401
|
if (voiceState !== "idle") return;
|
|
487593
487402
|
const tmpPath = path149.join(os46.tmpdir(), `proto-voice-${Date.now()}.wav`);
|
|
487594
487403
|
audioPathRef.current = tmpPath;
|
|
@@ -487601,7 +487410,7 @@ function useVoice(sttEndpoint, sttApiKey) {
|
|
|
487601
487410
|
setError(e4 instanceof Error ? e4.message : String(e4));
|
|
487602
487411
|
}
|
|
487603
487412
|
}, [voiceState, backend]);
|
|
487604
|
-
const stop3 = (0,
|
|
487413
|
+
const stop3 = (0, import_react174.useCallback)(async () => {
|
|
487605
487414
|
if (voiceState !== "recording" || !procRef.current || !audioPathRef.current) {
|
|
487606
487415
|
return "";
|
|
487607
487416
|
}
|
|
@@ -487634,7 +487443,7 @@ function useVoice(sttEndpoint, sttApiKey) {
|
|
|
487634
487443
|
return "";
|
|
487635
487444
|
}
|
|
487636
487445
|
}, [voiceState, sttEndpoint, sttApiKey]);
|
|
487637
|
-
const reset = (0,
|
|
487446
|
+
const reset = (0, import_react174.useCallback)(() => {
|
|
487638
487447
|
setVoiceState("idle");
|
|
487639
487448
|
setError(null);
|
|
487640
487449
|
}, []);
|
|
@@ -487669,21 +487478,21 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487669
487478
|
const { settings: settings2, config: config2, initializationResult } = props;
|
|
487670
487479
|
const historyManager = useHistory();
|
|
487671
487480
|
useMemoryMonitor(historyManager);
|
|
487672
|
-
const [debugMessage, setDebugMessage] = (0,
|
|
487673
|
-
const [quittingMessages, setQuittingMessages] = (0,
|
|
487674
|
-
const [themeError, setThemeError] = (0,
|
|
487481
|
+
const [debugMessage, setDebugMessage] = (0, import_react175.useState)("");
|
|
487482
|
+
const [quittingMessages, setQuittingMessages] = (0, import_react175.useState)(null);
|
|
487483
|
+
const [themeError, setThemeError] = (0, import_react175.useState)(
|
|
487675
487484
|
initializationResult.themeError
|
|
487676
487485
|
);
|
|
487677
|
-
const [isProcessing, setIsProcessing] = (0,
|
|
487678
|
-
const [embeddedShellFocused, setEmbeddedShellFocused] = (0,
|
|
487679
|
-
const [geminiMdFileCount, setGeminiMdFileCount] = (0,
|
|
487486
|
+
const [isProcessing, setIsProcessing] = (0, import_react175.useState)(false);
|
|
487487
|
+
const [embeddedShellFocused, setEmbeddedShellFocused] = (0, import_react175.useState)(false);
|
|
487488
|
+
const [geminiMdFileCount, setGeminiMdFileCount] = (0, import_react175.useState)(
|
|
487680
487489
|
initializationResult.geminiMdFileCount
|
|
487681
487490
|
);
|
|
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,
|
|
487491
|
+
const [shellModeActive, setShellModeActive] = (0, import_react175.useState)(false);
|
|
487492
|
+
const [modelSwitchedFromQuotaError, setModelSwitchedFromQuotaError] = (0, import_react175.useState)(false);
|
|
487493
|
+
const [historyRemountKey, setHistoryRemountKey] = (0, import_react175.useState)(0);
|
|
487494
|
+
const [updateInfo, setUpdateInfo] = (0, import_react175.useState)(null);
|
|
487495
|
+
const [isTrustedFolder, setIsTrustedFolder] = (0, import_react175.useState)(
|
|
487687
487496
|
config2.isTrustedFolder()
|
|
487688
487497
|
);
|
|
487689
487498
|
const extensionManager = config2.getExtensionManager();
|
|
@@ -487738,38 +487547,38 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487738
487547
|
config2.getWorkingDir()
|
|
487739
487548
|
);
|
|
487740
487549
|
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,
|
|
487550
|
+
const [isTrustDialogOpen, setTrustDialogOpen] = (0, import_react175.useState)(false);
|
|
487551
|
+
const openTrustDialog = (0, import_react175.useCallback)(() => setTrustDialogOpen(true), []);
|
|
487552
|
+
const closeTrustDialog = (0, import_react175.useCallback)(() => setTrustDialogOpen(false), []);
|
|
487553
|
+
const [isPermissionsDialogOpen, setPermissionsDialogOpen] = (0, import_react175.useState)(false);
|
|
487554
|
+
const openPermissionsDialog = (0, import_react175.useCallback)(
|
|
487746
487555
|
() => setPermissionsDialogOpen(true),
|
|
487747
487556
|
[]
|
|
487748
487557
|
);
|
|
487749
|
-
const closePermissionsDialog = (0,
|
|
487558
|
+
const closePermissionsDialog = (0, import_react175.useCallback)(
|
|
487750
487559
|
() => setPermissionsDialogOpen(false),
|
|
487751
487560
|
[]
|
|
487752
487561
|
);
|
|
487753
|
-
const getCurrentModel = (0,
|
|
487754
|
-
const [currentModel, setCurrentModel] = (0,
|
|
487755
|
-
const [isConfigInitialized, setConfigInitialized] = (0,
|
|
487756
|
-
const [userMessages, setUserMessages] = (0,
|
|
487562
|
+
const getCurrentModel = (0, import_react175.useCallback)(() => config2.getModel(), [config2]);
|
|
487563
|
+
const [currentModel, setCurrentModel] = (0, import_react175.useState)(getCurrentModel());
|
|
487564
|
+
const [isConfigInitialized, setConfigInitialized] = (0, import_react175.useState)(false);
|
|
487565
|
+
const [userMessages, setUserMessages] = (0, import_react175.useState)([]);
|
|
487757
487566
|
const { columns: terminalWidth, rows: terminalHeight } = useTerminalSize();
|
|
487758
487567
|
const { stdin: stdin3, setRawMode } = use_stdin_default();
|
|
487759
487568
|
const { stdout: stdout3 } = use_stdout_default();
|
|
487760
487569
|
const { stats: sessionStats, startNewSession } = useSessionStats();
|
|
487761
487570
|
const logger10 = useLogger(config2.storage, sessionStats.sessionId);
|
|
487762
487571
|
const branchName = useGitBranchName(config2.getTargetDir());
|
|
487763
|
-
const mainControlsRef = (0,
|
|
487572
|
+
const mainControlsRef = (0, import_react175.useRef)(null);
|
|
487764
487573
|
const staticExtraHeight = 3;
|
|
487765
487574
|
useInitializationEffects(config2, historyManager, setConfigInitialized);
|
|
487766
|
-
(0,
|
|
487575
|
+
(0, import_react175.useEffect)(
|
|
487767
487576
|
() => setUpdateHandler(historyManager.addItem, setUpdateInfo),
|
|
487768
487577
|
[historyManager.addItem]
|
|
487769
487578
|
);
|
|
487770
487579
|
const { lastFinished } = useBackgroundAgentProgress();
|
|
487771
487580
|
const addHistoryItem = historyManager.addItem;
|
|
487772
|
-
(0,
|
|
487581
|
+
(0, import_react175.useEffect)(() => {
|
|
487773
487582
|
if (!lastFinished?.hitLimit) return;
|
|
487774
487583
|
addHistoryItem(
|
|
487775
487584
|
{
|
|
@@ -487779,7 +487588,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487779
487588
|
Date.now()
|
|
487780
487589
|
);
|
|
487781
487590
|
}, [lastFinished, addHistoryItem]);
|
|
487782
|
-
(0,
|
|
487591
|
+
(0, import_react175.useEffect)(() => {
|
|
487783
487592
|
const interval = setInterval(() => {
|
|
487784
487593
|
const model = getCurrentModel();
|
|
487785
487594
|
if (model !== currentModel) {
|
|
@@ -487788,13 +487597,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487788
487597
|
}, 1e3);
|
|
487789
487598
|
return () => clearInterval(interval);
|
|
487790
487599
|
}, [config2, currentModel, getCurrentModel]);
|
|
487791
|
-
const { inputWidth, suggestionsWidth } = (0,
|
|
487600
|
+
const { inputWidth, suggestionsWidth } = (0, import_react175.useMemo)(() => {
|
|
487792
487601
|
const { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 } = calculatePromptWidths(terminalWidth);
|
|
487793
487602
|
return { inputWidth: inputWidth2, suggestionsWidth: suggestionsWidth2 };
|
|
487794
487603
|
}, [terminalWidth]);
|
|
487795
487604
|
const mainAreaWidth = Math.min(terminalWidth - 4, 100);
|
|
487796
487605
|
const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);
|
|
487797
|
-
const isValidPath = (0,
|
|
487606
|
+
const isValidPath = (0, import_react175.useCallback)((filePath) => {
|
|
487798
487607
|
try {
|
|
487799
487608
|
return fs135.existsSync(filePath) && fs135.statSync(filePath).isFile();
|
|
487800
487609
|
} catch (_e2) {
|
|
@@ -487809,7 +487618,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487809
487618
|
isValidPath,
|
|
487810
487619
|
shellModeActive
|
|
487811
487620
|
});
|
|
487812
|
-
(0,
|
|
487621
|
+
(0, import_react175.useEffect)(() => {
|
|
487813
487622
|
const fetchUserMessages = /* @__PURE__ */ __name(async () => {
|
|
487814
487623
|
const pastMessagesRaw = await logger10?.getPreviousUserMessages() || [];
|
|
487815
487624
|
const currentSessionUserMessages = historyManager.history.filter(
|
|
@@ -487832,7 +487641,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487832
487641
|
}, "fetchUserMessages");
|
|
487833
487642
|
fetchUserMessages();
|
|
487834
487643
|
}, [historyManager.history, logger10]);
|
|
487835
|
-
const refreshStatic = (0,
|
|
487644
|
+
const refreshStatic = (0, import_react175.useCallback)(() => {
|
|
487836
487645
|
stdout3.write("\x1B[?2026h");
|
|
487837
487646
|
stdout3.write(base_exports.clearTerminal);
|
|
487838
487647
|
stdout3.write("\x1B[?2026l");
|
|
@@ -487868,7 +487677,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487868
487677
|
cancelAuthentication
|
|
487869
487678
|
} = useAuthCommand(settings2, config2, historyManager.addItem, refreshStatic);
|
|
487870
487679
|
useInitializationAuthError(initializationResult.authError, onAuthError);
|
|
487871
|
-
(0,
|
|
487680
|
+
(0, import_react175.useEffect)(() => {
|
|
487872
487681
|
const currentAuthType = config2.getModelsConfig().getCurrentAuthType();
|
|
487873
487682
|
if (settings2.merged.security?.auth?.enforcedType && currentAuthType && settings2.merged.security?.auth.enforcedType !== currentAuthType) {
|
|
487874
487683
|
onAuthError(
|
|
@@ -487894,7 +487703,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487894
487703
|
config2,
|
|
487895
487704
|
onAuthError
|
|
487896
487705
|
]);
|
|
487897
|
-
const [editorError, setEditorError] = (0,
|
|
487706
|
+
const [editorError, setEditorError] = (0, import_react175.useState)(null);
|
|
487898
487707
|
const {
|
|
487899
487708
|
isEditorDialogOpen,
|
|
487900
487709
|
openEditorDialog,
|
|
@@ -487938,10 +487747,10 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
487938
487747
|
} = useExtensionsManagerDialog();
|
|
487939
487748
|
const { isMcpDialogOpen, openMcpDialog, closeMcpDialog } = useMcpDialog();
|
|
487940
487749
|
const { isHooksDialogOpen, openHooksDialog, closeHooksDialog } = useHooksDialog();
|
|
487941
|
-
const [isRewindDialogOpen, setIsRewindDialogOpen] = (0,
|
|
487942
|
-
const openRewindDialog = (0,
|
|
487943
|
-
const closeRewindDialog = (0,
|
|
487944
|
-
const slashCommandActions = (0,
|
|
487750
|
+
const [isRewindDialogOpen, setIsRewindDialogOpen] = (0, import_react175.useState)(false);
|
|
487751
|
+
const openRewindDialog = (0, import_react175.useCallback)(() => setIsRewindDialogOpen(true), []);
|
|
487752
|
+
const closeRewindDialog = (0, import_react175.useCallback)(() => setIsRewindDialogOpen(false), []);
|
|
487753
|
+
const slashCommandActions = (0, import_react175.useMemo)(
|
|
487945
487754
|
() => ({
|
|
487946
487755
|
openAuthDialog,
|
|
487947
487756
|
openThemeDialog,
|
|
@@ -488019,14 +487828,14 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488019
487828
|
isConfigInitialized,
|
|
488020
487829
|
logger10
|
|
488021
487830
|
);
|
|
488022
|
-
const onDebugMessage = (0,
|
|
487831
|
+
const onDebugMessage = (0, import_react175.useCallback)(
|
|
488023
487832
|
(message) => {
|
|
488024
487833
|
config2.getDebugLogger().debug(message);
|
|
488025
487834
|
},
|
|
488026
487835
|
[config2]
|
|
488027
487836
|
);
|
|
488028
487837
|
const stableAddItem = historyManager.addItem;
|
|
488029
|
-
const performMemoryRefresh = (0,
|
|
487838
|
+
const performMemoryRefresh = (0, import_react175.useCallback)(async () => {
|
|
488030
487839
|
stableAddItem(
|
|
488031
487840
|
{
|
|
488032
487841
|
type: "info" /* INFO */,
|
|
@@ -488072,7 +487881,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488072
487881
|
debugLogger159.error("Error refreshing memory:", error40);
|
|
488073
487882
|
}
|
|
488074
487883
|
}, [config2, stableAddItem, settings2.merged]);
|
|
488075
|
-
const cancelHandlerRef = (0,
|
|
487884
|
+
const cancelHandlerRef = (0, import_react175.useRef)(() => {
|
|
488076
487885
|
});
|
|
488077
487886
|
const { messageQueue, addMessage, popLast, drain } = useMessageQueue();
|
|
488078
487887
|
const voiceEnabled = settings2.merged.voice?.enabled ?? false;
|
|
@@ -488124,7 +487933,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488124
487933
|
drain,
|
|
488125
487934
|
submitQuery
|
|
488126
487935
|
);
|
|
488127
|
-
const [hasSuggestionsVisible, setHasSuggestionsVisible] = (0,
|
|
487936
|
+
const [hasSuggestionsVisible, setHasSuggestionsVisible] = (0, import_react175.useState)(false);
|
|
488128
487937
|
const agentViewState = useAgentViewState();
|
|
488129
487938
|
const geminiClient = config2.getGeminiClient();
|
|
488130
487939
|
const showAutoAcceptIndicator = useAutoAcceptIndicator({
|
|
@@ -488152,17 +487961,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488152
487961
|
settingInputRequests,
|
|
488153
487962
|
pendingGeminiHistoryItems
|
|
488154
487963
|
});
|
|
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)(
|
|
487964
|
+
const handleFinalSubmit = (0, import_react175.useCallback)(
|
|
488166
487965
|
(submittedValue) => {
|
|
488167
487966
|
if (agentViewState.activeView !== "main") {
|
|
488168
487967
|
const agent = agentViewState.agents.get(agentViewState.activeView);
|
|
@@ -488270,7 +488069,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488270
488069
|
speculationRef
|
|
488271
488070
|
]
|
|
488272
488071
|
);
|
|
488273
|
-
const handleArenaModelsSelected = (0,
|
|
488072
|
+
const handleArenaModelsSelected = (0, import_react175.useCallback)(
|
|
488274
488073
|
(models) => {
|
|
488275
488074
|
const value = models.join(",");
|
|
488276
488075
|
buffer.setText(`/arena start --models ${value} `);
|
|
@@ -488285,7 +488084,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488285
488084
|
handleWelcomeBackSelection,
|
|
488286
488085
|
handleWelcomeBackClose
|
|
488287
488086
|
} = useWelcomeBack(config2, handleFinalSubmit, buffer, settings2.merged);
|
|
488288
|
-
cancelHandlerRef.current = (0,
|
|
488087
|
+
cancelHandlerRef.current = (0, import_react175.useCallback)(() => {
|
|
488289
488088
|
const pendingHistoryItems2 = [
|
|
488290
488089
|
...pendingSlashCommandHistoryItems,
|
|
488291
488090
|
...pendingGeminiHistoryItems
|
|
@@ -488310,15 +488109,15 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488310
488109
|
pendingSlashCommandHistoryItems,
|
|
488311
488110
|
pendingGeminiHistoryItems
|
|
488312
488111
|
]);
|
|
488313
|
-
const handleClearScreen = (0,
|
|
488112
|
+
const handleClearScreen = (0, import_react175.useCallback)(() => {
|
|
488314
488113
|
historyManager.clearItems();
|
|
488315
488114
|
clearScreen2();
|
|
488316
488115
|
refreshStatic();
|
|
488317
488116
|
}, [historyManager, refreshStatic]);
|
|
488318
488117
|
const { handleInput: vimHandleInput } = useVim(buffer, handleFinalSubmit);
|
|
488319
488118
|
const isInputActive = !initError && !isProcessing && (streamingState === "idle" /* Idle */ || streamingState === "responding" /* Responding */);
|
|
488320
|
-
const [controlsHeight, setControlsHeight] = (0,
|
|
488321
|
-
(0,
|
|
488119
|
+
const [controlsHeight, setControlsHeight] = (0, import_react175.useState)(0);
|
|
488120
|
+
(0, import_react175.useLayoutEffect)(() => {
|
|
488322
488121
|
if (mainControlsRef.current) {
|
|
488323
488122
|
const fullFooterMeasurement = measure_element_default(mainControlsRef.current);
|
|
488324
488123
|
if (fullFooterMeasurement.height > 0) {
|
|
@@ -488342,13 +488141,13 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488342
488141
|
});
|
|
488343
488142
|
const isFocused = useFocus();
|
|
488344
488143
|
useBracketedPaste();
|
|
488345
|
-
const contextFileNames = (0,
|
|
488144
|
+
const contextFileNames = (0, import_react175.useMemo)(() => {
|
|
488346
488145
|
const fromSettings = settings2.merged.context?.fileName;
|
|
488347
488146
|
return fromSettings ? Array.isArray(fromSettings) ? fromSettings : [fromSettings] : getAllGeminiMdFilenames();
|
|
488348
488147
|
}, [settings2.merged.context?.fileName]);
|
|
488349
|
-
const initialPrompt = (0,
|
|
488350
|
-
const initialPromptSubmitted = (0,
|
|
488351
|
-
(0,
|
|
488148
|
+
const initialPrompt = (0, import_react175.useMemo)(() => config2.getQuestion(), [config2]);
|
|
488149
|
+
const initialPromptSubmitted = (0, import_react175.useRef)(false);
|
|
488150
|
+
(0, import_react175.useEffect)(() => {
|
|
488352
488151
|
if (activePtyId) {
|
|
488353
488152
|
ShellExecutionService.resizePty(
|
|
488354
488153
|
activePtyId,
|
|
@@ -488357,7 +488156,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488357
488156
|
);
|
|
488358
488157
|
}
|
|
488359
488158
|
}, [terminalWidth, availableTerminalHeight, activePtyId]);
|
|
488360
|
-
(0,
|
|
488159
|
+
(0, import_react175.useEffect)(() => {
|
|
488361
488160
|
if (initialPrompt && isConfigInitialized && !initialPromptSubmitted.current && !isAuthenticating && !isAuthDialogOpen && !isThemeDialogOpen && !isEditorDialogOpen && !showWelcomeBackDialog && welcomeBackChoice !== "restart" && geminiClient?.isInitialized?.()) {
|
|
488362
488161
|
handleFinalSubmit(initialPrompt);
|
|
488363
488162
|
initialPromptSubmitted.current = true;
|
|
@@ -488374,9 +488173,9 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488374
488173
|
welcomeBackChoice,
|
|
488375
488174
|
geminiClient
|
|
488376
488175
|
]);
|
|
488377
|
-
const [idePromptAnswered, setIdePromptAnswered] = (0,
|
|
488378
|
-
const [currentIDE, setCurrentIDE] = (0,
|
|
488379
|
-
(0,
|
|
488176
|
+
const [idePromptAnswered, setIdePromptAnswered] = (0, import_react175.useState)(false);
|
|
488177
|
+
const [currentIDE, setCurrentIDE] = (0, import_react175.useState)(null);
|
|
488178
|
+
(0, import_react175.useEffect)(() => {
|
|
488380
488179
|
const getIde = /* @__PURE__ */ __name(async () => {
|
|
488381
488180
|
const ideClient = await IdeClient.getInstance();
|
|
488382
488181
|
const currentIde = ideClient.getCurrentIde();
|
|
@@ -488392,20 +488191,20 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488392
488191
|
tomlFiles: commandMigrationTomlFiles,
|
|
488393
488192
|
setShowMigrationNudge: setShowCommandMigrationNudge
|
|
488394
488193
|
} = useCommandMigration(settings2, config2.storage);
|
|
488395
|
-
const [ideContextState, setIdeContextState] = (0,
|
|
488396
|
-
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0,
|
|
488194
|
+
const [ideContextState, setIdeContextState] = (0, import_react175.useState)();
|
|
488195
|
+
const [showIdeRestartPrompt, setShowIdeRestartPrompt] = (0, import_react175.useState)(false);
|
|
488397
488196
|
const { isFolderTrustDialogOpen, handleFolderTrustSelect, isRestarting } = useFolderTrust(settings2, setIsTrustedFolder);
|
|
488398
488197
|
const {
|
|
488399
488198
|
needsRestart: ideNeedsRestart,
|
|
488400
488199
|
restartReason: ideTrustRestartReason
|
|
488401
488200
|
} = useIdeTrustListener();
|
|
488402
|
-
const isInitialMount = (0,
|
|
488403
|
-
(0,
|
|
488201
|
+
const isInitialMount = (0, import_react175.useRef)(true);
|
|
488202
|
+
(0, import_react175.useEffect)(() => {
|
|
488404
488203
|
if (ideNeedsRestart) {
|
|
488405
488204
|
setShowIdeRestartPrompt(true);
|
|
488406
488205
|
}
|
|
488407
488206
|
}, [ideNeedsRestart]);
|
|
488408
|
-
(0,
|
|
488207
|
+
(0, import_react175.useEffect)(() => {
|
|
488409
488208
|
if (isInitialMount.current) {
|
|
488410
488209
|
isInitialMount.current = false;
|
|
488411
488210
|
return;
|
|
@@ -488417,12 +488216,12 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488417
488216
|
clearTimeout(handler);
|
|
488418
488217
|
};
|
|
488419
488218
|
}, [terminalWidth, refreshStatic]);
|
|
488420
|
-
(0,
|
|
488219
|
+
(0, import_react175.useEffect)(() => {
|
|
488421
488220
|
const unsubscribe = ideContextStore.subscribe(setIdeContextState);
|
|
488422
488221
|
setIdeContextState(ideContextStore.get());
|
|
488423
488222
|
return unsubscribe;
|
|
488424
488223
|
}, []);
|
|
488425
|
-
const handleIdePromptComplete = (0,
|
|
488224
|
+
const handleIdePromptComplete = (0, import_react175.useCallback)(
|
|
488426
488225
|
(result) => {
|
|
488427
488226
|
if (result.userSelection === "yes") {
|
|
488428
488227
|
if (result.isExtensionPreInstalled) {
|
|
@@ -488438,7 +488237,7 @@ var AppContainer = /* @__PURE__ */ __name((props) => {
|
|
|
488438
488237
|
},
|
|
488439
488238
|
[handleSlashCommand2, settings2]
|
|
488440
488239
|
);
|
|
488441
|
-
const handleCommandMigrationComplete = (0,
|
|
488240
|
+
const handleCommandMigrationComplete = (0, import_react175.useCallback)(
|
|
488442
488241
|
async (result) => {
|
|
488443
488242
|
setShowCommandMigrationNudge(false);
|
|
488444
488243
|
if (result.userSelection === "yes") {
|
|
@@ -488597,11 +488396,11 @@ ${migrationResult.failedFiles.map((f5) => ` \u2022 ${f5.file}: ${f5.error}`).jo
|
|
|
488597
488396
|
history: historyManager.history,
|
|
488598
488397
|
sessionStats
|
|
488599
488398
|
});
|
|
488600
|
-
const pendingHistoryItems = (0,
|
|
488399
|
+
const pendingHistoryItems = (0, import_react175.useMemo)(
|
|
488601
488400
|
() => [...pendingSlashCommandHistoryItems, ...pendingGeminiHistoryItems],
|
|
488602
488401
|
[pendingSlashCommandHistoryItems, pendingGeminiHistoryItems]
|
|
488603
488402
|
);
|
|
488604
|
-
const uiState = (0,
|
|
488403
|
+
const uiState = (0, import_react175.useMemo)(
|
|
488605
488404
|
() => ({
|
|
488606
488405
|
history: historyManager.history,
|
|
488607
488406
|
historyManager,
|
|
@@ -488826,7 +488625,7 @@ ${migrationResult.failedFiles.map((f5) => ` \u2022 ${f5.file}: ${f5.error}`).jo
|
|
|
488826
488625
|
dismissPromptSuggestion
|
|
488827
488626
|
]
|
|
488828
488627
|
);
|
|
488829
|
-
const uiActions = (0,
|
|
488628
|
+
const uiActions = (0, import_react175.useMemo)(
|
|
488830
488629
|
() => ({
|
|
488831
488630
|
openThemeDialog,
|
|
488832
488631
|
openEditorDialog,
|
|
@@ -488977,9 +488776,9 @@ ${migrationResult.failedFiles.map((f5) => ` \u2022 ${f5.file}: ${f5.error}`).jo
|
|
|
488977
488776
|
|
|
488978
488777
|
// packages/cli/src/ui/hooks/useKittyKeyboardProtocol.ts
|
|
488979
488778
|
init_esbuild_shims();
|
|
488980
|
-
var
|
|
488779
|
+
var import_react176 = __toESM(require_react(), 1);
|
|
488981
488780
|
function useKittyKeyboardProtocol() {
|
|
488982
|
-
const [status] = (0,
|
|
488781
|
+
const [status] = (0, import_react176.useState)({
|
|
488983
488782
|
supported: isKittyProtocolSupported(),
|
|
488984
488783
|
enabled: isKittyProtocolEnabled(),
|
|
488985
488784
|
checking: false
|
|
@@ -489959,7 +489758,7 @@ __name(validateNonInteractiveAuth, "validateNonInteractiveAuth");
|
|
|
489959
489758
|
|
|
489960
489759
|
// packages/cli/src/ui/components/StandaloneSessionPicker.tsx
|
|
489961
489760
|
init_esbuild_shims();
|
|
489962
|
-
var
|
|
489761
|
+
var import_react177 = __toESM(require_react(), 1);
|
|
489963
489762
|
init_dist4();
|
|
489964
489763
|
var import_jsx_runtime141 = __toESM(require_jsx_runtime(), 1);
|
|
489965
489764
|
function StandalonePickerScreen({
|
|
@@ -489969,7 +489768,7 @@ function StandalonePickerScreen({
|
|
|
489969
489768
|
currentBranch
|
|
489970
489769
|
}) {
|
|
489971
489770
|
const { exit } = use_app_default();
|
|
489972
|
-
const [isExiting, setIsExiting] = (0,
|
|
489771
|
+
const [isExiting, setIsExiting] = (0, import_react177.useState)(false);
|
|
489973
489772
|
const handleExit = /* @__PURE__ */ __name(() => {
|
|
489974
489773
|
setIsExiting(true);
|
|
489975
489774
|
exit();
|
|
@@ -493071,7 +492870,7 @@ var QwenAgent = class {
|
|
|
493071
492870
|
async initialize(args2) {
|
|
493072
492871
|
this.clientCapabilities = args2.clientCapabilities;
|
|
493073
492872
|
const authMethods = buildAuthMethods();
|
|
493074
|
-
const version2 = "0.26.
|
|
492873
|
+
const version2 = "0.26.25";
|
|
493075
492874
|
return {
|
|
493076
492875
|
protocolVersion: PROTOCOL_VERSION,
|
|
493077
492876
|
agentInfo: {
|
|
@@ -493745,7 +493544,7 @@ async function startInteractiveUI(config2, settings2, startupWarnings, workspace
|
|
|
493745
493544
|
) });
|
|
493746
493545
|
}, "AppWrapper");
|
|
493747
493546
|
const instance2 = render_default(
|
|
493748
|
-
process.env["DEBUG"] ? /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(
|
|
493547
|
+
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
493548
|
{
|
|
493750
493549
|
exitOnCtrlC: false,
|
|
493751
493550
|
patchConsole: false,
|
|
@@ -494366,20 +494165,6 @@ main().catch((error40) => {
|
|
|
494366
494165
|
* Copyright 2025 ProtoLabs
|
|
494367
494166
|
* SPDX-License-Identifier: Apache-2.0
|
|
494368
494167
|
*/
|
|
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
494168
|
/*! Bundled license information:
|
|
494384
494169
|
|
|
494385
494170
|
undici/lib/web/fetch/body.js:
|