pullfrog 0.1.7 → 0.1.8

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.
@@ -9,6 +9,11 @@ export declare const ShellParams: import("arktype/internal/variants/object.ts").
9
9
  export type SandboxMethod = "unshare" | "sudo-unshare" | "none";
10
10
  /** get the current sandbox method (for testing/diagnostics) */
11
11
  export declare function getSandboxMethod(): SandboxMethod;
12
+ /** chars of shell output kept inline in the agent reply. anything past this
13
+ * blows the agent's context budget on commands that dump big logs (test
14
+ * runners, build tools, grep on large trees), so the overflow is spilled
15
+ * to a tempfile the agent can re-read selectively (cat/tail/grep). */
16
+ export declare const MAX_OUTPUT_CHARS = 5000;
12
17
  export declare function ShellTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
13
18
  command: string;
14
19
  description: string;
@@ -1,5 +1,6 @@
1
1
  import type { AgentUsage } from "./agents/shared.ts";
2
2
  import type { PrepResult } from "./prep/types.ts";
3
+ import type { AgentDiagnostic } from "./utils/agentHangReport.ts";
3
4
  import type { DiffCoverageState } from "./utils/diffCoverage.ts";
4
5
  import { type ProgressComment, type ProgressCommentType } from "./utils/progressComment.ts";
5
6
  import type { TodoTracker } from "./utils/todoTracking.ts";
@@ -98,6 +99,7 @@ export interface ToolState {
98
99
  model?: string | undefined;
99
100
  todoTracker?: TodoTracker | undefined;
100
101
  diffCoverage?: DiffCoverageState | undefined;
102
+ agentDiagnostic?: AgentDiagnostic | undefined;
101
103
  }
102
104
  interface InitToolStateParams {
103
105
  progressComment: {
@@ -0,0 +1,38 @@
1
+ /**
2
+ * mutable per-run handle the agent harness writes to as a run progresses.
3
+ * the action's outer try/catch in `main.ts` reads this off `toolState` when
4
+ * the activity-timeout watchdog wins the race against the harness's own
5
+ * catch — the bare timer reject reason ("activity timeout: no output for
6
+ * 302s") tells the user nothing actionable, but `recentStderr` +
7
+ * `lastProviderError` together usually point straight at the upstream cause.
8
+ *
9
+ * `recentStderr` is shared by reference with the harness's bounded ring
10
+ * buffer, so the diagnostic always reflects the latest captured tail.
11
+ */
12
+ export type AgentDiagnostic = {
13
+ /** display label for the agent, e.g. "Pullfrog". used in the headline. */
14
+ label: string;
15
+ /** shared reference to the harness's bounded stderr ring buffer. */
16
+ recentStderr: string[];
17
+ /** most-recent provider-error label from `detectProviderError`, if any. */
18
+ lastProviderError: string | undefined;
19
+ /** count of stdout events successfully parsed before the failure. */
20
+ eventCount: number;
21
+ };
22
+ /**
23
+ * Build a user-facing markdown body for an agent hang or failure.
24
+ *
25
+ * Rendered into both the PR progress comment and the GitHub Actions job
26
+ * summary. Returns `null` when no diagnostic is available, which signals to
27
+ * the caller to fall back to its bare-error rendering.
28
+ *
29
+ * `errorMessage` is the underlying timer / spawn reject string (e.g.
30
+ * `activity timeout: no output for 301s`). The idle seconds are parsed out
31
+ * of it for the hang explanation — total runtime would overstate the stall
32
+ * for runs that streamed for a long time before going quiet.
33
+ */
34
+ export declare function formatAgentHangBody(input: {
35
+ diagnostic: AgentDiagnostic | undefined;
36
+ isHang: boolean;
37
+ errorMessage: string;
38
+ }): string | null;
@@ -44,4 +44,31 @@ export declare function setGitAuthServer(server: GitAuthServer): void;
44
44
  * await $git("push", ["-u", "origin", "feature"], { token });
45
45
  */
46
46
  export declare function $git(subcommand: SafeGitSubcommand, args: string[], options: GitAuthOptions): Promise<GitResult>;
47
+ /**
48
+ * shallow-clone unreachable: when an existing local depth is too shallow for
49
+ * git to traverse to the requested ref's ancestry, the remote walk fails with
50
+ * one of these wordings (git emits the full OID via oid_to_hex, so the bound
51
+ * is 40 for SHA-1 or 64 for SHA-256). detecting both lets a single deepen
52
+ * retry recover before the error reaches the agent — see issue #564 for the
53
+ * original `git_fetch` precedent and #656 for the `checkout_pr` follow-up.
54
+ */
55
+ export declare const SHALLOW_UNREACHABLE_PATTERNS: RegExp[];
56
+ /**
57
+ * large enough to clear the merge base on most real-world PRs without
58
+ * downloading the full history; matches the fallback used by
59
+ * `checkoutPrBranch` when the GitHub compare API is unavailable.
60
+ */
61
+ export declare const DEEPEN_RETRY_DEPTH = 1000;
62
+ /**
63
+ * authenticated `git fetch` that recovers from shallow-unreachable errors
64
+ * by retrying once with `--deepen=1000`. callers pass the same args they
65
+ * would to `$git("fetch", ...)`; on shallow-unreachable failures in a
66
+ * shallow repo, the second attempt prepends `--deepen=N` and strips any
67
+ * caller-supplied `--depth=` (the two flags are mutually exclusive, and
68
+ * the caller's depth is what got us into this mess).
69
+ *
70
+ * non-shallow-unreachable errors and non-shallow repos rethrow unchanged,
71
+ * so this is safe to wrap any fetch without changing fast-path behavior.
72
+ */
73
+ export declare function $gitFetchWithDeepen(args: string[], options: GitAuthOptions, label?: string): Promise<GitResult>;
47
74
  export {};
@@ -1,2 +1,13 @@
1
+ /**
2
+ * Result of a provider-error scan: the classification label plus a
3
+ * human-readable excerpt centered on the matched line. The excerpt is what
4
+ * gets surfaced in `» provider error detected (...)` log lines — see
5
+ * `extractExcerpt` for the windowing/byte-cap policy.
6
+ */
7
+ export type ProviderErrorMatch = {
8
+ label: string;
9
+ excerpt: string;
10
+ };
11
+ export declare function findProviderErrorMatch(text: string): ProviderErrorMatch | null;
1
12
  export declare function detectProviderError(text: string): string | null;
2
13
  export declare function isRouterKeylimitExhaustedError(text: string): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pullfrog",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "pullfrog": "dist/cli.mjs",