@averyyy/pi-coding-agent 1.3.0-piclient.3 → 1.3.0-piclient.4

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 (39) hide show
  1. package/CHANGELOG.md +3 -0
  2. package/dist/bundle/chunks/{anthropic-messages-VGILSZE4.js → anthropic-messages-JKZEYO3X.js} +1 -1
  3. package/dist/bundle/chunks/{azure-openai-responses-RQ4TCY4V.js → azure-openai-responses-CALHHRO4.js} +1 -1
  4. package/dist/bundle/chunks/{chunk-S7GW7ZCV.js → chunk-2TBKESBE.js} +1 -1
  5. package/dist/bundle/chunks/{chunk-VWVP4RBU.js → chunk-3IAHLZM6.js} +1 -1
  6. package/dist/bundle/chunks/{chunk-NB2YR6RG.js → chunk-A5PVA2BG.js} +1 -1
  7. package/dist/bundle/chunks/{chunk-QRZH73DC.js → chunk-DYPQLT4D.js} +8 -8
  8. package/dist/bundle/chunks/{chunk-SWXCGFWB.js → chunk-KO7M2ZFM.js} +1 -1
  9. package/dist/bundle/chunks/{chunk-MPZ232UI.js → chunk-MSGIVOTQ.js} +1 -1
  10. package/dist/bundle/chunks/{chunk-S2W5KTDO.js → chunk-NAPMJL5U.js} +1 -1
  11. package/dist/bundle/chunks/{chunk-TOASJ3OW.js → chunk-XIQJS2WK.js} +1 -1
  12. package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-PET7FI2G.js → cloudflare-workers-ai-system-one-W3JVUOXV.js} +1 -1
  13. package/dist/bundle/chunks/github-copilot.js +1 -1
  14. package/dist/bundle/chunks/{google-generative-ai-ZFNZ3LG6.js → google-generative-ai-4YEPBKDH.js} +1 -1
  15. package/dist/bundle/chunks/{google-vertex-UC7CFP4J.js → google-vertex-5HD3H47T.js} +1 -1
  16. package/dist/bundle/chunks/{mistral-conversations-KZROP3MF.js → mistral-conversations-IDNVOMLP.js} +1 -1
  17. package/dist/bundle/chunks/{openai-codex-responses-2CXWT4CB.js → openai-codex-responses-TWAB375R.js} +1 -1
  18. package/dist/bundle/chunks/{openai-completions-WV22DQI3.js → openai-completions-3LCSEI2J.js} +1 -1
  19. package/dist/bundle/chunks/{openai-decisions-BL7TXE4H.js → openai-decisions-CWANEVXX.js} +1 -1
  20. package/dist/bundle/chunks/{openai-responses-4SZGS7GF.js → openai-responses-JEQACBMR.js} +1 -1
  21. package/dist/bundle/chunks/{typesafe-system-one-KIQLTPSL.js → typesafe-system-one-JJVDHYHL.js} +1 -1
  22. package/dist/bundle/chunks/{virtual-modules-NPAAMEVD.js → virtual-modules-4VB3FSWN.js} +1 -1
  23. package/dist/bundle/cli-runtime.js +1 -1
  24. package/dist/bundle/index.js +1 -1
  25. package/dist/bundle/rpc-entry.js +1 -1
  26. package/dist/core/agent-session.d.ts.map +1 -1
  27. package/dist/core/agent-session.js +2 -2
  28. package/dist/core/agent-session.js.map +1 -1
  29. package/dist/core/model-resolver.d.ts +4 -0
  30. package/dist/core/model-resolver.d.ts.map +1 -1
  31. package/dist/core/model-resolver.js +9 -1
  32. package/dist/core/model-resolver.js.map +1 -1
  33. package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
  34. package/dist/modes/interactive/components/model-selector.js +8 -10
  35. package/dist/modes/interactive/components/model-selector.js.map +1 -1
  36. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  37. package/dist/modes/interactive/interactive-mode.js +36 -13
  38. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  39. package/package.json +4 -4
@@ -22,7 +22,7 @@ import { FooterDataProvider } from "../../core/footer-data-provider.js";
22
22
  import { configureHttpDispatcher, formatHttpIdleTimeoutMs } from "../../core/http-dispatcher.js";
23
23
  import { KeybindingsManager } from "../../core/keybindings.js";
24
24
  import { createCompactionSummaryMessage, createCustomMessage } from "../../core/messages.js";
25
- import { defaultModelPerProvider, findExactModelReferenceMatch, resolveModelScopeFromModels, } from "../../core/model-resolver.js";
25
+ import { defaultModelPerProvider, findExactModelReferenceMatch, getAvailableScopedModels, resolveModelScopeFromModels, } from "../../core/model-resolver.js";
26
26
  import { CredentialSynchronizationError } from "../../core/model-runtime.js";
27
27
  import { DefaultPackageManager } from "../../core/package-manager.js";
28
28
  import { getCliBinName } from "../../core/pi-client-cli-adapter.js";
