pullfrog 0.0.196 → 0.0.198
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/claude.d.ts +1 -0
- package/dist/agents/index.d.ts +6 -0
- package/dist/agents/opentoad.d.ts +1 -0
- package/dist/agents/shared.d.ts +46 -0
- package/dist/cli.mjs +6 -9
- package/dist/external.d.ts +213 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +151703 -0
- package/dist/internal/index.d.ts +12 -0
- package/dist/internal.js +681 -0
- package/dist/lifecycle.d.ts +2 -0
- package/dist/main.d.ts +8 -0
- package/dist/mcp/arkConfig.d.ts +1 -0
- package/dist/mcp/checkSuite.d.ts +9 -0
- package/dist/mcp/checkout.d.ts +63 -0
- package/dist/mcp/comment.d.ts +87 -0
- package/dist/mcp/commitInfo.d.ts +9 -0
- package/dist/mcp/dependencies.d.ts +3 -0
- package/dist/mcp/git.d.ts +38 -0
- package/dist/mcp/issue.d.ts +18 -0
- package/dist/mcp/issueComments.d.ts +9 -0
- package/dist/mcp/issueEvents.d.ts +9 -0
- package/dist/mcp/issueInfo.d.ts +9 -0
- package/dist/mcp/labels.d.ts +12 -0
- package/dist/mcp/learnings.d.ts +6 -0
- package/dist/mcp/output.d.ts +12 -0
- package/dist/mcp/pr.d.ts +29 -0
- package/dist/mcp/prInfo.d.ts +9 -0
- package/dist/mcp/review.d.ts +47 -0
- package/dist/mcp/reviewComments.d.ts +135 -0
- package/dist/mcp/selectMode.d.ts +24 -0
- package/dist/mcp/server.d.ts +93 -0
- package/dist/mcp/shared.d.ts +21 -0
- package/dist/mcp/shell.d.ts +32 -0
- package/dist/mcp/upload.d.ts +6 -0
- package/dist/models.d.ts +69 -0
- package/dist/modes.d.ts +9 -0
- package/dist/prep/index.d.ts +7 -0
- package/dist/prep/installNodeDependencies.d.ts +2 -0
- package/dist/prep/installPythonDependencies.d.ts +2 -0
- package/dist/prep/types.d.ts +29 -0
- package/dist/utils/activity.d.ts +21 -0
- package/dist/utils/agent.d.ts +15 -0
- package/dist/utils/apiFetch.d.ts +19 -0
- package/dist/utils/apiKeys.d.ts +10 -0
- package/dist/utils/apiUrl.d.ts +9 -0
- package/dist/utils/body.d.ts +16 -0
- package/dist/utils/browser.d.ts +21 -0
- package/dist/utils/buildPullfrogFooter.d.ts +30 -0
- package/dist/utils/cli.d.ts +10 -0
- package/dist/utils/errorReport.d.ts +8 -0
- package/dist/utils/exitHandler.d.ts +8 -0
- package/dist/utils/fixDoubleEscapedString.d.ts +1 -0
- package/dist/utils/gitAuth.d.ts +47 -0
- package/dist/utils/gitAuthServer.d.ts +18 -0
- package/dist/utils/github.d.ts +78 -0
- package/dist/utils/globals.d.ts +3 -0
- package/dist/utils/install.d.ts +60 -0
- package/dist/utils/instructions.d.ts +22 -0
- package/dist/utils/lifecycle.d.ts +9 -0
- package/dist/utils/log.d.ts +92 -0
- package/dist/utils/normalizeEnv.d.ts +10 -0
- package/dist/utils/payload.d.ts +41 -0
- package/dist/utils/providerErrors.d.ts +1 -0
- package/dist/utils/rangeDiff.d.ts +51 -0
- package/dist/utils/retry.d.ts +7 -0
- package/dist/utils/reviewCleanup.d.ts +14 -0
- package/dist/utils/run.d.ts +9 -0
- package/dist/utils/runContext.d.ts +36 -0
- package/dist/utils/runContextData.d.ts +24 -0
- package/dist/utils/secrets.d.ts +17 -0
- package/dist/utils/setup.d.ts +33 -0
- package/dist/utils/shell.d.ts +32 -0
- package/dist/utils/skills.d.ts +6 -0
- package/dist/utils/subprocess.d.ts +32 -0
- package/dist/utils/time.d.ts +14 -0
- package/dist/utils/timer.d.ts +12 -0
- package/dist/utils/todoTracking.d.ts +14 -0
- package/dist/utils/token.d.ts +40 -0
- package/dist/utils/version.d.ts +2 -0
- package/dist/utils/versioning.d.ts +7 -0
- package/dist/utils/workflow.d.ts +14 -0
- package/package.json +5 -8
package/dist/main.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
export declare const GetCheckSuiteLogs: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
check_suite_id: number;
|
|
4
|
+
}, {}>;
|
|
5
|
+
export declare function GetCheckSuiteLogsTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
6
|
+
check_suite_id: number;
|
|
7
|
+
}, {
|
|
8
|
+
check_suite_id: number;
|
|
9
|
+
}>>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { RestEndpointMethodTypes } from "@octokit/rest";
|
|
2
|
+
import type { ToolContext } from "./server.ts";
|
|
3
|
+
type PullFile = RestEndpointMethodTypes["pulls"]["listFiles"]["response"]["data"][number];
|
|
4
|
+
export type FormatFilesResult = {
|
|
5
|
+
content: string;
|
|
6
|
+
toc: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* formats PR files with explicit line numbers for each code line.
|
|
10
|
+
* preserves all original diff info (file headers, hunk headers) and adds:
|
|
11
|
+
* | OLD | NEW | TYPE | code
|
|
12
|
+
* returns both the formatted content and a TOC with line ranges per file.
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatFilesWithLineNumbers(files: PullFile[]): FormatFilesResult;
|
|
15
|
+
export declare const CheckoutPr: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
16
|
+
pull_number: number;
|
|
17
|
+
}, {}>;
|
|
18
|
+
export type CheckoutPrResult = {
|
|
19
|
+
success: true;
|
|
20
|
+
number: number;
|
|
21
|
+
title: string;
|
|
22
|
+
base: string;
|
|
23
|
+
localBranch: string;
|
|
24
|
+
remoteBranch: string;
|
|
25
|
+
isFork: boolean;
|
|
26
|
+
maintainerCanModify: boolean;
|
|
27
|
+
url: string;
|
|
28
|
+
headRepo: string;
|
|
29
|
+
diffPath: string;
|
|
30
|
+
incrementalDiffPath?: string | undefined;
|
|
31
|
+
toc: string;
|
|
32
|
+
instructions: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* fetches PR files from GitHub and formats them with line numbers and TOC.
|
|
36
|
+
* this is the core diff formatting logic, extracted for testability.
|
|
37
|
+
*/
|
|
38
|
+
export declare function fetchAndFormatPrDiff(ctx: ToolContext, pullNumber: number): Promise<FormatFilesResult>;
|
|
39
|
+
import type { GitContext } from "../utils/setup.ts";
|
|
40
|
+
export type PrData = {
|
|
41
|
+
number: number;
|
|
42
|
+
headSha: string;
|
|
43
|
+
headRef: string;
|
|
44
|
+
headRepoFullName: string;
|
|
45
|
+
baseRef: string;
|
|
46
|
+
baseRepoFullName: string;
|
|
47
|
+
maintainerCanModify: boolean;
|
|
48
|
+
};
|
|
49
|
+
type CheckoutPrBranchParams = GitContext & {
|
|
50
|
+
beforeSha?: string | undefined;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Shared helper to checkout a PR branch and configure fork remotes.
|
|
54
|
+
* Assumes origin remote is already configured with authentication.
|
|
55
|
+
* Updates toolState.issueNumber, toolState.checkoutSha, and toolState.pushUrl (for fork PRs).
|
|
56
|
+
*/
|
|
57
|
+
export declare function checkoutPrBranch(pr: PrData, params: CheckoutPrBranchParams): Promise<void>;
|
|
58
|
+
export declare function CheckoutPrTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
59
|
+
pull_number: number;
|
|
60
|
+
}, {
|
|
61
|
+
pull_number: number;
|
|
62
|
+
}>>;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
type CommentNodeIdField = "planCommentNodeId" | "summaryCommentNodeId";
|
|
3
|
+
export declare function updateCommentNodeId(ctx: ToolContext, field: CommentNodeIdField, nodeId: string): Promise<void>;
|
|
4
|
+
/**
|
|
5
|
+
* The prefix text for the initial "leaping into action" comment.
|
|
6
|
+
* This is used to identify if a comment is still in its initial state
|
|
7
|
+
* and hasn't been updated with progress or error messages.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LEAPING_INTO_ACTION_PREFIX = "Leaping into action";
|
|
10
|
+
export declare function addFooter(ctx: ToolContext, body: string): string;
|
|
11
|
+
export declare const Comment: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
12
|
+
issueNumber: number;
|
|
13
|
+
body: string;
|
|
14
|
+
type?: "Plan" | "Summary" | "Comment";
|
|
15
|
+
}, {}>;
|
|
16
|
+
export declare function CreateCommentTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
17
|
+
issueNumber: number;
|
|
18
|
+
body: string;
|
|
19
|
+
type?: "Plan" | "Summary" | "Comment";
|
|
20
|
+
}, {
|
|
21
|
+
issueNumber: number;
|
|
22
|
+
body: string;
|
|
23
|
+
type?: "Plan" | "Summary" | "Comment";
|
|
24
|
+
}>>;
|
|
25
|
+
export declare const EditComment: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
26
|
+
commentId: number;
|
|
27
|
+
body: string;
|
|
28
|
+
}, {}>;
|
|
29
|
+
export declare function EditCommentTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
30
|
+
commentId: number;
|
|
31
|
+
body: string;
|
|
32
|
+
}, {
|
|
33
|
+
commentId: number;
|
|
34
|
+
body: string;
|
|
35
|
+
}>>;
|
|
36
|
+
export declare const ReportProgress: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
37
|
+
body: string;
|
|
38
|
+
target_plan_comment?: boolean;
|
|
39
|
+
}, {}>;
|
|
40
|
+
/**
|
|
41
|
+
* Report progress to a GitHub comment.
|
|
42
|
+
*
|
|
43
|
+
* progressCommentId has three states:
|
|
44
|
+
* - undefined: no comment yet — will create one if an issue/PR target exists
|
|
45
|
+
* - number: active comment — will update it in place
|
|
46
|
+
* - null: deliberately deleted (e.g. after submitting a PR review) — skips silently
|
|
47
|
+
*
|
|
48
|
+
* The body is always tracked in lastProgressBody for the job summary regardless of comment state.
|
|
49
|
+
*/
|
|
50
|
+
export declare function reportProgress(ctx: ToolContext, params: {
|
|
51
|
+
body: string;
|
|
52
|
+
target_plan_comment?: boolean;
|
|
53
|
+
}): Promise<{
|
|
54
|
+
commentId?: number;
|
|
55
|
+
url?: string;
|
|
56
|
+
body: string;
|
|
57
|
+
action: "created" | "updated" | "skipped";
|
|
58
|
+
}>;
|
|
59
|
+
export declare function ReportProgressTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
60
|
+
body: string;
|
|
61
|
+
target_plan_comment?: boolean;
|
|
62
|
+
}, {
|
|
63
|
+
body: string;
|
|
64
|
+
target_plan_comment?: boolean;
|
|
65
|
+
}>>;
|
|
66
|
+
/**
|
|
67
|
+
* Delete the progress comment if it exists.
|
|
68
|
+
* Used by main.ts for stranded-comment cleanup (orphaned "Leaping into action" or
|
|
69
|
+
* checklist left by the todo tracker when the agent didn't call report_progress).
|
|
70
|
+
* Sets progressCommentId to null so subsequent report_progress calls are no-ops.
|
|
71
|
+
*/
|
|
72
|
+
export declare function deleteProgressComment(ctx: ToolContext): Promise<boolean>;
|
|
73
|
+
export declare const ReplyToReviewComment: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
74
|
+
pull_number: number;
|
|
75
|
+
comment_id: number;
|
|
76
|
+
body: string;
|
|
77
|
+
}, {}>;
|
|
78
|
+
export declare function ReplyToReviewCommentTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
79
|
+
pull_number: number;
|
|
80
|
+
comment_id: number;
|
|
81
|
+
body: string;
|
|
82
|
+
}, {
|
|
83
|
+
pull_number: number;
|
|
84
|
+
comment_id: number;
|
|
85
|
+
body: string;
|
|
86
|
+
}>>;
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
export declare const CommitInfo: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
sha: string;
|
|
4
|
+
}, {}>;
|
|
5
|
+
export declare function CommitInfoTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
6
|
+
sha: string;
|
|
7
|
+
}, {
|
|
8
|
+
sha: string;
|
|
9
|
+
}>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
export declare function StartDependencyInstallationTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<object, object>>;
|
|
3
|
+
export declare function AwaitDependencyInstallationTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<object, object>>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
export declare const PushBranch: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
force: import("arktype/internal/attributes.ts").Default<boolean, false>;
|
|
4
|
+
branchName?: string;
|
|
5
|
+
}, {}>;
|
|
6
|
+
export declare function PushBranchTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
7
|
+
branchName?: string;
|
|
8
|
+
force?: boolean;
|
|
9
|
+
}, {
|
|
10
|
+
branchName?: string;
|
|
11
|
+
force?: boolean;
|
|
12
|
+
}>>;
|
|
13
|
+
export declare function GitTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
14
|
+
subcommand: string;
|
|
15
|
+
args?: string[];
|
|
16
|
+
}, {
|
|
17
|
+
subcommand: string;
|
|
18
|
+
args?: string[];
|
|
19
|
+
}>>;
|
|
20
|
+
export declare function GitFetchTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
21
|
+
ref: string;
|
|
22
|
+
depth?: number;
|
|
23
|
+
}, {
|
|
24
|
+
ref: string;
|
|
25
|
+
depth?: number;
|
|
26
|
+
}>>;
|
|
27
|
+
export declare function DeleteBranchTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
28
|
+
branchName: string;
|
|
29
|
+
}, {
|
|
30
|
+
branchName: string;
|
|
31
|
+
}>>;
|
|
32
|
+
export declare function PushTagsTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
33
|
+
tag: string;
|
|
34
|
+
force?: boolean;
|
|
35
|
+
}, {
|
|
36
|
+
tag: string;
|
|
37
|
+
force?: boolean;
|
|
38
|
+
}>>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
export declare const Issue: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
title: string;
|
|
4
|
+
body: string;
|
|
5
|
+
labels?: string[];
|
|
6
|
+
assignees?: string[];
|
|
7
|
+
}, {}>;
|
|
8
|
+
export declare function IssueTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
9
|
+
title: string;
|
|
10
|
+
body: string;
|
|
11
|
+
labels?: string[];
|
|
12
|
+
assignees?: string[];
|
|
13
|
+
}, {
|
|
14
|
+
title: string;
|
|
15
|
+
body: string;
|
|
16
|
+
labels?: string[];
|
|
17
|
+
assignees?: string[];
|
|
18
|
+
}>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
export declare const GetIssueComments: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
issue_number: number;
|
|
4
|
+
}, {}>;
|
|
5
|
+
export declare function GetIssueCommentsTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
6
|
+
issue_number: number;
|
|
7
|
+
}, {
|
|
8
|
+
issue_number: number;
|
|
9
|
+
}>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
export declare const GetIssueEvents: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
issue_number: number;
|
|
4
|
+
}, {}>;
|
|
5
|
+
export declare function GetIssueEventsTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
6
|
+
issue_number: number;
|
|
7
|
+
}, {
|
|
8
|
+
issue_number: number;
|
|
9
|
+
}>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
export declare const IssueInfo: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
issue_number: number;
|
|
4
|
+
}, {}>;
|
|
5
|
+
export declare function IssueInfoTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
6
|
+
issue_number: number;
|
|
7
|
+
}, {
|
|
8
|
+
issue_number: number;
|
|
9
|
+
}>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
export declare const AddLabelsParams: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
issue_number: number;
|
|
4
|
+
labels: string[];
|
|
5
|
+
}, {}>;
|
|
6
|
+
export declare function AddLabelsTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
7
|
+
issue_number: number;
|
|
8
|
+
labels: string[];
|
|
9
|
+
}, {
|
|
10
|
+
issue_number: number;
|
|
11
|
+
labels: string[];
|
|
12
|
+
}>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StandardSchemaV1 } from "@standard-schema/spec";
|
|
2
|
+
import type { ToolContext } from "./server.ts";
|
|
3
|
+
export declare const SetOutputParams: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
4
|
+
value: string;
|
|
5
|
+
}, {}>;
|
|
6
|
+
type JsonSchema = Record<string, unknown>;
|
|
7
|
+
export declare function SetOutputTool(ctx: ToolContext, outputSchema?: JsonSchema): import("fastmcp").Tool<any, StandardSchemaV1<any, any>> | import("fastmcp").Tool<any, StandardSchemaV1<{
|
|
8
|
+
value: string;
|
|
9
|
+
}, {
|
|
10
|
+
value: string;
|
|
11
|
+
}>>;
|
|
12
|
+
export {};
|
package/dist/mcp/pr.d.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
export declare const PullRequest: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
title: string;
|
|
4
|
+
body: string;
|
|
5
|
+
base: string;
|
|
6
|
+
draft?: boolean;
|
|
7
|
+
}, {}>;
|
|
8
|
+
export declare const UpdatePullRequestBody: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
9
|
+
pull_number: number;
|
|
10
|
+
body: string;
|
|
11
|
+
}, {}>;
|
|
12
|
+
export declare function UpdatePullRequestBodyTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
13
|
+
pull_number: number;
|
|
14
|
+
body: string;
|
|
15
|
+
}, {
|
|
16
|
+
pull_number: number;
|
|
17
|
+
body: string;
|
|
18
|
+
}>>;
|
|
19
|
+
export declare function CreatePullRequestTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
20
|
+
title: string;
|
|
21
|
+
body: string;
|
|
22
|
+
base: string;
|
|
23
|
+
draft?: boolean;
|
|
24
|
+
}, {
|
|
25
|
+
title: string;
|
|
26
|
+
body: string;
|
|
27
|
+
base: string;
|
|
28
|
+
draft?: boolean;
|
|
29
|
+
}>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
export declare const PullRequestInfo: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
pull_number: number;
|
|
4
|
+
}, {}>;
|
|
5
|
+
export declare function PullRequestInfoTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
6
|
+
pull_number: number;
|
|
7
|
+
}, {
|
|
8
|
+
pull_number: number;
|
|
9
|
+
}>>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
export declare const CreatePullRequestReview: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
pull_number: number;
|
|
4
|
+
body?: string;
|
|
5
|
+
approved?: boolean;
|
|
6
|
+
commit_id?: string;
|
|
7
|
+
comments?: {
|
|
8
|
+
path: string;
|
|
9
|
+
line: number;
|
|
10
|
+
side?: "LEFT" | "RIGHT";
|
|
11
|
+
body?: string;
|
|
12
|
+
suggestion?: string;
|
|
13
|
+
start_line?: number;
|
|
14
|
+
}[];
|
|
15
|
+
}, {}>;
|
|
16
|
+
export declare function CreatePullRequestReviewTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
17
|
+
pull_number: number;
|
|
18
|
+
body?: string;
|
|
19
|
+
approved?: boolean;
|
|
20
|
+
commit_id?: string;
|
|
21
|
+
comments?: {
|
|
22
|
+
path: string;
|
|
23
|
+
line: number;
|
|
24
|
+
side?: "LEFT" | "RIGHT";
|
|
25
|
+
body?: string;
|
|
26
|
+
suggestion?: string;
|
|
27
|
+
start_line?: number;
|
|
28
|
+
}[];
|
|
29
|
+
}, {
|
|
30
|
+
pull_number: number;
|
|
31
|
+
body?: string;
|
|
32
|
+
approved?: boolean;
|
|
33
|
+
commit_id?: string;
|
|
34
|
+
comments?: {
|
|
35
|
+
path: string;
|
|
36
|
+
line: number;
|
|
37
|
+
side?: "LEFT" | "RIGHT";
|
|
38
|
+
body?: string;
|
|
39
|
+
suggestion?: string;
|
|
40
|
+
start_line?: number;
|
|
41
|
+
}[];
|
|
42
|
+
}>>;
|
|
43
|
+
/**
|
|
44
|
+
* report the review node ID to the server so the WorkflowRun is marked as "review submitted".
|
|
45
|
+
* exported for use in main.ts post-agent cleanup.
|
|
46
|
+
*/
|
|
47
|
+
export declare function reportReviewNodeId(ctx: ToolContext, reviewNodeId: string): Promise<void>;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Octokit } from "@octokit/rest";
|
|
2
|
+
import type { ToolContext } from "./server.ts";
|
|
3
|
+
export declare const REVIEW_THREADS_QUERY = "\nquery ($owner: String!, $name: String!, $prNumber: Int!) {\n repository(owner: $owner, name: $name) {\n pullRequest(number: $prNumber) {\n reviewThreads(first: 100) {\n nodes {\n id\n path\n line\n startLine\n diffSide\n isResolved\n isOutdated\n comments(first: 50) {\n nodes {\n fullDatabaseId\n body\n createdAt\n diffHunk\n line\n startLine\n originalLine\n originalStartLine\n author { login }\n pullRequestReview {\n databaseId\n author { login }\n }\n reactionGroups {\n content\n reactors(first: 10) {\n nodes {\n ... on Actor { login }\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}\n";
|
|
4
|
+
export type ReviewThreadComment = {
|
|
5
|
+
fullDatabaseId: string | null;
|
|
6
|
+
body: string;
|
|
7
|
+
createdAt: string;
|
|
8
|
+
diffHunk: string;
|
|
9
|
+
line: number | null;
|
|
10
|
+
startLine: number | null;
|
|
11
|
+
originalLine: number | null;
|
|
12
|
+
originalStartLine: number | null;
|
|
13
|
+
author: {
|
|
14
|
+
login: string;
|
|
15
|
+
} | null;
|
|
16
|
+
pullRequestReview: {
|
|
17
|
+
databaseId: number | null;
|
|
18
|
+
author: {
|
|
19
|
+
login: string;
|
|
20
|
+
} | null;
|
|
21
|
+
} | null;
|
|
22
|
+
reactionGroups: Array<{
|
|
23
|
+
content: string;
|
|
24
|
+
reactors: {
|
|
25
|
+
nodes: Array<{
|
|
26
|
+
login: string;
|
|
27
|
+
} | null> | null;
|
|
28
|
+
} | null;
|
|
29
|
+
}> | null;
|
|
30
|
+
};
|
|
31
|
+
export type ReviewThread = {
|
|
32
|
+
id: string;
|
|
33
|
+
path: string;
|
|
34
|
+
line: number | null;
|
|
35
|
+
startLine: number | null;
|
|
36
|
+
diffSide: "LEFT" | "RIGHT";
|
|
37
|
+
isResolved: boolean;
|
|
38
|
+
isOutdated: boolean;
|
|
39
|
+
comments: {
|
|
40
|
+
nodes: (ReviewThreadComment | null)[] | null;
|
|
41
|
+
} | null;
|
|
42
|
+
};
|
|
43
|
+
export type ReviewThreadsQueryResponse = {
|
|
44
|
+
repository: {
|
|
45
|
+
pullRequest: {
|
|
46
|
+
reviewThreads: {
|
|
47
|
+
nodes: (ReviewThread | null)[] | null;
|
|
48
|
+
} | null;
|
|
49
|
+
} | null;
|
|
50
|
+
} | null;
|
|
51
|
+
};
|
|
52
|
+
export declare function countLines(str: string): number;
|
|
53
|
+
export type ParsedHunk = {
|
|
54
|
+
header: string;
|
|
55
|
+
oldStart: number;
|
|
56
|
+
oldCount: number;
|
|
57
|
+
newStart: number;
|
|
58
|
+
newCount: number;
|
|
59
|
+
content: string[];
|
|
60
|
+
};
|
|
61
|
+
export declare function parseFilePatches(patch: string): ParsedHunk[];
|
|
62
|
+
export declare const GetReviewComments: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
63
|
+
pull_number: number;
|
|
64
|
+
review_id: number;
|
|
65
|
+
}, {}>;
|
|
66
|
+
/**
|
|
67
|
+
* formats thread blocks into markdown with TOC and line numbers.
|
|
68
|
+
* extracted for testability.
|
|
69
|
+
*/
|
|
70
|
+
export declare function formatReviewThreads(threadBlocks: Array<{
|
|
71
|
+
path: string;
|
|
72
|
+
lineRange: string;
|
|
73
|
+
content: string[];
|
|
74
|
+
}>, header: {
|
|
75
|
+
pullNumber: number;
|
|
76
|
+
reviewId: number;
|
|
77
|
+
reviewer: string;
|
|
78
|
+
reviewBody?: string;
|
|
79
|
+
}): {
|
|
80
|
+
toc: string;
|
|
81
|
+
content: string;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* builds thread blocks from review threads and file patches.
|
|
85
|
+
* extracted for testability.
|
|
86
|
+
*/
|
|
87
|
+
export declare function buildThreadBlocks(threads: ReviewThread[], filePatchMap: Map<string, ParsedHunk[]>, reviewId: number): {
|
|
88
|
+
path: string;
|
|
89
|
+
lineRange: string;
|
|
90
|
+
content: string[];
|
|
91
|
+
}[];
|
|
92
|
+
interface GetReviewDataInput {
|
|
93
|
+
octokit: Octokit;
|
|
94
|
+
owner: string;
|
|
95
|
+
name: string;
|
|
96
|
+
pullNumber: number;
|
|
97
|
+
reviewId: number;
|
|
98
|
+
approvedBy?: string | undefined;
|
|
99
|
+
}
|
|
100
|
+
export declare function getReviewData(input: GetReviewDataInput): Promise<{
|
|
101
|
+
threadBlocks: Array<{
|
|
102
|
+
path: string;
|
|
103
|
+
lineRange: string;
|
|
104
|
+
content: string[];
|
|
105
|
+
}>;
|
|
106
|
+
reviewer: string;
|
|
107
|
+
formatted: {
|
|
108
|
+
toc: string;
|
|
109
|
+
content: string;
|
|
110
|
+
};
|
|
111
|
+
} | undefined>;
|
|
112
|
+
export declare function GetReviewCommentsTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
113
|
+
pull_number: number;
|
|
114
|
+
review_id: number;
|
|
115
|
+
}, {
|
|
116
|
+
pull_number: number;
|
|
117
|
+
review_id: number;
|
|
118
|
+
}>>;
|
|
119
|
+
export declare const ListPullRequestReviews: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
120
|
+
pull_number: number;
|
|
121
|
+
}, {}>;
|
|
122
|
+
export declare function ListPullRequestReviewsTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
123
|
+
pull_number: number;
|
|
124
|
+
}, {
|
|
125
|
+
pull_number: number;
|
|
126
|
+
}>>;
|
|
127
|
+
export declare const ResolveReviewThread: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
128
|
+
thread_id: string;
|
|
129
|
+
}, {}>;
|
|
130
|
+
export declare function ResolveReviewThreadTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
131
|
+
thread_id: string;
|
|
132
|
+
}, {
|
|
133
|
+
thread_id: string;
|
|
134
|
+
}>>;
|
|
135
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ToolContext } from "./server.ts";
|
|
2
|
+
export declare const SelectModeParams: import("arktype/internal/variants/object.ts").ObjectType<{
|
|
3
|
+
mode: string;
|
|
4
|
+
issue_number?: number;
|
|
5
|
+
}, {}>;
|
|
6
|
+
export type PlanCommentResponsePayload = {
|
|
7
|
+
error: string;
|
|
8
|
+
} | {
|
|
9
|
+
commentId: number;
|
|
10
|
+
body: string;
|
|
11
|
+
};
|
|
12
|
+
export type SummaryCommentResponsePayload = {
|
|
13
|
+
error: string;
|
|
14
|
+
} | {
|
|
15
|
+
commentId: number;
|
|
16
|
+
body: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function SelectModeTool(ctx: ToolContext): import("fastmcp").Tool<any, import("@standard-schema/spec").StandardSchemaV1<{
|
|
19
|
+
mode: string;
|
|
20
|
+
issue_number?: number;
|
|
21
|
+
}, {
|
|
22
|
+
mode: string;
|
|
23
|
+
issue_number?: number;
|
|
24
|
+
}>>;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import "./arkConfig.ts";
|
|
2
|
+
import type { AgentUsage } from "../agents/index.ts";
|
|
3
|
+
import { type AgentId } from "../external.ts";
|
|
4
|
+
import type { Mode } from "../modes.ts";
|
|
5
|
+
import type { PrepResult } from "../prep/index.ts";
|
|
6
|
+
import type { OctokitWithPlugins } from "../utils/github.ts";
|
|
7
|
+
import type { ResolvedPayload } from "../utils/payload.ts";
|
|
8
|
+
import type { RunContextData } from "../utils/runContextData.ts";
|
|
9
|
+
import type { TodoTracker } from "../utils/todoTracking.ts";
|
|
10
|
+
export type BackgroundProcess = {
|
|
11
|
+
pid: number;
|
|
12
|
+
outputPath: string;
|
|
13
|
+
pidPath: string;
|
|
14
|
+
};
|
|
15
|
+
export type BrowserDaemon = {
|
|
16
|
+
binDir: string;
|
|
17
|
+
error?: never;
|
|
18
|
+
} | {
|
|
19
|
+
binDir?: never;
|
|
20
|
+
error: string;
|
|
21
|
+
};
|
|
22
|
+
export type StoredPushDest = {
|
|
23
|
+
remoteName: string;
|
|
24
|
+
remoteBranch: string;
|
|
25
|
+
localBranch: string;
|
|
26
|
+
};
|
|
27
|
+
export interface ToolState {
|
|
28
|
+
pushUrl?: string;
|
|
29
|
+
pushDest?: StoredPushDest;
|
|
30
|
+
issueNumber?: number;
|
|
31
|
+
checkoutSha?: string;
|
|
32
|
+
beforeSha?: string;
|
|
33
|
+
selectedMode?: string;
|
|
34
|
+
backgroundProcesses: Map<string, BackgroundProcess>;
|
|
35
|
+
browserDaemon?: BrowserDaemon | undefined;
|
|
36
|
+
review?: {
|
|
37
|
+
id: number;
|
|
38
|
+
nodeId: string;
|
|
39
|
+
reviewedSha: string | undefined;
|
|
40
|
+
};
|
|
41
|
+
dependencyInstallation?: {
|
|
42
|
+
status: "not_started" | "in_progress" | "completed" | "failed";
|
|
43
|
+
promise: Promise<PrepResult[]> | undefined;
|
|
44
|
+
results: PrepResult[] | undefined;
|
|
45
|
+
};
|
|
46
|
+
progressCommentId: number | null | undefined;
|
|
47
|
+
hadProgressComment: boolean;
|
|
48
|
+
lastProgressBody?: string;
|
|
49
|
+
wasUpdated?: boolean;
|
|
50
|
+
finalSummaryWritten?: boolean;
|
|
51
|
+
existingPlanCommentId?: number;
|
|
52
|
+
previousPlanBody?: string;
|
|
53
|
+
existingSummaryCommentId?: number;
|
|
54
|
+
output?: string;
|
|
55
|
+
usageEntries: AgentUsage[];
|
|
56
|
+
model?: string | undefined;
|
|
57
|
+
todoTracker?: TodoTracker | undefined;
|
|
58
|
+
}
|
|
59
|
+
interface InitToolStateParams {
|
|
60
|
+
progressCommentId: string | undefined;
|
|
61
|
+
}
|
|
62
|
+
export declare function initToolState(params: InitToolStateParams): ToolState;
|
|
63
|
+
export interface ToolContext {
|
|
64
|
+
agentId: AgentId;
|
|
65
|
+
repo: RunContextData["repo"];
|
|
66
|
+
payload: ResolvedPayload;
|
|
67
|
+
octokit: OctokitWithPlugins;
|
|
68
|
+
githubInstallationToken: string;
|
|
69
|
+
gitToken: string;
|
|
70
|
+
apiToken: string;
|
|
71
|
+
modes: Mode[];
|
|
72
|
+
postCheckoutScript: string | null;
|
|
73
|
+
prepushScript: string | null;
|
|
74
|
+
prApproveEnabled: boolean;
|
|
75
|
+
modeInstructions: Record<string, string>;
|
|
76
|
+
toolState: ToolState;
|
|
77
|
+
runId: number | undefined;
|
|
78
|
+
jobId: string | undefined;
|
|
79
|
+
mcpServerUrl: string;
|
|
80
|
+
tmpdir: string;
|
|
81
|
+
}
|
|
82
|
+
type JsonSchema = Record<string, unknown>;
|
|
83
|
+
type McpHttpServerOptions = {
|
|
84
|
+
outputSchema?: JsonSchema | undefined;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Start the MCP HTTP server.
|
|
88
|
+
*/
|
|
89
|
+
export declare function startMcpHttpServer(ctx: ToolContext, options?: McpHttpServerOptions): Promise<{
|
|
90
|
+
url: string;
|
|
91
|
+
[Symbol.asyncDispose]: () => Promise<void>;
|
|
92
|
+
}>;
|
|
93
|
+
export {};
|