pullfrog 0.1.71 → 0.1.72
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.mjs +22 -9
- package/dist/index.js +20 -7
- package/dist/internal.js +2 -1
- package/dist/models.d.ts +24 -0
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -111347,6 +111347,10 @@ function getModelManagedCredentials(slug2) {
|
|
|
111347
111347
|
const providerConfig = providers[parsed2.provider];
|
|
111348
111348
|
return providerConfig?.managedCredentials?.slice() ?? [];
|
|
111349
111349
|
}
|
|
111350
|
+
var CLAUDE_CODE_ONLY_CREDENTIALS = ["ANTHROPIC_AUTH_TOKEN", "CLAUDE_CODE_OAUTH_TOKEN"];
|
|
111351
|
+
function getOpenCodeEnvVars(slug2) {
|
|
111352
|
+
return getModelEnvVars(slug2).filter((v) => !CLAUDE_CODE_ONLY_CREDENTIALS.includes(v));
|
|
111353
|
+
}
|
|
111350
111354
|
var modelAliases = Object.entries(providers).flatMap(
|
|
111351
111355
|
([providerKey, config3]) => Object.entries(config3.models).map(([modelId, def]) => ({
|
|
111352
111356
|
slug: `${providerKey}/${modelId}`,
|
|
@@ -112281,7 +112285,7 @@ var import_semver = __toESM(require_semver2(), 1);
|
|
|
112281
112285
|
// package.json
|
|
112282
112286
|
var package_default = {
|
|
112283
112287
|
name: "pullfrog",
|
|
112284
|
-
version: "0.1.
|
|
112288
|
+
version: "0.1.72",
|
|
112285
112289
|
type: "module",
|
|
112286
112290
|
bin: {
|
|
112287
112291
|
pullfrog: "dist/cli.mjs",
|
|
@@ -114320,6 +114324,11 @@ function installManagedSettings(params) {
|
|
|
114320
114324
|
return false;
|
|
114321
114325
|
}
|
|
114322
114326
|
}
|
|
114327
|
+
function autoSelectClaudeModel() {
|
|
114328
|
+
return modelAliases.find(
|
|
114329
|
+
(a2) => a2.provider === "anthropic" && a2.preferred && !a2.hidden && !a2.fallback && !a2.routing
|
|
114330
|
+
)?.resolve;
|
|
114331
|
+
}
|
|
114323
114332
|
var claude = agent({
|
|
114324
114333
|
name: "claude",
|
|
114325
114334
|
install: installClaudeCli,
|
|
@@ -114327,7 +114336,8 @@ var claude = agent({
|
|
|
114327
114336
|
var _stack = [];
|
|
114328
114337
|
try {
|
|
114329
114338
|
const cliPath = await installClaudeCli();
|
|
114330
|
-
const specifier = ctx.payload.proxyModel ?? ctx.resolvedModel;
|
|
114339
|
+
const specifier = ctx.payload.proxyModel ?? ctx.resolvedModel ?? autoSelectClaudeModel();
|
|
114340
|
+
if (specifier) ctx.toolState.model = specifier;
|
|
114331
114341
|
const bedrockModelId = process.env[BEDROCK_MODEL_ID_ENV]?.trim();
|
|
114332
114342
|
const isBedrockRoute = specifier !== void 0 && bedrockModelId !== void 0 && bedrockModelId === specifier;
|
|
114333
114343
|
const vertexModelId = process.env[VERTEX_MODEL_ID_ENV]?.trim();
|
|
@@ -114347,7 +114357,10 @@ var claude = agent({
|
|
|
114347
114357
|
});
|
|
114348
114358
|
installBundledSkills({ home: homeEnv.HOME });
|
|
114349
114359
|
const mcpConfigPath = writeMcpConfig(ctx);
|
|
114350
|
-
const effort = resolveRunEffort(ctx);
|
|
114360
|
+
const effort = resolveRunEffort({ ...ctx, resolvedModel: specifier });
|
|
114361
|
+
if (!ctx.resolvedModel && !ctx.payload.proxyModel) {
|
|
114362
|
+
log2.info(`\xBB effort: ${effort.rung ?? "n/a (model has no effort control)"}`);
|
|
114363
|
+
}
|
|
114351
114364
|
const stopHookPath = join5(ctx.tmpdir, "pullfrog-stop-hook.sh");
|
|
114352
114365
|
writeFileSync4(stopHookPath, buildStopHookScript(), { mode: 493 });
|
|
114353
114366
|
const pretoolGate = writePretoolGateAssets({ ctx, stopHookPath });
|
|
@@ -120995,7 +121008,7 @@ function autoSelectModel() {
|
|
|
120995
121008
|
const authorized2 = getAuthorizedModels();
|
|
120996
121009
|
const selectable = modelAliases.filter((a2) => !a2.hidden && !a2.fallback && !a2.routing);
|
|
120997
121010
|
const servable = selectable.filter((a2) => {
|
|
120998
|
-
const envVars =
|
|
121011
|
+
const envVars = getOpenCodeEnvVars(a2.resolve);
|
|
120999
121012
|
return envVars.length === 0 || envVars.some((name) => process.env[name]);
|
|
121000
121013
|
});
|
|
121001
121014
|
const pick4 = (list) => list.find((a2) => a2.preferred) ?? list[0];
|
|
@@ -200317,7 +200330,7 @@ function hasEnvVar2(name) {
|
|
|
200317
200330
|
return typeof value2 === "string" && value2.length > 0;
|
|
200318
200331
|
}
|
|
200319
200332
|
function modelHasRuntimeAuth(model) {
|
|
200320
|
-
const authVars = [...
|
|
200333
|
+
const authVars = [...getOpenCodeEnvVars(model), ...getModelManagedCredentials(model)];
|
|
200321
200334
|
return authVars.length === 0 || authVars.some(hasEnvVar2);
|
|
200322
200335
|
}
|
|
200323
200336
|
function hasPositiveNumberEnvVar(name) {
|
|
@@ -200411,7 +200424,7 @@ function validateAgentApiKey(params) {
|
|
|
200411
200424
|
if (params.authorized.has(params.model)) return;
|
|
200412
200425
|
const reason = getModelsFailure();
|
|
200413
200426
|
if (reason) throw new Error(reason);
|
|
200414
|
-
if (
|
|
200427
|
+
if (getOpenCodeEnvVars(params.model).some(hasEnvVar2)) return;
|
|
200415
200428
|
throwKeyError({
|
|
200416
200429
|
owner: params.owner,
|
|
200417
200430
|
name: params.name,
|
|
@@ -200677,7 +200690,7 @@ function resolveAgent(ctx) {
|
|
|
200677
200690
|
}
|
|
200678
200691
|
}
|
|
200679
200692
|
if (!ctx.model) {
|
|
200680
|
-
if (
|
|
200693
|
+
if (!hasEnvVar3("ANTHROPIC_API_KEY") && CLAUDE_CODE_ONLY_CREDENTIALS.some(hasEnvVar3)) {
|
|
200681
200694
|
return agents.claude;
|
|
200682
200695
|
}
|
|
200683
200696
|
if (ctx.codexAgent && hasCodexAuth() && !hasClaudeCodeAuth()) return agents.codex;
|
|
@@ -204984,7 +204997,7 @@ function resolveTarget(repo) {
|
|
|
204984
204997
|
return { owner: match3[1], repo: match3[2] };
|
|
204985
204998
|
}
|
|
204986
204999
|
function cliVersion() {
|
|
204987
|
-
const parts = /^(\d+)\.(\d+)\.(\d+)$/.exec("0.1.
|
|
205000
|
+
const parts = /^(\d+)\.(\d+)\.(\d+)$/.exec("0.1.72");
|
|
204988
205001
|
if (!parts) return "0.0.0";
|
|
204989
205002
|
return `${Number(parts[1])}.${Number(parts[2])}.${Number(parts[3])}`;
|
|
204990
205003
|
}
|
|
@@ -205151,7 +205164,7 @@ async function runCli5(input2) {
|
|
|
205151
205164
|
}
|
|
205152
205165
|
|
|
205153
205166
|
// cli.ts
|
|
205154
|
-
var VERSION10 = "0.1.
|
|
205167
|
+
var VERSION10 = "0.1.72";
|
|
205155
205168
|
var bin = basename2(process.argv[1] || "");
|
|
205156
205169
|
var PROG = bin === "pf" || bin === "pullfrog" ? bin : "pullfrog";
|
|
205157
205170
|
var rawArgs = process.argv.slice(2);
|
package/dist/index.js
CHANGED
|
@@ -108857,6 +108857,10 @@ function getModelManagedCredentials(slug2) {
|
|
|
108857
108857
|
const providerConfig = providers[parsed2.provider];
|
|
108858
108858
|
return providerConfig?.managedCredentials?.slice() ?? [];
|
|
108859
108859
|
}
|
|
108860
|
+
var CLAUDE_CODE_ONLY_CREDENTIALS = ["ANTHROPIC_AUTH_TOKEN", "CLAUDE_CODE_OAUTH_TOKEN"];
|
|
108861
|
+
function getOpenCodeEnvVars(slug2) {
|
|
108862
|
+
return getModelEnvVars(slug2).filter((v) => !CLAUDE_CODE_ONLY_CREDENTIALS.includes(v));
|
|
108863
|
+
}
|
|
108860
108864
|
var modelAliases = Object.entries(providers).flatMap(
|
|
108861
108865
|
([providerKey, config3]) => Object.entries(config3.models).map(([modelId, def]) => ({
|
|
108862
108866
|
slug: `${providerKey}/${modelId}`,
|
|
@@ -109791,7 +109795,7 @@ var import_semver = __toESM(require_semver2(), 1);
|
|
|
109791
109795
|
// package.json
|
|
109792
109796
|
var package_default = {
|
|
109793
109797
|
name: "pullfrog",
|
|
109794
|
-
version: "0.1.
|
|
109798
|
+
version: "0.1.72",
|
|
109795
109799
|
type: "module",
|
|
109796
109800
|
bin: {
|
|
109797
109801
|
pullfrog: "dist/cli.mjs",
|
|
@@ -111830,6 +111834,11 @@ function installManagedSettings(params) {
|
|
|
111830
111834
|
return false;
|
|
111831
111835
|
}
|
|
111832
111836
|
}
|
|
111837
|
+
function autoSelectClaudeModel() {
|
|
111838
|
+
return modelAliases.find(
|
|
111839
|
+
(a) => a.provider === "anthropic" && a.preferred && !a.hidden && !a.fallback && !a.routing
|
|
111840
|
+
)?.resolve;
|
|
111841
|
+
}
|
|
111833
111842
|
var claude = agent({
|
|
111834
111843
|
name: "claude",
|
|
111835
111844
|
install: installClaudeCli,
|
|
@@ -111837,7 +111846,8 @@ var claude = agent({
|
|
|
111837
111846
|
var _stack = [];
|
|
111838
111847
|
try {
|
|
111839
111848
|
const cliPath = await installClaudeCli();
|
|
111840
|
-
const specifier = ctx.payload.proxyModel ?? ctx.resolvedModel;
|
|
111849
|
+
const specifier = ctx.payload.proxyModel ?? ctx.resolvedModel ?? autoSelectClaudeModel();
|
|
111850
|
+
if (specifier) ctx.toolState.model = specifier;
|
|
111841
111851
|
const bedrockModelId = process.env[BEDROCK_MODEL_ID_ENV]?.trim();
|
|
111842
111852
|
const isBedrockRoute = specifier !== void 0 && bedrockModelId !== void 0 && bedrockModelId === specifier;
|
|
111843
111853
|
const vertexModelId = process.env[VERTEX_MODEL_ID_ENV]?.trim();
|
|
@@ -111857,7 +111867,10 @@ var claude = agent({
|
|
|
111857
111867
|
});
|
|
111858
111868
|
installBundledSkills({ home: homeEnv.HOME });
|
|
111859
111869
|
const mcpConfigPath = writeMcpConfig(ctx);
|
|
111860
|
-
const effort = resolveRunEffort(ctx);
|
|
111870
|
+
const effort = resolveRunEffort({ ...ctx, resolvedModel: specifier });
|
|
111871
|
+
if (!ctx.resolvedModel && !ctx.payload.proxyModel) {
|
|
111872
|
+
log.info(`\xBB effort: ${effort.rung ?? "n/a (model has no effort control)"}`);
|
|
111873
|
+
}
|
|
111861
111874
|
const stopHookPath = join4(ctx.tmpdir, "pullfrog-stop-hook.sh");
|
|
111862
111875
|
writeFileSync3(stopHookPath, buildStopHookScript(), { mode: 493 });
|
|
111863
111876
|
const pretoolGate = writePretoolGateAssets({ ctx, stopHookPath });
|
|
@@ -118578,7 +118591,7 @@ function autoSelectModel() {
|
|
|
118578
118591
|
const authorized2 = getAuthorizedModels();
|
|
118579
118592
|
const selectable = modelAliases.filter((a) => !a.hidden && !a.fallback && !a.routing);
|
|
118580
118593
|
const servable = selectable.filter((a) => {
|
|
118581
|
-
const envVars =
|
|
118594
|
+
const envVars = getOpenCodeEnvVars(a.resolve);
|
|
118582
118595
|
return envVars.length === 0 || envVars.some((name) => process.env[name]);
|
|
118583
118596
|
});
|
|
118584
118597
|
const pick4 = (list) => list.find((a) => a.preferred) ?? list[0];
|
|
@@ -197900,7 +197913,7 @@ function hasEnvVar2(name) {
|
|
|
197900
197913
|
return typeof value2 === "string" && value2.length > 0;
|
|
197901
197914
|
}
|
|
197902
197915
|
function modelHasRuntimeAuth(model) {
|
|
197903
|
-
const authVars = [...
|
|
197916
|
+
const authVars = [...getOpenCodeEnvVars(model), ...getModelManagedCredentials(model)];
|
|
197904
197917
|
return authVars.length === 0 || authVars.some(hasEnvVar2);
|
|
197905
197918
|
}
|
|
197906
197919
|
function hasPositiveNumberEnvVar(name) {
|
|
@@ -197994,7 +198007,7 @@ function validateAgentApiKey(params) {
|
|
|
197994
198007
|
if (params.authorized.has(params.model)) return;
|
|
197995
198008
|
const reason = getModelsFailure();
|
|
197996
198009
|
if (reason) throw new Error(reason);
|
|
197997
|
-
if (
|
|
198010
|
+
if (getOpenCodeEnvVars(params.model).some(hasEnvVar2)) return;
|
|
197998
198011
|
throwKeyError({
|
|
197999
198012
|
owner: params.owner,
|
|
198000
198013
|
name: params.name,
|
|
@@ -198260,7 +198273,7 @@ function resolveAgent(ctx) {
|
|
|
198260
198273
|
}
|
|
198261
198274
|
}
|
|
198262
198275
|
if (!ctx.model) {
|
|
198263
|
-
if (
|
|
198276
|
+
if (!hasEnvVar3("ANTHROPIC_API_KEY") && CLAUDE_CODE_ONLY_CREDENTIALS.some(hasEnvVar3)) {
|
|
198264
198277
|
return agents.claude;
|
|
198265
198278
|
}
|
|
198266
198279
|
if (ctx.codexAgent && hasCodexAuth() && !hasClaudeCodeAuth()) return agents.codex;
|
package/dist/internal.js
CHANGED
|
@@ -1153,8 +1153,9 @@ function getModelManagedCredentials(slug) {
|
|
|
1153
1153
|
const providerConfig = providers[parsed.provider];
|
|
1154
1154
|
return providerConfig?.managedCredentials?.slice() ?? [];
|
|
1155
1155
|
}
|
|
1156
|
+
var CLAUDE_CODE_ONLY_CREDENTIALS = ["ANTHROPIC_AUTH_TOKEN", "CLAUDE_CODE_OAUTH_TOKEN"];
|
|
1156
1157
|
var HARNESS_ONLY_CREDENTIALS = {
|
|
1157
|
-
anthropic:
|
|
1158
|
+
anthropic: CLAUDE_CODE_ONLY_CREDENTIALS
|
|
1158
1159
|
};
|
|
1159
1160
|
function modelHasStoredAuth(params) {
|
|
1160
1161
|
const slug = resolveDisplayAlias(params.model)?.slug ?? params.model;
|
package/dist/models.d.ts
CHANGED
|
@@ -145,6 +145,30 @@ export declare function getModelEnvVars(slug: string): string[];
|
|
|
145
145
|
* a manual-paste option in `init` or the AgentSettings env-var button row.
|
|
146
146
|
* see `provider.managedCredentials` and wiki/codex-auth.md. */
|
|
147
147
|
export declare function getModelManagedCredentials(slug: string): string[];
|
|
148
|
+
/**
|
|
149
|
+
* Anthropic credentials that ONLY claude-code can present. opencode's anthropic
|
|
150
|
+
* provider authenticates from `ANTHROPIC_API_KEY` and nothing else (see
|
|
151
|
+
* `packages/llm/src/providers/anthropic.ts` upstream), so holding one of these
|
|
152
|
+
* is not evidence opencode can serve a Claude model.
|
|
153
|
+
*
|
|
154
|
+
* `ANTHROPIC_AUTH_TOKEN` (the gateway variable) is kept out of
|
|
155
|
+
* `providers.anthropic.envVars` entirely. `CLAUDE_CODE_OAUTH_TOKEN` cannot be:
|
|
156
|
+
* the console offers it as a paste target and `credentialFallback` preflights
|
|
157
|
+
* it, both of which read `getModelEnvVars`. So it stays in `envVars` and is
|
|
158
|
+
* subtracted here instead, via `getOpenCodeEnvVars` at every opencode-facing
|
|
159
|
+
* gate. Leaving it un-subtracted let `autoSelectModel` pin
|
|
160
|
+
* `anthropic/claude-opus-5` on a subscription-only account and hand it to
|
|
161
|
+
* opencode, which died with `Model not found` before the first turn.
|
|
162
|
+
*/
|
|
163
|
+
export declare const CLAUDE_CODE_ONLY_CREDENTIALS: string[];
|
|
164
|
+
/**
|
|
165
|
+
* `getModelEnvVars` minus the credentials only claude-code can present — the
|
|
166
|
+
* right question for every opencode-facing gate (auto-select, key validation).
|
|
167
|
+
* `getModelEnvVars` answers "which credentials can serve this model", which is
|
|
168
|
+
* the product's question; this answers "which can serve it UNDER OPENCODE",
|
|
169
|
+
* which is the only one those gates may act on.
|
|
170
|
+
*/
|
|
171
|
+
export declare function getOpenCodeEnvVars(slug: string): string[];
|
|
148
172
|
/**
|
|
149
173
|
* Whether one of `secretNames` can run `model` — the Router opt-out predicate,
|
|
150
174
|
* shared so every caller decides the same way. Auto-tier sentinels and
|