@tenux/cli 0.0.18 → 0.0.20
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-PNQQWSNW.js} +16 -9
- 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,20 @@ 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 focusPrefix = "";
|
|
238
245
|
if (project_path) {
|
|
239
|
-
const
|
|
240
|
-
if (
|
|
241
|
-
|
|
246
|
+
const projectDir = resolve(config.projectsDir, project_path);
|
|
247
|
+
if (existsSync2(projectDir)) {
|
|
248
|
+
focusPrefix = `>> focused: ./projects/${project_path}
|
|
249
|
+
`;
|
|
242
250
|
}
|
|
243
251
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
}
|
|
252
|
+
const baseSystemPrompt = `You are working inside a Tenux workspace at ${cwd}. All projects live under ./projects/. User messages may start with ">> focused: ./projects/<name>" \u2014 this indicates which project the user is currently viewing. Treat it as context for which project changes likely apply to, unless the user explicitly says otherwise. Never echo the ">>" line back to the user.`;
|
|
253
|
+
const fullSystemPrompt = [baseSystemPrompt, system_prompt].filter(Boolean).join("\n\n");
|
|
247
254
|
const args = [
|
|
248
255
|
"--print",
|
|
249
256
|
// non-interactive
|
|
@@ -257,7 +264,7 @@ async function handleClaudeQuery(command, supabase) {
|
|
|
257
264
|
if (effort) args.push("--effort", effort);
|
|
258
265
|
if (permission_mode) args.push("--permission-mode", permission_mode);
|
|
259
266
|
if (max_budget) args.push("--max-budget-usd", max_budget);
|
|
260
|
-
if (
|
|
267
|
+
if (fullSystemPrompt) args.push("--append-system-prompt", fullSystemPrompt);
|
|
261
268
|
if (session_id) args.push("--resume", session_id);
|
|
262
269
|
const isWindows = process.platform === "win32";
|
|
263
270
|
const claudeBin = isWindows ? "claude.cmd" : "claude";
|
|
@@ -266,7 +273,7 @@ async function handleClaudeQuery(command, supabase) {
|
|
|
266
273
|
shell: isWindows,
|
|
267
274
|
stdio: ["pipe", "pipe", "pipe"]
|
|
268
275
|
});
|
|
269
|
-
proc.stdin.write(prompt);
|
|
276
|
+
proc.stdin.write(focusPrefix + prompt);
|
|
270
277
|
proc.stdin.end();
|
|
271
278
|
let seq = 0;
|
|
272
279
|
let capturedSessionId = null;
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED