@kimbho/kimbho-cli 0.1.22 → 0.1.23

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.cjs CHANGED
@@ -12718,7 +12718,7 @@ function createCompletionRuntimeCommand(program2) {
12718
12718
  // package.json
12719
12719
  var package_default = {
12720
12720
  name: "@kimbho/kimbho-cli",
12721
- version: "0.1.22",
12721
+ version: "0.1.23",
12722
12722
  description: "Kimbho CLI is a terminal-native coding agent for planning, execution, and verification.",
12723
12723
  type: "module",
12724
12724
  engines: {
@@ -34255,11 +34255,20 @@ ${truncateForModel(customAgentMemory)}`);
34255
34255
  sessionId,
34256
34256
  taskId: task.id,
34257
34257
  agentRole: task.agentRole,
34258
- message: `Step budget exhausted after ${maxSteps} steps.`
34258
+ message: task.agentRole !== "test-debugger" ? `Step budget exhausted after ${maxSteps} steps; handing task to test-debugger.` : `Step budget exhausted after ${maxSteps} steps; debugger escalation exhausted.`
34259
34259
  });
34260
+ if (task.agentRole !== "test-debugger") {
34261
+ return {
34262
+ status: "handoff",
34263
+ summary: `Autonomous executor reached the step limit (${maxSteps}) for ${task.id}; handing off to test-debugger.`,
34264
+ toolResults,
34265
+ artifacts: Array.from(artifacts),
34266
+ usage: usageTotals
34267
+ };
34268
+ }
34260
34269
  return {
34261
- status: "paused",
34262
- summary: `Autonomous executor reached the step limit (${maxSteps}) for ${task.id}.`,
34270
+ status: "blocked",
34271
+ summary: `Autonomous executor reached the step limit (${maxSteps}) for ${task.id}; debugger escalation exhausted.`,
34263
34272
  toolResults,
34264
34273
  artifacts: Array.from(artifacts),
34265
34274
  usage: usageTotals
@@ -43848,6 +43857,9 @@ async function renderCustomAgents(cwd) {
43848
43857
  // src/shell.ts
43849
43858
  var AMBER = "\x1B[38;5;214m";
43850
43859
  var CYAN = "\x1B[38;5;45m";
43860
+ var RED = "\x1B[38;5;203m";
43861
+ var SHIMMER_HEAD = "\x1B[38;5;230m";
43862
+ var SHIMMER_TAIL = "\x1B[38;5;223m";
43851
43863
  var BOLD = "\x1B[1m";
43852
43864
  var DIM = "\x1B[2m";
43853
43865
  var RESET = "\x1B[0m";
@@ -43908,7 +43920,9 @@ var MAX_CHAT_MESSAGES = 12;
43908
43920
  var MAX_CHAT_CONTEXT_CHARS = 8e3;
43909
43921
  var CHAT_COMPACTION_TAIL_MESSAGES = 6;
43910
43922
  var DEFAULT_MAX_AUTO_TASKS = 3;
43923
+ var UNBOUNDED_MAX_AUTO_TASKS = Number.MAX_SAFE_INTEGER;
43911
43924
  var DEFAULT_MAX_AGENT_STEPS = 8;
43925
+ var UNBOUNDED_MAX_AGENT_STEPS = 128;
43912
43926
  var DEFAULT_MAX_REPAIR_ATTEMPTS2 = 2;
43913
43927
  var SPINNER_FRAMES = [
43914
43928
  "-",
@@ -43927,6 +43941,24 @@ var IDLE_STATUS_LABELS = [
43927
43941
  function color(code, value) {
43928
43942
  return `${code}${value}${RESET}`;
43929
43943
  }
43944
+ function renderShimmeringLabel(label, frameIndex) {
43945
+ const characters = Array.from(label);
43946
+ if (characters.length === 0) {
43947
+ return color(BOLD, label);
43948
+ }
43949
+ const shimmerWidth = Math.min(4, characters.length + 1);
43950
+ const head = frameIndex % (characters.length + shimmerWidth);
43951
+ return characters.map((character, index) => {
43952
+ const distance = head - index;
43953
+ if (distance === 0) {
43954
+ return `${BOLD}${SHIMMER_HEAD}${character}${RESET}`;
43955
+ }
43956
+ if (distance > 0 && distance < shimmerWidth) {
43957
+ return `${BOLD}${SHIMMER_TAIL}${character}${RESET}`;
43958
+ }
43959
+ return `${BOLD}${character}${RESET}`;
43960
+ }).join("");
43961
+ }
43930
43962
  function readRuntimeOverrideEntries() {
43931
43963
  const raw = import_node_process26.default.env[KIMBHO_RUNTIME_OVERRIDES_ENV];
43932
43964
  if (!raw || raw.trim().length === 0) {
@@ -43991,6 +44023,12 @@ function shouldAutoStartApprovedRuns(runtime) {
43991
44023
  const approvalMode = resolveRuntimeOverrideApprovalMode(runtime);
43992
44024
  return approvalMode === "auto" || approvalMode === "dontAsk" || approvalMode === "acceptEdits" || approvalMode === "bypassPermissions";
43993
44025
  }
44026
+ function resolveShellMaxAutoTasks(runtime) {
44027
+ return shouldAutoStartApprovedRuns(runtime) ? UNBOUNDED_MAX_AUTO_TASKS : DEFAULT_MAX_AUTO_TASKS;
44028
+ }
44029
+ function resolveShellMaxAgentSteps(runtime) {
44030
+ return shouldAutoStartApprovedRuns(runtime) ? UNBOUNDED_MAX_AGENT_STEPS : DEFAULT_MAX_AGENT_STEPS;
44031
+ }
43994
44032
  function normalizeApprovalMode(value) {
43995
44033
  const normalized = value.trim().toLowerCase();
43996
44034
  if (normalized === "manual" || normalized === "default") {
@@ -44151,6 +44189,9 @@ var ShellActivityIndicator = class {
44151
44189
  this.interval.unref?.();
44152
44190
  }
44153
44191
  update(label) {
44192
+ if (label !== this.label) {
44193
+ this.frameIndex = 0;
44194
+ }
44154
44195
  this.label = label;
44155
44196
  if (this.interval) {
44156
44197
  this.render();
@@ -44181,7 +44222,7 @@ var ShellActivityIndicator = class {
44181
44222
  return;
44182
44223
  }
44183
44224
  const frame = color(AMBER, SPINNER_FRAMES[this.frameIndex]);
44184
- const status = color(BOLD, this.label);
44225
+ const status = renderShimmeringLabel(this.label, this.frameIndex);
44185
44226
  const raw = `${frame} ${status}${color(DIM, "...")}`;
44186
44227
  this.clear();
44187
44228
  (0, import_node_readline2.cursorTo)(import_node_process26.default.stdout, 0);
@@ -44667,13 +44708,13 @@ function renderShellPlanSummary(plan) {
44667
44708
  }
44668
44709
  return lines;
44669
44710
  }
44670
- function renderPendingRunProposal(proposal) {
44711
+ function renderPendingRunProposal(proposal, options = {}) {
44671
44712
  const lines = [
44672
44713
  `${color(BOLD, proposal.source === "queued" ? "Queued Plan Ready" : "Ready To Run")}`,
44673
44714
  ...renderShellPlanSummary(proposal.plan),
44674
44715
  "",
44675
44716
  color(DIM, `saved plan: ${proposal.planPath}`),
44676
- "next: /approve to start, /run revise <feedback> to adjust, /run cancel to drop it"
44717
+ options.autoStart ? color(DIM, "next: auto-starting in the current permission mode") : "next: /approve to start, /run revise <feedback> to adjust, /run cancel to drop it"
44677
44718
  ];
44678
44719
  if (proposal.source === "queued") {
44679
44720
  lines.splice(1, 0, color(DIM, "The next queued request has been planned and is waiting for your approval."));
@@ -44734,8 +44775,12 @@ function renderShellSessionSummary(snapshot, planPath, sessionPath) {
44734
44775
  lines.push(color(DIM, `saved session: ${sessionPath}`));
44735
44776
  if (snapshot.pendingApprovals.length > 0) {
44736
44777
  lines.push("next: /approve to continue, /deny to stop");
44737
- } else {
44778
+ } else if (snapshot.status === "paused" || snapshot.status === "running" || snapshot.status === "ready") {
44738
44779
  lines.push("next: /resume to continue a paused run or start another request");
44780
+ } else if (snapshot.status === "blocked") {
44781
+ lines.push("next: review the blocker or start another request");
44782
+ } else {
44783
+ lines.push("next: start another request");
44739
44784
  }
44740
44785
  return lines.join("\n");
44741
44786
  }
@@ -44777,7 +44822,10 @@ function renderLiveExecutionEvent(event, board, startedAt) {
44777
44822
  ];
44778
44823
  case "task-finished":
44779
44824
  return [
44780
- `${color(event.status === "completed" ? CYAN : AMBER, event.status === "completed" ? "Completed" : event.status === "awaiting-approval" ? "Paused" : "Updated")} ${simplifyExecutionSummary(event.summary) || event.taskId}`,
44825
+ `${color(
44826
+ event.status === "completed" ? CYAN : event.status === "blocked" ? RED : AMBER,
44827
+ event.status === "completed" ? "Completed" : event.status === "awaiting-approval" ? "Paused" : event.status === "handoff" ? "Rerouting" : event.status === "blocked" ? "Blocked" : "Updated"
44828
+ )} ${simplifyExecutionSummary(event.summary) || event.taskId}`,
44781
44829
  ...renderConciseProgress(board, startedAt)
44782
44830
  ];
44783
44831
  case "task-note":
@@ -45128,7 +45176,12 @@ async function prepareRunProposal(cwd, goal, runtime, options = {}) {
45128
45176
  feedback: options.feedback ?? [],
45129
45177
  source: options.source ?? "direct"
45130
45178
  };
45131
- console.log(renderPendingRunProposal(runtime.pendingRunProposal).join("\n"));
45179
+ console.log(renderPendingRunProposal(
45180
+ runtime.pendingRunProposal,
45181
+ {
45182
+ autoStart: shouldAutoStartApprovedRuns(runtime)
45183
+ }
45184
+ ).join("\n"));
45132
45185
  return request.cwd;
45133
45186
  }
45134
45187
  async function executePendingRunProposal(runtime) {
@@ -45150,8 +45203,8 @@ async function executePendingRunProposal(runtime) {
45150
45203
  proposal.goal,
45151
45204
  request,
45152
45205
  proposal.plan,
45153
- DEFAULT_MAX_AUTO_TASKS,
45154
- DEFAULT_MAX_AGENT_STEPS,
45206
+ resolveShellMaxAutoTasks(runtime),
45207
+ resolveShellMaxAgentSteps(runtime),
45155
45208
  DEFAULT_MAX_REPAIR_ATTEMPTS2
45156
45209
  );
45157
45210
  console.log(renderRunStartCard(liveBoard));
@@ -45161,8 +45214,8 @@ async function executePendingRunProposal(runtime) {
45161
45214
  let snapshot;
45162
45215
  try {
45163
45216
  snapshot = await new ExecutionOrchestrator().continueSession(proposal.snapshot, {
45164
- maxAutoTasks: DEFAULT_MAX_AUTO_TASKS,
45165
- maxAgentSteps: DEFAULT_MAX_AGENT_STEPS,
45217
+ maxAutoTasks: resolveShellMaxAutoTasks(runtime),
45218
+ maxAgentSteps: resolveShellMaxAgentSteps(runtime),
45166
45219
  maxRepairAttempts: DEFAULT_MAX_REPAIR_ATTEMPTS2,
45167
45220
  signal: controller.signal,
45168
45221
  onProgress: async (event) => {
@@ -45215,8 +45268,8 @@ async function resumeGoalExecution(cwd, runtime) {
45215
45268
  session.goal,
45216
45269
  session.request,
45217
45270
  session.plan,
45218
- DEFAULT_MAX_AUTO_TASKS,
45219
- DEFAULT_MAX_AGENT_STEPS,
45271
+ resolveShellMaxAutoTasks(runtime),
45272
+ resolveShellMaxAgentSteps(runtime),
45220
45273
  DEFAULT_MAX_REPAIR_ATTEMPTS2
45221
45274
  );
45222
45275
  const controller = new AbortController();
@@ -45230,8 +45283,8 @@ async function resumeGoalExecution(cwd, runtime) {
45230
45283
  let snapshot;
45231
45284
  try {
45232
45285
  snapshot = await new ExecutionOrchestrator().continueSession(session, {
45233
- maxAutoTasks: DEFAULT_MAX_AUTO_TASKS,
45234
- maxAgentSteps: DEFAULT_MAX_AGENT_STEPS,
45286
+ maxAutoTasks: resolveShellMaxAutoTasks(runtime),
45287
+ maxAgentSteps: resolveShellMaxAgentSteps(runtime),
45235
45288
  maxRepairAttempts: DEFAULT_MAX_REPAIR_ATTEMPTS2,
45236
45289
  signal: controller.signal,
45237
45290
  onProgress: async (event) => {
@@ -45309,8 +45362,8 @@ async function resolvePendingApproval(cwd, runtime, decision, approvalId, option
45309
45362
  session.goal,
45310
45363
  session.request,
45311
45364
  session.plan,
45312
- DEFAULT_MAX_AUTO_TASKS,
45313
- DEFAULT_MAX_AGENT_STEPS,
45365
+ resolveShellMaxAutoTasks(runtime),
45366
+ resolveShellMaxAgentSteps(runtime),
45314
45367
  DEFAULT_MAX_REPAIR_ATTEMPTS2
45315
45368
  );
45316
45369
  liveBoard.approvals = session.pendingApprovals.length;
@@ -45325,8 +45378,8 @@ async function resolvePendingApproval(cwd, runtime, decision, approvalId, option
45325
45378
  let snapshot;
45326
45379
  try {
45327
45380
  snapshot = await new ExecutionOrchestrator().continueSession(session, {
45328
- maxAutoTasks: DEFAULT_MAX_AUTO_TASKS,
45329
- maxAgentSteps: DEFAULT_MAX_AGENT_STEPS,
45381
+ maxAutoTasks: resolveShellMaxAutoTasks(runtime),
45382
+ maxAgentSteps: resolveShellMaxAgentSteps(runtime),
45330
45383
  maxRepairAttempts: DEFAULT_MAX_REPAIR_ATTEMPTS2,
45331
45384
  approvalDecisions: approvals.map((approval) => ({
45332
45385
  approvalId: approval.id,
@@ -46663,7 +46716,12 @@ async function handleShellCommand(cwd, input, state, runtime, execute) {
46663
46716
  if (head === "run" || head === "new" || head === "scaffold") {
46664
46717
  const subcommand = tokens[1]?.trim().toLowerCase();
46665
46718
  if (!tokens[1] && runtime.pendingRunProposal) {
46666
- console.log(renderPendingRunProposal(runtime.pendingRunProposal).join("\n"));
46719
+ console.log(renderPendingRunProposal(
46720
+ runtime.pendingRunProposal,
46721
+ {
46722
+ autoStart: shouldAutoStartApprovedRuns(runtime)
46723
+ }
46724
+ ).join("\n"));
46667
46725
  return cwd;
46668
46726
  }
46669
46727
  if (subcommand === "approve" || subcommand === "start" || subcommand === "execute") {