pullfrog 0.1.6 → 0.1.7
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/postRun.d.ts +21 -0
- package/dist/agents/subagentModels.d.ts +19 -0
- package/dist/cli.mjs +390 -177
- package/dist/index.js +385 -174
- package/dist/internal.js +150 -60
- package/dist/models.d.ts +63 -3
- package/dist/utils/agent.d.ts +5 -2
- package/dist/utils/apiKeys.d.ts +18 -0
- package/dist/utils/instructions.d.ts +19 -0
- package/dist/utils/learnings.d.ts +20 -9
- package/dist/utils/runContext.d.ts +16 -0
- package/package.json +1 -1
|
@@ -4,23 +4,34 @@
|
|
|
4
4
|
* back into future runs as durable context. Modeled on the PR-summary tmpfile
|
|
5
5
|
* pattern (see action/utils/prSummary.ts):
|
|
6
6
|
*
|
|
7
|
-
* 1. server seeds `pullfrog-learnings.md`
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
7
|
+
* 1. server seeds `pullfrog-learnings.md` with the verbatim body of
|
|
8
|
+
* `Repo.learnings` (or empty for fresh repos), and parses headings
|
|
9
|
+
* server-side (`utils/learningsToc.ts`) — the parsed TOC is rendered
|
|
10
|
+
* into the LEARNINGS prompt section, not into the file
|
|
11
|
+
* 2. the agent reads the TOC in the prompt and uses listed line ranges
|
|
12
|
+
* to read just the sections relevant to the current task — file can
|
|
13
|
+
* grow large, but only targeted ranges hit the agent's context
|
|
14
|
+
* 3. agent edits the file in place at end-of-run during the reflection
|
|
15
|
+
* turn (see action/agents/postRun.ts buildLearningsReflectionPrompt)
|
|
16
|
+
* 4. main.ts reads the file back at end-of-run and PATCHes
|
|
17
|
+
* `/api/repo/[owner]/[repo]/learnings` if the body changed
|
|
14
18
|
*
|
|
15
19
|
* Edit-in-place avoids stuffing the entire learnings list into both the
|
|
16
20
|
* prompt context and an `update_learnings` MCP tool call (which previously
|
|
17
21
|
* required passing the FULL merged list as a string parameter — an
|
|
18
22
|
* output-token tax that grew linearly with the learnings size).
|
|
23
|
+
*
|
|
24
|
+
* Section structure is agent-curated. The reflection prompt teaches
|
|
25
|
+
* hierarchy + a soft 300-line-per-section cap to keep TOC ranges
|
|
26
|
+
* agent-targetable on long-lived repos; there is no fixed taxonomy.
|
|
19
27
|
*/
|
|
20
28
|
export declare const LEARNINGS_FILE_NAME = "pullfrog-learnings.md";
|
|
21
29
|
export declare function learningsFilePath(tmpdir: string): string;
|
|
22
|
-
/** seed the learnings
|
|
23
|
-
*
|
|
30
|
+
/** seed the rolling learnings tmpfile with the verbatim DB body (or empty
|
|
31
|
+
* string for fresh repos). returns the absolute path. the parsed TOC is
|
|
32
|
+
* carried separately via `RepoSettings.learningsHeadings` and rendered
|
|
33
|
+
* into the prompt by `resolveInstructions`, so the file on disk is just
|
|
34
|
+
* the body — no markers, no scaffold, no in-file TOC. */
|
|
24
35
|
export declare function seedLearningsFile(params: {
|
|
25
36
|
tmpdir: string;
|
|
26
37
|
current: string | null;
|
|
@@ -6,6 +6,21 @@ export interface Mode {
|
|
|
6
6
|
description: string;
|
|
7
7
|
prompt: string;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* server-parsed TOC entry for `Repo.learnings`. depth is 1-6 (h1-h6),
|
|
11
|
+
* line numbers are 1-indexed against the raw body. computed by
|
|
12
|
+
* `parseLearningsHeadings` in `utils/learningsToc.ts` (server side) and
|
|
13
|
+
* shipped over the run-context JSON boundary; the canonical declaration
|
|
14
|
+
* lives there. duplicated here because the action runtime can't reach
|
|
15
|
+
* across into the proprietary root-level codebase, and the JSON wire
|
|
16
|
+
* means typecheck can't enforce shape equality across both sides.
|
|
17
|
+
*/
|
|
18
|
+
export interface LearningsHeading {
|
|
19
|
+
depth: 1 | 2 | 3 | 4 | 5 | 6;
|
|
20
|
+
title: string;
|
|
21
|
+
startLine: number;
|
|
22
|
+
endLine: number;
|
|
23
|
+
}
|
|
9
24
|
export interface RepoSettings {
|
|
10
25
|
model: string | null;
|
|
11
26
|
modes: Mode[];
|
|
@@ -18,6 +33,7 @@ export interface RepoSettings {
|
|
|
18
33
|
prApproveEnabled: boolean;
|
|
19
34
|
modeInstructions: Record<string, string>;
|
|
20
35
|
learnings: string | null;
|
|
36
|
+
learningsHeadings: LearningsHeading[];
|
|
21
37
|
envAllowlist: string | null;
|
|
22
38
|
}
|
|
23
39
|
/**
|