@rynfar/meridian 1.42.0 → 1.42.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.
@@ -0,0 +1,279 @@
1
+ // src/proxy/models.ts
2
+ import { exec as execCallback, execFile as execFileCallback } from "child_process";
3
+ import { existsSync, statSync } from "fs";
4
+ import { fileURLToPath } from "url";
5
+ import { join, dirname } from "path";
6
+ import { promisify } from "util";
7
+ var exec = promisify(execCallback);
8
+ var execFile = promisify(execFileCallback);
9
+ var STUB_SIZE_THRESHOLD = 4096;
10
+ var CANONICAL_OPUS_MODEL = "claude-opus-4-7";
11
+ var CANONICAL_SONNET_MODEL = "claude-sonnet-4-6";
12
+ var CANONICAL_HAIKU_MODEL = "claude-haiku-4-5";
13
+ function resolveSdkModelDefaults(env = process.env) {
14
+ return {
15
+ ANTHROPIC_DEFAULT_OPUS_MODEL: env.MERIDIAN_DEFAULT_OPUS_MODEL ?? CANONICAL_OPUS_MODEL,
16
+ ANTHROPIC_DEFAULT_SONNET_MODEL: env.MERIDIAN_DEFAULT_SONNET_MODEL ?? CANONICAL_SONNET_MODEL,
17
+ ANTHROPIC_DEFAULT_HAIKU_MODEL: env.MERIDIAN_DEFAULT_HAIKU_MODEL ?? CANONICAL_HAIKU_MODEL
18
+ };
19
+ }
20
+ var AUTH_STATUS_CACHE_TTL_MS = 60000;
21
+ var AUTH_STATUS_FAILURE_TTL_MS = 5000;
22
+ var cachedAuthStatus = null;
23
+ var lastKnownGoodAuthStatus = null;
24
+ var cachedAuthStatusAt = 0;
25
+ var cachedAuthStatusIsFailure = false;
26
+ var cachedAuthStatusPromise = null;
27
+ function supports1mContext(model) {
28
+ if (model.includes("4-5") || model.includes("4.5"))
29
+ return false;
30
+ return true;
31
+ }
32
+ function mapModelToClaudeModel(model, subscriptionType, agentMode) {
33
+ if (model.includes("haiku"))
34
+ return "haiku";
35
+ const use1m = supports1mContext(model);
36
+ const isSubagent = agentMode === "subagent";
37
+ if (model.includes("opus")) {
38
+ if (use1m && !isSubagent && !isExtendedContextKnownUnavailable())
39
+ return "opus[1m]";
40
+ return "opus";
41
+ }
42
+ const sonnetOverride = process.env.MERIDIAN_SONNET_MODEL ?? process.env.CLAUDE_PROXY_SONNET_MODEL;
43
+ if (sonnetOverride === "sonnet[1m]") {
44
+ if (!use1m || isSubagent || isExtendedContextKnownUnavailable())
45
+ return "sonnet";
46
+ return "sonnet[1m]";
47
+ }
48
+ return "sonnet";
49
+ }
50
+ var EXTRA_USAGE_RETRY_MS = 60 * 60 * 1000;
51
+ var extraUsageUnavailableAt = 0;
52
+ function recordExtendedContextUnavailable() {
53
+ extraUsageUnavailableAt = Date.now();
54
+ }
55
+ function isExtendedContextKnownUnavailable() {
56
+ return extraUsageUnavailableAt > 0 && Date.now() - extraUsageUnavailableAt < EXTRA_USAGE_RETRY_MS;
57
+ }
58
+ function stripExtendedContext(model) {
59
+ if (model === "opus[1m]")
60
+ return "opus";
61
+ if (model === "sonnet[1m]")
62
+ return "sonnet";
63
+ return model;
64
+ }
65
+ function hasExtendedContext(model) {
66
+ return model.endsWith("[1m]");
67
+ }
68
+ var profileAuthCaches = new Map;
69
+ function getAuthCacheInfo(profileId) {
70
+ if (!profileId) {
71
+ return { lastCheckedAt: cachedAuthStatusAt, lastSuccessAt: cachedAuthStatusIsFailure ? 0 : cachedAuthStatusAt, isFailure: cachedAuthStatusIsFailure };
72
+ }
73
+ const cache = profileAuthCaches.get(profileId);
74
+ if (!cache)
75
+ return { lastCheckedAt: 0, lastSuccessAt: 0, isFailure: false };
76
+ return { lastCheckedAt: cache.at, lastSuccessAt: cache.lastSuccessAt, isFailure: cache.isFailure };
77
+ }
78
+ function getAuthCache(key) {
79
+ let cache = profileAuthCaches.get(key);
80
+ if (!cache) {
81
+ cache = { status: null, lastKnownGood: null, at: 0, isFailure: false, promise: null, lastSuccessAt: 0 };
82
+ profileAuthCaches.set(key, cache);
83
+ }
84
+ return cache;
85
+ }
86
+ async function getClaudeAuthStatusAsync(profileId, envOverrides) {
87
+ const isDefault = !profileId;
88
+ const cache = isDefault ? null : getAuthCache(profileId);
89
+ const c_status = cache ? cache.status : cachedAuthStatus;
90
+ const c_lastKnownGood = cache ? cache.lastKnownGood : lastKnownGoodAuthStatus;
91
+ const c_at = cache ? cache.at : cachedAuthStatusAt;
92
+ const c_isFailure = cache ? cache.isFailure : cachedAuthStatusIsFailure;
93
+ let c_promise = cache ? cache.promise : cachedAuthStatusPromise;
94
+ const ttl = c_isFailure ? AUTH_STATUS_FAILURE_TTL_MS : AUTH_STATUS_CACHE_TTL_MS;
95
+ if (c_at > 0 && Date.now() - c_at < ttl) {
96
+ return c_status ?? c_lastKnownGood;
97
+ }
98
+ if (c_promise)
99
+ return c_promise;
100
+ c_promise = (async () => {
101
+ try {
102
+ const claudePath = await resolveClaudeExecutableAsync();
103
+ const { stdout } = await execFile(claudePath, ["auth", "status"], {
104
+ timeout: 5000,
105
+ ...envOverrides ? { env: { ...process.env, ...envOverrides } } : {}
106
+ });
107
+ const parsed = JSON.parse(stdout);
108
+ if (cache) {
109
+ cache.status = parsed;
110
+ cache.lastKnownGood = parsed;
111
+ cache.at = Date.now();
112
+ cache.isFailure = false;
113
+ cache.lastSuccessAt = Date.now();
114
+ } else {
115
+ cachedAuthStatus = parsed;
116
+ lastKnownGoodAuthStatus = parsed;
117
+ cachedAuthStatusAt = Date.now();
118
+ cachedAuthStatusIsFailure = false;
119
+ }
120
+ return parsed;
121
+ } catch {
122
+ if (cache) {
123
+ cache.isFailure = true;
124
+ cache.at = Date.now();
125
+ cache.status = null;
126
+ return cache.lastKnownGood;
127
+ } else {
128
+ cachedAuthStatusIsFailure = true;
129
+ cachedAuthStatusAt = Date.now();
130
+ cachedAuthStatus = null;
131
+ return lastKnownGoodAuthStatus;
132
+ }
133
+ }
134
+ })();
135
+ if (cache)
136
+ cache.promise = c_promise;
137
+ else
138
+ cachedAuthStatusPromise = c_promise;
139
+ try {
140
+ return await c_promise;
141
+ } finally {
142
+ if (cache)
143
+ cache.promise = null;
144
+ else
145
+ cachedAuthStatusPromise = null;
146
+ }
147
+ }
148
+ var cachedClaudeInfo = null;
149
+ var cachedClaudePathPromise = null;
150
+ var DEFAULT_DEPS = {
151
+ existsSync,
152
+ statSync: (p) => statSync(p),
153
+ exec,
154
+ resolvePackage: (specifier) => fileURLToPath(import.meta.resolve(specifier)),
155
+ envGet: (name) => process.env[name],
156
+ platform: process.platform,
157
+ arch: process.arch,
158
+ isBun: typeof process.versions.bun !== "undefined"
159
+ };
160
+ function tryEnvOverride(deps) {
161
+ const explicit = deps.envGet("MERIDIAN_CLAUDE_PATH");
162
+ if (!explicit)
163
+ return null;
164
+ return deps.existsSync(explicit) ? explicit : null;
165
+ }
166
+ function tryBundledBinary(deps) {
167
+ try {
168
+ const pkgPath = deps.resolvePackage("@anthropic-ai/claude-code/package.json");
169
+ const bundled = join(dirname(pkgPath), "bin", "claude.exe");
170
+ if (!deps.existsSync(bundled))
171
+ return null;
172
+ const size = deps.statSync(bundled).size;
173
+ if (size <= STUB_SIZE_THRESHOLD)
174
+ return null;
175
+ return bundled;
176
+ } catch {
177
+ return null;
178
+ }
179
+ }
180
+ function tryPlatformPackage(deps) {
181
+ const binName = deps.platform === "win32" ? "claude.exe" : "claude";
182
+ const candidates = [`@anthropic-ai/claude-code-${deps.platform}-${deps.arch}`];
183
+ if (deps.platform === "linux") {
184
+ candidates.push(`@anthropic-ai/claude-code-${deps.platform}-${deps.arch}-musl`);
185
+ }
186
+ for (const pkg of candidates) {
187
+ try {
188
+ const pkgJson = deps.resolvePackage(`${pkg}/package.json`);
189
+ const candidate = join(dirname(pkgJson), binName);
190
+ if (deps.existsSync(candidate))
191
+ return candidate;
192
+ } catch {}
193
+ }
194
+ return null;
195
+ }
196
+ async function tryPathLookup(deps) {
197
+ const cmd = deps.platform === "win32" ? "where claude" : "which claude";
198
+ try {
199
+ const { stdout } = await deps.exec(cmd);
200
+ const candidates = stdout.split(/\r?\n/).map((s) => s.trim()).filter(Boolean);
201
+ for (const candidate of candidates) {
202
+ if (deps.platform === "win32" && candidate.startsWith("/"))
203
+ continue;
204
+ if (deps.existsSync(candidate))
205
+ return candidate;
206
+ }
207
+ } catch {}
208
+ return null;
209
+ }
210
+ function tryLegacySdkCliJs(deps) {
211
+ if (!deps.isBun)
212
+ return null;
213
+ try {
214
+ const sdkPath = deps.resolvePackage("@anthropic-ai/claude-agent-sdk");
215
+ const cliJs = join(dirname(sdkPath), "cli.js");
216
+ return deps.existsSync(cliJs) ? cliJs : null;
217
+ } catch {
218
+ return null;
219
+ }
220
+ }
221
+ async function resolveClaudeExecutableWithSource(deps = DEFAULT_DEPS) {
222
+ const env = tryEnvOverride(deps);
223
+ if (env)
224
+ return { path: env, source: "env" };
225
+ const bundled = tryBundledBinary(deps);
226
+ if (bundled)
227
+ return { path: bundled, source: "bundled" };
228
+ const platformPkg = tryPlatformPackage(deps);
229
+ if (platformPkg)
230
+ return { path: platformPkg, source: "platform-package" };
231
+ const pathLookup = await tryPathLookup(deps);
232
+ if (pathLookup)
233
+ return { path: pathLookup, source: "path-lookup" };
234
+ const legacy = tryLegacySdkCliJs(deps);
235
+ if (legacy)
236
+ return { path: legacy, source: "legacy-cli-js" };
237
+ return null;
238
+ }
239
+ function resolveClaudeExecutableSync(deps = DEFAULT_DEPS) {
240
+ const env = tryEnvOverride(deps);
241
+ if (env)
242
+ return { path: env, source: "env" };
243
+ const bundled = tryBundledBinary(deps);
244
+ if (bundled)
245
+ return { path: bundled, source: "bundled" };
246
+ const platformPkg = tryPlatformPackage(deps);
247
+ if (platformPkg)
248
+ return { path: platformPkg, source: "platform-package" };
249
+ return null;
250
+ }
251
+ function getResolvedClaudeExecutableInfo() {
252
+ return cachedClaudeInfo;
253
+ }
254
+ async function resolveClaudeExecutableAsync() {
255
+ if (cachedClaudeInfo)
256
+ return cachedClaudeInfo.path;
257
+ if (cachedClaudePathPromise)
258
+ return cachedClaudePathPromise;
259
+ cachedClaudePathPromise = (async () => {
260
+ const resolved = await resolveClaudeExecutableWithSource();
261
+ if (resolved) {
262
+ cachedClaudeInfo = resolved;
263
+ return resolved.path;
264
+ }
265
+ 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.");
266
+ })();
267
+ try {
268
+ return await cachedClaudePathPromise;
269
+ } finally {
270
+ cachedClaudePathPromise = null;
271
+ }
272
+ }
273
+ function isClosedControllerError(error) {
274
+ if (!(error instanceof Error))
275
+ return false;
276
+ return error.message.includes("Controller is already closed");
277
+ }
278
+
279
+ export { resolveSdkModelDefaults, mapModelToClaudeModel, recordExtendedContextUnavailable, stripExtendedContext, hasExtendedContext, getAuthCacheInfo, getClaudeAuthStatusAsync, resolveClaudeExecutableSync, getResolvedClaudeExecutableInfo, resolveClaudeExecutableAsync, isClosedControllerError };
@@ -20,6 +20,18 @@ import {
20
20
  profileBarJs,
21
21
  themeCss
22
22
  } from "./cli-4rqtm83g.js";
