pullfrog 0.1.0 → 0.1.2
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/opencodePlugin.d.ts +60 -0
- package/dist/agents/postRun.d.ts +12 -8
- package/dist/agents/shared.d.ts +7 -0
- package/dist/cli.mjs +396 -129
- package/dist/index.js +393 -126
- package/dist/internal.js +4 -17
- package/dist/mcp/server.d.ts +3 -0
- package/dist/utils/apiUrl.d.ts +8 -0
- package/dist/utils/instructions.d.ts +4 -1
- package/dist/utils/learnings.d.ts +31 -0
- package/dist/utils/subprocess.d.ts +1 -0
- package/package.json +1 -1
- package/dist/mcp/learnings.d.ts +0 -6
package/dist/internal.js
CHANGED
|
@@ -463,9 +463,6 @@ Rules:
|
|
|
463
463
|
- Do NOT include a changelog section \u2014 the key changes list serves this purpose
|
|
464
464
|
- Focus on *intent*, not *what* \u2014 the diff already shows what changed
|
|
465
465
|
- Get the file count and commit count from the checkout_pr metadata, not by counting manually`;
|
|
466
|
-
function learningsStep(t, n) {
|
|
467
|
-
return `${n}. **learnings** (only if high confidence): if you discovered something about repo setup, test commands, conventions, or patterns that you are confident is correct and would reliably help future runs, call \`${t("update_learnings")}\` to persist it. skip this step if you are unsure or the finding is speculative/one-off. format as a flat bullet list (\`- \` per line, one fact per bullet). merge with existing learnings from the prompt \u2014 pass the FULL merged list. deduplicate, and drop bullets that are clearly wrong or no longer relevant to the current codebase.`;
|
|
468
|
-
}
|
|
469
466
|
function computeModes(agentId) {
|
|
470
467
|
const t = (toolName) => formatMcpToolRef(agentId, toolName);
|
|
471
468
|
return [
|
|
@@ -521,8 +518,6 @@ function computeModes(agentId) {
|
|
|
521
518
|
- create a PR via \`${t("create_pull_request")}\`
|
|
522
519
|
- call \`${t("report_progress")}\` with the PR link or the exact error if push/PR failed
|
|
523
520
|
|
|
524
|
-
${learningsStep(t, 6)}
|
|
525
|
-
|
|
526
521
|
### Notes
|
|
527
522
|
|
|
528
523
|
For simple, well-defined tasks, skip the plan phase and go straight to build.`
|
|
@@ -550,9 +545,7 @@ For simple, well-defined tasks, skip the plan phase and go straight to build.`
|
|
|
550
545
|
- confirm a clean working tree, then push via \`${t("push_branch")}\` (same push/prepush guidance as Build mode in *SYSTEM*)
|
|
551
546
|
- reply to each comment using \`${t("reply_to_review_comment")}\`
|
|
552
547
|
- resolve addressed threads via \`${t("resolve_review_thread")}\`
|
|
553
|
-
- call \`${t("report_progress")}\` with a brief summary (or the exact push error if push failed)
|
|
554
|
-
|
|
555
|
-
${learningsStep(t, 6)}`
|
|
548
|
+
- call \`${t("report_progress")}\` with a brief summary (or the exact push error if push failed)`
|
|
556
549
|
},
|
|
557
550
|
// Review and IncrementalReview use the multi-lens orchestrator pattern
|
|
558
551
|
// (canonical source: .claude/commands/anneal.md). The orchestrator does
|
|
@@ -723,9 +716,7 @@ ${PR_SUMMARY_FORMAT}`
|
|
|
723
716
|
|
|
724
717
|
2. Produce a structured, actionable plan with clear milestones.
|
|
725
718
|
|
|
726
|
-
3. Call \`${t("report_progress")}\` with the plan
|
|
727
|
-
|
|
728
|
-
${learningsStep(t, 4)}`
|
|
719
|
+
3. Call \`${t("report_progress")}\` with the plan.`
|
|
729
720
|
},
|
|
730
721
|
{
|
|
731
722
|
name: "Fix",
|
|
@@ -747,9 +738,7 @@ ${learningsStep(t, 4)}`
|
|
|
747
738
|
|
|
748
739
|
5. Finalize:
|
|
749
740
|
- confirm a clean working tree, then push via \`${t("push_branch")}\` (same push/prepush guidance as Build mode in *SYSTEM*)
|
|
750
|
-
- call \`${t("report_progress")}\` with the diagnosis and fix summary (or the exact push error if push failed)
|
|
751
|
-
|
|
752
|
-
${learningsStep(t, 6)}`
|
|
741
|
+
- call \`${t("report_progress")}\` with the diagnosis and fix summary (or the exact push error if push failed)`
|
|
753
742
|
},
|
|
754
743
|
{
|
|
755
744
|
name: "ResolveConflicts",
|
|
@@ -793,9 +782,7 @@ ${learningsStep(t, 6)}`
|
|
|
793
782
|
3. Finalize:
|
|
794
783
|
- if code changes were made, push to a pull request (new or existing) using \`${t("push_branch")}\` and \`${t("create_pull_request")}\` as needed. \`git status\` must be clean before you finish (see *SYSTEM* Git rules if push fails).
|
|
795
784
|
- call \`${t("report_progress")}\` once with results \u2014 include exact tool errors if push or PR creation failed
|
|
796
|
-
- if the task involved labeling, commenting, or other GitHub operations, perform those directly
|
|
797
|
-
|
|
798
|
-
${learningsStep(t, 4)}`
|
|
785
|
+
- if the task involved labeling, commenting, or other GitHub operations, perform those directly`
|
|
799
786
|
}
|
|
800
787
|
];
|
|
801
788
|
}
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -60,6 +60,9 @@ export interface ToolState {
|
|
|
60
60
|
summaryFilePath?: string;
|
|
61
61
|
summarySeed?: string;
|
|
62
62
|
summaryPersistAttempted?: boolean;
|
|
63
|
+
learningsFilePath?: string;
|
|
64
|
+
learningsSeed?: string;
|
|
65
|
+
learningsPersistAttempted?: boolean;
|
|
63
66
|
output?: string;
|
|
64
67
|
usageEntries: AgentUsage[];
|
|
65
68
|
model?: string | undefined;
|
package/dist/utils/apiUrl.d.ts
CHANGED
|
@@ -7,3 +7,11 @@
|
|
|
7
7
|
* enforces https:// for non-local URLs to prevent cleartext credential transmission.
|
|
8
8
|
*/
|
|
9
9
|
export declare function getApiUrl(): string;
|
|
10
|
+
/**
|
|
11
|
+
* true when the action is configured to talk to a localhost API server (i.e.
|
|
12
|
+
* `pnpm dev` running on the developer's box). signals we can use dev-only
|
|
13
|
+
* affordances like the `x-dev-repo` proxy-token bypass — the corresponding
|
|
14
|
+
* server-side dev gates (`NODE_ENV === "development"`) ensure these paths
|
|
15
|
+
* never activate against prod regardless of what the action does.
|
|
16
|
+
*/
|
|
17
|
+
export declare function isLocalApiUrl(): boolean;
|
|
@@ -8,7 +8,10 @@ interface InstructionsContext {
|
|
|
8
8
|
modes: Mode[];
|
|
9
9
|
agentId: AgentId;
|
|
10
10
|
outputSchema?: Record<string, unknown> | undefined;
|
|
11
|
-
learnings
|
|
11
|
+
/** absolute path to the seeded learnings tmpfile, or null when the file
|
|
12
|
+
* couldn't be seeded for some reason. main.ts always seeds, so in
|
|
13
|
+
* practice this is always set; the null case keeps the type honest. */
|
|
14
|
+
learningsFilePath: string | null;
|
|
12
15
|
}
|
|
13
16
|
export interface ResolvedInstructions {
|
|
14
17
|
full: string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Repo-level learnings — operational facts about a repo (setup steps, test
|
|
3
|
+
* commands, conventions, gotchas) that accumulate across agent runs and feed
|
|
4
|
+
* back into future runs as durable context. Modeled on the PR-summary tmpfile
|
|
5
|
+
* pattern (see action/utils/prSummary.ts):
|
|
6
|
+
*
|
|
7
|
+
* 1. server seeds `pullfrog-learnings.md` from `Repo.learnings` (or empty
|
|
8
|
+
* when the repo has none yet)
|
|
9
|
+
* 2. the agent reads the file at startup as part of its context, and may
|
|
10
|
+
* edit it in place at end-of-run when prompted by the reflection turn
|
|
11
|
+
* 3. main.ts reads the file back at end-of-run and PATCHes
|
|
12
|
+
* `/api/repo/[owner]/[repo]/learnings` if it changed (byte-trim equality
|
|
13
|
+
* against the seed determines change detection)
|
|
14
|
+
*
|
|
15
|
+
* Edit-in-place avoids stuffing the entire learnings list into both the
|
|
16
|
+
* prompt context and an `update_learnings` MCP tool call (which previously
|
|
17
|
+
* required passing the FULL merged list as a string parameter — an
|
|
18
|
+
* output-token tax that grew linearly with the learnings size).
|
|
19
|
+
*/
|
|
20
|
+
export declare const LEARNINGS_FILE_NAME = "pullfrog-learnings.md";
|
|
21
|
+
export declare function learningsFilePath(tmpdir: string): string;
|
|
22
|
+
/** seed the learnings file with the repo's current learnings, or an empty
|
|
23
|
+
* file when the repo has none yet. returns the absolute path. */
|
|
24
|
+
export declare function seedLearningsFile(params: {
|
|
25
|
+
tmpdir: string;
|
|
26
|
+
current: string | null;
|
|
27
|
+
}): Promise<string>;
|
|
28
|
+
/** read the agent-edited learnings file. returns null when the file is
|
|
29
|
+
* missing or unreadable (treated as "no change"). caps content at the
|
|
30
|
+
* server's max length to avoid a 400 round-trip. */
|
|
31
|
+
export declare function readLearningsFile(path: string): Promise<string | null>;
|
package/package.json
CHANGED
package/dist/mcp/learnings.d.ts
DELETED