@askalf/dario
Advanced tools
@@ -289,2 +289,4 @@ /** | ||
| }; | ||
| /** Test-only: drop the resolved-binary memo. */ | ||
| export declare function _resetClaudeBinCacheForTest(): void; | ||
| export declare function enumerateClaudeCandidates(): string[]; | ||
@@ -291,0 +293,0 @@ /** |
@@ -590,7 +590,28 @@ /** | ||
| } | ||
| // Resolving the binary means enumerating candidates and, when there is more | ||
| // than one, SPAWNING each to compare versions. That is a subprocess per | ||
| // candidate per call, and there are four call sites (refresh, capture, | ||
| // findInstalledCC, drift). Profiling a proxy start showed ~720ms of blocking | ||
| // spawnSync, over half of a ~1270ms startup, from repeating this and the | ||
| // version probe. The installed binary cannot change mid-process, so resolve | ||
| // once. Keyed on the override so a test flipping DARIO_CLAUDE_BIN is not served | ||
| // a stale answer. | ||
| let _claudeBinCache = null; | ||
| /** Test-only: drop the resolved-binary memo. */ | ||
| export function _resetClaudeBinCacheForTest() { | ||
| _claudeBinCache = null; | ||
| } | ||
| function findClaudeBinary() { | ||
| // Honor an explicit override first — useful for tests and for users on | ||
| // non-standard installs. | ||
| if (process.env.DARIO_CLAUDE_BIN) | ||
| return process.env.DARIO_CLAUDE_BIN; | ||
| const override = process.env.DARIO_CLAUDE_BIN; | ||
| if (override) | ||
| return override; | ||
| if (_claudeBinCache && _claudeBinCache.key === '') | ||
| return _claudeBinCache.value; | ||
| const resolved = resolveClaudeBinaryUncached(); | ||
| _claudeBinCache = { key: '', value: resolved }; | ||
| return resolved; | ||
| } | ||
| function resolveClaudeBinaryUncached() { | ||
| const candidates = enumerateClaudeCandidates(); | ||
@@ -597,0 +618,0 @@ if (candidates.length === 0) |
+1
-1
| { | ||
| "name": "@askalf/dario", | ||
| "version": "5.4.20", | ||
| "version": "5.4.21", | ||
| "description": "Use your Claude Pro/Max subscription in any tool — Cursor, Cline, Aider, the Agent SDK, your scripts — at subscription pricing, not per-token API bills. One local Anthropic + OpenAI-compatible endpoint.", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
1734386
0.09%28731
0.1%124
-0.8%39
-2.5%