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/dist/internal.js CHANGED
@@ -8,7 +8,7 @@ var __export = (target, all) => {
8
8
  // package.json
9
9
  var package_default = {
10
10
  name: "pullfrog",
11
- version: "0.1.103",
11
+ version: "0.1.105",
12
12
  cliContractVersion: "1",
13
13
  type: "module",
14
14
  bin: {
@@ -20079,7 +20079,7 @@ var repoConfigFields = [
20079
20079
  key: "address-reviews.enabled",
20080
20080
  field: "codingAddressReviews",
20081
20081
  kind: "toggle",
20082
- description: "address review feedback"
20082
+ description: "address reviews on Pullfrog-authored PRs"
20083
20083
  },
20084
20084
  {
20085
20085
  key: "fix-ci.own-prs",
@@ -21651,7 +21651,10 @@ function modelHasStoredAuth(params) {
21651
21651
  const authVars = [
21652
21652
  ...getModelEnvVars(slug),
21653
21653
  ...getModelManagedCredentials(slug),
21654
- ...HARNESS_ONLY_CREDENTIALS[getModelProvider(slug)] ?? []
21654
+ ...HARNESS_ONLY_CREDENTIALS[getModelProvider(slug)] ?? [],
21655
+ // the default endpoint's vars above still count: a runner holding no such set runs the
21656
+ // slug as a raw model id on it
21657
+ ...openAICompatibleSetEnvVars(slug)
21655
21658
  ];
21656
21659
  return authVars.some((v) => params.secretNames.includes(v));
21657
21660
  }
@@ -21877,6 +21880,46 @@ function isOssAllowedModel(slug) {
21877
21880
  function getAutoSelectHintModel() {
21878
21881
  return defaultProxyDisplayName;
21879
21882
  }
21883
+ var OPENAI_COMPATIBLE_PROVIDER = "openai-compatible";
21884
+ function isOpenAICompatibleSetName(name) {
21885
+ return name !== "byok" && name.length <= 32 && /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(name);
21886
+ }
21887
+ function openAICompatibleSetName(slug) {
21888
+ const prefix = `${OPENAI_COMPATIBLE_PROVIDER}/`;
21889
+ if (!slug.startsWith(prefix)) return void 0;
21890
+ const name = slug.slice(prefix.length);
21891
+ return isOpenAICompatibleSetName(name) ? name : void 0;
21892
+ }
21893
+ function openAICompatibleEnv(name) {
21894
+ const prefix = `OPENAI_COMPATIBLE_${name ? `${name.toUpperCase().replaceAll("-", "_")}_` : ""}`;
21895
+ return {
21896
+ baseUrl: `${prefix}BASE_URL`,
21897
+ apiKey: `${prefix}API_KEY`,
21898
+ model: `${prefix}MODEL`,
21899
+ context: `${prefix}CONTEXT`,
21900
+ maxOutput: `${prefix}MAX_OUTPUT`
21901
+ };
21902
+ }
21903
+ function openAICompatibleSetEnvVars(slug) {
21904
+ const set2 = openAICompatibleSetName(slug);
21905
+ if (!set2) return [];
21906
+ const env = openAICompatibleEnv(set2);
21907
+ return [env.baseUrl, env.apiKey, env.model];
21908
+ }
21909
+ function openAICompatibleSetOf(envName) {
21910
+ const match = /^OPENAI_COMPATIBLE_([A-Z0-9]+(?:_[A-Z0-9]+)*)_(?:BASE_URL|API_KEY|MODEL|CONTEXT|MAX_OUTPUT)$/.exec(
21911
+ envName
21912
+ );
21913
+ const name = match?.[1]?.toLowerCase().replaceAll("_", "-");
21914
+ return name && isOpenAICompatibleSetName(name) ? name : void 0;
21915
+ }
21916
+ function openAICompatibleSets(names) {
21917
+ return [...new Set(names.flatMap((name) => openAICompatibleSetOf(name) ?? []))].sort();
21918
+ }
21919
+ function openAICompatibleSetAlias(set2) {
21920
+ const byok = resolveDisplayAlias(`${OPENAI_COMPATIBLE_PROVIDER}/byok`);
21921
+ return byok && { ...byok, slug: `${OPENAI_COMPATIBLE_PROVIDER}/${set2}`, displayName: set2 };
21922
+ }
21880
21923
  var PROVIDER_GATEWAY_URL_ENV = {
21881
21924
  anthropic: "ANTHROPIC_BASE_URL",
21882
21925
  openai: "OPENAI_BASE_URL"
@@ -23534,6 +23577,7 @@ export {
23534
23577
  isEffortPosition,
23535
23578
  isLeapingIntoActionCommentBody,
23536
23579
  isLiveChecklistCommentBody,
23580
+ isOpenAICompatibleSetName,
23537
23581
  isOssAllowedModel,
23538
23582
  isPullfrog,
23539
23583
  isRouterTier,
@@ -23544,6 +23588,11 @@ export {
23544
23588
  modelIdLabel,
23545
23589
  modes,
23546
23590
  offeredRungs,
23591
+ openAICompatibleEnv,
23592
+ openAICompatibleSetAlias,
23593
+ openAICompatibleSetName,
23594
+ openAICompatibleSetOf,
23595
+ openAICompatibleSets,
23547
23596
  ossFundedModelNames,
23548
23597
  parseCodexAuthBody,
23549
23598
  parseEffortPosition,
@@ -263,4 +263,5 @@ export declare function createAndSubmitWithFooter(ctx: ToolContext, params: Rest
263
263
  */
264
264
  export declare function reportReviewNodeId(ctx: ToolContext, params: {
265
265
  nodeId: string;
266
+ reviewedSha: string | undefined;
266
267
  }): Promise<void>;
package/dist/models.d.ts CHANGED
@@ -464,6 +464,27 @@ export declare const OPENAI_COMPATIBLE_CONTEXT_ENV = "OPENAI_COMPATIBLE_CONTEXT"
464
464
  * `context` + `output` together, so the pair is validated and emitted as a unit.
465
465
  */
466
466
  export declare const OPENAI_COMPATIBLE_MAX_OUTPUT_ENV = "OPENAI_COMPATIBLE_MAX_OUTPUT";
467
+ /**
468
+ * a NAMED OpenAI-compatible endpoint: the slug `openai-compatible/<name>` runs on the five
469
+ * `OPENAI_COMPATIBLE_<NAME>_*` values, so one account holds several endpoints and each repo,
470
+ * trigger or `--model=` picks one. `byok` stays the unnamed default on the bare names. 32 is
471
+ * what keeps `OPENAI_COMPATIBLE_<NAME>_MAX_OUTPUT` under the 64-character secret-name cap.
472
+ */
473
+ export declare function isOpenAICompatibleSetName(name: string): boolean;
474
+ /**
475
+ * the set a slug names, by shape alone. `openai-compatible/<x>` is also a raw specifier (model
476
+ * `x` on the default endpoint), so a runner treats it as a set only when it holds that set's values.
477
+ */
478
+ export declare function openAICompatibleSetName(slug: string): string | undefined;
479
+ export declare const OPENAI_COMPATIBLE_FIELDS: readonly ["baseUrl", "apiKey", "model", "context", "maxOutput"];
480
+ /** the env var names one endpoint is configured by: a named set's, or the default's. */
481
+ export declare function openAICompatibleEnv(name?: string): Record<(typeof OPENAI_COMPATIBLE_FIELDS)[number], string>;
482
+ /** the set a variable belongs to: `OPENAI_COMPATIBLE_VLLM_A_API_KEY` → `vllm-a`. */
483
+ export declare function openAICompatibleSetOf(envName: string): string | undefined;
484
+ /** the named endpoints `names` (stored secret or env var names) hold any value of. */
485
+ export declare function openAICompatibleSets(names: string[]): string[];
486
+ /** a named endpoint as a picker entry: the default endpoint's routing alias under its own slug. */
487
+ export declare function openAICompatibleSetAlias(set: string): ModelAlias | undefined;
467
488
  /**
468
489
  * Providers whose endpoint can be re-pointed at a customer gateway, and the env
469
490
  * var that does it. Deliberately a short explicit map rather than a derived
@@ -1,4 +1,13 @@
1
1
  import type { Agent } from "../agents/index.ts";
2
+ /**
3
+ * make the run's named set (`openai-compatible/<name>`) its endpoint: the set's five values
4
+ * replace the bare `OPENAI_COMPATIBLE_*` that validation and the opencode provider read. a value
5
+ * the set lacks is cleared, never inherited, so the default endpoint's key cannot reach the set's
6
+ * URL. returns the set, so setup errors can name its own variables.
7
+ */
8
+ export declare function activateOpenAICompatibleSet(ctx: {
9
+ slug: string | undefined;
10
+ }): string | undefined;
2
11
  /**
3
12
  * resolve the effective model for this run.
4
13
  *
@@ -121,6 +121,8 @@ export declare function validateAgentApiKey(params: {
121
121
  * says nothing about what the user actually configured. */
122
122
  secretsUnavailable?: boolean | undefined;
123
123
  routerUnfunded?: boolean | undefined;
124
+ /** the named OpenAI-compatible set the run is on, from `activateOpenAICompatibleSet`. */
125
+ openAICompatibleSet?: string | undefined;
124
126
  }): void;
125
127
  /**
126
128
  * Detect agent-runtime auth failures that should be reformatted as an actionable
@@ -4,6 +4,8 @@ import type { ToolContext } from "../mcp/server.ts";
4
4
  * String-valued PATCH fields (all serialized identically on the wire):
5
5
  * - artifact node IDs (`*NodeId`, `summarySnapshot`) — PATCHed incrementally
6
6
  * by MCP tools as GitHub entities are created during the run.
7
+ * - `reviewedCommitSha` — the PR head a review covered, sent with `reviewNodeId`
8
+ * or `reviewSkipped`; the next re-review's delta starts there.
7
9
  * - `model` — the resolved/effective model the run actually ran on (proxy spec
8
10
  * for router/oss, post-fallback slug otherwise; NOT the configured
9
11
  * `Repo.model` slug), PATCHed once at end-of-run so per-model cost analytics
@@ -13,7 +15,7 @@ import type { ToolContext } from "../mcp/server.ts";
13
15
  * workflow can start the action several times in one run, and the server keeps
14
16
  * one row per start, keyed by `START_KEY`, and sums them onto the run.
15
17
  */
16
- declare const STRING_KEYS: readonly ["prNodeId", "issueNodeId", "reviewNodeId", "planCommentNodeId", "summarySnapshot", "model", "agent", "credential"];
18
+ declare const STRING_KEYS: readonly ["prNodeId", "issueNodeId", "reviewNodeId", "reviewedCommitSha", "planCommentNodeId", "summarySnapshot", "model", "agent", "credential"];
17
19
  /**
18
20
  * Number-valued usage fields — aggregated across all agent calls and PATCHed
19
21
  * once at end-of-run. Token counts are Int4 on the DB side (ample for any
@@ -23,7 +25,7 @@ declare const STRING_KEYS: readonly ["prNodeId", "issueNodeId", "reviewNodeId",
23
25
  declare const NUMBER_KEYS: readonly ["inputTokens", "outputTokens", "cacheReadTokens", "cacheWriteTokens", "costUsd"];
24
26
  /** one-way flags, only ever sent as `true`. Keep in sync with `BOOLEAN_FIELDS` in the server route. */
25
27
  declare const FLAG_KEYS: readonly ["reviewSkipped"];
26
- export type WorkflowRunPatch = Partial<Record<(typeof STRING_KEYS)[number], string>> & Partial<Record<(typeof NUMBER_KEYS)[number], number>> & Partial<Record<(typeof FLAG_KEYS)[number], true>> & {
28
+ export type WorkflowRunPatch = Partial<Record<(typeof STRING_KEYS)[number], string | undefined>> & Partial<Record<(typeof NUMBER_KEYS)[number], number>> & Partial<Record<(typeof FLAG_KEYS)[number], true>> & {
27
29
  succeeded?: boolean;
28
30
  };
29
31
  /** PATCH workflow-run fields (Pullfrog JWT, not GitHub). */
@@ -2,6 +2,8 @@ type ComputeIncrementalDiffParams = {
2
2
  baseBranch: string;
3
3
  beforeSha: string;
4
4
  headSha: string;
5
+ /** tips the base branch was force-pushed away from, which either version may still be built on */
6
+ formerBaseTips: string[];
5
7
  };
6
8
  /**
7
9
  * computes the incremental diff between two versions of a PR using range-diff
@@ -20,6 +20,11 @@ export interface RunEffort {
20
20
  rung: string | undefined;
21
21
  /** the catalog alias the ladder came from, if we recognized one. */
22
22
  alias: ModelAlias | undefined;
23
+ /**
24
+ * true when the catalog has no ladder for a configured effort and the variants
25
+ * the opencode server declares for the model may stand in (`declaredVariants`).
26
+ */
27
+ declarable: boolean;
23
28
  }
24
29
  /**
25
30
  * the position a subsidised run is pinned to — the `high` rung on the ladder of
@@ -39,4 +44,9 @@ export declare function ossEffortFloor(ctx: {
39
44
  export declare function resolveRunEffort(ctx: {
40
45
  payload: ResolvedPayload;
41
46
  resolvedModel?: string | undefined;
47
+ /**
48
+ * the variant names the opencode server lists for the running model, in its
49
+ * order. only consulted when the catalog has no alias for the model.
50
+ */
51
+ declaredVariants?: readonly string[] | undefined;
42
52
  }): RunEffort;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pullfrog",
3
- "version": "0.1.103",
3
+ "version": "0.1.105",
4
4
  "cliContractVersion": "1",
5
5
  "type": "module",
6
6
  "bin": {