pennyrouter 0.3.22 → 0.3.24
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/package.json +1 -1
- package/src/cli.js +28 -4
- package/standalone/penny-compare +4 -4
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -1280,15 +1280,38 @@ async function update(flags) {
|
|
|
1280
1280
|
|
|
1281
1281
|
const updateContexts = new Map();
|
|
1282
1282
|
for (const record of targets) {
|
|
1283
|
-
const
|
|
1284
|
-
|
|
1283
|
+
const preferredProfile = record.profile || profileFromManifestRecord(record) || flags.profile;
|
|
1284
|
+
let profile = preferredProfile;
|
|
1285
|
+
let launchConfig = await loadPennyConfig({ profile });
|
|
1285
1286
|
const globalAuth = await readClaudeCodeGatewayAuth();
|
|
1286
|
-
|
|
1287
|
-
|
|
1287
|
+
let apiKey = flags.pennyKey || launchConfig.api_key || globalAuth.apiKey;
|
|
1288
|
+
let gatewayBaseUrl = flags.gatewayBaseUrl
|
|
1288
1289
|
|| launchConfig.gateway_base_url
|
|
1289
1290
|
|| globalAuth.gatewayBaseUrl
|
|
1290
1291
|
|| process.env.PENNYROUTER_GATEWAY_BASE_URL
|
|
1291
1292
|
|| DEFAULT_GATEWAY_BASE_URL;
|
|
1293
|
+
|
|
1294
|
+
// A pre-profile manifest may say "cloud" simply because that was the old default,
|
|
1295
|
+
// even though the user only has a private profile now. An unqualified update should
|
|
1296
|
+
// use an available credential rather than treating that stale hint as authoritative.
|
|
1297
|
+
if (!apiKey && !flags.profile && !flags.pennyKey) {
|
|
1298
|
+
const candidates = [
|
|
1299
|
+
activePennyProfile(launchConfig),
|
|
1300
|
+
...listPennyProfiles(launchConfig),
|
|
1301
|
+
].filter((name, index, all) => name && all.indexOf(name) === index);
|
|
1302
|
+
for (const candidate of candidates) {
|
|
1303
|
+
const candidateConfig = await loadPennyConfig({ profile: candidate });
|
|
1304
|
+
if (!candidateConfig.api_key) continue;
|
|
1305
|
+
profile = candidate;
|
|
1306
|
+
launchConfig = candidateConfig;
|
|
1307
|
+
apiKey = candidateConfig.api_key;
|
|
1308
|
+
gatewayBaseUrl = flags.gatewayBaseUrl
|
|
1309
|
+
|| candidateConfig.gateway_base_url
|
|
1310
|
+
|| process.env.PENNYROUTER_GATEWAY_BASE_URL
|
|
1311
|
+
|| DEFAULT_GATEWAY_BASE_URL;
|
|
1312
|
+
break;
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1292
1315
|
if (!apiKey) {
|
|
1293
1316
|
const suffix = profile ? ` for profile "${profile}"` : "";
|
|
1294
1317
|
throw new Error(
|
|
@@ -1371,6 +1394,7 @@ async function update(flags) {
|
|
|
1371
1394
|
|
|
1372
1395
|
next.updated_at = new Date().toISOString();
|
|
1373
1396
|
if (record.harness === "codex") next.openai_subscription_auth = codexSubscriptionAuth;
|
|
1397
|
+
next.profile = profile;
|
|
1374
1398
|
upsertManifestRecord(manifest, next);
|
|
1375
1399
|
await saveManifest(manifest);
|
|
1376
1400
|
console.log(`Updated ${record.harness}.`);
|
package/standalone/penny-compare
CHANGED
|
@@ -118,7 +118,7 @@ else
|
|
|
118
118
|
left="$(choose 'left pane' claude "${variants[@]}")"
|
|
119
119
|
echo >&2
|
|
120
120
|
if [ -z "$dir_left" ]; then
|
|
121
|
-
echo " left directory (blank = $PWD)" >&2
|
|
121
|
+
echo " left directory (blank = $PWD/native)" >&2
|
|
122
122
|
read -r -p " [] " dir_left >&2 || true
|
|
123
123
|
echo >&2
|
|
124
124
|
fi
|
|
@@ -130,7 +130,7 @@ else
|
|
|
130
130
|
right="$(choose 'right pane' penny-claude "${variants[@]}")"
|
|
131
131
|
echo >&2
|
|
132
132
|
if [ -z "$dir_right" ]; then
|
|
133
|
-
echo " right directory (blank = $PWD)" >&2
|
|
133
|
+
echo " right directory (blank = $PWD/penny)" >&2
|
|
134
134
|
read -r -p " [] " dir_right >&2 || true
|
|
135
135
|
echo >&2
|
|
136
136
|
fi
|
|
@@ -232,9 +232,9 @@ export PENNY_COMPARE_STATE="$state"
|
|
|
232
232
|
|
|
233
233
|
# Each pane's readout finds its session by the directory it ran in, so the two must be set
|
|
234
234
|
# explicitly rather than left to tmux's default of wherever the launcher was invoked.
|
|
235
|
-
workdir_left="${dir_left:-$PWD}"
|
|
235
|
+
workdir_left="${dir_left:-$PWD/native}"
|
|
236
236
|
workdir_left="${workdir_left/#\~/$HOME}"
|
|
237
|
-
workdir_right="${dir_right:-$PWD}"
|
|
237
|
+
workdir_right="${dir_right:-$PWD/penny}"
|
|
238
238
|
workdir_right="${workdir_right/#\~/$HOME}"
|
|
239
239
|
|
|
240
240
|
# --native-proxy only means anything on a NATIVE Claude or Codex pane;
|