@tiflis-io/tiflis-code-workstation 0.3.0 → 0.3.1

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.
Files changed (2) hide show
  1. package/dist/main.js +38 -2
  2. package/package.json +2 -2
package/dist/main.js CHANGED
@@ -134,12 +134,34 @@ function parseAgentAliases() {
134
134
  console.warn(`Invalid agent alias ${key}: empty command`);
135
135
  continue;
136
136
  }
137
- const baseCommand = parts[0];
138
- const additionalArgs = parts.slice(1);
137
+ const envVars = {};
138
+ let commandStartIndex = 0;
139
+ for (let i = 0; i < parts.length; i++) {
140
+ const part = parts[i];
141
+ const eqIndex = part.indexOf("=");
142
+ if (eqIndex > 0 && !part.startsWith("-")) {
143
+ const varName = part.slice(0, eqIndex);
144
+ const varValue = part.slice(eqIndex + 1);
145
+ if (/^[A-Z_][A-Z0-9_]*$/.test(varName)) {
146
+ envVars[varName] = varValue;
147
+ commandStartIndex = i + 1;
148
+ continue;
149
+ }
150
+ }
151
+ break;
152
+ }
153
+ const commandParts = parts.slice(commandStartIndex);
154
+ if (commandParts.length === 0) {
155
+ console.warn(`Invalid agent alias ${key}: no command after env vars`);
156
+ continue;
157
+ }
158
+ const baseCommand = commandParts[0];
159
+ const additionalArgs = commandParts.slice(1);
139
160
  aliases.set(aliasName, {
140
161
  name: aliasName,
141
162
  baseCommand,
142
163
  additionalArgs,
164
+ envVars,
143
165
  rawCommand: value
144
166
  });
145
167
  }
@@ -325,6 +347,7 @@ function getAvailableAgents() {
325
347
  name: "cursor",
326
348
  command: AGENT_COMMANDS.cursor.command,
327
349
  aliasArgs: [],
350
+ aliasEnvVars: {},
328
351
  baseType: "cursor",
329
352
  description: AGENT_COMMANDS.cursor.description,
330
353
  isAlias: false
@@ -333,6 +356,7 @@ function getAvailableAgents() {
333
356
  name: "claude",
334
357
  command: AGENT_COMMANDS.claude.command,
335
358
  aliasArgs: [],
359
+ aliasEnvVars: {},
336
360
  baseType: "claude",
337
361
  description: AGENT_COMMANDS.claude.description,
338
362
  isAlias: false
@@ -341,6 +365,7 @@ function getAvailableAgents() {
341
365
  name: "opencode",
342
366
  command: AGENT_COMMANDS.opencode.command,
343
367
  aliasArgs: [],
368
+ aliasEnvVars: {},
344
369
  baseType: "opencode",
345
370
  description: AGENT_COMMANDS.opencode.description,
346
371
  isAlias: false
@@ -358,6 +383,7 @@ function getAvailableAgents() {
358
383
  name,
359
384
  command: alias.baseCommand,
360
385
  aliasArgs: alias.additionalArgs,
386
+ aliasEnvVars: alias.envVars,
361
387
  baseType,
362
388
  description: `${name} (alias for ${baseType} with custom config)`,
363
389
  isAlias: true
@@ -2563,10 +2589,13 @@ var HeadlessAgentExecutor = class extends EventEmitter {
2563
2589
  await this.killAndWait();
2564
2590
  }
2565
2591
  const { command, args } = this.buildCommand(prompt);
2592
+ const aliasEnvVars = this.getAliasEnvVars();
2566
2593
  this.subprocess = spawn2(command, args, {
2567
2594
  cwd: this.workingDir,
2568
2595
  env: {
2569
2596
  ...process.env,
2597
+ // Apply alias env vars (e.g., CLAUDE_CONFIG_DIR)
2598
+ ...aliasEnvVars,
2570
2599
  // Ensure proper terminal environment
2571
2600
  TERM: "xterm-256color",
2572
2601
  // Disable interactive prompts
@@ -2626,6 +2655,13 @@ var HeadlessAgentExecutor = class extends EventEmitter {
2626
2655
  getAliasArgs() {
2627
2656
  return this.agentConfig?.aliasArgs ?? [];
2628
2657
  }
2658
+ /**
2659
+ * Get alias environment variables from agent config.
2660
+ * Returns empty object if no alias configured.
2661
+ */
2662
+ getAliasEnvVars() {
2663
+ return this.agentConfig?.aliasEnvVars ?? {};
2664
+ }
2629
2665
  /**
2630
2666
  * Build cursor-agent command.
2631
2667
  * Format: cursor-agent [alias-args] --output-format stream-json --print [--resume <session_id>] "prompt"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tiflis-io/tiflis-code-workstation",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Workstation server for tiflis-code - manages agent sessions and terminal access",
5
5
  "author": "Roman Barinov <rbarinov@gmail.com>",
6
6
  "license": "FSL-1.1-NC",
@@ -64,7 +64,7 @@
64
64
  "vitest": "^2.1.8"
65
65
  },
66
66
  "engines": {
67
- "node": ">=22.0.0"
67
+ "node": ">=24.0.0"
68
68
  },
69
69
  "scripts": {
70
70
  "dev": "tsx watch src/main.ts",