@tenux/cli 0.0.18 → 0.0.19
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/{chunk-QPS4CXAL.js → chunk-BMALGL6Q.js} +14 -8
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -4,6 +4,9 @@ import { homedir } from "os";
|
|
|
4
4
|
import { join } from "path";
|
|
5
5
|
var CONFIG_DIR = join(homedir(), ".tenux");
|
|
6
6
|
var CONFIG_FILE = join(CONFIG_DIR, "config.json");
|
|
7
|
+
function getConfigDir() {
|
|
8
|
+
return CONFIG_DIR;
|
|
9
|
+
}
|
|
7
10
|
function getConfigPath() {
|
|
8
11
|
return CONFIG_FILE;
|
|
9
12
|
}
|
|
@@ -234,16 +237,19 @@ async function handleClaudeQuery(command, supabase) {
|
|
|
234
237
|
} = command.payload;
|
|
235
238
|
if (!prompt) throw new Error("prompt is required");
|
|
236
239
|
const config = loadConfig();
|
|
237
|
-
|
|
240
|
+
const cwd = getConfigDir();
|
|
241
|
+
if (!existsSync2(config.projectsDir)) {
|
|
242
|
+
mkdirSync2(config.projectsDir, { recursive: true });
|
|
243
|
+
}
|
|
244
|
+
let contextHint = "";
|
|
238
245
|
if (project_path) {
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
|
|
246
|
+
const projectDir = resolve(config.projectsDir, project_path);
|
|
247
|
+
const relPath = `./projects/${project_path}`;
|
|
248
|
+
if (existsSync2(projectDir)) {
|
|
249
|
+
contextHint = `The user currently has the project "${project_path}" selected (at ${relPath}). This is likely the project they are referring to unless they say otherwise. All projects are under ./projects/.`;
|
|
242
250
|
}
|
|
243
251
|
}
|
|
244
|
-
|
|
245
|
-
mkdirSync2(cwd, { recursive: true });
|
|
246
|
-
}
|
|
252
|
+
const fullSystemPrompt = [contextHint, system_prompt].filter(Boolean).join("\n\n");
|
|
247
253
|
const args = [
|
|
248
254
|
"--print",
|
|
249
255
|
// non-interactive
|
|
@@ -257,7 +263,7 @@ async function handleClaudeQuery(command, supabase) {
|
|
|
257
263
|
if (effort) args.push("--effort", effort);
|
|
258
264
|
if (permission_mode) args.push("--permission-mode", permission_mode);
|
|
259
265
|
if (max_budget) args.push("--max-budget-usd", max_budget);
|
|
260
|
-
if (
|
|
266
|
+
if (fullSystemPrompt) args.push("--append-system-prompt", fullSystemPrompt);
|
|
261
267
|
if (session_id) args.push("--resume", session_id);
|
|
262
268
|
const isWindows = process.platform === "win32";
|
|
263
269
|
const claudeBin = isWindows ? "claude.cmd" : "claude";
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED