pullfrog 0.1.29 → 0.1.31
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/agents/claudePretoolGate.d.ts +5 -1
- package/dist/agents/opencodePlugin.d.ts +2 -2
- package/dist/agents/postRun.d.ts +8 -31
- package/dist/agents/shared.d.ts +6 -0
- package/dist/agents/subagentToolGates.d.ts +22 -40
- package/dist/cli.mjs +63989 -59666
- package/dist/external.d.ts +45 -2
- package/dist/index.js +62509 -58186
- package/dist/internal/index.d.ts +2 -2
- package/dist/internal.js +99 -33
- package/dist/mcp/checkSuite.d.ts +3 -1
- package/dist/mcp/checkout.d.ts +4 -2
- package/dist/mcp/comment.d.ts +12 -4
- package/dist/mcp/commitInfo.d.ts +3 -1
- package/dist/mcp/dependencies.d.ts +6 -2
- package/dist/mcp/git.d.ts +32 -6
- package/dist/mcp/issue.d.ts +26 -1
- package/dist/mcp/issueComments.d.ts +3 -1
- package/dist/mcp/issueEvents.d.ts +3 -1
- package/dist/mcp/issueInfo.d.ts +3 -1
- package/dist/mcp/labels.d.ts +16 -1
- package/dist/mcp/output.d.ts +6 -2
- package/dist/mcp/pr.d.ts +19 -2
- package/dist/mcp/prInfo.d.ts +3 -1
- package/dist/mcp/resolveRepoCtx.d.ts +34 -0
- package/dist/mcp/review.d.ts +9 -3
- package/dist/mcp/reviewComments.d.ts +9 -3
- package/dist/mcp/selectMode.d.ts +3 -1
- package/dist/mcp/server.d.ts +7 -1
- package/dist/mcp/shared.d.ts +18 -1
- package/dist/mcp/shell.d.ts +6 -2
- package/dist/mcp/upload.d.ts +3 -1
- package/dist/mcp/xrepo.d.ts +15 -0
- package/dist/models.d.ts +58 -5
- package/dist/modes.d.ts +1 -1
- package/dist/toolState.d.ts +66 -16
- package/dist/utils/apiCommit.d.ts +40 -0
- package/dist/utils/apiKeys.d.ts +19 -0
- package/dist/utils/buildPullfrogFooter.d.ts +27 -0
- package/dist/utils/claudeSubscription.d.ts +30 -0
- package/dist/utils/errorReport.d.ts +2 -2
- package/dist/utils/github.d.ts +28 -2
- package/dist/utils/instructions.d.ts +11 -0
- package/dist/utils/isTransientNetworkError.d.ts +10 -0
- package/dist/utils/learnings.d.ts +14 -0
- package/dist/utils/modelAccess.d.ts +64 -0
- package/dist/utils/openCodeModels.d.ts +2 -2
- package/dist/utils/payload.d.ts +16 -0
- package/dist/utils/proxy.d.ts +3 -5
- package/dist/utils/runContext.d.ts +4 -0
- package/dist/utils/runContextData.d.ts +10 -0
- package/dist/utils/runErrorRenderer.d.ts +2 -2
- package/dist/utils/setup.d.ts +18 -3
- package/dist/utils/token.d.ts +22 -3
- package/dist/yes/index.d.ts +32 -0
- package/dist/yes/standard-schema.d.ts +117 -0
- package/dist/yes.js +1244 -0
- package/package.json +19 -10
- package/dist/utils/byokFallback.d.ts +0 -44
- package/dist/utils/retry.d.ts +0 -13
|
@@ -39,7 +39,11 @@
|
|
|
39
39
|
* `#!/usr/bin/env node` shebang and the executable bit set by the harness.
|
|
40
40
|
*/
|
|
41
41
|
export declare const CLAUDE_PRETOOL_GATE_FILENAME: "pullfrog-pretool-gate.mjs";
|
|
42
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Build the gate script source, embedding the run's derived denied-tool set
|
|
44
|
+
* (see `subagentDeniedToolNames` in action/agents/subagentToolGates.ts).
|
|
45
|
+
*/
|
|
46
|
+
export declare function buildClaudePretoolGateSource(deniedTools: readonly string[]): string;
|
|
43
47
|
/**
|
|
44
48
|
* Settings JSON shape registered via `claude --settings <path>`. The
|
|
45
49
|
* matcher `^mcp__pullfrog__` is treated as a regex by claude-code's
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
*
|
|
32
32
|
* The subagent gate (the `tool.execute.before` hook that hard-blocks
|
|
33
33
|
* state-mutating MCP tool calls from a subagent session) lives in a SEPARATE
|
|
34
|
-
* plugin — `
|
|
34
|
+
* plugin — `buildOpencodeSubagentGateSource` below — because it's the
|
|
35
35
|
* load-bearing security fence and must ship into both opencode harnesses,
|
|
36
36
|
* whereas this events re-emitter is only needed by the legacy `opencode.ts`
|
|
37
37
|
* CLI-parsing path (the active `opencode_v2.ts` reads subagent events directly
|
|
@@ -82,4 +82,4 @@ export declare const PULLFROG_OPENCODE_PLUGIN_SOURCE: string;
|
|
|
82
82
|
* PR #796 (action/mcp/checkout.ts, action/mcp/git.ts). Deny-list source of
|
|
83
83
|
* truth: `action/agents/subagentToolGates.ts`.
|
|
84
84
|
*/
|
|
85
|
-
export declare
|
|
85
|
+
export declare function buildOpencodeSubagentGateSource(deniedTools: readonly string[]): string;
|
package/dist/agents/postRun.d.ts
CHANGED
|
@@ -67,39 +67,16 @@ export declare function finalizeAgentResult<R extends AgentResult>(params: {
|
|
|
67
67
|
ctx: AgentRunContext;
|
|
68
68
|
result: R;
|
|
69
69
|
}): Promise<R>;
|
|
70
|
-
export declare function shouldRunReflection(mode: string | undefined): boolean;
|
|
71
70
|
/**
|
|
72
|
-
*
|
|
73
|
-
* the
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* fire rate substantially.
|
|
80
|
-
*
|
|
81
|
-
* the file is the single source of truth — there is no separate MCP tool
|
|
82
|
-
* call. the server reads the file at end-of-run and persists any edits to
|
|
83
|
-
* `Repo.learnings`.
|
|
84
|
-
*
|
|
85
|
-
* the prompt copy is shaped by repo-wide audits of the actual content the
|
|
86
|
-
* agent has been writing (issue #619 in pullfrog/app). recurring failure
|
|
87
|
-
* modes the framing pushes back on:
|
|
88
|
-
* - massive multi-paragraph "bullets" that are really mini-articles
|
|
89
|
-
* - facts anchored to moving repo state (PR / review / commit / branch
|
|
90
|
-
* refs, dates, version pins, line numbers) that decay within weeks
|
|
91
|
-
* - sections growing into giant flat lists with no internal structure,
|
|
92
|
-
* forcing future runs to read kilobytes to find one fact
|
|
93
|
-
*
|
|
94
|
-
* single litmus delivered in the prompt: "would a future run on this repo
|
|
95
|
-
* do its work better because this bullet exists?". tool-quirk workarounds
|
|
96
|
-
* are explicitly allowed when the agent burned calls discovering the
|
|
97
|
-
* quirk this run — recording the workaround prevents next run from
|
|
98
|
-
* repeating the waste. tradeoff: the same quirk gets duplicated across
|
|
99
|
-
* repos, so when a quirk is fixed upstream in tool descriptions the
|
|
100
|
-
* per-repo bullets go stale and we have no batch-invalidation path.
|
|
71
|
+
* the combined post-run reflection nudge for a run: the repo-level learnings
|
|
72
|
+
* reflection, plus the org-level cross-repo reflection when this is an --xrepo
|
|
73
|
+
* run. each half is gated on its own seeded file — the two seeds are
|
|
74
|
+
* independent best-effort steps in main.ts, so a failed repo-learnings seed
|
|
75
|
+
* must not also suppress an org-level cross-repo reflection that did seed.
|
|
76
|
+
* returns undefined when reflection should be skipped (neither file seeded, or
|
|
77
|
+
* a reflection-skip mode like IncrementalReview).
|
|
101
78
|
*/
|
|
102
|
-
export declare function
|
|
79
|
+
export declare function buildReflectionPrompt(toolState: ToolState): string | undefined;
|
|
103
80
|
/**
|
|
104
81
|
* shared post-run retry loop used by every agent harness.
|
|
105
82
|
*
|
package/dist/agents/shared.d.ts
CHANGED
|
@@ -92,6 +92,12 @@ export interface AgentRunContext {
|
|
|
92
92
|
tmpdir: string;
|
|
93
93
|
/** harness-owned secret paths that agent filesystem tools must never read. */
|
|
94
94
|
secretDenyPaths?: string[] | undefined;
|
|
95
|
+
/**
|
|
96
|
+
* canonical bare names of state-mutating MCP tools the subagent gate must
|
|
97
|
+
* deny (derived from each tool's `mutates` flag). embedded into the per-run
|
|
98
|
+
* gate scripts. see action/agents/subagentToolGates.ts.
|
|
99
|
+
*/
|
|
100
|
+
subagentDeniedTools: readonly string[];
|
|
95
101
|
instructions: ResolvedInstructions;
|
|
96
102
|
todoTracker?: TodoTracker | undefined;
|
|
97
103
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Single source of truth for MCP tools subagents are forbidden from
|
|
2
|
+
* Single source of truth for which MCP tools subagents are forbidden from
|
|
3
|
+
* calling — derived from each tool's `mutates` flag, not a hand-maintained list.
|
|
3
4
|
*
|
|
4
5
|
* Subagents share the orchestrator's in-process git working tree, `toolState`,
|
|
5
6
|
* progress comment, and run-scoped pr/branch context. A subagent that calls
|
|
@@ -8,48 +9,29 @@
|
|
|
8
9
|
* `zed-industries/cloud` incident hit exactly this: a `reviewfrog` lens
|
|
9
10
|
* dispatched `checkout_pr({2582})` mid-review, the orchestrator's next push
|
|
10
11
|
* clobbered an unrelated engineer's branch. PR #796 added runtime backstops
|
|
11
|
-
* inside `checkout_pr`/`push_branch`; this
|
|
12
|
-
*
|
|
12
|
+
* inside `checkout_pr`/`push_branch`; this gate stops the call from ever
|
|
13
|
+
* reaching MCP when it originates from a subagent.
|
|
13
14
|
*
|
|
14
|
-
* The
|
|
15
|
+
* The denied set is whatever the run actually registers with `mutates: true`
|
|
16
|
+
* (see `action/mcp/shared.ts`). To deny a new state-changing MCP tool to
|
|
17
|
+
* subagents, mark it `mutates: true` at its definition — nothing to add here.
|
|
18
|
+
* Read-only tools (`get_*`, `list_*`, `git_fetch`, …) and the general-purpose
|
|
19
|
+
* `git`/`shell` execution tools are intentionally unmarked: denying them would
|
|
20
|
+
* make review impossible, and their mutations are gated by command-arg
|
|
21
|
+
* validation plus the reviewer system prompt (`action/agents/reviewer.ts`).
|
|
22
|
+
*
|
|
23
|
+
* The gate is enforced at two pre-tool hooks, each fed this derived list:
|
|
15
24
|
* - opencode: `tool.execute.before` (action/agents/opencodePlugin.ts)
|
|
16
25
|
* - claude: `PreToolUse` settings hook (action/agents/claudePretoolGate.ts)
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* - claude: `mcp__pullfrog__<name>`
|
|
21
|
-
* - opencode: `pullfrog_<name>`
|
|
22
|
-
* The hooks strip those prefixes before comparing.
|
|
23
|
-
*
|
|
24
|
-
* Read-only MCP tools (`get_*`, `list_*`, `git_fetch`, `get_check_suite_logs`,
|
|
25
|
-
* `await_dependency_installation`, etc.) and the `git`/`shell` tools stay off
|
|
26
|
-
* this list — denying them would make review work impossible. The reviewer system prompt
|
|
27
|
-
* (`action/agents/reviewer.ts`) already forbids state-changing shell/git
|
|
28
|
-
* subcommands as a prose constraint; this list is the belt-and-suspenders
|
|
29
|
-
* machine fence for the high-stakes mutations we can identify by name alone.
|
|
30
|
-
*
|
|
31
|
-
* When adding a state-changing MCP tool to `action/mcp/server.ts`, add its
|
|
32
|
-
* canonical name here too. Inclusions justified inline.
|
|
33
|
-
*/
|
|
34
|
-
export declare const SUBAGENT_DENIED_TOOLS: readonly ["checkout_pr", "push_branch", "push_tags", "delete_branch", "create_pull_request", "update_pull_request_body", "create_issue", "create_issue_comment", "edit_issue_comment", "reply_to_review_comment", "create_pull_request_review", "resolve_review_thread", "add_labels", "set_output", "report_progress", "select_mode", "start_dependency_installation", "kill_background", "upload_file"];
|
|
35
|
-
export type SubagentDeniedTool = (typeof SUBAGENT_DENIED_TOOLS)[number];
|
|
36
|
-
/**
|
|
37
|
-
* Strip the runtime-specific MCP prefix from a tool name and return the
|
|
38
|
-
* canonical bare name (matching FastMCP's `name:` field). Returns the input
|
|
39
|
-
* unchanged if it doesn't carry a known prefix — keeping comparison simple
|
|
40
|
-
* for native (non-MCP) tools, which never appear on the deny list anyway.
|
|
41
|
-
*/
|
|
42
|
-
export declare function stripMcpPrefix(toolName: string): string;
|
|
43
|
-
/**
|
|
44
|
-
* Whether `toolName` (in any runtime's prefix style) names a tool that
|
|
45
|
-
* subagents must not call.
|
|
26
|
+
* Names are the canonical bare form (the FastMCP tool `name`). Each runtime
|
|
27
|
+
* presents them with a different prefix (`mcp__pullfrog__<name>` for claude,
|
|
28
|
+
* `pullfrog_<name>` for opencode); the hooks strip the prefix before comparing.
|
|
46
29
|
*/
|
|
47
|
-
|
|
30
|
+
import { type ToolContext } from "../mcp/server.ts";
|
|
48
31
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
* tool directly).
|
|
32
|
+
* Canonical bare names of every state-mutating MCP tool registered for this
|
|
33
|
+
* run — the set subagents are denied. Derived from the `mutates` flag so it can
|
|
34
|
+
* never silently drift from the registered tool set. Throws if it derives empty
|
|
35
|
+
* (a sign the flag plumbing broke) rather than starting with the gate disabled.
|
|
54
36
|
*/
|
|
55
|
-
export declare function
|
|
37
|
+
export declare function subagentDeniedToolNames(ctx: ToolContext, outputSchema?: Record<string, unknown>): string[];
|