openlimiter 2.0.3 → 2.0.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.
- package/README.md +3 -1
- package/dist/api-spend.d.ts +1 -3
- package/dist/api-spend.d.ts.map +1 -1
- package/dist/api-spend.js +11 -15
- package/dist/api-spend.js.map +1 -1
- package/dist/bin.js +1 -0
- package/dist/bin.js.map +1 -1
- package/dist/cli.d.ts +6 -20
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +78 -44
- package/dist/cli.js.map +1 -1
- package/dist/config.d.ts +4 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +22 -5
- package/dist/config.js.map +1 -1
- package/dist/hub-sync.d.ts +4 -2
- package/dist/hub-sync.d.ts.map +1 -1
- package/dist/hub-sync.js +40 -9
- package/dist/hub-sync.js.map +1 -1
- package/dist/ingest.d.ts +2 -0
- package/dist/ingest.d.ts.map +1 -1
- package/dist/ingest.js +14 -62
- package/dist/ingest.js.map +1 -1
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +42 -11
- package/dist/render.js.map +1 -1
- package/dist/statusline.d.ts +3 -1
- package/dist/statusline.d.ts.map +1 -1
- package/dist/statusline.js +188 -45
- package/dist/statusline.js.map +1 -1
- package/dist/terminal.d.ts.map +1 -1
- package/dist/terminal.js +5 -5
- package/dist/terminal.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -65,7 +65,7 @@ openlimiter status --agent-context
|
|
|
65
65
|
|
|
66
66
|
| Provider | Connects by | Reads |
|
|
67
67
|
|---|---|---|
|
|
68
|
-
| Claude |
|
|
68
|
+
| Claude | Setup asks once in a terminal | The Claude Code status line automatically; the recorded `providers.claude.poll` choice controls direct usage requests when Claude Code is closed |
|
|
69
69
|
| Codex | Use the login already there, or sign in from inside OpenLimiter | The login the Codex CLI stored |
|
|
70
70
|
| Gemini CLI | Read only, from the login already there | The login the Gemini CLI stored |
|
|
71
71
|
| Antigravity | Read only, from the credential already there | The credential the Antigravity CLI stored |
|
|
@@ -77,4 +77,6 @@ openlimiter status --agent-context
|
|
|
77
77
|
|
|
78
78
|
`openlimiter refresh` is what reaches the network, at most once every fifteen minutes per provider: it reads the logins your provider tools already stored and asks each provider for its own usage. It stands down while the desktop app is running, and `statusline`, `snapshot` and `setup` all start it in the background on their own. OpenLimiter never asks for a vendor password, never impersonates a vendor tool, and never uploads a token.
|
|
79
79
|
|
|
80
|
+
Claude has two independent switches. Show Fable limit in the desktop app controls the desktop process. To stop it, open Settings, then Show Fable limit, then turn it off. `providers.claude.poll` controls the command line process. To stop it, run `openlimiter config set providers.claude.poll false`. Terminal setup asks once, and unattended setup records off. The request goes directly to the usage endpoint with your local Claude credentials. Anthropic's policy for tools like this is unresolved.
|
|
81
|
+
|
|
80
82
|
Read the [documentation](https://openlimiter.com/docs) or browse the [repository](https://github.com/lucaswebsystems/openlimiter).
|
package/dist/api-spend.d.ts
CHANGED
|
@@ -20,9 +20,7 @@ export interface MoneyCell {
|
|
|
20
20
|
}
|
|
21
21
|
export interface MoneyOptions {
|
|
22
22
|
readonly now: string;
|
|
23
|
-
/**
|
|
24
|
-
readonly hasOpenRouter: boolean;
|
|
25
|
-
/** Whether a provider name (`openai`, `openrouter`...) may be drawn. */
|
|
23
|
+
/** Whether a provider name may be drawn. */
|
|
26
24
|
readonly allowed: (provider: string) => boolean;
|
|
27
25
|
}
|
|
28
26
|
export declare function moneyCells(document: unknown, options: MoneyOptions): readonly MoneyCell[];
|
package/dist/api-spend.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-spend.d.ts","sourceRoot":"","sources":["../src/api-spend.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD,8EAA8E;AAC9E,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMvD,CAAC;
|
|
1
|
+
{"version":3,"file":"api-spend.d.ts","sourceRoot":"","sources":["../src/api-spend.ts"],"names":[],"mappings":"AAGA;;;;;;;;GAQG;AAEH,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD,8EAA8E;AAC9E,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMvD,CAAC;AAMF,wBAAsB,YAAY,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAG3E;AAED,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,qFAAqF;IACrF,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,4CAA4C;IAC5C,QAAQ,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,OAAO,CAAC;CACjD;AAuBD,wBAAgB,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,GAAG,SAAS,SAAS,EAAE,CAsDzF"}
|
package/dist/api-spend.js
CHANGED
|
@@ -18,6 +18,7 @@ export const MONEY_TAGS = {
|
|
|
18
18
|
moonshot: "ms",
|
|
19
19
|
deepseek: "ds"
|
|
20
20
|
};
|
|
21
|
+
const BALANCE_PROVIDERS = new Set(["moonshot", "deepseek"]);
|
|
21
22
|
const MAX_SOURCES = 64;
|
|
22
23
|
export async function readApiSpend(stateDirectory) {
|
|
23
24
|
const result = await readJsonFileSafely(path.join(stateDirectory, API_SPEND_FILE_NAME)).catch(() => null);
|
|
@@ -58,7 +59,6 @@ export function moneyCells(document, options) {
|
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
const cells = [];
|
|
61
|
-
let openRouter;
|
|
62
62
|
for (const source of document["sources"].slice(0, MAX_SOURCES)) {
|
|
63
63
|
if (!isRecord(source) || source["enabled"] !== true || typeof source["id"] !== "string")
|
|
64
64
|
continue;
|
|
@@ -68,8 +68,11 @@ export function moneyCells(document, options) {
|
|
|
68
68
|
const sample = newest.get(source["id"]);
|
|
69
69
|
if (sample === undefined)
|
|
70
70
|
continue;
|
|
71
|
-
|
|
72
|
-
if (
|
|
71
|
+
// OpenRouter monthly spend is not the account's remaining credit balance.
|
|
72
|
+
if (provider === "openrouter")
|
|
73
|
+
continue;
|
|
74
|
+
const tag = MONEY_TAGS[provider];
|
|
75
|
+
if (tag === undefined)
|
|
73
76
|
continue;
|
|
74
77
|
const stale = freshnessPolicy({
|
|
75
78
|
sourceClass: "internal_payload", observedAt: String(sample["observedAt"]), now: options.now, writer: "desktop"
|
|
@@ -77,7 +80,9 @@ export function moneyCells(document, options) {
|
|
|
77
80
|
const prefix = tag + " ";
|
|
78
81
|
const mark = stale ? "~" : "";
|
|
79
82
|
const usd = sample["currencySource"] === "provider_usd";
|
|
80
|
-
|
|
83
|
+
/* Moonshot's available_balance and DeepSeek's balance are current balances,
|
|
84
|
+
never spend for the current month. */
|
|
85
|
+
if (BALANCE_PROVIDERS.has(provider)) {
|
|
81
86
|
const balance = decimal(sample["balanceUsd"]);
|
|
82
87
|
const tooLow = source["status"] === "too_low_for_api_calls";
|
|
83
88
|
if (usd && balance !== null) {
|
|
@@ -97,17 +102,8 @@ export function moneyCells(document, options) {
|
|
|
97
102
|
if (!usd || spend === null || sample["month"] !== month)
|
|
98
103
|
continue;
|
|
99
104
|
const amount = mark + money(spend);
|
|
100
|
-
|
|
101
|
-
const cell = { plain: prefix + amount + suffix, prefix, amount: amount + suffix, band: budgetBand(spend, source["budgetUsd"]) };
|
|
102
|
-
if (provider === "openrouter") {
|
|
103
|
-
// One `or` cell at most: the most recently observed source wins, the first on a tie.
|
|
104
|
-
const observedAt = Date.parse(String(sample["observedAt"]));
|
|
105
|
-
if (openRouter !== undefined && observedAt <= openRouter.observedAt)
|
|
106
|
-
continue;
|
|
107
|
-
openRouter = { cell, observedAt };
|
|
108
|
-
}
|
|
109
|
-
cells.push(cell);
|
|
105
|
+
cells.push({ plain: prefix + amount, prefix, amount, band: budgetBand(spend, source["budgetUsd"]) });
|
|
110
106
|
}
|
|
111
|
-
return cells
|
|
107
|
+
return cells;
|
|
112
108
|
}
|
|
113
109
|
//# sourceMappingURL=api-spend.js.map
|
package/dist/api-spend.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-spend.js","sourceRoot":"","sources":["../src/api-spend.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAExE;;;;;;;;GAQG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC;AAEvD,8EAA8E;AAC9E,MAAM,CAAC,MAAM,UAAU,GAAqC;IAC1D,MAAM,EAAE,IAAI;IACZ,SAAS,EAAE,IAAI;IACf,GAAG,EAAE,IAAI;IACT,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,IAAI;CACf,CAAC;AAEF,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,cAAsB;IACvD,MAAM,MAAM,GAAG,MAAM,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC;IAC1G,OAAO,MAAM,EAAE,EAAE,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACxD,CAAC;
|
|
1
|
+
{"version":3,"file":"api-spend.js","sourceRoot":"","sources":["../src/api-spend.ts"],"names":[],"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AAK,cAAc;gBAC7E,MAAM,CAAC,YAAY,CAAC,IAAI,IAAI,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,IAAI,EAAE,CAAC;gBAC/D,wEAAwE;gBACxE,MAAM,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC;gBAC5B,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;YACrE,CAAC;YACD,SAAS;QACX,CAAC;QACD,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC;QAC1C,+EAA+E;QAC/E,IAAI,CAAC,GAAG,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,KAAK;YAAE,SAAS;QAClE,MAAM,MAAM,GAAG,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;QACnC,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC;IACvG,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/bin.js
CHANGED
|
@@ -92,6 +92,7 @@ else {
|
|
|
92
92
|
...runtime,
|
|
93
93
|
promptForSecret,
|
|
94
94
|
promptChoice,
|
|
95
|
+
interactive: process.stdin.isTTY === true && process.stdout.isTTY === true,
|
|
95
96
|
...(controller === null ? {} : { interruptSignal: controller.signal }),
|
|
96
97
|
readStandardInput: async (signal) => argumentsList[0] === "event"
|
|
97
98
|
? (await import("./activity/event.js")).readEventInput(signal)
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";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M,CAAC,QAAQ,CAAC;AACrC,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AcquisitionSpec, type AcquisitionTransport, type CredentialCommandRunner, type DetachedSpawn, type ProviderFailure, type Snapshot } from "@openlimiter/core";
|
|
2
2
|
import { type AgentId, type AgentInstallation, type HostedContextTrust, type HostedTrustLoadOptions } from "@openlimiter/adapters";
|
|
3
3
|
import { type ProvidersConfig } from "./config.js";
|
|
4
4
|
import { type CredentialStore } from "./credentials.js";
|
|
@@ -62,30 +62,16 @@ export interface CliDependencies {
|
|
|
62
62
|
/**
|
|
63
63
|
* How the Windows Credential Manager is asked for one entry.
|
|
64
64
|
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
65
|
+
* This remains injectable so terminal shell discovery never touches a real
|
|
66
|
+
* user profile in tests.
|
|
67
67
|
*/
|
|
68
68
|
windowsCredentialRunner?: CredentialCommandRunner;
|
|
69
|
-
/**
|
|
70
|
-
* Probe running Antigravity instances on loopback ports.
|
|
71
|
-
*
|
|
72
|
-
* Reaches nothing by default in tests. The real executable injects the real
|
|
73
|
-
* loopback probe.
|
|
74
|
-
*/
|
|
75
|
-
probeAntigravity?: (options?: AntigravityProbeOptions) => Promise<AntigravityProbeResult>;
|
|
76
|
-
/**
|
|
77
|
-
* Turn a pid the Antigravity probe found listening into the executable path
|
|
78
|
-
* it checks against the trusted install roots.
|
|
79
|
-
*
|
|
80
|
-
* Reaches nothing by default in tests, exactly like `probeAntigravity`
|
|
81
|
-
* above: an unresolved pid is a pid the probe skips, never one it trusts on
|
|
82
|
-
* a bare process name. The real executable injects `resolveAgyExecutablePath`.
|
|
83
|
-
*/
|
|
84
|
-
resolveExecutablePath?: (pid: string) => Promise<string | null>;
|
|
85
69
|
/**
|
|
86
70
|
* Interactive prompt choice helper.
|
|
87
71
|
*/
|
|
88
72
|
promptChoice?: (question: string) => Promise<string>;
|
|
73
|
+
/** True only when both terminal input and output can answer a question. */
|
|
74
|
+
interactive?: boolean;
|
|
89
75
|
/**
|
|
90
76
|
* How a hub request leaves this machine.
|
|
91
77
|
*
|
|
@@ -149,7 +135,7 @@ export interface BrowserOpenInvocation {
|
|
|
149
135
|
}
|
|
150
136
|
/** Build a direct browser opener invocation without a command shell. */
|
|
151
137
|
export declare function browserOpenInvocation(url: string, platform: NodeJS.Platform, environment?: Readonly<Record<string, string | undefined>>): BrowserOpenInvocation | null;
|
|
152
|
-
export declare function runtimeDependencies(): Pick<CliDependencies, "acquisitionTransport" | "spawnDetached" | "windowsCredentialRunner" | "
|
|
138
|
+
export declare function runtimeDependencies(): Pick<CliDependencies, "acquisitionTransport" | "spawnDetached" | "windowsCredentialRunner" | "hubTransport" | "openBrowser" | "emit" | "windowsAclRunner" | "codexDeviceLoginRunnerFactory">;
|
|
153
139
|
export interface RefreshResult {
|
|
154
140
|
snapshots: Snapshot[];
|
|
155
141
|
/** Only genuine failures. A connector offered nothing is not one. */
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EA4CL,KAAK,
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EA4CL,KAAK,eAAe,EACpB,KAAK,oBAAoB,EAGzB,KAAK,uBAAuB,EAE5B,KAAK,aAAa,EAGlB,KAAK,eAAe,EAEpB,KAAK,QAAQ,EACd,MAAM,mBAAmB,CAAC;AAsB3B,OAAO,EAWL,KAAK,OAAO,EACZ,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,EACvB,KAAK,sBAAsB,EAE5B,MAAM,uBAAuB,CAAC;AAM/B,OAAO,EAgBL,KAAK,eAAe,EAGrB,MAAM,aAAa,CAAC;AAsBrB,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;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AgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,CAAC,QAAQ,EACzB,WAAW,GAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAe,GACtE,qBAAqB,GAAG,IAAI,CAyB9B;AAqBD,wBAAgB,mBAAmB,IAAI,IAAI,CACzC,eAAe,EACb,sBAAsB,GACtB,eAAe,GACf,yBAAyB,GACzB,cAAc,GACd,aAAa,GACb,MAAM,GACN,kBAAkB,GAClB,+BAA+B,CAClC,CAgCA;AA0DD,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,QAAQ,EAAE,CAAC;IACtB,qEAAqE;IACrE,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAC;CACtC;AAqED;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,eAAe,GAAG,eAAe,EAAE,CAa9E;AAowDD,wBAAsB,MAAM,CAC1B,aAAa,EAAE,SAAS,MAAM,EAAE,EAChC,SAAS,GAAE,OAAO,CAAC,eAAe,CAAM,GACvC,OAAO,CAAC,SAAS,CAAC,CAwFpB"}
|
package/dist/cli.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { ACQUISITION_OUTCOME_SENTENCE, captureStatuslineAccount, pruneSnapshotCache, ACQUISITION_PROVIDERS, registerManagedCodexAccount, CREDENTIAL_FAILURE_SENTENCE, PROVIDER_CODES, acquireRefreshLock, clearRefreshSpawnFailure, mergeAcquiredSnapshots, createFetchTransport, readRefreshSpawnFailure,
|
|
2
|
-
import { antigravityFixture, claudeFixture, codexFixture, grokFixture, kimiFixture, connectors, manualFixture, opencodeFixture, openrouterFixture,
|
|
3
|
-
import { AGENT_COMPATIBILITY, agentContextFromCache, agentContextSpillFromCache, agentVersionCompatibility, changeAgentHook, detectAgentInstallation, readAgentHookStatus, runAgentHook, validateAgentExecutableStamp, writeAgentContextSnapshot, loadHostedContextTrust,
|
|
1
|
+
import { ACQUISITION_OUTCOME_SENTENCE, captureStatuslineAccount, pruneSnapshotCache, ACQUISITION_PROVIDERS, registerManagedCodexAccount, CREDENTIAL_FAILURE_SENTENCE, PROVIDER_CODES, acquireRefreshLock, clearRefreshSpawnFailure, mergeAcquiredSnapshots, createFetchTransport, readRefreshSpawnFailure, buildAdvice, canonicalJson, claudeSpec, codexSpec, cursorSpec, dedupeFailures, desktopHoldsCache, failureFromConnectorReason, freshness, geminiCliSpec, grokSpec, isProviderDue, kimiSpec, mergeSnapshotCache, mergeSnapshots, normalizeMeters, normalizeMetersReport, openrouterSpec, readAcquisitionCredential, readAcquisitionSchedule, readSnapshotCache, readWindowsCredentialWith, resolveStateDirectory, runAcquisition, spawnDetachedRefresh, trustedHelperWorkingDirectory, writeAcquisitionSchedule, windowsSystemTool } from "@openlimiter/core";
|
|
2
|
+
import { antigravityFixture, claudeFixture, codexFixture, grokFixture, kimiFixture, connectors, manualFixture, opencodeFixture, openrouterFixture, parseAntigravityPayload, parseClaudePayload, parseCodexPayload, parseCursorPayload, parseGeminiCliPayload, parseGrokPayload, parseKimiPayload, parseManualPayload, parseOpencodePayload, parseOpenrouterPayload } from "@openlimiter/connectors";
|
|
3
|
+
import { AGENT_COMPATIBILITY, agentContextFromCache, agentContextSpillFromCache, agentVersionCompatibility, changeAgentHook, detectAgentInstallation, readAgentHookStatus, runAgentHook, validateAgentExecutableStamp, writeAgentContextSnapshot, loadHostedContextTrust, } from "@openlimiter/adapters";
|
|
4
4
|
import { execFile, spawn } from "node:child_process";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
import packageJson from "../package.json" with { type: "json" };
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { PROVIDER_KEYS, STATUSLINE_KEYS, defaultConfig, initialize, isProviderKey, isStatuslineKey, providerValueText, readConfig, readProvidersConfig, readStatuslineConfig, setProviderValue, setStatuslineValue, statuslineValueText, writeConfig } from "./config.js";
|
|
10
|
-
import { ACQUISITION_PROVENANCE, ANTIGRAVITY_STATUSLINE_PROVENANCE, GROK_STATUSLINE_PROVENANCE, INGEST_PROVENANCE, MANUAL_PROVENANCE, STATUSLINE_PROVENANCE, environmentWithLocalMarkers, STDIN_BYTE_LIMIT, parseAntigravityStatuslinePayload, parseGrokStatuslinePayload, parseJsonText, persistSnapshots, clearStatuslineFailure, readStatuslineFailure, recordStatuslineFailure, readManualDocument, withProvenance } from "./ingest.js";
|
|
10
|
+
import { ACQUISITION_PROVENANCE, ANTIGRAVITY_STATUSLINE_PROVENANCE, GROK_STATUSLINE_PROVENANCE, INGEST_PROVENANCE, MANUAL_PROVENANCE, STATUSLINE_PROVENANCE, environmentWithLocalMarkers, STDIN_BYTE_LIMIT, parseAntigravityStatuslinePayload, antigravityStatuslineAccount, parseGrokStatuslinePayload, parseJsonText, persistSnapshots, clearStatuslineFailure, readStatuslineFailure, recordStatuslineFailure, readManualDocument, withProvenance } from "./ingest.js";
|
|
11
11
|
import { UnavailableCredentialStore } from "./credentials.js";
|
|
12
12
|
import { failureLine, failureLines, renderTable, supportsColor } from "./render.js";
|
|
13
|
-
import { isStatuslineHost, renderStatuslineLayout, statuslineColor, statuslineUnicode } from "./statusline.js";
|
|
13
|
+
import { isStatuslineHost, renderPlainStatusline, renderStatuslineLayout, resolveProviderOrder, statuslineColor, statuslineUnicode } from "./statusline.js";
|
|
14
14
|
import { parseStatuslineSession } from "./statusline-ingest.js";
|
|
15
15
|
import { readApiSpend } from "./api-spend.js";
|
|
16
16
|
import { TERMINAL_HOST_NAMES, installHost, terminalHide, terminalShow, terminalStatusTable, uninstallHost } from "./terminal.js";
|
|
@@ -49,8 +49,8 @@ function defaults() {
|
|
|
49
49
|
throw new Error("No acquisition transport was injected");
|
|
50
50
|
},
|
|
51
51
|
spawnDetached: () => undefined,
|
|
52
|
-
probeAntigravity: async () => ({ ok: false, reason: "not_running" }),
|
|
53
52
|
promptChoice: async () => "",
|
|
53
|
+
interactive: false,
|
|
54
54
|
hubTransport: async () => {
|
|
55
55
|
throw new Error("No hub transport was injected");
|
|
56
56
|
},
|
|
@@ -169,11 +169,6 @@ function openBrowserPlatform(url, platform) {
|
|
|
169
169
|
export function runtimeDependencies() {
|
|
170
170
|
return {
|
|
171
171
|
acquisitionTransport: createFetchTransport(),
|
|
172
|
-
probeAntigravity: (options) => probeAntigravity({
|
|
173
|
-
...options,
|
|
174
|
-
runCommand: options?.runCommand ?? execFileRunner
|
|
175
|
-
}),
|
|
176
|
-
resolveExecutablePath: resolveAgyExecutablePath,
|
|
177
172
|
spawnDetached: (executable, argumentsList, options) => {
|
|
178
173
|
const child = spawn(executable, [...argumentsList], {
|
|
179
174
|
cwd: options.cwd,
|
|
@@ -320,11 +315,13 @@ async function refresh(dependencies, now) {
|
|
|
320
315
|
*/
|
|
321
316
|
export function acquisitionSpecs(providers) {
|
|
322
317
|
return [
|
|
323
|
-
claudeSpec({
|
|
318
|
+
claudeSpec({
|
|
319
|
+
parse: parseClaudePayload,
|
|
320
|
+
enabled: providers.claude.recorded && providers.claude.poll
|
|
321
|
+
}),
|
|
324
322
|
codexSpec(parseCodexPayload),
|
|
325
323
|
cursorSpec(parseCursorPayload),
|
|
326
324
|
geminiCliSpec(parseGeminiCliPayload),
|
|
327
|
-
antigravitySpec(parseAntigravityCodeAssistPayload),
|
|
328
325
|
grokSpec(parseGrokPayload),
|
|
329
326
|
kimiSpec(parseKimiPayload),
|
|
330
327
|
openrouterSpec(parseOpenrouterPayload)
|
|
@@ -369,7 +366,7 @@ function credentialReader(dependencies) {
|
|
|
369
366
|
}
|
|
370
367
|
};
|
|
371
368
|
}
|
|
372
|
-
|
|
369
|
+
const result = await readAcquisitionCredential(provider, {
|
|
373
370
|
...(dependencies.stateDirectory === undefined ? {} : { stateDirectory: dependencies.stateDirectory }),
|
|
374
371
|
platform: dependencies.platform,
|
|
375
372
|
environment: dependencies.environment,
|
|
@@ -381,6 +378,26 @@ function credentialReader(dependencies) {
|
|
|
381
378
|
readWindowsCredential: async (target) => await readWindowsCredentialWith(target, { runCommand: runner })
|
|
382
379
|
})
|
|
383
380
|
});
|
|
381
|
+
if (provider !== "CODEX" || !result.ok)
|
|
382
|
+
return result;
|
|
383
|
+
const installation = Object.prototype.hasOwnProperty.call(dependencies.detectedAgentInstallations, "codex")
|
|
384
|
+
? dependencies.detectedAgentInstallations.codex ?? null
|
|
385
|
+
: await detectAgentInstallation("codex", {
|
|
386
|
+
environment: dependencies.environment,
|
|
387
|
+
platform: dependencies.platform,
|
|
388
|
+
runCommand: async (executable, argumentsList, timeoutMilliseconds) => {
|
|
389
|
+
const command = await execFileRunner(executable, argumentsList, timeoutMilliseconds);
|
|
390
|
+
return command.ok
|
|
391
|
+
? { ok: true, stdout: command.stdout, stderr: "" }
|
|
392
|
+
: command;
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
if (installation === null)
|
|
396
|
+
return { ok: false, reason: "absent" };
|
|
397
|
+
return {
|
|
398
|
+
ok: true,
|
|
399
|
+
credential: { ...result.credential, executable: installation.executable }
|
|
400
|
+
};
|
|
384
401
|
};
|
|
385
402
|
}
|
|
386
403
|
/**
|
|
@@ -489,27 +506,9 @@ async function acquisitionDoctorRows(dependencies, snapshots, now) {
|
|
|
489
506
|
}
|
|
490
507
|
return [ACQUISITION_HEADER, ...rows].join(NEWLINE);
|
|
491
508
|
}
|
|
492
|
-
/**
|
|
493
|
-
* Where a person can still see a reading this row could not take.
|
|
494
|
-
*
|
|
495
|
-
* Antigravity and Gemini CLI meter the same Google Code Assist pool. When
|
|
496
|
-
* Google withholds the reading from this client but another tool on the machine
|
|
497
|
-
* has already written one, the honest thing is to point at it rather than leave
|
|
498
|
-
* a bare refusal, so the person knows the number exists and where.
|
|
499
|
-
*/
|
|
500
|
-
function sharedQuotaNote(row, snapshots) {
|
|
501
|
-
if (row.provider !== "ANTIGRAVITY")
|
|
502
|
-
return null;
|
|
503
|
-
return snapshots.some((snapshot) => snapshot.provider === "GEMINI_CLI")
|
|
504
|
-
? "the shared Code Assist quota is shown under gemini_cli"
|
|
505
|
-
: null;
|
|
506
|
-
}
|
|
507
509
|
/** One row of the refresh report, in the space separated grammar doctor uses. */
|
|
508
|
-
function acquisitionLine(row,
|
|
509
|
-
const
|
|
510
|
-
const note = [row.reason ?? row.disclosure ?? "", shared ?? ""]
|
|
511
|
-
.filter((part) => part !== "")
|
|
512
|
-
.join(", ");
|
|
510
|
+
function acquisitionLine(row, _snapshots = []) {
|
|
511
|
+
const note = row.reason ?? row.disclosure ?? "";
|
|
513
512
|
return [
|
|
514
513
|
row.provider.toLowerCase(),
|
|
515
514
|
row.detected ? "yes" : "no",
|
|
@@ -560,13 +559,7 @@ async function refreshCommand(dependencies, now) {
|
|
|
560
559
|
now,
|
|
561
560
|
schedule,
|
|
562
561
|
readCredential: credentialReader(dependencies),
|
|
563
|
-
stamp: acquisitionStamp
|
|
564
|
-
...(dependencies.probeAntigravity === undefined
|
|
565
|
-
? {}
|
|
566
|
-
: { probeAntigravity: dependencies.probeAntigravity }),
|
|
567
|
-
...(dependencies.resolveExecutablePath === undefined
|
|
568
|
-
? {}
|
|
569
|
-
: { resolveExecutablePath: dependencies.resolveExecutablePath })
|
|
562
|
+
stamp: acquisitionStamp
|
|
570
563
|
});
|
|
571
564
|
/*
|
|
572
565
|
* Ownership is checked before every write, not once at the start. A round
|
|
@@ -752,12 +745,15 @@ async function ingestStandardInput(dependencies, now, host = "claude") {
|
|
|
752
745
|
if (host === "codex" || host === "shell")
|
|
753
746
|
return null;
|
|
754
747
|
try {
|
|
755
|
-
const
|
|
748
|
+
const accountIdBeforePayload = host === "antigravity" ? null : await captureStatuslineAccount(host === "grok" ? "GROK" : "CLAUDE", {
|
|
756
749
|
environment: dependencies.environment, homeDirectory: dependencies.homeDirectory, platform: dependencies.platform, ...(dependencies.stateDirectory ? { stateDirectory: dependencies.stateDirectory } : {}), now
|
|
757
750
|
});
|
|
758
751
|
const document = parseJsonText(await dependencies.readStandardInput());
|
|
759
752
|
if (!document.ok)
|
|
760
753
|
return null;
|
|
754
|
+
const accountId = host === "antigravity"
|
|
755
|
+
? antigravityStatuslineAccount(document.value)
|
|
756
|
+
: accountIdBeforePayload;
|
|
761
757
|
const meters = host === "antigravity"
|
|
762
758
|
? parseAntigravityStatuslinePayload(document.value, now)
|
|
763
759
|
: host === "grok"
|
|
@@ -803,6 +799,9 @@ async function ingestStandardInput(dependencies, now, host = "claude") {
|
|
|
803
799
|
async function initCommand(dependencies) {
|
|
804
800
|
const environment = await environmentWithLocalMarkers(dependencies.environment, dependencies.stateDirectory);
|
|
805
801
|
try {
|
|
802
|
+
if (!(await ensureClaudePollChoice(dependencies))) {
|
|
803
|
+
return fail(EXIT_FAILURE, "openlimiter init: configuration could not be written, so Claude usage stays off.");
|
|
804
|
+
}
|
|
806
805
|
const result = await initialize(environment, dependencies.credentialStore, dependencies.promptForSecret, dependencies.stateDirectory);
|
|
807
806
|
const detected = result.config.connectors
|
|
808
807
|
.filter((connector) => connector.detected)
|
|
@@ -1013,8 +1012,9 @@ async function statuslineCommand(dependencies, argumentsList, now) {
|
|
|
1013
1012
|
}
|
|
1014
1013
|
const advice = buildAdvice(snapshots, now, PROVIDER_CODES);
|
|
1015
1014
|
const config = await readStatuslineConfig(dependencies.stateDirectory);
|
|
1016
|
-
if (!config.bars)
|
|
1017
|
-
return succeed(
|
|
1015
|
+
if (!config.bars) {
|
|
1016
|
+
return succeed(renderPlainStatusline(advice, snapshots, now, resolveProviderOrder(config.order), config.meters));
|
|
1017
|
+
}
|
|
1018
1018
|
return succeed(renderStatuslineLayout({
|
|
1019
1019
|
advice,
|
|
1020
1020
|
snapshots,
|
|
@@ -1595,10 +1595,39 @@ async function triggerSyncAfterRefresh(dependencies, now) {
|
|
|
1595
1595
|
}
|
|
1596
1596
|
/* -------------------------------------------------------------- setup */
|
|
1597
1597
|
const SETUP_SIGN_IN_PROMPT = "Sign in to sync your bars to the hub and your phone (free)";
|
|
1598
|
+
const CLAUDE_POLL_DISCLOSURE = "OpenLimiter can read the same usage Claude shows by sending a direct usage request with your Claude sign in on this computer. Anthropic's policy for tools like this is unresolved.";
|
|
1599
|
+
const CLAUDE_POLL_QUESTION = "Show Fable limit? Enter to turn it on, N to keep it off: ";
|
|
1598
1600
|
async function promptOrSkip(dependencies, question) {
|
|
1601
|
+
if (!dependencies.interactive)
|
|
1602
|
+
return false;
|
|
1599
1603
|
const answer = await dependencies.promptChoice?.(question) ?? "";
|
|
1600
1604
|
return !answer.trim().toLowerCase().startsWith("s");
|
|
1601
1605
|
}
|
|
1606
|
+
/** Record one real Claude polling choice before any terminal acquisition. */
|
|
1607
|
+
async function ensureClaudePollChoice(dependencies) {
|
|
1608
|
+
const stored = await readConfig(dependencies.stateDirectory);
|
|
1609
|
+
if (!stored.ok && stored.reason !== "missing")
|
|
1610
|
+
return false;
|
|
1611
|
+
const config = stored.ok ? stored.config : defaultConfig(dependencies.environment);
|
|
1612
|
+
if (config.providers.claude.recorded)
|
|
1613
|
+
return true;
|
|
1614
|
+
let enabled = false;
|
|
1615
|
+
if (dependencies.interactive) {
|
|
1616
|
+
dependencies.emit(CLAUDE_POLL_DISCLOSURE);
|
|
1617
|
+
const answer = await dependencies.promptChoice?.(CLAUDE_POLL_QUESTION) ?? "n";
|
|
1618
|
+
enabled = !answer.trim().toLowerCase().startsWith("n");
|
|
1619
|
+
}
|
|
1620
|
+
try {
|
|
1621
|
+
await writeConfig({
|
|
1622
|
+
...config,
|
|
1623
|
+
providers: { claude: { poll: enabled, recorded: true } }
|
|
1624
|
+
}, dependencies.stateDirectory);
|
|
1625
|
+
return true;
|
|
1626
|
+
}
|
|
1627
|
+
catch {
|
|
1628
|
+
return false;
|
|
1629
|
+
}
|
|
1630
|
+
}
|
|
1602
1631
|
/** Step one: sign in, or say plainly why this machine did not. */
|
|
1603
1632
|
async function setupSignInStep(dependencies) {
|
|
1604
1633
|
const lines = ["1. Sign in", SETUP_SIGN_IN_PROMPT];
|
|
@@ -1813,6 +1842,9 @@ async function setupShowBarsStep(dependencies) {
|
|
|
1813
1842
|
async function setupCommand(dependencies, now) {
|
|
1814
1843
|
await setupSignInStep(dependencies);
|
|
1815
1844
|
await setupConnectStep(dependencies);
|
|
1845
|
+
if (!(await ensureClaudePollChoice(dependencies))) {
|
|
1846
|
+
dependencies.emit("Claude usage stays off because the choice could not be saved.");
|
|
1847
|
+
}
|
|
1816
1848
|
const collected = await refreshCommand(dependencies, now);
|
|
1817
1849
|
if (collected.exitCode !== 0 && collected.stderr !== "")
|
|
1818
1850
|
dependencies.emit(collected.stderr);
|
|
@@ -1824,9 +1856,11 @@ async function setupCommand(dependencies, now) {
|
|
|
1824
1856
|
export async function runCli(argumentsList, overrides = {}) {
|
|
1825
1857
|
const setupOutput = [];
|
|
1826
1858
|
const hasOutputSink = overrides.emit !== undefined;
|
|
1859
|
+
const interactive = overrides.interactive ?? overrides.promptChoice !== undefined;
|
|
1827
1860
|
const dependencies = {
|
|
1828
1861
|
...defaults(),
|
|
1829
1862
|
...overrides,
|
|
1863
|
+
interactive,
|
|
1830
1864
|
...(hasOutputSink ? {} : { emit: (line) => setupOutput.push(line) })
|
|
1831
1865
|
};
|
|
1832
1866
|
const command = argumentsList[0] ?? "setup";
|