@rynfar/meridian 1.41.0 → 1.41.1
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/{cli-swjr844z.js → cli-51a9sav0.js} +137 -63
- package/dist/{cli-0eky480v.js → cli-e289rj3k.js} +6 -3
- package/dist/cli.js +3 -3
- package/dist/proxy/adapters/droid.d.ts.map +1 -1
- package/dist/proxy/models.d.ts +26 -0
- package/dist/proxy/models.d.ts.map +1 -1
- package/dist/proxy/query.d.ts.map +1 -1
- package/dist/proxy/sdkFeatures.d.ts.map +1 -1
- package/dist/proxy/server.d.ts.map +1 -1
- package/dist/proxy/tokenRefresh.d.ts +11 -0
- package/dist/proxy/tokenRefresh.d.ts.map +1 -1
- package/dist/proxy/transforms/droid.d.ts.map +1 -1
- package/dist/server.js +2 -2
- package/dist/{tokenRefresh-3kh1e8q8.js → tokenRefresh-psq94r54.js} +4 -2
- package/package.json +1 -1
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
createPlatformCredentialStore,
|
|
29
29
|
refreshOAuthToken,
|
|
30
30
|
withClaudeLogContext
|
|
31
|
-
} from "./cli-
|
|
31
|
+
} from "./cli-e289rj3k.js";
|
|
32
32
|
import {
|
|
33
33
|
__commonJS,
|
|
34
34
|
__esm,
|
|
@@ -1179,13 +1179,13 @@ __export(exports_sdkFeatures, {
|
|
|
1179
1179
|
getAllFeatureConfigs: () => getAllFeatureConfigs
|
|
1180
1180
|
});
|
|
1181
1181
|
import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync4, writeFileSync as writeFileSync2, renameSync as renameSync2 } from "node:fs";
|
|
1182
|
-
import { join as
|
|
1183
|
-
import { homedir as
|
|
1182
|
+
import { join as join5 } from "node:path";
|
|
1183
|
+
import { homedir as homedir3 } from "node:os";
|
|
1184
1184
|
function getConfigPath() {
|
|
1185
|
-
const dir =
|
|
1185
|
+
const dir = join5(homedir3(), ".config", "meridian");
|
|
1186
1186
|
if (!existsSync5(dir))
|
|
1187
1187
|
mkdirSync2(dir, { recursive: true });
|
|
1188
|
-
return
|
|
1188
|
+
return join5(dir, "sdk-features.json");
|
|
1189
1189
|
}
|
|
1190
1190
|
function readConfig() {
|
|
1191
1191
|
const now = Date.now();
|
|
@@ -1283,7 +1283,7 @@ function resetAdapterFeatures(adapterName) {
|
|
|
1283
1283
|
var DEFAULT_FEATURES, ADAPTER_DEFAULTS, cachedConfig = null, lastReadTime = 0, CACHE_TTL_MS = 5000, VALID_CLAUDE_MD_VALUES, VALID_THINKING_VALUES;
|
|
1284
1284
|
var init_sdkFeatures = __esm(() => {
|
|
1285
1285
|
DEFAULT_FEATURES = {
|
|
1286
|
-
codeSystemPrompt:
|
|
1286
|
+
codeSystemPrompt: true,
|
|
1287
1287
|
clientSystemPrompt: true,
|
|
1288
1288
|
claudeMd: "off",
|
|
1289
1289
|
memory: false,
|
|
@@ -1296,7 +1296,11 @@ var init_sdkFeatures = __esm(() => {
|
|
|
1296
1296
|
sdkDebug: false,
|
|
1297
1297
|
additionalDirectories: ""
|
|
1298
1298
|
};
|
|
1299
|
-
ADAPTER_DEFAULTS = {
|
|
1299
|
+
ADAPTER_DEFAULTS = {
|
|
1300
|
+
passthrough: {
|
|
1301
|
+
codeSystemPrompt: false
|
|
1302
|
+
}
|
|
1303
|
+
};
|
|
1300
1304
|
VALID_CLAUDE_MD_VALUES = new Set(["off", "project", "full"]);
|
|
1301
1305
|
VALID_THINKING_VALUES = new Set(["adaptive", "enabled", "disabled"]);
|
|
1302
1306
|
});
|
|
@@ -3703,8 +3707,8 @@ var serve = (options, listeningListener) => {
|
|
|
3703
3707
|
};
|
|
3704
3708
|
|
|
3705
3709
|
// src/proxy/server.ts
|
|
3706
|
-
import { homedir as
|
|
3707
|
-
import { join as
|
|
3710
|
+
import { homedir as homedir4 } from "node:os";
|
|
3711
|
+
import { join as join6 } from "node:path";
|
|
3708
3712
|
import { query } from "@anthropic-ai/claude-agent-sdk";
|
|
3709
3713
|
|
|
3710
3714
|
// src/proxy/rateLimitStore.ts
|
|
@@ -9230,11 +9234,12 @@ function formatSdkTermination(t, ctx) {
|
|
|
9230
9234
|
|
|
9231
9235
|
// src/proxy/models.ts
|
|
9232
9236
|
import { exec as execCallback } from "child_process";
|
|
9233
|
-
import { existsSync as existsSync2 } from "fs";
|
|
9237
|
+
import { existsSync as existsSync2, statSync } from "fs";
|
|
9234
9238
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
9235
9239
|
import { join as join2, dirname as dirname2 } from "path";
|
|
9236
9240
|
import { promisify } from "util";
|
|
9237
9241
|
var exec = promisify(execCallback);
|
|
9242
|
+
var STUB_SIZE_THRESHOLD = 4096;
|
|
9238
9243
|
var CANONICAL_OPUS_MODEL = "claude-opus-4-7";
|
|
9239
9244
|
var CANONICAL_SONNET_MODEL = "claude-sonnet-4-6";
|
|
9240
9245
|
var CANONICAL_HAIKU_MODEL = "claude-haiku-4-5";
|
|
@@ -9374,40 +9379,92 @@ async function getClaudeAuthStatusAsync(profileId, envOverrides) {
|
|
|
9374
9379
|
}
|
|
9375
9380
|
var cachedClaudePath = null;
|
|
9376
9381
|
var cachedClaudePathPromise = null;
|
|
9382
|
+
var DEFAULT_DEPS = {
|
|
9383
|
+
existsSync: existsSync2,
|
|
9384
|
+
statSync: (p) => statSync(p),
|
|
9385
|
+
exec,
|
|
9386
|
+
resolvePackage: (specifier) => fileURLToPath2(import.meta.resolve(specifier)),
|
|
9387
|
+
envGet: (name) => process.env[name],
|
|
9388
|
+
platform: process.platform,
|
|
9389
|
+
arch: process.arch,
|
|
9390
|
+
isBun: typeof process.versions.bun !== "undefined"
|
|
9391
|
+
};
|
|
9392
|
+
function tryEnvOverride(deps) {
|
|
9393
|
+
const explicit = deps.envGet("MERIDIAN_CLAUDE_PATH");
|
|
9394
|
+
if (!explicit)
|
|
9395
|
+
return null;
|
|
9396
|
+
return deps.existsSync(explicit) ? explicit : null;
|
|
9397
|
+
}
|
|
9398
|
+
function tryBundledBinary(deps) {
|
|
9399
|
+
try {
|
|
9400
|
+
const pkgPath = deps.resolvePackage("@anthropic-ai/claude-code/package.json");
|
|
9401
|
+
const bundled = join2(dirname2(pkgPath), "bin", "claude.exe");
|
|
9402
|
+
if (!deps.existsSync(bundled))
|
|
9403
|
+
return null;
|
|
9404
|
+
const size = deps.statSync(bundled).size;
|
|
9405
|
+
if (size <= STUB_SIZE_THRESHOLD)
|
|
9406
|
+
return null;
|
|
9407
|
+
return bundled;
|
|
9408
|
+
} catch {
|
|
9409
|
+
return null;
|
|
9410
|
+
}
|
|
9411
|
+
}
|
|
9412
|
+
function tryPlatformPackage(deps) {
|
|
9413
|
+
const binName = deps.platform === "win32" ? "claude.exe" : "claude";
|
|
9414
|
+
const candidates = [`@anthropic-ai/claude-code-${deps.platform}-${deps.arch}`];
|
|
9415
|
+
if (deps.platform === "linux") {
|
|
9416
|
+
candidates.push(`@anthropic-ai/claude-code-${deps.platform}-${deps.arch}-musl`);
|
|
9417
|
+
}
|
|
9418
|
+
for (const pkg of candidates) {
|
|
9419
|
+
try {
|
|
9420
|
+
const pkgJson = deps.resolvePackage(`${pkg}/package.json`);
|
|
9421
|
+
const candidate = join2(dirname2(pkgJson), binName);
|
|
9422
|
+
if (deps.existsSync(candidate))
|
|
9423
|
+
return candidate;
|
|
9424
|
+
} catch {}
|
|
9425
|
+
}
|
|
9426
|
+
return null;
|
|
9427
|
+
}
|
|
9428
|
+
async function tryPathLookup(deps) {
|
|
9429
|
+
const cmd = deps.platform === "win32" ? "where claude" : "which claude";
|
|
9430
|
+
try {
|
|
9431
|
+
const { stdout } = await deps.exec(cmd);
|
|
9432
|
+
const candidates = stdout.split(/\r?\n/).map((s) => s.trim()).filter(Boolean);
|
|
9433
|
+
for (const candidate of candidates) {
|
|
9434
|
+
if (deps.platform === "win32" && candidate.startsWith("/"))
|
|
9435
|
+
continue;
|
|
9436
|
+
if (deps.existsSync(candidate))
|
|
9437
|
+
return candidate;
|
|
9438
|
+
}
|
|
9439
|
+
} catch {}
|
|
9440
|
+
return null;
|
|
9441
|
+
}
|
|
9442
|
+
function tryLegacySdkCliJs(deps) {
|
|
9443
|
+
if (!deps.isBun)
|
|
9444
|
+
return null;
|
|
9445
|
+
try {
|
|
9446
|
+
const sdkPath = deps.resolvePackage("@anthropic-ai/claude-agent-sdk");
|
|
9447
|
+
const cliJs = join2(dirname2(sdkPath), "cli.js");
|
|
9448
|
+
return deps.existsSync(cliJs) ? cliJs : null;
|
|
9449
|
+
} catch {
|
|
9450
|
+
return null;
|
|
9451
|
+
}
|
|
9452
|
+
}
|
|
9453
|
+
async function resolveClaudeExecutable(deps = DEFAULT_DEPS) {
|
|
9454
|
+
return tryEnvOverride(deps) ?? tryBundledBinary(deps) ?? tryPlatformPackage(deps) ?? await tryPathLookup(deps) ?? tryLegacySdkCliJs(deps);
|
|
9455
|
+
}
|
|
9377
9456
|
async function resolveClaudeExecutableAsync() {
|
|
9378
9457
|
if (cachedClaudePath)
|
|
9379
9458
|
return cachedClaudePath;
|
|
9380
9459
|
if (cachedClaudePathPromise)
|
|
9381
9460
|
return cachedClaudePathPromise;
|
|
9382
9461
|
cachedClaudePathPromise = (async () => {
|
|
9383
|
-
const
|
|
9384
|
-
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
if (existsSync2(bundledBinary)) {
|
|
9388
|
-
cachedClaudePath = bundledBinary;
|
|
9389
|
-
return bundledBinary;
|
|
9390
|
-
}
|
|
9391
|
-
} catch {}
|
|
9392
|
-
try {
|
|
9393
|
-
const { stdout } = await exec("which claude");
|
|
9394
|
-
const claudePath = stdout.trim();
|
|
9395
|
-
if (claudePath && existsSync2(claudePath)) {
|
|
9396
|
-
cachedClaudePath = claudePath;
|
|
9397
|
-
return claudePath;
|
|
9398
|
-
}
|
|
9399
|
-
} catch {}
|
|
9400
|
-
if (runningUnderBun) {
|
|
9401
|
-
try {
|
|
9402
|
-
const sdkPath = fileURLToPath2(import.meta.resolve("@anthropic-ai/claude-agent-sdk"));
|
|
9403
|
-
const sdkCliJs = join2(dirname2(sdkPath), "cli.js");
|
|
9404
|
-
if (existsSync2(sdkCliJs)) {
|
|
9405
|
-
cachedClaudePath = sdkCliJs;
|
|
9406
|
-
return sdkCliJs;
|
|
9407
|
-
}
|
|
9408
|
-
} catch {}
|
|
9462
|
+
const resolved = await resolveClaudeExecutable();
|
|
9463
|
+
if (resolved) {
|
|
9464
|
+
cachedClaudePath = resolved;
|
|
9465
|
+
return resolved;
|
|
9409
9466
|
}
|
|
9410
|
-
throw new Error("Could not find Claude Code executable. Install via: npm install -g @anthropic-ai/claude-code");
|
|
9467
|
+
throw new Error("Could not find Claude Code executable. Install via: npm install -g @anthropic-ai/claude-code, " + "or set MERIDIAN_CLAUDE_PATH=/path/to/claude to point at an existing binary.");
|
|
9411
9468
|
})();
|
|
9412
9469
|
try {
|
|
9413
9470
|
return await cachedClaudePathPromise;
|
|
@@ -10285,6 +10342,10 @@ var DROID_ALLOWED_MCP_TOOLS = [
|
|
|
10285
10342
|
`mcp__${DROID_MCP_SERVER_NAME}__glob`,
|
|
10286
10343
|
`mcp__${DROID_MCP_SERVER_NAME}__grep`
|
|
10287
10344
|
];
|
|
10345
|
+
function resolveDroidPassthrough() {
|
|
10346
|
+
const envVal = process.env.MERIDIAN_PASSTHROUGH ?? process.env.CLAUDE_PROXY_PASSTHROUGH;
|
|
10347
|
+
return envVal === "1" || envVal === "true" || envVal === "yes";
|
|
10348
|
+
}
|
|
10288
10349
|
var droidTransforms = [
|
|
10289
10350
|
{
|
|
10290
10351
|
name: "droid-core",
|
|
@@ -10296,7 +10357,7 @@ var droidTransforms = [
|
|
|
10296
10357
|
incompatibleTools: CLAUDE_CODE_ONLY_TOOLS,
|
|
10297
10358
|
allowedMcpTools: DROID_ALLOWED_MCP_TOOLS,
|
|
10298
10359
|
sdkAgents: {},
|
|
10299
|
-
passthrough:
|
|
10360
|
+
passthrough: resolveDroidPassthrough(),
|
|
10300
10361
|
leaksCwdViaSystemReminder: true
|
|
10301
10362
|
};
|
|
10302
10363
|
}
|
|
@@ -10367,7 +10428,8 @@ var droidAdapter = {
|
|
|
10367
10428
|
return "";
|
|
10368
10429
|
},
|
|
10369
10430
|
usesPassthrough() {
|
|
10370
|
-
|
|
10431
|
+
const envVal = process.env.MERIDIAN_PASSTHROUGH ?? process.env.CLAUDE_PROXY_PASSTHROUGH;
|
|
10432
|
+
return envVal === "1" || envVal === "true" || envVal === "yes";
|
|
10371
10433
|
}
|
|
10372
10434
|
};
|
|
10373
10435
|
|
|
@@ -10929,10 +10991,6 @@ function detectAdapter(c) {
|
|
|
10929
10991
|
return defaultAdapter;
|
|
10930
10992
|
}
|
|
10931
10993
|
|
|
10932
|
-
// src/proxy/query.ts
|
|
10933
|
-
import { join as join3 } from "node:path";
|
|
10934
|
-
import { homedir as homedir2 } from "node:os";
|
|
10935
|
-
|
|
10936
10994
|
// src/mcpTools.ts
|
|
10937
10995
|
import { createSdkMcpServer as createSdkMcpServer2, tool } from "@anthropic-ai/claude-agent-sdk";
|
|
10938
10996
|
import * as fs from "node:fs/promises";
|
|
@@ -16625,6 +16683,13 @@ function createOpencodeMcpServer() {
|
|
|
16625
16683
|
}
|
|
16626
16684
|
|
|
16627
16685
|
// src/proxy/query.ts
|
|
16686
|
+
function stripConfigDir(env2) {
|
|
16687
|
+
if (!("CLAUDE_CONFIG_DIR" in env2))
|
|
16688
|
+
return env2;
|
|
16689
|
+
const out = { ...env2 };
|
|
16690
|
+
delete out.CLAUDE_CONFIG_DIR;
|
|
16691
|
+
return out;
|
|
16692
|
+
}
|
|
16628
16693
|
function computePassthroughMaxTurns(resumeSessionId, hasDeferredTools, advisorModel) {
|
|
16629
16694
|
const hasResume = !!resumeSessionId;
|
|
16630
16695
|
const base = hasResume && hasDeferredTools ? 4 : 3;
|
|
@@ -16729,10 +16794,9 @@ function buildQueryOptions(ctx) {
|
|
|
16729
16794
|
} : {},
|
|
16730
16795
|
...onStderr ? { stderr: onStderr } : {},
|
|
16731
16796
|
env: {
|
|
16732
|
-
...cleanEnv,
|
|
16797
|
+
...sharedMemory ? stripConfigDir(cleanEnv) : cleanEnv,
|
|
16733
16798
|
ENABLE_TOOL_SEARCH: hasDeferredTools ? "true" : "false",
|
|
16734
16799
|
...passthrough ? { ENABLE_CLAUDEAI_MCP_SERVERS: "false" } : {},
|
|
16735
|
-
...sharedMemory ? { CLAUDE_CONFIG_DIR: join3(homedir2(), ".claude") } : {},
|
|
16736
16800
|
...process.getuid?.() === 0 ? { IS_SANDBOX: "1" } : {}
|
|
16737
16801
|
},
|
|
16738
16802
|
...Object.keys(sdkAgents).length > 0 ? { agents: sdkAgents } : {},
|
|
@@ -16767,7 +16831,7 @@ function getAdapterTransforms(adapterName) {
|
|
|
16767
16831
|
|
|
16768
16832
|
// src/proxy/plugins/loader.ts
|
|
16769
16833
|
import { readdirSync as readdirSync2, readFileSync as readFileSync2, existsSync as existsSync3 } from "fs";
|
|
16770
|
-
import { join as
|
|
16834
|
+
import { join as join3, isAbsolute as isAbsolute2, extname } from "path";
|
|
16771
16835
|
|
|
16772
16836
|
// src/proxy/plugins/validation.ts
|
|
16773
16837
|
var KNOWN_ADAPTERS = ["opencode", "crush", "droid", "pi", "forgecode", "passthrough"];
|
|
@@ -16851,7 +16915,7 @@ async function loadPlugins(pluginDir, configPath) {
|
|
|
16851
16915
|
const loaded = [];
|
|
16852
16916
|
const seenNames = new Set;
|
|
16853
16917
|
for (const { filename, entry } of ordered) {
|
|
16854
|
-
const filePath = isAbsolute2(filename) ? filename :
|
|
16918
|
+
const filePath = isAbsolute2(filename) ? filename : join3(pluginDir, filename);
|
|
16855
16919
|
if (entry && !entry.enabled) {
|
|
16856
16920
|
loaded.push({
|
|
16857
16921
|
name: filename,
|
|
@@ -17227,12 +17291,12 @@ import {
|
|
|
17227
17291
|
openSync,
|
|
17228
17292
|
readFileSync as readFileSync3,
|
|
17229
17293
|
renameSync,
|
|
17230
|
-
statSync,
|
|
17294
|
+
statSync as statSync2,
|
|
17231
17295
|
unlinkSync,
|
|
17232
17296
|
writeFileSync
|
|
17233
17297
|
} from "node:fs";
|
|
17234
|
-
import { homedir as
|
|
17235
|
-
import { join as
|
|
17298
|
+
import { homedir as homedir2 } from "node:os";
|
|
17299
|
+
import { join as join4 } from "node:path";
|
|
17236
17300
|
var DEFAULT_MAX_STORED_SESSIONS = 1e4;
|
|
17237
17301
|
var STALE_LOCK_THRESHOLD_MS = 30000;
|
|
17238
17302
|
function getMaxStoredSessions() {
|
|
@@ -17256,7 +17320,7 @@ function acquireLock(lockPath) {
|
|
|
17256
17320
|
return false;
|
|
17257
17321
|
}
|
|
17258
17322
|
try {
|
|
17259
|
-
const stat =
|
|
17323
|
+
const stat = statSync2(lockPath);
|
|
17260
17324
|
if (Date.now() - stat.mtimeMs > STALE_LOCK_THRESHOLD_MS) {
|
|
17261
17325
|
unlinkSync(lockPath);
|
|
17262
17326
|
const fd = openSync(lockPath, "wx");
|
|
@@ -17283,11 +17347,11 @@ function getStorePath() {
|
|
|
17283
17347
|
if (!existsSync4(dir)) {
|
|
17284
17348
|
mkdirSync(dir, { recursive: true });
|
|
17285
17349
|
}
|
|
17286
|
-
return
|
|
17350
|
+
return join4(dir, "sessions.json");
|
|
17287
17351
|
}
|
|
17288
17352
|
function getDefaultCacheDir() {
|
|
17289
|
-
const newDir =
|
|
17290
|
-
const oldDir =
|
|
17353
|
+
const newDir = join4(homedir2(), ".cache", "meridian");
|
|
17354
|
+
const oldDir = join4(homedir2(), ".cache", "opencode-claude-max-proxy");
|
|
17291
17355
|
if (existsSync4(newDir))
|
|
17292
17356
|
return newDir;
|
|
17293
17357
|
if (existsSync4(oldDir)) {
|
|
@@ -17805,8 +17869,8 @@ function createProxyServer(config = {}) {
|
|
|
17805
17869
|
const sessionDiscoveredTools = new Map;
|
|
17806
17870
|
const sessionToolCache = new Map;
|
|
17807
17871
|
const sessionMcpCache = new LRUMap(getMaxSessionsLimit());
|
|
17808
|
-
const pluginDir = finalConfig.pluginDir ??
|
|
17809
|
-
const pluginConfigPath = finalConfig.pluginConfigPath ??
|
|
17872
|
+
const pluginDir = finalConfig.pluginDir ?? join6(homedir4(), ".config", "meridian", "plugins");
|
|
17873
|
+
const pluginConfigPath = finalConfig.pluginConfigPath ?? join6(homedir4(), ".config", "meridian", "plugins.json");
|
|
17810
17874
|
let loadedPlugins = [];
|
|
17811
17875
|
let pluginTransforms = [];
|
|
17812
17876
|
const app = new Hono2;
|
|
@@ -17872,6 +17936,9 @@ function createProxyServer(config = {}) {
|
|
|
17872
17936
|
if (!Array.isArray(body.messages)) {
|
|
17873
17937
|
return c.json({ type: "error", error: { type: "invalid_request_error", message: "messages: Field required" } }, 400);
|
|
17874
17938
|
}
|
|
17939
|
+
if (body.messages.length === 0) {
|
|
17940
|
+
return c.json({ type: "error", error: { type: "invalid_request_error", message: "messages: Cannot be empty — at least one message is required" } }, 400);
|
|
17941
|
+
}
|
|
17875
17942
|
const profile = resolveProfile(finalConfig.profiles, finalConfig.defaultProfile, c.req.header("x-meridian-profile") || undefined);
|
|
17876
17943
|
const authStatus = await getClaudeAuthStatusAsync(profile.id !== "default" ? profile.id : undefined, Object.keys(profile.env).length > 0 ? profile.env : undefined);
|
|
17877
17944
|
const agentMode = c.req.header("x-opencode-agent-mode") ?? null;
|
|
@@ -17880,10 +17947,11 @@ function createProxyServer(config = {}) {
|
|
|
17880
17947
|
const workingDirectory = (process.env.MERIDIAN_WORKDIR ?? process.env.CLAUDE_PROXY_WORKDIR) || adapter.extractWorkingDirectory(body) || process.cwd();
|
|
17881
17948
|
const clientWorkingDirectory = adapter.extractClientWorkingDirectory?.(body) || workingDirectory;
|
|
17882
17949
|
const {
|
|
17883
|
-
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS,
|
|
17884
17950
|
ANTHROPIC_API_KEY: _dropApiKey,
|
|
17885
17951
|
ANTHROPIC_BASE_URL: _dropBaseUrl,
|
|
17886
17952
|
ANTHROPIC_AUTH_TOKEN: _dropAuthToken,
|
|
17953
|
+
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS,
|
|
17954
|
+
CLAUDE_CODE_USE_POWERSHELL_TOOL: _dropUsePowershell,
|
|
17887
17955
|
...cleanEnv
|
|
17888
17956
|
} = process.env;
|
|
17889
17957
|
const sdkModelDefaults = resolveSdkModelDefaults();
|
|
@@ -18142,7 +18210,7 @@ function createProxyServer(config = {}) {
|
|
|
18142
18210
|
const upstreamStartAt = Date.now();
|
|
18143
18211
|
let firstChunkAt;
|
|
18144
18212
|
let currentSessionId;
|
|
18145
|
-
const sdkUuidMap = cachedSession?.sdkMessageUuids ? [...cachedSession.sdkMessageUuids] :
|
|
18213
|
+
const sdkUuidMap = cachedSession?.sdkMessageUuids ? [...cachedSession.sdkMessageUuids] : [];
|
|
18146
18214
|
while (sdkUuidMap.length < allMessages.length)
|
|
18147
18215
|
sdkUuidMap.push(null);
|
|
18148
18216
|
claudeLog("upstream.start", { mode: "non_stream", model });
|
|
@@ -18187,7 +18255,7 @@ function createProxyServer(config = {}) {
|
|
|
18187
18255
|
taskBudget,
|
|
18188
18256
|
betas,
|
|
18189
18257
|
settingSources,
|
|
18190
|
-
codeSystemPrompt: sdkFeatures.codeSystemPrompt
|
|
18258
|
+
codeSystemPrompt: sdkFeatures.codeSystemPrompt,
|
|
18191
18259
|
clientSystemPrompt: sdkFeatures.clientSystemPrompt === false ? false : undefined,
|
|
18192
18260
|
memory: sdkFeatures.memory,
|
|
18193
18261
|
dreaming: sdkFeatures.dreaming,
|
|
@@ -18249,7 +18317,7 @@ function createProxyServer(config = {}) {
|
|
|
18249
18317
|
taskBudget,
|
|
18250
18318
|
betas,
|
|
18251
18319
|
settingSources,
|
|
18252
|
-
codeSystemPrompt: sdkFeatures.codeSystemPrompt
|
|
18320
|
+
codeSystemPrompt: sdkFeatures.codeSystemPrompt,
|
|
18253
18321
|
clientSystemPrompt: sdkFeatures.clientSystemPrompt === false ? false : undefined,
|
|
18254
18322
|
memory: sdkFeatures.memory,
|
|
18255
18323
|
dreaming: sdkFeatures.dreaming,
|
|
@@ -18360,6 +18428,12 @@ function createProxyServer(config = {}) {
|
|
|
18360
18428
|
lastStopReason = message.message.stop_reason;
|
|
18361
18429
|
}
|
|
18362
18430
|
}
|
|
18431
|
+
if (message.type === "result") {
|
|
18432
|
+
const resultUsage = message.usage;
|
|
18433
|
+
if (resultUsage) {
|
|
18434
|
+
lastUsage = { ...lastUsage, ...resultUsage };
|
|
18435
|
+
}
|
|
18436
|
+
}
|
|
18363
18437
|
}
|
|
18364
18438
|
claudeLog("upstream.completed", {
|
|
18365
18439
|
mode: "non_stream",
|
|
@@ -18539,7 +18613,7 @@ Subprocess stderr: ${stderrOutput}`;
|
|
|
18539
18613
|
throw error;
|
|
18540
18614
|
}
|
|
18541
18615
|
};
|
|
18542
|
-
const sdkUuidMap = cachedSession?.sdkMessageUuids ? [...cachedSession.sdkMessageUuids] :
|
|
18616
|
+
const sdkUuidMap = cachedSession?.sdkMessageUuids ? [...cachedSession.sdkMessageUuids] : [];
|
|
18543
18617
|
while (sdkUuidMap.length < allMessages.length)
|
|
18544
18618
|
sdkUuidMap.push(null);
|
|
18545
18619
|
let messageStartEmitted = false;
|
|
@@ -18582,7 +18656,7 @@ Subprocess stderr: ${stderrOutput}`;
|
|
|
18582
18656
|
taskBudget,
|
|
18583
18657
|
betas,
|
|
18584
18658
|
settingSources,
|
|
18585
|
-
codeSystemPrompt: sdkFeatures.codeSystemPrompt
|
|
18659
|
+
codeSystemPrompt: sdkFeatures.codeSystemPrompt,
|
|
18586
18660
|
clientSystemPrompt: sdkFeatures.clientSystemPrompt === false ? false : undefined,
|
|
18587
18661
|
memory: sdkFeatures.memory,
|
|
18588
18662
|
dreaming: sdkFeatures.dreaming,
|
|
@@ -18644,7 +18718,7 @@ Subprocess stderr: ${stderrOutput}`;
|
|
|
18644
18718
|
taskBudget,
|
|
18645
18719
|
betas,
|
|
18646
18720
|
settingSources,
|
|
18647
|
-
codeSystemPrompt: sdkFeatures.codeSystemPrompt
|
|
18721
|
+
codeSystemPrompt: sdkFeatures.codeSystemPrompt,
|
|
18648
18722
|
clientSystemPrompt: sdkFeatures.clientSystemPrompt === false ? false : undefined,
|
|
18649
18723
|
memory: sdkFeatures.memory,
|
|
18650
18724
|
dreaming: sdkFeatures.dreaming,
|
|
@@ -85,6 +85,9 @@ function configDirToKeychainService(claudeConfigDir) {
|
|
|
85
85
|
function configDirToCredentialsFile(claudeConfigDir) {
|
|
86
86
|
return join(resolve(claudeConfigDir), ".credentials.json");
|
|
87
87
|
}
|
|
88
|
+
function serializeCredentials(credentials) {
|
|
89
|
+
return JSON.stringify(credentials);
|
|
90
|
+
}
|
|
88
91
|
function parseKeychainValue(raw) {
|
|
89
92
|
const trimmed = raw.trim();
|
|
90
93
|
try {
|
|
@@ -113,7 +116,7 @@ function buildMacosStore(serviceName) {
|
|
|
113
116
|
}
|
|
114
117
|
},
|
|
115
118
|
async write(credentials) {
|
|
116
|
-
const json =
|
|
119
|
+
const json = serializeCredentials(credentials);
|
|
117
120
|
const wasHex = keychainWasHexByService.get(serviceName) ?? false;
|
|
118
121
|
const value = wasHex ? Buffer.from(json).toString("hex") : json;
|
|
119
122
|
try {
|
|
@@ -142,7 +145,7 @@ function buildFileStore(filePath) {
|
|
|
142
145
|
async write(credentials) {
|
|
143
146
|
try {
|
|
144
147
|
mkdirSync(dirname(filePath), { recursive: true });
|
|
145
|
-
writeFileSync(filePath,
|
|
148
|
+
writeFileSync(filePath, serializeCredentials(credentials), "utf-8");
|
|
146
149
|
return true;
|
|
147
150
|
} catch (err) {
|
|
148
151
|
claudeLog("token_refresh.file_write_failed", { path: filePath, error: String(err) });
|
|
@@ -230,4 +233,4 @@ function resetInflightRefresh() {
|
|
|
230
233
|
inflightRefresh = null;
|
|
231
234
|
}
|
|
232
235
|
|
|
233
|
-
export { withClaudeLogContext, claudeLog, configDirToKeychainService, configDirToCredentialsFile, createPlatformCredentialStore, credentialsFilePathForProfile, refreshOAuthToken, resetInflightRefresh };
|
|
236
|
+
export { withClaudeLogContext, claudeLog, configDirToKeychainService, configDirToCredentialsFile, serializeCredentials, createPlatformCredentialStore, credentialsFilePathForProfile, refreshOAuthToken, resetInflightRefresh };
|
package/dist/cli.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
startProxyServer
|
|
4
|
-
} from "./cli-
|
|
4
|
+
} from "./cli-51a9sav0.js";
|
|
5
5
|
import"./cli-vdp9s10c.js";
|
|
6
6
|
import"./cli-sry5aqdj.js";
|
|
7
7
|
import"./cli-4rqtm83g.js";
|
|
8
8
|
import"./cli-340h1chz.js";
|
|
9
9
|
import"./cli-rtab0qa6.js";
|
|
10
|
-
import"./cli-
|
|
10
|
+
import"./cli-e289rj3k.js";
|
|
11
11
|
import {
|
|
12
12
|
__require
|
|
13
13
|
} from "./cli-p9swy5t3.js";
|
|
@@ -89,7 +89,7 @@ Restart OpenCode for the plugin to take effect.`);
|
|
|
89
89
|
process.exit(0);
|
|
90
90
|
}
|
|
91
91
|
if (args[0] === "refresh-token") {
|
|
92
|
-
const { refreshOAuthToken } = await import("./tokenRefresh-
|
|
92
|
+
const { refreshOAuthToken } = await import("./tokenRefresh-psq94r54.js");
|
|
93
93
|
const success = await refreshOAuthToken();
|
|
94
94
|
if (success) {
|
|
95
95
|
console.log("Token refreshed successfully");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"droid.d.ts","sourceRoot":"","sources":["../../../src/proxy/adapters/droid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAwC9C,eAAO,MAAM,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"droid.d.ts","sourceRoot":"","sources":["../../../src/proxy/adapters/droid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAwC9C,eAAO,MAAM,YAAY,EAAE,YAmF1B,CAAA;AAED,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrD,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
package/dist/proxy/models.d.ts
CHANGED
|
@@ -82,6 +82,31 @@ export declare function getClaudeAuthStatusAsync(profileId?: string, envOverride
|
|
|
82
82
|
* The promise is cleared in `finally` to allow retry on failure while
|
|
83
83
|
* cachedClaudePath prevents re-resolution on success.
|
|
84
84
|
*/
|
|
85
|
+
/**
|
|
86
|
+
* Resolver step contract — each tries one source, returns a path on success
|
|
87
|
+
* or null on miss. Failures (thrown errors) are caught by the caller and
|
|
88
|
+
* treated as misses so unresolved sources never block subsequent steps.
|
|
89
|
+
*/
|
|
90
|
+
type ResolverDeps = {
|
|
91
|
+
existsSync: (p: string) => boolean;
|
|
92
|
+
statSync: (p: string) => {
|
|
93
|
+
size: number;
|
|
94
|
+
};
|
|
95
|
+
exec: (cmd: string) => Promise<{
|
|
96
|
+
stdout: string;
|
|
97
|
+
}>;
|
|
98
|
+
resolvePackage: (specifier: string) => string;
|
|
99
|
+
envGet: (name: string) => string | undefined;
|
|
100
|
+
platform: NodeJS.Platform;
|
|
101
|
+
arch: string;
|
|
102
|
+
isBun: boolean;
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Pure resolver — runs each step and returns the first hit, or null when
|
|
106
|
+
* all steps miss. Exported for unit tests; production callers use
|
|
107
|
+
* resolveClaudeExecutableAsync, which adds caching on top.
|
|
108
|
+
*/
|
|
109
|
+
export declare function resolveClaudeExecutable(deps?: ResolverDeps): Promise<string | null>;
|
|
85
110
|
export declare function resolveClaudeExecutableAsync(): Promise<string>;
|
|
86
111
|
/** Reset cached path — for testing only */
|
|
87
112
|
export declare function resetCachedClaudePath(): void;
|
|
@@ -96,4 +121,5 @@ export declare function expireAuthStatusCache(): void;
|
|
|
96
121
|
* This happens when the client disconnects mid-stream.
|
|
97
122
|
*/
|
|
98
123
|
export declare function isClosedControllerError(error: unknown): boolean;
|
|
124
|
+
export {};
|
|
99
125
|
//# sourceMappingURL=models.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/proxy/models.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/proxy/models.ts"],"names":[],"mappings":"AAAA;;GAEG;AAoBH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CAAA;AAEjF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,oBAAoB,CAAA;AACrD,eAAO,MAAM,sBAAsB,sBAAsB,CAAA;AACzD,eAAO,MAAM,qBAAqB,qBAAqB,CAAA;AAEvD;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMhE;AACD,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AA0BD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,WAAW,CA8B7H;AAWD;;;;;;GAMG;AACH,wBAAgB,gCAAgC,IAAI,IAAI,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,IAAI,OAAO,CAG3D;AAED,0EAA0E;AAC1E,wBAAgB,+BAA+B,IAAI,IAAI,CAEtD;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,GAAG,WAAW,CAIpE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KA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,IAAI,CAOlD;AAED;;6DAE6D;AAC7D,wBAAgB,qBAAqB,IAAI,IAAI,CAO5C;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAG/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/proxy/query.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/proxy/query.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAW,aAAa,EAAE,MAAM,gCAAgC,CAAA;AAErF,OAAO,EAAE,0BAA0B,EAAwB,MAAM,oBAAoB,CAAA;AAerF,MAAM,WAAW,YAAY;IAC3B,iEAAiE;IACjE,MAAM,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;IACnC,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,gBAAgB,EAAE,MAAM,CAAA;IACxB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,yCAAyC;IACzC,aAAa,EAAE,MAAM,CAAA;IACrB,gCAAgC;IAChC,gBAAgB,EAAE,MAAM,CAAA;IACxB,0CAA0C;IAC1C,WAAW,EAAE,OAAO,CAAA;IACpB,0CAA0C;IAC1C,MAAM,EAAE,OAAO,CAAA;IACf,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC9B,mEAAmE;IACnE,cAAc,CAAC,EAAE,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAA;IAC9D,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5C,yDAAyD;IACzD,gBAAgB,EAAE,OAAO,CAAA;IACzB,0DAA0D;IAC1D,eAA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,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAAC,eAAe,CAAC,CAgC5E;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAInG;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAI9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/proxy/server.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAGvD,YAAY,EACV,SAAS,EACT,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAA;AAKpB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAgCnG,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EAEpB,KAAK,aAAa,EAGnB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAA+B,iBAAiB,EAAE,mBAAmB,EAAsC,MAAM,iBAAiB,CAAA;AAGzI,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,CAAA;AA+N7B,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/proxy/server.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACtE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,CAAA;AAGvD,YAAY,EACV,SAAS,EACT,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,MAAM,aAAa,CAAA;AAKpB,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAgCnG,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,oBAAoB,EAEpB,KAAK,aAAa,EAGnB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAA+B,iBAAiB,EAAE,mBAAmB,EAAsC,MAAM,iBAAiB,CAAA;AAGzI,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,oBAAoB,EAAE,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,CAAA;AACjD,YAAY,EAAE,aAAa,EAAE,CAAA;AA+N7B,wBAAgB,iBAAiB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,WAAW,CA2gFhF;AAED,wBAAsB,gBAAgB,CAAC,MAAM,GAAE,OAAO,CAAC,WAAW,CAAM,GAAG,OAAO,CAAC,aAAa,CAAC,CAoEhG"}
|
|
@@ -41,6 +41,17 @@ export interface CredentialStore {
|
|
|
41
41
|
read(): Promise<CredentialsFile | null>;
|
|
42
42
|
write(credentials: CredentialsFile): Promise<boolean>;
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* Serialize a credentials object to the on-disk / Keychain format Claude Code
|
|
46
|
+
* expects.
|
|
47
|
+
*
|
|
48
|
+
* MUST be compact (no whitespace) — Claude Code's credential parser cannot
|
|
49
|
+
* read pretty-printed JSON and treats the user as logged out when it
|
|
50
|
+
* encounters one. See issue #452.
|
|
51
|
+
*
|
|
52
|
+
* Exported so the regression test can pin the output format directly.
|
|
53
|
+
*/
|
|
54
|
+
export declare function serializeCredentials(credentials: CredentialsFile): string;
|
|
44
55
|
/**
|
|
45
56
|
* Returns the appropriate credential store for the current platform.
|
|
46
57
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokenRefresh.d.ts","sourceRoot":"","sources":["../../src/proxy/tokenRefresh.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAkBH;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAK1E;AAED,gEAAgE;AAChE,wBAAgB,0BAA0B,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAE1E;AAED,UAAU,gBAAgB;IACxB,WAAW,EAAE,MAAM,CAAA;IACnB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,aAAa,CAAC,EAAE,MAAM,CAAA;CACvB;AAED,UAAU,eAAe;IACvB,aAAa,EAAE,gBAAgB,CAAA;IAC/B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAMD,MAAM,WAAW,eAAe;IAC9B,IAAI,IAAI,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAAA;IACvC,KAAK,CAAC,WAAW,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACtD;AAuGD;;;;;;;GAOG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,CAAC,EAAE;IAAE,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,CAQlG;AAED,uGAAuG;AACvG,wBAAgB,6BAA6B,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAE9E;AASD;;;;;;;;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,CAE9E;AASD;;;;;;;;;;GAUG;AACH,wBAAsB,iBAAiB,CAAC,KAAK,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAQjF;AAiED,gDAAgD;AAChD,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"droid.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/droid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"droid.d.ts","sourceRoot":"","sources":["../../../src/proxy/transforms/droid.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAkB,MAAM,cAAc,CAAA;AA6B7D,eAAO,MAAM,eAAe,EAAE,SAAS,EAgBtC,CAAA"}
|
package/dist/server.js
CHANGED
|
@@ -10,13 +10,13 @@ import {
|
|
|
10
10
|
runObserveHook,
|
|
11
11
|
runTransformHook,
|
|
12
12
|
startProxyServer
|
|
13
|
-
} from "./cli-
|
|
13
|
+
} from "./cli-51a9sav0.js";
|
|
14
14
|
import"./cli-vdp9s10c.js";
|
|
15
15
|
import"./cli-sry5aqdj.js";
|
|
16
16
|
import"./cli-4rqtm83g.js";
|
|
17
17
|
import"./cli-340h1chz.js";
|
|
18
18
|
import"./cli-rtab0qa6.js";
|
|
19
|
-
import"./cli-
|
|
19
|
+
import"./cli-e289rj3k.js";
|
|
20
20
|
import"./cli-p9swy5t3.js";
|
|
21
21
|
export {
|
|
22
22
|
startProxyServer,
|
|
@@ -4,10 +4,12 @@ import {
|
|
|
4
4
|
createPlatformCredentialStore,
|
|
5
5
|
credentialsFilePathForProfile,
|
|
6
6
|
refreshOAuthToken,
|
|
7
|
-
resetInflightRefresh
|
|
8
|
-
|
|
7
|
+
resetInflightRefresh,
|
|
8
|
+
serializeCredentials
|
|
9
|
+
} from "./cli-e289rj3k.js";
|
|
9
10
|
import"./cli-p9swy5t3.js";
|
|
10
11
|
export {
|
|
12
|
+
serializeCredentials,
|
|
11
13
|
resetInflightRefresh,
|
|
12
14
|
refreshOAuthToken,
|
|
13
15
|
credentialsFilePathForProfile,
|
package/package.json
CHANGED