23
+ import {
24
+ getAuthCacheInfo,
25
+ getClaudeAuthStatusAsync,
26
+ getResolvedClaudeExecutableInfo,
27
+ hasExtendedContext,
28
+ isClosedControllerError,
29
+ mapModelToClaudeModel,
30
+ recordExtendedContextUnavailable,
31
+ resolveClaudeExecutableAsync,
32
+ resolveSdkModelDefaults,
33
+ stripExtendedContext
34
+ } from "./cli-3jqvrake.js";
23
35
  import {
24
36
  checkPluginConfigured
25
37
  } from "./cli-rtab0qa6.js";
@@ -1181,14 +1193,14 @@ __export(exports_sdkFeatures, {
1181
1193
  getFeaturesForAdapter: () => getFeaturesForAdapter,
1182
1194
  getAllFeatureConfigs: () => getAllFeatureConfigs
1183
1195
  });
1184
- import { existsSync as existsSync6, mkdirSync as mkdirSync2, readFileSync as readFileSync4, writeFileSync as writeFileSync2, renameSync as renameSync2 } from "node:fs";
1185
- import { join as join5 } from "node:path";
1196
+ import { existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync4, writeFileSync as writeFileSync2, renameSync as renameSync2 } from "node:fs";
1197
+ import { join as join4 } from "node:path";
1186
1198
  import { homedir as homedir3 } from "node:os";