@@ -480,7 +480,7 @@ export class InteractiveMode {
480
480
  if (modelCommand) {
481
481
  modelCommand.getArgumentCompletions = (prefix) => {
482
482
  const models = this.session.scopedModels.length > 0
483
- ? this.session.scopedModels.map((s) => s.model)
483
+ ? getAvailableScopedModels(this.session.scopedModels, this.session.modelRuntime.getAvailableSnapshot()).map((scoped) => scoped.model)
484
484
  : this.session.modelRuntime.getAvailableSnapshot();
485
485
  if (models.length === 0)
486
486
  return null;
@@ -4572,7 +4572,7 @@ export class InteractiveMode {
4572
4572
  }
4573
4573
  async findExactModelMatch(searchTerm) {
4574
4574
  const cachedModels = this.session.scopedModels.length > 0
4575
- ? this.session.scopedModels.map((scoped) => scoped.model)
4575
+ ? getAvailableScopedModels(this.session.scopedModels, this.session.modelRuntime.getAvailableSnapshot()).map((scoped) => scoped.model)
4576
4576
  : [...this.session.modelRuntime.getAvailableSnapshot()];
4577
4577
  const cachedMatch = findExactModelReferenceMatch(searchTerm, cachedModels);
4578
4578
  if (cachedMatch || this.session.scopedModels.length > 0)
@@ -4606,7 +4606,7 @@ export class InteractiveMode {
4606
4606
  /** Update the footer's available provider count from the current snapshot without refreshing catalogs. */
4607
4607
  updateAvailableProviderCount() {
4608
4608
  const models = this.session.scopedModels.length > 0
4609
- ? this.session.scopedModels.map((scoped) => scoped.model)
4609
+ ? getAvailableScopedModels(this.session.scopedModels, this.session.modelRuntime.getAvailableSnapshot()).map((scoped) => scoped.model)
4610
4610
  : this.session.modelRuntime.getAvailableSnapshot();
4611
4611
  const uniqueProviders = new Set(models.map((model) => model.provider));
4612
4612
  this.footerDataProvider.setAvailableProviderCount(uniqueProviders.size);
@@ -4731,14 +4731,20 @@ export class InteractiveMode {
4731
4731
  let selectionChanged = false;
4732
4732
  const updateSessionModels = (enabledIds) => {
4733
4733
  currentEnabledIds = enabledIds === null ? null : [...enabledIds];
4734
- const hasEnabledAvailableModel = enabledIds?.some((id) => availableModelIds.has(id)) ?? false;
4735
- const allAvailableModelsEnabled = enabledIds !== null && [...availableModelIds].every((id) => enabledIds.includes(id));
4736
- if (enabledIds && hasEnabledAvailableModel && !allAvailableModelsEnabled) {
4734
+ const allAvailableModelsEnabled = enabledIds !== null &&
4735
+ enabledIds.length === availableModelIds.size &&
4736
+ [...availableModelIds].every((id) => enabledIds.includes(id));
4737
+ if (enabledIds && !allAvailableModelsEnabled) {
4737
4738
  const newScopedModels = resolveModelScopeFromModels(enabledIds, availableModels).scopedModels;
4738
- this.session.setScopedModels(newScopedModels.map((scoped) => ({
4739
- model: scoped.model,
4740
- thinkingLevel: scoped.thinkingLevel,
4741
- })));
4739
+ const scopedById = new Map(sessionScopedModels
4740
+ .filter((scoped) => !availableModelIds.has(`${scoped.model.provider}/${scoped.model.id}`))
4741
+ .map((scoped) => [`${scoped.model.provider}/${scoped.model.id}`, scoped]));
4742
+ for (const scoped of newScopedModels)
4743
+ scopedById.set(`${scoped.model.provider}/${scoped.model.id}`, scoped);
4744
+ this.session.setScopedModels(enabledIds.flatMap((id) => {
4745
+ const scoped = scopedById.get(id);
4746
+ return scoped ? [scoped] : [];
4747
+ }));
4742
4748
  }
4743
4749
  else {
4744
4750
  this.session.setScopedModels([]);
@@ -5265,9 +5271,26 @@ export class InteractiveMode {
5265
5271
  signal: AbortSignal.timeout(15_000),
5266
5272
  });
5267
5273
  await this.updateAvailableProviderCount();
5268
- const message = providerOption.authType === "oauth"
5274
+ let message = providerOption.authType === "oauth"
5269
5275
  ? `Logged out of ${providerOption.name}`
5270
- : `Removed stored API key for ${providerOption.name}. Environment variables and models.json config are unchanged.`;
5276
+ : `Removed stored API key for ${providerOption.name}`;
5277
+ if (this.session.modelRuntime.hasConfiguredAuth(providerOption.id)) {
5278
+ const authStatus = this.session.modelRuntime.getProviderAuthStatus(providerOption.id);
5279
+ const sources = {
5280
+ stored: "stored credentials",
5281
+ runtime: "a runtime API key",
5282
+ environment: authStatus.label ? `environment (${authStatus.label})` : "environment credentials",
5283
+ fallback: "extension configuration",
5284
+ models_json_key: "models.json configuration",
5285
+ models_json_command: "a models.json credential command",
5286
+ };
5287
+ const source = authStatus.configured && authStatus.source
5288
+ ? sources[authStatus.source]
5289
+ : process.env.PI_SERVER_MODE === "true"
5290
+ ? "pi-server credentials"
5291
+ : "configured authentication";
5292
+ message += `. Models remain available through ${source}.`;
5293
+ }
5271
5294
  this.showStatus(message);
5272
5295
  }
5273
5296
  catch (error) {