@f5-sales-demo/xcsh 21.19.0 → 21.19.2
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/package.json +8 -8
- package/src/commit/agentic/index.ts +3 -1
- package/src/commit/pipeline.ts +3 -1
- package/src/config/auto-config.ts +37 -7
- package/src/config/model-registry.ts +301 -46
- package/src/config/settings-schema.ts +4 -0
- package/src/config/settings.ts +12 -6
- package/src/internal-urls/build-info.generated.ts +8 -8
- package/src/internal-urls/docs-index.generated.ts +1 -1
- package/src/main.ts +4 -1
- package/src/modes/components/model-selector.ts +409 -107
- package/src/modes/components/oauth-selector.ts +39 -12
- package/src/modes/controllers/litellm-login-transaction.ts +10 -1
- package/src/modes/controllers/login-model.ts +23 -1
- package/src/modes/controllers/model-selection.ts +54 -0
- package/src/modes/controllers/selector-controller.ts +61 -48
- package/src/routing/presets.ts +6 -15
- package/src/sandbox/containment.ts +4 -6
- package/src/sdk.ts +5 -2
- package/src/session/session-manager.ts +3 -0
- package/src/task/executor.ts +3 -1
- package/src/tools/xcsh-api.ts +15 -9
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@f5-sales-demo/xcsh",
|
|
4
|
-
"version": "21.19.
|
|
4
|
+
"version": "21.19.2",
|
|
5
5
|
"description": "Coding agent CLI with read, bash, edit, write tools and session management",
|
|
6
6
|
"homepage": "https://github.com/f5-sales-demo/xcsh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
64
|
"@agentclientprotocol/sdk": "1.3.0",
|
|
65
|
-
"@f5-sales-demo/pi-agent-core": "21.19.
|
|
66
|
-
"@f5-sales-demo/pi-ai": "21.19.
|
|
67
|
-
"@f5-sales-demo/pi-natives": "21.19.
|
|
68
|
-
"@f5-sales-demo/pi-resource-management": "21.19.
|
|
69
|
-
"@f5-sales-demo/pi-tui": "21.19.
|
|
70
|
-
"@f5-sales-demo/pi-utils": "21.19.
|
|
71
|
-
"@f5-sales-demo/xcsh-stats": "21.19.
|
|
65
|
+
"@f5-sales-demo/pi-agent-core": "21.19.2",
|
|
66
|
+
"@f5-sales-demo/pi-ai": "21.19.2",
|
|
67
|
+
"@f5-sales-demo/pi-natives": "21.19.2",
|
|
68
|
+
"@f5-sales-demo/pi-resource-management": "21.19.2",
|
|
69
|
+
"@f5-sales-demo/pi-tui": "21.19.2",
|
|
70
|
+
"@f5-sales-demo/pi-utils": "21.19.2",
|
|
71
|
+
"@f5-sales-demo/xcsh-stats": "21.19.2",
|
|
72
72
|
"@mozilla/readability": "^0.6",
|
|
73
73
|
"@sinclair/typebox": "^0.34",
|
|
74
74
|
"@xterm/headless": "^6.0",
|
|
@@ -29,7 +29,9 @@ export async function runAgenticCommit(args: CommitCommandArgs): Promise<void> {
|
|
|
29
29
|
const [settings, authStorage] = await Promise.all([Settings.init({ cwd }), discoverAuthStorage()]);
|
|
30
30
|
|
|
31
31
|
process.stdout.write("● Resolving model...\n");
|
|
32
|
-
const modelRegistry = new ModelRegistry(authStorage
|
|
32
|
+
const modelRegistry = new ModelRegistry(authStorage, undefined, {
|
|
33
|
+
getProviderOrder: () => settings.get("modelProviderOrder"),
|
|
34
|
+
});
|
|
33
35
|
await modelRegistry.refresh();
|
|
34
36
|
const stagedFilesPromise = (async () => {
|
|
35
37
|
let stagedFiles = await git.diff.changedFiles(cwd, { cached: true });
|
package/src/commit/pipeline.ts
CHANGED
|
@@ -42,7 +42,9 @@ async function runLegacyCommitCommand(args: CommitCommandArgs): Promise<void> {
|
|
|
42
42
|
const settings = await Settings.init();
|
|
43
43
|
const commitSettings = settings.getGroup("commit");
|
|
44
44
|
const authStorage = await discoverAuthStorage();
|
|
45
|
-
const modelRegistry = new ModelRegistry(authStorage
|
|
45
|
+
const modelRegistry = new ModelRegistry(authStorage, undefined, {
|
|
46
|
+
getProviderOrder: () => settings.get("modelProviderOrder"),
|
|
47
|
+
});
|
|
46
48
|
await modelRegistry.refresh();
|
|
47
49
|
|
|
48
50
|
const {
|
|
@@ -20,9 +20,14 @@ import { hardenAgentConfigFileSync, writeAgentConfigFileSync } from "./agent-con
|
|
|
20
20
|
import { DEFAULT_MODEL_ROLE } from "./settings-schema";
|
|
21
21
|
|
|
22
22
|
/** Current config schema version. Bump when the generated format changes. */
|
|
23
|
-
export const CURRENT_CONFIG_VERSION =
|
|
23
|
+
export const CURRENT_CONFIG_VERSION = 6;
|
|
24
24
|
const LITELLM_CONFIG_DIR_MODE = 0o700;
|
|
25
25
|
const LITELLM_MODELS_FILE_MODE = 0o600;
|
|
26
|
+
const GENERATED_LITELLM_MARKER = "# Auto-generated by xcsh for LiteLLM proxy";
|
|
27
|
+
|
|
28
|
+
function isGeneratedLiteLLMConfig(content: string): boolean {
|
|
29
|
+
return content.includes(GENERATED_LITELLM_MARKER);
|
|
30
|
+
}
|
|
26
31
|
|
|
27
32
|
// ---------------------------------------------------------------------------
|
|
28
33
|
// Detection
|
|
@@ -65,19 +70,35 @@ export function generateModelsYml(baseUrl: string, options?: GenerateModelsYmlOp
|
|
|
65
70
|
? "# API key stored as literal value"
|
|
66
71
|
: "# API key resolved from LITELLM_API_KEY env var at runtime";
|
|
67
72
|
const lines = [
|
|
68
|
-
|
|
73
|
+
GENERATED_LITELLM_MARKER,
|
|
69
74
|
keyComment,
|
|
70
75
|
`configVersion: ${CURRENT_CONFIG_VERSION}`,
|
|
71
76
|
"providers:",
|
|
72
77
|
" anthropic:",
|
|
73
78
|
` baseUrl: "${baseUrl}/anthropic"`,
|
|
74
79
|
` apiKey: ${apiKeyValue}`,
|
|
80
|
+
" modelAllowlist:",
|
|
81
|
+
" - claude-opus-5",
|
|
82
|
+
" - claude-sonnet-5",
|
|
83
|
+
" - claude-haiku-4-5",
|
|
84
|
+
" picker:",
|
|
85
|
+
" groupId: litellm",
|
|
86
|
+
" groupLabel: LiteLLM",
|
|
87
|
+
" sectionLabel: Anthropic",
|
|
75
88
|
" litellm:",
|
|
76
89
|
` baseUrl: "${baseUrl}${apiBase}"`,
|
|
77
90
|
` apiKey: ${apiKeyValue}`,
|
|
78
91
|
" api: openai-completions",
|
|
79
92
|
" discovery:",
|
|
80
93
|
" type: openai-compat",
|
|
94
|
+
" modelAllowlist:",
|
|
95
|
+
" - gpt-5.6-sol",
|
|
96
|
+
" - gpt-5.6-terra",
|
|
97
|
+
" - gpt-5.6-luna",
|
|
98
|
+
" picker:",
|
|
99
|
+
" groupId: litellm",
|
|
100
|
+
" groupLabel: LiteLLM",
|
|
101
|
+
" sectionLabel: OpenAI",
|
|
81
102
|
" modelOverrides:",
|
|
82
103
|
" gpt-5.6-sol:",
|
|
83
104
|
" reasoning: true",
|
|
@@ -176,7 +197,7 @@ export const DEFAULT_MODEL_ROLE_VALUE = DEFAULT_MODEL_ROLE;
|
|
|
176
197
|
*/
|
|
177
198
|
export function generateConfigYml(): string {
|
|
178
199
|
return [
|
|
179
|
-
|
|
200
|
+
GENERATED_LITELLM_MARKER,
|
|
180
201
|
"# The default model role ships in the binary — none is written here.",
|
|
181
202
|
"providers:",
|
|
182
203
|
" image: openai",
|
|
@@ -567,6 +588,16 @@ export interface FixResult {
|
|
|
567
588
|
* Always creates .bak backup before overwriting.
|
|
568
589
|
*/
|
|
569
590
|
export function autoFixModelsConfig(modelsPath: string): FixResult {
|
|
591
|
+
if (fs.existsSync(modelsPath)) {
|
|
592
|
+
try {
|
|
593
|
+
const content = fs.readFileSync(modelsPath, "utf-8");
|
|
594
|
+
if (!isGeneratedLiteLLMConfig(content)) {
|
|
595
|
+
return { fixed: false, changes: ["Skipped custom models.yml; only xcsh-generated files are upgraded"] };
|
|
596
|
+
}
|
|
597
|
+
} catch {
|
|
598
|
+
return { fixed: false, changes: ["Cannot inspect existing models.yml safely"] };
|
|
599
|
+
}
|
|
600
|
+
}
|
|
570
601
|
const existing = readLiteLLMConfig(modelsPath);
|
|
571
602
|
const baseUrl = getLiteLLMBaseUrl() ?? existing?.baseUrl;
|
|
572
603
|
const existingLiteralKey = readApiKeyLiteral(modelsPath);
|
|
@@ -637,8 +668,7 @@ export function startupHealthCheck(
|
|
|
637
668
|
if (status === "ok" && loadedProviders) {
|
|
638
669
|
try {
|
|
639
670
|
const content = fs.readFileSync(modelsPath, "utf-8");
|
|
640
|
-
const isAutoGenerated =
|
|
641
|
-
content.includes("Auto-generated by xcsh") || content.includes("apiKey: LITELLM_API_KEY");
|
|
671
|
+
const isAutoGenerated = isGeneratedLiteLLMConfig(content);
|
|
642
672
|
if (
|
|
643
673
|
isAutoGenerated &&
|
|
644
674
|
(!content.includes(`configVersion: ${CURRENT_CONFIG_VERSION}`) || !content.includes("type: openai-compat"))
|
|
@@ -661,7 +691,7 @@ export function startupHealthCheck(
|
|
|
661
691
|
let isAutoGenerated = false;
|
|
662
692
|
try {
|
|
663
693
|
const content = fs.readFileSync(modelsPath, "utf-8");
|
|
664
|
-
isAutoGenerated =
|
|
694
|
+
isAutoGenerated = isGeneratedLiteLLMConfig(content);
|
|
665
695
|
} catch {
|
|
666
696
|
// File unreadable — skip, don't block startup
|
|
667
697
|
}
|
|
@@ -729,7 +759,7 @@ export async function probeAndUpgradeLiteLLMConfig(
|
|
|
729
759
|
// Only upgrade configs that were auto-generated by xcsh. User-written configs
|
|
730
760
|
// with custom proxy URLs must never be silently overwritten by LiteLLM probing.
|
|
731
761
|
// Recognize both env-var-ref configs and literal-key configs as auto-generated.
|
|
732
|
-
if (!
|
|
762
|
+
if (!isGeneratedLiteLLMConfig(content)) {
|
|
733
763
|
return false;
|
|
734
764
|
}
|
|
735
765
|
|