1187
1199
  function getConfigPath() {
1188
- const dir = join5(homedir3(), ".config", "meridian");
1189
- if (!existsSync6(dir))
1200
+ const dir = join4(homedir3(), ".config", "meridian");
1201
+ if (!existsSync5(dir))
1190
1202
  mkdirSync2(dir, { recursive: true });
1191
- return join5(dir, "sdk-features.json");
1203
+ return join4(dir, "sdk-features.json");
1192
1204
  }
1193
1205
  function readConfig() {
1194
1206
  const now = Date.now();
@@ -1196,7 +1208,7 @@ function readConfig() {
1196
1208
  return cachedConfig;
1197
1209
  const path3 = getConfigPath();
1198
1210
  try {
1199
- if (existsSync6(path3)) {
1211
+ if (existsSync5(path3)) {
1200
1212
  cachedConfig = JSON.parse(readFileSync4(path3, "utf-8"));
1201
1213
  } else {
1202
1214
  cachedConfig = {};
@@ -3711,7 +3723,7 @@ var serve = (options, listeningListener) => {
3711
3723
 
3712
3724
  // src/proxy/server.ts
3713
3725
  import { homedir as homedir4 } from "node:os";
3714
- import { join as join6 } from "node:path";
3726
+ import { join as join5 } from "node:path";
3715
3727
  import { query } from "@anthropic-ai/claude-agent-sdk";
3716
3728
 
3717
3729
  // src/proxy/rateLimitStore.ts
@@ -3967,8 +3979,8 @@ function createRequestContext(params) {
3967
3979
  };
3968
3980
  }
3969
3981
  // src/proxy/server.ts
3970
- import { exec as execCallback2 } from "child_process";
3971
- import { promisify as promisify3 } from "util";
3982
+ import { exec as execCallback } from "child_process";
3983
+ import { promisify as promisify2 } from "util";
3972
3984
  import { randomUUID } from "crypto";
3973
3985
 
3974
3986
  // src/proxy/passthroughTools.ts
@@ -9260,270 +9272,6 @@ function formatSdkTermination(t, ctx) {
9260
9272
  return `sdk_termination ${parts.join(" ")}`;
9261
9273
  }
9262
9274
 
9263
- // src/proxy/models.ts
9264
- import { exec as execCallback } from "child_process";
9265
- import { existsSync as existsSync3, statSync } from "fs";
9266
- import { fileURLToPath as fileURLToPath2 } from "url";
9267
- import { join as join2, dirname as dirname2 } from "path";
9268
- import { promisify } from "util";
9269
- var exec = promisify(execCallback);
9270
- var STUB_SIZE_THRESHOLD = 4096;
9271
- var CANONICAL_OPUS_MODEL = "claude-opus-4-7";
9272
- var CANONICAL_SONNET_MODEL = "claude-sonnet-4-6";
9273
- var CANONICAL_HAIKU_MODEL = "claude-haiku-4-5";
9274
- function resolveSdkModelDefaults(env2 = process.env) {
9275
- return {
9276
- ANTHROPIC_DEFAULT_OPUS_MODEL: env2.MERIDIAN_DEFAULT_OPUS_MODEL ?? CANONICAL_OPUS_MODEL,
9277
- ANTHROPIC_DEFAULT_SONNET_MODEL: env2.MERIDIAN_DEFAULT_SONNET_MODEL ?? CANONICAL_SONNET_MODEL,
9278
- ANTHROPIC_DEFAULT_HAIKU_MODEL: env2.MERIDIAN_DEFAULT_HAIKU_MODEL ?? CANONICAL_HAIKU_MODEL
9279
- };
9280
- }
9281
- var AUTH_STATUS_CACHE_TTL_MS = 60000;
9282
- var AUTH_STATUS_FAILURE_TTL_MS = 5000;
9283
- var cachedAuthStatus = null;
9284
- var lastKnownGoodAuthStatus = null;
9285
- var cachedAuthStatusAt = 0;
9286
- var cachedAuthStatusIsFailure = false;
9287
- var cachedAuthStatusPromise = null;
9288
- function supports1mContext(model) {
9289
- if (model.includes("4-5") || model.includes("4.5"))
9290
- return false;
9291
- return true;
9292
- }
9293
- function mapModelToClaudeModel(model, subscriptionType, agentMode) {
9294
- if (model.includes("haiku"))
9295
- return "haiku";
9296
- const use1m = supports1mContext(model);
9297
- const isSubagent = agentMode === "subagent";
9298
- if (model.includes("opus")) {
9299
- if (use1m && !isSubagent && !isExtendedContextKnownUnavailable())
9300
- return "opus[1m]";
9301
- return "opus";
9302
- }
9303
- const sonnetOverride = process.env.MERIDIAN_SONNET_MODEL ?? process.env.CLAUDE_PROXY_SONNET_MODEL;
9304
- if (sonnetOverride === "sonnet[1m]") {
9305
- if (!use1m || isSubagent || isExtendedContextKnownUnavailable())
9306
- return "sonnet";
9307
- return "sonnet[1m]";
9308
- }
9309
- return "sonnet";
9310
- }
9311
- var EXTRA_USAGE_RETRY_MS = 60 * 60 * 1000;
9312
- var extraUsageUnavailableAt = 0;
9313
- function recordExtendedContextUnavailable() {
9314
- extraUsageUnavailableAt = Date.now();
9315
- }
9316
- function isExtendedContextKnownUnavailable() {
9317
- return extraUsageUnavailableAt > 0 && Date.now() - extraUsageUnavailableAt < EXTRA_USAGE_RETRY_MS;
9318
- }
9319
- function stripExtendedContext(model) {
9320
- if (model === "opus[1m]")
9321
- return "opus";
9322
- if (model === "sonnet[1m]")
9323
- return "sonnet";
9324
- return model;
9325
- }
9326
- function hasExtendedContext(model) {
9327
- return model.endsWith("[1m]");
9328
- }
9329
- var profileAuthCaches = new Map;
9330
- function getAuthCacheInfo(profileId) {
9331
- if (!profileId) {
9332
- return { lastCheckedAt: cachedAuthStatusAt, lastSuccessAt: cachedAuthStatusIsFailure ? 0 : cachedAuthStatusAt, isFailure: cachedAuthStatusIsFailure };
9333
- }
9334
- const cache = profileAuthCaches.get(profileId);
9335
- if (!cache)
9336
- return { lastCheckedAt: 0, lastSuccessAt: 0, isFailure: false };
9337
- return { lastCheckedAt: cache.at, lastSuccessAt: cache.lastSuccessAt, isFailure: cache.isFailure };
9338
- }
9339
- function getAuthCache(key) {
9340
- let cache = profileAuthCaches.get(key);
9341
- if (!cache) {
9342
- cache = { status: null, lastKnownGood: null, at: 0, isFailure: false, promise: null, lastSuccessAt: 0 };
9343
- profileAuthCaches.set(key, cache);
9344
- }
9345
- return cache;
9346
- }
9347
- async function getClaudeAuthStatusAsync(profileId, envOverrides) {
9348
- const isDefault = !profileId;
9349
- const cache = isDefault ? null : getAuthCache(profileId);
9350
- const c_status = cache ? cache.status : cachedAuthStatus;
9351
- const c_lastKnownGood = cache ? cache.lastKnownGood : lastKnownGoodAuthStatus;
9352
- const c_at = cache ? cache.at : cachedAuthStatusAt;
9353
- const c_isFailure = cache ? cache.isFailure : cachedAuthStatusIsFailure;
9354
- let c_promise = cache ? cache.promise : cachedAuthStatusPromise;
9355
- const ttl = c_isFailure ? AUTH_STATUS_FAILURE_TTL_MS : AUTH_STATUS_CACHE_TTL_MS;
9356
- if (c_at > 0 && Date.now() - c_at < ttl) {
9357
- return c_status ?? c_lastKnownGood;
9358
- }
9359
- if (c_promise)
9360
- return c_promise;
9361
- c_promise = (async () => {
9362
- try {
9363
- const { stdout } = await exec("claude auth status", {
9364
- timeout: 5000,
9365
- ...envOverrides ? { env: { ...process.env, ...envOverrides } } : {}
9366
- });
9367
- const parsed = JSON.parse(stdout);
9368
- if (cache) {
9369
- cache.status = parsed;
9370
- cache.lastKnownGood = parsed;
9371
- cache.at = Date.now();
9372
- cache.isFailure = false;
9373
- cache.lastSuccessAt = Date.now();
9374
- } else {
9375
- cachedAuthStatus = parsed;
9376
- lastKnownGoodAuthStatus = parsed;
9377
- cachedAuthStatusAt = Date.now();
9378
- cachedAuthStatusIsFailure = false;
9379
- }
9380
- return parsed;
9381
- } catch {
9382
- if (cache) {
9383
- cache.isFailure = true;
9384
- cache.at = Date.now();
9385
- cache.status = null;
9386
- return cache.lastKnownGood;
9387
- } else {
9388
- cachedAuthStatusIsFailure = true;
9389
- cachedAuthStatusAt = Date.now();
9390
- cachedAuthStatus = null;
9391
- return lastKnownGoodAuthStatus;
9392
- }
9393
- }
9394
- })();
9395
- if (cache)
9396
- cache.promise = c_promise;
9397
- else
9398
- cachedAuthStatusPromise = c_promise;
9399
- try {
9400
- return await c_promise;
9401
- } finally {
9402
- if (cache)
9403
- cache.promise = null;
9404
- else
9405
- cachedAuthStatusPromise = null;
9406
- }
9407
- }
9408
- var cachedClaudeInfo = null;
9409
- var cachedClaudePathPromise = null;
9410
- var DEFAULT_DEPS = {
9411
- existsSync: existsSync3,
9412
- statSync: (p) => statSync(p),
9413
- exec,
9414
- resolvePackage: (specifier) => fileURLToPath2(import.meta.resolve(specifier)),
9415
- envGet: (name) => process.env[name],
9416
- platform: process.platform,
9417
- arch: process.arch,
9418
- isBun: typeof process.versions.bun !== "undefined"
9419
- };
9420
- function tryEnvOverride(deps) {
9421
- const explicit = deps.envGet("MERIDIAN_CLAUDE_PATH");
9422
- if (!explicit)
9423
- return null;
9424
- return deps.existsSync(explicit) ? explicit : null;
9425
- }
9426
- function tryBundledBinary(deps) {
9427
- try {
9428
- const pkgPath = deps.resolvePackage("@anthropic-ai/claude-code/package.json");
9429
- const bundled = join2(dirname2(pkgPath), "bin", "claude.exe");
9430
- if (!deps.existsSync(bundled))
9431
- return null;
9432
- const size = deps.statSync(bundled).size;
9433
- if (size <= STUB_SIZE_THRESHOLD)
9434
- return null;
9435
- return bundled;
9436
- } catch {
9437
- return null;
9438
- }
9439
- }
9440
- function tryPlatformPackage(deps) {
9441
- const binName = deps.platform === "win32" ? "claude.exe" : "claude";
9442
- const candidates = [`@anthropic-ai/claude-code-${deps.platform}-${deps.arch}`];
9443
- if (deps.platform === "linux") {
9444
- candidates.push(`@anthropic-ai/claude-code-${deps.platform}-${deps.arch}-musl`);
9445
- }
9446
- for (const pkg of candidates) {
9447
- try {
9448
- const pkgJson = deps.resolvePackage(`${pkg}/package.json`);
9449
- const candidate = join2(dirname2(pkgJson), binName);
9450
- if (deps.existsSync(candidate))
9451
- return candidate;
9452
- } catch {}
9453
- }
9454
- return null;
9455
- }
9456
- async function tryPathLookup(deps) {
9457
- const cmd = deps.platform === "win32" ? "where claude" : "which claude";
9458
- try {
9459
- const { stdout } = await deps.exec(cmd);
9460
- const candidates = stdout.split(/\r?\n/).map((s) => s.trim()).filter(Boolean);
9461
- for (const candidate of candidates) {
9462
- if (deps.platform === "win32" && candidate.startsWith("/"))
9463
- continue;
9464
- if (deps.existsSync(candidate))
9465
- return candidate;
9466
- }
9467
- } catch {}
9468
- return null;
9469
- }
9470
- function tryLegacySdkCliJs(deps) {
9471
- if (!deps.isBun)
9472
- return null;
9473
- try {
9474
- const sdkPath = deps.resolvePackage("@anthropic-ai/claude-agent-sdk");
9475
- const cliJs = join2(dirname2(sdkPath), "cli.js");
9476
- return deps.existsSync(cliJs) ? cliJs : null;
9477
- } catch {
9478
- return null;
9479
- }
9480
- }
9481
- async function resolveClaudeExecutableWithSource(deps = DEFAULT_DEPS) {
9482
- const env2 = tryEnvOverride(deps);
9483
- if (env2)
9484
- return { path: env2, source: "env" };
9485
- const bundled = tryBundledBinary(deps);
9486
- if (bundled)
9487
- return { path: bundled, source: "bundled" };
9488
- const platformPkg = tryPlatformPackage(deps);
9489
- if (platformPkg)
9490
- return { path: platformPkg, source: "platform-package" };
9491
- const pathLookup = await tryPathLookup(deps);
9492
- if (pathLookup)
9493
- return { path: pathLookup, source: "path-lookup" };
9494
- const legacy = tryLegacySdkCliJs(deps);
9495
- if (legacy)
9496
- return { path: legacy, source: "legacy-cli-js" };
9497
- return null;
9498
- }
9499
- function getResolvedClaudeExecutableInfo() {
9500
- return cachedClaudeInfo;
9501
- }
9502
- async function resolveClaudeExecutableAsync() {
9503
- if (cachedClaudeInfo)
9504
- return cachedClaudeInfo.path;
9505
- if (cachedClaudePathPromise)
9506
- return cachedClaudePathPromise;
9507
- cachedClaudePathPromise = (async () => {
9508
- const resolved = await resolveClaudeExecutableWithSource();
9509
- if (resolved) {
9510
- cachedClaudeInfo = resolved;
9511
- return resolved.path;
9512
- }
9513
- 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.");
9514
- })();
9515
- try {
9516
- return await cachedClaudePathPromise;
9517
- } finally {
9518
- cachedClaudePathPromise = null;
9519
- }
9520
- }
9521
- function isClosedControllerError(error) {
9522
- if (!(error instanceof Error))
9523
- return false;
9524
- return error.message.includes("Controller is already closed");
9525
- }
9526
-
9527
9275
  // src/proxy/openai.ts
9528
9276
  function extractOpenAiContent(content) {
9529
9277
  if (typeof content === "string")
@@ -11041,8 +10789,8 @@ function detectAdapter(c) {
11041
10789
  import { createSdkMcpServer as createSdkMcpServer2, tool } from "@anthropic-ai/claude-agent-sdk";
11042
10790
  import * as fs from "node:fs/promises";
11043
10791
  import * as path2 from "node:path";
11044
- import { exec as exec2 } from "node:child_process";
11045
- import { promisify as promisify2 } from "node:util";
10792
+ import { exec } from "node:child_process";
10793
+ import { promisify } from "node:util";
11046
10794
 
11047
10795
  // node_modules/@isaacs/balanced-match/dist/esm/index.js
11048
10796
  var balanced = (a, b, str) => {
@@ -12479,7 +12227,7 @@ minimatch.escape = escape;
12479
12227
  minimatch.unescape = unescape;
12480
12228
 
12481
12229
  // node_modules/glob/dist/esm/glob.js
12482
- import { fileURLToPath as fileURLToPath4 } from "node:url";
12230
+ import { fileURLToPath as fileURLToPath3 } from "node:url";
12483
12231
 
12484
12232
  // node_modules/lru-cache/dist/esm/index.js
12485
12233
  var defaultPerf = typeof performance === "object" && performance && typeof performance.now === "function" ? performance : Date;
@@ -13642,7 +13390,7 @@ class LRUCache {
13642
13390
 
13643
13391
  // node_modules/path-scurry/dist/esm/index.js
13644
13392
  import { posix, win32 } from "node:path";
13645
- import { fileURLToPath as fileURLToPath3 } from "node:url";
13393
+ import { fileURLToPath as fileURLToPath2 } from "node:url";
13646
13394
  import { lstatSync, readdir as readdirCB, readdirSync, readlinkSync, realpathSync as rps } from "fs";
13647
13395
  import * as actualFS from "node:fs";
13648
13396
  import { lstat, readdir, readlink, realpath } from "node:fs/promises";
@@ -15097,7 +14845,7 @@ class PathScurryBase {
15097
14845
  constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS } = {}) {
15098
14846
  this.#fs = fsFromOption(fs);
15099
14847
  if (cwd instanceof URL || cwd.startsWith("file://")) {
15100
- cwd = fileURLToPath3(cwd);
14848
+ cwd = fileURLToPath2(cwd);
15101
14849
  }
15102
14850
  const cwdPath = pathImpl.resolve(cwd);
15103
14851
  this.roots = Object.create(null);
@@ -16401,7 +16149,7 @@ class Glob {
16401
16149
  if (!opts.cwd) {
16402
16150
  this.cwd = "";
16403
16151
  } else if (opts.cwd instanceof URL || opts.cwd.startsWith("file://")) {
16404
- opts.cwd = fileURLToPath4(opts.cwd);
16152
+ opts.cwd = fileURLToPath3(opts.cwd);
16405
16153
  }
16406
16154
  this.cwd = opts.cwd || "";
16407
16155
  this.root = opts.root;
@@ -16592,7 +16340,7 @@ var glob = Object.assign(glob_, {
16592
16340
  glob.glob = glob;
16593
16341
 
16594
16342
  // src/mcpTools.ts
16595
- var execAsync = promisify2(exec2);
16343
+ var execAsync = promisify(exec);
16596
16344
  var getCwd = () => process.env.MERIDIAN_WORKDIR ?? process.env.CLAUDE_PROXY_WORKDIR ?? process.cwd();
16597
16345
  function createOpencodeMcpServer() {
16598
16346
  return createSdkMcpServer2({
@@ -16767,6 +16515,8 @@ function resolveSystemPrompt(systemContext, passthrough, settingSources, codeSys
16767
16515
  }
16768
16516
  if (append)
16769
16517
  return { systemPrompt: append };
16518
+ if (codeSystemPrompt === false)
16519
+ return { systemPrompt: "" };
16770
16520
  return {};
16771
16521
  }
16772
16522
  function buildQueryOptions(ctx) {
@@ -16822,6 +16572,8 @@ function buildQueryOptions(ctx) {
16822
16572
  allowDangerouslySkipPermissions: true,
16823
16573
  ...resolveSystemPrompt(systemContext, passthrough, settingSources, codeSystemPrompt, clientSystemPrompt, cwdNote),
16824
16574
  ...passthrough ? {
16575
+ tools: [],
16576
+ settingSources: [],
16825
16577
  disallowedTools: [...allBlockedTools],
16826
16578
  ...passthroughMcp ? {
16827
16579
  allowedTools: [...passthroughMcp.toolNames],
@@ -16878,8 +16630,8 @@ function getAdapterTransforms(adapterName) {
16878
16630
  }
16879
16631
 
16880
16632
  // src/proxy/plugins/loader.ts
16881
- import { readdirSync as readdirSync2, readFileSync as readFileSync2, existsSync as existsSync4 } from "fs";
16882
- import { join as join3, isAbsolute as isAbsolute2, extname } from "path";
16633
+ import { readdirSync as readdirSync2, readFileSync as readFileSync2, existsSync as existsSync3 } from "fs";
16634
+ import { join as join2, isAbsolute as isAbsolute2, extname } from "path";
16883
16635
  import { pathToFileURL } from "url";
16884
16636
 
16885
16637
  // src/proxy/plugins/validation.ts
@@ -16920,7 +16672,7 @@ function validateTransform(exported) {
16920
16672
  // src/proxy/plugins/loader.ts
16921
16673
  var loadCounter = 0;
16922
16674
  function parsePluginConfig(configPath) {
16923
- if (!existsSync4(configPath))
16675
+ if (!existsSync3(configPath))
16924
16676
  return [];
16925
16677
  try {
16926
16678
  const raw2 = readFileSync2(configPath, "utf-8");
@@ -16933,7 +16685,7 @@ function parsePluginConfig(configPath) {
16933
16685
  async function loadPlugins(pluginDir, configPath) {
16934
16686
  resetAllPluginStats();
16935
16687
  const config = configPath ? parsePluginConfig(configPath) : [];
16936
- const pluginDirExists = existsSync4(pluginDir);
16688
+ const pluginDirExists = existsSync3(pluginDir);
16937
16689
  let filenames = [];
16938
16690
  if (pluginDirExists) {
16939
16691
  try {
@@ -16964,7 +16716,7 @@ async function loadPlugins(pluginDir, configPath) {
16964
16716
  const loaded = [];
16965
16717
  const seenNames = new Set;
16966
16718
  for (const { filename, entry } of ordered) {
16967
- const filePath = isAbsolute2(filename) ? filename : join3(pluginDir, filename);
16719
+ const filePath = isAbsolute2(filename) ? filename : join2(pluginDir, filename);
16968
16720
  if (entry && !entry.enabled) {
16969
16721
  loaded.push({
16970
16722
  name: filename,
@@ -17336,17 +17088,17 @@ function verifyLineage(cached, messages, cacheKey2, cache) {
17336
17088
  // src/proxy/sessionStore.ts
17337
17089
  import {
17338
17090
  closeSync,
17339
- existsSync as existsSync5,
17091
+ existsSync as existsSync4,
17340
17092
  mkdirSync,
17341
17093
  openSync,
17342
17094
  readFileSync as readFileSync3,
17343
17095
  renameSync,
17344
- statSync as statSync2,
17096
+ statSync,
17345
17097
  unlinkSync,
17346
17098
  writeFileSync
17347
17099
  } from "node:fs";
17348
17100
  import { homedir as homedir2 } from "node:os";
17349
- import { join as join4 } from "node:path";
17101
+ import { join as join3 } from "node:path";
17350
17102
  var DEFAULT_MAX_STORED_SESSIONS = 1e4;
17351
17103
  var STALE_LOCK_THRESHOLD_MS = 30000;
17352
17104
  function getMaxStoredSessions() {
@@ -17370,7 +17122,7 @@ function acquireLock(lockPath) {
17370
17122
  return false;
17371
17123
  }
17372
17124
  try {
17373
- const stat = statSync2(lockPath);
17125
+ const stat = statSync(lockPath);
17374
17126
  if (Date.now() - stat.mtimeMs > STALE_LOCK_THRESHOLD_MS) {
17375
17127
  unlinkSync(lockPath);
17376
17128
  const fd = openSync(lockPath, "wx");
@@ -17394,17 +17146,17 @@ var sessionDirOverride = null;
17394
17146
  var skipLocking = false;
17395
17147
  function getStorePath() {
17396
17148
  const dir = sessionDirOverride || process.env.MERIDIAN_SESSION_DIR || process.env.CLAUDE_PROXY_SESSION_DIR || getDefaultCacheDir();
17397
- if (!existsSync5(dir)) {
17149
+ if (!existsSync4(dir)) {
17398
17150
  mkdirSync(dir, { recursive: true });
17399
17151
  }
17400
- return join4(dir, "sessions.json");
17152
+ return join3(dir, "sessions.json");
17401
17153
  }
17402
17154
  function getDefaultCacheDir() {
17403
- const newDir = join4(homedir2(), ".cache", "meridian");
17404
- const oldDir = join4(homedir2(), ".cache", "opencode-claude-max-proxy");
17405
- if (existsSync5(newDir))
17155
+ const newDir = join3(homedir2(), ".cache", "meridian");
17156
+ const oldDir = join3(homedir2(), ".cache", "opencode-claude-max-proxy");
17157
+ if (existsSync4(newDir))
17406
17158
  return newDir;
17407
- if (existsSync5(oldDir)) {
17159
+ if (existsSync4(oldDir)) {
17408
17160
  try {
17409
17161
  const { symlinkSync } = __require("fs");
17410
17162
  symlinkSync(oldDir, newDir);
@@ -17417,7 +17169,7 @@ function getDefaultCacheDir() {
17417
17169
  }
17418
17170
  function readStore() {
17419
17171
  const path3 = getStorePath();
17420
- if (!existsSync5(path3))
17172
+ if (!existsSync4(path3))
17421
17173
  return {};
17422
17174
  try {
17423
17175
  const data = readFileSync3(path3, "utf-8");
@@ -17741,7 +17493,7 @@ function storeSession(sessionId, messages, claudeSessionId, workingDirectory, sd
17741
17493
  }
17742
17494
 
17743
17495
  // src/proxy/server.ts
17744
- var exec3 = promisify3(execCallback2);
17496
+ var exec2 = promisify2(execCallback);
17745
17497
  var claudeExecutable = "";
17746
17498
  var MULTIMODAL_TYPES = new Set(["image", "document", "file"]);
17747
17499
  function hasMultimodalContent(content) {
@@ -17919,8 +17671,8 @@ function createProxyServer(config = {}) {
17919
17671
  const sessionDiscoveredTools = new Map;
17920
17672
  const sessionToolCache = new Map;
17921
17673
  const sessionMcpCache = new LRUMap(getMaxSessionsLimit());
17922
- const pluginDir = finalConfig.pluginDir ?? join6(homedir4(), ".config", "meridian", "plugins");
17923
- const pluginConfigPath = finalConfig.pluginConfigPath ?? join6(homedir4(), ".config", "meridian", "plugins.json");
17674
+ const pluginDir = finalConfig.pluginDir ?? join5(homedir4(), ".config", "meridian", "plugins");
17675
+ const pluginConfigPath = finalConfig.pluginConfigPath ?? join5(homedir4(), ".config", "meridian", "plugins.json");
17924
17676
  let loadedPlugins = [];
17925
17677
  let pluginTransforms = [];
17926
17678
  const app = new Hono2;
package/dist/cli.js CHANGED
@@ -1,10 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  startProxyServer
4
- } from "./cli-kvwnarfk.js";
4
+ } from "./cli-8xzxm1cq.js";
5
5
  import"./cli-cx463q74.js";
6
6
  import"./cli-sry5aqdj.js";
7
7
  import"./cli-4rqtm83g.js";
8
+ import {
9
+ resolveClaudeExecutableAsync
10
+ } from "./cli-3jqvrake.js";
8
11
  import"./cli-340h1chz.js";
9
12
  import"./cli-rtab0qa6.js";
10
13
  import"./cli-7k1fcprd.js";
@@ -14,7 +17,7 @@ import {
14
17
 
15
18
  // bin/cli.ts
16
19
  import { createRequire } from "module";
17
- import { exec as execCallback } from "child_process";
20
+ import { exec as execCallback, execFile as execFileCallback } from "child_process";
18
21
  import { promisify } from "util";
19
22
  var require2 = createRequire(import.meta.url);
20
23
  var { version } = require2("../package.json");
@@ -50,7 +53,7 @@ See https://github.com/rynfar/meridian for full documentation.`);
50
53
  process.exit(0);
51
54
  }
52
55
  if (args[0] === "profile") {
53
- const { profileAdd, profileAddOauthToken, profileList, profileRemove, profileSwitch, profileLogin, profileHelp } = await import("./profileCli-wpb4qbjn.js");
56
+ const { profileAdd, profileAddOauthToken, profileList, profileRemove, profileSwitch, profileLogin, profileHelp } = await import("./profileCli-c7cvkv5q.js");
54
57
  const subcommand = args[1];
55
58
  const profileId = args[2];
56
59
  if (subcommand === "add" && profileId) {
@@ -106,6 +109,7 @@ if (args[0] === "refresh-token") {
106
109
  }
107
110
  }
108
111
  var exec = promisify(execCallback);
112
+ var execFile = promisify(execFileCallback);
109
113
  process.on("uncaughtException", (err) => {
110
114
  console.error(`[PROXY] Uncaught exception (recovered): ${err.message}`);
111
115
  });
@@ -126,7 +130,10 @@ try {
126
130
  } catch (e) {
127
131
  console.error(`[meridian] Failed to parse MERIDIAN_PROFILES: ${e instanceof Error ? e.message : e}`);
128
132
  }
129
- async function runCli(start = startProxyServer, runExec = exec) {
133
+ async function runCli(start = startProxyServer, runAuthCheck = async () => {
134
+ const claudePath = await resolveClaudeExecutableAsync();
135
+ return execFile(claudePath, ["auth", "status"], { timeout: 5000 });
136
+ }) {
130
137
  try {
131
138
  const { findOpencodeConfigPath, checkPluginConfigured, findPluginPath } = await import("./setup-v5pnqe04.js");
132
139
  const configPath = findOpencodeConfigPath();
@@ -140,7 +147,7 @@ async function runCli(start = startProxyServer, runExec = exec) {
140
147
  }
141
148
  } catch {}
142
149
  try {
143
- const { stdout } = await runExec("claude auth status", { timeout: 5000 });
150
+ const { stdout } = await runAuthCheck();
144
151
  const auth = JSON.parse(stdout);
145
152
  if (!auth.loggedIn) {
146
153
  console.error("\x1B[31m✗ Not logged in to Claude.\x1B[0m Run: claude login");
@@ -1,3 +1,6 @@
1
+ import {
2
+ resolveClaudeExecutableSync
3
+ } from "./cli-3jqvrake.js";
1
4
  import {
2
5
  setSetting
3
6
  } from "./cli-340h1chz.js";
@@ -6,7 +9,7 @@ import"./cli-p9swy5t3.js";
6
9
  // src/proxy/profileCli.ts
7
10
  import { mkdirSync, existsSync, rmSync, readFileSync, writeFileSync } from "node:fs";
8
11
  import { join } from "node:path";
9
- import { execSync, spawnSync } from "node:child_process";
12
+ import { execFileSync, spawnSync } from "node:child_process";
10
13
  import { homedir } from "node:os";
11
14
  var PROFILES_DIR = join(homedir(), ".config", "meridian", "profiles");
12
15
  var CONFIG_FILE = join(homedir(), ".config", "meridian", "profiles.json");
@@ -32,8 +35,13 @@ function saveProfileConfig(profiles) {
32
35
  `, { mode: 384 });
33
36
  }
34
37
  function getAuthStatus(configDir) {
38
+ const resolved = resolveClaudeExecutableSync();
39
+ if (!resolved) {
40
+ console.warn(`[meridian] Could not resolve a Claude executable for auth check (set MERIDIAN_CLAUDE_PATH or install @anthropic-ai/claude-code)`);
41
+ return { loggedIn: false };
42
+ }
35
43
  try {
36
- const result = execSync("claude auth status", {
44
+ const result = execFileSync(resolved.path, ["auth", "status"], {
37
45
  timeout: 5000,
38
46
  env: { ...process.env, CLAUDE_CONFIG_DIR: configDir },
39
47
  stdio: ["pipe", "pipe", "pipe"]
@@ -97,7 +105,13 @@ function profileAdd(id) {
97
105
  console.log();
98
106
  console.log(" Press Ctrl+C to cancel, or wait for the browser to open...");
99
107
  console.log();
100
- const result = spawnSync("claude", ["auth", "login"], {
108
+ const resolvedAuth = resolveClaudeExecutableSync();
109
+ if (!resolvedAuth) {
110
+ console.error("\x1B[31m✗ Could not find a Claude executable to run auth login.\x1B[0m");
111
+ console.error(" Install via: npm install -g @anthropic-ai/claude-code, or set MERIDIAN_CLAUDE_PATH=/path/to/claude");
112
+ process.exit(1);
113
+ }
114
+ const result = spawnSync(resolvedAuth.path, ["auth", "login"], {
101
115
  env: { ...process.env, CLAUDE_CONFIG_DIR: configDir },
102
116
  stdio: "inherit"
103
117
  });
@@ -235,7 +249,13 @@ function profileLogin(id) {
235
249
  console.log();
236
250
  console.log("\x1B[33m⚠ Make sure you're signed into the correct Claude account in your browser.\x1B[0m");
237
251
  console.log();
238
- const result = spawnSync("claude", ["auth", "login"], {
252
+ const resolvedLogin = resolveClaudeExecutableSync();
253
+ if (!resolvedLogin) {
254
+ console.error("\x1B[31m✗ Could not find a Claude executable to run auth login.\x1B[0m");
255
+ console.error(" Install via: npm install -g @anthropic-ai/claude-code, or set MERIDIAN_CLAUDE_PATH=/path/to/claude");
256
+ process.exit(1);
257
+ }
258
+ const result = spawnSync(resolvedLogin.path, ["auth", "login"], {
239
259
  env: { ...process.env, CLAUDE_CONFIG_DIR: profile.claudeConfigDir },
240
260
  stdio: "inherit"
241
261
  });
@@ -134,6 +134,25 @@ export declare function resolveClaudeExecutableWithSource(deps?: ResolverDeps):
134
134
  * test surface in claude-executable-resolver.test.ts).
135
135
  */
136
136
  export declare function resolveClaudeExecutable(deps?: ResolverDeps): Promise<string | null>;
137
+ /**
138
+ * Synchronous subset of the resolver. Used by CLI commands
139
+ * (`meridian profile list`, `profileAdd`, etc.) that can't await before
140
+ * spawning `claude auth status`.
141
+ *
142
+ * Skips two steps that the async resolver runs:
143
+ * - `path-lookup` — running `which`/`where` synchronously is awkward
144
+ * and platform-fragile; the audit showed bundled + platform-package
145
+ * covers every supported install layout (npm-global, npx/bunx
146
+ * download, Docker, NixOS).
147
+ * - `legacy-cli-js` — only matters for stale Bun installs of SDK < 0.2.98.
148
+ *
149
+ * Closes the diagnostic gap from #478: `getAuthStatus` in profileCli.ts
150
+ * and `getClaudeAuthStatusAsync` in this file previously called
151
+ * `claude auth status` via shell, which fails when `claude` isn't on
152
+ * PATH (Stefan's case — bunx-installed meridian under systemd, no
153
+ * global claude). Both call sites now route through resolved paths.
154
+ */
155
+ export declare function resolveClaudeExecutableSync(deps?: ResolverDeps): ClaudeExecutableInfo | null;
137
156
  /**
138
157
  * Returns the cached resolved-executable info — `null` if
139
158
  * `resolveClaudeExecutableAsync` hasn't run yet. Used by `/health` and the
@@ -1 +1 @@
1
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C,CAAA;IAC9B,OAAO,EAAE,OAAO,CAAA;CACjB;AA+BD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAkBvE;AAgCD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,YAAY,GAAG,gBAAgB,CA4GrE"}
package/dist/server.js CHANGED
@@ -10,10 +10,11 @@ import {
10
10
  runObserveHook,
11
11
  runTransformHook,
12
12
  startProxyServer
13
- } from "./cli-kvwnarfk.js";
13
+ } from "./cli-8xzxm1cq.js";
14
14
  import"./cli-cx463q74.js";
15
15
  import"./cli-sry5aqdj.js";
16
16
  import"./cli-4rqtm83g.js";
17
+ import"./cli-3jqvrake.js";
17
18
  import"./cli-340h1chz.js";
18
19
  import"./cli-rtab0qa6.js";
19
20
  import"./cli-7k1fcprd.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rynfar/meridian",
3
- "version": "1.42.0",
3
+ "version": "1.42.1",
4
4
  "description": "Local Anthropic API powered by your Claude Max subscription. One subscription, every agent.",
5
5
  "type": "module",
6
6
  "main": "./dist/server.js",