@f5-sales-demo/xcsh 21.9.2 → 21.9.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@f5-sales-demo/xcsh",
4
- "version": "21.9.2",
4
+ "version": "21.9.3",
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",
@@ -61,13 +61,13 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@agentclientprotocol/sdk": "1.3.0",
64
- "@f5-sales-demo/pi-agent-core": "21.9.2",
65
- "@f5-sales-demo/pi-ai": "21.9.2",
66
- "@f5-sales-demo/pi-natives": "21.9.2",
67
- "@f5-sales-demo/pi-resource-management": "21.9.2",
68
- "@f5-sales-demo/pi-tui": "21.9.2",
69
- "@f5-sales-demo/pi-utils": "21.9.2",
70
- "@f5-sales-demo/xcsh-stats": "21.9.2",
64
+ "@f5-sales-demo/pi-agent-core": "21.9.3",
65
+ "@f5-sales-demo/pi-ai": "21.9.3",
66
+ "@f5-sales-demo/pi-natives": "21.9.3",
67
+ "@f5-sales-demo/pi-resource-management": "21.9.3",
68
+ "@f5-sales-demo/pi-tui": "21.9.3",
69
+ "@f5-sales-demo/pi-utils": "21.9.3",
70
+ "@f5-sales-demo/xcsh-stats": "21.9.3",
71
71
  "@mozilla/readability": "^0.6",
72
72
  "@sinclair/typebox": "^0.34",
73
73
  "@xterm/headless": "^6.0",
