codesavant 1.2.0 → 1.2.2
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/cli.js +21 -13
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -5455,6 +5455,9 @@ var init_commands = __esm({
|
|
|
5455
5455
|
// src/cli.ts
|
|
5456
5456
|
import { Command } from "commander";
|
|
5457
5457
|
import chalk20 from "chalk";
|
|
5458
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
5459
|
+
import { fileURLToPath } from "url";
|
|
5460
|
+
import { dirname, join as join3 } from "path";
|
|
5458
5461
|
|
|
5459
5462
|
// src/config.ts
|
|
5460
5463
|
import fs from "fs-extra";
|
|
@@ -30130,7 +30133,7 @@ function InputBoxView({
|
|
|
30130
30133
|
] }),
|
|
30131
30134
|
/* @__PURE__ */ jsx4(Text4, { color: colors.primary, children: "Ctrl+C" }),
|
|
30132
30135
|
/* @__PURE__ */ jsx4(Text4, { color: colors.muted, children: " cancel" }),
|
|
30133
|
-
|
|
30136
|
+
permissionMode && /* @__PURE__ */ jsxs4(Fragment2, { children: [
|
|
30134
30137
|
/* @__PURE__ */ jsxs4(Text4, { color: colors.muted, children: [
|
|
30135
30138
|
" ",
|
|
30136
30139
|
icons.boxV,
|
|
@@ -30138,7 +30141,7 @@ function InputBoxView({
|
|
|
30138
30141
|
] }),
|
|
30139
30142
|
/* @__PURE__ */ jsxs4(Text4, { color: colors.info, children: [
|
|
30140
30143
|
"[",
|
|
30141
|
-
|
|
30144
|
+
permissionMode,
|
|
30142
30145
|
"]"
|
|
30143
30146
|
] })
|
|
30144
30147
|
] })
|
|
@@ -30171,7 +30174,7 @@ function App({
|
|
|
30171
30174
|
const lastEscapeRef = useRef(0);
|
|
30172
30175
|
const [renderedMessageCount, setRenderedMessageCount] = useState5(0);
|
|
30173
30176
|
const permissionModes = ["prompt", "auto-edit", "auto-full", "deny"];
|
|
30174
|
-
const [
|
|
30177
|
+
const [currentPermissionMode, setCurrentPermissionMode] = useState5(permissionMode);
|
|
30175
30178
|
useEffect2(() => {
|
|
30176
30179
|
if (sessionId2) actions.setSessionId(sessionId2);
|
|
30177
30180
|
if (provider && model) actions.setProvider(provider, model);
|
|
@@ -30251,7 +30254,7 @@ function App({
|
|
|
30251
30254
|
return;
|
|
30252
30255
|
}
|
|
30253
30256
|
if (key.shift && key.tab) {
|
|
30254
|
-
const currentIndex = permissionModes.indexOf(
|
|
30257
|
+
const currentIndex = permissionModes.indexOf(currentPermissionMode);
|
|
30255
30258
|
const nextIndex = (currentIndex + 1) % permissionModes.length;
|
|
30256
30259
|
const nextMode = permissionModes[nextIndex];
|
|
30257
30260
|
setCurrentPermissionMode(nextMode);
|
|
@@ -30425,7 +30428,7 @@ function App({
|
|
|
30425
30428
|
historyIndex: state.historyIndex,
|
|
30426
30429
|
onHistoryNavigate: handleHistoryNavigate,
|
|
30427
30430
|
theme,
|
|
30428
|
-
permissionMode:
|
|
30431
|
+
permissionMode: currentPermissionMode,
|
|
30429
30432
|
historySearchMode,
|
|
30430
30433
|
historySearchQuery,
|
|
30431
30434
|
historySearchMatch,
|
|
@@ -31990,13 +31993,13 @@ Type /help for available commands.`);
|
|
|
31990
31993
|
mcpTools: mcpToolCount,
|
|
31991
31994
|
workingDir: projectPath
|
|
31992
31995
|
});
|
|
31993
|
-
let
|
|
31996
|
+
let currentPermissionMode = agent.getPermissionManager().getMode();
|
|
31994
31997
|
appController = renderApp({
|
|
31995
31998
|
sessionId: sessionId2,
|
|
31996
31999
|
provider: defaultProvider?.name,
|
|
31997
32000
|
model: defaultProvider?.model,
|
|
31998
32001
|
welcomeMessage,
|
|
31999
|
-
permissionMode:
|
|
32002
|
+
permissionMode: currentPermissionMode,
|
|
32000
32003
|
onSubmit: (input) => {
|
|
32001
32004
|
if (!isProcessing) {
|
|
32002
32005
|
processAgentStream(input);
|
|
@@ -32032,7 +32035,7 @@ Type /help for available commands.`);
|
|
|
32032
32035
|
const validModes = ["prompt", "auto-edit", "auto-full", "deny"];
|
|
32033
32036
|
if (validModes.includes(mode)) {
|
|
32034
32037
|
agent.getPermissionManager().setMode(mode);
|
|
32035
|
-
|
|
32038
|
+
currentPermissionMode = mode;
|
|
32036
32039
|
}
|
|
32037
32040
|
}
|
|
32038
32041
|
});
|
|
@@ -32195,10 +32198,10 @@ async function detectCICommands(projectPath) {
|
|
|
32195
32198
|
const fs26 = await import("fs-extra");
|
|
32196
32199
|
const path27 = await import("path");
|
|
32197
32200
|
const commands = [];
|
|
32198
|
-
const
|
|
32199
|
-
if (await fs26.pathExists(
|
|
32201
|
+
const packageJsonPath2 = path27.join(projectPath, "package.json");
|
|
32202
|
+
if (await fs26.pathExists(packageJsonPath2)) {
|
|
32200
32203
|
try {
|
|
32201
|
-
const pkg = await fs26.readJson(
|
|
32204
|
+
const pkg = await fs26.readJson(packageJsonPath2);
|
|
32202
32205
|
if (pkg.scripts?.build) {
|
|
32203
32206
|
commands.push("npm run build");
|
|
32204
32207
|
}
|
|
@@ -32231,7 +32234,7 @@ async function detectCICommands(projectPath) {
|
|
|
32231
32234
|
if (await fs26.pathExists(path27.join(projectPath, "pyproject.toml")) || await fs26.pathExists(path27.join(projectPath, "setup.py"))) {
|
|
32232
32235
|
commands.push("python -m pytest");
|
|
32233
32236
|
}
|
|
32234
|
-
if (commands.length === 0 && await fs26.pathExists(
|
|
32237
|
+
if (commands.length === 0 && await fs26.pathExists(packageJsonPath2)) {
|
|
32235
32238
|
commands.push("npm run build");
|
|
32236
32239
|
}
|
|
32237
32240
|
return commands;
|
|
@@ -32327,6 +32330,11 @@ Fix all the issues to make the CI pass. Use the available tools to read files, e
|
|
|
32327
32330
|
}
|
|
32328
32331
|
|
|
32329
32332
|
// src/cli.ts
|
|
32333
|
+
var __filename = fileURLToPath(import.meta.url);
|
|
32334
|
+
var __dirname = dirname(__filename);
|
|
32335
|
+
var packageJsonPath = join3(__dirname, "..", "package.json");
|
|
32336
|
+
var packageJson = JSON.parse(readFileSync2(packageJsonPath, "utf-8"));
|
|
32337
|
+
var VERSION = packageJson.version;
|
|
32330
32338
|
var MAX_STDIN_SIZE = 10 * 1024 * 1024;
|
|
32331
32339
|
var MAX_STDIN_LINES = 1e5;
|
|
32332
32340
|
async function readStdinInput(format, options) {
|
|
@@ -32378,7 +32386,7 @@ async function readStdinInput(format, options) {
|
|
|
32378
32386
|
});
|
|
32379
32387
|
}
|
|
32380
32388
|
var program = new Command();
|
|
32381
|
-
program.name("codesavant").description("AI coding assistant for your terminal").version(
|
|
32389
|
+
program.name("codesavant").description("AI coding assistant for your terminal").version(VERSION).option("--verbose", "Enable verbose logging for debugging").option("--debug <categories>", 'Enable debug logging for specific categories (comma-separated: api,mcp,tool,provider,stream,session,context,permission,checkpoint,error,all). Use ! prefix to exclude: "all,!mcp"').option("--mcp-debug", "Enable MCP protocol-level debug logging").hook("preAction", (thisCommand) => {
|
|
32382
32390
|
const opts = thisCommand.opts();
|
|
32383
32391
|
if (opts.debug) {
|
|
32384
32392
|
setVerbose(true);
|