free-coding-models 0.3.16 → 0.3.18

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.
@@ -43,6 +43,7 @@ import { getApiKey } from './config.js'
43
43
  import { ENV_VAR_NAMES, isWindows } from './provider-metadata.js'
44
44
  import { getToolMeta } from './tool-metadata.js'
45
45
  import { PROVIDER_METADATA } from './provider-metadata.js'
46
+ import { resolveToolBinaryPath } from './tool-bootstrap.js'
46
47
 
47
48
  const OPENAI_COMPAT_ENV_KEYS = [
48
49
  'OPENAI_API_KEY',
@@ -127,6 +128,10 @@ function applyOpenAiCompatEnv(env, apiKey, baseUrl, modelId) {
127
128
  return env
128
129
  }
129
130
 
131
+ function resolveLaunchCommand(mode, fallbackCommand) {
132
+ return resolveToolBinaryPath(mode) || fallbackCommand
133
+ }
134
+
130
135
  /**
131
136
  * 📖 resolveLauncherModelId returns the provider-native id used by the direct
132
137
  * 📖 launchers. Legacy bridge-specific model remapping has been removed.
@@ -562,35 +567,35 @@ export async function startExternalTool(mode, model, config) {
562
567
  printConfigArtifacts(meta.label, launchPlan.configArtifacts)
563
568
 
564
569
  if (mode === 'aider') {
565
- return spawnCommand(launchPlan.command, launchPlan.args, launchPlan.env)
570
+ return spawnCommand(resolveLaunchCommand(mode, launchPlan.command), launchPlan.args, launchPlan.env)
566
571
  }
567
572
 
568
573
  if (mode === 'crush') {
569
574
  console.log(chalk.dim(' 📖 Crush will use the provider directly for this launch.'))
570
- return spawnCommand(launchPlan.command, launchPlan.args, launchPlan.env)
575
+ return spawnCommand(resolveLaunchCommand(mode, launchPlan.command), launchPlan.args, launchPlan.env)
571
576
  }
572
577
 
573
578
  if (mode === 'goose') {
574
- return spawnCommand(launchPlan.command, launchPlan.args, launchPlan.env)
579
+ return spawnCommand(resolveLaunchCommand(mode, launchPlan.command), launchPlan.args, launchPlan.env)
575
580
  }
576
581
 
577
582
  if (mode === 'qwen') {
578
- return spawnCommand(launchPlan.command, launchPlan.args, launchPlan.env)
583
+ return spawnCommand(resolveLaunchCommand(mode, launchPlan.command), launchPlan.args, launchPlan.env)
579
584
  }
580
585
 
581
586
  if (mode === 'openhands') {
582
587
  console.log(chalk.dim(` 📖 OpenHands launched with model: ${model.modelId}`))
583
- return spawnCommand(launchPlan.command, launchPlan.args, launchPlan.env)
588
+ return spawnCommand(resolveLaunchCommand(mode, launchPlan.command), launchPlan.args, launchPlan.env)
584
589
  }
585
590
 
586
591
  if (mode === 'amp') {
587
592
  console.log(chalk.dim(` 📖 Amp config updated with model: ${model.modelId}`))
588
- return spawnCommand(launchPlan.command, launchPlan.args, launchPlan.env)
593
+ return spawnCommand(resolveLaunchCommand(mode, launchPlan.command), launchPlan.args, launchPlan.env)
589
594
  }
590
595
 
591
596
  if (mode === 'pi') {
592
597
  // 📖 Pi supports --provider and --model flags for guaranteed auto-selection
593
- return spawnCommand(launchPlan.command, launchPlan.args, launchPlan.env)
598
+ return spawnCommand(resolveLaunchCommand(mode, launchPlan.command), launchPlan.args, launchPlan.env)
594
599
  }
595
600
 
596
601
  console.log(chalk.red(` X Unsupported external tool mode: ${mode}`))
package/src/ui-config.js CHANGED
@@ -1,49 +1,42 @@
1
1
  /**
2
2
  * @file ui-config.js
3
- * @description Central configuration for TUI visual styling.
3
+ * @description Central configuration helpers for TUI separators and spacing.
4
4
  *
5
5
  * @details
6
- * This module centralizes all visual styling constants for the TUI interface.
7
- * By keeping colors, separators, and spacing in one place, it becomes easy to
8
- * customize the look and feel without modifying rendering logic.
6
+ * This module centralizes the shared table separators used by the TUI. The
7
+ * theme can change at runtime, so separators must be generated lazily instead
8
+ * of frozen once at import time.
9
9
  *
10
10
  * 📖 Configuration:
11
- * - BORDER_COLOR: Color of column separators (vertical bars)
12
- * - BORDER_STYLE: Style of separators (dim, bold, etc.)
13
- * - HORIZONTAL_SEPARATOR: Character used for horizontal lines
14
- * - HORIZONTAL_STYLE: Style of horizontal lines
15
- * - COLUMN_SPACING: Space between columns
11
+ * - `getVerticalSeparator()` theme-aware vertical divider
12
+ * - `getHorizontalLine()` theme-aware horizontal divider
13
+ * - `getColumnSpacing()` formatted spacing wrapper around the divider
16
14
  *
17
15
  * @see render-table.js - uses these constants for rendering
18
16
  * @see tier-colors.js - for tier-specific color definitions
19
17
  */
20
18
 
21
- import chalk from 'chalk';
19
+ import { themeColors } from './theme.js'
22
20
 
23
- // 📖 Column separator (vertical bar) configuration
24
- export const BORDER_COLOR = chalk.rgb(255, 140, 0); // Gentle dark orange
25
- export const BORDER_STYLE = 'dim'; // Options: 'dim', 'bold', 'underline', 'inverse', etc.
26
- export const VERTICAL_SEPARATOR = BORDER_COLOR[BORDER_STYLE]('│');
21
+ // 📖 Column separator stays subtle so it improves scanability without turning
22
+ // 📖 the table into a bright fence.
23
+ export function getVerticalSeparator() {
24
+ return themeColors.border('│')
25
+ }
27
26
 
28
- // 📖 Horizontal separator configuration
29
- export const HORIZONTAL_SEPARATOR = '─'; // Unicode horizontal line
30
- export const HORIZONTAL_STYLE = 'dim'; // Options: 'dim', 'bold', etc.
31
- export const HORIZONTAL_LINE = chalk[HORIZONTAL_STYLE](HORIZONTAL_SEPARATOR);
27
+ export function getHorizontalLine() {
28
+ return themeColors.dim('─')
29
+ }
32
30
 
33
- // 📖 Column spacing configuration
34
- export const COLUMN_SPACING = ` ${VERTICAL_SEPARATOR} `; // Space around vertical separator
31
+ export function getColumnSpacing() {
32
+ return ` ${getVerticalSeparator()} `
33
+ }
35
34
 
36
- // 📖 Optional: Add more UI styling constants here as needed
37
- export const TABLE_PADDING = 1; // Padding around table edges
35
+ export const TABLE_PADDING = 1
38
36
 
39
- // 📖 Export all constants for easy import
40
37
  export default {
41
- BORDER_COLOR,
42
- BORDER_STYLE,
43
- VERTICAL_SEPARATOR,
44
- HORIZONTAL_SEPARATOR,
45
- HORIZONTAL_STYLE,
46
- HORIZONTAL_LINE,
47
- COLUMN_SPACING,
38
+ getVerticalSeparator,
39
+ getHorizontalLine,
40
+ getColumnSpacing,
48
41
  TABLE_PADDING
49
- };
42
+ }