pullfrog 0.1.104 → 0.1.105
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/README.md +3 -3
- package/dist/cli.mjs +290 -177
- package/dist/external.d.ts +3 -2
- package/dist/index.js +122 -44
- package/dist/internal/index.d.ts +1 -0
- package/dist/internal.js +52 -3
- package/dist/models.d.ts +21 -0
- package/dist/utils/agent.d.ts +9 -0
- package/dist/utils/apiKeys.d.ts +2 -0
- package/dist/utils/runEffort.d.ts +10 -0
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -96,7 +96,7 @@ var require_arg = __commonJS({
|
|
|
96
96
|
Object.setPrototypeOf(this, _ArgError.prototype);
|
|
97
97
|
}
|
|
98
98
|
};
|
|
99
|
-
function
|
|
99
|
+
function arg11(opts, {
|
|
100
100
|
argv = process.argv.slice(2),
|
|
101
101
|
permissive = false,
|
|
102
102
|
stopAtPositional = false
|
|
@@ -171,15 +171,15 @@ var require_arg = __commonJS({
|
|
|
171
171
|
if (wholeArg.length > 1 && wholeArg[0] === "-") {
|
|
172
172
|
const separatedArguments = wholeArg[1] === "-" || wholeArg.length === 2 ? [wholeArg] : wholeArg.slice(1).split("").map((a2) => `-${a2}`);
|
|
173
173
|
for (let j = 0; j < separatedArguments.length; j++) {
|
|
174
|
-
const
|
|
175
|
-
const [originalArgName, argStr] =
|
|
174
|
+
const arg12 = separatedArguments[j];
|
|
175
|
+
const [originalArgName, argStr] = arg12[1] === "-" ? arg12.split(/=(.*)/, 2) : [arg12, void 0];
|
|
176
176
|
let argName = originalArgName;
|
|
177
177
|
while (argName in aliases) {
|
|
178
178
|
argName = aliases[argName];
|
|
179
179
|
}
|
|
180
180
|
if (!(argName in handlers2)) {
|
|
181
181
|
if (permissive) {
|
|
182
|
-
result._.push(
|
|
182
|
+
result._.push(arg12);
|
|
183
183
|
continue;
|
|
184
184
|
} else {
|
|
185
185
|
throw new ArgError(
|
|
@@ -218,13 +218,13 @@ var require_arg = __commonJS({
|
|
|
218
218
|
}
|
|
219
219
|
return result;
|
|
220
220
|
}
|
|
221
|
-
|
|
221
|
+
arg11.flag = (fn2) => {
|
|
222
222
|
fn2[flagSymbol] = true;
|
|
223
223
|
return fn2;
|
|
224
224
|
};
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
module.exports =
|
|
225
|
+
arg11.COUNT = arg11.flag((v, name, existingCount) => (existingCount || 0) + 1);
|
|
226
|
+
arg11.ArgError = ArgError;
|
|
227
|
+
module.exports = arg11;
|
|
228
228
|
}
|
|
229
229
|
});
|
|
230
230
|
|
|
@@ -2393,13 +2393,13 @@ var init_doc = __esm({
|
|
|
2393
2393
|
this.indent -= 1;
|
|
2394
2394
|
}
|
|
2395
2395
|
}
|
|
2396
|
-
write(
|
|
2397
|
-
if (typeof
|
|
2398
|
-
|
|
2399
|
-
|
|
2396
|
+
write(arg11) {
|
|
2397
|
+
if (typeof arg11 === "function") {
|
|
2398
|
+
arg11(this, { execution: "sync" });
|
|
2399
|
+
arg11(this, { execution: "async" });
|
|
2400
2400
|
return;
|
|
2401
2401
|
}
|
|
2402
|
-
const content =
|
|
2402
|
+
const content = arg11;
|
|
2403
2403
|
const lines = content.split("\n").filter((x) => x);
|
|
2404
2404
|
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
|
|
2405
2405
|
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
|
|
@@ -19992,10 +19992,10 @@ var require_timers = __commonJS({
|
|
|
19992
19992
|
* before the specified function or code is executed.
|
|
19993
19993
|
* @param {*} arg
|
|
19994
19994
|
*/
|
|
19995
|
-
constructor(callback, delay2,
|
|
19995
|
+
constructor(callback, delay2, arg11) {
|
|
19996
19996
|
this._onTimeout = callback;
|
|
19997
19997
|
this._idleTimeout = delay2;
|
|
19998
|
-
this._timerArg =
|
|
19998
|
+
this._timerArg = arg11;
|
|
19999
19999
|
this.refresh();
|
|
20000
20000
|
}
|
|
20001
20001
|
/**
|
|
@@ -20039,8 +20039,8 @@ var require_timers = __commonJS({
|
|
|
20039
20039
|
* when the timer expires.
|
|
20040
20040
|
* @returns {NodeJS.Timeout|FastTimer}
|
|
20041
20041
|
*/
|
|
20042
|
-
setTimeout(callback, delay2,
|
|
20043
|
-
return delay2 <= RESOLUTION_MS ? setTimeout(callback, delay2,
|
|
20042
|
+
setTimeout(callback, delay2, arg11) {
|
|
20043
|
+
return delay2 <= RESOLUTION_MS ? setTimeout(callback, delay2, arg11) : new FastTimer(callback, delay2, arg11);
|
|
20044
20044
|
},
|
|
20045
20045
|
/**
|
|
20046
20046
|
* The clearTimeout method cancels an instantiated Timer previously created
|
|
@@ -20066,8 +20066,8 @@ var require_timers = __commonJS({
|
|
|
20066
20066
|
* when the timer expires.
|
|
20067
20067
|
* @returns {FastTimer}
|
|
20068
20068
|
*/
|
|
20069
|
-
setFastTimeout(callback, delay2,
|
|
20070
|
-
return new FastTimer(callback, delay2,
|
|
20069
|
+
setFastTimeout(callback, delay2, arg11) {
|
|
20070
|
+
return new FastTimer(callback, delay2, arg11);
|
|
20071
20071
|
},
|
|
20072
20072
|
/**
|
|
20073
20073
|
* The clearTimeout method cancels an instantiated FastTimer previously
|
|
@@ -44727,20 +44727,20 @@ var require_escape = __commonJS({
|
|
|
44727
44727
|
"node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/escape.js"(exports, module) {
|
|
44728
44728
|
"use strict";
|
|
44729
44729
|
var metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
44730
|
-
function escapeCommand(
|
|
44731
|
-
|
|
44732
|
-
return
|
|
44733
|
-
}
|
|
44734
|
-
function escapeArgument(
|
|
44735
|
-
|
|
44736
|
-
|
|
44737
|
-
|
|
44738
|
-
|
|
44739
|
-
|
|
44730
|
+
function escapeCommand(arg11) {
|
|
44731
|
+
arg11 = arg11.replace(metaCharsRegExp, "^$1");
|
|
44732
|
+
return arg11;
|
|
44733
|
+
}
|
|
44734
|
+
function escapeArgument(arg11, doubleEscapeMetaChars) {
|
|
44735
|
+
arg11 = `${arg11}`;
|
|
44736
|
+
arg11 = arg11.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
|
|
44737
|
+
arg11 = arg11.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
44738
|
+
arg11 = `"${arg11}"`;
|
|
44739
|
+
arg11 = arg11.replace(metaCharsRegExp, "^$1");
|
|
44740
44740
|
if (doubleEscapeMetaChars) {
|
|
44741
|
-
|
|
44741
|
+
arg11 = arg11.replace(metaCharsRegExp, "^$1");
|
|
44742
44742
|
}
|
|
44743
|
-
return
|
|
44743
|
+
return arg11;
|
|
44744
44744
|
}
|
|
44745
44745
|
module.exports.command = escapeCommand;
|
|
44746
44746
|
module.exports.argument = escapeArgument;
|
|
@@ -44828,7 +44828,7 @@ var require_parse3 = __commonJS({
|
|
|
44828
44828
|
const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
|
|
44829
44829
|
parsed2.command = path4.normalize(parsed2.command);
|
|
44830
44830
|
parsed2.command = escape2.command(parsed2.command);
|
|
44831
|
-
parsed2.args = parsed2.args.map((
|
|
44831
|
+
parsed2.args = parsed2.args.map((arg11) => escape2.argument(arg11, needsDoubleEscapeMetaChars));
|
|
44832
44832
|
const shellCommand = [parsed2.command].concat(parsed2.args).join(" ");
|
|
44833
44833
|
parsed2.args = ["/d", "/s", "/c", `"${shellCommand}"`];
|
|
44834
44834
|
parsed2.command = process.env.comspec || "cmd.exe";
|
|
@@ -45118,10 +45118,10 @@ var require_timers2 = __commonJS({
|
|
|
45118
45118
|
* before the specified function or code is executed.
|
|
45119
45119
|
* @param {*} arg
|
|
45120
45120
|
*/
|
|
45121
|
-
constructor(callback, delay2,
|
|
45121
|
+
constructor(callback, delay2, arg11) {
|
|
45122
45122
|
this._onTimeout = callback;
|
|
45123
45123
|
this._idleTimeout = delay2;
|
|
45124
|
-
this._timerArg =
|
|
45124
|
+
this._timerArg = arg11;
|
|
45125
45125
|
this.refresh();
|
|
45126
45126
|
}
|
|
45127
45127
|
/**
|
|
@@ -45165,8 +45165,8 @@ var require_timers2 = __commonJS({
|
|
|
45165
45165
|
* when the timer expires.
|
|
45166
45166
|
* @returns {NodeJS.Timeout|FastTimer}
|
|
45167
45167
|
*/
|
|
45168
|
-
setTimeout(callback, delay2,
|
|
45169
|
-
return delay2 <= RESOLUTION_MS ? setTimeout(callback, delay2,
|
|
45168
|
+
setTimeout(callback, delay2, arg11) {
|
|
45169
|
+
return delay2 <= RESOLUTION_MS ? setTimeout(callback, delay2, arg11) : new FastTimer(callback, delay2, arg11);
|
|
45170
45170
|
},
|
|
45171
45171
|
/**
|
|
45172
45172
|
* The clearTimeout method cancels an instantiated Timer previously created
|
|
@@ -45192,8 +45192,8 @@ var require_timers2 = __commonJS({
|
|
|
45192
45192
|
* when the timer expires.
|
|
45193
45193
|
* @returns {FastTimer}
|
|
45194
45194
|
*/
|
|
45195
|
-
setFastTimeout(callback, delay2,
|
|
45196
|
-
return new FastTimer(callback, delay2,
|
|
45195
|
+
setFastTimeout(callback, delay2, arg11) {
|
|
45196
|
+
return new FastTimer(callback, delay2, arg11);
|
|
45197
45197
|
},
|
|
45198
45198
|
/**
|
|
45199
45199
|
* The clearTimeout method cancels an instantiated FastTimer previously
|
|
@@ -74716,9 +74716,9 @@ var init_types = __esm({
|
|
|
74716
74716
|
const { status, ctx } = this._processInputParams(input2);
|
|
74717
74717
|
const effect = this._def.effect || null;
|
|
74718
74718
|
const checkCtx = {
|
|
74719
|
-
addIssue: (
|
|
74720
|
-
addIssueToContext(ctx,
|
|
74721
|
-
if (
|
|
74719
|
+
addIssue: (arg11) => {
|
|
74720
|
+
addIssueToContext(ctx, arg11);
|
|
74721
|
+
if (arg11.fatal) {
|
|
74722
74722
|
status.abort();
|
|
74723
74723
|
} else {
|
|
74724
74724
|
status.dirty();
|
|
@@ -76884,13 +76884,13 @@ var require_code = __commonJS({
|
|
|
76884
76884
|
return new _Code(expr);
|
|
76885
76885
|
}
|
|
76886
76886
|
exports.str = str;
|
|
76887
|
-
function addCodeArg(code,
|
|
76888
|
-
if (
|
|
76889
|
-
code.push(...
|
|
76890
|
-
else if (
|
|
76891
|
-
code.push(
|
|
76887
|
+
function addCodeArg(code, arg11) {
|
|
76888
|
+
if (arg11 instanceof _Code)
|
|
76889
|
+
code.push(...arg11._items);
|
|
76890
|
+
else if (arg11 instanceof Name)
|
|
76891
|
+
code.push(arg11);
|
|
76892
76892
|
else
|
|
76893
|
-
code.push(interpolate(
|
|
76893
|
+
code.push(interpolate(arg11));
|
|
76894
76894
|
}
|
|
76895
76895
|
exports.addCodeArg = addCodeArg;
|
|
76896
76896
|
function optimize(expr) {
|
|
@@ -88199,8 +88199,8 @@ var require_select = __commonJS({
|
|
|
88199
88199
|
return selectors[":is"](sel);
|
|
88200
88200
|
},
|
|
88201
88201
|
":nth-match": function(param, last) {
|
|
88202
|
-
var args2 = param.split(/\s*,\s*/),
|
|
88203
|
-
return nth(
|
|
88202
|
+
var args2 = param.split(/\s*,\s*/), arg11 = args2.shift(), test = compileGroup(args2.join(","));
|
|
88203
|
+
return nth(arg11, test, last);
|
|
88204
88204
|
},
|
|
88205
88205
|
":nth-last-match": function(param) {
|
|
88206
88206
|
return selectors[":nth-match"](param, true);
|
|
@@ -108171,7 +108171,7 @@ var init_file_type = __esm({
|
|
|
108171
108171
|
});
|
|
108172
108172
|
|
|
108173
108173
|
// cli.ts
|
|
108174
|
-
var
|
|
108174
|
+
var import_arg10 = __toESM(require_arg(), 1);
|
|
108175
108175
|
var import_picocolors5 = __toESM(require_picocolors(), 1);
|
|
108176
108176
|
import { basename as basename2 } from "node:path";
|
|
108177
108177
|
|
|
@@ -109984,11 +109984,11 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
109984
109984
|
array() {
|
|
109985
109985
|
return array(this);
|
|
109986
109986
|
},
|
|
109987
|
-
or(
|
|
109988
|
-
return union([this,
|
|
109987
|
+
or(arg11) {
|
|
109988
|
+
return union([this, arg11]);
|
|
109989
109989
|
},
|
|
109990
|
-
and(
|
|
109991
|
-
return intersection(this,
|
|
109990
|
+
and(arg11) {
|
|
109991
|
+
return intersection(this, arg11);
|
|
109992
109992
|
},
|
|
109993
109993
|
transform(tx) {
|
|
109994
109994
|
return pipe(this, transform(tx));
|
|
@@ -112919,7 +112919,7 @@ var import_picocolors = __toESM(require_picocolors(), 1);
|
|
|
112919
112919
|
// package.json
|
|
112920
112920
|
var package_default = {
|
|
112921
112921
|
name: "pullfrog",
|
|
112922
|
-
version: "0.1.
|
|
112922
|
+
version: "0.1.105",
|
|
112923
112923
|
cliContractVersion: "1",
|
|
112924
112924
|
type: "module",
|
|
112925
112925
|
bin: {
|
|
@@ -114155,7 +114155,7 @@ var repoConfigFields = [
|
|
|
114155
114155
|
key: "address-reviews.enabled",
|
|
114156
114156
|
field: "codingAddressReviews",
|
|
114157
114157
|
kind: "toggle",
|
|
114158
|
-
description: "address
|
|
114158
|
+
description: "address reviews on Pullfrog-authored PRs"
|
|
114159
114159
|
},
|
|
114160
114160
|
{
|
|
114161
114161
|
key: "fix-ci.own-prs",
|
|
@@ -115946,7 +115946,7 @@ var aube = {
|
|
|
115946
115946
|
function denoAdd(args2) {
|
|
115947
115947
|
if (args2.includes("--npm") || args2.includes("--jsr"))
|
|
115948
115948
|
return ["deno", "add", ...args2];
|
|
115949
|
-
return ["deno", "add", ...args2.map((
|
|
115949
|
+
return ["deno", "add", ...args2.map((arg11) => arg11.startsWith("-") || arg11.includes(":") ? arg11 : `npm:${arg11}`)];
|
|
115950
115950
|
}
|
|
115951
115951
|
var deno = {
|
|
115952
115952
|
"agent": ["deno", 0],
|
|
@@ -117863,9 +117863,34 @@ var AZURE_USE_CHAT_COMPLETIONS_ENV = "AZURE_USE_CHAT_COMPLETIONS";
|
|
|
117863
117863
|
var OPENAI_COMPATIBLE_PROVIDER = "openai-compatible";
|
|
117864
117864
|
var OPENAI_COMPATIBLE_BASE_URL_ENV = "OPENAI_COMPATIBLE_BASE_URL";
|
|
117865
117865
|
var OPENAI_COMPATIBLE_API_KEY_ENV = "OPENAI_COMPATIBLE_API_KEY";
|
|
117866
|
-
var OPENAI_COMPATIBLE_MODEL_ENV = "OPENAI_COMPATIBLE_MODEL";
|
|
117867
117866
|
var OPENAI_COMPATIBLE_CONTEXT_ENV = "OPENAI_COMPATIBLE_CONTEXT";
|
|
117868
117867
|
var OPENAI_COMPATIBLE_MAX_OUTPUT_ENV = "OPENAI_COMPATIBLE_MAX_OUTPUT";
|
|
117868
|
+
function isOpenAICompatibleSetName(name) {
|
|
117869
|
+
return name !== "byok" && name.length <= 32 && /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(name);
|
|
117870
|
+
}
|
|
117871
|
+
function openAICompatibleSetName(slug2) {
|
|
117872
|
+
const prefix = `${OPENAI_COMPATIBLE_PROVIDER}/`;
|
|
117873
|
+
if (!slug2.startsWith(prefix)) return void 0;
|
|
117874
|
+
const name = slug2.slice(prefix.length);
|
|
117875
|
+
return isOpenAICompatibleSetName(name) ? name : void 0;
|
|
117876
|
+
}
|
|
117877
|
+
var OPENAI_COMPATIBLE_FIELDS = [
|
|
117878
|
+
"baseUrl",
|
|
117879
|
+
"apiKey",
|
|
117880
|
+
"model",
|
|
117881
|
+
"context",
|
|
117882
|
+
"maxOutput"
|
|
117883
|
+
];
|
|
117884
|
+
function openAICompatibleEnv(name) {
|
|
117885
|
+
const prefix = `OPENAI_COMPATIBLE_${name ? `${name.toUpperCase().replaceAll("-", "_")}_` : ""}`;
|
|
117886
|
+
return {
|
|
117887
|
+
baseUrl: `${prefix}BASE_URL`,
|
|
117888
|
+
apiKey: `${prefix}API_KEY`,
|
|
117889
|
+
model: `${prefix}MODEL`,
|
|
117890
|
+
context: `${prefix}CONTEXT`,
|
|
117891
|
+
maxOutput: `${prefix}MAX_OUTPUT`
|
|
117892
|
+
};
|
|
117893
|
+
}
|
|
117869
117894
|
var PROVIDER_GATEWAY_URL_ENV = {
|
|
117870
117895
|
anthropic: "ANTHROPIC_BASE_URL",
|
|
117871
117896
|
openai: "OPENAI_BASE_URL"
|
|
@@ -117910,7 +117935,7 @@ function findDanglingPromptToolRefs(params) {
|
|
|
117910
117935
|
return [...new Set(extractMcpToolRefs(params.agentId, params.prompt))].filter((name) => !registered.has(name)).sort();
|
|
117911
117936
|
}
|
|
117912
117937
|
function hasSimilarIssues(params) {
|
|
117913
|
-
return params.repoIntelligence &&
|
|
117938
|
+
return params.repoIntelligence && !params.event.is_pr;
|
|
117914
117939
|
}
|
|
117915
117940
|
|
|
117916
117941
|
// utils/activity.ts
|
|
@@ -118187,11 +118212,11 @@ function ts() {
|
|
|
118187
118212
|
return isDebugEnabled() ? `[${(/* @__PURE__ */ new Date()).toISOString()}] ` : "";
|
|
118188
118213
|
}
|
|
118189
118214
|
function formatArgs(args2) {
|
|
118190
|
-
return args2.map((
|
|
118191
|
-
if (typeof
|
|
118192
|
-
if (
|
|
118193
|
-
${
|
|
118194
|
-
return JSON.stringify(
|
|
118215
|
+
return args2.map((arg11) => {
|
|
118216
|
+
if (typeof arg11 === "string") return arg11;
|
|
118217
|
+
if (arg11 instanceof Error) return `${arg11.message}
|
|
118218
|
+
${arg11.stack}`;
|
|
118219
|
+
return JSON.stringify(arg11);
|
|
118195
118220
|
}).join(" ");
|
|
118196
118221
|
}
|
|
118197
118222
|
function startGroup2(name) {
|
|
@@ -118697,7 +118722,11 @@ function resolveRunEffort(ctx) {
|
|
|
118697
118722
|
const configured = ctx.payload.effort !== void 0;
|
|
118698
118723
|
const position = ctx.payload.effort ?? DEFAULT_EFFORT_POSITION;
|
|
118699
118724
|
const alias = resolveRunAlias(ctx);
|
|
118700
|
-
if (!alias)
|
|
118725
|
+
if (!alias) {
|
|
118726
|
+
const declarable = configured && !ctx.resolvedModel?.startsWith(`${AZURE_PROVIDER}/`);
|
|
118727
|
+
const rung = declarable && ctx.declaredVariants ? resolveRung({ position, published: ctx.declaredVariants }) : void 0;
|
|
118728
|
+
return { position, configured, rung, alias: void 0, declarable };
|
|
118729
|
+
}
|
|
118701
118730
|
return {
|
|
118702
118731
|
position,
|
|
118703
118732
|
configured,
|
|
@@ -118706,7 +118735,8 @@ function resolveRunEffort(ctx) {
|
|
|
118706
118735
|
position,
|
|
118707
118736
|
useOpenRouter: !!ctx.payload.proxyModel
|
|
118708
118737
|
}),
|
|
118709
|
-
alias
|
|
118738
|
+
alias,
|
|
118739
|
+
declarable: false
|
|
118710
118740
|
};
|
|
118711
118741
|
}
|
|
118712
118742
|
|
|
@@ -122724,7 +122754,7 @@ var buildClientParams = (args2, fields) => {
|
|
|
122724
122754
|
};
|
|
122725
122755
|
const map2 = buildKeyMap(fields);
|
|
122726
122756
|
let config3;
|
|
122727
|
-
for (const [index,
|
|
122757
|
+
for (const [index, arg11] of args2.entries()) {
|
|
122728
122758
|
if (fields[index]) {
|
|
122729
122759
|
config3 = fields[index];
|
|
122730
122760
|
}
|
|
@@ -122737,13 +122767,13 @@ var buildClientParams = (args2, fields) => {
|
|
|
122737
122767
|
const name = field.map || config3.key;
|
|
122738
122768
|
if (field.in) {
|
|
122739
122769
|
;
|
|
122740
|
-
params[field.in][name] =
|
|
122770
|
+
params[field.in][name] = arg11;
|
|
122741
122771
|
}
|
|
122742
122772
|
} else {
|
|
122743
|
-
params.body =
|
|
122773
|
+
params.body = arg11;
|
|
122744
122774
|
}
|
|
122745
122775
|
} else {
|
|
122746
|
-
for (const [key, value2] of Object.entries(
|
|
122776
|
+
for (const [key, value2] of Object.entries(arg11 ?? {})) {
|
|
122747
122777
|
const field = map2.get(key);
|
|
122748
122778
|
if (field) {
|
|
122749
122779
|
if (field.in) {
|
|
@@ -127788,6 +127818,17 @@ function parseModel2(value2) {
|
|
|
127788
127818
|
if (slash <= 0) return void 0;
|
|
127789
127819
|
return { providerID: value2.slice(0, slash), modelID: value2.slice(slash + 1) };
|
|
127790
127820
|
}
|
|
127821
|
+
async function resolveDeclaredRung(ctx, params) {
|
|
127822
|
+
const resp = await params.client.config.providers();
|
|
127823
|
+
const provider2 = resp.data?.providers.find((p) => p.id === params.model.providerID);
|
|
127824
|
+
const variants = provider2?.models[params.model.modelID]?.variants ?? {};
|
|
127825
|
+
const name = `${params.model.providerID}/${params.model.modelID}`;
|
|
127826
|
+
const rung = resolveRunEffort({ ...ctx, declaredVariants: Object.keys(variants) }).rung;
|
|
127827
|
+
log2.info(
|
|
127828
|
+
`\xBB effort: ${rung ? `${rung} (declared by opencode for ${name})` : `not applied \u2014 opencode declares no variants for ${name}`}`
|
|
127829
|
+
);
|
|
127830
|
+
return rung;
|
|
127831
|
+
}
|
|
127791
127832
|
function bootOpencodeServer(params) {
|
|
127792
127833
|
const logLevel = isDebugEnabled() ? "INFO" : "ERROR";
|
|
127793
127834
|
if (logLevel !== "ERROR") log2.info(`\xBB opencode log level: ${logLevel} (debug run)`);
|
|
@@ -128442,6 +128483,11 @@ var opencode = agent({
|
|
|
128442
128483
|
log2.info(`\xBB opencode session: ${sessionID}`);
|
|
128443
128484
|
const labeler = new SessionLabeler();
|
|
128444
128485
|
labeler.labelFor(sessionID);
|
|
128486
|
+
const sdkModel = parseModel2(model);
|
|
128487
|
+
const variant = effort.declarable && sdkModel ? await resolveDeclaredRung(
|
|
128488
|
+
{ ...ctx, resolvedModel: rawModel },
|
|
128489
|
+
{ client: client2, model: sdkModel }
|
|
128490
|
+
) : effort.rung;
|
|
128445
128491
|
const runnerCtx = {
|
|
128446
128492
|
client: client2,
|
|
128447
128493
|
sessionID,
|
|
@@ -128450,7 +128496,7 @@ var opencode = agent({
|
|
|
128450
128496
|
labeler,
|
|
128451
128497
|
toolState: ctx.toolState,
|
|
128452
128498
|
// `rawModel` folds in the auto-select pick — see the opencode.ts twin.
|
|
128453
|
-
variant
|
|
128499
|
+
variant,
|
|
128454
128500
|
todoTracker: ctx.todoTracker,
|
|
128455
128501
|
onActivityTimeout: ctx.onActivityTimeout,
|
|
128456
128502
|
onTurnRecovered: ctx.onTurnRecovered,
|
|
@@ -128512,7 +128558,6 @@ var opencode = agent({
|
|
|
128512
128558
|
timeoutMs: AGENT_ACTIVITY_TIMEOUT_MS,
|
|
128513
128559
|
abortTurn: () => turnController.abort()
|
|
128514
128560
|
});
|
|
128515
|
-
const sdkModel = parseModel2(model);
|
|
128516
128561
|
let salvagesLeft = 1;
|
|
128517
128562
|
const runTurn = async (text) => {
|
|
128518
128563
|
const attempt = (prompt) => {
|
|
@@ -129383,12 +129428,12 @@ var CompiledFunction = class extends CastableBase {
|
|
|
129383
129428
|
constructor(...args2) {
|
|
129384
129429
|
super();
|
|
129385
129430
|
this.argNames = args2;
|
|
129386
|
-
for (const
|
|
129387
|
-
if (
|
|
129388
|
-
throw new Error(`Arg name '${
|
|
129431
|
+
for (const arg11 of args2) {
|
|
129432
|
+
if (arg11 in this) {
|
|
129433
|
+
throw new Error(`Arg name '${arg11}' would overwrite an existing property on FunctionBody`);
|
|
129389
129434
|
}
|
|
129390
129435
|
;
|
|
129391
|
-
this[
|
|
129436
|
+
this[arg11] = arg11;
|
|
129392
129437
|
}
|
|
129393
129438
|
}
|
|
129394
129439
|
indentation = 0;
|
|
@@ -129473,12 +129518,12 @@ var NodeCompiler = class extends CompiledFunction {
|
|
|
129473
129518
|
this.optimistic = ctx.optimistic === true;
|
|
129474
129519
|
}
|
|
129475
129520
|
invoke(node3, opts) {
|
|
129476
|
-
const
|
|
129521
|
+
const arg11 = opts?.arg ?? this.data;
|
|
129477
129522
|
const requiresContext = typeof node3 === "string" ? true : this.requiresContextFor(node3);
|
|
129478
129523
|
const id = typeof node3 === "string" ? node3 : node3.id;
|
|
129479
129524
|
if (requiresContext)
|
|
129480
|
-
return `${this.referenceToId(id, opts)}(${
|
|
129481
|
-
return `${this.referenceToId(id, opts)}(${
|
|
129525
|
+
return `${this.referenceToId(id, opts)}(${arg11}, ${this.ctx})`;
|
|
129526
|
+
return `${this.referenceToId(id, opts)}(${arg11})`;
|
|
129482
129527
|
}
|
|
129483
129528
|
referenceToId(id, opts) {
|
|
129484
129529
|
const invokedKind = opts?.kind ?? this.traversalKind;
|
|
@@ -135474,11 +135519,11 @@ var Context = class {
|
|
|
135474
135519
|
if (!this.#var) return {};
|
|
135475
135520
|
return Object.fromEntries(this.#var);
|
|
135476
135521
|
}
|
|
135477
|
-
#newResponse(data,
|
|
135522
|
+
#newResponse(data, arg11, headers) {
|
|
135478
135523
|
let responseHeaders = this.#res ? new Headers(this.#res.headers) : this.#preparedHeaders;
|
|
135479
|
-
if (typeof
|
|
135524
|
+
if (typeof arg11 === "object" && arg11.headers) {
|
|
135480
135525
|
responseHeaders ??= new Headers();
|
|
135481
|
-
for (const [key, value2] of new Headers(
|
|
135526
|
+
for (const [key, value2] of new Headers(arg11.headers)) if (key === "set-cookie") responseHeaders.append(key, value2);
|
|
135482
135527
|
else responseHeaders.set(key, value2);
|
|
135483
135528
|
}
|
|
135484
135529
|
if (headers) {
|
|
@@ -135498,7 +135543,7 @@ var Context = class {
|
|
|
135498
135543
|
}
|
|
135499
135544
|
}
|
|
135500
135545
|
}
|
|
135501
|
-
const status = typeof
|
|
135546
|
+
const status = typeof arg11 === "number" ? arg11 : arg11?.status ?? this.#status;
|
|
135502
135547
|
return createResponseInstance(data, {
|
|
135503
135548
|
status,
|
|
135504
135549
|
headers: responseHeaders ?? headers
|
|
@@ -135526,7 +135571,7 @@ var Context = class {
|
|
|
135526
135571
|
* })
|
|
135527
135572
|
* ```
|
|
135528
135573
|
*/
|
|
135529
|
-
body = (data,
|
|
135574
|
+
body = (data, arg11, headers) => this.#newResponse(data, arg11, headers);
|
|
135530
135575
|
/**
|
|
135531
135576
|
* `.text()` can render text as `Content-Type:text/plain`.
|
|
135532
135577
|
*
|
|
@@ -135539,8 +135584,8 @@ var Context = class {
|
|
|
135539
135584
|
* })
|
|
135540
135585
|
* ```
|
|
135541
135586
|
*/
|
|
135542
|
-
text = (text,
|
|
135543
|
-
return !this.#preparedHeaders && !this.#status && !
|
|
135587
|
+
text = (text, arg11, headers) => {
|
|
135588
|
+
return !this.#preparedHeaders && !this.#status && !arg11 && !headers && !this.finalized ? new Response(text) : this.#newResponse(text, arg11, setDefaultContentType(TEXT_PLAIN, headers));
|
|
135544
135589
|
};
|
|
135545
135590
|
/**
|
|
135546
135591
|
* `.json()` can render JSON as `Content-Type:application/json`.
|
|
@@ -135554,11 +135599,11 @@ var Context = class {
|
|
|
135554
135599
|
* })
|
|
135555
135600
|
* ```
|
|
135556
135601
|
*/
|
|
135557
|
-
json = (object5,
|
|
135558
|
-
return this.#newResponse(JSON.stringify(object5),
|
|
135602
|
+
json = (object5, arg11, headers) => {
|
|
135603
|
+
return this.#newResponse(JSON.stringify(object5), arg11, setDefaultContentType("application/json", headers));
|
|
135559
135604
|
};
|
|
135560
|
-
html = (html,
|
|
135561
|
-
const res = (html2) => this.#newResponse(html2,
|
|
135605
|
+
html = (html, arg11, headers) => {
|
|
135606
|
+
const res = (html2) => this.#newResponse(html2, arg11, setDefaultContentType("text/html; charset=UTF-8", headers));
|
|
135562
135607
|
return typeof html === "object" ? resolveCallback(html, HtmlEscapedCallbackPhase.Stringify, false, {}).then(res) : res(html);
|
|
135563
135608
|
};
|
|
135564
135609
|
/**
|
|
@@ -142445,10 +142490,10 @@ var require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
142445
142490
|
return new _Code(expr);
|
|
142446
142491
|
}
|
|
142447
142492
|
exports.str = str;
|
|
142448
|
-
function addCodeArg(code,
|
|
142449
|
-
if (
|
|
142450
|
-
else if (
|
|
142451
|
-
else code.push(interpolate(
|
|
142493
|
+
function addCodeArg(code, arg11) {
|
|
142494
|
+
if (arg11 instanceof _Code) code.push(...arg11._items);
|
|
142495
|
+
else if (arg11 instanceof Name) code.push(arg11);
|
|
142496
|
+
else code.push(interpolate(arg11));
|
|
142452
142497
|
}
|
|
142453
142498
|
exports.addCodeArg = addCodeArg;
|
|
142454
142499
|
function optimize(expr) {
|
|
@@ -156782,10 +156827,10 @@ var require_code$12 = /* @__PURE__ */ __commonJSMin2(((exports) => {
|
|
|
156782
156827
|
return new _Code(expr);
|
|
156783
156828
|
}
|
|
156784
156829
|
exports.str = str;
|
|
156785
|
-
function addCodeArg(code,
|
|
156786
|
-
if (
|
|
156787
|
-
else if (
|
|
156788
|
-
else code.push(interpolate(
|
|
156830
|
+
function addCodeArg(code, arg11) {
|
|
156831
|
+
if (arg11 instanceof _Code) code.push(...arg11._items);
|
|
156832
|
+
else if (arg11 instanceof Name) code.push(arg11);
|
|
156833
|
+
else code.push(interpolate(arg11));
|
|
156789
156834
|
}
|
|
156790
156835
|
exports.addCodeArg = addCodeArg;
|
|
156791
156836
|
function optimize(expr) {
|
|
@@ -164983,13 +165028,13 @@ var Doc2 = class {
|
|
|
164983
165028
|
fn2(this);
|
|
164984
165029
|
this.indent -= 1;
|
|
164985
165030
|
}
|
|
164986
|
-
write(
|
|
164987
|
-
if (typeof
|
|
164988
|
-
|
|
164989
|
-
|
|
165031
|
+
write(arg11) {
|
|
165032
|
+
if (typeof arg11 === "function") {
|
|
165033
|
+
arg11(this, { execution: "sync" });
|
|
165034
|
+
arg11(this, { execution: "async" });
|
|
164990
165035
|
return;
|
|
164991
165036
|
}
|
|
164992
|
-
const lines =
|
|
165037
|
+
const lines = arg11.split("\n").filter((x) => x);
|
|
164993
165038
|
const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
|
|
164994
165039
|
const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
|
|
164995
165040
|
for (const line of dedented) this.content.push(line);
|
|
@@ -167798,11 +167843,11 @@ var ZodType3 = /* @__PURE__ */ $constructor2("ZodType", (inst, def) => {
|
|
|
167798
167843
|
array() {
|
|
167799
167844
|
return array2(this);
|
|
167800
167845
|
},
|
|
167801
|
-
or(
|
|
167802
|
-
return union2([this,
|
|
167846
|
+
or(arg11) {
|
|
167847
|
+
return union2([this, arg11]);
|
|
167803
167848
|
},
|
|
167804
|
-
and(
|
|
167805
|
-
return intersection2(this,
|
|
167849
|
+
and(arg11) {
|
|
167850
|
+
return intersection2(this, arg11);
|
|
167806
167851
|
},
|
|
167807
167852
|
transform(tx) {
|
|
167808
167853
|
return pipe2(this, transform2(tx));
|
|
@@ -171487,14 +171532,14 @@ var require_http_errors = /* @__PURE__ */ __commonJSMin3(((exports, module) => {
|
|
|
171487
171532
|
var status$1 = 500;
|
|
171488
171533
|
var props = {};
|
|
171489
171534
|
for (var i$3 = 0; i$3 < arguments.length; i$3++) {
|
|
171490
|
-
var
|
|
171491
|
-
var type2 = typeof
|
|
171492
|
-
if (type2 === "object" &&
|
|
171493
|
-
err =
|
|
171535
|
+
var arg11 = arguments[i$3];
|
|
171536
|
+
var type2 = typeof arg11;
|
|
171537
|
+
if (type2 === "object" && arg11 instanceof Error) {
|
|
171538
|
+
err = arg11;
|
|
171494
171539
|
status$1 = err.status || err.statusCode || status$1;
|
|
171495
|
-
} else if (type2 === "number" && i$3 === 0) status$1 =
|
|
171496
|
-
else if (type2 === "string") msg =
|
|
171497
|
-
else if (type2 === "object") props =
|
|
171540
|
+
} else if (type2 === "number" && i$3 === 0) status$1 = arg11;
|
|
171541
|
+
else if (type2 === "string") msg = arg11;
|
|
171542
|
+
else if (type2 === "object") props = arg11;
|
|
171498
171543
|
else throw new TypeError("argument #" + (i$3 + 1) + " unsupported type " + type2);
|
|
171499
171544
|
}
|
|
171500
171545
|
if (typeof status$1 === "number" && (status$1 < 400 || status$1 >= 600)) deprecate("non-error status code; use only 4xx or 5xx status codes");
|
|
@@ -182062,11 +182107,11 @@ ${error63 instanceof Error ? error63.stack : JSON.stringify(error63)}`
|
|
|
182062
182107
|
);
|
|
182063
182108
|
}
|
|
182064
182109
|
const args2 = request2.params.arguments;
|
|
182065
|
-
for (const
|
|
182066
|
-
if (
|
|
182110
|
+
for (const arg11 of prompt.arguments ?? []) {
|
|
182111
|
+
if (arg11.required && !(args2 && arg11.name in args2)) {
|
|
182067
182112
|
throw new McpError(
|
|
182068
182113
|
ErrorCode.InvalidRequest,
|
|
182069
|
-
`Prompt '${request2.params.name}' requires argument '${
|
|
182114
|
+
`Prompt '${request2.params.name}' requires argument '${arg11.name}': ${arg11.description || "No description provided"}`
|
|
182070
182115
|
);
|
|
182071
182116
|
}
|
|
182072
182117
|
}
|
|
@@ -183292,7 +183337,7 @@ var FastMCP = class extends FastMCPEventEmitter {
|
|
|
183292
183337
|
#parseRuntimeConfig(overrides) {
|
|
183293
183338
|
const args2 = process.argv.slice(2);
|
|
183294
183339
|
const getArg = (name) => {
|
|
183295
|
-
const index = args2.findIndex((
|
|
183340
|
+
const index = args2.findIndex((arg11) => arg11 === `--${name}`);
|
|
183296
183341
|
return index !== -1 && index + 1 < args2.length ? args2[index + 1] : void 0;
|
|
183297
183342
|
};
|
|
183298
183343
|
const transportArg = getArg("transport");
|
|
@@ -184570,11 +184615,11 @@ var GenericRoot = class extends Callable {
|
|
|
184570
184615
|
constructor(paramDefs, bodyDef, $2, arg$, hkt) {
|
|
184571
184616
|
super((...args2) => {
|
|
184572
184617
|
const argNodes = flatMorph(this.names, (i2, name) => {
|
|
184573
|
-
const
|
|
184574
|
-
if (!
|
|
184575
|
-
throwParseError(writeUnsatisfiedParameterConstraintMessage(name, this.constraints[i2].expression,
|
|
184618
|
+
const arg11 = this.arg$.parse(args2[i2]);
|
|
184619
|
+
if (!arg11.extends(this.constraints[i2])) {
|
|
184620
|
+
throwParseError(writeUnsatisfiedParameterConstraintMessage(name, this.constraints[i2].expression, arg11.expression));
|
|
184576
184621
|
}
|
|
184577
|
-
return [name,
|
|
184622
|
+
return [name, arg11];
|
|
184578
184623
|
});
|
|
184579
184624
|
if (this.defIsLazy()) {
|
|
184580
184625
|
const def = this.bodyDef(argNodes);
|
|
@@ -184622,7 +184667,7 @@ var GenericRoot = class extends Callable {
|
|
|
184622
184667
|
return this.baseInstantiation.internal.references;
|
|
184623
184668
|
}
|
|
184624
184669
|
};
|
|
184625
|
-
var writeUnsatisfiedParameterConstraintMessage = (name, constraint,
|
|
184670
|
+
var writeUnsatisfiedParameterConstraintMessage = (name, constraint, arg11) => `${name} must be assignable to ${constraint} (was ${arg11})`;
|
|
184626
184671
|
|
|
184627
184672
|
// node_modules/.pnpm/@ark+schema@0.56.0/node_modules/@ark/schema/out/predicate.js
|
|
184628
184673
|
var implementation = implementNode({
|
|
@@ -189120,7 +189165,7 @@ var _parseGenericArgs = (name, g, s, argNodes) => {
|
|
|
189120
189165
|
argNodes.push(argState.root);
|
|
189121
189166
|
if (argState.finalizer === ">") {
|
|
189122
189167
|
if (argNodes.length !== g.params.length) {
|
|
189123
|
-
return s.error(writeInvalidGenericArgCountMessage(name, g.names, argNodes.map((
|
|
189168
|
+
return s.error(writeInvalidGenericArgCountMessage(name, g.names, argNodes.map((arg11) => arg11.expression)));
|
|
189124
189169
|
}
|
|
189125
189170
|
return argNodes;
|
|
189126
189171
|
}
|
|
@@ -189149,10 +189194,10 @@ var parseGenericInstantiation = (name, g, s) => {
|
|
|
189149
189194
|
var unenclosedToNode = (s, token) => maybeParseReference(s, token) ?? maybeParseUnenclosedLiteral(s, token) ?? s.error(token === "" ? s.scanner.lookahead === "#" ? writePrefixedPrivateReferenceMessage(s.shiftedBy(1).scanner.shiftUntilLookahead(terminatingChars)) : writeMissingOperandMessage(s) : writeUnresolvableMessage(token));
|
|
189150
189195
|
var maybeParseReference = (s, token) => {
|
|
189151
189196
|
if (s.ctx.args?.[token]) {
|
|
189152
|
-
const
|
|
189153
|
-
if (typeof
|
|
189154
|
-
return
|
|
189155
|
-
return s.ctx.$.node("alias", { reference:
|
|
189197
|
+
const arg11 = s.ctx.args[token];
|
|
189198
|
+
if (typeof arg11 !== "string")
|
|
189199
|
+
return arg11;
|
|
189200
|
+
return s.ctx.$.node("alias", { reference: arg11 }, { prereduced: true });
|
|
189156
189201
|
}
|
|
189157
189202
|
const resolution = s.ctx.$.maybeResolve(token);
|
|
189158
189203
|
if (hasArkKind(resolution, "root"))
|
|
@@ -199349,13 +199394,13 @@ function GitTool(ctx) {
|
|
|
199349
199394
|
if (blocked) {
|
|
199350
199395
|
throw new Error(blocked);
|
|
199351
199396
|
}
|
|
199352
|
-
for (const
|
|
199397
|
+
for (const arg11 of args2) {
|
|
199353
199398
|
const isBlocked = NOSHELL_BLOCKED_ARGS.some(
|
|
199354
|
-
(flag) =>
|
|
199399
|
+
(flag) => arg11 === flag || arg11.startsWith(flag + "=")
|
|
199355
199400
|
);
|
|
199356
199401
|
if (isBlocked) {
|
|
199357
199402
|
throw new Error(
|
|
199358
|
-
`Blocked: '${
|
|
199403
|
+
`Blocked: '${arg11}' flag can execute arbitrary code and is not allowed.`
|
|
199359
199404
|
);
|
|
199360
199405
|
}
|
|
199361
199406
|
}
|
|
@@ -199902,13 +199947,16 @@ function buildImplementPlanLink(ctx, issueNumber, commentId) {
|
|
|
199902
199947
|
const apiUrl = getApiUrl();
|
|
199903
199948
|
return `[Implement plan \u2794](${apiUrl}/trigger/${ctx.repo.owner}/${ctx.repo.name}/${issueNumber}?action=implement&comment_id=${commentId})`;
|
|
199904
199949
|
}
|
|
199905
|
-
function
|
|
199950
|
+
function runIssueNumber(ctx) {
|
|
199951
|
+
return ctx.payload.event.issue_number ?? primaryRepoState(ctx.toolState).issueNumber;
|
|
199952
|
+
}
|
|
199953
|
+
function buildEnrichmentLinks(ctx, issueNumber) {
|
|
199906
199954
|
const event = ctx.payload.event;
|
|
199907
|
-
|
|
199908
|
-
|
|
199909
|
-
|
|
199955
|
+
const mode = ctx.toolState.selectedMode;
|
|
199956
|
+
const enriching = mode === "Enrich" || event.trigger === "issues_opened" && !ctx.payload.prompt && mode !== "Build";
|
|
199957
|
+
if (issueNumber === void 0 || event.is_pr || !enriching) return [];
|
|
199910
199958
|
return [
|
|
199911
|
-
`[Implement a fix \u2794](${getApiUrl()}/trigger/${ctx.repo.owner}/${ctx.repo.name}/${
|
|
199959
|
+
`[Implement a fix \u2794](${getApiUrl()}/trigger/${ctx.repo.owner}/${ctx.repo.name}/${issueNumber}?action=build)`
|
|
199912
199960
|
];
|
|
199913
199961
|
}
|
|
199914
199962
|
function addFooter(ctx, body) {
|
|
@@ -199944,10 +199992,11 @@ function CreateCommentTool(ctx) {
|
|
|
199944
199992
|
});
|
|
199945
199993
|
ctx.toolState.wasUpdated = true;
|
|
199946
199994
|
log2.info(`\xBB created comment ${result.data.id}`);
|
|
199947
|
-
|
|
199995
|
+
const ownTarget = issueNumber === runIssueNumber(ctx);
|
|
199996
|
+
if (ownTarget) {
|
|
199948
199997
|
ctx.toolState.standaloneCommentId = result.data.id;
|
|
199949
199998
|
}
|
|
199950
|
-
const enrichmentLinks =
|
|
199999
|
+
const enrichmentLinks = ownTarget ? buildEnrichmentLinks(ctx, issueNumber) : [];
|
|
199951
200000
|
if (commentType === "Plan" || enrichmentLinks.length > 0) {
|
|
199952
200001
|
if (commentType === "Plan" && result.data.node_id) {
|
|
199953
200002
|
await patchWorkflowRunFields(ctx, { planCommentNodeId: result.data.node_id });
|
|
@@ -200027,9 +200076,9 @@ async function reportProgress(ctx, params) {
|
|
|
200027
200076
|
if (params.liveProgress && !ctx.payload.progressComments) {
|
|
200028
200077
|
return { body, action: "skipped" };
|
|
200029
200078
|
}
|
|
200030
|
-
const issueNumber =
|
|
200079
|
+
const issueNumber = runIssueNumber(ctx);
|
|
200031
200080
|
const isPlanMode = ctx.toolState.selectedMode === "Plan";
|
|
200032
|
-
const enrichmentLinks = params.liveProgress ? [] : buildEnrichmentLinks(ctx);
|
|
200081
|
+
const enrichmentLinks = params.liveProgress ? [] : buildEnrichmentLinks(ctx, issueNumber);
|
|
200033
200082
|
const apiCtx = { octokit: ctx.octokit, owner: ctx.repo.owner, repo: ctx.repo.name };
|
|
200034
200083
|
if (target_plan_comment === true && ctx.toolState.existingPlanCommentId === void 0) {
|
|
200035
200084
|
log2.warning("target_plan_comment requested but no existingPlanCommentId in tool state");
|
|
@@ -202767,8 +202816,8 @@ var GhParams = type({
|
|
|
202767
202816
|
'gh arguments as an argv array, e.g. ["pr", "list", "--json", "number,title"] or ["api", "graphql", "-f", "query=..."]'
|
|
202768
202817
|
)
|
|
202769
202818
|
});
|
|
202770
|
-
function shellQuote(
|
|
202771
|
-
return `'${
|
|
202819
|
+
function shellQuote(arg11) {
|
|
202820
|
+
return `'${arg11.replace(/'/g, "'\\''")}'`;
|
|
202772
202821
|
}
|
|
202773
202822
|
function GhTool(ctx) {
|
|
202774
202823
|
const permissions = mirrorRolePermissions(ctx.payload.event.authorPermission);
|
|
@@ -203040,7 +203089,7 @@ function GetIssueCommentsTool(ctx) {
|
|
|
203040
203089
|
description: "Get all comments for a GitHub issue. Returns all comments including the issue body and all subsequent discussion comments. Example: `get_issue_comments({ issue_number: 1234 })`.",
|
|
203041
203090
|
parameters: GetIssueComments,
|
|
203042
203091
|
execute: execute(async ({ issue_number }) => {
|
|
203043
|
-
primaryRepoState(ctx.toolState).issueNumber
|
|
203092
|
+
primaryRepoState(ctx.toolState).issueNumber ??= issue_number;
|
|
203044
203093
|
const comments = await ctx.octokit.paginate(ctx.octokit.rest.issues.listComments, {
|
|
203045
203094
|
owner: ctx.repo.owner,
|
|
203046
203095
|
repo: ctx.repo.name,
|
|
@@ -203078,7 +203127,7 @@ function GetIssueEventsTool(ctx) {
|
|
|
203078
203127
|
description: "Get timeline events for a GitHub issue that aren't reflected in the current state. Returns cross-references to other issues/PRs and commit references. Note: current labels, assignees, state, and milestone are already available via get_issue.",
|
|
203079
203128
|
parameters: GetIssueEvents,
|
|
203080
203129
|
execute: execute(async ({ issue_number }) => {
|
|
203081
|
-
primaryRepoState(ctx.toolState).issueNumber
|
|
203130
|
+
primaryRepoState(ctx.toolState).issueNumber ??= issue_number;
|
|
203082
203131
|
const events = await ctx.octokit.paginate(ctx.octokit.rest.issues.listEventsForTimeline, {
|
|
203083
203132
|
owner: ctx.repo.owner,
|
|
203084
203133
|
repo: ctx.repo.name,
|
|
@@ -203162,7 +203211,7 @@ function IssueInfoTool(ctx) {
|
|
|
203162
203211
|
tmpdir: ctx.tmpdir,
|
|
203163
203212
|
githubToken: ctx.githubInstallationToken
|
|
203164
203213
|
});
|
|
203165
|
-
primaryRepoState(ctx.toolState).issueNumber
|
|
203214
|
+
primaryRepoState(ctx.toolState).issueNumber ??= issue_number;
|
|
203166
203215
|
const hints = [];
|
|
203167
203216
|
if (data.comments > 0) {
|
|
203168
203217
|
hints.push("use get_issue_comments to retrieve all comments for this issue");
|
|
@@ -204630,8 +204679,11 @@ function SimilarIssuesTool(ctx) {
|
|
|
204630
204679
|
mutates: true,
|
|
204631
204680
|
parameters: SimilarIssues,
|
|
204632
204681
|
execute: execute(async (input2) => {
|
|
204633
|
-
|
|
204634
|
-
|
|
204682
|
+
const repoState = primaryRepoState(ctx.toolState);
|
|
204683
|
+
repoState.issueNumber ??= input2.issue_number;
|
|
204684
|
+
const subject = ctx.payload.event.issue_number ?? repoState.issueNumber;
|
|
204685
|
+
if (ctx.payload.event.is_pr || subject !== input2.issue_number) {
|
|
204686
|
+
throw new Error(`find_similar_issues is limited to this run's issue, #${subject}`);
|
|
204635
204687
|
}
|
|
204636
204688
|
const response = await apiFetch({
|
|
204637
204689
|
path: `/api/repo/${ctx.repo.owner}/${ctx.repo.name}/issues/${input2.issue_number}/similar`,
|
|
@@ -204913,7 +204965,7 @@ function buildCommonTools(ctx, outputSchema) {
|
|
|
204913
204965
|
if (hasSimilarIssues({ repoIntelligence: ctx.repoIntelligence, event: ctx.payload.event })) {
|
|
204914
204966
|
tools.push(SimilarIssuesTool(ctx));
|
|
204915
204967
|
}
|
|
204916
|
-
if (
|
|
204968
|
+
if (!ctx.payload.event.is_pr) {
|
|
204917
204969
|
tools.push(SearchIssuesTool(ctx));
|
|
204918
204970
|
}
|
|
204919
204971
|
const isStandalone = ctx.payload.event.trigger === "unknown";
|
|
@@ -205311,11 +205363,11 @@ function buildOpenAICompatibleSetupError(params) {
|
|
|
205311
205363
|
missing: params.missing,
|
|
205312
205364
|
where: `Set them on the OpenAI-compatible provider in [Pullfrog's provider settings](${getApiUrl()}/console/${params.owner}#billing), or in the workflow's \`env:\` block with the key as an [Actions secret](${secretsUrl(params)}):`,
|
|
205313
205365
|
env: [
|
|
205314
|
-
`${
|
|
205315
|
-
`${
|
|
205316
|
-
`${
|
|
205317
|
-
`${
|
|
205318
|
-
`${
|
|
205366
|
+
`${params.env.baseUrl}: https://your-endpoint.example.com/v1`,
|
|
205367
|
+
`${params.env.apiKey}: \${{ secrets.${params.env.apiKey} }}`,
|
|
205368
|
+
`${params.env.model}: <model-id>`,
|
|
205369
|
+
`${params.env.context}: "128000"`,
|
|
205370
|
+
`${params.env.maxOutput}: "16384"`
|
|
205319
205371
|
],
|
|
205320
205372
|
note: "Use the real context and output limits of the model your endpoint serves: Pullfrog can't discover them, and without them long runs grow until the endpoint refuses them.",
|
|
205321
205373
|
guide: "https://docs.pullfrog.com/openai-compatible"
|
|
@@ -205349,17 +205401,16 @@ function hasPositiveNumberEnvVar(name) {
|
|
|
205349
205401
|
return Number(process.env[name]) > 0;
|
|
205350
205402
|
}
|
|
205351
205403
|
function validateOpenAICompatibleSetup(params) {
|
|
205404
|
+
const env2 = openAICompatibleEnv(params.set);
|
|
205352
205405
|
const missing = [];
|
|
205353
|
-
if (!hasEnvVar2(
|
|
205354
|
-
if (!hasEnvVar2(
|
|
205355
|
-
if (!hasEnvVar2(
|
|
205356
|
-
if (!hasPositiveNumberEnvVar(
|
|
205357
|
-
|
|
205358
|
-
if (!hasPositiveNumberEnvVar(OPENAI_COMPATIBLE_MAX_OUTPUT_ENV))
|
|
205359
|
-
missing.push(OPENAI_COMPATIBLE_MAX_OUTPUT_ENV);
|
|
205406
|
+
if (!hasEnvVar2(env2.baseUrl)) missing.push(env2.baseUrl);
|
|
205407
|
+
if (!hasEnvVar2(env2.apiKey)) missing.push(env2.apiKey);
|
|
205408
|
+
if (!hasEnvVar2(env2.model)) missing.push(env2.model);
|
|
205409
|
+
if (!hasPositiveNumberEnvVar(env2.context)) missing.push(env2.context);
|
|
205410
|
+
if (!hasPositiveNumberEnvVar(env2.maxOutput)) missing.push(env2.maxOutput);
|
|
205360
205411
|
if (missing.length > 0) {
|
|
205361
205412
|
throw new Error(
|
|
205362
|
-
buildOpenAICompatibleSetupError({ owner: params.owner, name: params.name, missing })
|
|
205413
|
+
buildOpenAICompatibleSetupError({ owner: params.owner, name: params.name, missing, env: env2 })
|
|
205363
205414
|
);
|
|
205364
205415
|
}
|
|
205365
205416
|
}
|
|
@@ -205415,7 +205466,11 @@ function validateAgentApiKey(params) {
|
|
|
205415
205466
|
return;
|
|
205416
205467
|
}
|
|
205417
205468
|
if (params.model.startsWith(`${OPENAI_COMPATIBLE_PROVIDER}/`)) {
|
|
205418
|
-
validateOpenAICompatibleSetup({
|
|
205469
|
+
validateOpenAICompatibleSetup({
|
|
205470
|
+
owner: params.owner,
|
|
205471
|
+
name: params.name,
|
|
205472
|
+
set: params.openAICompatibleSet
|
|
205473
|
+
});
|
|
205419
205474
|
return;
|
|
205420
205475
|
}
|
|
205421
205476
|
if (params.model.startsWith(`${AZURE_PROVIDER}/`)) {
|
|
@@ -205729,17 +205784,37 @@ function resolveSlug(slug2) {
|
|
|
205729
205784
|
}
|
|
205730
205785
|
return `${AZURE_PROVIDER}/${deployment}`;
|
|
205731
205786
|
}
|
|
205732
|
-
|
|
205733
|
-
|
|
205787
|
+
const set2 = heldOpenAICompatibleSet(slug2);
|
|
205788
|
+
if (alias?.routing === "openai-compatible" || set2) {
|
|
205789
|
+
const modelEnv = openAICompatibleEnv(set2).model;
|
|
205790
|
+
const modelId = process.env[modelEnv]?.trim();
|
|
205734
205791
|
if (!modelId) {
|
|
205735
205792
|
throw new Error(
|
|
205736
|
-
`\`${
|
|
205793
|
+
`\`${modelEnv}\` ${BYOK_SLUG_MARKER} \`${slug2}\`. Set it to the model ID your endpoint serves, on the OpenAI-compatible provider in Pullfrog or in the workflow's \`env:\` block. [OpenAI-compatible setup guide](https://docs.pullfrog.com/openai-compatible)`
|
|
205737
205794
|
);
|
|
205738
205795
|
}
|
|
205739
205796
|
return `${OPENAI_COMPATIBLE_PROVIDER}/${modelId}`;
|
|
205740
205797
|
}
|
|
205741
205798
|
return resolveCliModel(slug2);
|
|
205742
205799
|
}
|
|
205800
|
+
function heldOpenAICompatibleSet(slug2) {
|
|
205801
|
+
const set2 = openAICompatibleSetName(slug2);
|
|
205802
|
+
return set2 && Object.values(openAICompatibleEnv(set2)).some(hasEnvVar3) ? set2 : void 0;
|
|
205803
|
+
}
|
|
205804
|
+
function activateOpenAICompatibleSet(ctx) {
|
|
205805
|
+
const slug2 = process.env.PULLFROG_MODEL?.trim() || ctx.slug?.trim();
|
|
205806
|
+
const set2 = slug2 ? heldOpenAICompatibleSet(slug2) : void 0;
|
|
205807
|
+
if (!set2) return void 0;
|
|
205808
|
+
const from = openAICompatibleEnv(set2);
|
|
205809
|
+
const to = openAICompatibleEnv();
|
|
205810
|
+
for (const field of OPENAI_COMPATIBLE_FIELDS) {
|
|
205811
|
+
const value2 = process.env[from[field]];
|
|
205812
|
+
if (value2 === void 0) delete process.env[to[field]];
|
|
205813
|
+
else process.env[to[field]] = value2;
|
|
205814
|
+
}
|
|
205815
|
+
log2.info(`\xBB using the OpenAI-compatible endpoint "${set2}"`);
|
|
205816
|
+
return set2;
|
|
205817
|
+
}
|
|
205743
205818
|
function resolveModel(ctx) {
|
|
205744
205819
|
const envModel = process.env.PULLFROG_MODEL?.trim();
|
|
205745
205820
|
if (envModel) {
|
|
@@ -206739,7 +206814,7 @@ Rules:
|
|
|
206739
206814
|
### GitHub
|
|
206740
206815
|
|
|
206741
206816
|
Use MCP tools from ${pullfrogMcpName} for all GitHub operations. Never use the \`gh\` CLI \u2014 it is not authenticated and will fail. The MCP tools handle authentication and enforce permissions.
|
|
206742
|
-
${hasSimilarIssues({ repoIntelligence: ctx.repoIntelligence, event: ctx.payload.event }) ? `
|
|
206817
|
+
${ctx.payload.event.issue_number !== void 0 && hasSimilarIssues({ repoIntelligence: ctx.repoIntelligence, event: ctx.payload.event }) ? `
|
|
206743
206818
|
#### Duplicate detection (enabled for this repository)
|
|
206744
206819
|
|
|
206745
206820
|
Call \`${t2("find_similar_issues")}\` for #${ctx.payload.event.issue_number} before planning. If it duplicates an existing issue, link that instead of producing a plan; never close or label on similarity alone.
|
|
@@ -208618,6 +208693,9 @@ function resolveModelForLog(ctx) {
|
|
|
208618
208693
|
function resolveEffortForLog(ctx) {
|
|
208619
208694
|
const effort = resolveRunEffort(ctx);
|
|
208620
208695
|
if (!ctx.resolvedModel && !ctx.payload.proxyModel) return "pending \u2014 model not chosen yet";
|
|
208696
|
+
if (effort.declarable && ctx.agentName === "opencode") {
|
|
208697
|
+
return "pending \u2014 reading the variants opencode declares";
|
|
208698
|
+
}
|
|
208621
208699
|
if (!effort.alias) return "not applied \u2014 model not recognized";
|
|
208622
208700
|
if (!effort.rung) return "n/a (model has no effort control)";
|
|
208623
208701
|
return effort.configured ? effort.rung : `${effort.rung} (default)`;
|
|
@@ -208636,9 +208714,7 @@ function logRunStartup(ctx) {
|
|
|
208636
208714
|
log2.info(
|
|
208637
208715
|
`\xBB model: ${resolveModelForLog({ payload: ctx.payload, resolvedModel: ctx.resolvedModel })}`
|
|
208638
208716
|
);
|
|
208639
|
-
log2.info(
|
|
208640
|
-
`\xBB effort: ${resolveEffortForLog({ payload: ctx.payload, resolvedModel: ctx.resolvedModel })}`
|
|
208641
|
-
);
|
|
208717
|
+
log2.info(`\xBB effort: ${resolveEffortForLog(ctx)}`);
|
|
208642
208718
|
const routing = ctx.payload.routing;
|
|
208643
208719
|
if (routing) {
|
|
208644
208720
|
log2.info(
|
|
@@ -208909,6 +208985,7 @@ async function main() {
|
|
|
208909
208985
|
const count = Object.keys(runContext.dbSecrets).length;
|
|
208910
208986
|
if (count > 0) log2.info(`\xBB ${count} db secret(s) loaded`);
|
|
208911
208987
|
}
|
|
208988
|
+
const openAICompatibleSet = activateOpenAICompatibleSet({ slug: payload.model });
|
|
208912
208989
|
await initializeCredentialPool({ ctx: runContext, slug: payload.model, injected });
|
|
208913
208990
|
installCodexAuth();
|
|
208914
208991
|
installXaiAuth();
|
|
@@ -209057,7 +209134,8 @@ async function main() {
|
|
|
209057
209134
|
owner: runContext.repo.owner,
|
|
209058
209135
|
name: runContext.repo.name,
|
|
209059
209136
|
secretsUnavailable: runContext.secretsUnavailable,
|
|
209060
|
-
routerUnfunded: runContext.routerUnfunded
|
|
209137
|
+
routerUnfunded: runContext.routerUnfunded,
|
|
209138
|
+
openAICompatibleSet
|
|
209061
209139
|
});
|
|
209062
209140
|
} catch (missingKey) {
|
|
209063
209141
|
const funded = runContext.trialFallback && missingKey instanceof NoUsableCredentialError ? await resolveTrialFallback({
|
|
@@ -209988,7 +210066,7 @@ function resolveTarget2(repo) {
|
|
|
209988
210066
|
return { owner: match3[1], repo: match3[2] };
|
|
209989
210067
|
}
|
|
209990
210068
|
function cliVersion() {
|
|
209991
|
-
const parts = /^(\d+)\.(\d+)\.(\d+)$/.exec("0.1.
|
|
210069
|
+
const parts = /^(\d+)\.(\d+)\.(\d+)$/.exec("0.1.105");
|
|
209992
210070
|
if (!parts) return "0.0.0";
|
|
209993
210071
|
return `${Number(parts[1])}.${Number(parts[2])}.${Number(parts[3])}`;
|
|
209994
210072
|
}
|
|
@@ -210044,11 +210122,41 @@ async function runCli7(input2) {
|
|
|
210044
210122
|
});
|
|
210045
210123
|
}
|
|
210046
210124
|
|
|
210047
|
-
// commands/
|
|
210125
|
+
// commands/run.ts
|
|
210048
210126
|
var import_arg8 = __toESM(require_arg(), 1);
|
|
210127
|
+
async function runCli8(input2) {
|
|
210128
|
+
const args2 = (0, import_arg8.default)(
|
|
210129
|
+
{ "--repo": String, "-R": "--repo", "--help": Boolean, "-h": "--help" },
|
|
210130
|
+
{ argv: input2.args }
|
|
210131
|
+
);
|
|
210132
|
+
if (input2.showHelp || args2["--help"] || !args2._.length) {
|
|
210133
|
+
console.log(`usage: ${input2.prog} run PROMPT
|
|
210134
|
+
|
|
210135
|
+
start a Pullfrog run, like the console's prompt box, and print its URL.
|
|
210136
|
+
name the issue or pull request in the prompt:
|
|
210137
|
+
|
|
210138
|
+
${input2.prog} run "enrich issue #42"
|
|
210139
|
+
gh issue list --json number --jq '.[].number' | xargs -I{} ${input2.prog} run "enrich issue #{}"
|
|
210140
|
+
|
|
210141
|
+
--repo, -R OWNER/REPO select a repository (default: GitHub origin)`);
|
|
210142
|
+
return;
|
|
210143
|
+
}
|
|
210144
|
+
if (args2._.length > 1) throw new Error("quote the prompt as one argument");
|
|
210145
|
+
const target = resolveTarget({ org: void 0, repo: args2["--repo"] });
|
|
210146
|
+
const data = await configurationApi({
|
|
210147
|
+
target,
|
|
210148
|
+
path: "run",
|
|
210149
|
+
method: "POST",
|
|
210150
|
+
body: { prompt: args2._[0] }
|
|
210151
|
+
});
|
|
210152
|
+
console.log(external_exports.object({ url: external_exports.string() }).parse(data).url);
|
|
210153
|
+
}
|
|
210154
|
+
|
|
210155
|
+
// commands/watch.ts
|
|
210156
|
+
var import_arg9 = __toESM(require_arg(), 1);
|
|
210049
210157
|
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
210050
210158
|
function parseWatchArgs(args2) {
|
|
210051
|
-
return (0,
|
|
210159
|
+
return (0, import_arg9.default)(
|
|
210052
210160
|
{
|
|
210053
210161
|
"--pr": Number,
|
|
210054
210162
|
"--pretty": Boolean,
|
|
@@ -210095,7 +210203,7 @@ function emit(events, pretty) {
|
|
|
210095
210203
|
`);
|
|
210096
210204
|
}
|
|
210097
210205
|
}
|
|
210098
|
-
async function
|
|
210206
|
+
async function runCli9(input2) {
|
|
210099
210207
|
let parsed2;
|
|
210100
210208
|
try {
|
|
210101
210209
|
parsed2 = parseWatchArgs(input2.args);
|
|
@@ -210155,7 +210263,7 @@ async function runCli8(input2) {
|
|
|
210155
210263
|
}
|
|
210156
210264
|
|
|
210157
210265
|
// cli.ts
|
|
210158
|
-
var VERSION10 = "0.1.
|
|
210266
|
+
var VERSION10 = "0.1.105";
|
|
210159
210267
|
var bin = basename2(process.argv[1] || "");
|
|
210160
210268
|
var PROG = bin === "pf" || bin === "pullfrog" ? bin : "pullfrog";
|
|
210161
210269
|
var rawArgs = process.argv.slice(2);
|
|
@@ -210167,6 +210275,7 @@ function printMainUsage(stream) {
|
|
|
210167
210275
|
stream(" console open the repository or organization console");
|
|
210168
210276
|
stream(" secret list secret names, save or delete scoped credentials");
|
|
210169
210277
|
stream(" init install pullfrog on the current repository and open its dashboard");
|
|
210278
|
+
stream(" run start a run from a prompt, like the console's prompt box");
|
|
210170
210279
|
stream(" auth manage provider credentials for the current repository");
|
|
210171
210280
|
stream(" watch stream a PR's activity as one JSON line per event");
|
|
210172
210281
|
stream(" mcp run a stdio MCP server exposing PR activity as an agent tool");
|
|
@@ -210176,7 +210285,7 @@ function printMainUsage(stream) {
|
|
|
210176
210285
|
stream(" -v, --version show version");
|
|
210177
210286
|
}
|
|
210178
210287
|
function parseGlobalArgs(args2) {
|
|
210179
|
-
return (0,
|
|
210288
|
+
return (0, import_arg10.default)(
|
|
210180
210289
|
{
|
|
210181
210290
|
"--help": Boolean,
|
|
210182
210291
|
"--version": Boolean,
|
|
@@ -210227,6 +210336,10 @@ async function run3() {
|
|
|
210227
210336
|
});
|
|
210228
210337
|
return;
|
|
210229
210338
|
}
|
|
210339
|
+
if (command === "run") {
|
|
210340
|
+
await runCli8({ args: commandArgs, prog: PROG, showHelp: globalParsed["--help"] === true });
|
|
210341
|
+
return;
|
|
210342
|
+
}
|
|
210230
210343
|
if (command === "config" || command === "console" || command === "secret") {
|
|
210231
210344
|
const runCommand = command === "config" ? runCli3 : command === "secret" ? runCli : runCli4;
|
|
210232
210345
|
await runCommand({ args: commandArgs, prog: PROG, showHelp: globalParsed["--help"] === true });
|
|
@@ -210257,7 +210370,7 @@ async function run3() {
|
|
|
210257
210370
|
return;
|
|
210258
210371
|
}
|
|
210259
210372
|
if (command === "watch") {
|
|
210260
|
-
await
|
|
210373
|
+
await runCli9({
|
|
210261
210374
|
args: commandArgs,
|
|
210262
210375
|
prog: PROG,
|
|
210263
210376
|
showHelp: globalParsed["--help"] === true
|