@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.
@@ -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
- let cwd = config.projectsDir;
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 resolved = resolve(config.projectsDir, project_path);
240
- if (resolved.startsWith(resolve(config.projectsDir))) {
241
- cwd = resolved;
246
+ const projectDir = resolve(config.projectsDir, project_path);
247
+ if (existsSync2(projectDir)) {
248
+ focusPrefix = `>> focused: ./projects/${project_path}
249
+ `;
242
250
  }
243
251
  }
244
- if (!existsSync2(cwd)) {
245
- mkdirSync2(cwd, { recursive: true });
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 (system_prompt) args.push("--append-system-prompt", system_prompt);
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
@@ -9,7 +9,7 @@ import {
9
9
  loadConfig,
10
10
  saveConfig,
11
11
  updateConfig
12
- } from "./chunk-QPS4CXAL.js";
12
+ } from "./chunk-PNQQWSNW.js";
13
13
 
14
14
  // src/cli.ts
15
15
  import { Command } from "commander";
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  resetSupabase,
8
8
  saveConfig,
9
9
  updateConfig
10
- } from "./chunk-QPS4CXAL.js";
10
+ } from "./chunk-PNQQWSNW.js";
11
11
  export {
12
12
  Relay,
13
13
  configExists,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenux/cli",
3
- "version": "0.0.18",
3
+ "version": "0.0.20",
4
4
  "description": "Tenux — mobile-first IDE for 10x engineering",
5
5
  "author": "Antelogic LLC",
6
6
  "license": "MIT",