@@ -2060,6 +2060,11 @@ export class ModelRegistry {
2060
2060
  return new Set(this.#configuredProviderIds);
2061
2061
  }
2062
2062
 
2063
+ /** Whether this provider is explicitly or implicitly configured to run without credentials. */
2064
+ isProviderKeyless(provider: string): boolean {
2065
+ return this.#keylessProviders.has(provider);
2066
+ }
2067
+
2063
2068
  getDiscoverableProviders(): string[] {
2064
2069
  const disabledProviders = getDisabledProviderIdsFromSettings();
2065
2070
  return this.#discoverableProviders
@@ -17,17 +17,17 @@ export interface BuildInfo {
17
17
  }
18
18
 
19
19
  export const BUILD_INFO: BuildInfo = {
20
- "version": "21.9.2",
21
- "commit": "56616a2381219096fc67218de2cc8f42b369ca5d",
22
- "shortCommit": "56616a2",
20
+ "version": "21.9.3",
21
+ "commit": "d0f68c91d5de2867aef626f20d80c147bf183f7c",
22
+ "shortCommit": "d0f68c9",
23
23
  "branch": "main",
24
- "tag": "v21.9.2",
25
- "commitDate": "2026-09-03T06:02:32+00:00",
26
- "buildDate": "2026-09-03T06:34:34.898Z",
24
+ "tag": "v21.9.3",
25
+ "commitDate": "2026-09-03T11:54:42+00:00",
26
+ "buildDate": "2026-09-03T12:26:26.165Z",
27
27
  "dirty": true,
28
28
  "prNumber": "",
29
29
  "repoUrl": "https://github.com/f5-sales-demo/xcsh",
30
30
  "repoSlug": "f5-sales-demo/xcsh",
31
- "commitUrl": "https://github.com/f5-sales-demo/xcsh/commit/56616a2381219096fc67218de2cc8f42b369ca5d",
32
- "releaseUrl": "https://github.com/f5-sales-demo/xcsh/releases/tag/v21.9.2"
31
+ "commitUrl": "https://github.com/f5-sales-demo/xcsh/commit/d0f68c91d5de2867aef626f20d80c147bf183f7c",
32
+ "releaseUrl": "https://github.com/f5-sales-demo/xcsh/releases/tag/v21.9.3"
33
33
  };
@@ -244,10 +244,12 @@ export function buildProviderModelGroups(
244
244
 
245
245
  const authenticated: ProviderModelGroup[] = [];
246
246
  const localItems: ModelItem[] = [];
247
+ let localStale = false;
247
248
  for (const [provider, providerItems] of byProvider) {
248
249
  const discovery = getDiscoveryState(provider);
249
250
  if (LOCAL_PROVIDER_IDS.has(provider)) {
250
- if (discovery?.status !== "ok") continue;
251
+ if (discovery?.status !== "ok" && discovery?.status !== "cached") continue;
252
+ localStale ||= discovery.status === "cached" || discovery.stale;
251
253
  localItems.push(...providerItems);
252
254
  continue;
253
255
  }
@@ -284,8 +286,8 @@ export function buildProviderModelGroups(
284
286
  id: LOCAL_PROVIDERS_TAB,
285
287
  label: "Local Providers",
286
288
  classification: "local",
287
- discoveryStatus: "ok",
288
- stale: false,
289
+ discoveryStatus: localStale ? "cached" : "ok",
290
+ stale: localStale,
289
291
  models: localItems,
290
292
  };
291
293
  if (currentProvider && LOCAL_PROVIDER_IDS.has(currentProvider)) authenticated.unshift(localGroup);
@@ -384,7 +386,7 @@ export class ModelSelectorComponent extends Container {
384
386
  const hintText =
385
387
  scopedModels.length > 0
386
388
  ? "Showing models from --models scope"
387
- : "Only showing models with configured API keys (see README for details)";
389
+ : "Only showing models from configured providers (see README for details)";
388
390
  this.addChild(new Text(theme.fg("warning", hintText), 0, 0));
389
391
  this.addChild(new Spacer(1));
390
392
 
@@ -1,6 +1,7 @@
1
1
  import type { Model } from "@f5-sales-demo/pi-ai";
2
2
  import { validateApiKeyAgainstModelsEndpoint } from "@f5-sales-demo/pi-ai/utils/oauth/api-key-validation";
3
3
  import { logger } from "@f5-sales-demo/pi-utils";
4
+ import type { ModelRegistry } from "../../config/model-registry";
4
5
  import { type AuthStatus, ContextService } from "../../services/xcsh-context";
5
6
  import { deriveTenantFromUrl } from "../../services/xcsh-env";
6
7
  import type { AuthStorage } from "../../session/auth-storage";
@@ -67,15 +68,25 @@ export interface WelcomeCheckResult {
67
68
  /** Providers that don't store API keys (local inference servers) */
68
69
  const KEYLESS_PROVIDERS = new Set(["ollama", "llama.cpp", "lm-studio", "llamafile", "local"]);
69
70
 
71
+ type KeylessProviderRegistry = Pick<ModelRegistry, "isProviderKeyless">;
72
+
73
+ function isKeylessProvider(provider: string, modelRegistry?: KeylessProviderRegistry): boolean {
74
+ return modelRegistry ? modelRegistry.isProviderKeyless(provider) : KEYLESS_PROVIDERS.has(provider);
75
+ }
76
+
70
77
  /**
71
78
  * Instant, local check for whether the session has a usable LLM provider configured.
72
79
  * Zero network: a model must be resolved and either be keyless (local inference) or
73
80
  * have credentials present in the auth store. Used by the startup readiness gate to
74
81
  * decide whether natural-language input can be processed.
75
82
  */
76
- export function hasActiveLlmProvider(model: Model | undefined, authStorage: Pick<AuthStorage, "hasAuth">): boolean {
83
+ export function hasActiveLlmProvider(
84
+ model: Model | undefined,
85
+ authStorage: Pick<AuthStorage, "hasAuth">,
86
+ modelRegistry?: KeylessProviderRegistry,
87
+ ): boolean {
77
88
  if (!model) return false;
78
- return KEYLESS_PROVIDERS.has(model.provider) || authStorage.hasAuth(model.provider);
89
+ return isKeylessProvider(model.provider, modelRegistry) || authStorage.hasAuth(model.provider);
79
90
  }
80
91
 
81
92
  /**
@@ -85,17 +96,18 @@ export function hasActiveLlmProvider(model: Model | undefined, authStorage: Pick
85
96
  export async function runWelcomeChecks(
86
97
  model: Model | undefined,
87
98
  authStorage: AuthStorage,
99
+ modelRegistry?: KeylessProviderRegistry,
88
100
  ): Promise<WelcomeCheckResult> {
89
101
  const provider = model?.provider ?? "unknown";
90
102
 
91
103
  // Step 1: Check model provider credentials exist
92
104
  // Keyless local providers (ollama, llama.cpp, lm-studio, etc.) don't store credentials
93
- if (!authStorage.hasAuth(provider) && !KEYLESS_PROVIDERS.has(provider)) {
105
+ if (!authStorage.hasAuth(provider) && !isKeylessProvider(provider, modelRegistry)) {
94
106
  return { model: { state: "no_provider", provider } };
95
107
  }
96
108
 
97
109
  // Step 2: Live model validation — try to reach the models endpoint
98
- const modelStatus = await validateModelConnection(model, authStorage);
110
+ const modelStatus = await validateModelConnection(model, authStorage, modelRegistry);
99
111
  if (modelStatus.state !== "connected") {
100
112
  return { model: modelStatus };
101
113
  }
@@ -105,13 +117,17 @@ export async function runWelcomeChecks(
105
117
  return { model: modelStatus, context: contextStatus };
106
118
  }
107
119
 
108
- async function validateModelConnection(model: Model | undefined, authStorage: AuthStorage): Promise<ModelStatus> {
120
+ async function validateModelConnection(
121
+ model: Model | undefined,
122
+ authStorage: AuthStorage,
123
+ modelRegistry?: KeylessProviderRegistry,
124
+ ): Promise<ModelStatus> {
109
125
  const provider = model?.provider ?? "unknown";
110
126
  try {
111
127
  const rawApiKey = await authStorage.peekApiKey(provider);
112
128
  if (!rawApiKey) {
113
129
  // Keyless providers skip validation
114
- if (KEYLESS_PROVIDERS.has(provider)) {
130
+ if (isKeylessProvider(provider, modelRegistry)) {
115
131
  return { state: "connected", provider, latencyMs: 0 };
116
132
  }
117
133
  return { state: "auth_error", provider };
@@ -319,7 +319,11 @@ export class InteractiveMode implements InteractiveModeContext {
319
319
  // LLM readiness gate: instant, local check (no network). When no provider is
320
320
  // configured we still initialize immediately, but warn the user to /login —
321
321
  // natural-language input is blocked until then (enforced in input-controller).
322
- const needsLogin = !hasActiveLlmProvider(this.session.model, this.session.modelRegistry.authStorage);
322
+ const needsLogin = !hasActiveLlmProvider(
323
+ this.session.model,
324
+ this.session.modelRegistry.authStorage,
325
+ this.session.modelRegistry,
326
+ );
323
327
 
324
328
  if (!startupQuiet) {
325
329
  this.#welcomeComponent = new WelcomeComponent(this.#version);
@@ -1097,7 +1101,11 @@ export class InteractiveMode implements InteractiveModeContext {
1097
1101
  }
1098
1102
 
1099
1103
  hasActiveLlmProvider(): boolean {
1100
- return hasActiveLlmProvider(this.session.model, this.session.modelRegistry.authStorage);
1104
+ return hasActiveLlmProvider(
1105
+ this.session.model,
1106
+ this.session.modelRegistry.authStorage,
1107
+ this.session.modelRegistry,
1108
+ );
1101
1109
  }
1102
1110
 
1103
1111
  ensureLoadingAnimation(): void {
@@ -634,7 +634,11 @@ export async function runRpcMode(session: AgentSession): Promise<never> {
634
634
  }
635
635
 
636
636
  case "get_integrations": {
637
- const welcomeResult = await runWelcomeChecks(session.model, session.modelRegistry.authStorage);
637
+ const welcomeResult = await runWelcomeChecks(
638
+ session.model,
639
+ session.modelRegistry.authStorage,
640
+ session.modelRegistry,
641
+ );
638
642
 
639
643
  const services =
640
644
  welcomeResult.model.state === "connected"