@ashx-j/lunr 0.1.1 → 0.1.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/dist/catalog/models.json +1 -1
- package/dist/catalog/providers/opencode-go.json +1 -1
- package/dist/catalog/providers/openrouter.json +1 -1
- package/dist/catalog/providers/qwen-token-plan-cn.json +1 -1
- package/dist/catalog/providers/qwen-token-plan.json +1 -1
- package/dist/catalog/publication.json +3 -3
- package/dist/core/catalog-merge.d.ts.map +1 -1
- package/dist/core/catalog-merge.js +7 -1
- package/dist/core/catalog-merge.js.map +1 -1
- package/dist/core/grok-cli-auth.d.ts +32 -0
- package/dist/core/grok-cli-auth.d.ts.map +1 -0
- package/dist/core/grok-cli-auth.js +218 -0
- package/dist/core/grok-cli-auth.js.map +1 -0
- package/dist/core/model-runtime.d.ts +9 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +22 -3
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/usage-adapters/xai.d.ts.map +1 -1
- package/dist/core/usage-adapters/xai.js +4 -0
- package/dist/core/usage-adapters/xai.js.map +1 -1
- package/dist/core/usage-service.d.ts +11 -1
- package/dist/core/usage-service.d.ts.map +1 -1
- package/dist/core/usage-service.js +45 -9
- package/dist/core/usage-service.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +28 -3
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/package.json +4 -4
|
@@ -16,6 +16,7 @@ import { CACHE_TTL_MS, collectCacheMisses, computeCacheWaste, detectCacheMiss, }
|
|
|
16
16
|
import { formatCatalogRefreshSummary } from "../../core/catalog-merge.js";
|
|
17
17
|
import { computeContextBreakdown } from "../../core/context-breakdown.js";
|
|
18
18
|
import { FooterDataProvider } from "../../core/footer-data-provider.js";
|
|
19
|
+
import { hasGrokCliXaiAuth } from "../../core/grok-cli-auth.js";
|
|
19
20
|
import { configureHttpDispatcher, formatHttpIdleTimeoutMs } from "../../core/http-dispatcher.js";
|
|
20
21
|
import { detectInjectedPrompt } from "../../core/injected-prompt.js";
|
|
21
22
|
import { KeybindingsManager } from "../../core/keybindings.js";
|
|
@@ -37,7 +38,7 @@ import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
|
37
38
|
import { buildSwarmPrompt } from "../../core/swarm.js";
|
|
38
39
|
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
|
|
39
40
|
import { collectUsageHistory } from "../../core/usage-history.js";
|
|
40
|
-
import {
|
|
41
|
+
import { getPlanUsageResult } from "../../core/usage-service.js";
|
|
41
42
|
import { modelToUserEntry } from "../../core/user-models.js";
|
|
42
43
|
import { copyToClipboard, readClipboardText } from "../../utils/clipboard.js";
|
|
43
44
|
import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
|
|
@@ -4654,6 +4655,28 @@ export class InteractiveMode {
|
|
|
4654
4655
|
}
|
|
4655
4656
|
}
|
|
4656
4657
|
if (providerOption.authType === "oauth") {
|
|
4658
|
+
if (providerOption.id === "xai" && hasGrokCliXaiAuth()) {
|
|
4659
|
+
const choice = await this.showExtensionSelector("xAI SuperGrok is already signed in via Grok CLI.", [
|
|
4660
|
+
"Use existing Grok CLI login",
|
|
4661
|
+
"Sign in again",
|
|
4662
|
+
]);
|
|
4663
|
+
if (choice === undefined)
|
|
4664
|
+
return;
|
|
4665
|
+
if (choice === "Use existing Grok CLI login") {
|
|
4666
|
+
try {
|
|
4667
|
+
const imported = await this.session.modelRuntime.importGrokCliXaiAuth();
|
|
4668
|
+
if (!imported) {
|
|
4669
|
+
this.showError("Could not read the Grok CLI SuperGrok session. Run /login xai again.");
|
|
4670
|
+
return;
|
|
4671
|
+
}
|
|
4672
|
+
await this.completeProviderAuthentication(providerOption.id, providerOption.name, "oauth", this.session.model, { actionLabel: "Imported Grok CLI login", savedNote: "Using ~/.grok/auth.json" });
|
|
4673
|
+
}
|
|
4674
|
+
catch (error) {
|
|
4675
|
+
this.showError(`Failed to import Grok CLI login: ${error instanceof Error ? error.message : String(error)}`);
|
|
4676
|
+
}
|
|
4677
|
+
return;
|
|
4678
|
+
}
|
|
4679
|
+
}
|
|
4657
4680
|
await this.showLoginDialog(providerOption.id, providerOption.name);
|
|
4658
4681
|
}
|
|
4659
4682
|
else if (providerOption.method?.login) {
|
|
@@ -5867,11 +5890,13 @@ export class InteractiveMode {
|
|
|
5867
5890
|
: undefined;
|
|
5868
5891
|
const context = this.session.getContextUsage();
|
|
5869
5892
|
const provider = this.session.model?.provider;
|
|
5870
|
-
const
|
|
5893
|
+
const planResult = provider ? await getPlanUsageResult(provider, this.session.modelRuntime) : {};
|
|
5871
5894
|
const history = this.collectUsageHistorySafe();
|
|
5872
|
-
const lines = renderUsageBox({ sessionTotals, context, plan, history }, this.ui.terminal.columns);
|
|
5895
|
+
const lines = renderUsageBox({ sessionTotals, context, plan: planResult.usage, history }, this.ui.terminal.columns);
|
|
5873
5896
|
this.chatContainer.addChild(new Spacer(1));
|
|
5874
5897
|
this.chatContainer.addChild(new Text(lines.join("\n"), 1, 0));
|
|
5898
|
+
if (planResult.error)
|
|
5899
|
+
this.showStatus(planResult.error);
|
|
5875
5900
|
this.ui.requestRender();
|
|
5876
5901
|
}
|
|
5877
5902
|
// lunr: /token-usage — per-model token breakdown for the current session and
|