@kimbho/kimbho-cli 0.1.21 → 0.1.22
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 +54 -13
- package/dist/index.cjs.map +2 -2
- package/package.json +1 -1
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.
|
|
12721
|
+
version: "0.1.22",
|
|
12722
12722
|
description: "Kimbho CLI is a terminal-native coding agent for planning, execution, and verification.",
|
|
12723
12723
|
type: "module",
|
|
12724
12724
|
engines: {
|
|
@@ -38726,9 +38726,6 @@ var CHAT_PREFIXES = [
|
|
|
38726
38726
|
"when ",
|
|
38727
38727
|
"where ",
|
|
38728
38728
|
"who ",
|
|
38729
|
-
"can you ",
|
|
38730
|
-
"could you ",
|
|
38731
|
-
"would you ",
|
|
38732
38729
|
"should ",
|
|
38733
38730
|
"is ",
|
|
38734
38731
|
"are ",
|
|
@@ -38749,30 +38746,40 @@ var PLAN_PREFIXES = [
|
|
|
38749
38746
|
function looksLikeExecutionRequest(input) {
|
|
38750
38747
|
return /\b(build|create|make|scaffold|implement|fix|refactor|setup|set up|generate|add|change|update|edit|rewrite|restyle|redesign|improve|enhance)\b/.test(input);
|
|
38751
38748
|
}
|
|
38749
|
+
function stripConversationalLead(input) {
|
|
38750
|
+
let normalized = input.trim().toLowerCase();
|
|
38751
|
+
normalized = normalized.replace(/^(hi|hello|hey|yo|sup)\b[!,. ]*/u, "").trim();
|
|
38752
|
+
normalized = normalized.replace(/^(please|pls)\b[!,. ]*/u, "").trim();
|
|
38753
|
+
normalized = normalized.replace(/^(can you|could you|would you|will you)\b[,: ]*/u, "").trim();
|
|
38754
|
+
normalized = normalized.replace(/^(help me)\b[,: ]*/u, "").trim();
|
|
38755
|
+
normalized = normalized.replace(/^(i need you to)\b[,: ]*/u, "").trim();
|
|
38756
|
+
return normalized;
|
|
38757
|
+
}
|
|
38752
38758
|
function inferPromptIntent(input) {
|
|
38753
38759
|
const normalized = input.trim().toLowerCase();
|
|
38760
|
+
const taskCandidate = stripConversationalLead(normalized);
|
|
38754
38761
|
if (!normalized) {
|
|
38755
38762
|
return "chat";
|
|
38756
38763
|
}
|
|
38757
|
-
if (
|
|
38764
|
+
if (!taskCandidate) {
|
|
38758
38765
|
return "chat";
|
|
38759
38766
|
}
|
|
38760
|
-
if (PLAN_PREFIXES.some((prefix) =>
|
|
38767
|
+
if (PLAN_PREFIXES.some((prefix) => taskCandidate.startsWith(prefix))) {
|
|
38761
38768
|
return "plan";
|
|
38762
38769
|
}
|
|
38763
|
-
if (EXECUTION_PREFIXES.some((prefix) =>
|
|
38770
|
+
if (EXECUTION_PREFIXES.some((prefix) => taskCandidate.startsWith(prefix))) {
|
|
38764
38771
|
return "run";
|
|
38765
38772
|
}
|
|
38766
|
-
if (looksLikeExecutionRequest(
|
|
38773
|
+
if (looksLikeExecutionRequest(taskCandidate)) {
|
|
38767
38774
|
return "run";
|
|
38768
38775
|
}
|
|
38769
38776
|
if (normalized.endsWith("?")) {
|
|
38770
38777
|
return "chat";
|
|
38771
38778
|
}
|
|
38772
|
-
if (CHAT_PREFIXES.some((prefix) =>
|
|
38779
|
+
if (CHAT_PREFIXES.some((prefix) => taskCandidate.startsWith(prefix))) {
|
|
38773
38780
|
return "chat";
|
|
38774
38781
|
}
|
|
38775
|
-
return
|
|
38782
|
+
return taskCandidate.split(/\s+/).length >= 4 ? "plan" : "chat";
|
|
38776
38783
|
}
|
|
38777
38784
|
function normalizePlanPrompt(input) {
|
|
38778
38785
|
const trimmed = input.trim();
|
|
@@ -43963,6 +43970,27 @@ function syncShellRuntimeOverrides(runtime) {
|
|
|
43963
43970
|
}
|
|
43964
43971
|
import_node_process26.default.env[KIMBHO_RUNTIME_OVERRIDES_ENV] = JSON.stringify(merged);
|
|
43965
43972
|
}
|
|
43973
|
+
function resolveRuntimeOverrideApprovalMode(runtime) {
|
|
43974
|
+
if (runtime.sessionApprovalModeOverride) {
|
|
43975
|
+
return runtime.sessionApprovalModeOverride;
|
|
43976
|
+
}
|
|
43977
|
+
for (let index = runtime.baseRuntimeOverrides.length - 1; index >= 0; index -= 1) {
|
|
43978
|
+
const entry = runtime.baseRuntimeOverrides[index];
|
|
43979
|
+
if (entry?.path !== "approvalMode" || typeof entry.value !== "string") {
|
|
43980
|
+
continue;
|
|
43981
|
+
}
|
|
43982
|
+
try {
|
|
43983
|
+
return normalizeApprovalMode(entry.value);
|
|
43984
|
+
} catch {
|
|
43985
|
+
return null;
|
|
43986
|
+
}
|
|
43987
|
+
}
|
|
43988
|
+
return null;
|
|
43989
|
+
}
|
|
43990
|
+
function shouldAutoStartApprovedRuns(runtime) {
|
|
43991
|
+
const approvalMode = resolveRuntimeOverrideApprovalMode(runtime);
|
|
43992
|
+
return approvalMode === "auto" || approvalMode === "dontAsk" || approvalMode === "acceptEdits" || approvalMode === "bypassPermissions";
|
|
43993
|
+
}
|
|
43966
43994
|
function normalizeApprovalMode(value) {
|
|
43967
43995
|
const normalized = value.trim().toLowerCase();
|
|
43968
43996
|
if (normalized === "manual" || normalized === "default") {
|
|
@@ -44930,6 +44958,10 @@ async function drainQueuedWork(runtime) {
|
|
|
44930
44958
|
source: "queued"
|
|
44931
44959
|
});
|
|
44932
44960
|
runtime.currentCwd = nextCwd;
|
|
44961
|
+
if (shouldAutoStartApprovedRuns(runtime)) {
|
|
44962
|
+
console.log(color(DIM, "Auto-starting queued request in the current permission mode."));
|
|
44963
|
+
startPendingRunExecution(runtime);
|
|
44964
|
+
}
|
|
44933
44965
|
} else if (next.kind === "resume") {
|
|
44934
44966
|
await resumeGoalExecution(next.cwd, runtime);
|
|
44935
44967
|
} else {
|
|
@@ -46501,9 +46533,14 @@ async function handleShellCommand(cwd, input, state, runtime, execute) {
|
|
|
46501
46533
|
if (runtime.activeExecution || runtime.queueDrainPromise || runtime.pendingRunProposal) {
|
|
46502
46534
|
queuePlannerRequest(cwd, trimmed, runtime, "run");
|
|
46503
46535
|
} else {
|
|
46504
|
-
|
|
46536
|
+
const nextCwd = await prepareRunProposal(cwd, trimmed, runtime, {
|
|
46505
46537
|
source: "direct"
|
|
46506
46538
|
});
|
|
46539
|
+
if (shouldAutoStartApprovedRuns(runtime)) {
|
|
46540
|
+
console.log(color(DIM, "Auto-starting in the current permission mode."));
|
|
46541
|
+
startPendingRunExecution(runtime);
|
|
46542
|
+
}
|
|
46543
|
+
return nextCwd;
|
|
46507
46544
|
}
|
|
46508
46545
|
return cwd;
|
|
46509
46546
|
}
|
|
@@ -46658,10 +46695,14 @@ async function handleShellCommand(cwd, input, state, runtime, execute) {
|
|
|
46658
46695
|
queuePlannerRequest(cwd, goal, runtime, "run");
|
|
46659
46696
|
return cwd;
|
|
46660
46697
|
}
|
|
46661
|
-
await prepareRunProposal(cwd, goal, runtime, {
|
|
46698
|
+
const nextCwd = await prepareRunProposal(cwd, goal, runtime, {
|
|
46662
46699
|
source: "direct"
|
|
46663
46700
|
});
|
|
46664
|
-
|
|
46701
|
+
if (shouldAutoStartApprovedRuns(runtime)) {
|
|
46702
|
+
console.log(color(DIM, "Auto-starting in the current permission mode."));
|
|
46703
|
+
startPendingRunExecution(runtime);
|
|
46704
|
+
}
|
|
46705
|
+
return nextCwd;
|
|
46665
46706
|
}
|
|
46666
46707
|
if (head === "plan") {
|
|
46667
46708
|
if (!isSlashCommand) {
|