pullfrog 0.1.51 → 0.1.53

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.
@@ -7,6 +7,7 @@ export declare const JsonPayload: import("arktype/internal/variants/object.ts").
7
7
  model?: string | undefined;
8
8
  modelExplicit?: boolean | undefined;
9
9
  effort?: string | number | undefined;
10
+ debug?: boolean | undefined;
10
11
  triggerer?: string | undefined;
11
12
  baseInstructions?: string | undefined;
12
13
  eventInstructions?: string;
@@ -33,6 +34,7 @@ export declare const Inputs: import("arktype/internal/variants/object.ts").Objec
33
34
  prompt_file?: string | undefined;
34
35
  model?: string | undefined;
35
36
  effort?: string | undefined;
37
+ debug?: "disabled" | "enabled" | undefined;
36
38
  timeout?: string | undefined;
37
39
  push?: "disabled" | "enabled" | "restricted" | undefined;
38
40
  shell?: "disabled" | "enabled" | "restricted" | undefined;
@@ -50,6 +52,7 @@ export declare function resolvePayload(resolvedPromptInput: ResolvedPromptInput,
50
52
  model: string | undefined;
51
53
  modelExplicit: boolean;
52
54
  effort: number | undefined;
55
+ debug: true | undefined;
53
56
  prompt: string;
54
57
  triggerer: string | undefined;
55
58
  baseInstructions: string | undefined;
@@ -32,7 +32,26 @@ type ComputeIncrementalDiffParams = {
32
32
  * - patch-text diffing (interdiff / diff-of-diffs): fragile, hunk offset noise on rebase
33
33
  * - range-diff on raw commit ranges: confused by commit reorganization across force-pushes
34
34
  */
35
- export declare function computeIncrementalDiff(params: ComputeIncrementalDiffParams): string | null;
35
+ export type IncrementalDiffResult =
36
+ /** range-diff ran and produced a delta */
37
+ {
38
+ status: "ok";
39
+ diff: string;
40
+ }
41
+ /** range-diff ran and the two versions are identical */
42
+ | {
43
+ status: "empty";
44
+ }
45
+ /** range-diff could not run — most often `beforeSha` has no ancestry to
46
+ * merge-base against on a shallow clone. distinct from "empty" on purpose:
47
+ * they were the same `null` before, so `checkout_pr` could not tell the
48
+ * agent whether there was nothing to see or whether we had simply failed.
49
+ * see #1139. */
50
+ | {
51
+ status: "unavailable";
52
+ reason: string;
53
+ };
54
+ export declare function computeIncrementalDiff(params: ComputeIncrementalDiffParams): IncrementalDiffResult;
36
55
  /**
37
56
  * transforms git range-diff output into a clean incremental diff.
38
57
  *
@@ -37,6 +37,7 @@ export interface RepoSettings {
37
37
  repoIntelligence: boolean;
38
38
  progressComments: boolean;
39
39
  statusChecks: boolean;
40
+ approvalCheck: boolean;
40
41
  modeInstructions: Record<string, string>;
41
42
  learnings: string | null;
42
43
  learningsHeadings: LearningsHeading[];
@@ -21,6 +21,21 @@ export interface RunEffort {
21
21
  /** the catalog alias the ladder came from, if we recognized one. */
22
22
  alias: ModelAlias | undefined;
23
23
  }
24
+ /**
25
+ * the position a subsidised run is pinned to — the `high` rung on the ladder of
26
+ * the funded model. only reachable on the subsidy proxy, so the ladder is always
27
+ * the OpenRouter one.
28
+ *
29
+ * `high` by name, not position 0. position 0 was equivalent for as long as every
30
+ * subsidy candidate's ladder started at `high`, but DeepSeek V4 Flash 0731
31
+ * publishes `low, high, max` on the OpenRouter route, so the floor would have
32
+ * silently dropped a level the moment that became the funded default — undoing
33
+ * the `high`-effort result #1063 chose the tier on. a model publishing no `high`
34
+ * falls back to its own floor.
35
+ */
36
+ export declare function ossEffortFloor(ctx: {
37
+ payload: ResolvedPayload;
38
+ }): EffortPosition;
24
39
  export declare function resolveRunEffort(ctx: {
25
40
  payload: ResolvedPayload;
26
41
  resolvedModel?: string | undefined;
@@ -27,6 +27,14 @@
27
27
  * 4. ProviderModelNotFoundError — configured model id no longer in the
28
28
  * OpenCode catalog; renders a nudge to pick a different model.
29
29
  *
30
+ * 4a. No-provider-available (#1077) — the model IS in the catalog but the
31
+ * provider declines to route it on this account's plan (OpenCode Zen's
32
+ * own refusal string). Same "pick another model" CTA, different reason.
33
+ *
34
+ * 4b. Context-window overflow (#1116) — terminal `Prompt is too long` /
35
+ * `maximum context length is N tokens`. Actionable, so it renders on
36
+ * both surfaces rather than collapsing to the one-line comment.
37
+ *
30
38
  * 5. Activity-timeout hang — `errorMessage` starts with
31
39
  * `"activity timeout"` or `"agent still pending"` AND none of the
32
40
  * above matched. The harness keeps structured diagnostic state on
@@ -43,8 +51,9 @@
43
51
  * banner; the PR comment collapses to the same one-line logs link as
44
52
  * the hang case, since the raw internal string helps nobody on the PR.
45
53
  *
46
- * Net: the actionable classifications (billing, API-key, model-not-found)
47
- * render identical bodies on both surfaces; the non-actionable ones (hang,
54
+ * Net: the actionable classifications (billing, API-key, model-not-found,
55
+ * no-provider-available, context-overflow) render identical bodies on both
56
+ * surfaces; the non-actionable ones (hang,
48
57
  * generic) keep the forensics in the Actions job summary and show a calm
49
58
  * one-liner in the PR comment, whose footer already carries Pullfrog
50
59
  * branding + rerun links.
@@ -61,4 +70,8 @@ export declare function renderRunError(input: {
61
70
  name: string;
62
71
  };
63
72
  agentDiagnostic: AgentDiagnostic | undefined;
73
+ /** the run is spending Pullfrog's Router wallet (a proxy key was minted), not
74
+ * the user's own provider credential. `payload.proxyModel` at both call
75
+ * sites. */
76
+ routerActive: boolean;
64
77
  }): RenderedRunError;
@@ -10,6 +10,11 @@
10
10
  export declare const SENSITIVE_PATTERNS: RegExp[];
11
11
  export declare function isSensitiveEnvName(key: string): boolean;
12
12
  export declare function setEnvAllowlist(raw: string): void;
13
+ /**
14
+ * `filterEnv()` minus the workflow-command file paths. For subprocesses that
15
+ * execute third-party code we do not sandbox — the dependency installers.
16
+ */
17
+ export declare function filterEnvForUntrustedCode(): Record<string, string>;
13
18
  /** filter env vars using default-deny allowlist: safe set + user allowlist */
14
19
  export declare function filterEnv(): Record<string, string>;
15
20
  export type EnvMode = "restricted" | "inherit" | Record<string, string>;
@@ -53,6 +53,13 @@ export declare function setupTestRepo(options: SetupOptions): void;
53
53
  export declare function removeIncludeIfEntries(repoDir: string): void;
54
54
  export interface GitContext {
55
55
  gitToken: string;
56
+ /**
57
+ * re-mint the git token when GitHub's git edge rejects the one we hold. the
58
+ * fetch path had no re-mint at all, so `checkout_pr` died unrecoverably on a
59
+ * bad token instance while `push_branch` recovered from the identical
60
+ * failure. see #1115.
61
+ */
62
+ refreshGitToken?: ((stale: string) => Promise<string>) | undefined;
56
63
  owner: string;
57
64
  name: string;
58
65
  octokit: OctokitWithPlugins;
@@ -8,7 +8,7 @@ import type { ToolContext } from "../mcp/server.ts";
8
8
  * see `runStatusCheck.ts` for why a second create would leave two contradictory rows.
9
9
  * the terminal-create fallback covers a payload with no `checkRun` (older server
10
10
  * build mid-rolling-deploy, or a workflow driven outside Pullfrog's dispatch path).
11
- * - `pullfrog-approval` stays opt-in (`status_checks: enabled`) and terminal-only:
11
+ * - `pullfrog-approval` stays opt-in (`Repo.approvalCheck`, default off) and terminal-only:
12
12
  * it asserts a review verdict, which only exists once a run produces one. anchored
13
13
  * to the exact reviewed sha so a mid-run push leaves the new head unapproved until
14
14
  * a follow-up re-review reports.
@@ -0,0 +1,20 @@
1
+ /** tracked paths with staged or unstaged modifications. */
2
+ export declare function dirtyTrackedPaths(): Promise<Set<string>>;
3
+ /**
4
+ * discard tracked-file mods that appeared since the `before` snapshot, so the
5
+ * customer checkout is clean before agent tools run — any dirt makes
6
+ * `checkout_pr` refuse for the rest of the run. paths already dirty at snapshot
7
+ * time are left alone, and untracked files (`node_modules`, etc.) are never
8
+ * touched.
9
+ *
10
+ * attribution is by WINDOW, not by writer: every tracked path dirtied while the
11
+ * window was open gets reverted, whoever wrote it. a caller must therefore close
12
+ * its window before the agent can write, or it will discard the agent's own work
13
+ * (#1146 — background prep cannot make that guarantee).
14
+ *
15
+ * `actor` names the phase that owns the window and is what the log line blames.
16
+ */
17
+ export declare function restoreDirtiedSince(params: {
18
+ before: Set<string>;
19
+ actor: string;
20
+ }): Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pullfrog",
3
- "version": "0.1.51",
3
+ "version": "0.1.53",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "pullfrog": "dist/cli.mjs",