pullfrog 0.1.103 → 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 +380 -194
- package/dist/external.d.ts +3 -2
- package/dist/index.js +212 -61
- package/dist/internal/index.d.ts +1 -0
- package/dist/internal.js +52 -3
- package/dist/mcp/review.d.ts +1 -0
- 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/patchWorkflowRunFields.d.ts +4 -2
- package/dist/utils/rangeDiff.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"))
|
|
@@ -193647,14 +193692,18 @@ async function runGitLines(args2) {
|
|
|
193647
193692
|
// utils/rangeDiff.ts
|
|
193648
193693
|
function computeIncrementalDiff(params) {
|
|
193649
193694
|
try {
|
|
193695
|
+
const tips = [`origin/${params.baseBranch}`, ...params.formerBaseTips];
|
|
193696
|
+
const oldBase = versionBase({ sha: params.beforeSha, tips });
|
|
193697
|
+
const newBase = versionBase({ sha: params.headSha, tips });
|
|
193650
193698
|
const raw2 = $(
|
|
193651
193699
|
"sh",
|
|
193652
193700
|
[
|
|
193653
193701
|
"-c",
|
|
193654
|
-
'
|
|
193702
|
+
'git range-diff --no-color --creation-factor=1000 "$1..$(git commit-tree "$2^{tree}" -p "$1" -m x)" "$3..$(git commit-tree "$4^{tree}" -p "$3" -m x)"',
|
|
193655
193703
|
"--",
|
|
193704
|
+
oldBase,
|
|
193656
193705
|
params.beforeSha,
|
|
193657
|
-
|
|
193706
|
+
newBase,
|
|
193658
193707
|
params.headSha
|
|
193659
193708
|
],
|
|
193660
193709
|
{ log: false }
|
|
@@ -193667,6 +193716,27 @@ function computeIncrementalDiff(params) {
|
|
|
193667
193716
|
return { status: "unavailable", reason };
|
|
193668
193717
|
}
|
|
193669
193718
|
}
|
|
193719
|
+
function git(args2) {
|
|
193720
|
+
return $("git", args2, { log: false }).trim();
|
|
193721
|
+
}
|
|
193722
|
+
function versionBase(params) {
|
|
193723
|
+
let best;
|
|
193724
|
+
for (const tip of params.tips) {
|
|
193725
|
+
let sha;
|
|
193726
|
+
try {
|
|
193727
|
+
sha = git(["merge-base", params.sha, tip]);
|
|
193728
|
+
} catch {
|
|
193729
|
+
continue;
|
|
193730
|
+
}
|
|
193731
|
+
const commits = Number(git(["rev-list", "--count", `${sha}..${params.sha}`]));
|
|
193732
|
+
if (!best || commits < best.commits) best = { tip, sha, commits };
|
|
193733
|
+
}
|
|
193734
|
+
if (!best) throw new Error(`no merge base between ${params.sha} and the base branch`);
|
|
193735
|
+
if (best.tip !== params.tips[0]) {
|
|
193736
|
+
log2.info(`\xBB incremental diff: ${params.sha.slice(0, 7)} sits on former base tip ${best.tip}`);
|
|
193737
|
+
}
|
|
193738
|
+
return best.sha;
|
|
193739
|
+
}
|
|
193670
193740
|
function isDiffPrefix(ch) {
|
|
193671
193741
|
return ch === " " || ch === "+" || ch === "-";
|
|
193672
193742
|
}
|
|
@@ -193694,14 +193764,28 @@ function postProcessRangeDiff(raw2, contextLines = 3) {
|
|
|
193694
193764
|
if (lastHunkHdr?.seq === line.seq) hunkHdrEmitted = true;
|
|
193695
193765
|
}
|
|
193696
193766
|
function flushBefore() {
|
|
193697
|
-
|
|
193698
|
-
|
|
193699
|
-
|
|
193700
|
-
|
|
193701
|
-
|
|
193767
|
+
const headers = [
|
|
193768
|
+
outerHdrEmitted ? null : lastOuterHdr,
|
|
193769
|
+
fileHdrEmitted ? null : lastFileHdr,
|
|
193770
|
+
hunkHdrEmitted ? null : lastHunkHdr
|
|
193771
|
+
].filter((line) => line !== null);
|
|
193772
|
+
const pending = [...headers, ...beforeBuf.filter((line) => line.seq > lastEmittedSeq)].sort(
|
|
193773
|
+
(a2, b) => a2.seq - b.seq
|
|
193774
|
+
);
|
|
193775
|
+
for (const [i2, line] of pending.entries()) {
|
|
193776
|
+
if (pending[i2 - 1]?.seq !== line.seq) emit2(line);
|
|
193702
193777
|
}
|
|
193703
193778
|
beforeBuf.length = 0;
|
|
193704
193779
|
}
|
|
193780
|
+
function isFileHeader(pos) {
|
|
193781
|
+
return raw2.startsWith("## ", pos) && !raw2.startsWith("## Commit message", pos);
|
|
193782
|
+
}
|
|
193783
|
+
function markFileHeader(line, emitted) {
|
|
193784
|
+
lastFileHdr = line;
|
|
193785
|
+
fileHdrEmitted = emitted;
|
|
193786
|
+
lastHunkHdr = null;
|
|
193787
|
+
hunkHdrEmitted = true;
|
|
193788
|
+
}
|
|
193705
193789
|
let cursor3 = 0;
|
|
193706
193790
|
while (cursor3 < raw2.length) {
|
|
193707
193791
|
const eol = raw2.indexOf("\n", cursor3);
|
|
@@ -193711,7 +193795,8 @@ function postProcessRangeDiff(raw2, contextLines = 3) {
|
|
|
193711
193795
|
continue;
|
|
193712
193796
|
}
|
|
193713
193797
|
if (raw2.startsWith(" @@", cursor3)) {
|
|
193714
|
-
|
|
193798
|
+
const label = raw2.slice(cursor3 + 4, lineEnd);
|
|
193799
|
+
lastOuterHdr = label === "@@ Metadata" || label === "@@ Commit message" ? null : { prefix: "", from: cursor3 + 4, to: lineEnd, seq };
|
|
193715
193800
|
outerHdrEmitted = false;
|
|
193716
193801
|
lastFileHdr = null;
|
|
193717
193802
|
fileHdrEmitted = true;
|
|
@@ -193732,13 +193817,13 @@ function postProcessRangeDiff(raw2, contextLines = 3) {
|
|
|
193732
193817
|
} else if (isDiffPrefix(raw2[contentPos])) {
|
|
193733
193818
|
isChange = isOuterChange;
|
|
193734
193819
|
line = { prefix, from: contentPos + 1, to: lineEnd, seq };
|
|
193820
|
+
if (raw2[contentPos] === " " && isFileHeader(contentPos + 1)) {
|
|
193821
|
+
markFileHeader(line, isChange);
|
|
193822
|
+
}
|
|
193735
193823
|
} else {
|
|
193736
193824
|
line = { prefix, from: contentPos, to: lineEnd, seq };
|
|
193737
|
-
if (
|
|
193738
|
-
|
|
193739
|
-
fileHdrEmitted = false;
|
|
193740
|
-
lastHunkHdr = null;
|
|
193741
|
-
hunkHdrEmitted = true;
|
|
193825
|
+
if (isFileHeader(contentPos)) {
|
|
193826
|
+
markFileHeader(line, false);
|
|
193742
193827
|
} else if (raw2.startsWith("@@", contentPos) && !raw2.startsWith("@@ Metadata", contentPos)) {
|
|
193743
193828
|
lastHunkHdr = line;
|
|
193744
193829
|
hunkHdrEmitted = false;
|
|
@@ -199309,13 +199394,13 @@ function GitTool(ctx) {
|
|
|
199309
199394
|
if (blocked) {
|
|
199310
199395
|
throw new Error(blocked);
|
|
199311
199396
|
}
|
|
199312
|
-
for (const
|
|
199397
|
+
for (const arg11 of args2) {
|
|
199313
199398
|
const isBlocked = NOSHELL_BLOCKED_ARGS.some(
|
|
199314
|
-
(flag) =>
|
|
199399
|
+
(flag) => arg11 === flag || arg11.startsWith(flag + "=")
|
|
199315
199400
|
);
|
|
199316
199401
|
if (isBlocked) {
|
|
199317
199402
|
throw new Error(
|
|
199318
|
-
`Blocked: '${
|
|
199403
|
+
`Blocked: '${arg11}' flag can execute arbitrary code and is not allowed.`
|
|
199319
199404
|
);
|
|
199320
199405
|
}
|
|
199321
199406
|
}
|
|
@@ -199731,6 +199816,7 @@ var STRING_KEYS = [
|
|
|
199731
199816
|
"prNodeId",
|
|
199732
199817
|
"issueNodeId",
|
|
199733
199818
|
"reviewNodeId",
|
|
199819
|
+
"reviewedCommitSha",
|
|
199734
199820
|
"planCommentNodeId",
|
|
199735
199821
|
"summarySnapshot",
|
|
199736
199822
|
"model",
|
|
@@ -199861,13 +199947,16 @@ function buildImplementPlanLink(ctx, issueNumber, commentId) {
|
|
|
199861
199947
|
const apiUrl = getApiUrl();
|
|
199862
199948
|
return `[Implement plan \u2794](${apiUrl}/trigger/${ctx.repo.owner}/${ctx.repo.name}/${issueNumber}?action=implement&comment_id=${commentId})`;
|
|
199863
199949
|
}
|
|
199864
|
-
function
|
|
199950
|
+
function runIssueNumber(ctx) {
|
|
199951
|
+
return ctx.payload.event.issue_number ?? primaryRepoState(ctx.toolState).issueNumber;
|
|
199952
|
+
}
|
|
199953
|
+
function buildEnrichmentLinks(ctx, issueNumber) {
|
|
199865
199954
|
const event = ctx.payload.event;
|
|
199866
|
-
|
|
199867
|
-
|
|
199868
|
-
|
|
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 [];
|
|
199869
199958
|
return [
|
|
199870
|
-
`[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)`
|
|
199871
199960
|
];
|
|
199872
199961
|
}
|
|
199873
199962
|
function addFooter(ctx, body) {
|
|
@@ -199903,10 +199992,11 @@ function CreateCommentTool(ctx) {
|
|
|
199903
199992
|
});
|
|
199904
199993
|
ctx.toolState.wasUpdated = true;
|
|
199905
199994
|
log2.info(`\xBB created comment ${result.data.id}`);
|
|
199906
|
-
|
|
199995
|
+
const ownTarget = issueNumber === runIssueNumber(ctx);
|
|
199996
|
+
if (ownTarget) {
|
|
199907
199997
|
ctx.toolState.standaloneCommentId = result.data.id;
|
|
199908
199998
|
}
|
|
199909
|
-
const enrichmentLinks =
|
|
199999
|
+
const enrichmentLinks = ownTarget ? buildEnrichmentLinks(ctx, issueNumber) : [];
|
|
199910
200000
|
if (commentType === "Plan" || enrichmentLinks.length > 0) {
|
|
199911
200001
|
if (commentType === "Plan" && result.data.node_id) {
|
|
199912
200002
|
await patchWorkflowRunFields(ctx, { planCommentNodeId: result.data.node_id });
|
|
@@ -199986,9 +200076,9 @@ async function reportProgress(ctx, params) {
|
|
|
199986
200076
|
if (params.liveProgress && !ctx.payload.progressComments) {
|
|
199987
200077
|
return { body, action: "skipped" };
|
|
199988
200078
|
}
|
|
199989
|
-
const issueNumber =
|
|
200079
|
+
const issueNumber = runIssueNumber(ctx);
|
|
199990
200080
|
const isPlanMode = ctx.toolState.selectedMode === "Plan";
|
|
199991
|
-
const enrichmentLinks = params.liveProgress ? [] : buildEnrichmentLinks(ctx);
|
|
200081
|
+
const enrichmentLinks = params.liveProgress ? [] : buildEnrichmentLinks(ctx, issueNumber);
|
|
199992
200082
|
const apiCtx = { octokit: ctx.octokit, owner: ctx.repo.owner, repo: ctx.repo.name };
|
|
199993
200083
|
if (target_plan_comment === true && ctx.toolState.existingPlanCommentId === void 0) {
|
|
199994
200084
|
log2.warning("target_plan_comment requested but no existingPlanCommentId in tool state");
|
|
@@ -200895,7 +200985,10 @@ async function createAndSubmitWithFooter(ctx, params, opts) {
|
|
|
200895
200985
|
}
|
|
200896
200986
|
}
|
|
200897
200987
|
async function reportReviewNodeId(ctx, params) {
|
|
200898
|
-
await patchWorkflowRunFields(ctx, {
|
|
200988
|
+
await patchWorkflowRunFields(ctx, {
|
|
200989
|
+
reviewNodeId: params.nodeId,
|
|
200990
|
+
reviewedCommitSha: params.reviewedSha
|
|
200991
|
+
});
|
|
200899
200992
|
}
|
|
200900
200993
|
|
|
200901
200994
|
// utils/setup.ts
|
|
@@ -201489,6 +201582,34 @@ function describeHead(h2) {
|
|
|
201489
201582
|
if (h2.kind === "branch") return `branch \`${h2.name}\``;
|
|
201490
201583
|
return `detached HEAD \`${h2.sha}\``;
|
|
201491
201584
|
}
|
|
201585
|
+
var FORMER_BASE_TIPS_QUERY = `
|
|
201586
|
+
query ($owner: String!, $repo: String!, $number: Int!) {
|
|
201587
|
+
repository(owner: $owner, name: $repo) {
|
|
201588
|
+
pullRequest(number: $number) {
|
|
201589
|
+
timelineItems(itemTypes: [BASE_REF_FORCE_PUSHED_EVENT], last: 100) {
|
|
201590
|
+
nodes { ... on BaseRefForcePushedEvent { beforeCommit { oid } } }
|
|
201591
|
+
}
|
|
201592
|
+
}
|
|
201593
|
+
}
|
|
201594
|
+
}
|
|
201595
|
+
`;
|
|
201596
|
+
async function getFormerBaseTips(ctx, pullNumber) {
|
|
201597
|
+
try {
|
|
201598
|
+
const response = await ctx.octokit.graphql(FORMER_BASE_TIPS_QUERY, {
|
|
201599
|
+
owner: ctx.repo.owner,
|
|
201600
|
+
repo: ctx.repo.name,
|
|
201601
|
+
number: pullNumber
|
|
201602
|
+
});
|
|
201603
|
+
return response.repository.pullRequest.timelineItems.nodes.flatMap(
|
|
201604
|
+
(node3) => node3.beforeCommit ? [node3.beforeCommit.oid] : []
|
|
201605
|
+
);
|
|
201606
|
+
} catch (error63) {
|
|
201607
|
+
log2.warning(
|
|
201608
|
+
`\xBB former base tips unavailable: ${error63 instanceof Error ? error63.message : String(error63)}`
|
|
201609
|
+
);
|
|
201610
|
+
return [];
|
|
201611
|
+
}
|
|
201612
|
+
}
|
|
201492
201613
|
function CheckoutPrTool(ctx) {
|
|
201493
201614
|
const runCheckout = async (pull_number, signal) => {
|
|
201494
201615
|
const prResponse = await ctx.octokit.rest.pulls.get({
|
|
@@ -201541,7 +201662,8 @@ function CheckoutPrTool(ctx) {
|
|
|
201541
201662
|
const incremental = computeIncrementalDiff({
|
|
201542
201663
|
baseBranch: pr.baseRef,
|
|
201543
201664
|
beforeSha: primary.beforeSha,
|
|
201544
|
-
headSha: checkoutSha
|
|
201665
|
+
headSha: checkoutSha,
|
|
201666
|
+
formerBaseTips: await getFormerBaseTips(ctx, pull_number)
|
|
201545
201667
|
});
|
|
201546
201668
|
if (incremental.status === "ok") {
|
|
201547
201669
|
incrementalDiffPath = join17(
|
|
@@ -202694,8 +202816,8 @@ var GhParams = type({
|
|
|
202694
202816
|
'gh arguments as an argv array, e.g. ["pr", "list", "--json", "number,title"] or ["api", "graphql", "-f", "query=..."]'
|
|
202695
202817
|
)
|
|
202696
202818
|
});
|
|
202697
|
-
function shellQuote(
|
|
202698
|
-
return `'${
|
|
202819
|
+
function shellQuote(arg11) {
|
|
202820
|
+
return `'${arg11.replace(/'/g, "'\\''")}'`;
|
|
202699
202821
|
}
|
|
202700
202822
|
function GhTool(ctx) {
|
|
202701
202823
|
const permissions = mirrorRolePermissions(ctx.payload.event.authorPermission);
|
|
@@ -202967,7 +203089,7 @@ function GetIssueCommentsTool(ctx) {
|
|
|
202967
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 })`.",
|
|
202968
203090
|
parameters: GetIssueComments,
|
|
202969
203091
|
execute: execute(async ({ issue_number }) => {
|
|
202970
|
-
primaryRepoState(ctx.toolState).issueNumber
|
|
203092
|
+
primaryRepoState(ctx.toolState).issueNumber ??= issue_number;
|
|
202971
203093
|
const comments = await ctx.octokit.paginate(ctx.octokit.rest.issues.listComments, {
|
|
202972
203094
|
owner: ctx.repo.owner,
|
|
202973
203095
|
repo: ctx.repo.name,
|
|
@@ -203005,7 +203127,7 @@ function GetIssueEventsTool(ctx) {
|
|
|
203005
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.",
|
|
203006
203128
|
parameters: GetIssueEvents,
|
|
203007
203129
|
execute: execute(async ({ issue_number }) => {
|
|
203008
|
-
primaryRepoState(ctx.toolState).issueNumber
|
|
203130
|
+
primaryRepoState(ctx.toolState).issueNumber ??= issue_number;
|
|
203009
203131
|
const events = await ctx.octokit.paginate(ctx.octokit.rest.issues.listEventsForTimeline, {
|
|
203010
203132
|
owner: ctx.repo.owner,
|
|
203011
203133
|
repo: ctx.repo.name,
|
|
@@ -203089,7 +203211,7 @@ function IssueInfoTool(ctx) {
|
|
|
203089
203211
|
tmpdir: ctx.tmpdir,
|
|
203090
203212
|
githubToken: ctx.githubInstallationToken
|
|
203091
203213
|
});
|
|
203092
|
-
primaryRepoState(ctx.toolState).issueNumber
|
|
203214
|
+
primaryRepoState(ctx.toolState).issueNumber ??= issue_number;
|
|
203093
203215
|
const hints = [];
|
|
203094
203216
|
if (data.comments > 0) {
|
|
203095
203217
|
hints.push("use get_issue_comments to retrieve all comments for this issue");
|
|
@@ -204557,8 +204679,11 @@ function SimilarIssuesTool(ctx) {
|
|
|
204557
204679
|
mutates: true,
|
|
204558
204680
|
parameters: SimilarIssues,
|
|
204559
204681
|
execute: execute(async (input2) => {
|
|
204560
|
-
|
|
204561
|
-
|
|
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}`);
|
|
204562
204687
|
}
|
|
204563
204688
|
const response = await apiFetch({
|
|
204564
204689
|
path: `/api/repo/${ctx.repo.owner}/${ctx.repo.name}/issues/${input2.issue_number}/similar`,
|
|
@@ -204840,7 +204965,7 @@ function buildCommonTools(ctx, outputSchema) {
|
|
|
204840
204965
|
if (hasSimilarIssues({ repoIntelligence: ctx.repoIntelligence, event: ctx.payload.event })) {
|
|
204841
204966
|
tools.push(SimilarIssuesTool(ctx));
|
|
204842
204967
|
}
|
|
204843
|
-
if (
|
|
204968
|
+
if (!ctx.payload.event.is_pr) {
|
|
204844
204969
|
tools.push(SearchIssuesTool(ctx));
|
|
204845
204970
|
}
|
|
204846
204971
|
const isStandalone = ctx.payload.event.trigger === "unknown";
|
|
@@ -205238,11 +205363,11 @@ function buildOpenAICompatibleSetupError(params) {
|
|
|
205238
205363
|
missing: params.missing,
|
|
205239
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)}):`,
|
|
205240
205365
|
env: [
|
|
205241
|
-
`${
|
|
205242
|
-
`${
|
|
205243
|
-
`${
|
|
205244
|
-
`${
|
|
205245
|
-
`${
|
|
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"`
|
|
205246
205371
|
],
|
|
205247
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.",
|
|
205248
205373
|
guide: "https://docs.pullfrog.com/openai-compatible"
|
|
@@ -205276,17 +205401,16 @@ function hasPositiveNumberEnvVar(name) {
|
|
|
205276
205401
|
return Number(process.env[name]) > 0;
|
|
205277
205402
|
}
|
|
205278
205403
|
function validateOpenAICompatibleSetup(params) {
|
|
205404
|
+
const env2 = openAICompatibleEnv(params.set);
|
|
205279
205405
|
const missing = [];
|
|
205280
|
-
if (!hasEnvVar2(
|
|
205281
|
-
if (!hasEnvVar2(
|
|
205282
|
-
if (!hasEnvVar2(
|
|
205283
|
-
if (!hasPositiveNumberEnvVar(
|
|
205284
|
-
|
|
205285
|
-
if (!hasPositiveNumberEnvVar(OPENAI_COMPATIBLE_MAX_OUTPUT_ENV))
|
|
205286
|
-
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);
|
|
205287
205411
|
if (missing.length > 0) {
|
|
205288
205412
|
throw new Error(
|
|
205289
|
-
buildOpenAICompatibleSetupError({ owner: params.owner, name: params.name, missing })
|
|
205413
|
+
buildOpenAICompatibleSetupError({ owner: params.owner, name: params.name, missing, env: env2 })
|
|
205290
205414
|
);
|
|
205291
205415
|
}
|
|
205292
205416
|
}
|
|
@@ -205342,7 +205466,11 @@ function validateAgentApiKey(params) {
|
|
|
205342
205466
|
return;
|
|
205343
205467
|
}
|
|
205344
205468
|
if (params.model.startsWith(`${OPENAI_COMPATIBLE_PROVIDER}/`)) {
|
|
205345
|
-
validateOpenAICompatibleSetup({
|
|
205469
|
+
validateOpenAICompatibleSetup({
|
|
205470
|
+
owner: params.owner,
|
|
205471
|
+
name: params.name,
|
|
205472
|
+
set: params.openAICompatibleSet
|
|
205473
|
+
});
|
|
205346
205474
|
return;
|
|
205347
205475
|
}
|
|
205348
205476
|
if (params.model.startsWith(`${AZURE_PROVIDER}/`)) {
|
|
@@ -205656,17 +205784,37 @@ function resolveSlug(slug2) {
|
|
|
205656
205784
|
}
|
|
205657
205785
|
return `${AZURE_PROVIDER}/${deployment}`;
|
|
205658
205786
|
}
|
|
205659
|
-
|
|
205660
|
-
|
|
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();
|
|
205661
205791
|
if (!modelId) {
|
|
205662
205792
|
throw new Error(
|
|
205663
|
-
`\`${
|
|
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)`
|
|
205664
205794
|
);
|
|
205665
205795
|
}
|
|
205666
205796
|
return `${OPENAI_COMPATIBLE_PROVIDER}/${modelId}`;
|
|
205667
205797
|
}
|
|
205668
205798
|
return resolveCliModel(slug2);
|
|
205669
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
|
+
}
|
|
205670
205818
|
function resolveModel(ctx) {
|
|
205671
205819
|
const envModel = process.env.PULLFROG_MODEL?.trim();
|
|
205672
205820
|
if (envModel) {
|
|
@@ -206666,7 +206814,7 @@ Rules:
|
|
|
206666
206814
|
### GitHub
|
|
206667
206815
|
|
|
206668
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.
|
|
206669
|
-
${hasSimilarIssues({ repoIntelligence: ctx.repoIntelligence, event: ctx.payload.event }) ? `
|
|
206817
|
+
${ctx.payload.event.issue_number !== void 0 && hasSimilarIssues({ repoIntelligence: ctx.repoIntelligence, event: ctx.payload.event }) ? `
|
|
206670
206818
|
#### Duplicate detection (enabled for this repository)
|
|
206671
206819
|
|
|
206672
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.
|
|
@@ -208136,7 +208284,7 @@ async function postReviewCleanup(ctx) {
|
|
|
208136
208284
|
if (!review) {
|
|
208137
208285
|
const checkoutSha = primaryRepoState(ctx.toolState).checkoutSha;
|
|
208138
208286
|
if (ctx.toolState.selectedMode === "IncrementalReview" && checkoutSha) {
|
|
208139
|
-
await patchWorkflowRunFields(ctx, { reviewSkipped: true });
|
|
208287
|
+
await patchWorkflowRunFields(ctx, { reviewSkipped: true, reviewedCommitSha: checkoutSha });
|
|
208140
208288
|
await bestEffort(
|
|
208141
208289
|
() => dispatchFollowUpReReview(ctx, checkoutSha),
|
|
208142
208290
|
"follow-up re-review dispatch"
|
|
@@ -208145,7 +208293,7 @@ async function postReviewCleanup(ctx) {
|
|
|
208145
208293
|
return;
|
|
208146
208294
|
}
|
|
208147
208295
|
delete ctx.toolState.review;
|
|
208148
|
-
await bestEffort(() => reportReviewNodeId(ctx,
|
|
208296
|
+
await bestEffort(() => reportReviewNodeId(ctx, review), "reportReviewNodeId");
|
|
208149
208297
|
if (review.reviewedSha) {
|
|
208150
208298
|
await bestEffort(
|
|
208151
208299
|
() => dispatchFollowUpReReview(ctx, review.reviewedSha),
|
|
@@ -208545,6 +208693,9 @@ function resolveModelForLog(ctx) {
|
|
|
208545
208693
|
function resolveEffortForLog(ctx) {
|
|
208546
208694
|
const effort = resolveRunEffort(ctx);
|
|
208547
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
|
+
}
|
|
208548
208699
|
if (!effort.alias) return "not applied \u2014 model not recognized";
|
|
208549
208700
|
if (!effort.rung) return "n/a (model has no effort control)";
|
|
208550
208701
|
return effort.configured ? effort.rung : `${effort.rung} (default)`;
|
|
@@ -208563,9 +208714,7 @@ function logRunStartup(ctx) {
|
|
|
208563
208714
|
log2.info(
|
|
208564
208715
|
`\xBB model: ${resolveModelForLog({ payload: ctx.payload, resolvedModel: ctx.resolvedModel })}`
|
|
208565
208716
|
);
|
|
208566
|
-
log2.info(
|
|
208567
|
-
`\xBB effort: ${resolveEffortForLog({ payload: ctx.payload, resolvedModel: ctx.resolvedModel })}`
|
|
208568
|
-
);
|
|
208717
|
+
log2.info(`\xBB effort: ${resolveEffortForLog(ctx)}`);
|
|
208569
208718
|
const routing = ctx.payload.routing;
|
|
208570
208719
|
if (routing) {
|
|
208571
208720
|
log2.info(
|
|
@@ -208836,6 +208985,7 @@ async function main() {
|
|
|
208836
208985
|
const count = Object.keys(runContext.dbSecrets).length;
|
|
208837
208986
|
if (count > 0) log2.info(`\xBB ${count} db secret(s) loaded`);
|
|
208838
208987
|
}
|
|
208988
|
+
const openAICompatibleSet = activateOpenAICompatibleSet({ slug: payload.model });
|
|
208839
208989
|
await initializeCredentialPool({ ctx: runContext, slug: payload.model, injected });
|
|
208840
208990
|
installCodexAuth();
|
|
208841
208991
|
installXaiAuth();
|
|
@@ -208984,7 +209134,8 @@ async function main() {
|
|
|
208984
209134
|
owner: runContext.repo.owner,
|
|
208985
209135
|
name: runContext.repo.name,
|
|
208986
209136
|
secretsUnavailable: runContext.secretsUnavailable,
|
|
208987
|
-
routerUnfunded: runContext.routerUnfunded
|
|
209137
|
+
routerUnfunded: runContext.routerUnfunded,
|
|
209138
|
+
openAICompatibleSet
|
|
208988
209139
|
});
|
|
208989
209140
|
} catch (missingKey) {
|
|
208990
209141
|
const funded = runContext.trialFallback && missingKey instanceof NoUsableCredentialError ? await resolveTrialFallback({
|
|
@@ -209915,7 +210066,7 @@ function resolveTarget2(repo) {
|
|
|
209915
210066
|
return { owner: match3[1], repo: match3[2] };
|
|
209916
210067
|
}
|
|
209917
210068
|
function cliVersion() {
|
|
209918
|
-
const parts = /^(\d+)\.(\d+)\.(\d+)$/.exec("0.1.
|
|
210069
|
+
const parts = /^(\d+)\.(\d+)\.(\d+)$/.exec("0.1.105");
|
|
209919
210070
|
if (!parts) return "0.0.0";
|
|
209920
210071
|
return `${Number(parts[1])}.${Number(parts[2])}.${Number(parts[3])}`;
|
|
209921
210072
|
}
|
|
@@ -209971,11 +210122,41 @@ async function runCli7(input2) {
|
|
|
209971
210122
|
});
|
|
209972
210123
|
}
|
|
209973
210124
|
|
|
209974
|
-
// commands/
|
|
210125
|
+
// commands/run.ts
|
|
209975
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);
|
|
209976
210157
|
var import_picocolors4 = __toESM(require_picocolors(), 1);
|
|
209977
210158
|
function parseWatchArgs(args2) {
|
|
209978
|
-
return (0,
|
|
210159
|
+
return (0, import_arg9.default)(
|
|
209979
210160
|
{
|
|
209980
210161
|
"--pr": Number,
|
|
209981
210162
|
"--pretty": Boolean,
|
|
@@ -210022,7 +210203,7 @@ function emit(events, pretty) {
|
|
|
210022
210203
|
`);
|
|
210023
210204
|
}
|
|
210024
210205
|
}
|
|
210025
|
-
async function
|
|
210206
|
+
async function runCli9(input2) {
|
|
210026
210207
|
let parsed2;
|
|
210027
210208
|
try {
|
|
210028
210209
|
parsed2 = parseWatchArgs(input2.args);
|
|
@@ -210082,7 +210263,7 @@ async function runCli8(input2) {
|
|
|
210082
210263
|
}
|
|
210083
210264
|
|
|
210084
210265
|
// cli.ts
|
|
210085
|
-
var VERSION10 = "0.1.
|
|
210266
|
+
var VERSION10 = "0.1.105";
|
|
210086
210267
|
var bin = basename2(process.argv[1] || "");
|
|
210087
210268
|
var PROG = bin === "pf" || bin === "pullfrog" ? bin : "pullfrog";
|
|
210088
210269
|
var rawArgs = process.argv.slice(2);
|
|
@@ -210094,6 +210275,7 @@ function printMainUsage(stream) {
|
|
|
210094
210275
|
stream(" console open the repository or organization console");
|
|
210095
210276
|
stream(" secret list secret names, save or delete scoped credentials");
|
|
210096
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");
|
|
210097
210279
|
stream(" auth manage provider credentials for the current repository");
|
|
210098
210280
|
stream(" watch stream a PR's activity as one JSON line per event");
|
|
210099
210281
|
stream(" mcp run a stdio MCP server exposing PR activity as an agent tool");
|
|
@@ -210103,7 +210285,7 @@ function printMainUsage(stream) {
|
|
|
210103
210285
|
stream(" -v, --version show version");
|
|
210104
210286
|
}
|
|
210105
210287
|
function parseGlobalArgs(args2) {
|
|
210106
|
-
return (0,
|
|
210288
|
+
return (0, import_arg10.default)(
|
|
210107
210289
|
{
|
|
210108
210290
|
"--help": Boolean,
|
|
210109
210291
|
"--version": Boolean,
|
|
@@ -210154,6 +210336,10 @@ async function run3() {
|
|
|
210154
210336
|
});
|
|
210155
210337
|
return;
|
|
210156
210338
|
}
|
|
210339
|
+
if (command === "run") {
|
|
210340
|
+
await runCli8({ args: commandArgs, prog: PROG, showHelp: globalParsed["--help"] === true });
|
|
210341
|
+
return;
|
|
210342
|
+
}
|
|
210157
210343
|
if (command === "config" || command === "console" || command === "secret") {
|
|
210158
210344
|
const runCommand = command === "config" ? runCli3 : command === "secret" ? runCli : runCli4;
|
|
210159
210345
|
await runCommand({ args: commandArgs, prog: PROG, showHelp: globalParsed["--help"] === true });
|
|
@@ -210184,7 +210370,7 @@ async function run3() {
|
|
|
210184
210370
|
return;
|
|
210185
210371
|
}
|
|
210186
210372
|
if (command === "watch") {
|
|
210187
|
-
await
|
|
210373
|
+
await runCli9({
|
|
210188
210374
|
args: commandArgs,
|
|
210189
210375
|
prog: PROG,
|
|
210190
210376
|
showHelp: globalParsed["--help"] === true
|