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.
- package/CHANGELOG.md +23 -0
- package/README.md +195 -120
- package/package.json +1 -1
- package/src/app.js +20 -2
- package/src/config.js +3 -0
- package/src/key-handler.js +184 -38
- package/src/openclaw.js +39 -5
- package/src/opencode.js +2 -1
- package/src/overlays.js +314 -223
- package/src/render-helpers.js +1 -1
- package/src/render-table.js +152 -180
- package/src/theme.js +315 -0
- package/src/tier-colors.js +15 -17
- package/src/tool-bootstrap.js +310 -0
- package/src/tool-launchers.js +12 -7
- package/src/ui-config.js +24 -31
package/src/tool-launchers.js
CHANGED
|
@@ -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
|
|
3
|
+
* @description Central configuration helpers for TUI separators and spacing.
|
|
4
4
|
*
|
|
5
5
|
* @details
|
|
6
|
-
* This module centralizes
|
|
7
|
-
*
|
|
8
|
-
*
|
|
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
|
-
* -
|
|
12
|
-
* -
|
|
13
|
-
* -
|
|
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
|
|
19
|
+
import { themeColors } from './theme.js'
|
|
22
20
|
|
|
23
|
-
// 📖 Column separator
|
|
24
|
-
|
|
25
|
-
export
|
|
26
|
-
|
|
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
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
export const HORIZONTAL_LINE = chalk[HORIZONTAL_STYLE](HORIZONTAL_SEPARATOR);
|
|
27
|
+
export function getHorizontalLine() {
|
|
28
|
+
return themeColors.dim('─')
|
|
29
|
+
}
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
export function getColumnSpacing() {
|
|
32
|
+
return ` ${getVerticalSeparator()} `
|
|
33
|
+
}
|
|
35
34
|
|
|
36
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
HORIZONTAL_SEPARATOR,
|
|
45
|
-
HORIZONTAL_STYLE,
|
|
46
|
-
HORIZONTAL_LINE,
|
|
47
|
-
COLUMN_SPACING,
|
|
38
|
+
getVerticalSeparator,
|
|
39
|
+
getHorizontalLine,
|
|
40
|
+
getColumnSpacing,
|
|
48
41
|
TABLE_PADDING
|
|
49
|
-
}
|
|
42
|
+
}
|