frizz 0.7.3 → 0.7.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/dist/dev-child.js +20 -4
- package/package.json +1 -1
package/dist/dev-child.js
CHANGED
|
@@ -20647,11 +20647,17 @@ function windowsShimTarget(shimPath) {
|
|
|
20647
20647
|
return void 0;
|
|
20648
20648
|
}
|
|
20649
20649
|
}
|
|
20650
|
+
function searchPath(env) {
|
|
20651
|
+
const direct = env.PATH ?? env.Path ?? env.path;
|
|
20652
|
+
if (direct !== void 0) return direct;
|
|
20653
|
+
for (const [key, value] of Object.entries(env)) if (key.toLowerCase() === "path") return value ?? "";
|
|
20654
|
+
return "";
|
|
20655
|
+
}
|
|
20650
20656
|
function resolveClaudeExecutableAbsolute(bin, env = process.env) {
|
|
20651
20657
|
const candidate = bin && bin.length > 0 ? bin : "claude";
|
|
20652
20658
|
if (isAbsolute2(candidate)) return candidate;
|
|
20653
20659
|
const windows = process.platform === "win32";
|
|
20654
|
-
for (const dir of (env
|
|
20660
|
+
for (const dir of searchPath(env).split(delimiter)) {
|
|
20655
20661
|
if (!dir) continue;
|
|
20656
20662
|
if (windows) {
|
|
20657
20663
|
const exe = join14(dir, `${candidate}.exe`);
|
|
@@ -32453,7 +32459,11 @@ async function acquireLock(path) {
|
|
|
32453
32459
|
}
|
|
32454
32460
|
async function runClaudeUsage(claudeBin) {
|
|
32455
32461
|
const { stdout } = await execFileAsync(
|
|
32456
|
-
|
|
32462
|
+
// Never a bare name: on Windows `execFile("claude")` is ENOENT and `execFile("claude.cmd")` is
|
|
32463
|
+
// EINVAL (node refuses .cmd/.bat without a shell since CVE-2024-27980), so this reader could
|
|
32464
|
+
// never reach the CLI there and every quota refresh threw. See auth-status.ts for the measurement.
|
|
32465
|
+
// A resolver throw is a refresh failure like any other — the callers' stale-serving catch owns it.
|
|
32466
|
+
resolveClaudeExecutableAbsolute(claudeBin),
|
|
32457
32467
|
["-p", "/usage", "--safe-mode", "--output-format", "json", "--no-session-persistence", "--tools", ""],
|
|
32458
32468
|
{ encoding: "utf8", timeout: CLI_TIMEOUT_MS, maxBuffer: 2 * 1024 * 1024 }
|
|
32459
32469
|
);
|
|
@@ -32660,6 +32670,7 @@ var init_claude_quota = __esm({
|
|
|
32660
32670
|
"packages/server/src/backend/claude-quota.ts"() {
|
|
32661
32671
|
"use strict";
|
|
32662
32672
|
init_frizz_paths();
|
|
32673
|
+
init_claude_broker_host();
|
|
32663
32674
|
execFileAsync = promisify2(execFile2);
|
|
32664
32675
|
USAGE_URL = "https://api.anthropic.com/api/oauth/usage";
|
|
32665
32676
|
OAUTH_BETA = "oauth-2025-04-20";
|
|
@@ -34782,8 +34793,8 @@ function parseClaudeAuthStatusJson(stdout) {
|
|
|
34782
34793
|
}
|
|
34783
34794
|
}
|
|
34784
34795
|
async function readClaudeAuthStatusCli(opts) {
|
|
34785
|
-
const bin = opts?.claudeBin ?? "claude";
|
|
34786
34796
|
try {
|
|
34797
|
+
const bin = resolveClaudeExecutableAbsolute(opts?.claudeBin);
|
|
34787
34798
|
const { stdout } = await execFileAsync2(bin, ["auth", "status", "--json"], {
|
|
34788
34799
|
encoding: "utf8",
|
|
34789
34800
|
timeout: opts?.timeoutMs ?? 5e3,
|
|
@@ -34888,6 +34899,7 @@ var init_auth_status = __esm({
|
|
|
34888
34899
|
"use strict";
|
|
34889
34900
|
init_claude_quota();
|
|
34890
34901
|
init_codex();
|
|
34902
|
+
init_claude_broker_host();
|
|
34891
34903
|
execFileAsync2 = promisify4(execFile4);
|
|
34892
34904
|
ProviderAuthRequiredError = class extends Error {
|
|
34893
34905
|
backend;
|
|
@@ -44726,7 +44738,11 @@ function readThreadTranscript(project, storage, slug, backendFor) {
|
|
|
44726
44738
|
const found = discoverTranscriptId(logDirOf(project), row.session_id, { exclude });
|
|
44727
44739
|
return projectDeliveryLedger(found ? readTranscript(project, found) : msgs, ledger);
|
|
44728
44740
|
}
|
|
44729
|
-
if (FOREIGN_SESSION_ID_RE.test(slug))
|
|
44741
|
+
if (FOREIGN_SESSION_ID_RE.test(slug)) {
|
|
44742
|
+
const source = sourceForThread(project, storage, slug, backendFor);
|
|
44743
|
+
if (!source) return [];
|
|
44744
|
+
return source.backend === "codex" ? readCodexTranscriptFile(source.path, slug) : readTranscript(project, slug);
|
|
44745
|
+
}
|
|
44730
44746
|
return [];
|
|
44731
44747
|
}
|
|
44732
44748
|
function projectTranscriptAgentLifecycles(messages, lookup) {
|