pullfrog 0.1.71 → 0.1.73
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 +29278 -14570
- package/dist/cliContract.d.ts +5 -0
- package/dist/configuration.d.ts +45 -0
- package/dist/index.js +216 -217
- package/dist/internal/index.d.ts +3 -0
- package/dist/internal.js +14278 -17
- package/dist/models.d.ts +24 -0
- package/dist/toolState.d.ts +0 -1
- package/dist/utils/buildPullfrogFooter.d.ts +0 -6
- package/dist/utils/oauthWriteback.d.ts +29 -0
- package/dist/utils/runContextData.d.ts +0 -10
- package/package.json +4 -2
package/dist/index.js
CHANGED
|
@@ -17639,12 +17639,12 @@ var require_lib = __commonJS({
|
|
|
17639
17639
|
throw new Error("Client has already been disposed.");
|
|
17640
17640
|
}
|
|
17641
17641
|
const parsedUrl = new URL(requestUrl);
|
|
17642
|
-
let
|
|
17642
|
+
let info3 = this._prepareRequest(verb, parsedUrl, headers);
|
|
17643
17643
|
const maxTries = this._allowRetries && RetryableHttpVerbs.includes(verb) ? this._maxRetries + 1 : 1;
|
|
17644
17644
|
let numTries = 0;
|
|
17645
17645
|
let response;
|
|
17646
17646
|
do {
|
|
17647
|
-
response = yield this.requestRaw(
|
|
17647
|
+
response = yield this.requestRaw(info3, data);
|
|
17648
17648
|
if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
|
|
17649
17649
|
let authenticationHandler;
|
|
17650
17650
|
for (const handler2 of this.handlers) {
|
|
@@ -17654,7 +17654,7 @@ var require_lib = __commonJS({
|
|
|
17654
17654
|
}
|
|
17655
17655
|
}
|
|
17656
17656
|
if (authenticationHandler) {
|
|
17657
|
-
return authenticationHandler.handleAuthentication(this,
|
|
17657
|
+
return authenticationHandler.handleAuthentication(this, info3, data);
|
|
17658
17658
|
} else {
|
|
17659
17659
|
return response;
|
|
17660
17660
|
}
|
|
@@ -17677,8 +17677,8 @@ var require_lib = __commonJS({
|
|
|
17677
17677
|
}
|
|
17678
17678
|
}
|
|
17679
17679
|
}
|
|
17680
|
-
|
|
17681
|
-
response = yield this.requestRaw(
|
|
17680
|
+
info3 = this._prepareRequest(verb, parsedRedirectUrl, headers);
|
|
17681
|
+
response = yield this.requestRaw(info3, data);
|
|
17682
17682
|
redirectsRemaining--;
|
|
17683
17683
|
}
|
|
17684
17684
|
if (!response.message.statusCode || !HttpResponseRetryCodes.includes(response.message.statusCode)) {
|
|
@@ -17707,7 +17707,7 @@ var require_lib = __commonJS({
|
|
|
17707
17707
|
* @param info
|
|
17708
17708
|
* @param data
|
|
17709
17709
|
*/
|
|
17710
|
-
requestRaw(
|
|
17710
|
+
requestRaw(info3, data) {
|
|
17711
17711
|
return __awaiter(this, void 0, void 0, function* () {
|
|
17712
17712
|
return new Promise((resolve3, reject) => {
|
|
17713
17713
|
function callbackForResult(err, res) {
|
|
@@ -17719,7 +17719,7 @@ var require_lib = __commonJS({
|
|
|
17719
17719
|
resolve3(res);
|
|
17720
17720
|
}
|
|
17721
17721
|
}
|
|
17722
|
-
this.requestRawWithCallback(
|
|
17722
|
+
this.requestRawWithCallback(info3, data, callbackForResult);
|
|
17723
17723
|
});
|
|
17724
17724
|
});
|
|
17725
17725
|
}
|
|
@@ -17729,12 +17729,12 @@ var require_lib = __commonJS({
|
|
|
17729
17729
|
* @param data
|
|
17730
17730
|
* @param onResult
|
|
17731
17731
|
*/
|
|
17732
|
-
requestRawWithCallback(
|
|
17732
|
+
requestRawWithCallback(info3, data, onResult) {
|
|
17733
17733
|
if (typeof data === "string") {
|
|
17734
|
-
if (!
|
|
17735
|
-
|
|
17734
|
+
if (!info3.options.headers) {
|
|
17735
|
+
info3.options.headers = {};
|
|
17736
17736
|
}
|
|
17737
|
-
|
|
17737
|
+
info3.options.headers["Content-Length"] = Buffer.byteLength(data, "utf8");
|
|
17738
17738
|
}
|
|
17739
17739
|
let callbackCalled = false;
|
|
17740
17740
|
function handleResult2(err, res) {
|
|
@@ -17743,7 +17743,7 @@ var require_lib = __commonJS({
|
|
|
17743
17743
|
onResult(err, res);
|
|
17744
17744
|
}
|
|
17745
17745
|
}
|
|
17746
|
-
const req =
|
|
17746
|
+
const req = info3.httpModule.request(info3.options, (msg) => {
|
|
17747
17747
|
const res = new HttpClientResponse(msg);
|
|
17748
17748
|
handleResult2(void 0, res);
|
|
17749
17749
|
});
|
|
@@ -17755,7 +17755,7 @@ var require_lib = __commonJS({
|
|
|
17755
17755
|
if (socket) {
|
|
17756
17756
|
socket.end();
|
|
17757
17757
|
}
|
|
17758
|
-
handleResult2(new Error(`Request timeout: ${
|
|
17758
|
+
handleResult2(new Error(`Request timeout: ${info3.options.path}`));
|
|
17759
17759
|
});
|
|
17760
17760
|
req.on("error", function(err) {
|
|
17761
17761
|
handleResult2(err);
|
|
@@ -17791,27 +17791,27 @@ var require_lib = __commonJS({
|
|
|
17791
17791
|
return this._getProxyAgentDispatcher(parsedUrl, proxyUrl);
|
|
17792
17792
|
}
|
|
17793
17793
|
_prepareRequest(method, requestUrl, headers) {
|
|
17794
|
-
const
|
|
17795
|
-
|
|
17796
|
-
const usingSsl =
|
|
17797
|
-
|
|
17794
|
+
const info3 = {};
|
|
17795
|
+
info3.parsedUrl = requestUrl;
|
|
17796
|
+
const usingSsl = info3.parsedUrl.protocol === "https:";
|
|
17797
|
+
info3.httpModule = usingSsl ? https2 : http2;
|
|
17798
17798
|
const defaultPort = usingSsl ? 443 : 80;
|
|
17799
|
-
|
|
17800
|
-
|
|
17801
|
-
|
|
17802
|
-
|
|
17803
|
-
|
|
17804
|
-
|
|
17799
|
+
info3.options = {};
|
|
17800
|
+
info3.options.host = info3.parsedUrl.hostname;
|
|
17801
|
+
info3.options.port = info3.parsedUrl.port ? parseInt(info3.parsedUrl.port) : defaultPort;
|
|
17802
|
+
info3.options.path = (info3.parsedUrl.pathname || "") + (info3.parsedUrl.search || "");
|
|
17803
|
+
info3.options.method = method;
|
|
17804
|
+
info3.options.headers = this._mergeHeaders(headers);
|
|
17805
17805
|
if (this.userAgent != null) {
|
|
17806
|
-
|
|
17806
|
+
info3.options.headers["user-agent"] = this.userAgent;
|
|
17807
17807
|
}
|
|
17808
|
-
|
|
17808
|
+
info3.options.agent = this._getAgent(info3.parsedUrl);
|
|
17809
17809
|
if (this.handlers) {
|
|
17810
17810
|
for (const handler2 of this.handlers) {
|
|
17811
|
-
handler2.prepareRequest(
|
|
17811
|
+
handler2.prepareRequest(info3.options);
|
|
17812
17812
|
}
|
|
17813
17813
|
}
|
|
17814
|
-
return
|
|
17814
|
+
return info3;
|
|
17815
17815
|
}
|
|
17816
17816
|
_mergeHeaders(headers) {
|
|
17817
17817
|
if (this.requestOptions && this.requestOptions.headers) {
|
|
@@ -19793,18 +19793,18 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
|
|
19793
19793
|
(0, command_1.issueCommand)("error", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
|
|
19794
19794
|
}
|
|
19795
19795
|
exports.error = error62;
|
|
19796
|
-
function
|
|
19796
|
+
function warning4(message, properties = {}) {
|
|
19797
19797
|
(0, command_1.issueCommand)("warning", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
|
|
19798
19798
|
}
|
|
19799
|
-
exports.warning =
|
|
19799
|
+
exports.warning = warning4;
|
|
19800
19800
|
function notice(message, properties = {}) {
|
|
19801
19801
|
(0, command_1.issueCommand)("notice", (0, utils_1.toCommandProperties)(properties), message instanceof Error ? message.toString() : message);
|
|
19802
19802
|
}
|
|
19803
19803
|
exports.notice = notice;
|
|
19804
|
-
function
|
|
19804
|
+
function info3(message) {
|
|
19805
19805
|
process.stdout.write(message + os2.EOL);
|
|
19806
19806
|
}
|
|
19807
|
-
exports.info =
|
|
19807
|
+
exports.info = info3;
|
|
19808
19808
|
function startGroup3(name) {
|
|
19809
19809
|
(0, command_1.issue)("group", name);
|
|
19810
19810
|
}
|
|
@@ -19834,10 +19834,10 @@ Support boolean input list: \`true | True | TRUE | false | False | FALSE\``);
|
|
|
19834
19834
|
(0, command_1.issueCommand)("save-state", { name }, (0, utils_1.toCommandValue)(value2));
|
|
19835
19835
|
}
|
|
19836
19836
|
exports.saveState = saveState3;
|
|
19837
|
-
function
|
|
19837
|
+
function getState2(name) {
|
|
19838
19838
|
return process.env[`STATE_${name}`] || "";
|
|
19839
19839
|
}
|
|
19840
|
-
exports.getState =
|
|
19840
|
+
exports.getState = getState2;
|
|
19841
19841
|
function getIDToken2(aud) {
|
|
19842
19842
|
return __awaiter(this, void 0, void 0, function* () {
|
|
19843
19843
|
return yield oidc_utils_1.OidcClient.getIDToken(aud);
|
|
@@ -27621,11 +27621,11 @@ var require_mode = __commonJS({
|
|
|
27621
27621
|
var require_isexe = __commonJS({
|
|
27622
27622
|
"node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module) {
|
|
27623
27623
|
var fs5 = __require("fs");
|
|
27624
|
-
var
|
|
27624
|
+
var core12;
|
|
27625
27625
|
if (process.platform === "win32" || global.TESTING_WINDOWS) {
|
|
27626
|
-
|
|
27626
|
+
core12 = require_windows();
|
|
27627
27627
|
} else {
|
|
27628
|
-
|
|
27628
|
+
core12 = require_mode();
|
|
27629
27629
|
}
|
|
27630
27630
|
module.exports = isexe;
|
|
27631
27631
|
isexe.sync = sync;
|
|
@@ -27648,7 +27648,7 @@ var require_isexe = __commonJS({
|
|
|
27648
27648
|
});
|
|
27649
27649
|
});
|
|
27650
27650
|
}
|
|
27651
|
-
|
|
27651
|
+
core12(path4, options || {}, function(er, is) {
|
|
27652
27652
|
if (er) {
|
|
27653
27653
|
if (er.code === "EACCES" || options && options.ignoreErrors) {
|
|
27654
27654
|
er = null;
|
|
@@ -27660,7 +27660,7 @@ var require_isexe = __commonJS({
|
|
|
27660
27660
|
}
|
|
27661
27661
|
function sync(path4, options) {
|
|
27662
27662
|
try {
|
|
27663
|
-
return
|
|
27663
|
+
return core12.sync(path4, options || {});
|
|
27664
27664
|
} catch (er) {
|
|
27665
27665
|
if (options && options.ignoreErrors || er.code === "EACCES") {
|
|
27666
27666
|
return false;
|
|
@@ -38449,8 +38449,8 @@ var require_socks5_proxy_agent = __commonJS({
|
|
|
38449
38449
|
const timeout = setTimeout(() => {
|
|
38450
38450
|
reject(new Error("SOCKS5 connection timeout"));
|
|
38451
38451
|
}, 5e3);
|
|
38452
|
-
const onConnected = (
|
|
38453
|
-
debug3("SOCKS5 tunnel established to", targetHost, targetPort, "via",
|
|
38452
|
+
const onConnected = (info3) => {
|
|
38453
|
+
debug3("SOCKS5 tunnel established to", targetHost, targetPort, "via", info3);
|
|
38454
38454
|
clearTimeout(timeout);
|
|
38455
38455
|
socks5Client.removeListener("error", onError);
|
|
38456
38456
|
resolve3();
|
|
@@ -80800,7 +80800,7 @@ var require_core3 = __commonJS({
|
|
|
80800
80800
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
80801
80801
|
var id_1 = require_id();
|
|
80802
80802
|
var ref_1 = require_ref();
|
|
80803
|
-
var
|
|
80803
|
+
var core12 = [
|
|
80804
80804
|
"$schema",
|
|
80805
80805
|
"$id",
|
|
80806
80806
|
"$defs",
|
|
@@ -80810,7 +80810,7 @@ var require_core3 = __commonJS({
|
|
|
80810
80810
|
id_1.default,
|
|
80811
80811
|
ref_1.default
|
|
80812
80812
|
];
|
|
80813
|
-
exports.default =
|
|
80813
|
+
exports.default = core12;
|
|
80814
80814
|
}
|
|
80815
80815
|
});
|
|
80816
80816
|
|
|
@@ -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,8 @@ 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.73",
|
|
109799
|
+
cliContractVersion: "1",
|
|
109795
109800
|
type: "module",
|
|
109796
109801
|
bin: {
|
|
109797
109802
|
pullfrog: "dist/cli.mjs",
|
|
@@ -109857,7 +109862,8 @@ var package_default = {
|
|
|
109857
109862
|
typescript: "^5.9.3",
|
|
109858
109863
|
undici: "^7.22.0",
|
|
109859
109864
|
vitest: "^4.0.17",
|
|
109860
|
-
yaml: "^2.8.2"
|
|
109865
|
+
yaml: "^2.8.2",
|
|
109866
|
+
zod: "4.3.6"
|
|
109861
109867
|
},
|
|
109862
109868
|
repository: {
|
|
109863
109869
|
type: "git",
|
|
@@ -111830,6 +111836,11 @@ function installManagedSettings(params) {
|
|
|
111830
111836
|
return false;
|
|
111831
111837
|
}
|
|
111832
111838
|
}
|
|
111839
|
+
function autoSelectClaudeModel() {
|
|
111840
|
+
return modelAliases.find(
|
|
111841
|
+
(a) => a.provider === "anthropic" && a.preferred && !a.hidden && !a.fallback && !a.routing
|
|
111842
|
+
)?.resolve;
|
|
111843
|
+
}
|
|
111833
111844
|
var claude = agent({
|
|
111834
111845
|
name: "claude",
|
|
111835
111846
|
install: installClaudeCli,
|
|
@@ -111837,7 +111848,8 @@ var claude = agent({
|
|
|
111837
111848
|
var _stack = [];
|
|
111838
111849
|
try {
|
|
111839
111850
|
const cliPath = await installClaudeCli();
|
|
111840
|
-
const specifier = ctx.payload.proxyModel ?? ctx.resolvedModel;
|
|
111851
|
+
const specifier = ctx.payload.proxyModel ?? ctx.resolvedModel ?? autoSelectClaudeModel();
|
|
111852
|
+
if (specifier) ctx.toolState.model = specifier;
|
|
111841
111853
|
const bedrockModelId = process.env[BEDROCK_MODEL_ID_ENV]?.trim();
|
|
111842
111854
|
const isBedrockRoute = specifier !== void 0 && bedrockModelId !== void 0 && bedrockModelId === specifier;
|
|
111843
111855
|
const vertexModelId = process.env[VERTEX_MODEL_ID_ENV]?.trim();
|
|
@@ -111857,7 +111869,10 @@ var claude = agent({
|
|
|
111857
111869
|
});
|
|
111858
111870
|
installBundledSkills({ home: homeEnv.HOME });
|
|
111859
111871
|
const mcpConfigPath = writeMcpConfig(ctx);
|
|
111860
|
-
const effort = resolveRunEffort(ctx);
|
|
111872
|
+
const effort = resolveRunEffort({ ...ctx, resolvedModel: specifier });
|
|
111873
|
+
if (!ctx.resolvedModel && !ctx.payload.proxyModel) {
|
|
111874
|
+
log.info(`\xBB effort: ${effort.rung ?? "n/a (model has no effort control)"}`);
|
|
111875
|
+
}
|
|
111861
111876
|
const stopHookPath = join4(ctx.tmpdir, "pullfrog-stop-hook.sh");
|
|
111862
111877
|
writeFileSync3(stopHookPath, buildStopHookScript(), { mode: 493 });
|
|
111863
111878
|
const pretoolGate = writePretoolGateAssets({ ctx, stopHookPath });
|
|
@@ -111961,7 +111976,7 @@ var claude = agent({
|
|
|
111961
111976
|
});
|
|
111962
111977
|
|
|
111963
111978
|
// agents/codex.ts
|
|
111964
|
-
var
|
|
111979
|
+
var core3 = __toESM(require_core(), 1);
|
|
111965
111980
|
import { existsSync as existsSync5, mkdirSync as mkdirSync6, readFileSync as readFileSync3, writeFileSync as writeFileSync5 } from "node:fs";
|
|
111966
111981
|
import { join as join6 } from "node:path";
|
|
111967
111982
|
import { performance as performance6 } from "node:perf_hooks";
|
|
@@ -112189,6 +112204,64 @@ function bootstrapPullfrogDataDir() {
|
|
|
112189
112204
|
}
|
|
112190
112205
|
}
|
|
112191
112206
|
|
|
112207
|
+
// utils/oauthWriteback.ts
|
|
112208
|
+
var core2 = __toESM(require_core(), 1);
|
|
112209
|
+
|
|
112210
|
+
// utils/apiUrl.ts
|
|
112211
|
+
function isLocalUrl(url4) {
|
|
112212
|
+
return url4.hostname === "localhost" || url4.hostname === "127.0.0.1";
|
|
112213
|
+
}
|
|
112214
|
+
function getApiUrl() {
|
|
112215
|
+
const raw2 = process.env.API_URL || "https://pullfrog.com";
|
|
112216
|
+
const parsed2 = new URL(raw2);
|
|
112217
|
+
if (parsed2.protocol !== "https:" && !isLocalUrl(parsed2)) {
|
|
112218
|
+
throw new Error(
|
|
112219
|
+
`API_URL must use https:// (got ${parsed2.protocol}). only localhost is exempt.`
|
|
112220
|
+
);
|
|
112221
|
+
}
|
|
112222
|
+
log.debug(`resolved API_URL: ${raw2}`);
|
|
112223
|
+
return raw2;
|
|
112224
|
+
}
|
|
112225
|
+
function isLocalApiUrl() {
|
|
112226
|
+
try {
|
|
112227
|
+
return isLocalUrl(new URL(getApiUrl()));
|
|
112228
|
+
} catch {
|
|
112229
|
+
return false;
|
|
112230
|
+
}
|
|
112231
|
+
}
|
|
112232
|
+
|
|
112233
|
+
// utils/apiFetch.ts
|
|
112234
|
+
async function apiFetch(options) {
|
|
112235
|
+
const apiUrl = getApiUrl();
|
|
112236
|
+
const url4 = new URL(options.path, apiUrl);
|
|
112237
|
+
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
112238
|
+
if (bypassSecret) {
|
|
112239
|
+
url4.searchParams.set("x-vercel-protection-bypass", bypassSecret);
|
|
112240
|
+
}
|
|
112241
|
+
const headers = {
|
|
112242
|
+
...options.headers
|
|
112243
|
+
};
|
|
112244
|
+
if (bypassSecret) {
|
|
112245
|
+
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
112246
|
+
}
|
|
112247
|
+
if (!options.body) {
|
|
112248
|
+
for (const key of Object.keys(headers)) {
|
|
112249
|
+
if (key.toLowerCase() === "content-type") delete headers[key];
|
|
112250
|
+
}
|
|
112251
|
+
}
|
|
112252
|
+
log.debug(`api fetch: ${options.method ?? "GET"} ${url4.pathname}`);
|
|
112253
|
+
const init = {
|
|
112254
|
+
method: options.method ?? "GET",
|
|
112255
|
+
headers
|
|
112256
|
+
};
|
|
112257
|
+
if (options.body) init.body = options.body;
|
|
112258
|
+
if (options.signal) init.signal = options.signal;
|
|
112259
|
+
return fetch(url4.toString(), init);
|
|
112260
|
+
}
|
|
112261
|
+
|
|
112262
|
+
// utils/oauthWriteback.ts
|
|
112263
|
+
var OAUTH_WRITEBACK_STATE = "oauth_writeback";
|
|
112264
|
+
|
|
112192
112265
|
// utils/secrets.ts
|
|
112193
112266
|
var SENSITIVE_PATTERNS = [
|
|
112194
112267
|
/_KEY$/i,
|
|
@@ -112757,8 +112830,8 @@ var codex = agent({
|
|
|
112757
112830
|
effortRung: effort.rung && CODEX_EFFORTS.includes(effort.rung) ? effort.rung : void 0
|
|
112758
112831
|
});
|
|
112759
112832
|
if (codexHomeAuth) {
|
|
112760
|
-
|
|
112761
|
-
|
|
112833
|
+
core3.saveState(
|
|
112834
|
+
OAUTH_WRITEBACK_STATE,
|
|
112762
112835
|
JSON.stringify({
|
|
112763
112836
|
apiToken: ctx.apiToken,
|
|
112764
112837
|
entries: [
|
|
@@ -112842,7 +112915,7 @@ var codex = agent({
|
|
|
112842
112915
|
});
|
|
112843
112916
|
|
|
112844
112917
|
// agents/opencode.ts
|
|
112845
|
-
var
|
|
112918
|
+
var core4 = __toESM(require_core(), 1);
|
|
112846
112919
|
import { spawn as nodeSpawn2 } from "node:child_process";
|
|
112847
112920
|
import { mkdirSync as mkdirSync7, writeFileSync as writeFileSync6 } from "node:fs";
|
|
112848
112921
|
import { join as join7 } from "node:path";
|
|
@@ -118578,7 +118651,7 @@ function autoSelectModel() {
|
|
|
118578
118651
|
const authorized2 = getAuthorizedModels();
|
|
118579
118652
|
const selectable = modelAliases.filter((a) => !a.hidden && !a.fallback && !a.routing);
|
|
118580
118653
|
const servable = selectable.filter((a) => {
|
|
118581
|
-
const envVars =
|
|
118654
|
+
const envVars = getOpenCodeEnvVars(a.resolve);
|
|
118582
118655
|
return envVars.length === 0 || envVars.some((name) => process.env[name]);
|
|
118583
118656
|
});
|
|
118584
118657
|
const pick4 = (list) => list.find((a) => a.preferred) ?? list[0];
|
|
@@ -119251,8 +119324,8 @@ var opencode = agent({
|
|
|
119251
119324
|
});
|
|
119252
119325
|
}
|
|
119253
119326
|
if (writebacks.length > 0) {
|
|
119254
|
-
|
|
119255
|
-
|
|
119327
|
+
core4.saveState(
|
|
119328
|
+
OAUTH_WRITEBACK_STATE,
|
|
119256
119329
|
JSON.stringify({ apiToken: ctx.apiToken, entries: writebacks })
|
|
119257
119330
|
);
|
|
119258
119331
|
}
|
|
@@ -125138,25 +125211,25 @@ var Protocol = class {
|
|
|
125138
125211
|
});
|
|
125139
125212
|
}
|
|
125140
125213
|
_resetTimeout(messageId) {
|
|
125141
|
-
const
|
|
125142
|
-
if (!
|
|
125214
|
+
const info3 = this._timeoutInfo.get(messageId);
|
|
125215
|
+
if (!info3)
|
|
125143
125216
|
return false;
|
|
125144
|
-
const totalElapsed = Date.now() -
|
|
125145
|
-
if (
|
|
125217
|
+
const totalElapsed = Date.now() - info3.startTime;
|
|
125218
|
+
if (info3.maxTotalTimeout && totalElapsed >= info3.maxTotalTimeout) {
|
|
125146
125219
|
this._timeoutInfo.delete(messageId);
|
|
125147
125220
|
throw McpError.fromError(ErrorCode.RequestTimeout, "Maximum total timeout exceeded", {
|
|
125148
|
-
maxTotalTimeout:
|
|
125221
|
+
maxTotalTimeout: info3.maxTotalTimeout,
|
|
125149
125222
|
totalElapsed
|
|
125150
125223
|
});
|
|
125151
125224
|
}
|
|
125152
|
-
clearTimeout(
|
|
125153
|
-
|
|
125225
|
+
clearTimeout(info3.timeoutId);
|
|
125226
|
+
info3.timeoutId = setTimeout(info3.onTimeout, info3.timeout);
|
|
125154
125227
|
return true;
|
|
125155
125228
|
}
|
|
125156
125229
|
_cleanupTimeout(messageId) {
|
|
125157
|
-
const
|
|
125158
|
-
if (
|
|
125159
|
-
clearTimeout(
|
|
125230
|
+
const info3 = this._timeoutInfo.get(messageId);
|
|
125231
|
+
if (info3) {
|
|
125232
|
+
clearTimeout(info3.timeoutId);
|
|
125160
125233
|
this._timeoutInfo.delete(messageId);
|
|
125161
125234
|
}
|
|
125162
125235
|
}
|
|
@@ -125201,8 +125274,8 @@ var Protocol = class {
|
|
|
125201
125274
|
this._progressHandlers.clear();
|
|
125202
125275
|
this._taskProgressTokens.clear();
|
|
125203
125276
|
this._pendingDebouncedNotifications.clear();
|
|
125204
|
-
for (const
|
|
125205
|
-
clearTimeout(
|
|
125277
|
+
for (const info3 of this._timeoutInfo.values()) {
|
|
125278
|
+
clearTimeout(info3.timeoutId);
|
|
125206
125279
|
}
|
|
125207
125280
|
this._timeoutInfo.clear();
|
|
125208
125281
|
for (const controller of this._requestHandlerAbortControllers.values()) {
|
|
@@ -135452,24 +135525,24 @@ var Protocol2 = class {
|
|
|
135452
135525
|
});
|
|
135453
135526
|
}
|
|
135454
135527
|
_resetTimeout(messageId) {
|
|
135455
|
-
const
|
|
135456
|
-
if (!
|
|
135457
|
-
const totalElapsed = Date.now() -
|
|
135458
|
-
if (
|
|
135528
|
+
const info3 = this._timeoutInfo.get(messageId);
|
|
135529
|
+
if (!info3) return false;
|
|
135530
|
+
const totalElapsed = Date.now() - info3.startTime;
|
|
135531
|
+
if (info3.maxTotalTimeout && totalElapsed >= info3.maxTotalTimeout) {
|
|
135459
135532
|
this._timeoutInfo.delete(messageId);
|
|
135460
135533
|
throw new SdkError(SdkErrorCode.RequestTimeout, "Maximum total timeout exceeded", {
|
|
135461
|
-
maxTotalTimeout:
|
|
135534
|
+
maxTotalTimeout: info3.maxTotalTimeout,
|
|
135462
135535
|
totalElapsed
|
|
135463
135536
|
});
|
|
135464
135537
|
}
|
|
135465
|
-
clearTimeout(
|
|
135466
|
-
|
|
135538
|
+
clearTimeout(info3.timeoutId);
|
|
135539
|
+
info3.timeoutId = setTimeout(info3.onTimeout, info3.timeout);
|
|
135467
135540
|
return true;
|
|
135468
135541
|
}
|
|
135469
135542
|
_cleanupTimeout(messageId) {
|
|
135470
|
-
const
|
|
135471
|
-
if (
|
|
135472
|
-
clearTimeout(
|
|
135543
|
+
const info3 = this._timeoutInfo.get(messageId);
|
|
135544
|
+
if (info3) {
|
|
135545
|
+
clearTimeout(info3.timeoutId);
|
|
135473
135546
|
this._timeoutInfo.delete(messageId);
|
|
135474
135547
|
}
|
|
135475
135548
|
}
|
|
@@ -135514,7 +135587,7 @@ var Protocol2 = class {
|
|
|
135514
135587
|
this._responseHandlers = /* @__PURE__ */ new Map();
|
|
135515
135588
|
this._progressHandlers.clear();
|
|
135516
135589
|
this._pendingDebouncedNotifications.clear();
|
|
135517
|
-
for (const
|
|
135590
|
+
for (const info3 of this._timeoutInfo.values()) clearTimeout(info3.timeoutId);
|
|
135518
135591
|
this._timeoutInfo.clear();
|
|
135519
135592
|
const requestHandlerAbortControllers = this._requestHandlerAbortControllers;
|
|
135520
135593
|
this._requestHandlerAbortControllers = /* @__PURE__ */ new Map();
|
|
@@ -136163,7 +136236,7 @@ function validateToolName(name) {
|
|
|
136163
136236
|
function issueToolNameWarning(name, warnings) {
|
|
136164
136237
|
if (warnings.length > 0) {
|
|
136165
136238
|
console.warn(`Tool name validation warning for "${name}":`);
|
|
136166
|
-
for (const
|
|
136239
|
+
for (const warning4 of warnings) console.warn(` - ${warning4}`);
|
|
136167
136240
|
console.warn("Tool registration will proceed, but this may cause compatibility issues.");
|
|
136168
136241
|
console.warn("Consider updating the tool name to conform to the MCP tool naming standard.");
|
|
136169
136242
|
console.warn("See SEP: Specify Format for Tool Names (https://github.com/modelcontextprotocol/modelcontextprotocol/issues/986) for more details.");
|
|
@@ -140119,7 +140192,7 @@ var require_core$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
140119
140192
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
140120
140193
|
const id_1 = require_id2();
|
|
140121
140194
|
const ref_1 = require_ref2();
|
|
140122
|
-
const
|
|
140195
|
+
const core12 = [
|
|
140123
140196
|
"$schema",
|
|
140124
140197
|
"$id",
|
|
140125
140198
|
"$defs",
|
|
@@ -140129,7 +140202,7 @@ var require_core$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
140129
140202
|
id_1.default,
|
|
140130
140203
|
ref_1.default
|
|
140131
140204
|
];
|
|
140132
|
-
exports.default =
|
|
140205
|
+
exports.default = core12;
|
|
140133
140206
|
}));
|
|
140134
140207
|
var require_limitNumber2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
140135
140208
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -142267,7 +142340,7 @@ var require_json_schema_2019_09 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
142267
142340
|
const metaSchema = require_schema$1();
|
|
142268
142341
|
const applicator = require_applicator$1();
|
|
142269
142342
|
const content = require_content$1();
|
|
142270
|
-
const
|
|
142343
|
+
const core12 = require_core$1();
|
|
142271
142344
|
const format2 = require_format3();
|
|
142272
142345
|
const metadata = require_meta_data$1();
|
|
142273
142346
|
const validation = require_validation$1();
|
|
@@ -142277,7 +142350,7 @@ var require_json_schema_2019_09 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
142277
142350
|
metaSchema,
|
|
142278
142351
|
applicator,
|
|
142279
142352
|
content,
|
|
142280
|
-
|
|
142353
|
+
core12,
|
|
142281
142354
|
with$data(this, format2),
|
|
142282
142355
|
metadata,
|
|
142283
142356
|
with$data(this, validation)
|
|
@@ -142717,7 +142790,7 @@ var require_json_schema_2020_12 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
142717
142790
|
const applicator = require_applicator2();
|
|
142718
142791
|
const unevaluated = require_unevaluated();
|
|
142719
142792
|
const content = require_content();
|
|
142720
|
-
const
|
|
142793
|
+
const core12 = require_core4();
|
|
142721
142794
|
const format2 = require_format_annotation();
|
|
142722
142795
|
const metadata = require_meta_data();
|
|
142723
142796
|
const validation = require_validation2();
|
|
@@ -142728,7 +142801,7 @@ var require_json_schema_2020_12 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
142728
142801
|
applicator,
|
|
142729
142802
|
unevaluated,
|
|
142730
142803
|
content,
|
|
142731
|
-
|
|
142804
|
+
core12,
|
|
142732
142805
|
with$data(this, format2),
|
|
142733
142806
|
metadata,
|
|
142734
142807
|
with$data(this, validation)
|
|
@@ -149593,24 +149666,24 @@ var Protocol3 = class {
|
|
|
149593
149666
|
});
|
|
149594
149667
|
}
|
|
149595
149668
|
_resetTimeout(messageId) {
|
|
149596
|
-
const
|
|
149597
|
-
if (!
|
|
149598
|
-
const totalElapsed = Date.now() -
|
|
149599
|
-
if (
|
|
149669
|
+
const info3 = this._timeoutInfo.get(messageId);
|
|
149670
|
+
if (!info3) return false;
|
|
149671
|
+
const totalElapsed = Date.now() - info3.startTime;
|
|
149672
|
+
if (info3.maxTotalTimeout && totalElapsed >= info3.maxTotalTimeout) {
|
|
149600
149673
|
this._timeoutInfo.delete(messageId);
|
|
149601
149674
|
throw new SdkError2(SdkErrorCode2.RequestTimeout, "Maximum total timeout exceeded", {
|
|
149602
|
-
maxTotalTimeout:
|
|
149675
|
+
maxTotalTimeout: info3.maxTotalTimeout,
|
|
149603
149676
|
totalElapsed
|
|
149604
149677
|
});
|
|
149605
149678
|
}
|
|
149606
|
-
clearTimeout(
|
|
149607
|
-
|
|
149679
|
+
clearTimeout(info3.timeoutId);
|
|
149680
|
+
info3.timeoutId = setTimeout(info3.onTimeout, info3.timeout);
|
|
149608
149681
|
return true;
|
|
149609
149682
|
}
|
|
149610
149683
|
_cleanupTimeout(messageId) {
|
|
149611
|
-
const
|
|
149612
|
-
if (
|
|
149613
|
-
clearTimeout(
|
|
149684
|
+
const info3 = this._timeoutInfo.get(messageId);
|
|
149685
|
+
if (info3) {
|
|
149686
|
+
clearTimeout(info3.timeoutId);
|
|
149614
149687
|
this._timeoutInfo.delete(messageId);
|
|
149615
149688
|
}
|
|
149616
149689
|
}
|
|
@@ -149655,7 +149728,7 @@ var Protocol3 = class {
|
|
|
149655
149728
|
this._responseHandlers = /* @__PURE__ */ new Map();
|
|
149656
149729
|
this._progressHandlers.clear();
|
|
149657
149730
|
this._pendingDebouncedNotifications.clear();
|
|
149658
|
-
for (const
|
|
149731
|
+
for (const info3 of this._timeoutInfo.values()) clearTimeout(info3.timeoutId);
|
|
149659
149732
|
this._timeoutInfo.clear();
|
|
149660
149733
|
const requestHandlerAbortControllers = this._requestHandlerAbortControllers;
|
|
149661
149734
|
this._requestHandlerAbortControllers = /* @__PURE__ */ new Map();
|
|
@@ -154170,7 +154243,7 @@ var require_core$22 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
154170
154243
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
154171
154244
|
const id_1 = require_id3();
|
|
154172
154245
|
const ref_1 = require_ref3();
|
|
154173
|
-
const
|
|
154246
|
+
const core12 = [
|
|
154174
154247
|
"$schema",
|
|
154175
154248
|
"$id",
|
|
154176
154249
|
"$defs",
|
|
@@ -154180,7 +154253,7 @@ var require_core$22 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
154180
154253
|
id_1.default,
|
|
154181
154254
|
ref_1.default
|
|
154182
154255
|
];
|
|
154183
|
-
exports.default =
|
|
154256
|
+
exports.default = core12;
|
|
154184
154257
|
}));
|
|
154185
154258
|
var require_limitNumber3 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
154186
154259
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -156318,7 +156391,7 @@ var require_json_schema_2019_092 = /* @__PURE__ */ __commonJSMin2(((exports) =>
|
|
|
156318
156391
|
const metaSchema = require_schema$12();
|
|
156319
156392
|
const applicator = require_applicator$12();
|
|
156320
156393
|
const content = require_content$12();
|
|
156321
|
-
const
|
|
156394
|
+
const core12 = require_core$12();
|
|
156322
156395
|
const format2 = require_format4();
|
|
156323
156396
|
const metadata = require_meta_data$12();
|
|
156324
156397
|
const validation = require_validation$12();
|
|
@@ -156328,7 +156401,7 @@ var require_json_schema_2019_092 = /* @__PURE__ */ __commonJSMin2(((exports) =>
|
|
|
156328
156401
|
metaSchema,
|
|
156329
156402
|
applicator,
|
|
156330
156403
|
content,
|
|
156331
|
-
|
|
156404
|
+
core12,
|
|
156332
156405
|
with$data(this, format2),
|
|
156333
156406
|
metadata,
|
|
156334
156407
|
with$data(this, validation)
|
|
@@ -156768,7 +156841,7 @@ var require_json_schema_2020_122 = /* @__PURE__ */ __commonJSMin2(((exports) =>
|
|
|
156768
156841
|
const applicator = require_applicator3();
|
|
156769
156842
|
const unevaluated = require_unevaluated2();
|
|
156770
156843
|
const content = require_content2();
|
|
156771
|
-
const
|
|
156844
|
+
const core12 = require_core5();
|
|
156772
156845
|
const format2 = require_format_annotation2();
|
|
156773
156846
|
const metadata = require_meta_data2();
|
|
156774
156847
|
const validation = require_validation3();
|
|
@@ -156779,7 +156852,7 @@ var require_json_schema_2020_122 = /* @__PURE__ */ __commonJSMin2(((exports) =>
|
|
|
156779
156852
|
applicator,
|
|
156780
156853
|
unevaluated,
|
|
156781
156854
|
content,
|
|
156782
|
-
|
|
156855
|
+
core12,
|
|
156783
156856
|
with$data(this, format2),
|
|
156784
156857
|
metadata,
|
|
156785
156858
|
with$data(this, validation)
|
|
@@ -186515,7 +186588,7 @@ this usually means your local branch has commits that were never pushed \u2014 s
|
|
|
186515
186588
|
}
|
|
186516
186589
|
|
|
186517
186590
|
// utils/github.ts
|
|
186518
|
-
var
|
|
186591
|
+
var core5 = __toESM(require_core(), 1);
|
|
186519
186592
|
import { createSign } from "node:crypto";
|
|
186520
186593
|
import { rename, writeFile } from "node:fs/promises";
|
|
186521
186594
|
import { dirname as dirname3, join as join11 } from "node:path";
|
|
@@ -186690,8 +186763,8 @@ function throttling(octokit, octokitOptions) {
|
|
|
186690
186763
|
"error",
|
|
186691
186764
|
(e) => octokit.log.warn("Error in throttling-plugin limit handler", e)
|
|
186692
186765
|
);
|
|
186693
|
-
state.retryLimiter.on("failed", async function(error62,
|
|
186694
|
-
const [state2, request2, options] =
|
|
186766
|
+
state.retryLimiter.on("failed", async function(error62, info3) {
|
|
186767
|
+
const [state2, request2, options] = info3.args;
|
|
186695
186768
|
const { pathname } = new URL(options.url, "http://github.test");
|
|
186696
186769
|
const shouldRetryGraphQL = pathname.startsWith("/graphql") && error62.status !== 401;
|
|
186697
186770
|
if (!(shouldRetryGraphQL || error62.status === 403 || error62.status === 429)) {
|
|
@@ -190720,58 +190793,6 @@ var Octokit2 = Octokit.plugin(requestLog, legacyRestEndpointMethods, paginateRes
|
|
|
190720
190793
|
}
|
|
190721
190794
|
);
|
|
190722
190795
|
|
|
190723
|
-
// utils/apiUrl.ts
|
|
190724
|
-
function isLocalUrl(url4) {
|
|
190725
|
-
return url4.hostname === "localhost" || url4.hostname === "127.0.0.1";
|
|
190726
|
-
}
|
|
190727
|
-
function getApiUrl() {
|
|
190728
|
-
const raw2 = process.env.API_URL || "https://pullfrog.com";
|
|
190729
|
-
const parsed2 = new URL(raw2);
|
|
190730
|
-
if (parsed2.protocol !== "https:" && !isLocalUrl(parsed2)) {
|
|
190731
|
-
throw new Error(
|
|
190732
|
-
`API_URL must use https:// (got ${parsed2.protocol}). only localhost is exempt.`
|
|
190733
|
-
);
|
|
190734
|
-
}
|
|
190735
|
-
log.debug(`resolved API_URL: ${raw2}`);
|
|
190736
|
-
return raw2;
|
|
190737
|
-
}
|
|
190738
|
-
function isLocalApiUrl() {
|
|
190739
|
-
try {
|
|
190740
|
-
return isLocalUrl(new URL(getApiUrl()));
|
|
190741
|
-
} catch {
|
|
190742
|
-
return false;
|
|
190743
|
-
}
|
|
190744
|
-
}
|
|
190745
|
-
|
|
190746
|
-
// utils/apiFetch.ts
|
|
190747
|
-
async function apiFetch(options) {
|
|
190748
|
-
const apiUrl = getApiUrl();
|
|
190749
|
-
const url4 = new URL(options.path, apiUrl);
|
|
190750
|
-
const bypassSecret = process.env.VERCEL_AUTOMATION_BYPASS_SECRET;
|
|
190751
|
-
if (bypassSecret) {
|
|
190752
|
-
url4.searchParams.set("x-vercel-protection-bypass", bypassSecret);
|
|
190753
|
-
}
|
|
190754
|
-
const headers = {
|
|
190755
|
-
...options.headers
|
|
190756
|
-
};
|
|
190757
|
-
if (bypassSecret) {
|
|
190758
|
-
headers["x-vercel-protection-bypass"] = bypassSecret;
|
|
190759
|
-
}
|
|
190760
|
-
if (!options.body) {
|
|
190761
|
-
for (const key of Object.keys(headers)) {
|
|
190762
|
-
if (key.toLowerCase() === "content-type") delete headers[key];
|
|
190763
|
-
}
|
|
190764
|
-
}
|
|
190765
|
-
log.debug(`api fetch: ${options.method ?? "GET"} ${url4.pathname}`);
|
|
190766
|
-
const init = {
|
|
190767
|
-
method: options.method ?? "GET",
|
|
190768
|
-
headers
|
|
190769
|
-
};
|
|
190770
|
-
if (options.body) init.body = options.body;
|
|
190771
|
-
if (options.signal) init.signal = options.signal;
|
|
190772
|
-
return fetch(url4.toString(), init);
|
|
190773
|
-
}
|
|
190774
|
-
|
|
190775
190796
|
// utils/github.ts
|
|
190776
190797
|
var OIDC_AUDIENCE = "pullfrog-api";
|
|
190777
190798
|
function isObject4(value2) {
|
|
@@ -190817,7 +190838,7 @@ async function fetchIdTokenFromStash(creds) {
|
|
|
190817
190838
|
throw new Error("ID token response has no value field");
|
|
190818
190839
|
}
|
|
190819
190840
|
if (isGitHubActions) {
|
|
190820
|
-
|
|
190841
|
+
core5.setSecret(body.value);
|
|
190821
190842
|
}
|
|
190822
190843
|
return body.value;
|
|
190823
190844
|
}
|
|
@@ -190830,7 +190851,7 @@ function translateIdTokenError(error62) {
|
|
|
190830
190851
|
var mintIdToken = op(
|
|
190831
190852
|
async () => {
|
|
190832
190853
|
try {
|
|
190833
|
-
return await
|
|
190854
|
+
return await core5.getIDToken(OIDC_AUDIENCE);
|
|
190834
190855
|
} catch (error62) {
|
|
190835
190856
|
throw translateIdTokenError(error62);
|
|
190836
190857
|
}
|
|
@@ -192500,11 +192521,6 @@ function buildTrialDisclosure(owner) {
|
|
|
192500
192521
|
}
|
|
192501
192522
|
function buildPullfrogFooter(params) {
|
|
192502
192523
|
const parts = [];
|
|
192503
|
-
if (params.shaPinned) {
|
|
192504
|
-
parts.push(
|
|
192505
|
-
"\u26A0\uFE0F this action is pinned to a commit SHA, which [freezes the cleanup step](https://docs.pullfrog.com/versioning) \u2014 switch to `@v0` or keep the SHA fresh with Dependabot"
|
|
192506
|
-
);
|
|
192507
|
-
}
|
|
192508
192524
|
if (params.customParts) {
|
|
192509
192525
|
parts.push(...params.customParts);
|
|
192510
192526
|
}
|
|
@@ -192689,7 +192705,6 @@ function buildCommentFooter(ctx, customParts) {
|
|
|
192689
192705
|
fallbackFrom: ctx.toolState.modelFallback?.from,
|
|
192690
192706
|
clamped: ctx.toolState.modelClamped,
|
|
192691
192707
|
unselectedProxyDefault: ctx.toolState.unselectedProxyDefault,
|
|
192692
|
-
shaPinned: ctx.toolState.shaPinned,
|
|
192693
192708
|
oss: ctx.oss,
|
|
192694
192709
|
owner: ctx.repo.owner
|
|
192695
192710
|
});
|
|
@@ -193689,7 +193704,6 @@ async function createAndSubmitWithFooter(ctx, params, opts) {
|
|
|
193689
193704
|
fallbackFrom: ctx.toolState.modelFallback?.from,
|
|
193690
193705
|
clamped: ctx.toolState.modelClamped,
|
|
193691
193706
|
unselectedProxyDefault: ctx.toolState.unselectedProxyDefault,
|
|
193692
|
-
shaPinned: ctx.toolState.shaPinned,
|
|
193693
193707
|
oss: ctx.oss,
|
|
193694
193708
|
owner: ctx.repo.owner
|
|
193695
193709
|
});
|
|
@@ -196451,7 +196465,6 @@ function buildPrBodyWithFooter(ctx, body) {
|
|
|
196451
196465
|
fallbackFrom: ctx.toolState.modelFallback?.from,
|
|
196452
196466
|
clamped: ctx.toolState.modelClamped,
|
|
196453
196467
|
unselectedProxyDefault: ctx.toolState.unselectedProxyDefault,
|
|
196454
|
-
shaPinned: ctx.toolState.shaPinned,
|
|
196455
196468
|
oss: ctx.oss,
|
|
196456
196469
|
owner: ctx.repo.owner
|
|
196457
196470
|
});
|
|
@@ -197532,8 +197545,8 @@ function CheckoutRepoTool(ctx) {
|
|
|
197532
197545
|
const state = ensureRepoState(ctx.toolState, { owner, name: repo, dir, access });
|
|
197533
197546
|
const rc = resolveRepoCtx(ctx, repo);
|
|
197534
197547
|
try {
|
|
197535
|
-
const
|
|
197536
|
-
const defaultBranch =
|
|
197548
|
+
const info3 = await rc.octokit.rest.repos.get({ owner, repo });
|
|
197549
|
+
const defaultBranch = info3.data.default_branch;
|
|
197537
197550
|
state.defaultBranch = defaultBranch;
|
|
197538
197551
|
const url4 = `https://github.com/${owner}/${repo}.git`;
|
|
197539
197552
|
$("git", ["init", "-q"], { cwd: dir });
|
|
@@ -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;
|
|
@@ -199226,7 +199239,7 @@ function buildModelAccessError(input2) {
|
|
|
199226
199239
|
}
|
|
199227
199240
|
|
|
199228
199241
|
// utils/normalizeEnv.ts
|
|
199229
|
-
var
|
|
199242
|
+
var core6 = __toESM(require_core(), 1);
|
|
199230
199243
|
function hasControlCharacter(value2) {
|
|
199231
199244
|
return [...value2].some((ch) => {
|
|
199232
199245
|
const code = ch.charCodeAt(0);
|
|
@@ -199252,7 +199265,7 @@ function sanitizeSecret(key, value2) {
|
|
|
199252
199265
|
`\xBB stripped whitespace from ${key} (whitespace in secret values breaks GitHub Actions log masking)`
|
|
199253
199266
|
);
|
|
199254
199267
|
}
|
|
199255
|
-
|
|
199268
|
+
core6.setSecret(trimmed);
|
|
199256
199269
|
return trimmed;
|
|
199257
199270
|
}
|
|
199258
199271
|
function normalizeEnv() {
|
|
@@ -199296,7 +199309,7 @@ function normalizeEnv() {
|
|
|
199296
199309
|
}
|
|
199297
199310
|
|
|
199298
199311
|
// utils/overrides.ts
|
|
199299
|
-
var
|
|
199312
|
+
var core7 = __toESM(require_core(), 1);
|
|
199300
199313
|
var DENIED_OVERRIDE_NAMES = /* @__PURE__ */ new Set([
|
|
199301
199314
|
"GITHUB_TOKEN",
|
|
199302
199315
|
"GH_TOKEN",
|
|
@@ -199342,7 +199355,7 @@ function applyOverrides(params) {
|
|
|
199342
199355
|
denied.push(key);
|
|
199343
199356
|
continue;
|
|
199344
199357
|
}
|
|
199345
|
-
if (value2.length > 0)
|
|
199358
|
+
if (value2.length > 0) core7.setSecret(value2);
|
|
199346
199359
|
params.env[key] = value2;
|
|
199347
199360
|
applied.push(key);
|
|
199348
199361
|
}
|
|
@@ -199351,7 +199364,7 @@ function applyOverrides(params) {
|
|
|
199351
199364
|
}
|
|
199352
199365
|
|
|
199353
199366
|
// utils/payload.ts
|
|
199354
|
-
var
|
|
199367
|
+
var core8 = __toESM(require_core(), 1);
|
|
199355
199368
|
import { readFileSync as readFileSync7 } from "node:fs";
|
|
199356
199369
|
import { isAbsolute as isAbsolute2, resolve as resolve2 } from "node:path";
|
|
199357
199370
|
|
|
@@ -199485,8 +199498,8 @@ function assertDispatchPayloadIntact(promptInput) {
|
|
|
199485
199498
|
);
|
|
199486
199499
|
}
|
|
199487
199500
|
function resolvePromptInput() {
|
|
199488
|
-
const promptInput =
|
|
199489
|
-
const promptFile =
|
|
199501
|
+
const promptInput = core8.getInput("prompt");
|
|
199502
|
+
const promptFile = core8.getInput("prompt_file");
|
|
199490
199503
|
if (promptInput && promptFile) {
|
|
199491
199504
|
throw new Error("set exactly one of 'prompt' or 'prompt_file' inputs, not both.");
|
|
199492
199505
|
}
|
|
@@ -199520,7 +199533,7 @@ function resolvePromptFile(input2) {
|
|
|
199520
199533
|
}
|
|
199521
199534
|
function warnIfDeprecatedStatusChecks(value2) {
|
|
199522
199535
|
if (value2 !== void 0) {
|
|
199523
|
-
|
|
199536
|
+
core8.warning(
|
|
199524
199537
|
"`status_checks` is deprecated. Both checks are now repository settings \u2014 open the Pullfrog console for this repo (Automations \u2192 Review PRs) and set them there, then remove `status_checks` from your workflow. It keeps working until you do."
|
|
199525
199538
|
);
|
|
199526
199539
|
}
|
|
@@ -199528,15 +199541,15 @@ function warnIfDeprecatedStatusChecks(value2) {
|
|
|
199528
199541
|
}
|
|
199529
199542
|
function resolveNonPromptInputs() {
|
|
199530
199543
|
return Inputs.omit("prompt", "prompt_file").assert({
|
|
199531
|
-
model:
|
|
199532
|
-
effort:
|
|
199533
|
-
debug:
|
|
199534
|
-
timeout:
|
|
199535
|
-
cwd:
|
|
199536
|
-
push:
|
|
199537
|
-
shell:
|
|
199538
|
-
status_checks: warnIfDeprecatedStatusChecks(
|
|
199539
|
-
progress_comments:
|
|
199544
|
+
model: core8.getInput("model") || void 0,
|
|
199545
|
+
effort: core8.getInput("effort") || void 0,
|
|
199546
|
+
debug: core8.getInput("debug") || void 0,
|
|
199547
|
+
timeout: core8.getInput("timeout") || void 0,
|
|
199548
|
+
cwd: core8.getInput("cwd") || void 0,
|
|
199549
|
+
push: core8.getInput("push") || void 0,
|
|
199550
|
+
shell: core8.getInput("shell") || void 0,
|
|
199551
|
+
status_checks: warnIfDeprecatedStatusChecks(core8.getInput("status_checks") || void 0),
|
|
199552
|
+
progress_comments: core8.getInput("progress_comments") || void 0
|
|
199540
199553
|
});
|
|
199541
199554
|
}
|
|
199542
199555
|
function resolvePayload(resolvedPromptInput, repoSettings) {
|
|
@@ -199606,7 +199619,7 @@ function resolvePayload(resolvedPromptInput, repoSettings) {
|
|
|
199606
199619
|
};
|
|
199607
199620
|
}
|
|
199608
199621
|
function resolveOutputSchema() {
|
|
199609
|
-
const raw2 =
|
|
199622
|
+
const raw2 = core8.getInput("output_schema");
|
|
199610
199623
|
if (!raw2) return void 0;
|
|
199611
199624
|
let parsed2;
|
|
199612
199625
|
try {
|
|
@@ -199622,10 +199635,10 @@ function resolveOutputSchema() {
|
|
|
199622
199635
|
}
|
|
199623
199636
|
|
|
199624
199637
|
// utils/proxy.ts
|
|
199625
|
-
var
|
|
199638
|
+
var core10 = __toESM(require_core(), 1);
|
|
199626
199639
|
|
|
199627
199640
|
// utils/token.ts
|
|
199628
|
-
var
|
|
199641
|
+
var core9 = __toESM(require_core(), 1);
|
|
199629
199642
|
import assert2 from "node:assert/strict";
|
|
199630
199643
|
var mcpTokenValue;
|
|
199631
199644
|
var refreshMcpTokenFn;
|
|
@@ -199633,7 +199646,7 @@ function getMcpTokenRefresh() {
|
|
|
199633
199646
|
return refreshMcpTokenFn;
|
|
199634
199647
|
}
|
|
199635
199648
|
function getJobToken() {
|
|
199636
|
-
const inputToken =
|
|
199649
|
+
const inputToken = core9.getInput("token");
|
|
199637
199650
|
if (inputToken) {
|
|
199638
199651
|
return inputToken;
|
|
199639
199652
|
}
|
|
@@ -199649,7 +199662,7 @@ async function resolveTokens(params) {
|
|
|
199649
199662
|
if (externalToken) {
|
|
199650
199663
|
mcpTokenValue = externalToken;
|
|
199651
199664
|
if (isGitHubActions) {
|
|
199652
|
-
|
|
199665
|
+
core9.setSecret(externalToken);
|
|
199653
199666
|
}
|
|
199654
199667
|
log.info("\xBB using external GH_TOKEN for both git and MCP");
|
|
199655
199668
|
return {
|
|
@@ -199673,7 +199686,7 @@ async function resolveTokens(params) {
|
|
|
199673
199686
|
permissions: gitPermissions
|
|
199674
199687
|
});
|
|
199675
199688
|
if (isGitHubActions) {
|
|
199676
|
-
|
|
199689
|
+
core9.setSecret(gitToken);
|
|
199677
199690
|
}
|
|
199678
199691
|
log.info(
|
|
199679
199692
|
`\xBB acquired git token (${Object.entries(gitPermissions).map((e) => e.join(":")).join(", ")})`
|
|
@@ -199694,7 +199707,7 @@ async function resolveTokens(params) {
|
|
|
199694
199707
|
permissions: mcpPermissions
|
|
199695
199708
|
});
|
|
199696
199709
|
if (isGitHubActions) {
|
|
199697
|
-
|
|
199710
|
+
core9.setSecret(mcpToken);
|
|
199698
199711
|
}
|
|
199699
199712
|
log.info(
|
|
199700
199713
|
`\xBB acquired scoped MCP token (${Object.entries(mcpPermissions).map((e) => e.join(":")).join(", ")})`
|
|
@@ -199703,7 +199716,7 @@ async function resolveTokens(params) {
|
|
|
199703
199716
|
let ghToken;
|
|
199704
199717
|
if (ghPermissions) {
|
|
199705
199718
|
ghToken = await acquireNewToken({ permissions: ghPermissions });
|
|
199706
|
-
if (isGitHubActions)
|
|
199719
|
+
if (isGitHubActions) core9.setSecret(ghToken);
|
|
199707
199720
|
log.info(
|
|
199708
199721
|
`\xBB acquired gh token mirroring ${params.authorPermission} (${formatPermissions(ghPermissions)})`
|
|
199709
199722
|
);
|
|
@@ -199715,7 +199728,7 @@ async function resolveTokens(params) {
|
|
|
199715
199728
|
xrepoGrant: params.xrepoGrant,
|
|
199716
199729
|
permissions: { contents: "read" }
|
|
199717
199730
|
});
|
|
199718
|
-
if (isGitHubActions)
|
|
199731
|
+
if (isGitHubActions) core9.setSecret(readToken);
|
|
199719
199732
|
log.info(`\xBB acquired cross-repo read token (contents:read, ${params.xrepo.read.length} repos)`);
|
|
199720
199733
|
}
|
|
199721
199734
|
mcpTokenValue = mcpToken;
|
|
@@ -199735,7 +199748,7 @@ async function resolveTokens(params) {
|
|
|
199735
199748
|
oidc: params.oidc ?? void 0
|
|
199736
199749
|
}).then((fresh) => {
|
|
199737
199750
|
if (isGitHubActions) {
|
|
199738
|
-
|
|
199751
|
+
core9.setSecret(fresh);
|
|
199739
199752
|
}
|
|
199740
199753
|
mcpTokenValue = fresh;
|
|
199741
199754
|
currentMcpToken = fresh;
|
|
@@ -199757,7 +199770,7 @@ async function resolveTokens(params) {
|
|
|
199757
199770
|
permissions: gitPermissions,
|
|
199758
199771
|
oidc: params.oidc ?? void 0
|
|
199759
199772
|
}).then((fresh) => {
|
|
199760
|
-
if (isGitHubActions)
|
|
199773
|
+
if (isGitHubActions) core9.setSecret(fresh);
|
|
199761
199774
|
void revokeGitHubInstallationToken(currentGitToken);
|
|
199762
199775
|
currentGitToken = fresh;
|
|
199763
199776
|
log.warning("\xBB GitHub rejected the git token; re-acquired a fresh git token");
|
|
@@ -199775,7 +199788,7 @@ async function resolveTokens(params) {
|
|
|
199775
199788
|
permissions: { contents: "read" },
|
|
199776
199789
|
oidc: params.oidc ?? void 0
|
|
199777
199790
|
}).then((fresh) => {
|
|
199778
|
-
if (isGitHubActions)
|
|
199791
|
+
if (isGitHubActions) core9.setSecret(fresh);
|
|
199779
199792
|
void revokeGitHubInstallationToken(read2);
|
|
199780
199793
|
currentReadToken = fresh;
|
|
199781
199794
|
log.warning("\xBB GitHub rejected the read token; re-acquired a fresh read token");
|
|
@@ -199869,7 +199882,6 @@ ${ctx.error}` : ctx.error;
|
|
|
199869
199882
|
fallbackFrom: ctx.toolState.modelFallback?.from,
|
|
199870
199883
|
clamped: ctx.toolState.modelClamped,
|
|
199871
199884
|
unselectedProxyDefault: ctx.toolState.unselectedProxyDefault,
|
|
199872
|
-
shaPinned: ctx.toolState.shaPinned,
|
|
199873
199885
|
oss: ctx.toolState.oss,
|
|
199874
199886
|
owner: repoContext.owner
|
|
199875
199887
|
});
|
|
@@ -199990,7 +200002,7 @@ async function resolveProxyModel(ctx) {
|
|
|
199990
200002
|
});
|
|
199991
200003
|
if (!key) return;
|
|
199992
200004
|
process.env.OPENROUTER_API_KEY = key;
|
|
199993
|
-
|
|
200005
|
+
core10.setSecret(key);
|
|
199994
200006
|
ctx.payload.proxyModel = ctx.proxyModel;
|
|
199995
200007
|
ctx.toolState.model = ctx.proxyModel;
|
|
199996
200008
|
const label = ctx.oss ? "oss" : "router";
|
|
@@ -200068,7 +200080,7 @@ async function resolveTrialFallback(ctx) {
|
|
|
200068
200080
|
});
|
|
200069
200081
|
if (!key) return false;
|
|
200070
200082
|
process.env.OPENROUTER_API_KEY = key;
|
|
200071
|
-
|
|
200083
|
+
core10.setSecret(key);
|
|
200072
200084
|
ctx.payload.proxyModel = DEFAULT_PROXY_MODEL;
|
|
200073
200085
|
ctx.toolState.model = DEFAULT_PROXY_MODEL;
|
|
200074
200086
|
ctx.toolState.modelClamped = {
|
|
@@ -200304,23 +200316,11 @@ async function fetchRunContext(params) {
|
|
|
200304
200316
|
}
|
|
200305
200317
|
|
|
200306
200318
|
// utils/runContextData.ts
|
|
200307
|
-
function isActionPinnedToSha() {
|
|
200308
|
-
const ref = process.env.GITHUB_ACTION_REF;
|
|
200309
|
-
return !!ref && /^[0-9a-f]{40}$/i.test(ref);
|
|
200310
|
-
}
|
|
200311
|
-
function warnIfPinnedToSha() {
|
|
200312
|
-
if (isActionPinnedToSha()) {
|
|
200313
|
-
log.warning(
|
|
200314
|
-
`\xBB pinned to a commit SHA (${process.env.GITHUB_ACTION_REF}); the post-run cleanup step is frozen at that commit and won't receive fixes. keep the SHA fresh with Dependabot, or pin to \`pullfrog/pullfrog@v0\` if your org doesn't require full-SHA action pinning \u2014 see https://docs.pullfrog.com/versioning`
|
|
200315
|
-
);
|
|
200316
|
-
}
|
|
200317
|
-
}
|
|
200318
200319
|
async function resolveRunContextData(params) {
|
|
200319
200320
|
const actionRef = process.env.GITHUB_ACTION_REF;
|
|
200320
200321
|
log.info(
|
|
200321
200322
|
`\xBB running Pullfrog v${package_default.version}${actionRef ? ` (ref: ${actionRef})` : ""}...`
|
|
200322
200323
|
);
|
|
200323
|
-
warnIfPinnedToSha();
|
|
200324
200324
|
const repoContext = parseRepoContext();
|
|
200325
200325
|
let oidcToken;
|
|
200326
200326
|
try {
|
|
@@ -200754,7 +200754,7 @@ ${genericBody}`,
|
|
|
200754
200754
|
}
|
|
200755
200755
|
|
|
200756
200756
|
// utils/runLifecycle.ts
|
|
200757
|
-
var
|
|
200757
|
+
var core11 = __toESM(require_core(), 1);
|
|
200758
200758
|
|
|
200759
200759
|
// utils/autoMerge.ts
|
|
200760
200760
|
function hasBlockingHumanReview(reviews) {
|
|
@@ -201150,7 +201150,7 @@ async function finalizeSuccessRun(input2) {
|
|
|
201150
201150
|
}
|
|
201151
201151
|
if (input2.toolState.output) {
|
|
201152
201152
|
log.info(`::pullfrog-output::${Buffer.from(input2.toolState.output).toString("base64")}`);
|
|
201153
|
-
|
|
201153
|
+
core11.setOutput("result", input2.toolState.output);
|
|
201154
201154
|
}
|
|
201155
201155
|
if (input2.result.success) {
|
|
201156
201156
|
await approveAfterFix(input2.toolContext).catch((error62) => {
|
|
@@ -201450,7 +201450,6 @@ async function main() {
|
|
|
201450
201450
|
});
|
|
201451
201451
|
toolState.model = payload.model;
|
|
201452
201452
|
toolState.oss = runContext.oss;
|
|
201453
|
-
toolState.shaPinned = isActionPinnedToSha();
|
|
201454
201453
|
if (payload.event.issue_number !== void 0) {
|
|
201455
201454
|
primaryRepoState(toolState).issueNumber = payload.event.issue_number;
|
|
201456
201455
|
}
|