deepcode-ai 1.2.11 → 1.2.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +392 -943
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2233,12 +2233,11 @@ var SessionTelemetrySchema = z.object({
|
|
|
2233
2233
|
});
|
|
2234
2234
|
|
|
2235
2235
|
// ../../packages/core/dist/index.js
|
|
2236
|
-
import { z as z2 } from "zod";
|
|
2237
2236
|
import { execFile, spawn } from "child_process";
|
|
2238
2237
|
import { spawn as spawn2 } from "child_process";
|
|
2239
2238
|
import { createInterface } from "readline";
|
|
2240
2239
|
import { Effect as Effect3 } from "effect";
|
|
2241
|
-
import { z as
|
|
2240
|
+
import { z as z2 } from "zod";
|
|
2242
2241
|
import { Effect as Effect2 } from "effect";
|
|
2243
2242
|
import fs from "fs";
|
|
2244
2243
|
import path22 from "path";
|
|
@@ -2249,12 +2248,12 @@ import { mkdir as mkdir22, readFile as readFile2 } from "fs/promises";
|
|
|
2249
2248
|
import os from "os";
|
|
2250
2249
|
import path4 from "path";
|
|
2251
2250
|
import { EventEmitter } from "events";
|
|
2252
|
-
import { z as
|
|
2251
|
+
import { z as z22 } from "zod";
|
|
2253
2252
|
import { spawn as spawn3 } from "child_process";
|
|
2254
2253
|
import { URL as URL2 } from "url";
|
|
2255
2254
|
import { URLSearchParams } from "url";
|
|
2256
2255
|
import { execFile as execFile2 } from "child_process";
|
|
2257
|
-
import { z as
|
|
2256
|
+
import { z as z3 } from "zod";
|
|
2258
2257
|
import { spawn as spawn4 } from "child_process";
|
|
2259
2258
|
import { existsSync } from "fs";
|
|
2260
2259
|
import path5 from "path";
|
|
@@ -2270,24 +2269,24 @@ import path9 from "path";
|
|
|
2270
2269
|
import { readFile as readFile5 } from "fs/promises";
|
|
2271
2270
|
import path11 from "path";
|
|
2272
2271
|
import { Effect as Effect4 } from "effect";
|
|
2273
|
-
import { z as
|
|
2272
|
+
import { z as z4 } from "zod";
|
|
2274
2273
|
import { lstat as lstat2, mkdir as mkdir6, readFile as readFile6, readdir as readdir4, stat, writeFile as writeFile22 } from "fs/promises";
|
|
2275
2274
|
import path12 from "path";
|
|
2276
2275
|
import { Effect as Effect5 } from "effect";
|
|
2277
|
-
import { z as
|
|
2276
|
+
import { z as z5 } from "zod";
|
|
2278
2277
|
import { Effect as Effect6 } from "effect";
|
|
2279
|
-
import { z as
|
|
2278
|
+
import { z as z6 } from "zod";
|
|
2280
2279
|
import path13 from "path";
|
|
2281
2280
|
import { Effect as Effect7 } from "effect";
|
|
2282
|
-
import { z as
|
|
2281
|
+
import { z as z7 } from "zod";
|
|
2283
2282
|
import { Effect as Effect8 } from "effect";
|
|
2284
|
-
import { z as
|
|
2283
|
+
import { z as z8 } from "zod";
|
|
2285
2284
|
import { Effect as Effect9 } from "effect";
|
|
2286
|
-
import { z as
|
|
2285
|
+
import { z as z9 } from "zod";
|
|
2287
2286
|
import { Effect as Effect10 } from "effect";
|
|
2288
|
-
import { z as
|
|
2287
|
+
import { z as z10 } from "zod";
|
|
2289
2288
|
import { Effect as Effect11 } from "effect";
|
|
2290
|
-
import { z as
|
|
2289
|
+
import { z as z11 } from "zod";
|
|
2291
2290
|
import { zodToJsonSchema as zodToJsonSchema2 } from "zod-to-json-schema";
|
|
2292
2291
|
import path14 from "path";
|
|
2293
2292
|
import { readdir as readdir5, lstat as lstat3 } from "fs/promises";
|
|
@@ -2547,139 +2546,6 @@ function failoverOrder(primary) {
|
|
|
2547
2546
|
(provider) => provider !== primary
|
|
2548
2547
|
);
|
|
2549
2548
|
}
|
|
2550
|
-
var TaskStatusSchema = z2.enum(["pending", "running", "completed", "failed"]);
|
|
2551
|
-
var TaskSchema = z2.object({
|
|
2552
|
-
id: z2.string().min(1).max(50).regex(/^[a-z0-9-]+$/),
|
|
2553
|
-
description: z2.string().min(1).max(500),
|
|
2554
|
-
type: z2.enum(["research", "code", "test", "verify"]),
|
|
2555
|
-
dependencies: z2.array(z2.string()).default([]),
|
|
2556
|
-
status: TaskStatusSchema,
|
|
2557
|
-
result: z2.string().optional(),
|
|
2558
|
-
error: z2.string().optional()
|
|
2559
|
-
});
|
|
2560
|
-
var TaskPlanSchema = z2.object({
|
|
2561
|
-
objective: z2.string().min(1),
|
|
2562
|
-
tasks: z2.array(TaskSchema),
|
|
2563
|
-
raw: z2.string().optional(),
|
|
2564
|
-
currentTaskId: z2.string().optional()
|
|
2565
|
-
});
|
|
2566
|
-
var PlannedTaskSchema = z2.object({
|
|
2567
|
-
id: z2.string().min(1).max(50).regex(/^[a-z0-9-]+$/),
|
|
2568
|
-
description: z2.string().min(1).max(500),
|
|
2569
|
-
type: z2.enum(["research", "code", "test", "verify"]),
|
|
2570
|
-
dependencies: z2.array(z2.string()).default([])
|
|
2571
|
-
});
|
|
2572
|
-
var PlannedTaskArraySchema = z2.array(PlannedTaskSchema).min(1, "At least one task is required.");
|
|
2573
|
-
var READ_ONLY_DISCOVERY_VERB_PATTERN = /\b(?:list|show|find|search|inspect|check|track|listar|mostre|mostrar|busque|buscar|procure|procurar|inspecione|verifique|rastrear|rastreie)\b/i;
|
|
2574
|
-
var READ_ONLY_DISCOVERY_NOUN_PATTERN = /\b(?:project|projects|repo|repos|repository|repositories|directory|directories|folder|folders|workspace|projeto|projetos|repositorio|repositorios|diretorio|diretorios|pasta|pastas)\b/i;
|
|
2575
|
-
var READ_ONLY_MUTATION_PATTERN = /\b(?:git\s+init|git\s+add|git\s+commit|git\s+push|git\s+tag|git\s+stash|initialize\s+(?:a\s+)?git\s+repository|initialise\s+(?:a\s+)?git\s+repository|create\s+(?:a\s+)?\.?gitignore|stage\s+all\s+files|commit\s+all\s+files)\b/i;
|
|
2576
|
-
function isReadOnlyDiscoveryObjective(objective) {
|
|
2577
|
-
return READ_ONLY_DISCOVERY_VERB_PATTERN.test(objective) && READ_ONLY_DISCOVERY_NOUN_PATTERN.test(objective);
|
|
2578
|
-
}
|
|
2579
|
-
var TaskPlanner = class {
|
|
2580
|
-
async plan(objective, complete) {
|
|
2581
|
-
const readOnlyDiscoveryObjective = isReadOnlyDiscoveryObjective(objective);
|
|
2582
|
-
const raw = await complete(`Create an execution plan for this coding task.
|
|
2583
|
-
Return only JSON in this shape:
|
|
2584
|
-
[
|
|
2585
|
-
{"id":"short-id","description":"specific action","type":"research|code|test|verify","dependencies":[]}
|
|
2586
|
-
]
|
|
2587
|
-
|
|
2588
|
-
Requirements:
|
|
2589
|
-
- Each task must have a unique ID (lowercase, alphanumeric with hyphens)
|
|
2590
|
-
- Description should be specific and actionable
|
|
2591
|
-
- Type must be one of: research, code, test, verify
|
|
2592
|
-
- Dependencies must reference existing task IDs
|
|
2593
|
-
- Tasks should be ordered logically
|
|
2594
|
-
${readOnlyDiscoveryObjective ? `- This is a read-only discovery request; prefer the fewest inspection steps needed
|
|
2595
|
-
- Do not propose initializing git repositories, creating .gitignore, staging files, committing, or pushing
|
|
2596
|
-
- Do not propose filesystem mutations for this request` : ""}
|
|
2597
|
-
|
|
2598
|
-
Task:
|
|
2599
|
-
${objective}`);
|
|
2600
|
-
try {
|
|
2601
|
-
const parsedRaw = JSON.parse(raw);
|
|
2602
|
-
const validationResult = PlannedTaskArraySchema.safeParse(parsedRaw);
|
|
2603
|
-
if (!validationResult.success) {
|
|
2604
|
-
throw new Error(`Invalid task plan format: ${validationResult.error.message}`);
|
|
2605
|
-
}
|
|
2606
|
-
const taskIds = new Set(validationResult.data.map((t2) => t2.id));
|
|
2607
|
-
for (const task of validationResult.data) {
|
|
2608
|
-
for (const dep of task.dependencies) {
|
|
2609
|
-
if (!taskIds.has(dep)) {
|
|
2610
|
-
throw new Error(`Task "${task.id}" has unknown dependency: "${dep}"`);
|
|
2611
|
-
}
|
|
2612
|
-
}
|
|
2613
|
-
if (readOnlyDiscoveryObjective && READ_ONLY_MUTATION_PATTERN.test(task.description)) {
|
|
2614
|
-
throw new Error(`Unsafe mutating task in read-only plan: "${task.description}"`);
|
|
2615
|
-
}
|
|
2616
|
-
}
|
|
2617
|
-
return {
|
|
2618
|
-
objective,
|
|
2619
|
-
raw,
|
|
2620
|
-
tasks: validationResult.data.map((task) => ({
|
|
2621
|
-
id: task.id,
|
|
2622
|
-
description: task.description,
|
|
2623
|
-
type: task.type,
|
|
2624
|
-
dependencies: task.dependencies,
|
|
2625
|
-
status: "pending"
|
|
2626
|
-
}))
|
|
2627
|
-
};
|
|
2628
|
-
} catch (error) {
|
|
2629
|
-
if (error instanceof SyntaxError) {
|
|
2630
|
-
throw new Error(`Invalid JSON in task plan: ${error.message}`);
|
|
2631
|
-
}
|
|
2632
|
-
throw error;
|
|
2633
|
-
}
|
|
2634
|
-
}
|
|
2635
|
-
/**
|
|
2636
|
-
* Get the next task that can be executed (all dependencies completed)
|
|
2637
|
-
*/
|
|
2638
|
-
getNextTask(plan) {
|
|
2639
|
-
return this.getRunnableTasks(plan)[0];
|
|
2640
|
-
}
|
|
2641
|
-
/**
|
|
2642
|
-
* Get all tasks that can be executed in parallel (dependencies satisfied, status pending)
|
|
2643
|
-
*/
|
|
2644
|
-
getRunnableTasks(plan) {
|
|
2645
|
-
const completedIds = new Set(
|
|
2646
|
-
plan.tasks.filter((t2) => t2.status === "completed").map((t2) => t2.id)
|
|
2647
|
-
);
|
|
2648
|
-
return plan.tasks.filter((task) => {
|
|
2649
|
-
if (task.status !== "pending") return false;
|
|
2650
|
-
return task.dependencies.every((dep) => completedIds.has(dep));
|
|
2651
|
-
});
|
|
2652
|
-
}
|
|
2653
|
-
/**
|
|
2654
|
-
* Update task status
|
|
2655
|
-
*/
|
|
2656
|
-
updateTaskStatus(plan, taskId, status, result, error) {
|
|
2657
|
-
const task = plan.tasks.find((t2) => t2.id === taskId);
|
|
2658
|
-
if (task) {
|
|
2659
|
-
task.status = status;
|
|
2660
|
-
if (result !== void 0) task.result = result;
|
|
2661
|
-
if (error !== void 0) task.error = error;
|
|
2662
|
-
}
|
|
2663
|
-
}
|
|
2664
|
-
/**
|
|
2665
|
-
* Check if all tasks are completed
|
|
2666
|
-
*/
|
|
2667
|
-
isComplete(plan) {
|
|
2668
|
-
return plan.tasks.length > 0 && plan.tasks.every((t2) => t2.status === "completed");
|
|
2669
|
-
}
|
|
2670
|
-
hasFailures(plan) {
|
|
2671
|
-
return plan.tasks.some((t2) => t2.status === "failed");
|
|
2672
|
-
}
|
|
2673
|
-
/**
|
|
2674
|
-
* Get progress summary
|
|
2675
|
-
*/
|
|
2676
|
-
getProgress(plan) {
|
|
2677
|
-
const completed = plan.tasks.filter((t2) => t2.status === "completed").length;
|
|
2678
|
-
const total = plan.tasks.length;
|
|
2679
|
-
const percentage = total === 0 ? 0 : Math.round(completed / total * 100);
|
|
2680
|
-
return { completed, total, percentage };
|
|
2681
|
-
}
|
|
2682
|
-
};
|
|
2683
2549
|
function estimateTokens(messages) {
|
|
2684
2550
|
return Math.ceil(
|
|
2685
2551
|
messages.reduce((sum, m) => {
|
|
@@ -3479,7 +3345,6 @@ var Agent = class {
|
|
|
3479
3345
|
permissions;
|
|
3480
3346
|
pathSecurity;
|
|
3481
3347
|
eventBus;
|
|
3482
|
-
planner = new TaskPlanner();
|
|
3483
3348
|
/** Per-session undo stacks. Each write_file / edit_file pushes one entry. */
|
|
3484
3349
|
undoStacks = /* @__PURE__ */ new Map();
|
|
3485
3350
|
/** Active token budget for the current run(), keyed by sessionId. */
|
|
@@ -3522,8 +3387,6 @@ Caminho: ${selectedPath}`;
|
|
|
3522
3387
|
} else {
|
|
3523
3388
|
session.metadata.pendingProjectList = void 0;
|
|
3524
3389
|
}
|
|
3525
|
-
session.metadata.plan = void 0;
|
|
3526
|
-
session.metadata.planError = void 0;
|
|
3527
3390
|
const directResponse = turnStrategy.kind === "chat" && !turnStrategy.allowTools ? directLocalResponse(turnStrategy.intent) : void 0;
|
|
3528
3391
|
if (directResponse) {
|
|
3529
3392
|
session.metadata.lastTurnUsedLlm = false;
|
|
@@ -3560,48 +3423,14 @@ Caminho: ${selectedPath}`;
|
|
|
3560
3423
|
);
|
|
3561
3424
|
}
|
|
3562
3425
|
await this.assertModelAvailable(session, resolvedTarget.provider, effectiveModel, options.signal);
|
|
3563
|
-
session.status = "planning";
|
|
3564
3426
|
this.activeBudgets.set(session.id, new SessionBudget(this.config.tokenBudget));
|
|
3565
3427
|
try {
|
|
3566
|
-
const planningProvider = this.providerManager.get(resolvedTarget.provider);
|
|
3567
|
-
let plan;
|
|
3568
|
-
if (turnStrategy.shouldPlan) {
|
|
3569
|
-
try {
|
|
3570
|
-
plan = await this.planner.plan(
|
|
3571
|
-
options.input,
|
|
3572
|
-
(prompt) => planningProvider.complete(prompt, {
|
|
3573
|
-
model: resolvedModel,
|
|
3574
|
-
maxTokens: Math.min(this.config.maxTokens, 512),
|
|
3575
|
-
temperature: 0,
|
|
3576
|
-
signal: options.signal,
|
|
3577
|
-
onUsage: (inputTokens, outputTokens) => {
|
|
3578
|
-
this.recordUsage(session.id, inputTokens, outputTokens);
|
|
3579
|
-
}
|
|
3580
|
-
})
|
|
3581
|
-
);
|
|
3582
|
-
session.metadata.plan = plan;
|
|
3583
|
-
} catch (error) {
|
|
3584
|
-
if (error instanceof BudgetExceededError) {
|
|
3585
|
-
throw error;
|
|
3586
|
-
}
|
|
3587
|
-
if (options.signal?.aborted) {
|
|
3588
|
-
throw error;
|
|
3589
|
-
}
|
|
3590
|
-
session.metadata.planError = formatErrorChain(error);
|
|
3591
|
-
this.eventBus.emit("app:warn", {
|
|
3592
|
-
message: formatPlanningFailureWarning(error),
|
|
3593
|
-
context: { error: session.metadata.planError }
|
|
3594
|
-
});
|
|
3595
|
-
}
|
|
3596
|
-
}
|
|
3597
3428
|
let finalText = "";
|
|
3598
|
-
|
|
3429
|
+
const iterations = 0;
|
|
3599
3430
|
const maxIterations = this.config.maxIterations;
|
|
3600
3431
|
session.status = "executing";
|
|
3601
3432
|
if (turnStrategy.kind === "utility") {
|
|
3602
3433
|
finalText = await this.executeUtilityTurn(session, options.input, mode, options);
|
|
3603
|
-
} else if (plan && mode === "build") {
|
|
3604
|
-
finalText = await this.executePlan(plan, session, mode, options);
|
|
3605
3434
|
} else {
|
|
3606
3435
|
finalText = await this.executeTraditional(session, mode, maxIterations, iterations, options, turnStrategy);
|
|
3607
3436
|
}
|
|
@@ -3651,209 +3480,7 @@ Caminho: ${selectedPath}`;
|
|
|
3651
3480
|
}
|
|
3652
3481
|
}
|
|
3653
3482
|
/**
|
|
3654
|
-
*
|
|
3655
|
-
*/
|
|
3656
|
-
async executePlan(plan, session, mode, options) {
|
|
3657
|
-
let finalText = `Executing plan: ${plan.objective}
|
|
3658
|
-
|
|
3659
|
-
`;
|
|
3660
|
-
let rounds = 0;
|
|
3661
|
-
const maxRounds = this.config.maxIterations;
|
|
3662
|
-
while (rounds < maxRounds) {
|
|
3663
|
-
const runnableTasks = this.planner.getRunnableTasks(plan);
|
|
3664
|
-
if (runnableTasks.length === 0) {
|
|
3665
|
-
if (this.planner.hasFailures(plan)) {
|
|
3666
|
-
const failedTasks = plan.tasks.filter((t2) => t2.status === "failed");
|
|
3667
|
-
finalText += `
|
|
3668
|
-
\u2717 Execution stopped due to failed tasks: ${failedTasks.map((t2) => t2.id).join(", ")}`;
|
|
3669
|
-
} else if (this.planner.isComplete(plan)) {
|
|
3670
|
-
finalText += "\n\u2713 All tasks completed successfully!";
|
|
3671
|
-
} else {
|
|
3672
|
-
finalText += "\n\u26A0 Plan contained no runnable tasks.";
|
|
3673
|
-
}
|
|
3674
|
-
break;
|
|
3675
|
-
}
|
|
3676
|
-
for (const task of runnableTasks) {
|
|
3677
|
-
this.planner.updateTaskStatus(plan, task.id, "running");
|
|
3678
|
-
options.onTaskUpdate?.(task, plan);
|
|
3679
|
-
}
|
|
3680
|
-
const progress = this.planner.getProgress(plan);
|
|
3681
|
-
const parallel = runnableTasks.length > 1;
|
|
3682
|
-
const taskLines = await Promise.all(
|
|
3683
|
-
runnableTasks.map(async (task, taskIndex) => {
|
|
3684
|
-
const taskPrompt = this.buildTaskPrompt(plan, task, progress);
|
|
3685
|
-
const executionSession = parallel ? this.createChildSession(session, task.id) : session;
|
|
3686
|
-
const maxAttempts = 1 + this.config.taskRetries;
|
|
3687
|
-
let lastError;
|
|
3688
|
-
const taskOptions = options.onChunkForTask ? { ...options, onChunk: (text) => options.onChunkForTask(task.id, text) } : options;
|
|
3689
|
-
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
3690
|
-
const prompt = lastError ? `${taskPrompt}
|
|
3691
|
-
|
|
3692
|
-
Previous attempt failed: ${lastError}
|
|
3693
|
-
Try a different approach.` : taskPrompt;
|
|
3694
|
-
try {
|
|
3695
|
-
const result = await this.executeTaskWithLLM(prompt, executionSession, mode, taskOptions, task.type);
|
|
3696
|
-
this.planner.updateTaskStatus(plan, task.id, "completed", result);
|
|
3697
|
-
options.onTaskUpdate?.(task, plan);
|
|
3698
|
-
return `[${progress.completed + taskIndex + 1}/${progress.total}] \u2713 ${task.description}`;
|
|
3699
|
-
} catch (error) {
|
|
3700
|
-
if (error instanceof BudgetExceededError) {
|
|
3701
|
-
throw error;
|
|
3702
|
-
}
|
|
3703
|
-
lastError = error instanceof Error ? error.message : String(error);
|
|
3704
|
-
}
|
|
3705
|
-
}
|
|
3706
|
-
this.planner.updateTaskStatus(plan, task.id, "failed", void 0, lastError);
|
|
3707
|
-
options.onTaskUpdate?.(task, plan);
|
|
3708
|
-
return `[${progress.completed + taskIndex + 1}/${progress.total}] \u2717 ${task.description} \u2014 ${lastError}`;
|
|
3709
|
-
})
|
|
3710
|
-
);
|
|
3711
|
-
finalText += `${taskLines.join("\n")}
|
|
3712
|
-
`;
|
|
3713
|
-
rounds++;
|
|
3714
|
-
options.onIteration?.(rounds, maxRounds);
|
|
3715
|
-
if (this.planner.hasFailures(plan) && this.config.strictMode) break;
|
|
3716
|
-
if (this.planner.isComplete(plan)) {
|
|
3717
|
-
finalText += "\n\u2713 All tasks completed successfully!";
|
|
3718
|
-
break;
|
|
3719
|
-
}
|
|
3720
|
-
}
|
|
3721
|
-
if (rounds >= maxRounds) {
|
|
3722
|
-
finalText += "\n\u26A0 Reached maximum rounds limit. Some tasks may not have been executed.";
|
|
3723
|
-
}
|
|
3724
|
-
return finalText;
|
|
3725
|
-
}
|
|
3726
|
-
/**
|
|
3727
|
-
* Build a prompt for the current task with context
|
|
3728
|
-
*/
|
|
3729
|
-
buildTaskPrompt(plan, task, progress) {
|
|
3730
|
-
const completedTasks = plan.tasks.filter((t2) => t2.status === "completed");
|
|
3731
|
-
const contextLimit = (t2) => t2.type === "research" ? 800 : 200;
|
|
3732
|
-
const context = completedTasks.length > 0 ? `
|
|
3733
|
-
|
|
3734
|
-
Context from completed tasks:
|
|
3735
|
-
${completedTasks.map((t2) => `- ${t2.description}: ${t2.result?.slice(0, contextLimit(t2)) || "Done"}...`).join("\n")}` : "";
|
|
3736
|
-
return `You are working on the following objective: "${plan.objective}"
|
|
3737
|
-
|
|
3738
|
-
Current task (${progress.completed + 1}/${progress.total} - ${progress.percentage}% complete):
|
|
3739
|
-
ID: ${task.id}
|
|
3740
|
-
Type: ${task.type}
|
|
3741
|
-
Description: ${task.description}
|
|
3742
|
-
${task.dependencies.length > 0 ? `Dependencies: ${task.dependencies.join(", ")}` : ""}
|
|
3743
|
-
|
|
3744
|
-
${context}
|
|
3745
|
-
|
|
3746
|
-
Execute this task using the available tools. Return a summary of what was done.`;
|
|
3747
|
-
}
|
|
3748
|
-
/**
|
|
3749
|
-
* Execute a single task using LLM and tools
|
|
3750
|
-
*/
|
|
3751
|
-
async executeTaskWithLLM(prompt, session, mode, options, taskType) {
|
|
3752
|
-
const taskPrompt = this.createInternalPromptMessage(prompt);
|
|
3753
|
-
const allowedToolNames = this.allowedToolNamesForTaskType(mode, taskType, this.getRevealedTools(session));
|
|
3754
|
-
const resolvedModel = session.model ?? resolveConfiguredModelForProvider(this.config, session.provider);
|
|
3755
|
-
const toolProfile = resolveModelExecutionProfile(session.provider, resolvedModel);
|
|
3756
|
-
const maxTaskIterations = 10;
|
|
3757
|
-
let taskIterations = 0;
|
|
3758
|
-
let finalAssistantText = "";
|
|
3759
|
-
while (taskIterations < maxTaskIterations) {
|
|
3760
|
-
taskIterations++;
|
|
3761
|
-
this.enforceBudget(session.id);
|
|
3762
|
-
const toolDefinitions = this.toolDefinitionsForNames(allowedToolNames, toolProfile.toolSchemaMode);
|
|
3763
|
-
const textToolFallbackEnabled = toolDefinitions.length > 0 && toolProfile.toolCallStrategy !== "native";
|
|
3764
|
-
const chunks = this.providerManager.chat(
|
|
3765
|
-
this.messagesForSystemPrompt(
|
|
3766
|
-
session,
|
|
3767
|
-
this.systemPromptForMode(mode),
|
|
3768
|
-
true,
|
|
3769
|
-
[taskPrompt],
|
|
3770
|
-
textToolFallbackEnabled ? buildFallbackToolCallPrompt(allowedToolNames) : void 0,
|
|
3771
|
-
mode === "build" ? this.buildDeferredToolsHint(session) : void 0
|
|
3772
|
-
),
|
|
3773
|
-
{
|
|
3774
|
-
preferredProvider: options.provider ?? session.provider,
|
|
3775
|
-
failover: this.failoverOrder(options.provider ?? session.provider),
|
|
3776
|
-
model: resolvedModel,
|
|
3777
|
-
maxTokens: this.config.maxTokens,
|
|
3778
|
-
temperature: this.config.temperature,
|
|
3779
|
-
tools: toolDefinitions,
|
|
3780
|
-
toolChoice: this.resolveTaskToolChoice(
|
|
3781
|
-
taskIterations,
|
|
3782
|
-
toolDefinitions.length,
|
|
3783
|
-
toolProfile.supportsRequiredToolChoice
|
|
3784
|
-
),
|
|
3785
|
-
signal: options.signal
|
|
3786
|
-
}
|
|
3787
|
-
);
|
|
3788
|
-
let assistantText = "";
|
|
3789
|
-
const toolCalls = [];
|
|
3790
|
-
const xmlFilter = textToolFallbackEnabled ? new XmlToolCallStreamFilter() : null;
|
|
3791
|
-
for await (const chunk of chunks) {
|
|
3792
|
-
if (chunk.type === "delta") {
|
|
3793
|
-
assistantText += chunk.content;
|
|
3794
|
-
if (textToolFallbackEnabled) {
|
|
3795
|
-
const visible = xmlFilter.filter(chunk.content);
|
|
3796
|
-
if (visible) options.onChunk?.(visible);
|
|
3797
|
-
} else {
|
|
3798
|
-
options.onChunk?.(chunk.content);
|
|
3799
|
-
}
|
|
3800
|
-
}
|
|
3801
|
-
if (chunk.type === "tool_call") {
|
|
3802
|
-
toolCalls.push(chunk.call);
|
|
3803
|
-
}
|
|
3804
|
-
if (chunk.type === "usage") {
|
|
3805
|
-
options.onUsage?.(chunk.inputTokens, chunk.outputTokens);
|
|
3806
|
-
this.recordUsage(session.id, chunk.inputTokens, chunk.outputTokens);
|
|
3807
|
-
}
|
|
3808
|
-
}
|
|
3809
|
-
if (textToolFallbackEnabled) {
|
|
3810
|
-
const flushed = xmlFilter.flush();
|
|
3811
|
-
if (flushed) options.onChunk?.(flushed);
|
|
3812
|
-
}
|
|
3813
|
-
const turnResult = textToolFallbackEnabled ? applyFallbackToolCallParsing(assistantText, toolCalls, allowedToolNames) : { assistantText, toolCalls };
|
|
3814
|
-
assistantText = turnResult.assistantText;
|
|
3815
|
-
const nextToolCalls = [...turnResult.toolCalls];
|
|
3816
|
-
toolCalls.length = 0;
|
|
3817
|
-
toolCalls.push(...nextToolCalls);
|
|
3818
|
-
if (assistantText.trim() || toolCalls.length > 0) {
|
|
3819
|
-
this.sessions.addMessage(session.id, {
|
|
3820
|
-
role: "assistant",
|
|
3821
|
-
source: "assistant",
|
|
3822
|
-
content: assistantText,
|
|
3823
|
-
toolCalls: toolCalls.length > 0 ? toolCalls : void 0
|
|
3824
|
-
});
|
|
3825
|
-
finalAssistantText = finalAssistantText ? `${finalAssistantText}
|
|
3826
|
-
${assistantText}` : assistantText;
|
|
3827
|
-
}
|
|
3828
|
-
if (toolCalls.length === 0) {
|
|
3829
|
-
break;
|
|
3830
|
-
}
|
|
3831
|
-
for (const call of toolCalls) {
|
|
3832
|
-
const result = await this.executeTool(
|
|
3833
|
-
call,
|
|
3834
|
-
session,
|
|
3835
|
-
mode,
|
|
3836
|
-
options.signal,
|
|
3837
|
-
allowedToolNames,
|
|
3838
|
-
options.onToolActivity,
|
|
3839
|
-
(names) => {
|
|
3840
|
-
for (const name of names) {
|
|
3841
|
-
if (this.tools.get(name)) allowedToolNames.add(name);
|
|
3842
|
-
}
|
|
3843
|
-
}
|
|
3844
|
-
);
|
|
3845
|
-
this.sessions.addMessage(session.id, {
|
|
3846
|
-
role: "tool",
|
|
3847
|
-
source: "tool",
|
|
3848
|
-
content: truncateToolOutput(result.output),
|
|
3849
|
-
toolCallId: call.id
|
|
3850
|
-
});
|
|
3851
|
-
}
|
|
3852
|
-
}
|
|
3853
|
-
return finalAssistantText.trim();
|
|
3854
|
-
}
|
|
3855
|
-
/**
|
|
3856
|
-
* Traditional execution loop (fallback when planning fails or in plan mode)
|
|
3483
|
+
* Traditional execution loop
|
|
3857
3484
|
*/
|
|
3858
3485
|
async executeTraditional(session, mode, maxIterations, startingIterations, options, turnStrategy) {
|
|
3859
3486
|
let finalText = "";
|
|
@@ -3946,7 +3573,8 @@ ${assistantText}` : assistantText;
|
|
|
3946
3573
|
});
|
|
3947
3574
|
}
|
|
3948
3575
|
if (toolCalls.length === 0) break;
|
|
3949
|
-
for (
|
|
3576
|
+
for (let callIdx = 0; callIdx < toolCalls.length; callIdx++) {
|
|
3577
|
+
const call = toolCalls[callIdx];
|
|
3950
3578
|
const result = await this.executeTool(
|
|
3951
3579
|
call,
|
|
3952
3580
|
session,
|
|
@@ -3975,6 +3603,14 @@ ${assistantText}` : assistantText;
|
|
|
3975
3603
|
consecutiveErrorCount = 1;
|
|
3976
3604
|
}
|
|
3977
3605
|
if (consecutiveErrorCount >= 3) {
|
|
3606
|
+
for (let j = callIdx + 1; j < toolCalls.length; j++) {
|
|
3607
|
+
this.sessions.addMessage(session.id, {
|
|
3608
|
+
role: "tool",
|
|
3609
|
+
source: "tool",
|
|
3610
|
+
content: "[Execu\xE7\xE3o cancelada: erros id\xEAnticos repetidos]",
|
|
3611
|
+
toolCallId: toolCalls[j].id
|
|
3612
|
+
});
|
|
3613
|
+
}
|
|
3978
3614
|
const abortMsg = `
|
|
3979
3615
|
[${call.name} falhou com o mesmo erro ${consecutiveErrorCount} vezes seguidas. Abortando para evitar loop. Tente uma abordagem diferente.]`;
|
|
3980
3616
|
finalText += abortMsg;
|
|
@@ -4038,7 +3674,7 @@ ${assistantText}` : assistantText;
|
|
|
4038
3674
|
if (call.name === "write_file") {
|
|
4039
3675
|
const args = call.arguments;
|
|
4040
3676
|
if (!args?.path || !args?.content) {
|
|
4041
|
-
hint = "
|
|
3677
|
+
hint = " Sua sa\xEDda foi provavelmente truncada antes da chamada completar. Use m\xFAltiplas chamadas edit_file para aplicar as mudan\xE7as em partes menores em vez de reescrever o arquivo inteiro.";
|
|
4042
3678
|
}
|
|
4043
3679
|
}
|
|
4044
3680
|
return {
|
|
@@ -4125,15 +3761,6 @@ ${assistantText}` : assistantText;
|
|
|
4125
3761
|
session.activities.push(full);
|
|
4126
3762
|
this.eventBus.emit("activity", full);
|
|
4127
3763
|
}
|
|
4128
|
-
resolveTaskToolChoice(taskIteration, toolCount, supportsRequiredToolChoice) {
|
|
4129
|
-
if (toolCount === 0) {
|
|
4130
|
-
return void 0;
|
|
4131
|
-
}
|
|
4132
|
-
if (taskIteration === 1 && supportsRequiredToolChoice) {
|
|
4133
|
-
return "required";
|
|
4134
|
-
}
|
|
4135
|
-
return "auto";
|
|
4136
|
-
}
|
|
4137
3764
|
resolveTraditionalToolChoice(turnStrategy, mode, firstIteration, toolCount, supportsRequiredToolChoice) {
|
|
4138
3765
|
if (toolCount === 0) {
|
|
4139
3766
|
return void 0;
|
|
@@ -4174,15 +3801,6 @@ ${assistantText}` : assistantText;
|
|
|
4174
3801
|
}
|
|
4175
3802
|
return new Set([...names].filter((n) => base.has(n)));
|
|
4176
3803
|
}
|
|
4177
|
-
allowedToolNamesForTaskType(mode, taskType, revealedTools) {
|
|
4178
|
-
if (taskType === "research") return /* @__PURE__ */ new Set([...PLAN_ALLOWED_TOOLS]);
|
|
4179
|
-
if (taskType === "verify") return /* @__PURE__ */ new Set(["read_file", "list_dir", "analyze_code", "search_text", "bash"]);
|
|
4180
|
-
const base = this.allowedToolNamesForMode(mode);
|
|
4181
|
-
for (const name of revealedTools ?? []) {
|
|
4182
|
-
if (this.tools.get(name)) base.add(name);
|
|
4183
|
-
}
|
|
4184
|
-
return base;
|
|
4185
|
-
}
|
|
4186
3804
|
toolDefinitionsForNames(names, schemaMode = "full") {
|
|
4187
3805
|
return this.tools.list().filter((tool) => names.has(tool.name)).map((tool) => ({
|
|
4188
3806
|
type: "function",
|
|
@@ -4196,16 +3814,6 @@ ${assistantText}` : assistantText;
|
|
|
4196
3814
|
}
|
|
4197
3815
|
}));
|
|
4198
3816
|
}
|
|
4199
|
-
createChildSession(parent, taskId) {
|
|
4200
|
-
const child = this.sessions.create({ provider: parent.provider, model: parent.model });
|
|
4201
|
-
child.worktree = parent.worktree;
|
|
4202
|
-
child.metadata = { parentSessionId: parent.id, taskId };
|
|
4203
|
-
this.sessions.save(child);
|
|
4204
|
-
return child;
|
|
4205
|
-
}
|
|
4206
|
-
systemPromptForMode(mode) {
|
|
4207
|
-
return mode === "plan" ? PLAN_SYSTEM_PROMPT : BUILD_SYSTEM_PROMPT;
|
|
4208
|
-
}
|
|
4209
3817
|
messagesForSystemPrompt(session, systemPrompt, toolsEnabled, extraMessages = [], fallbackToolPrompt, deferredToolsHint) {
|
|
4210
3818
|
return [
|
|
4211
3819
|
{
|
|
@@ -4236,15 +3844,6 @@ ${assistantText}` : assistantText;
|
|
|
4236
3844
|
...extraMessages
|
|
4237
3845
|
];
|
|
4238
3846
|
}
|
|
4239
|
-
createInternalPromptMessage(content) {
|
|
4240
|
-
return {
|
|
4241
|
-
id: createId("msg"),
|
|
4242
|
-
role: "user",
|
|
4243
|
-
source: "agent_internal",
|
|
4244
|
-
content,
|
|
4245
|
-
createdAt: nowIso()
|
|
4246
|
-
};
|
|
4247
|
-
}
|
|
4248
3847
|
isSessionMessageSafeForModel(message) {
|
|
4249
3848
|
if (!isModelContextMessage(message)) {
|
|
4250
3849
|
return false;
|
|
@@ -4518,45 +4117,6 @@ Modelos dispon\xEDveis: ${modelList}`,
|
|
|
4518
4117
|
}
|
|
4519
4118
|
}
|
|
4520
4119
|
};
|
|
4521
|
-
function formatPlanningFailureWarning(error) {
|
|
4522
|
-
if (error instanceof ProviderError) {
|
|
4523
|
-
const provider = formatProviderName(error.provider);
|
|
4524
|
-
const status = typeof error.statusCode === "number" ? ` (${error.statusCode})` : "";
|
|
4525
|
-
if (error.statusCode === 429) {
|
|
4526
|
-
return `Task planning skipped: ${provider} rate limit hit${status}. Continuing without structured plan.`;
|
|
4527
|
-
}
|
|
4528
|
-
if (error.statusCode && error.statusCode >= 500) {
|
|
4529
|
-
return `Task planning skipped: ${provider} returned a temporary service error${status}. Continuing without structured plan.`;
|
|
4530
|
-
}
|
|
4531
|
-
return `Task planning failed: ${compactPlanningError(error.message)}. Continuing without structured plan.`;
|
|
4532
|
-
}
|
|
4533
|
-
const detail = error instanceof Error ? error.message : String(error);
|
|
4534
|
-
return `Task planning failed: ${compactPlanningError(detail)}. Continuing without structured plan.`;
|
|
4535
|
-
}
|
|
4536
|
-
function compactPlanningError(message) {
|
|
4537
|
-
const firstLine2 = message.replace(/\s+/g, " ").trim();
|
|
4538
|
-
return firstLine2.length > 240 ? `${firstLine2.slice(0, 237)}...` : firstLine2;
|
|
4539
|
-
}
|
|
4540
|
-
function formatProviderName(provider) {
|
|
4541
|
-
switch (provider) {
|
|
4542
|
-
case "openrouter":
|
|
4543
|
-
return "OpenRouter";
|
|
4544
|
-
case "openai":
|
|
4545
|
-
return "OpenAI";
|
|
4546
|
-
case "anthropic":
|
|
4547
|
-
return "Anthropic";
|
|
4548
|
-
case "deepseek":
|
|
4549
|
-
return "DeepSeek";
|
|
4550
|
-
case "groq":
|
|
4551
|
-
return "Groq";
|
|
4552
|
-
case "ollama":
|
|
4553
|
-
return "Ollama";
|
|
4554
|
-
case "opencode":
|
|
4555
|
-
return "OpenCode";
|
|
4556
|
-
default:
|
|
4557
|
-
return provider;
|
|
4558
|
-
}
|
|
4559
|
-
}
|
|
4560
4120
|
function truncateForMetadata(value, maxLength = 2e3) {
|
|
4561
4121
|
return value.length > maxLength ? `${value.slice(0, maxLength)}...` : value;
|
|
4562
4122
|
}
|
|
@@ -4680,7 +4240,7 @@ function adaptMcpTool(client, tool, serverName) {
|
|
|
4680
4240
|
return defineTool({
|
|
4681
4241
|
name: qualifiedName,
|
|
4682
4242
|
description: tool.description ?? tool.name,
|
|
4683
|
-
parameters:
|
|
4243
|
+
parameters: z2.record(z2.unknown()).default({}),
|
|
4684
4244
|
deferred: true,
|
|
4685
4245
|
execute: (args) => Effect3.tryPromise({
|
|
4686
4246
|
try: () => client.callTool(tool.name, args),
|
|
@@ -5172,10 +4732,10 @@ var EventBus = class {
|
|
|
5172
4732
|
}
|
|
5173
4733
|
}
|
|
5174
4734
|
};
|
|
5175
|
-
var GitHubAuthenticatedUserSchema =
|
|
5176
|
-
login:
|
|
5177
|
-
id:
|
|
5178
|
-
html_url:
|
|
4735
|
+
var GitHubAuthenticatedUserSchema = z22.object({
|
|
4736
|
+
login: z22.string(),
|
|
4737
|
+
id: z22.number(),
|
|
4738
|
+
html_url: z22.string().url()
|
|
5179
4739
|
}).passthrough();
|
|
5180
4740
|
var GitHubClient = class {
|
|
5181
4741
|
constructor(options) {
|
|
@@ -5443,22 +5003,22 @@ function runStreamingCommand(command, args, options) {
|
|
|
5443
5003
|
});
|
|
5444
5004
|
});
|
|
5445
5005
|
}
|
|
5446
|
-
var DeviceCodeResponseSchema =
|
|
5447
|
-
device_code:
|
|
5448
|
-
user_code:
|
|
5449
|
-
verification_uri:
|
|
5450
|
-
expires_in:
|
|
5451
|
-
interval:
|
|
5006
|
+
var DeviceCodeResponseSchema = z3.object({
|
|
5007
|
+
device_code: z3.string().min(1),
|
|
5008
|
+
user_code: z3.string().min(1),
|
|
5009
|
+
verification_uri: z3.string().url(),
|
|
5010
|
+
expires_in: z3.number().int().positive(),
|
|
5011
|
+
interval: z3.number().int().positive().default(5)
|
|
5452
5012
|
}).passthrough();
|
|
5453
|
-
var AccessTokenResponseSchema =
|
|
5454
|
-
access_token:
|
|
5455
|
-
token_type:
|
|
5456
|
-
scope:
|
|
5013
|
+
var AccessTokenResponseSchema = z3.object({
|
|
5014
|
+
access_token: z3.string().min(1),
|
|
5015
|
+
token_type: z3.string().min(1),
|
|
5016
|
+
scope: z3.string().default("")
|
|
5457
5017
|
}).passthrough();
|
|
5458
|
-
var OAuthErrorResponseSchema =
|
|
5459
|
-
error:
|
|
5460
|
-
error_description:
|
|
5461
|
-
interval:
|
|
5018
|
+
var OAuthErrorResponseSchema = z3.object({
|
|
5019
|
+
error: z3.string().min(1),
|
|
5020
|
+
error_description: z3.string().optional(),
|
|
5021
|
+
interval: z3.number().int().positive().optional()
|
|
5462
5022
|
}).passthrough();
|
|
5463
5023
|
var GitHubOAuthDeviceFlow = class {
|
|
5464
5024
|
constructor(options = {}) {
|
|
@@ -7391,8 +6951,8 @@ async function quarantineFileIfPossible(filePath) {
|
|
|
7391
6951
|
var analyzeCodeTool = defineTool({
|
|
7392
6952
|
name: "analyze_code",
|
|
7393
6953
|
description: "Analyze source code structure using lightweight language-aware heuristics.",
|
|
7394
|
-
parameters:
|
|
7395
|
-
path:
|
|
6954
|
+
parameters: z4.object({
|
|
6955
|
+
path: z4.string()
|
|
7396
6956
|
}),
|
|
7397
6957
|
execute: (args, context) => Effect4.tryPromise({
|
|
7398
6958
|
try: async () => {
|
|
@@ -7414,8 +6974,8 @@ var analyzeCodeTool = defineTool({
|
|
|
7414
6974
|
var lintTool = defineTool({
|
|
7415
6975
|
name: "lint",
|
|
7416
6976
|
description: "Run project lint script. Uses package manager scripts when present.",
|
|
7417
|
-
parameters:
|
|
7418
|
-
fix:
|
|
6977
|
+
parameters: z4.object({
|
|
6978
|
+
fix: z4.boolean().default(false)
|
|
7419
6979
|
}),
|
|
7420
6980
|
execute: (args, context) => Effect4.tryPromise({
|
|
7421
6981
|
try: async () => {
|
|
@@ -7435,8 +6995,8 @@ var lintTool = defineTool({
|
|
|
7435
6995
|
var testTool = defineTool({
|
|
7436
6996
|
name: "test",
|
|
7437
6997
|
description: "Run project tests with pnpm.",
|
|
7438
|
-
parameters:
|
|
7439
|
-
pattern:
|
|
6998
|
+
parameters: z4.object({
|
|
6999
|
+
pattern: z4.string().optional()
|
|
7440
7000
|
}),
|
|
7441
7001
|
execute: (args, context) => Effect4.tryPromise({
|
|
7442
7002
|
try: async () => {
|
|
@@ -7456,10 +7016,10 @@ var testTool = defineTool({
|
|
|
7456
7016
|
var readFileTool = defineTool({
|
|
7457
7017
|
name: "read_file",
|
|
7458
7018
|
description: "Read a project file and return line-numbered content. Supports offset and limit.",
|
|
7459
|
-
parameters:
|
|
7460
|
-
path:
|
|
7461
|
-
offset:
|
|
7462
|
-
limit:
|
|
7019
|
+
parameters: z5.object({
|
|
7020
|
+
path: z5.string(),
|
|
7021
|
+
offset: z5.number().int().min(0).optional(),
|
|
7022
|
+
limit: z5.number().int().positive().max(2e3).optional()
|
|
7463
7023
|
}),
|
|
7464
7024
|
execute: (args, context) => Effect5.tryPromise({
|
|
7465
7025
|
try: async () => {
|
|
@@ -7495,9 +7055,9 @@ var readFileTool = defineTool({
|
|
|
7495
7055
|
var writeFileTool = defineTool({
|
|
7496
7056
|
name: "write_file",
|
|
7497
7057
|
description: "Create or overwrite a file. Parent directories are created when needed.",
|
|
7498
|
-
parameters:
|
|
7499
|
-
path:
|
|
7500
|
-
content:
|
|
7058
|
+
parameters: z5.object({
|
|
7059
|
+
path: z5.string(),
|
|
7060
|
+
content: z5.string()
|
|
7501
7061
|
}),
|
|
7502
7062
|
execute: (args, context) => Effect5.tryPromise({
|
|
7503
7063
|
try: async () => {
|
|
@@ -7519,10 +7079,10 @@ var writeFileTool = defineTool({
|
|
|
7519
7079
|
var editFileTool = defineTool({
|
|
7520
7080
|
name: "edit_file",
|
|
7521
7081
|
description: "Replace exactly one occurrence of oldString in a file.",
|
|
7522
|
-
parameters:
|
|
7523
|
-
path:
|
|
7524
|
-
oldString:
|
|
7525
|
-
newString:
|
|
7082
|
+
parameters: z5.object({
|
|
7083
|
+
path: z5.string(),
|
|
7084
|
+
oldString: z5.string().min(1),
|
|
7085
|
+
newString: z5.string()
|
|
7526
7086
|
}),
|
|
7527
7087
|
execute: (args, context) => Effect5.tryPromise({
|
|
7528
7088
|
try: async () => {
|
|
@@ -7552,8 +7112,8 @@ var editFileTool = defineTool({
|
|
|
7552
7112
|
var listDirTool = defineTool({
|
|
7553
7113
|
name: "list_dir",
|
|
7554
7114
|
description: "List directory entries with type, size, and relative path.",
|
|
7555
|
-
parameters:
|
|
7556
|
-
path:
|
|
7115
|
+
parameters: z5.object({
|
|
7116
|
+
path: z5.string().default(".")
|
|
7557
7117
|
}),
|
|
7558
7118
|
execute: (args, context) => Effect5.tryPromise({
|
|
7559
7119
|
try: async () => {
|
|
@@ -7586,7 +7146,7 @@ var listDirTool = defineTool({
|
|
|
7586
7146
|
}
|
|
7587
7147
|
})
|
|
7588
7148
|
});
|
|
7589
|
-
var GitOperationSchema =
|
|
7149
|
+
var GitOperationSchema = z6.enum([
|
|
7590
7150
|
"status",
|
|
7591
7151
|
"diff",
|
|
7592
7152
|
"add",
|
|
@@ -7600,9 +7160,9 @@ var GitOperationSchema = z7.enum([
|
|
|
7600
7160
|
var gitTool = defineTool({
|
|
7601
7161
|
name: "git",
|
|
7602
7162
|
description: "Run supported git operations with permission checks.",
|
|
7603
|
-
parameters:
|
|
7163
|
+
parameters: z6.object({
|
|
7604
7164
|
operation: GitOperationSchema,
|
|
7605
|
-
args:
|
|
7165
|
+
args: z6.record(z6.unknown()).default({})
|
|
7606
7166
|
}),
|
|
7607
7167
|
execute: (args, context) => Effect6.tryPromise({
|
|
7608
7168
|
try: async () => {
|
|
@@ -7674,12 +7234,12 @@ function readJsonLines(input) {
|
|
|
7674
7234
|
var searchTextTool = defineTool({
|
|
7675
7235
|
name: "search_text",
|
|
7676
7236
|
description: "Search text or regex patterns using ripgrep. Returns JSON match rows.",
|
|
7677
|
-
parameters:
|
|
7678
|
-
pattern:
|
|
7679
|
-
path:
|
|
7680
|
-
include:
|
|
7681
|
-
context:
|
|
7682
|
-
caseSensitive:
|
|
7237
|
+
parameters: z7.object({
|
|
7238
|
+
pattern: z7.string().min(1),
|
|
7239
|
+
path: z7.string().default("."),
|
|
7240
|
+
include: z7.string().optional(),
|
|
7241
|
+
context: z7.number().int().min(0).max(10).default(2),
|
|
7242
|
+
caseSensitive: z7.boolean().default(true)
|
|
7683
7243
|
}),
|
|
7684
7244
|
execute: (args, context) => Effect7.tryPromise({
|
|
7685
7245
|
try: async () => {
|
|
@@ -7732,9 +7292,9 @@ var searchTextTool = defineTool({
|
|
|
7732
7292
|
var searchFilesTool = defineTool({
|
|
7733
7293
|
name: "search_files",
|
|
7734
7294
|
description: "Find files by name using ripgrep file listing.",
|
|
7735
|
-
parameters:
|
|
7736
|
-
query:
|
|
7737
|
-
path:
|
|
7295
|
+
parameters: z7.object({
|
|
7296
|
+
query: z7.string().min(1),
|
|
7297
|
+
path: z7.string().default(".")
|
|
7738
7298
|
}),
|
|
7739
7299
|
execute: (args, context) => Effect7.tryPromise({
|
|
7740
7300
|
try: async () => {
|
|
@@ -7825,9 +7385,9 @@ async function heuristicSymbolSearch(query, searchPath, worktree, signal) {
|
|
|
7825
7385
|
var searchSymbolsTool = defineTool({
|
|
7826
7386
|
name: "search_symbols",
|
|
7827
7387
|
description: "Search workspace symbols. Uses LSP when configured; falls back to heuristic ripgrep-based extraction.",
|
|
7828
|
-
parameters:
|
|
7829
|
-
query:
|
|
7830
|
-
path:
|
|
7388
|
+
parameters: z7.object({
|
|
7389
|
+
query: z7.string().min(1),
|
|
7390
|
+
path: z7.string().default(".")
|
|
7831
7391
|
}),
|
|
7832
7392
|
execute: (args, context) => Effect7.tryPromise({
|
|
7833
7393
|
try: async () => {
|
|
@@ -7918,10 +7478,10 @@ function classifyShellCommand(command) {
|
|
|
7918
7478
|
var bashTool = defineTool({
|
|
7919
7479
|
name: "bash",
|
|
7920
7480
|
description: "Execute a shell command in the project directory with timeout and permission checks.",
|
|
7921
|
-
parameters:
|
|
7922
|
-
command:
|
|
7923
|
-
cwd:
|
|
7924
|
-
timeout:
|
|
7481
|
+
parameters: z8.object({
|
|
7482
|
+
command: z8.string().min(1),
|
|
7483
|
+
cwd: z8.string().default("."),
|
|
7484
|
+
timeout: z8.number().int().positive().max(600).default(60)
|
|
7925
7485
|
}),
|
|
7926
7486
|
execute: (args, context) => Effect8.tryPromise({
|
|
7927
7487
|
try: async () => {
|
|
@@ -7978,9 +7538,9 @@ var fetchWebTool = defineTool({
|
|
|
7978
7538
|
Returns the content as text. Supports HTTP and HTTPS URLs.
|
|
7979
7539
|
Use this to look up documentation, library APIs, or other web resources relevant to the task.
|
|
7980
7540
|
Note: This tool requires explicit approval and may be restricted by web.allowlist/web.blacklist configuration.`,
|
|
7981
|
-
parameters:
|
|
7982
|
-
url:
|
|
7983
|
-
maxLength:
|
|
7541
|
+
parameters: z9.object({
|
|
7542
|
+
url: z9.string().url().describe("URL to fetch (must start with http:// or https://)"),
|
|
7543
|
+
maxLength: z9.number().int().positive().max(5e4).optional().describe("Maximum content length to return (default: 10000)")
|
|
7984
7544
|
}),
|
|
7985
7545
|
execute: (args, context) => Effect9.tryPromise({
|
|
7986
7546
|
try: async () => {
|
|
@@ -8087,20 +7647,20 @@ function createDefaultToolRegistry() {
|
|
|
8087
7647
|
registry.register(fetchWebTool);
|
|
8088
7648
|
return registry;
|
|
8089
7649
|
}
|
|
8090
|
-
var
|
|
8091
|
-
prompt:
|
|
8092
|
-
subagent_type:
|
|
7650
|
+
var TaskSchema = z10.object({
|
|
7651
|
+
prompt: z10.string().describe("Full task description for the subagent \u2014 be specific and self-contained."),
|
|
7652
|
+
subagent_type: z10.string().optional().describe(
|
|
8093
7653
|
"Named agent type from .deepcode/agents/*.md (e.g. 'code-reviewer'). When set, the subagent uses the named agent's system prompt and tool restrictions."
|
|
8094
7654
|
),
|
|
8095
|
-
provider:
|
|
8096
|
-
model:
|
|
8097
|
-
fork:
|
|
7655
|
+
provider: z10.string().optional().describe("Provider override (e.g. 'anthropic', 'openai'). Defaults to current provider."),
|
|
7656
|
+
model: z10.string().optional().describe("Model override. Defaults to current model."),
|
|
7657
|
+
fork: z10.boolean().optional().describe("If true, the subagent starts with the current conversation history as context.")
|
|
8098
7658
|
});
|
|
8099
7659
|
function createTaskTool(subagents, worktree, sessions) {
|
|
8100
7660
|
return defineTool({
|
|
8101
7661
|
name: "task",
|
|
8102
7662
|
description: "Launch a subagent to handle a self-contained task in a child session. Use for parallelizable work, delegating a well-scoped subtask, or specialized analysis. Built-in subagent_type values: code-reviewer (read-only code analysis), test-runner (run tests and interpret output), refactor (surgical code changes without behavior change). Set fork=true to give the subagent the current conversation history as starting context. Custom agents can be defined in .deepcode/agents/<name>.md.",
|
|
8103
|
-
parameters:
|
|
7663
|
+
parameters: TaskSchema,
|
|
8104
7664
|
execute: (args, context) => Effect10.tryPromise(async () => {
|
|
8105
7665
|
const taskId = createId("task");
|
|
8106
7666
|
let systemPrompt;
|
|
@@ -8144,8 +7704,8 @@ function createToolSearchTool(registry) {
|
|
|
8144
7704
|
return defineTool({
|
|
8145
7705
|
name: "tool_search",
|
|
8146
7706
|
description: "Search and activate deferred tools (MCP integrations) by name or description keyword. Call this before using a tool that is not in the current schema. Matched tools are revealed and available in subsequent calls this session.",
|
|
8147
|
-
parameters:
|
|
8148
|
-
query:
|
|
7707
|
+
parameters: z11.object({
|
|
7708
|
+
query: z11.string().min(1).describe("Keyword to search in tool names and descriptions")
|
|
8149
7709
|
}),
|
|
8150
7710
|
execute: (args, context) => Effect11.tryPromise({
|
|
8151
7711
|
try: async () => {
|
|
@@ -8304,7 +7864,7 @@ import path62 from "path";
|
|
|
8304
7864
|
import fs8 from "fs";
|
|
8305
7865
|
import path15 from "path";
|
|
8306
7866
|
import { isValidElement, useCallback as useCallback27, useEffect as useEffect28, useMemo as useMemo19, useRef as useRef18, useState as useState30 } from "react";
|
|
8307
|
-
import { Box as
|
|
7867
|
+
import { Box as Box41, Text as Text49, useInput as useInput6, useStdin as useStdin3 } from "ink";
|
|
8308
7868
|
import os22 from "os";
|
|
8309
7869
|
import path92 from "path";
|
|
8310
7870
|
import fs22 from "fs";
|
|
@@ -9277,7 +8837,7 @@ import * as path82 from "path";
|
|
|
9277
8837
|
import { promisify } from "util";
|
|
9278
8838
|
import { useState as useState3, useRef, useCallback as useCallback3, useMemo as useMemo2 } from "react";
|
|
9279
8839
|
import { useCallback as useCallback8, useEffect as useEffect14, useMemo as useMemo6, useRef as useRef6, useState as useState12 } from "react";
|
|
9280
|
-
import { Box as
|
|
8840
|
+
import { Box as Box23, Static } from "ink";
|
|
9281
8841
|
import { Box as Box22, Text as Text25 } from "ink";
|
|
9282
8842
|
import { Box as Box8, Text as Text9 } from "ink";
|
|
9283
8843
|
|
|
@@ -10222,24 +9782,22 @@ import { Fragment as Fragment6, jsx as jsx25, jsxs as jsxs19 } from "react/jsx-r
|
|
|
10222
9782
|
import React21, { useContext as useContext5 } from "react";
|
|
10223
9783
|
import { jsx as jsx26, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
10224
9784
|
import { jsx as jsx27, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
10225
|
-
import { Box as Box23, Text as Text26 } from "ink";
|
|
10226
|
-
import { jsxs as jsxs22 } from "react/jsx-runtime";
|
|
10227
9785
|
import { createContext as createContext5, useContext as useContext6 } from "react";
|
|
10228
|
-
import { jsx as jsx28, jsxs as
|
|
10229
|
-
import { Box as
|
|
9786
|
+
import { jsx as jsx28, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
9787
|
+
import { Box as Box31, Text as Text39, useIsScreenReaderEnabled as useIsScreenReaderEnabled3 } from "ink";
|
|
10230
9788
|
import { useCallback as useCallback19, useState as useState24 } from "react";
|
|
10231
9789
|
import { useRef as useRef8 } from "react";
|
|
10232
|
-
import { Box as
|
|
9790
|
+
import { Box as Box24, Text as Text26 } from "ink";
|
|
10233
9791
|
import { useEffect as useEffect15, useState as useState13 } from "react";
|
|
10234
9792
|
import { useEffect as useEffect16, useRef as useRef7, useState as useState14 } from "react";
|
|
10235
|
-
import { jsx as jsx29, jsxs as
|
|
9793
|
+
import { jsx as jsx29, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
10236
9794
|
import { useCallback as useCallback17, useEffect as useEffect23, useMemo as useMemo11, useState as useState21, useRef as useRef13 } from "react";
|
|
10237
|
-
import { Box as
|
|
10238
|
-
import { Box as
|
|
9795
|
+
import { Box as Box27, Text as Text30 } from "ink";
|
|
9796
|
+
import { Box as Box25, Text as Text28 } from "ink";
|
|
10239
9797
|
import React25 from "react";
|
|
10240
|
-
import { Text as
|
|
10241
|
-
import { jsx as jsx30, jsxs as
|
|
10242
|
-
import { jsx as jsx31, jsxs as
|
|
9798
|
+
import { Text as Text27 } from "ink";
|
|
9799
|
+
import { jsx as jsx30, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
9800
|
+
import { jsx as jsx31, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
10243
9801
|
import { useState as useState15, useCallback as useCallback9 } from "react";
|
|
10244
9802
|
import chalk3 from "chalk";
|
|
10245
9803
|
import { useState as useState16, useEffect as useEffect17, useCallback as useCallback10 } from "react";
|
|
@@ -10256,21 +9814,21 @@ import * as path132 from "path";
|
|
|
10256
9814
|
import { createContext as createContext6, useContext as useContext7 } from "react";
|
|
10257
9815
|
import { createContext as createContext7, useContext as useContext8 } from "react";
|
|
10258
9816
|
import { useCallback as useCallback16 } from "react";
|
|
10259
|
-
import { Box as
|
|
9817
|
+
import { Box as Box26, Text as Text29 } from "ink";
|
|
10260
9818
|
import chalk2 from "chalk";
|
|
10261
|
-
import { jsx as jsx32, jsxs as
|
|
10262
|
-
import { Fragment as Fragment7, jsx as jsx33, jsxs as
|
|
10263
|
-
import { Box as
|
|
9819
|
+
import { jsx as jsx32, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
9820
|
+
import { Fragment as Fragment7, jsx as jsx33, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
9821
|
+
import { Box as Box28, Text as Text36 } from "ink";
|
|
9822
|
+
import { Text as Text31 } from "ink";
|
|
9823
|
+
import { Fragment as Fragment8, jsx as jsx34, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
10264
9824
|
import { Text as Text32 } from "ink";
|
|
10265
|
-
import {
|
|
9825
|
+
import { jsx as jsx35, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
10266
9826
|
import { Text as Text33 } from "ink";
|
|
10267
|
-
import { jsx as
|
|
9827
|
+
import { jsx as jsx36, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
10268
9828
|
import { Text as Text34 } from "ink";
|
|
10269
|
-
import {
|
|
9829
|
+
import { jsxs as jsxs31 } from "react/jsx-runtime";
|
|
10270
9830
|
import { Text as Text35 } from "ink";
|
|
10271
9831
|
import { jsxs as jsxs32 } from "react/jsx-runtime";
|
|
10272
|
-
import { Text as Text36 } from "ink";
|
|
10273
|
-
import { jsxs as jsxs33 } from "react/jsx-runtime";
|
|
10274
9832
|
import { useState as useState222, useEffect as useEffect24 } from "react";
|
|
10275
9833
|
import { execFile as execFile22 } from "child_process";
|
|
10276
9834
|
import os5 from "os";
|
|
@@ -10281,41 +9839,41 @@ import {
|
|
|
10281
9839
|
useState as useState23
|
|
10282
9840
|
} from "react";
|
|
10283
9841
|
import { jsx as jsx37 } from "react/jsx-runtime";
|
|
10284
|
-
import { jsx as jsx38, jsxs as
|
|
9842
|
+
import { jsx as jsx38, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
10285
9843
|
import { useRef as useRef14 } from "react";
|
|
9844
|
+
import { Box as Box29, Text as Text37 } from "ink";
|
|
9845
|
+
import { jsx as jsx39, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
10286
9846
|
import { Box as Box30, Text as Text38 } from "ink";
|
|
10287
|
-
import { jsx as
|
|
10288
|
-
import {
|
|
10289
|
-
import {
|
|
10290
|
-
import { jsx as
|
|
10291
|
-
import { Box as Box33, Text as Text41 } from "ink";
|
|
10292
|
-
import { jsx as jsx42, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
9847
|
+
import { jsx as jsx40, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
9848
|
+
import { jsx as jsx41, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
9849
|
+
import { Box as Box32, Text as Text40 } from "ink";
|
|
9850
|
+
import { jsx as jsx42, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
10293
9851
|
import { useCallback as useCallback20, useMemo as useMemo12, useRef as useRef15 } from "react";
|
|
10294
|
-
import { Box as
|
|
10295
|
-
import { jsx as jsx43, jsxs as
|
|
9852
|
+
import { Box as Box33, Text as Text41 } from "ink";
|
|
9853
|
+
import { jsx as jsx43, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
10296
9854
|
import { useCallback as useCallback21, useMemo as useMemo13, useState as useState25 } from "react";
|
|
10297
|
-
import { Box as
|
|
10298
|
-
import { Fragment as Fragment9, jsx as jsx44, jsxs as
|
|
9855
|
+
import { Box as Box34, Text as Text42, useInput as useInput3 } from "ink";
|
|
9856
|
+
import { Fragment as Fragment9, jsx as jsx44, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
10299
9857
|
import { useCallback as useCallback22, useMemo as useMemo14, useState as useState26 } from "react";
|
|
10300
|
-
import { Box as
|
|
10301
|
-
import { jsx as jsx45, jsxs as
|
|
9858
|
+
import { Box as Box35, Text as Text43 } from "ink";
|
|
9859
|
+
import { jsx as jsx45, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
10302
9860
|
import { useCallback as useCallback23, useEffect as useEffect25, useMemo as useMemo15, useRef as useRef16, useState as useState27 } from "react";
|
|
10303
|
-
import { Box as
|
|
10304
|
-
import { jsx as jsx46, jsxs as
|
|
9861
|
+
import { Box as Box36, Text as Text44 } from "ink";
|
|
9862
|
+
import { jsx as jsx46, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
10305
9863
|
import { useCallback as useCallback24, useEffect as useEffect26, useMemo as useMemo16, useRef as useRef17, useState as useState28 } from "react";
|
|
10306
|
-
import { Box as
|
|
10307
|
-
import { jsx as jsx47, jsxs as
|
|
9864
|
+
import { Box as Box37, Text as Text45, useInput as useInput4 } from "ink";
|
|
9865
|
+
import { jsx as jsx47, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
10308
9866
|
import fs7 from "fs";
|
|
10309
9867
|
import path142 from "path";
|
|
10310
9868
|
import { useCallback as useCallback25, useMemo as useMemo17 } from "react";
|
|
10311
|
-
import { Box as
|
|
10312
|
-
import { jsx as jsx48, jsxs as
|
|
9869
|
+
import { Box as Box38, Text as Text46 } from "ink";
|
|
9870
|
+
import { jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
10313
9871
|
import { useCallback as useCallback26, useEffect as useEffect27, useMemo as useMemo18, useState as useState29 } from "react";
|
|
10314
|
-
import { Box as
|
|
10315
|
-
import { jsx as jsx49, jsxs as
|
|
10316
|
-
import { Box as
|
|
10317
|
-
import { jsx as jsx50, jsxs as
|
|
10318
|
-
import { jsx as jsx51, jsxs as
|
|
9872
|
+
import { Box as Box39, Text as Text47, useInput as useInput5 } from "ink";
|
|
9873
|
+
import { jsx as jsx49, jsxs as jsxs44 } from "react/jsx-runtime";
|
|
9874
|
+
import { Box as Box40, Text as Text48 } from "ink";
|
|
9875
|
+
import { jsx as jsx50, jsxs as jsxs45 } from "react/jsx-runtime";
|
|
9876
|
+
import { jsx as jsx51, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
10319
9877
|
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
10320
9878
|
async function createRuntime(options) {
|
|
10321
9879
|
const worktree = path10.resolve(options.cwd);
|
|
@@ -11909,7 +11467,7 @@ function parseVersion(version) {
|
|
|
11909
11467
|
if (!match) return null;
|
|
11910
11468
|
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
11911
11469
|
}
|
|
11912
|
-
var VERSION = "1.2.
|
|
11470
|
+
var VERSION = "1.2.12".length > 0 ? "1.2.12" : "0.0.0-dev";
|
|
11913
11471
|
async function updateCommand() {
|
|
11914
11472
|
writeStdoutLine(`Current version: ${VERSION}`);
|
|
11915
11473
|
const update = await checkForUpdate(VERSION, { force: true });
|
|
@@ -23641,7 +23199,7 @@ var ToolStatusIndicator = ({
|
|
|
23641
23199
|
name
|
|
23642
23200
|
}) => {
|
|
23643
23201
|
const isShell = name === SHELL_COMMAND_NAME || name === SHELL_NAME;
|
|
23644
|
-
const
|
|
23202
|
+
const statusColor2 = isShell ? theme.ui.symbol : theme.status.warning;
|
|
23645
23203
|
return /* @__PURE__ */ jsxs17(Box17, { minWidth: STATUS_INDICATOR_WIDTH, children: [
|
|
23646
23204
|
status === "Pending" && /* @__PURE__ */ jsx22(Text20, { color: theme.status.success, children: TOOL_STATUS.PENDING }),
|
|
23647
23205
|
status === "Executing" && /* @__PURE__ */ jsx22(
|
|
@@ -23652,8 +23210,8 @@ var ToolStatusIndicator = ({
|
|
|
23652
23210
|
}
|
|
23653
23211
|
),
|
|
23654
23212
|
status === "Success" && /* @__PURE__ */ jsx22(Text20, { color: theme.status.success, "aria-label": "Success:", children: TOOL_STATUS.SUCCESS }),
|
|
23655
|
-
status === "Confirming" && /* @__PURE__ */ jsx22(Text20, { color:
|
|
23656
|
-
status === "Canceled" && /* @__PURE__ */ jsx22(Text20, { color:
|
|
23213
|
+
status === "Confirming" && /* @__PURE__ */ jsx22(Text20, { color: statusColor2, "aria-label": "Confirming:", children: TOOL_STATUS.CONFIRMING }),
|
|
23214
|
+
status === "Canceled" && /* @__PURE__ */ jsx22(Text20, { color: statusColor2, "aria-label": "Canceled:", bold: true, children: TOOL_STATUS.CANCELED }),
|
|
23657
23215
|
status === "Error" && /* @__PURE__ */ jsx22(Text20, { color: theme.status.error, "aria-label": "Error:", bold: true, children: TOOL_STATUS.ERROR })
|
|
23658
23216
|
] });
|
|
23659
23217
|
};
|
|
@@ -24578,76 +24136,6 @@ var ErrorMessage = ({ text }) => /* @__PURE__ */ jsxs21(Text25, { color: theme.s
|
|
|
24578
24136
|
"\u2717 ",
|
|
24579
24137
|
text
|
|
24580
24138
|
] });
|
|
24581
|
-
var STATUS_ICON = {
|
|
24582
|
-
pending: "\u25CB",
|
|
24583
|
-
running: "\u25D0",
|
|
24584
|
-
completed: "\u2713",
|
|
24585
|
-
failed: "\u2717"
|
|
24586
|
-
};
|
|
24587
|
-
function statusColor(status) {
|
|
24588
|
-
switch (status) {
|
|
24589
|
-
case "completed":
|
|
24590
|
-
return theme.status.success;
|
|
24591
|
-
case "failed":
|
|
24592
|
-
return theme.status.error;
|
|
24593
|
-
case "running":
|
|
24594
|
-
return theme.text.accent;
|
|
24595
|
-
default:
|
|
24596
|
-
return theme.text.secondary;
|
|
24597
|
-
}
|
|
24598
|
-
}
|
|
24599
|
-
function streamTail(stream, max = 100) {
|
|
24600
|
-
const lines = stream.split(/\r?\n/).filter((line) => line.trim().length > 0);
|
|
24601
|
-
const last = lines[lines.length - 1] ?? "";
|
|
24602
|
-
return last.length > max ? `${last.slice(0, max - 1)}\u2026` : last;
|
|
24603
|
-
}
|
|
24604
|
-
var TaskPlanPanel = ({ plan, taskStreams }) => {
|
|
24605
|
-
const completed = plan.tasks.filter((task) => task.status === "completed").length;
|
|
24606
|
-
return /* @__PURE__ */ jsxs22(
|
|
24607
|
-
Box23,
|
|
24608
|
-
{
|
|
24609
|
-
flexDirection: "column",
|
|
24610
|
-
marginTop: 1,
|
|
24611
|
-
marginLeft: 2,
|
|
24612
|
-
marginRight: 2,
|
|
24613
|
-
borderStyle: "round",
|
|
24614
|
-
borderColor: theme.border.default,
|
|
24615
|
-
paddingX: 1,
|
|
24616
|
-
children: [
|
|
24617
|
-
/* @__PURE__ */ jsxs22(Text26, { bold: true, color: theme.text.accent, children: [
|
|
24618
|
-
"Plan \xB7 ",
|
|
24619
|
-
plan.objective,
|
|
24620
|
-
" ",
|
|
24621
|
-
/* @__PURE__ */ jsxs22(Text26, { color: theme.text.secondary, children: [
|
|
24622
|
-
"(",
|
|
24623
|
-
completed,
|
|
24624
|
-
"/",
|
|
24625
|
-
plan.tasks.length,
|
|
24626
|
-
")"
|
|
24627
|
-
] })
|
|
24628
|
-
] }),
|
|
24629
|
-
plan.tasks.map((task) => {
|
|
24630
|
-
const tail = task.status === "running" ? streamTail(taskStreams[task.id] ?? "") : "";
|
|
24631
|
-
return /* @__PURE__ */ jsxs22(Box23, { flexDirection: "column", children: [
|
|
24632
|
-
/* @__PURE__ */ jsxs22(Text26, { color: statusColor(task.status), children: [
|
|
24633
|
-
STATUS_ICON[task.status],
|
|
24634
|
-
" ",
|
|
24635
|
-
task.description,
|
|
24636
|
-
task.error ? /* @__PURE__ */ jsxs22(Text26, { color: theme.status.error, children: [
|
|
24637
|
-
" \u2014 ",
|
|
24638
|
-
task.error
|
|
24639
|
-
] }) : null
|
|
24640
|
-
] }),
|
|
24641
|
-
tail ? /* @__PURE__ */ jsxs22(Text26, { color: theme.text.secondary, children: [
|
|
24642
|
-
" ",
|
|
24643
|
-
tail
|
|
24644
|
-
] }) : null
|
|
24645
|
-
] }, task.id);
|
|
24646
|
-
})
|
|
24647
|
-
]
|
|
24648
|
-
}
|
|
24649
|
-
);
|
|
24650
|
-
};
|
|
24651
24139
|
var UIActionsContext = createContext5(null);
|
|
24652
24140
|
var useUIActions = () => {
|
|
24653
24141
|
const context = useContext6(UIActionsContext);
|
|
@@ -24756,8 +24244,6 @@ var MainContent = ({
|
|
|
24756
24244
|
historyRemountKey,
|
|
24757
24245
|
pendingAssistantText,
|
|
24758
24246
|
liveToolCalls,
|
|
24759
|
-
taskPlan,
|
|
24760
|
-
taskStreams,
|
|
24761
24247
|
terminalWidth,
|
|
24762
24248
|
mainAreaWidth,
|
|
24763
24249
|
isFocused = true
|
|
@@ -24844,7 +24330,7 @@ var MainContent = ({
|
|
|
24844
24330
|
return () => clearImmediate(handle);
|
|
24845
24331
|
}, [replayCount, mergedHistory.length]);
|
|
24846
24332
|
const visibleHistory = mergedHistory.length - replayCount <= PROGRESSIVE_REPLAY_CHUNK_SIZE ? mergedHistory : mergedHistory.slice(0, replayCount);
|
|
24847
|
-
return /* @__PURE__ */
|
|
24333
|
+
return /* @__PURE__ */ jsxs22(Box23, { flexDirection: "column", flexGrow: 1, children: [
|
|
24848
24334
|
/* @__PURE__ */ jsx28(Static, { items: visibleHistory, children: (item) => /* @__PURE__ */ jsx28(
|
|
24849
24335
|
HistoryItemDisplay,
|
|
24850
24336
|
{
|
|
@@ -24878,8 +24364,7 @@ var MainContent = ({
|
|
|
24878
24364
|
isFocused,
|
|
24879
24365
|
compactLabel: getCompactLabel({ type: "tool_group", tools: liveToolCalls })
|
|
24880
24366
|
}
|
|
24881
|
-
)
|
|
24882
|
-
taskPlan && /* @__PURE__ */ jsx28(TaskPlanPanel, { plan: taskPlan, taskStreams })
|
|
24367
|
+
)
|
|
24883
24368
|
] });
|
|
24884
24369
|
};
|
|
24885
24370
|
function useTerminalSize() {
|
|
@@ -24981,34 +24466,34 @@ var LoadingIndicator = ({
|
|
|
24981
24466
|
time: timeStr,
|
|
24982
24467
|
tokens: tokenStr
|
|
24983
24468
|
}) : null;
|
|
24984
|
-
return /* @__PURE__ */
|
|
24985
|
-
/* @__PURE__ */
|
|
24986
|
-
|
|
24469
|
+
return /* @__PURE__ */ jsxs23(Box24, { paddingLeft: 2, flexDirection: "column", children: [
|
|
24470
|
+
/* @__PURE__ */ jsxs23(
|
|
24471
|
+
Box24,
|
|
24987
24472
|
{
|
|
24988
24473
|
width: "100%",
|
|
24989
24474
|
flexDirection: isNarrow ? "column" : "row",
|
|
24990
24475
|
alignItems: isNarrow ? "flex-start" : "center",
|
|
24991
24476
|
children: [
|
|
24992
|
-
/* @__PURE__ */
|
|
24993
|
-
/* @__PURE__ */ jsx29(
|
|
24477
|
+
/* @__PURE__ */ jsxs23(Box24, { children: [
|
|
24478
|
+
/* @__PURE__ */ jsx29(Box24, { marginRight: 1, children: /* @__PURE__ */ jsx29(
|
|
24994
24479
|
GeminiRespondingSpinner,
|
|
24995
24480
|
{
|
|
24996
24481
|
nonRespondingDisplay: streamingState === "waiting_for_confirmation" ? "\u280F" : ""
|
|
24997
24482
|
}
|
|
24998
24483
|
) }),
|
|
24999
|
-
primaryText && /* @__PURE__ */ jsx29(
|
|
25000
|
-
!isNarrow && cancelAndTimerContent && /* @__PURE__ */
|
|
24484
|
+
primaryText && /* @__PURE__ */ jsx29(Text26, { color: theme.text.accent, wrap: "truncate-end", children: primaryText }),
|
|
24485
|
+
!isNarrow && cancelAndTimerContent && /* @__PURE__ */ jsxs23(Text26, { color: theme.text.secondary, children: [
|
|
25001
24486
|
" ",
|
|
25002
24487
|
cancelAndTimerContent
|
|
25003
24488
|
] })
|
|
25004
24489
|
] }),
|
|
25005
|
-
!isNarrow && /* @__PURE__ */ jsx29(
|
|
25006
|
-
!isNarrow && rightContent && /* @__PURE__ */ jsx29(
|
|
24490
|
+
!isNarrow && /* @__PURE__ */ jsx29(Box24, { flexGrow: 1 }),
|
|
24491
|
+
!isNarrow && rightContent && /* @__PURE__ */ jsx29(Box24, { children: rightContent })
|
|
25007
24492
|
]
|
|
25008
24493
|
}
|
|
25009
24494
|
),
|
|
25010
|
-
isNarrow && cancelAndTimerContent && /* @__PURE__ */ jsx29(
|
|
25011
|
-
isNarrow && rightContent && /* @__PURE__ */ jsx29(
|
|
24495
|
+
isNarrow && cancelAndTimerContent && /* @__PURE__ */ jsx29(Box24, { children: /* @__PURE__ */ jsx29(Text26, { color: theme.text.secondary, children: cancelAndTimerContent }) }),
|
|
24496
|
+
isNarrow && rightContent && /* @__PURE__ */ jsx29(Box24, { children: rightContent })
|
|
25012
24497
|
] });
|
|
25013
24498
|
};
|
|
25014
24499
|
var MAX_WIDTH = 150;
|
|
@@ -25022,7 +24507,7 @@ var _PrepareLabel = ({
|
|
|
25022
24507
|
const hasMatch = matchedIndex !== void 0 && matchedIndex >= 0 && matchedIndex < label.length && userInput.length > 0;
|
|
25023
24508
|
if (!hasMatch) {
|
|
25024
24509
|
const display = isExpanded ? label : label.length > MAX_WIDTH ? label.slice(0, MAX_WIDTH) + "..." : label;
|
|
25025
|
-
return /* @__PURE__ */ jsx30(
|
|
24510
|
+
return /* @__PURE__ */ jsx30(Text27, { wrap: "wrap", color: textColor, children: display });
|
|
25026
24511
|
}
|
|
25027
24512
|
const matchLength = userInput.length;
|
|
25028
24513
|
let before = "";
|
|
@@ -25061,10 +24546,10 @@ var _PrepareLabel = ({
|
|
|
25061
24546
|
after = after.length >= 3 ? after.slice(0, -3) + "..." : "...";
|
|
25062
24547
|
}
|
|
25063
24548
|
}
|
|
25064
|
-
return /* @__PURE__ */
|
|
24549
|
+
return /* @__PURE__ */ jsxs24(Text27, { color: textColor, wrap: "wrap", children: [
|
|
25065
24550
|
before,
|
|
25066
24551
|
match ? match.split(/(\s+)/).map((part, index) => /* @__PURE__ */ jsx30(
|
|
25067
|
-
|
|
24552
|
+
Text27,
|
|
25068
24553
|
{
|
|
25069
24554
|
color: theme.background.primary,
|
|
25070
24555
|
backgroundColor: theme.text.primary,
|
|
@@ -25088,7 +24573,7 @@ function SuggestionsDisplay({
|
|
|
25088
24573
|
expandedIndex
|
|
25089
24574
|
}) {
|
|
25090
24575
|
if (isLoading) {
|
|
25091
|
-
return /* @__PURE__ */ jsx31(
|
|
24576
|
+
return /* @__PURE__ */ jsx31(Box25, { width, children: /* @__PURE__ */ jsx31(Text28, { color: "gray", children: t("Loading suggestions...") }) });
|
|
25092
24577
|
}
|
|
25093
24578
|
if (suggestions.length === 0) {
|
|
25094
24579
|
return null;
|
|
@@ -25104,8 +24589,8 @@ function SuggestionsDisplay({
|
|
|
25104
24589
|
...suggestions.map((s) => getFullLabel(s).length)
|
|
25105
24590
|
);
|
|
25106
24591
|
const commandColumnWidth = mode === "slash" ? Math.min(maxLabelLength, Math.floor(width * 0.5)) : 0;
|
|
25107
|
-
return /* @__PURE__ */
|
|
25108
|
-
scrollOffset > 0 && /* @__PURE__ */ jsx31(
|
|
24592
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "column", width, children: [
|
|
24593
|
+
scrollOffset > 0 && /* @__PURE__ */ jsx31(Text28, { color: theme.text.primary, children: "\u25B2" }),
|
|
25109
24594
|
visibleSuggestions.map((suggestion, index) => {
|
|
25110
24595
|
const originalIndex = startIndex + index;
|
|
25111
24596
|
const isActive = originalIndex === activeIndex;
|
|
@@ -25128,18 +24613,18 @@ function SuggestionsDisplay({
|
|
|
25128
24613
|
isExpanded
|
|
25129
24614
|
}
|
|
25130
24615
|
);
|
|
25131
|
-
return /* @__PURE__ */
|
|
24616
|
+
return /* @__PURE__ */ jsxs25(Box25, { flexDirection: "row", children: [
|
|
25132
24617
|
/* @__PURE__ */ jsx31(
|
|
25133
|
-
|
|
24618
|
+
Box25,
|
|
25134
24619
|
{
|
|
25135
24620
|
...mode === "slash" ? { width: commandColumnWidth, flexShrink: 0 } : { flexShrink: 1 },
|
|
25136
|
-
children: /* @__PURE__ */
|
|
24621
|
+
children: /* @__PURE__ */ jsxs25(Box25, { children: [
|
|
25137
24622
|
labelElement,
|
|
25138
|
-
suggestion.argumentHint && /* @__PURE__ */
|
|
24623
|
+
suggestion.argumentHint && /* @__PURE__ */ jsxs25(Text28, { color: theme.text.secondary, children: [
|
|
25139
24624
|
" ",
|
|
25140
24625
|
suggestion.argumentHint
|
|
25141
24626
|
] }),
|
|
25142
|
-
suggestion.sourceBadge && /* @__PURE__ */
|
|
24627
|
+
suggestion.sourceBadge && /* @__PURE__ */ jsxs25(Text28, { color: textColor, children: [
|
|
25143
24628
|
" ",
|
|
25144
24629
|
suggestion.sourceBadge
|
|
25145
24630
|
] })
|
|
@@ -25147,20 +24632,20 @@ function SuggestionsDisplay({
|
|
|
25147
24632
|
}
|
|
25148
24633
|
),
|
|
25149
24634
|
suggestion.description && /* @__PURE__ */ jsx31(
|
|
25150
|
-
|
|
24635
|
+
Box25,
|
|
25151
24636
|
{
|
|
25152
24637
|
width: descriptionColumnWidth,
|
|
25153
24638
|
flexGrow: 1,
|
|
25154
24639
|
flexShrink: 1,
|
|
25155
24640
|
paddingLeft: 2,
|
|
25156
|
-
children: /* @__PURE__ */ jsx31(
|
|
24641
|
+
children: /* @__PURE__ */ jsx31(Text28, { color: textColor, wrap: "wrap", children: suggestion.description })
|
|
25157
24642
|
}
|
|
25158
24643
|
),
|
|
25159
|
-
isActive && isLong && /* @__PURE__ */ jsx31(
|
|
24644
|
+
isActive && isLong && /* @__PURE__ */ jsx31(Box25, { children: /* @__PURE__ */ jsx31(Text28, { color: Colors.Gray, children: isExpanded ? " \u2190 " : " \u2192 " }) })
|
|
25160
24645
|
] }, `${suggestion.value}-${originalIndex}`);
|
|
25161
24646
|
}),
|
|
25162
|
-
endIndex < suggestions.length && /* @__PURE__ */ jsx31(
|
|
25163
|
-
suggestions.length > MAX_SUGGESTIONS_TO_SHOW && /* @__PURE__ */
|
|
24647
|
+
endIndex < suggestions.length && /* @__PURE__ */ jsx31(Text28, { color: "gray", children: "\u25BC" }),
|
|
24648
|
+
suggestions.length > MAX_SUGGESTIONS_TO_SHOW && /* @__PURE__ */ jsxs25(Text28, { color: "gray", children: [
|
|
25164
24649
|
"(",
|
|
25165
24650
|
activeIndex + 1,
|
|
25166
24651
|
"/",
|
|
@@ -26910,11 +26395,11 @@ function defaultRenderLine({
|
|
|
26910
26395
|
showCursor
|
|
26911
26396
|
}) {
|
|
26912
26397
|
if (!isOnCursorLine || !showCursor) {
|
|
26913
|
-
return /* @__PURE__ */ jsx32(
|
|
26398
|
+
return /* @__PURE__ */ jsx32(Text29, { children: lineText || " " });
|
|
26914
26399
|
}
|
|
26915
26400
|
const len = cpLen(lineText);
|
|
26916
26401
|
if (cursorCol >= len) {
|
|
26917
|
-
return /* @__PURE__ */
|
|
26402
|
+
return /* @__PURE__ */ jsxs26(Text29, { children: [
|
|
26918
26403
|
lineText,
|
|
26919
26404
|
chalk2.inverse(" ") + "\u200B"
|
|
26920
26405
|
] });
|
|
@@ -26922,7 +26407,7 @@ function defaultRenderLine({
|
|
|
26922
26407
|
const before = cpSlice(lineText, 0, cursorCol);
|
|
26923
26408
|
const cursorChar = cpSlice(lineText, cursorCol, cursorCol + 1);
|
|
26924
26409
|
const after = cpSlice(lineText, cursorCol + 1);
|
|
26925
|
-
return /* @__PURE__ */
|
|
26410
|
+
return /* @__PURE__ */ jsxs26(Text29, { children: [
|
|
26926
26411
|
before,
|
|
26927
26412
|
chalk2.inverse(cursorChar),
|
|
26928
26413
|
after
|
|
@@ -27045,15 +26530,15 @@ var BaseTextInput = ({
|
|
|
27045
26530
|
const [cursorVisualRow, cursorVisualCol] = buffer.visualCursor;
|
|
27046
26531
|
const scrollVisualRow = buffer.visualScrollRow;
|
|
27047
26532
|
const resolvedBorderColor = borderColor ?? theme.border.focused;
|
|
27048
|
-
const resolvedPrefix = prefix ?? /* @__PURE__ */ jsx32(
|
|
26533
|
+
const resolvedPrefix = prefix ?? /* @__PURE__ */ jsx32(Text29, { color: theme.text.accent, children: "> " });
|
|
27049
26534
|
const columns = process.stdout.columns || 80;
|
|
27050
26535
|
const labelWidth = topRightLabel ? stringWidth(topRightLabel) + 4 : 0;
|
|
27051
26536
|
const dashCount = Math.max(1, columns - labelWidth);
|
|
27052
26537
|
const topBorderLine = topRightLabel ? `${"\u2500".repeat(dashCount)} ${topRightLabel} ${"\u2500".repeat(2)}` : "\u2500".repeat(columns);
|
|
27053
|
-
return /* @__PURE__ */
|
|
27054
|
-
/* @__PURE__ */ jsx32(
|
|
27055
|
-
/* @__PURE__ */
|
|
27056
|
-
|
|
26538
|
+
return /* @__PURE__ */ jsxs26(Box26, { flexDirection: "column", children: [
|
|
26539
|
+
/* @__PURE__ */ jsx32(Text29, { color: resolvedBorderColor, wrap: "truncate-end", children: topBorderLine }),
|
|
26540
|
+
/* @__PURE__ */ jsxs26(
|
|
26541
|
+
Box26,
|
|
27057
26542
|
{
|
|
27058
26543
|
borderStyle: "single",
|
|
27059
26544
|
borderTop: false,
|
|
@@ -27063,13 +26548,13 @@ var BaseTextInput = ({
|
|
|
27063
26548
|
borderColor: resolvedBorderColor,
|
|
27064
26549
|
children: [
|
|
27065
26550
|
resolvedPrefix,
|
|
27066
|
-
/* @__PURE__ */ jsx32(
|
|
26551
|
+
/* @__PURE__ */ jsx32(Box26, { flexGrow: 1, flexDirection: "column", children: buffer.text.length === 0 && placeholder ? showCursor ? /* @__PURE__ */ jsxs26(Text29, { children: [
|
|
27067
26552
|
chalk2.inverse(placeholder.slice(0, 1)),
|
|
27068
|
-
/* @__PURE__ */ jsx32(
|
|
27069
|
-
] }) : /* @__PURE__ */ jsx32(
|
|
26553
|
+
/* @__PURE__ */ jsx32(Text29, { color: theme.text.secondary, children: placeholder.slice(1) })
|
|
26554
|
+
] }) : /* @__PURE__ */ jsx32(Text29, { color: theme.text.secondary, children: placeholder }) : linesToRender.map((lineText, idx) => {
|
|
27070
26555
|
const absoluteVisualIndex = scrollVisualRow + idx;
|
|
27071
26556
|
const isOnCursorLine = absoluteVisualIndex === cursorVisualRow;
|
|
27072
|
-
return /* @__PURE__ */ jsx32(
|
|
26557
|
+
return /* @__PURE__ */ jsx32(Box26, { height: 1, children: renderLine({
|
|
27073
26558
|
lineText,
|
|
27074
26559
|
isOnCursorLine,
|
|
27075
26560
|
cursorCol: cursorVisualCol,
|
|
@@ -28033,7 +27518,7 @@ ${currentText}`);
|
|
|
28033
27518
|
}
|
|
28034
27519
|
const color = seg.type === "command" || seg.type === "file" ? theme.text.accent : theme.text.primary;
|
|
28035
27520
|
renderedLine.push(
|
|
28036
|
-
/* @__PURE__ */ jsx33(
|
|
27521
|
+
/* @__PURE__ */ jsx33(Text30, { color, children: display }, `token-${segIdx}`)
|
|
28037
27522
|
);
|
|
28038
27523
|
});
|
|
28039
27524
|
if (isOnCursorLine && cursorVisualColAbsolute === cpLen(lineText)) {
|
|
@@ -28041,31 +27526,31 @@ ${currentText}`);
|
|
|
28041
27526
|
if (ghostText && showCursorOpt && ghostText.text.length > 0) {
|
|
28042
27527
|
if (ghostText.showCursorBeforeText) {
|
|
28043
27528
|
renderedLine.push(
|
|
28044
|
-
/* @__PURE__ */ jsx33(
|
|
27529
|
+
/* @__PURE__ */ jsx33(Text30, { children: chalk3.inverse(" ") }, "ghost-cursor")
|
|
28045
27530
|
);
|
|
28046
27531
|
renderedLine.push(
|
|
28047
|
-
/* @__PURE__ */ jsx33(
|
|
27532
|
+
/* @__PURE__ */ jsx33(Text30, { color: theme.text.secondary, children: ghostText.text }, "ghost-rest")
|
|
28048
27533
|
);
|
|
28049
27534
|
} else {
|
|
28050
27535
|
const firstChar = ghostText.text[0];
|
|
28051
27536
|
const rest = ghostText.text.slice(firstChar.length);
|
|
28052
27537
|
renderedLine.push(
|
|
28053
|
-
/* @__PURE__ */ jsx33(
|
|
27538
|
+
/* @__PURE__ */ jsx33(Text30, { children: chalk3.inverse(firstChar) }, "ghost-cursor")
|
|
28054
27539
|
);
|
|
28055
27540
|
if (rest.length > 0) {
|
|
28056
27541
|
renderedLine.push(
|
|
28057
|
-
/* @__PURE__ */ jsx33(
|
|
27542
|
+
/* @__PURE__ */ jsx33(Text30, { color: theme.text.secondary, children: rest }, "ghost-rest")
|
|
28058
27543
|
);
|
|
28059
27544
|
}
|
|
28060
27545
|
}
|
|
28061
|
-
renderedLine.push(/* @__PURE__ */ jsx33(
|
|
27546
|
+
renderedLine.push(/* @__PURE__ */ jsx33(Text30, { children: `\u200B` }, "ghost-zwsp"));
|
|
28062
27547
|
} else {
|
|
28063
27548
|
renderedLine.push(
|
|
28064
|
-
/* @__PURE__ */ jsx33(
|
|
27549
|
+
/* @__PURE__ */ jsx33(Text30, { children: showCursorOpt ? chalk3.inverse(" ") + "\u200B" : " \u200B" }, `cursor-end-${cursorVisualColAbsolute}`)
|
|
28065
27550
|
);
|
|
28066
27551
|
}
|
|
28067
27552
|
}
|
|
28068
|
-
return /* @__PURE__ */ jsx33(
|
|
27553
|
+
return /* @__PURE__ */ jsx33(Text30, { children: renderedLine });
|
|
28069
27554
|
},
|
|
28070
27555
|
[slashCommands]
|
|
28071
27556
|
);
|
|
@@ -28093,38 +27578,38 @@ ${currentText}`);
|
|
|
28093
27578
|
}, [promptSuggestion]);
|
|
28094
27579
|
const showAutoAcceptStyling = !shellModeActive && approvalMode === "auto-edit";
|
|
28095
27580
|
const showYoloStyling = !shellModeActive && approvalMode === "yolo";
|
|
28096
|
-
let
|
|
27581
|
+
let statusColor2;
|
|
28097
27582
|
let statusText = "";
|
|
28098
27583
|
if (shellModeActive) {
|
|
28099
|
-
|
|
27584
|
+
statusColor2 = theme.ui.symbol;
|
|
28100
27585
|
statusText = t("Shell mode");
|
|
28101
27586
|
} else if (showYoloStyling) {
|
|
28102
|
-
|
|
27587
|
+
statusColor2 = theme.status.errorDim;
|
|
28103
27588
|
statusText = t("YOLO mode");
|
|
28104
27589
|
} else if (showAutoAcceptStyling) {
|
|
28105
|
-
|
|
27590
|
+
statusColor2 = theme.status.warningDim;
|
|
28106
27591
|
statusText = t("Accepting edits");
|
|
28107
27592
|
}
|
|
28108
|
-
const borderColor = isShellFocused && !isEmbeddedShellFocused && !agentTabBarFocused ?
|
|
28109
|
-
const prefixNode = /* @__PURE__ */
|
|
28110
|
-
|
|
27593
|
+
const borderColor = isShellFocused && !isEmbeddedShellFocused && !agentTabBarFocused ? statusColor2 ?? theme.border.focused : theme.border.default;
|
|
27594
|
+
const prefixNode = /* @__PURE__ */ jsxs27(
|
|
27595
|
+
Text30,
|
|
28111
27596
|
{
|
|
28112
|
-
color:
|
|
27597
|
+
color: statusColor2 ?? theme.text.accent,
|
|
28113
27598
|
"aria-label": statusText || void 0,
|
|
28114
27599
|
children: [
|
|
28115
|
-
shellModeActive ? reverseSearchActive ? /* @__PURE__ */
|
|
27600
|
+
shellModeActive ? reverseSearchActive ? /* @__PURE__ */ jsxs27(Text30, { color: theme.text.link, "aria-label": SCREEN_READER_USER_PREFIX, children: [
|
|
28116
27601
|
"(r:)",
|
|
28117
27602
|
" "
|
|
28118
|
-
] }) : "!" : commandSearchActive ? /* @__PURE__ */ jsx33(
|
|
27603
|
+
] }) : "!" : commandSearchActive ? /* @__PURE__ */ jsx33(Text30, { color: theme.text.accent, children: "(r:) " }) : showYoloStyling ? "*" : ">",
|
|
28119
27604
|
" "
|
|
28120
27605
|
]
|
|
28121
27606
|
}
|
|
28122
27607
|
);
|
|
28123
|
-
return /* @__PURE__ */
|
|
28124
|
-
attachments.length > 0 && /* @__PURE__ */
|
|
28125
|
-
/* @__PURE__ */ jsx33(
|
|
28126
|
-
attachments.map((att, idx) => /* @__PURE__ */
|
|
28127
|
-
|
|
27608
|
+
return /* @__PURE__ */ jsxs27(Fragment7, { children: [
|
|
27609
|
+
attachments.length > 0 && /* @__PURE__ */ jsxs27(Box27, { marginLeft: 2, marginBottom: 0, children: [
|
|
27610
|
+
/* @__PURE__ */ jsx33(Text30, { color: theme.text.secondary, children: t("Attachments: ") }),
|
|
27611
|
+
attachments.map((att, idx) => /* @__PURE__ */ jsxs27(
|
|
27612
|
+
Text30,
|
|
28128
27613
|
{
|
|
28129
27614
|
color: isAttachmentMode && idx === selectedAttachmentIndex ? theme.status.success : theme.text.secondary,
|
|
28130
27615
|
children: [
|
|
@@ -28152,7 +27637,7 @@ ${currentText}`);
|
|
|
28152
27637
|
renderLine: renderLineWithHighlighting
|
|
28153
27638
|
}
|
|
28154
27639
|
),
|
|
28155
|
-
shouldShowSuggestions && /* @__PURE__ */ jsx33(
|
|
27640
|
+
shouldShowSuggestions && /* @__PURE__ */ jsx33(Box27, { marginLeft: 2, marginRight: 2, children: /* @__PURE__ */ jsx33(
|
|
28156
27641
|
SuggestionsDisplay,
|
|
28157
27642
|
{
|
|
28158
27643
|
suggestions: suggestionDisplayProps.suggestions,
|
|
@@ -28165,7 +27650,7 @@ ${currentText}`);
|
|
|
28165
27650
|
expandedIndex: expandedSuggestionIndex
|
|
28166
27651
|
}
|
|
28167
27652
|
) }),
|
|
28168
|
-
attachments.length > 0 && !shouldShowSuggestions && /* @__PURE__ */ jsx33(
|
|
27653
|
+
attachments.length > 0 && !shouldShowSuggestions && /* @__PURE__ */ jsx33(Box27, { marginLeft: 2, marginRight: 2, children: /* @__PURE__ */ jsx33(Text30, { color: theme.text.secondary, children: isAttachmentMode ? t("\u2190 \u2192 select, Delete to remove, \u2193 to exit") : t("\u2191 to manage attachments") }) })
|
|
28169
27654
|
] });
|
|
28170
27655
|
};
|
|
28171
27656
|
function formatPercentageUsed(percentage) {
|
|
@@ -28187,12 +27672,12 @@ var ContextUsageDisplay = ({
|
|
|
28187
27672
|
const isOverLimit = percentage > 1;
|
|
28188
27673
|
const label = terminalWidth < 100 ? t("% used") : t("% context used");
|
|
28189
27674
|
if (isOverLimit) {
|
|
28190
|
-
return /* @__PURE__ */ jsx34(Fragment8, { children: /* @__PURE__ */
|
|
27675
|
+
return /* @__PURE__ */ jsx34(Fragment8, { children: /* @__PURE__ */ jsxs28(Text31, { color: theme.status.error, children: [
|
|
28191
27676
|
percentageUsed,
|
|
28192
27677
|
label
|
|
28193
27678
|
] }) });
|
|
28194
27679
|
}
|
|
28195
|
-
return /* @__PURE__ */
|
|
27680
|
+
return /* @__PURE__ */ jsxs28(Text31, { color: theme.text.secondary, children: [
|
|
28196
27681
|
percentageUsed,
|
|
28197
27682
|
label
|
|
28198
27683
|
] });
|
|
@@ -28224,20 +27709,20 @@ var AutoAcceptIndicator = ({
|
|
|
28224
27709
|
default:
|
|
28225
27710
|
break;
|
|
28226
27711
|
}
|
|
28227
|
-
return /* @__PURE__ */
|
|
27712
|
+
return /* @__PURE__ */ jsxs29(Text32, { color: textColor, children: [
|
|
28228
27713
|
textContent,
|
|
28229
|
-
subText && /* @__PURE__ */ jsx35(
|
|
27714
|
+
subText && /* @__PURE__ */ jsx35(Text32, { color: theme.text.secondary, children: subText })
|
|
28230
27715
|
] });
|
|
28231
27716
|
};
|
|
28232
|
-
var ShellModeIndicator = () => /* @__PURE__ */
|
|
27717
|
+
var ShellModeIndicator = () => /* @__PURE__ */ jsxs30(Text33, { color: theme.ui.symbol, children: [
|
|
28233
27718
|
"shell mode enabled",
|
|
28234
|
-
/* @__PURE__ */ jsx36(
|
|
27719
|
+
/* @__PURE__ */ jsx36(Text33, { color: theme.text.secondary, children: " (esc to disable)" })
|
|
28235
27720
|
] });
|
|
28236
27721
|
function BackgroundTasksPill() {
|
|
28237
27722
|
const { activeSubagents } = useUIState();
|
|
28238
27723
|
const running = activeSubagents.filter((s) => s.status === "running").length;
|
|
28239
27724
|
if (running <= 0) return null;
|
|
28240
|
-
return /* @__PURE__ */
|
|
27725
|
+
return /* @__PURE__ */ jsxs31(Text34, { color: theme.text.accent, children: [
|
|
28241
27726
|
" ",
|
|
28242
27727
|
running,
|
|
28243
27728
|
" task",
|
|
@@ -28248,7 +27733,7 @@ function MCPHealthPill() {
|
|
|
28248
27733
|
const { mcpConnected, mcpTotal } = useUIState();
|
|
28249
27734
|
if (mcpTotal === 0) return null;
|
|
28250
27735
|
const color = mcpConnected === mcpTotal ? theme.status.success : theme.status.warning;
|
|
28251
|
-
return /* @__PURE__ */
|
|
27736
|
+
return /* @__PURE__ */ jsxs32(Text35, { color, children: [
|
|
28252
27737
|
" MCP ",
|
|
28253
27738
|
mcpConnected,
|
|
28254
27739
|
"/",
|
|
@@ -28325,16 +27810,16 @@ var Footer = () => {
|
|
|
28325
27810
|
const debugMode = config.getDebugMode();
|
|
28326
27811
|
const contextWindowSize = config.getContentGeneratorConfig()?.contextWindowSize;
|
|
28327
27812
|
const suppressHint = statusLineLines.length > 0;
|
|
28328
|
-
const leftBottomContent = uiState.ctrlCPressedOnce ? /* @__PURE__ */ jsx38(
|
|
27813
|
+
const leftBottomContent = uiState.ctrlCPressedOnce ? /* @__PURE__ */ jsx38(Text36, { color: theme.status.warning, children: t("Press Ctrl+C again to exit.") }) : uiState.ctrlDPressedOnce ? /* @__PURE__ */ jsx38(Text36, { color: theme.status.warning, children: t("Press Ctrl+D again to exit.") }) : uiState.showEscapePrompt ? /* @__PURE__ */ jsx38(Text36, { color: theme.text.secondary, children: t("Press Esc again to clear.") }) : uiState.rewindEscPending ? /* @__PURE__ */ jsx38(Text36, { color: theme.text.secondary, children: t("Press Esc again to rewind conversation.") }) : vimEnabled && vimMode === "INSERT" ? /* @__PURE__ */ jsx38(Text36, { color: theme.text.secondary, children: "-- INSERT --" }) : uiState.shellModeActive ? /* @__PURE__ */ jsx38(ShellModeIndicator, {}) : configInitMessage ? /* @__PURE__ */ jsxs33(Text36, { color: theme.text.secondary, children: [
|
|
28329
27814
|
/* @__PURE__ */ jsx38(GeminiSpinner, {}),
|
|
28330
27815
|
" ",
|
|
28331
27816
|
configInitMessage
|
|
28332
|
-
] }) : showAutoAcceptIndicator !== void 0 && showAutoAcceptIndicator !== "default" ? /* @__PURE__ */ jsx38(AutoAcceptIndicator, { approvalMode: showAutoAcceptIndicator }) : suppressHint ? null : /* @__PURE__ */ jsx38(
|
|
27817
|
+
] }) : showAutoAcceptIndicator !== void 0 && showAutoAcceptIndicator !== "default" ? /* @__PURE__ */ jsx38(AutoAcceptIndicator, { approvalMode: showAutoAcceptIndicator }) : suppressHint ? null : /* @__PURE__ */ jsx38(Text36, { color: theme.text.secondary, children: t("? for shortcuts") });
|
|
28333
27818
|
const rightItems = [];
|
|
28334
27819
|
if (sandboxInfo) {
|
|
28335
27820
|
rightItems.push({
|
|
28336
27821
|
key: "sandbox",
|
|
28337
|
-
node: /* @__PURE__ */
|
|
27822
|
+
node: /* @__PURE__ */ jsxs33(Text36, { color: theme.status.success, children: [
|
|
28338
27823
|
"\u{1F512} ",
|
|
28339
27824
|
sandboxInfo
|
|
28340
27825
|
] })
|
|
@@ -28343,13 +27828,13 @@ var Footer = () => {
|
|
|
28343
27828
|
if (debugMode) {
|
|
28344
27829
|
rightItems.push({
|
|
28345
27830
|
key: "debug",
|
|
28346
|
-
node: /* @__PURE__ */ jsx38(
|
|
27831
|
+
node: /* @__PURE__ */ jsx38(Text36, { color: theme.status.warning, children: "Debug Mode" })
|
|
28347
27832
|
});
|
|
28348
27833
|
}
|
|
28349
27834
|
if (promptTokenCount > 0 && contextWindowSize) {
|
|
28350
27835
|
rightItems.push({
|
|
28351
27836
|
key: "context",
|
|
28352
|
-
node: /* @__PURE__ */ jsx38(
|
|
27837
|
+
node: /* @__PURE__ */ jsx38(Text36, { color: theme.text.accent, children: /* @__PURE__ */ jsx38(
|
|
28353
27838
|
ContextUsageDisplay,
|
|
28354
27839
|
{
|
|
28355
27840
|
promptTokenCount,
|
|
@@ -28359,8 +27844,8 @@ var Footer = () => {
|
|
|
28359
27844
|
) })
|
|
28360
27845
|
});
|
|
28361
27846
|
}
|
|
28362
|
-
return /* @__PURE__ */
|
|
28363
|
-
|
|
27847
|
+
return /* @__PURE__ */ jsxs33(
|
|
27848
|
+
Box28,
|
|
28364
27849
|
{
|
|
28365
27850
|
flexDirection: isNarrow ? "column" : "row",
|
|
28366
27851
|
justifyContent: isNarrow ? "flex-start" : "space-between",
|
|
@@ -28368,16 +27853,16 @@ var Footer = () => {
|
|
|
28368
27853
|
paddingX: 2,
|
|
28369
27854
|
gap: isNarrow ? 0 : 1,
|
|
28370
27855
|
children: [
|
|
28371
|
-
/* @__PURE__ */
|
|
28372
|
-
statusLineLines.length > 0 && !uiState.ctrlCPressedOnce && !uiState.ctrlDPressedOnce && statusLineLines.map((line, i) => /* @__PURE__ */ jsx38(
|
|
28373
|
-
/* @__PURE__ */
|
|
28374
|
-
/* @__PURE__ */ jsx38(
|
|
27856
|
+
/* @__PURE__ */ jsxs33(Box28, { flexDirection: "column", flexShrink: isNarrow ? 0 : 1, children: [
|
|
27857
|
+
statusLineLines.length > 0 && !uiState.ctrlCPressedOnce && !uiState.ctrlDPressedOnce && statusLineLines.map((line, i) => /* @__PURE__ */ jsx38(Text36, { dimColor: true, wrap: "truncate", children: line }, `status-line-${i}`)),
|
|
27858
|
+
/* @__PURE__ */ jsxs33(Box28, { flexDirection: "row", flexShrink: 1, children: [
|
|
27859
|
+
/* @__PURE__ */ jsx38(Text36, { wrap: "truncate", children: leftBottomContent }),
|
|
28375
27860
|
/* @__PURE__ */ jsx38(BackgroundTasksPill, {}),
|
|
28376
27861
|
/* @__PURE__ */ jsx38(MCPHealthPill, {})
|
|
28377
27862
|
] })
|
|
28378
27863
|
] }),
|
|
28379
|
-
/* @__PURE__ */ jsx38(
|
|
28380
|
-
index > 0 && /* @__PURE__ */ jsx38(
|
|
27864
|
+
/* @__PURE__ */ jsx38(Box28, { flexShrink: 0, gap: 1, alignItems: "flex-start", children: rightItems.map(({ key, node }, index) => /* @__PURE__ */ jsxs33(Box28, { alignItems: "center", children: [
|
|
27865
|
+
index > 0 && /* @__PURE__ */ jsx38(Text36, { color: theme.text.secondary, children: " | " }),
|
|
28381
27866
|
node
|
|
28382
27867
|
] }, key)) })
|
|
28383
27868
|
]
|
|
@@ -28400,17 +27885,17 @@ var QueuedMessageDisplay = ({
|
|
|
28400
27885
|
wasEmptyRef.current = false;
|
|
28401
27886
|
}
|
|
28402
27887
|
const showHint = hintSeenCountRef.current <= NUM_TIMES_QUEUE_HINT_SHOWN;
|
|
28403
|
-
return /* @__PURE__ */
|
|
27888
|
+
return /* @__PURE__ */ jsxs34(Box29, { flexDirection: "column", marginTop: 1, children: [
|
|
28404
27889
|
messageQueue.slice(0, MAX_DISPLAYED_QUEUED_MESSAGES).map((message, index) => {
|
|
28405
27890
|
const preview = message.replace(/\s+/g, " ");
|
|
28406
|
-
return /* @__PURE__ */ jsx39(
|
|
27891
|
+
return /* @__PURE__ */ jsx39(Box29, { paddingLeft: 2, width: "100%", children: /* @__PURE__ */ jsx39(Text37, { dimColor: true, wrap: "truncate", children: preview }) }, index);
|
|
28407
27892
|
}),
|
|
28408
|
-
messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && /* @__PURE__ */ jsx39(
|
|
27893
|
+
messageQueue.length > MAX_DISPLAYED_QUEUED_MESSAGES && /* @__PURE__ */ jsx39(Box29, { paddingLeft: 2, children: /* @__PURE__ */ jsxs34(Text37, { dimColor: true, children: [
|
|
28409
27894
|
"... (+",
|
|
28410
27895
|
messageQueue.length - MAX_DISPLAYED_QUEUED_MESSAGES,
|
|
28411
27896
|
" more)"
|
|
28412
27897
|
] }) }),
|
|
28413
|
-
showHint && /* @__PURE__ */ jsx39(
|
|
27898
|
+
showHint && /* @__PURE__ */ jsx39(Box29, { paddingLeft: 2, children: /* @__PURE__ */ jsx39(Text37, { dimColor: true, italic: true, children: t("Press \u2191 to edit queued messages") }) })
|
|
28414
27899
|
] });
|
|
28415
27900
|
};
|
|
28416
27901
|
var getNewlineKey = () => process.platform === "win32" ? "ctrl+enter" : "ctrl+j";
|
|
@@ -28438,8 +27923,8 @@ var getShortcuts = () => [
|
|
|
28438
27923
|
{ key: getExternalEditorKey(), description: t("for external editor") },
|
|
28439
27924
|
{ key: "ctrl+o", description: t("to toggle compact mode") }
|
|
28440
27925
|
];
|
|
28441
|
-
var ShortcutItem = ({ shortcut }) => /* @__PURE__ */
|
|
28442
|
-
/* @__PURE__ */ jsx40(
|
|
27926
|
+
var ShortcutItem = ({ shortcut }) => /* @__PURE__ */ jsxs35(Text38, { color: theme.text.secondary, children: [
|
|
27927
|
+
/* @__PURE__ */ jsx40(Text38, { color: theme.text.accent, children: shortcut.key }),
|
|
28443
27928
|
" ",
|
|
28444
27929
|
shortcut.description
|
|
28445
27930
|
] });
|
|
@@ -28481,13 +27966,13 @@ var KeyboardShortcuts = () => {
|
|
|
28481
27966
|
startIndex += count;
|
|
28482
27967
|
}
|
|
28483
27968
|
return /* @__PURE__ */ jsx40(
|
|
28484
|
-
|
|
27969
|
+
Box30,
|
|
28485
27970
|
{
|
|
28486
27971
|
flexDirection: "row",
|
|
28487
27972
|
marginLeft: MARGIN_LEFT,
|
|
28488
27973
|
marginRight: MARGIN_RIGHT,
|
|
28489
27974
|
children: columns.map((column, colIndex) => /* @__PURE__ */ jsx40(
|
|
28490
|
-
|
|
27975
|
+
Box30,
|
|
28491
27976
|
{
|
|
28492
27977
|
flexDirection: "column",
|
|
28493
27978
|
marginRight: colIndex < numColumns - 1 ? COLUMN_GAP : 0,
|
|
@@ -28535,7 +28020,7 @@ var Composer = () => {
|
|
|
28535
28020
|
},
|
|
28536
28021
|
[uiActions]
|
|
28537
28022
|
);
|
|
28538
|
-
return /* @__PURE__ */
|
|
28023
|
+
return /* @__PURE__ */ jsxs36(Box31, { flexDirection: "column", marginTop: 1, children: [
|
|
28539
28024
|
!uiState.embeddedShellFocused && !suppressBottomLoadingIndicator && /* @__PURE__ */ jsx41(
|
|
28540
28025
|
LoadingIndicator,
|
|
28541
28026
|
{
|
|
@@ -28548,7 +28033,7 @@ var Composer = () => {
|
|
|
28548
28033
|
isReceivingContent
|
|
28549
28034
|
}
|
|
28550
28035
|
),
|
|
28551
|
-
!uiState.embeddedShellFocused && suppressBottomLoadingIndicator && /* @__PURE__ */ jsx41(
|
|
28036
|
+
!uiState.embeddedShellFocused && suppressBottomLoadingIndicator && /* @__PURE__ */ jsx41(Box31, { paddingLeft: 2, children: /* @__PURE__ */ jsxs36(Text39, { color: theme.text.secondary, children: [
|
|
28552
28037
|
"(",
|
|
28553
28038
|
t("Esc to cancel"),
|
|
28554
28039
|
")"
|
|
@@ -29056,10 +28541,10 @@ var CommandDialog = ({
|
|
|
29056
28541
|
title,
|
|
29057
28542
|
lines,
|
|
29058
28543
|
footerText = "Press Esc or Enter to close."
|
|
29059
|
-
}) => /* @__PURE__ */ jsx42(
|
|
29060
|
-
/* @__PURE__ */ jsx42(
|
|
29061
|
-
/* @__PURE__ */ jsx42(
|
|
29062
|
-
/* @__PURE__ */ jsx42(
|
|
28544
|
+
}) => /* @__PURE__ */ jsx42(Box32, { marginLeft: 2, marginRight: 2, marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ jsxs37(Box32, { borderStyle: "round", borderColor: theme.border.default, padding: 1, flexDirection: "column", children: [
|
|
28545
|
+
/* @__PURE__ */ jsx42(Text40, { bold: true, color: theme.text.accent, children: title }),
|
|
28546
|
+
/* @__PURE__ */ jsx42(Box32, { marginTop: 1, flexDirection: "column", children: lines.map((line, index) => /* @__PURE__ */ jsx42(Text40, { color: theme.text.primary, children: line }, index)) }),
|
|
28547
|
+
/* @__PURE__ */ jsx42(Box32, { marginTop: 1, children: /* @__PURE__ */ jsx42(Text40, { color: theme.text.secondary, children: footerText }) })
|
|
29063
28548
|
] }) });
|
|
29064
28549
|
var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
|
|
29065
28550
|
const originalTheme = useRef15(themeManager.getActiveTheme().name);
|
|
@@ -29096,8 +28581,8 @@ var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
|
|
|
29096
28581
|
},
|
|
29097
28582
|
[onPreview]
|
|
29098
28583
|
);
|
|
29099
|
-
return /* @__PURE__ */
|
|
29100
|
-
|
|
28584
|
+
return /* @__PURE__ */ jsxs38(
|
|
28585
|
+
Box33,
|
|
29101
28586
|
{
|
|
29102
28587
|
flexDirection: "column",
|
|
29103
28588
|
borderStyle: "round",
|
|
@@ -29106,7 +28591,7 @@ var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
|
|
|
29106
28591
|
marginLeft: 2,
|
|
29107
28592
|
marginRight: 2,
|
|
29108
28593
|
children: [
|
|
29109
|
-
/* @__PURE__ */ jsx43(
|
|
28594
|
+
/* @__PURE__ */ jsx43(Text41, { bold: true, color: theme.text.accent, children: "Select theme" }),
|
|
29110
28595
|
/* @__PURE__ */ jsx43(
|
|
29111
28596
|
RadioButtonSelect,
|
|
29112
28597
|
{
|
|
@@ -29117,7 +28602,7 @@ var ThemeDialog = ({ onSelect, onClose, onPreview }) => {
|
|
|
29117
28602
|
isFocused: true
|
|
29118
28603
|
}
|
|
29119
28604
|
),
|
|
29120
|
-
/* @__PURE__ */ jsx43(
|
|
28605
|
+
/* @__PURE__ */ jsx43(Text41, { color: theme.text.secondary, children: "\u2191\u2193 navigate \xB7 Enter apply \xB7 Esc cancel" })
|
|
29121
28606
|
]
|
|
29122
28607
|
}
|
|
29123
28608
|
);
|
|
@@ -29345,10 +28830,10 @@ var ProviderDialog = ({
|
|
|
29345
28830
|
},
|
|
29346
28831
|
{ isActive: phase === "apiKey" }
|
|
29347
28832
|
);
|
|
29348
|
-
const
|
|
28833
|
+
const statusColor2 = status ? status.ok ? status.text.startsWith("\u2713") ? theme.status.success : theme.text.secondary : theme.status.error : void 0;
|
|
29349
28834
|
const footer = phase === "apiKey" ? "Enter save Ctrl+U clear Esc cancel" : phase === "providers" ? "\u2191\u2193 navigate Enter select Esc close" : "\u2191\u2193 navigate Enter confirm Esc back";
|
|
29350
|
-
return /* @__PURE__ */
|
|
29351
|
-
|
|
28835
|
+
return /* @__PURE__ */ jsxs39(
|
|
28836
|
+
Box34,
|
|
29352
28837
|
{
|
|
29353
28838
|
flexDirection: "column",
|
|
29354
28839
|
borderStyle: "round",
|
|
@@ -29359,13 +28844,13 @@ var ProviderDialog = ({
|
|
|
29359
28844
|
marginRight: 2,
|
|
29360
28845
|
minWidth: 44,
|
|
29361
28846
|
children: [
|
|
29362
|
-
/* @__PURE__ */
|
|
29363
|
-
/* @__PURE__ */ jsx44(
|
|
29364
|
-
phase !== "providers" && /* @__PURE__ */
|
|
29365
|
-
/* @__PURE__ */ jsx44(
|
|
29366
|
-
/* @__PURE__ */ jsx44(
|
|
28847
|
+
/* @__PURE__ */ jsxs39(Box34, { marginBottom: 1, gap: 1, children: [
|
|
28848
|
+
/* @__PURE__ */ jsx44(Text42, { bold: true, color: theme.text.accent, children: "Providers" }),
|
|
28849
|
+
phase !== "providers" && /* @__PURE__ */ jsxs39(Fragment9, { children: [
|
|
28850
|
+
/* @__PURE__ */ jsx44(Text42, { color: theme.text.secondary, children: "\u203A" }),
|
|
28851
|
+
/* @__PURE__ */ jsx44(Text42, { bold: true, color: theme.text.primary, children: selectedProvider })
|
|
29367
28852
|
] }),
|
|
29368
|
-
phase === "providers" && currentModel && /* @__PURE__ */
|
|
28853
|
+
phase === "providers" && currentModel && /* @__PURE__ */ jsxs39(Text42, { color: theme.text.secondary, children: [
|
|
29369
28854
|
" (",
|
|
29370
28855
|
currentModel,
|
|
29371
28856
|
")"
|
|
@@ -29381,23 +28866,23 @@ var ProviderDialog = ({
|
|
|
29381
28866
|
maxItemsToShow: 8,
|
|
29382
28867
|
renderItem: (item, { titleColor }) => {
|
|
29383
28868
|
const { icon, color, label } = getStatusMark(item.provider, item.keyIsSet);
|
|
29384
|
-
return /* @__PURE__ */
|
|
29385
|
-
/* @__PURE__ */ jsx44(
|
|
29386
|
-
/* @__PURE__ */ jsx44(
|
|
29387
|
-
/* @__PURE__ */ jsx44(
|
|
29388
|
-
item.isCurrent && /* @__PURE__ */ jsx44(
|
|
28869
|
+
return /* @__PURE__ */ jsxs39(Box34, { gap: 1, children: [
|
|
28870
|
+
/* @__PURE__ */ jsx44(Text42, { color, children: icon }),
|
|
28871
|
+
/* @__PURE__ */ jsx44(Text42, { color: titleColor, bold: item.isCurrent, children: item.provider.padEnd(12) }),
|
|
28872
|
+
/* @__PURE__ */ jsx44(Text42, { color, dimColor: !item.keyIsSet && !item.isLocal, children: label }),
|
|
28873
|
+
item.isCurrent && /* @__PURE__ */ jsx44(Text42, { color: theme.text.accent, children: "\u25B6" })
|
|
29389
28874
|
] });
|
|
29390
28875
|
}
|
|
29391
28876
|
}
|
|
29392
28877
|
),
|
|
29393
|
-
phase === "actions" && /* @__PURE__ */
|
|
29394
|
-
/* @__PURE__ */
|
|
29395
|
-
/* @__PURE__ */ jsx44(
|
|
29396
|
-
/* @__PURE__ */ jsx44(
|
|
28878
|
+
phase === "actions" && /* @__PURE__ */ jsxs39(Fragment9, { children: [
|
|
28879
|
+
/* @__PURE__ */ jsxs39(Box34, { marginBottom: 1, gap: 1, children: [
|
|
28880
|
+
/* @__PURE__ */ jsx44(Text42, { color: theme.ui.comment, children: "session" }),
|
|
28881
|
+
/* @__PURE__ */ jsx44(Text42, { color: selectedProvider === currentProvider ? theme.text.accent : theme.text.secondary, children: selectedProvider === currentProvider ? "active" : `still using ${currentProvider}` })
|
|
29397
28882
|
] }),
|
|
29398
|
-
/* @__PURE__ */
|
|
29399
|
-
/* @__PURE__ */ jsx44(
|
|
29400
|
-
isLocal ? /* @__PURE__ */ jsx44(
|
|
28883
|
+
/* @__PURE__ */ jsxs39(Box34, { marginBottom: 1, gap: 1, children: [
|
|
28884
|
+
/* @__PURE__ */ jsx44(Text42, { color: theme.ui.comment, children: "key" }),
|
|
28885
|
+
isLocal ? /* @__PURE__ */ jsx44(Text42, { color: theme.text.accent, children: "no key required" }) : keyHint ? /* @__PURE__ */ jsx44(Text42, { color: theme.text.secondary, children: keyHint }) : /* @__PURE__ */ jsx44(Text42, { color: theme.ui.comment, dimColor: true, children: "not configured" })
|
|
29401
28886
|
] }),
|
|
29402
28887
|
/* @__PURE__ */ jsx44(
|
|
29403
28888
|
BaseSelectionList,
|
|
@@ -29407,10 +28892,10 @@ var ProviderDialog = ({
|
|
|
29407
28892
|
isFocused: !isBusy,
|
|
29408
28893
|
showNumbers: false,
|
|
29409
28894
|
maxItemsToShow: 6,
|
|
29410
|
-
renderItem: (item, { titleColor }) => /* @__PURE__ */
|
|
29411
|
-
/* @__PURE__ */ jsx44(
|
|
29412
|
-
/* @__PURE__ */ jsx44(
|
|
29413
|
-
item.hint && /* @__PURE__ */
|
|
28895
|
+
renderItem: (item, { titleColor }) => /* @__PURE__ */ jsxs39(Box34, { gap: 1, children: [
|
|
28896
|
+
/* @__PURE__ */ jsx44(Text42, { color: titleColor, children: item.icon }),
|
|
28897
|
+
/* @__PURE__ */ jsx44(Text42, { color: titleColor, children: item.label }),
|
|
28898
|
+
item.hint && /* @__PURE__ */ jsxs39(Text42, { color: theme.ui.comment, dimColor: true, children: [
|
|
29414
28899
|
"(",
|
|
29415
28900
|
item.hint,
|
|
29416
28901
|
")"
|
|
@@ -29419,26 +28904,26 @@ var ProviderDialog = ({
|
|
|
29419
28904
|
}
|
|
29420
28905
|
)
|
|
29421
28906
|
] }),
|
|
29422
|
-
phase === "apiKey" && /* @__PURE__ */
|
|
29423
|
-
/* @__PURE__ */
|
|
29424
|
-
/* @__PURE__ */ jsx44(
|
|
29425
|
-
isLocal ? /* @__PURE__ */ jsx44(
|
|
28907
|
+
phase === "apiKey" && /* @__PURE__ */ jsxs39(Box34, { flexDirection: "column", gap: 1, marginBottom: 1, children: [
|
|
28908
|
+
/* @__PURE__ */ jsxs39(Box34, { gap: 1, children: [
|
|
28909
|
+
/* @__PURE__ */ jsx44(Text42, { color: theme.ui.comment, children: "current" }),
|
|
28910
|
+
isLocal ? /* @__PURE__ */ jsx44(Text42, { color: theme.text.accent, children: "no key required" }) : keyHint ? /* @__PURE__ */ jsx44(Text42, { color: theme.text.secondary, children: keyHint }) : /* @__PURE__ */ jsx44(Text42, { color: theme.ui.comment, dimColor: true, children: "not set" })
|
|
29426
28911
|
] }),
|
|
29427
|
-
/* @__PURE__ */
|
|
29428
|
-
/* @__PURE__ */ jsx44(
|
|
29429
|
-
/* @__PURE__ */ jsx44(
|
|
28912
|
+
/* @__PURE__ */ jsxs39(Box34, { gap: 1, children: [
|
|
28913
|
+
/* @__PURE__ */ jsx44(Text42, { color: theme.ui.comment, children: "new key" }),
|
|
28914
|
+
/* @__PURE__ */ jsx44(Box34, { borderStyle: "single", borderColor: theme.border.focused, paddingX: 1, children: /* @__PURE__ */ jsx44(Text42, { color: theme.text.accent, children: apiKeyInput.length > 0 ? maskApiKeyInput(apiKeyInput.length) : /* @__PURE__ */ jsx44(Text42, { color: theme.ui.comment, dimColor: true, children: "paste or type\u2026" }) }) })
|
|
29430
28915
|
] })
|
|
29431
28916
|
] }),
|
|
29432
|
-
status && /* @__PURE__ */ jsx44(
|
|
29433
|
-
phase === "actions" && testLatencyMs !== void 0 && /* @__PURE__ */
|
|
29434
|
-
/* @__PURE__ */
|
|
28917
|
+
status && /* @__PURE__ */ jsx44(Box34, { marginTop: 1, children: /* @__PURE__ */ jsx44(Text42, { color: statusColor2, children: status.text }) }),
|
|
28918
|
+
phase === "actions" && testLatencyMs !== void 0 && /* @__PURE__ */ jsxs39(Box34, { marginTop: 0, gap: 1, children: [
|
|
28919
|
+
/* @__PURE__ */ jsxs39(Text42, { color: getLatencyColor(testLatencyMs), bold: true, children: [
|
|
29435
28920
|
testLatencyMs,
|
|
29436
28921
|
"ms"
|
|
29437
28922
|
] }),
|
|
29438
|
-
/* @__PURE__ */ jsx44(
|
|
28923
|
+
/* @__PURE__ */ jsx44(Text42, { color: theme.text.secondary, children: testLatencyMs < 300 ? "excellent" : testLatencyMs < 800 ? "good" : "slow" })
|
|
29439
28924
|
] }),
|
|
29440
28925
|
/* @__PURE__ */ jsx44(
|
|
29441
|
-
|
|
28926
|
+
Box34,
|
|
29442
28927
|
{
|
|
29443
28928
|
marginTop: 1,
|
|
29444
28929
|
borderStyle: "single",
|
|
@@ -29447,7 +28932,7 @@ var ProviderDialog = ({
|
|
|
29447
28932
|
borderLeft: false,
|
|
29448
28933
|
borderRight: false,
|
|
29449
28934
|
borderColor: theme.ui.comment,
|
|
29450
|
-
children: /* @__PURE__ */
|
|
28935
|
+
children: /* @__PURE__ */ jsxs39(Text42, { color: theme.ui.comment, dimColor: true, children: [
|
|
29451
28936
|
footer,
|
|
29452
28937
|
phase === "actions" && " Test does not change the session."
|
|
29453
28938
|
] })
|
|
@@ -29515,8 +29000,8 @@ var PermissionsDialog = ({
|
|
|
29515
29000
|
[onClose]
|
|
29516
29001
|
);
|
|
29517
29002
|
useKeypress(handleEscape, { isActive: true });
|
|
29518
|
-
return /* @__PURE__ */
|
|
29519
|
-
|
|
29003
|
+
return /* @__PURE__ */ jsxs40(
|
|
29004
|
+
Box35,
|
|
29520
29005
|
{
|
|
29521
29006
|
flexDirection: "column",
|
|
29522
29007
|
borderStyle: "round",
|
|
@@ -29525,9 +29010,9 @@ var PermissionsDialog = ({
|
|
|
29525
29010
|
marginLeft: 2,
|
|
29526
29011
|
marginRight: 2,
|
|
29527
29012
|
children: [
|
|
29528
|
-
/* @__PURE__ */ jsx45(
|
|
29013
|
+
/* @__PURE__ */ jsx45(Text43, { bold: true, color: theme.text.accent, children: "Permission policy" }),
|
|
29529
29014
|
/* @__PURE__ */ jsx45(RadioButtonSelect, { items, onSelect: handleSelect, isFocused: true, showNumbers: false }),
|
|
29530
|
-
/* @__PURE__ */ jsx45(
|
|
29015
|
+
/* @__PURE__ */ jsx45(Text43, { color: theme.text.secondary, children: "\u2191\u2193 navigate \xB7 Enter cycles allow/ask/deny \xB7 Esc cancel" })
|
|
29531
29016
|
]
|
|
29532
29017
|
}
|
|
29533
29018
|
);
|
|
@@ -29635,8 +29120,8 @@ var AuthDialog = ({
|
|
|
29635
29120
|
[onClose, phase]
|
|
29636
29121
|
);
|
|
29637
29122
|
useKeypress(handleEscape, { isActive: true });
|
|
29638
|
-
return /* @__PURE__ */
|
|
29639
|
-
|
|
29123
|
+
return /* @__PURE__ */ jsxs41(
|
|
29124
|
+
Box36,
|
|
29640
29125
|
{
|
|
29641
29126
|
flexDirection: "column",
|
|
29642
29127
|
borderStyle: "round",
|
|
@@ -29645,32 +29130,32 @@ var AuthDialog = ({
|
|
|
29645
29130
|
marginLeft: 2,
|
|
29646
29131
|
marginRight: 2,
|
|
29647
29132
|
children: [
|
|
29648
|
-
/* @__PURE__ */ jsx46(
|
|
29649
|
-
/* @__PURE__ */ jsx46(
|
|
29133
|
+
/* @__PURE__ */ jsx46(Text44, { bold: true, color: theme.text.accent, children: "GitHub authentication" }),
|
|
29134
|
+
/* @__PURE__ */ jsx46(Text44, { color: theme.text.secondary, children: statusSummary }),
|
|
29650
29135
|
phase === "menu" && /* @__PURE__ */ jsx46(RadioButtonSelect, { items, onSelect: handleSelect, isFocused: true, showNumbers: false }),
|
|
29651
|
-
deviceCode && phase === "running" && /* @__PURE__ */
|
|
29652
|
-
/* @__PURE__ */
|
|
29136
|
+
deviceCode && phase === "running" && /* @__PURE__ */ jsxs41(Box36, { flexDirection: "column", marginTop: 1, children: [
|
|
29137
|
+
/* @__PURE__ */ jsxs41(Text44, { children: [
|
|
29653
29138
|
"Open: ",
|
|
29654
|
-
/* @__PURE__ */ jsx46(
|
|
29139
|
+
/* @__PURE__ */ jsx46(Text44, { color: theme.text.accent, children: deviceCode.verificationUri })
|
|
29655
29140
|
] }),
|
|
29656
|
-
/* @__PURE__ */
|
|
29141
|
+
/* @__PURE__ */ jsxs41(Text44, { children: [
|
|
29657
29142
|
"Code: ",
|
|
29658
|
-
/* @__PURE__ */ jsx46(
|
|
29143
|
+
/* @__PURE__ */ jsx46(Text44, { bold: true, color: theme.text.accent, children: deviceCode.userCode })
|
|
29659
29144
|
] }),
|
|
29660
|
-
/* @__PURE__ */
|
|
29145
|
+
/* @__PURE__ */ jsxs41(Text44, { color: theme.text.secondary, children: [
|
|
29661
29146
|
"Expires in ",
|
|
29662
29147
|
Math.round(deviceCode.expiresIn / 60),
|
|
29663
29148
|
" minutes."
|
|
29664
29149
|
] })
|
|
29665
29150
|
] }),
|
|
29666
29151
|
message && /* @__PURE__ */ jsx46(
|
|
29667
|
-
|
|
29152
|
+
Text44,
|
|
29668
29153
|
{
|
|
29669
29154
|
color: phase === "error" ? theme.status.error : phase === "done" ? theme.status.success : theme.text.secondary,
|
|
29670
29155
|
children: message
|
|
29671
29156
|
}
|
|
29672
29157
|
),
|
|
29673
|
-
/* @__PURE__ */ jsx46(
|
|
29158
|
+
/* @__PURE__ */ jsx46(Text44, { color: theme.text.secondary, children: phase === "running" ? "Esc cancel login" : phase === "menu" ? "\u2191\u2193 navigate \xB7 Enter select \xB7 Esc close" : "Esc close" })
|
|
29674
29159
|
]
|
|
29675
29160
|
}
|
|
29676
29161
|
);
|
|
@@ -29797,8 +29282,8 @@ var ModelDialog = ({
|
|
|
29797
29282
|
}, { isActive: true });
|
|
29798
29283
|
const canScrollUp = scrollTop > 0;
|
|
29799
29284
|
const canScrollDown = scrollTop + MAX_VISIBLE < rows.length;
|
|
29800
|
-
return /* @__PURE__ */
|
|
29801
|
-
|
|
29285
|
+
return /* @__PURE__ */ jsxs42(
|
|
29286
|
+
Box37,
|
|
29802
29287
|
{
|
|
29803
29288
|
flexDirection: "column",
|
|
29804
29289
|
borderStyle: "round",
|
|
@@ -29809,80 +29294,80 @@ var ModelDialog = ({
|
|
|
29809
29294
|
marginRight: 1,
|
|
29810
29295
|
minWidth: 58,
|
|
29811
29296
|
children: [
|
|
29812
|
-
/* @__PURE__ */
|
|
29813
|
-
/* @__PURE__ */
|
|
29814
|
-
/* @__PURE__ */ jsx47(
|
|
29815
|
-
/* @__PURE__ */ jsx47(
|
|
29816
|
-
/* @__PURE__ */ jsx47(
|
|
29297
|
+
/* @__PURE__ */ jsxs42(Box37, { justifyContent: "space-between", marginBottom: 1, children: [
|
|
29298
|
+
/* @__PURE__ */ jsxs42(Box37, { gap: 1, children: [
|
|
29299
|
+
/* @__PURE__ */ jsx47(Text45, { bold: true, color: theme.text.primary, children: "Select model" }),
|
|
29300
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.text.secondary, children: "for" }),
|
|
29301
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.text.accent, children: currentProvider })
|
|
29817
29302
|
] }),
|
|
29818
|
-
/* @__PURE__ */ jsx47(
|
|
29303
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.ui.comment, dimColor: true, children: "esc" })
|
|
29819
29304
|
] }),
|
|
29820
|
-
/* @__PURE__ */
|
|
29821
|
-
|
|
29305
|
+
/* @__PURE__ */ jsxs42(
|
|
29306
|
+
Box37,
|
|
29822
29307
|
{
|
|
29823
29308
|
borderStyle: "single",
|
|
29824
29309
|
borderColor: search ? theme.border.focused : theme.ui.comment,
|
|
29825
29310
|
paddingX: 1,
|
|
29826
29311
|
marginBottom: 1,
|
|
29827
29312
|
children: [
|
|
29828
|
-
/* @__PURE__ */ jsx47(
|
|
29829
|
-
search ? /* @__PURE__ */
|
|
29313
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.ui.comment, children: "\u2315 " }),
|
|
29314
|
+
search ? /* @__PURE__ */ jsxs42(Text45, { color: theme.text.primary, children: [
|
|
29830
29315
|
search,
|
|
29831
|
-
/* @__PURE__ */ jsx47(
|
|
29832
|
-
] }) : /* @__PURE__ */
|
|
29316
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.text.accent, children: "\u258C" })
|
|
29317
|
+
] }) : /* @__PURE__ */ jsxs42(Text45, { color: theme.ui.comment, dimColor: true, children: [
|
|
29833
29318
|
"Search",
|
|
29834
|
-
/* @__PURE__ */ jsx47(
|
|
29319
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.text.accent, children: "\u258C" })
|
|
29835
29320
|
] })
|
|
29836
29321
|
]
|
|
29837
29322
|
}
|
|
29838
29323
|
),
|
|
29839
|
-
loadState === "loading" && /* @__PURE__ */ jsx47(
|
|
29840
|
-
loadState === "error" && /* @__PURE__ */
|
|
29841
|
-
/* @__PURE__ */ jsx47(
|
|
29842
|
-
/* @__PURE__ */ jsx47(
|
|
29324
|
+
loadState === "loading" && /* @__PURE__ */ jsx47(Box37, { marginY: 1, children: /* @__PURE__ */ jsx47(Text45, { color: theme.text.secondary, children: "Loading models\u2026" }) }),
|
|
29325
|
+
loadState === "error" && /* @__PURE__ */ jsxs42(Box37, { flexDirection: "column", marginY: 1, children: [
|
|
29326
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.status.error, children: "\u2717 Could not load models" }),
|
|
29327
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.ui.comment, dimColor: true, children: errorMsg })
|
|
29843
29328
|
] }),
|
|
29844
|
-
loadState === "ready" && selectableCount === 0 && /* @__PURE__ */ jsx47(
|
|
29329
|
+
loadState === "ready" && selectableCount === 0 && /* @__PURE__ */ jsx47(Box37, { marginY: 1, children: /* @__PURE__ */ jsxs42(Text45, { color: theme.ui.comment, dimColor: true, children: [
|
|
29845
29330
|
'No models match "',
|
|
29846
29331
|
search,
|
|
29847
29332
|
'"'
|
|
29848
29333
|
] }) }),
|
|
29849
|
-
loadState === "ready" && selectableCount > 0 && /* @__PURE__ */
|
|
29850
|
-
canScrollUp && /* @__PURE__ */ jsx47(
|
|
29334
|
+
loadState === "ready" && selectableCount > 0 && /* @__PURE__ */ jsxs42(Box37, { flexDirection: "column", children: [
|
|
29335
|
+
canScrollUp && /* @__PURE__ */ jsx47(Text45, { color: theme.ui.comment, dimColor: true, children: " \u2191" }),
|
|
29851
29336
|
visibleRows.map((row, i) => {
|
|
29852
29337
|
if (row.kind === "header") {
|
|
29853
|
-
return /* @__PURE__ */ jsx47(
|
|
29338
|
+
return /* @__PURE__ */ jsx47(Box37, { marginTop: i === 0 ? 0 : 1, children: /* @__PURE__ */ jsx47(Text45, { color: theme.text.accent, bold: true, children: row.label }) }, `h${i}`);
|
|
29854
29339
|
}
|
|
29855
29340
|
const { model, selIndex } = row;
|
|
29856
29341
|
const isActive = selIndex === clampedIndex;
|
|
29857
29342
|
const isCurrent = model.id === currentModel;
|
|
29858
29343
|
const free = isFree(model);
|
|
29859
29344
|
const group = providerGroup(model);
|
|
29860
|
-
return /* @__PURE__ */
|
|
29861
|
-
/* @__PURE__ */ jsx47(
|
|
29862
|
-
/* @__PURE__ */
|
|
29345
|
+
return /* @__PURE__ */ jsxs42(Box37, { gap: 1, children: [
|
|
29346
|
+
/* @__PURE__ */ jsx47(Text45, { color: isActive ? theme.text.accent : theme.ui.comment, children: isCurrent ? "\u25CF" : isActive ? "\u203A" : " " }),
|
|
29347
|
+
/* @__PURE__ */ jsxs42(Box37, { flexGrow: 1, gap: 1, children: [
|
|
29863
29348
|
/* @__PURE__ */ jsx47(
|
|
29864
|
-
|
|
29349
|
+
Text45,
|
|
29865
29350
|
{
|
|
29866
29351
|
color: isActive ? theme.text.primary : theme.text.secondary,
|
|
29867
29352
|
bold: isActive,
|
|
29868
29353
|
children: model.name
|
|
29869
29354
|
}
|
|
29870
29355
|
),
|
|
29871
|
-
/* @__PURE__ */ jsx47(
|
|
29356
|
+
/* @__PURE__ */ jsx47(Text45, { color: theme.text.accent, dimColor: true, children: group })
|
|
29872
29357
|
] }),
|
|
29873
|
-
free && /* @__PURE__ */ jsx47(
|
|
29358
|
+
free && /* @__PURE__ */ jsx47(Text45, { color: theme.status.success, dimColor: !isActive, children: "Free" })
|
|
29874
29359
|
] }, model.id);
|
|
29875
29360
|
}),
|
|
29876
|
-
canScrollDown && /* @__PURE__ */ jsx47(
|
|
29361
|
+
canScrollDown && /* @__PURE__ */ jsx47(Text45, { color: theme.ui.comment, dimColor: true, children: " \u2193" })
|
|
29877
29362
|
] }),
|
|
29878
|
-
loadState === "ready" && /* @__PURE__ */ jsx47(
|
|
29363
|
+
loadState === "ready" && /* @__PURE__ */ jsx47(Box37, { marginTop: 1, children: /* @__PURE__ */ jsxs42(Text45, { color: theme.ui.comment, dimColor: true, children: [
|
|
29879
29364
|
selectableCount,
|
|
29880
29365
|
" model",
|
|
29881
29366
|
selectableCount !== 1 ? "s" : "",
|
|
29882
29367
|
search ? ` \xB7 "${search}"` : ""
|
|
29883
29368
|
] }) }),
|
|
29884
29369
|
/* @__PURE__ */ jsx47(
|
|
29885
|
-
|
|
29370
|
+
Box37,
|
|
29886
29371
|
{
|
|
29887
29372
|
marginTop: 1,
|
|
29888
29373
|
borderStyle: "single",
|
|
@@ -29891,7 +29376,7 @@ var ModelDialog = ({
|
|
|
29891
29376
|
borderLeft: false,
|
|
29892
29377
|
borderRight: false,
|
|
29893
29378
|
borderColor: theme.ui.comment,
|
|
29894
|
-
children: /* @__PURE__ */ jsx47(
|
|
29379
|
+
children: /* @__PURE__ */ jsx47(Text45, { color: theme.ui.comment, dimColor: true, children: "\u2191\u2193 navigate type to search Enter use for session Esc close" })
|
|
29895
29380
|
}
|
|
29896
29381
|
)
|
|
29897
29382
|
]
|
|
@@ -29945,8 +29430,8 @@ var FeedbackDialog = ({ cwd, onClose }) => {
|
|
|
29945
29430
|
[onClose]
|
|
29946
29431
|
);
|
|
29947
29432
|
useKeypress(handleEscape, { isActive: true });
|
|
29948
|
-
return /* @__PURE__ */
|
|
29949
|
-
|
|
29433
|
+
return /* @__PURE__ */ jsxs43(
|
|
29434
|
+
Box38,
|
|
29950
29435
|
{
|
|
29951
29436
|
flexDirection: "column",
|
|
29952
29437
|
borderStyle: "round",
|
|
@@ -29955,9 +29440,9 @@ var FeedbackDialog = ({ cwd, onClose }) => {
|
|
|
29955
29440
|
marginLeft: 2,
|
|
29956
29441
|
marginRight: 2,
|
|
29957
29442
|
children: [
|
|
29958
|
-
/* @__PURE__ */ jsx48(
|
|
29443
|
+
/* @__PURE__ */ jsx48(Text46, { bold: true, color: theme.text.accent, children: "How useful was DeepCode in this session?" }),
|
|
29959
29444
|
/* @__PURE__ */ jsx48(RadioButtonSelect, { items, onSelect: handleSelect, isFocused: true, showNumbers: false }),
|
|
29960
|
-
/* @__PURE__ */ jsx48(
|
|
29445
|
+
/* @__PURE__ */ jsx48(Text46, { color: theme.text.secondary, children: "\u2191\u2193 navigate \xB7 Enter submit \xB7 Esc cancel" })
|
|
29961
29446
|
]
|
|
29962
29447
|
}
|
|
29963
29448
|
);
|
|
@@ -30038,8 +29523,8 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
30038
29523
|
}, { isActive: true });
|
|
30039
29524
|
const canScrollUp = scrollTop > 0;
|
|
30040
29525
|
const canScrollDown = scrollTop + MAX_VISIBLE2 < sessions.length;
|
|
30041
|
-
return /* @__PURE__ */
|
|
30042
|
-
|
|
29526
|
+
return /* @__PURE__ */ jsxs44(
|
|
29527
|
+
Box39,
|
|
30043
29528
|
{
|
|
30044
29529
|
flexDirection: "column",
|
|
30045
29530
|
borderStyle: "round",
|
|
@@ -30050,34 +29535,34 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
30050
29535
|
marginRight: 1,
|
|
30051
29536
|
minWidth: 60,
|
|
30052
29537
|
children: [
|
|
30053
|
-
/* @__PURE__ */
|
|
30054
|
-
/* @__PURE__ */ jsx49(
|
|
30055
|
-
/* @__PURE__ */ jsx49(
|
|
29538
|
+
/* @__PURE__ */ jsxs44(Box39, { justifyContent: "space-between", marginBottom: 1, children: [
|
|
29539
|
+
/* @__PURE__ */ jsx49(Text47, { bold: true, color: theme.text.primary, children: "Resume session" }),
|
|
29540
|
+
/* @__PURE__ */ jsx49(Text47, { color: theme.ui.comment, dimColor: true, children: "esc" })
|
|
30056
29541
|
] }),
|
|
30057
|
-
/* @__PURE__ */
|
|
30058
|
-
|
|
29542
|
+
/* @__PURE__ */ jsxs44(
|
|
29543
|
+
Box39,
|
|
30059
29544
|
{
|
|
30060
29545
|
borderStyle: "single",
|
|
30061
29546
|
borderColor: search ? theme.border.focused : theme.ui.comment,
|
|
30062
29547
|
paddingX: 1,
|
|
30063
29548
|
marginBottom: 1,
|
|
30064
29549
|
children: [
|
|
30065
|
-
/* @__PURE__ */ jsx49(
|
|
30066
|
-
search ? /* @__PURE__ */
|
|
29550
|
+
/* @__PURE__ */ jsx49(Text47, { color: theme.ui.comment, children: "\u2315 " }),
|
|
29551
|
+
search ? /* @__PURE__ */ jsxs44(Text47, { color: theme.text.primary, children: [
|
|
30067
29552
|
search,
|
|
30068
|
-
/* @__PURE__ */ jsx49(
|
|
30069
|
-
] }) : /* @__PURE__ */
|
|
29553
|
+
/* @__PURE__ */ jsx49(Text47, { color: theme.text.accent, children: "\u258C" })
|
|
29554
|
+
] }) : /* @__PURE__ */ jsxs44(Text47, { color: theme.ui.comment, dimColor: true, children: [
|
|
30070
29555
|
"Search",
|
|
30071
|
-
/* @__PURE__ */ jsx49(
|
|
29556
|
+
/* @__PURE__ */ jsx49(Text47, { color: theme.text.accent, children: "\u258C" })
|
|
30072
29557
|
] })
|
|
30073
29558
|
]
|
|
30074
29559
|
}
|
|
30075
29560
|
),
|
|
30076
|
-
loadState === "loading" && /* @__PURE__ */ jsx49(
|
|
30077
|
-
loadState === "error" && /* @__PURE__ */ jsx49(
|
|
30078
|
-
loadState === "ready" && sessions.length === 0 && /* @__PURE__ */ jsx49(
|
|
30079
|
-
loadState === "ready" && sessions.length > 0 && /* @__PURE__ */
|
|
30080
|
-
canScrollUp && /* @__PURE__ */ jsx49(
|
|
29561
|
+
loadState === "loading" && /* @__PURE__ */ jsx49(Box39, { marginY: 1, children: /* @__PURE__ */ jsx49(Text47, { color: theme.text.secondary, children: "Loading sessions\u2026" }) }),
|
|
29562
|
+
loadState === "error" && /* @__PURE__ */ jsx49(Box39, { marginY: 1, children: /* @__PURE__ */ jsx49(Text47, { color: theme.status.error, children: "\u2717 Could not load sessions" }) }),
|
|
29563
|
+
loadState === "ready" && sessions.length === 0 && /* @__PURE__ */ jsx49(Box39, { marginY: 1, children: /* @__PURE__ */ jsx49(Text47, { color: theme.ui.comment, dimColor: true, children: search ? `No sessions match "${search}"` : "No sessions found in .deepcode/sessions/" }) }),
|
|
29564
|
+
loadState === "ready" && sessions.length > 0 && /* @__PURE__ */ jsxs44(Box39, { flexDirection: "column", children: [
|
|
29565
|
+
canScrollUp && /* @__PURE__ */ jsx49(Text47, { color: theme.ui.comment, dimColor: true, children: " \u2191" }),
|
|
30081
29566
|
visibleSessions.map((session, visIdx) => {
|
|
30082
29567
|
const globalIdx = scrollTop + visIdx;
|
|
30083
29568
|
const isActive = globalIdx === clampedIndex;
|
|
@@ -30086,11 +29571,11 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
30086
29571
|
const target = session.model ? `${session.provider}/${session.model}` : session.provider;
|
|
30087
29572
|
const msgCount = session.messages.length;
|
|
30088
29573
|
const preview = sessionLabel2(session);
|
|
30089
|
-
return /* @__PURE__ */
|
|
30090
|
-
/* @__PURE__ */
|
|
30091
|
-
/* @__PURE__ */ jsx49(
|
|
29574
|
+
return /* @__PURE__ */ jsxs44(Box39, { flexDirection: "column", children: [
|
|
29575
|
+
/* @__PURE__ */ jsxs44(Box39, { gap: 1, children: [
|
|
29576
|
+
/* @__PURE__ */ jsx49(Text47, { color: isActive ? theme.text.accent : theme.ui.comment, children: isActive ? "\u203A" : " " }),
|
|
30092
29577
|
/* @__PURE__ */ jsx49(
|
|
30093
|
-
|
|
29578
|
+
Text47,
|
|
30094
29579
|
{
|
|
30095
29580
|
color: isActive ? theme.text.primary : theme.text.secondary,
|
|
30096
29581
|
bold: isActive,
|
|
@@ -30099,7 +29584,7 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
30099
29584
|
}
|
|
30100
29585
|
)
|
|
30101
29586
|
] }),
|
|
30102
|
-
isActive && /* @__PURE__ */ jsx49(
|
|
29587
|
+
isActive && /* @__PURE__ */ jsx49(Box39, { paddingLeft: 2, children: /* @__PURE__ */ jsxs44(Text47, { color: theme.ui.comment, dimColor: true, children: [
|
|
30103
29588
|
shortId,
|
|
30104
29589
|
" ",
|
|
30105
29590
|
target,
|
|
@@ -30110,8 +29595,8 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
30110
29595
|
] }) })
|
|
30111
29596
|
] }, session.id);
|
|
30112
29597
|
}),
|
|
30113
|
-
canScrollDown && /* @__PURE__ */ jsx49(
|
|
30114
|
-
/* @__PURE__ */ jsx49(
|
|
29598
|
+
canScrollDown && /* @__PURE__ */ jsx49(Text47, { color: theme.ui.comment, dimColor: true, children: " \u2193" }),
|
|
29599
|
+
/* @__PURE__ */ jsx49(Box39, { marginTop: 1, children: /* @__PURE__ */ jsxs44(Text47, { color: theme.ui.comment, dimColor: true, children: [
|
|
30115
29600
|
sessions.length,
|
|
30116
29601
|
" session",
|
|
30117
29602
|
sessions.length !== 1 ? "s" : "",
|
|
@@ -30119,7 +29604,7 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
30119
29604
|
] }) })
|
|
30120
29605
|
] }),
|
|
30121
29606
|
/* @__PURE__ */ jsx49(
|
|
30122
|
-
|
|
29607
|
+
Box39,
|
|
30123
29608
|
{
|
|
30124
29609
|
marginTop: 1,
|
|
30125
29610
|
borderStyle: "single",
|
|
@@ -30128,7 +29613,7 @@ var SessionsDialog = ({ cwd, onSelect, onClose }) => {
|
|
|
30128
29613
|
borderLeft: false,
|
|
30129
29614
|
borderRight: false,
|
|
30130
29615
|
borderColor: theme.ui.comment,
|
|
30131
|
-
children: /* @__PURE__ */ jsx49(
|
|
29616
|
+
children: /* @__PURE__ */ jsx49(Text47, { color: theme.ui.comment, dimColor: true, children: "\u2191\u2193 navigate type to search Enter resume Esc close" })
|
|
30132
29617
|
}
|
|
30133
29618
|
)
|
|
30134
29619
|
]
|
|
@@ -30140,7 +29625,7 @@ function statusIcon(e) {
|
|
|
30140
29625
|
if (e.status === "failed") return "\u2717";
|
|
30141
29626
|
return "\u2026";
|
|
30142
29627
|
}
|
|
30143
|
-
function
|
|
29628
|
+
function statusColor(e) {
|
|
30144
29629
|
if (e.status === "done") return theme.status.success;
|
|
30145
29630
|
if (e.status === "failed") return theme.status.error;
|
|
30146
29631
|
return theme.text.accent;
|
|
@@ -30149,8 +29634,8 @@ var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
|
|
|
30149
29634
|
if (subagents.length === 0) return null;
|
|
30150
29635
|
const running = subagents.filter((s) => s.status === "running").length;
|
|
30151
29636
|
const title = running > 0 ? `Subagents (${running} running)` : `Subagents (${subagents.length} finishing\u2026)`;
|
|
30152
|
-
return /* @__PURE__ */
|
|
30153
|
-
|
|
29637
|
+
return /* @__PURE__ */ jsxs45(
|
|
29638
|
+
Box40,
|
|
30154
29639
|
{
|
|
30155
29640
|
flexDirection: "column",
|
|
30156
29641
|
borderStyle: "round",
|
|
@@ -30160,25 +29645,25 @@ var SubagentsPanel = ({ subagents, mainAreaWidth }) => {
|
|
|
30160
29645
|
marginTop: 1,
|
|
30161
29646
|
width: Math.min(mainAreaWidth, 80),
|
|
30162
29647
|
children: [
|
|
30163
|
-
/* @__PURE__ */ jsx50(
|
|
30164
|
-
subagents.map((entry) => /* @__PURE__ */
|
|
30165
|
-
/* @__PURE__ */
|
|
30166
|
-
/* @__PURE__ */ jsx50(
|
|
30167
|
-
/* @__PURE__ */
|
|
29648
|
+
/* @__PURE__ */ jsx50(Box40, { paddingX: 1, children: /* @__PURE__ */ jsx50(Text48, { bold: true, color: theme.text.accent, children: title }) }),
|
|
29649
|
+
subagents.map((entry) => /* @__PURE__ */ jsxs45(Box40, { flexDirection: "column", paddingX: 1, children: [
|
|
29650
|
+
/* @__PURE__ */ jsxs45(Box40, { flexDirection: "row", gap: 1, children: [
|
|
29651
|
+
/* @__PURE__ */ jsx50(Text48, { color: statusColor(entry), children: statusIcon(entry) }),
|
|
29652
|
+
/* @__PURE__ */ jsxs45(Text48, { wrap: "truncate", color: theme.text.primary, children: [
|
|
30168
29653
|
entry.prompt,
|
|
30169
29654
|
entry.prompt.length >= 50 ? "\u2026" : ""
|
|
30170
29655
|
] })
|
|
30171
29656
|
] }),
|
|
30172
|
-
entry.status === "running" && entry.currentTool && /* @__PURE__ */
|
|
29657
|
+
entry.status === "running" && entry.currentTool && /* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, dimColor: true, children: [
|
|
30173
29658
|
" ",
|
|
30174
29659
|
"using ",
|
|
30175
29660
|
entry.currentTool
|
|
30176
29661
|
] }),
|
|
30177
|
-
entry.status === "running" && !entry.currentTool && entry.currentOutput && /* @__PURE__ */
|
|
29662
|
+
entry.status === "running" && !entry.currentTool && entry.currentOutput && /* @__PURE__ */ jsxs45(Text48, { color: theme.text.secondary, dimColor: true, wrap: "truncate", children: [
|
|
30178
29663
|
" ",
|
|
30179
29664
|
entry.currentOutput.trimStart()
|
|
30180
29665
|
] }),
|
|
30181
|
-
entry.status === "failed" && entry.error && /* @__PURE__ */
|
|
29666
|
+
entry.status === "failed" && entry.error && /* @__PURE__ */ jsxs45(Text48, { color: theme.status.error, dimColor: true, wrap: "truncate", children: [
|
|
30182
29667
|
" ",
|
|
30183
29668
|
entry.error.slice(0, 60)
|
|
30184
29669
|
] })
|
|
@@ -30443,8 +29928,6 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
30443
29928
|
const [isReceivingContent, setIsReceivingContent] = useState30(false);
|
|
30444
29929
|
const [iterationInfo, setIterationInfo] = useState30(null);
|
|
30445
29930
|
const [liveToolCalls, setLiveToolCalls] = useState30([]);
|
|
30446
|
-
const [taskPlan, setTaskPlan] = useState30(null);
|
|
30447
|
-
const [taskStreams, setTaskStreams] = useState30({});
|
|
30448
29931
|
const [recentSlashCommandsState, setRecentSlashCommandsState] = useState30(/* @__PURE__ */ new Map());
|
|
30449
29932
|
const [activeDialog, setActiveDialog] = useState30(null);
|
|
30450
29933
|
const [themeName, setThemeName] = useState30("(unknown)");
|
|
@@ -30473,7 +29956,6 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
30473
29956
|
const runStartedAtRef = useRef18(null);
|
|
30474
29957
|
const streamingResponseLengthRef = useRef18(0);
|
|
30475
29958
|
const pendingTextBufferRef = useRef18("");
|
|
30476
|
-
const taskStreamsBufferRef = useRef18({});
|
|
30477
29959
|
const liveToolCallsBufferRef = useRef18([]);
|
|
30478
29960
|
const subagentChunkBufferRef = useRef18(/* @__PURE__ */ new Map());
|
|
30479
29961
|
const subagentToolBufferRef = useRef18([]);
|
|
@@ -30764,18 +30246,6 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
30764
30246
|
pendingTextBufferRef.current = "";
|
|
30765
30247
|
setPendingAssistantText((prev) => prev + text);
|
|
30766
30248
|
}
|
|
30767
|
-
const taskBuf = taskStreamsBufferRef.current;
|
|
30768
|
-
const taskKeys = Object.keys(taskBuf);
|
|
30769
|
-
if (taskKeys.length > 0) {
|
|
30770
|
-
taskStreamsBufferRef.current = {};
|
|
30771
|
-
setTaskStreams((prev) => {
|
|
30772
|
-
const next = { ...prev };
|
|
30773
|
-
for (const taskId of taskKeys) {
|
|
30774
|
-
next[taskId] = (next[taskId] ?? "") + taskBuf[taskId];
|
|
30775
|
-
}
|
|
30776
|
-
return next;
|
|
30777
|
-
});
|
|
30778
|
-
}
|
|
30779
30249
|
const activities = liveToolCallsBufferRef.current;
|
|
30780
30250
|
if (activities.length > 0) {
|
|
30781
30251
|
liveToolCallsBufferRef.current = [];
|
|
@@ -31055,7 +30525,6 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31055
30525
|
lastSubmittedPromptRef.current = prompt;
|
|
31056
30526
|
setPromptSuggestion(null);
|
|
31057
30527
|
pendingTextBufferRef.current = "";
|
|
31058
|
-
taskStreamsBufferRef.current = {};
|
|
31059
30528
|
liveToolCallsBufferRef.current = [];
|
|
31060
30529
|
subagentChunkBufferRef.current = /* @__PURE__ */ new Map();
|
|
31061
30530
|
setPendingAssistantText("");
|
|
@@ -31063,8 +30532,6 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31063
30532
|
setIsReceivingContent(false);
|
|
31064
30533
|
streamingResponseLengthRef.current = 0;
|
|
31065
30534
|
setLiveToolCalls([]);
|
|
31066
|
-
setTaskPlan(null);
|
|
31067
|
-
setTaskStreams({});
|
|
31068
30535
|
setIterationInfo(null);
|
|
31069
30536
|
const startIndex = session.messages.length;
|
|
31070
30537
|
const isFirstTurn = startIndex === 0;
|
|
@@ -31081,11 +30548,6 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31081
30548
|
pendingTextBufferRef.current += text;
|
|
31082
30549
|
setIsReceivingContent(true);
|
|
31083
30550
|
},
|
|
31084
|
-
onChunkForTask: (taskId, text) => {
|
|
31085
|
-
streamingResponseLengthRef.current += text.length;
|
|
31086
|
-
taskStreamsBufferRef.current[taskId] = (taskStreamsBufferRef.current[taskId] ?? "") + text;
|
|
31087
|
-
setIsReceivingContent(true);
|
|
31088
|
-
},
|
|
31089
30551
|
onUsage: (inputTokens, outputTokens) => {
|
|
31090
30552
|
setLastPromptTokenCount(inputTokens);
|
|
31091
30553
|
setLastOutputTokenCount(outputTokens);
|
|
@@ -31094,14 +30556,6 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31094
30556
|
setIterationInfo({ round, max });
|
|
31095
30557
|
liveToolCallsBufferRef.current = [];
|
|
31096
30558
|
setLiveToolCalls([]);
|
|
31097
|
-
},
|
|
31098
|
-
onTaskUpdate: (_task, plan) => {
|
|
31099
|
-
setTaskPlan({
|
|
31100
|
-
objective: plan.objective,
|
|
31101
|
-
tasks: plan.tasks.map((task) => ({ ...task })),
|
|
31102
|
-
currentTaskId: plan.currentTaskId,
|
|
31103
|
-
raw: plan.raw
|
|
31104
|
-
});
|
|
31105
30559
|
}
|
|
31106
30560
|
});
|
|
31107
30561
|
const newMessages = session.messages.slice(startIndex);
|
|
@@ -31142,14 +30596,11 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31142
30596
|
} finally {
|
|
31143
30597
|
abortRef.current = null;
|
|
31144
30598
|
pendingTextBufferRef.current = "";
|
|
31145
|
-
taskStreamsBufferRef.current = {};
|
|
31146
30599
|
liveToolCallsBufferRef.current = [];
|
|
31147
30600
|
subagentChunkBufferRef.current = /* @__PURE__ */ new Map();
|
|
31148
30601
|
setPendingAssistantText("");
|
|
31149
30602
|
setIsRunning(false);
|
|
31150
30603
|
setLiveToolCalls([]);
|
|
31151
|
-
setTaskPlan(null);
|
|
31152
|
-
setTaskStreams({});
|
|
31153
30604
|
setIterationInfo(null);
|
|
31154
30605
|
const sess = sessionRef.current;
|
|
31155
30606
|
if (sess) {
|
|
@@ -31954,37 +31405,37 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31954
31405
|
userMessages
|
|
31955
31406
|
]
|
|
31956
31407
|
);
|
|
31957
|
-
return /* @__PURE__ */ jsx51(CompactModeProvider, { value: { compactMode }, children: /* @__PURE__ */ jsx51(ConfigContext.Provider, { value: configAdapter, children: /* @__PURE__ */ jsx51(SettingsContext.Provider, { value: loadedSettings, children: /* @__PURE__ */ jsx51(StreamingContext.Provider, { value: streamingState, children: /* @__PURE__ */ jsx51(VimModeProvider, { initialVimEnabled: loadedSettings.merged.general?.vimMode ?? false, children: /* @__PURE__ */ jsx51(KeypressProvider, { kittyProtocolEnabled: false, config: configAdapter, children: /* @__PURE__ */ jsx51(ShellFocusContext.Provider, { value: true, children: /* @__PURE__ */ jsx51(AgentViewProvider, { children: /* @__PURE__ */ jsx51(BackgroundTaskViewProvider, { children: /* @__PURE__ */ jsx51(UIStateContext.Provider, { value: uiState, children: /* @__PURE__ */ jsx51(UIActionsContext.Provider, { value: uiActions, children: /* @__PURE__ */
|
|
31958
|
-
/* @__PURE__ */
|
|
31959
|
-
/* @__PURE__ */ jsx51(
|
|
31960
|
-
/* @__PURE__ */ jsx51(
|
|
31961
|
-
/* @__PURE__ */ jsx51(
|
|
31962
|
-
/* @__PURE__ */
|
|
31408
|
+
return /* @__PURE__ */ jsx51(CompactModeProvider, { value: { compactMode }, children: /* @__PURE__ */ jsx51(ConfigContext.Provider, { value: configAdapter, children: /* @__PURE__ */ jsx51(SettingsContext.Provider, { value: loadedSettings, children: /* @__PURE__ */ jsx51(StreamingContext.Provider, { value: streamingState, children: /* @__PURE__ */ jsx51(VimModeProvider, { initialVimEnabled: loadedSettings.merged.general?.vimMode ?? false, children: /* @__PURE__ */ jsx51(KeypressProvider, { kittyProtocolEnabled: false, config: configAdapter, children: /* @__PURE__ */ jsx51(ShellFocusContext.Provider, { value: true, children: /* @__PURE__ */ jsx51(AgentViewProvider, { children: /* @__PURE__ */ jsx51(BackgroundTaskViewProvider, { children: /* @__PURE__ */ jsx51(UIStateContext.Provider, { value: uiState, children: /* @__PURE__ */ jsx51(UIActionsContext.Provider, { value: uiActions, children: /* @__PURE__ */ jsxs46(Box41, { flexDirection: "column", flexGrow: 1, children: [
|
|
31409
|
+
/* @__PURE__ */ jsxs46(Box41, { marginLeft: 2, marginRight: 2, marginTop: 1, marginBottom: 1, children: [
|
|
31410
|
+
/* @__PURE__ */ jsx51(Text49, { bold: true, color: theme.text.accent, children: "DeepCode" }),
|
|
31411
|
+
/* @__PURE__ */ jsx51(Text49, { color: theme.text.secondary, children: " Target: " }),
|
|
31412
|
+
/* @__PURE__ */ jsx51(Text49, { color: theme.text.primary, children: providerLabel }),
|
|
31413
|
+
/* @__PURE__ */ jsxs46(Text49, { color: theme.text.secondary, children: [
|
|
31963
31414
|
" (",
|
|
31964
31415
|
targetSource,
|
|
31965
31416
|
")"
|
|
31966
31417
|
] }),
|
|
31967
|
-
/* @__PURE__ */ jsx51(
|
|
31418
|
+
/* @__PURE__ */ jsx51(Text49, { color: theme.text.secondary, children: " Mode: " }),
|
|
31968
31419
|
/* @__PURE__ */ jsx51(
|
|
31969
|
-
|
|
31420
|
+
Text49,
|
|
31970
31421
|
{
|
|
31971
31422
|
bold: true,
|
|
31972
31423
|
color: agentMode === "build" ? theme.status.success : theme.status.warning,
|
|
31973
31424
|
children: agentMode.toUpperCase()
|
|
31974
31425
|
}
|
|
31975
31426
|
),
|
|
31976
|
-
/* @__PURE__ */
|
|
31427
|
+
/* @__PURE__ */ jsxs46(Text49, { color: theme.text.secondary, children: [
|
|
31977
31428
|
" ",
|
|
31978
31429
|
streamingState === "responding" ? "running" : streamingState === "waiting_for_confirmation" ? "waiting-approval" : "idle"
|
|
31979
31430
|
] }),
|
|
31980
|
-
iterationInfo && /* @__PURE__ */
|
|
31431
|
+
iterationInfo && /* @__PURE__ */ jsxs46(Text49, { color: theme.text.secondary, children: [
|
|
31981
31432
|
" ",
|
|
31982
31433
|
"iter ",
|
|
31983
31434
|
iterationInfo.round,
|
|
31984
31435
|
"/",
|
|
31985
31436
|
iterationInfo.max
|
|
31986
31437
|
] }),
|
|
31987
|
-
lastPromptTokenCount > 0 && /* @__PURE__ */
|
|
31438
|
+
lastPromptTokenCount > 0 && /* @__PURE__ */ jsxs46(Text49, { color: theme.text.secondary, children: [
|
|
31988
31439
|
" ",
|
|
31989
31440
|
"\u2191",
|
|
31990
31441
|
formatTokenCount(lastPromptTokenCount),
|
|
@@ -31992,7 +31443,7 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
31992
31443
|
formatTokenCount(lastOutputTokenCount)
|
|
31993
31444
|
] })
|
|
31994
31445
|
] }),
|
|
31995
|
-
initError ? /* @__PURE__ */ jsx51(
|
|
31446
|
+
initError ? /* @__PURE__ */ jsx51(Box41, { marginLeft: 2, marginRight: 2, children: /* @__PURE__ */ jsxs46(Text49, { color: theme.status.error, children: [
|
|
31996
31447
|
"Failed to initialize runtime: ",
|
|
31997
31448
|
initError
|
|
31998
31449
|
] }) }) : /* @__PURE__ */ jsx51(
|
|
@@ -32002,14 +31453,12 @@ var AppContainer = ({ cwd, config, provider, model, resumeSessionId }) => {
|
|
|
32002
31453
|
historyRemountKey,
|
|
32003
31454
|
pendingAssistantText,
|
|
32004
31455
|
liveToolCalls,
|
|
32005
|
-
taskPlan,
|
|
32006
|
-
taskStreams,
|
|
32007
31456
|
terminalWidth,
|
|
32008
31457
|
mainAreaWidth,
|
|
32009
31458
|
isFocused: approvalQueue.length === 0
|
|
32010
31459
|
}
|
|
32011
31460
|
),
|
|
32012
|
-
approvalQueue.length > 0 && /* @__PURE__ */ jsx51(
|
|
31461
|
+
approvalQueue.length > 0 && /* @__PURE__ */ jsx51(Box41, { marginLeft: 2, marginRight: 2, marginTop: 1, children: /* @__PURE__ */ jsx51(ApprovalPrompt, { request: approvalQueue[0] }) }),
|
|
32013
31462
|
dialogModel && /* @__PURE__ */ jsx51(CommandDialog, { title: dialogModel.title, lines: dialogModel.lines }),
|
|
32014
31463
|
activeDialog === "provider" && /* @__PURE__ */ jsx51(
|
|
32015
31464
|
ProviderDialog,
|
|
@@ -32217,22 +31666,22 @@ function formatAuthSummary(config) {
|
|
|
32217
31666
|
var ApprovalPrompt = ({ request }) => {
|
|
32218
31667
|
if (!request) return null;
|
|
32219
31668
|
const operationLabel = formatApprovalOperationLabel(request);
|
|
32220
|
-
return /* @__PURE__ */
|
|
32221
|
-
/* @__PURE__ */
|
|
31669
|
+
return /* @__PURE__ */ jsxs46(Box41, { flexDirection: "column", marginTop: 1, children: [
|
|
31670
|
+
/* @__PURE__ */ jsxs46(Text49, { color: theme.status.warning, children: [
|
|
32222
31671
|
"\u26A0 Allow ",
|
|
32223
31672
|
operationLabel,
|
|
32224
31673
|
"?"
|
|
32225
31674
|
] }),
|
|
32226
|
-
request.path && /* @__PURE__ */
|
|
31675
|
+
request.path && /* @__PURE__ */ jsxs46(Text49, { color: theme.text.secondary, children: [
|
|
32227
31676
|
" ",
|
|
32228
31677
|
request.path
|
|
32229
31678
|
] }),
|
|
32230
|
-
request.preview?.command && /* @__PURE__ */
|
|
31679
|
+
request.preview?.command && /* @__PURE__ */ jsxs46(Text49, { color: theme.text.secondary, children: [
|
|
32231
31680
|
" $ ",
|
|
32232
31681
|
request.preview.command,
|
|
32233
31682
|
request.preview.args?.length ? ` ${request.preview.args.join(" ")}` : ""
|
|
32234
31683
|
] }),
|
|
32235
|
-
/* @__PURE__ */ jsx51(
|
|
31684
|
+
/* @__PURE__ */ jsx51(Text49, { color: theme.text.secondary, children: " [\u21B5/y] once [s] session [a] always [n] deny" })
|
|
32236
31685
|
] });
|
|
32237
31686
|
};
|
|
32238
31687
|
function formatApprovalOperationLabel(request) {
|