pullfrog 0.1.30 → 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 +63441 -59740
- package/dist/external.d.ts +45 -2
- package/dist/index.js +61939 -58238
- package/dist/internal/index.d.ts +2 -2
- package/dist/internal.js +89 -22
- 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 +26 -7
- 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 +6 -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/toolState.d.ts +69 -16
- package/dist/utils/apiKeys.d.ts +4 -0
- package/dist/utils/buildPullfrogFooter.d.ts +34 -0
- package/dist/utils/errorReport.d.ts +2 -2
- package/dist/utils/github.d.ts +1 -1
- package/dist/utils/instructions.d.ts +8 -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/payload.d.ts +16 -0
- package/dist/utils/runContext.d.ts +3 -0
- package/dist/utils/runContextData.d.ts +10 -0
- package/dist/utils/setup.d.ts +18 -3
- package/dist/utils/token.d.ts +10 -2
- 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/retry.d.ts +0 -13
package/dist/utils/setup.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ShellPermission } from "../external.ts";
|
|
2
|
-
import type
|
|
2
|
+
import { type ToolState } from "../toolState.ts";
|
|
3
3
|
import type { OctokitWithPlugins } from "./github.ts";
|
|
4
4
|
export interface SetupOptions {
|
|
5
5
|
tempDir: string;
|
|
@@ -61,15 +61,30 @@ export interface GitContext {
|
|
|
61
61
|
postCheckoutScript: string | null;
|
|
62
62
|
}
|
|
63
63
|
export type SetupGitParams = GitContext;
|
|
64
|
+
/** GitContext plus an explicit working-tree directory (primary cwd or a
|
|
65
|
+
* secondary clone under ctx.tmpdir/xrepo/<name>). */
|
|
66
|
+
export interface ConfigureRepoGitParams extends GitContext {
|
|
67
|
+
dir: string;
|
|
68
|
+
}
|
|
64
69
|
/**
|
|
65
|
-
* setup git configuration
|
|
70
|
+
* setup git configuration + authentication for the PRIMARY repo working tree
|
|
71
|
+
* (process.cwd()). thin wrapper over configureRepoGit. preserves the existing
|
|
72
|
+
* single-repo call shape in main.ts.
|
|
73
|
+
*/
|
|
74
|
+
export declare function setupGit(params: SetupGitParams): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* setup git configuration and authentication for a repository working tree at
|
|
77
|
+
* `params.dir`. used for the primary repo (dir = cwd) and for secondary repos
|
|
78
|
+
* cloned on demand by checkout_repo (dir = ctx.tmpdir/xrepo/<name>).
|
|
66
79
|
* - configures git identity (user.email, user.name)
|
|
67
80
|
* - sets up authentication via gitToken (minimal contents:write)
|
|
81
|
+
* - records pushUrl + initialHead onto the repo's RepoToolState (must already
|
|
82
|
+
* be registered in toolState.repos)
|
|
68
83
|
*
|
|
69
84
|
* gitToken is a minimal-permission token (contents + workflows) used for git operations.
|
|
70
85
|
* it is assumed to be potentially exfiltratable, so it has limited scope.
|
|
71
86
|
*/
|
|
72
|
-
export declare function
|
|
87
|
+
export declare function configureRepoGit(params: ConfigureRepoGitParams): Promise<void>;
|
|
73
88
|
/**
|
|
74
89
|
* snapshot the current HEAD as either a branch name (when on a named branch)
|
|
75
90
|
* or a literal SHA (when detached). used by setupGit to pin the run-entry
|
package/dist/utils/token.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PushPermission } from "../external.ts";
|
|
1
|
+
import type { PushPermission, XrepoConfig } from "../external.ts";
|
|
2
2
|
import { acquireNewToken, type OidcCredentials } from "./github.ts";
|
|
3
3
|
export { acquireNewToken as acquireInstallationToken };
|
|
4
4
|
export { revokeGitHubInstallationToken as revokeInstallationToken };
|
|
@@ -20,10 +20,13 @@ export declare function getJobToken(): string;
|
|
|
20
20
|
export type TokenRef = {
|
|
21
21
|
gitToken: string;
|
|
22
22
|
mcpToken: string;
|
|
23
|
+
readToken?: string | undefined;
|
|
24
|
+
refreshGitToken?: ((stale: string) => Promise<string>) | undefined;
|
|
23
25
|
[Symbol.asyncDispose]: () => Promise<void>;
|
|
24
26
|
};
|
|
25
27
|
type ResolveTokensParams = {
|
|
26
28
|
push: PushPermission;
|
|
29
|
+
xrepo?: XrepoConfig | undefined;
|
|
27
30
|
/**
|
|
28
31
|
* OIDC credentials stashed by main.ts before the restricted-mode env wipe —
|
|
29
32
|
* the mid-run MCP token refresh mints from this snapshot (#891). null when
|
|
@@ -34,11 +37,16 @@ type ResolveTokensParams = {
|
|
|
34
37
|
/**
|
|
35
38
|
* resolve tokens for the action run.
|
|
36
39
|
*
|
|
37
|
-
* creates two separate tokens:
|
|
40
|
+
* creates two separate tokens (three on cross-repo runs):
|
|
38
41
|
* - gitToken: contents permission based on `push` setting (assumed exfiltratable)
|
|
39
42
|
* - push: enabled → contents:write (can push)
|
|
40
43
|
* - push: disabled → contents:read (read-only)
|
|
41
44
|
* - mcpToken: full installation token - used for GitHub API calls in MCP tools (not exfiltratable)
|
|
45
|
+
* - readToken (xrepo only): contents:read over the read set, for cloning read-tier secondaries
|
|
46
|
+
*
|
|
47
|
+
* on cross-repo runs, gitToken + mcpToken are scoped to the WRITE set (always
|
|
48
|
+
* incl. the primary), so a writable secondary can take PRs; read-only
|
|
49
|
+
* secondaries route through readToken instead.
|
|
42
50
|
*
|
|
43
51
|
* security-conscious users can pass their own token via GH_TOKEN env var or inputs.token.
|
|
44
52
|
*/
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { StandardSchemaV1 } from "./standard-schema.ts";
|
|
2
|
+
export type { StandardSchemaV1 } from "./standard-schema.ts";
|
|
3
|
+
export declare function range(n: number): number[];
|
|
4
|
+
export declare function range(start: number, end: number): number[];
|
|
5
|
+
export declare function range(n: number, fn: (i: number) => number): number[];
|
|
6
|
+
export declare function schedule(fn: (i: number) => number, count: number): number[];
|
|
7
|
+
type InferInput<S> = S extends StandardSchemaV1<infer I, any> ? I : never;
|
|
8
|
+
type InferOutput<S> = S extends StandardSchemaV1<any, infer O> ? O : never;
|
|
9
|
+
export interface OpOptions<TReturn = any> {
|
|
10
|
+
name?: string;
|
|
11
|
+
ttl?: number;
|
|
12
|
+
maxItems?: number;
|
|
13
|
+
retries?: number[];
|
|
14
|
+
cacheHit?: ((key: string) => void) | null;
|
|
15
|
+
cacheMiss?: ((key: string) => void) | null;
|
|
16
|
+
skipCache?: (result: TReturn) => boolean;
|
|
17
|
+
bail?: (error: unknown) => boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface OpObjectOptions<TInputSchema extends StandardSchemaV1 | undefined = undefined, TOutputSchema extends StandardSchemaV1 | undefined = undefined, TRun extends (input: TInputSchema extends StandardSchemaV1 ? InferOutput<TInputSchema> : any, ctx?: any) => Promise<TOutputSchema extends StandardSchemaV1 ? InferInput<TOutputSchema> : any> = (input: TInputSchema extends StandardSchemaV1 ? InferOutput<TInputSchema> : any, ctx?: any) => Promise<TOutputSchema extends StandardSchemaV1 ? InferInput<TOutputSchema> : any>> extends OpOptions<TOutputSchema extends StandardSchemaV1 ? InferOutput<TOutputSchema> : Awaited<ReturnType<TRun>>> {
|
|
20
|
+
input?: TInputSchema;
|
|
21
|
+
output?: TOutputSchema;
|
|
22
|
+
run: TRun;
|
|
23
|
+
}
|
|
24
|
+
type AnyAsyncFn = (...args: any[]) => Promise<any>;
|
|
25
|
+
type Input<F extends AnyAsyncFn> = Parameters<F>[0];
|
|
26
|
+
export type OpFunction<F extends AnyAsyncFn> = F & {
|
|
27
|
+
clear: (key?: Input<F>) => void;
|
|
28
|
+
has: (key: Input<F>) => boolean;
|
|
29
|
+
invalidate: (predicate: (key: Input<F>) => boolean) => number;
|
|
30
|
+
};
|
|
31
|
+
export declare function op<F extends AnyAsyncFn>(fn: F, options?: OpOptions<Awaited<ReturnType<F>>>): OpFunction<F>;
|
|
32
|
+
export declare function op<TInputSchema extends StandardSchemaV1 | undefined = undefined, TOutputSchema extends StandardSchemaV1 | undefined = undefined, TRun extends (input: TInputSchema extends StandardSchemaV1 ? InferOutput<TInputSchema> : any, ctx?: any) => Promise<TOutputSchema extends StandardSchemaV1 ? InferInput<TOutputSchema> : any> = (input: TInputSchema extends StandardSchemaV1 ? InferOutput<TInputSchema> : any, ctx?: any) => Promise<TOutputSchema extends StandardSchemaV1 ? InferInput<TOutputSchema> : any>>(options: OpObjectOptions<TInputSchema, TOutputSchema, TRun>): OpFunction<(input: TInputSchema extends StandardSchemaV1 ? InferInput<TInputSchema> : Parameters<TRun>[0], ctx?: TRun extends (input: any, ctx: infer C, ...rest: any[]) => any ? C : never) => Promise<TOutputSchema extends StandardSchemaV1 ? InferOutput<TOutputSchema> : Awaited<ReturnType<TRun>>>>;
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/** The Standard Typed interface. This is a base type extended by other specs. */
|
|
2
|
+
export interface StandardTypedV1<Input = unknown, Output = Input> {
|
|
3
|
+
/** The Standard properties. */
|
|
4
|
+
readonly "~standard": StandardTypedV1.Props<Input, Output>;
|
|
5
|
+
}
|
|
6
|
+
export declare namespace StandardTypedV1 {
|
|
7
|
+
/** The Standard Typed properties interface. */
|
|
8
|
+
interface Props<Input = unknown, Output = Input> {
|
|
9
|
+
/** The version number of the standard. */
|
|
10
|
+
readonly version: 1;
|
|
11
|
+
/** The vendor name of the schema library. */
|
|
12
|
+
readonly vendor: string;
|
|
13
|
+
/** Inferred types associated with the schema. */
|
|
14
|
+
readonly types?: Types<Input, Output> | undefined;
|
|
15
|
+
}
|
|
16
|
+
/** The Standard Typed types interface. */
|
|
17
|
+
interface Types<Input = unknown, Output = Input> {
|
|
18
|
+
/** The input type of the schema. */
|
|
19
|
+
readonly input: Input;
|
|
20
|
+
/** The output type of the schema. */
|
|
21
|
+
readonly output: Output;
|
|
22
|
+
}
|
|
23
|
+
/** Infers the input type of a Standard Typed. */
|
|
24
|
+
type InferInput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
25
|
+
/** Infers the output type of a Standard Typed. */
|
|
26
|
+
type InferOutput<Schema extends StandardTypedV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
27
|
+
}
|
|
28
|
+
/** The Standard Schema interface. */
|
|
29
|
+
export interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
30
|
+
/** The Standard Schema properties. */
|
|
31
|
+
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
32
|
+
}
|
|
33
|
+
export declare namespace StandardSchemaV1 {
|
|
34
|
+
/** The Standard Schema properties interface. */
|
|
35
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
36
|
+
/** Validates unknown input values. */
|
|
37
|
+
readonly validate: (value: unknown, options?: StandardSchemaV1.Options | undefined) => Result<Output> | Promise<Result<Output>>;
|
|
38
|
+
}
|
|
39
|
+
/** The result interface of the validate function. */
|
|
40
|
+
type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
41
|
+
/** The result interface if validation succeeds. */
|
|
42
|
+
interface SuccessResult<Output> {
|
|
43
|
+
/** The typed output value. */
|
|
44
|
+
readonly value: Output;
|
|
45
|
+
/** A falsy value for `issues` indicates success. */
|
|
46
|
+
readonly issues?: undefined;
|
|
47
|
+
}
|
|
48
|
+
interface Options {
|
|
49
|
+
/** Explicit support for additional vendor-specific parameters, if needed. */
|
|
50
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
51
|
+
}
|
|
52
|
+
/** The result interface if validation fails. */
|
|
53
|
+
interface FailureResult {
|
|
54
|
+
/** The issues of failed validation. */
|
|
55
|
+
readonly issues: ReadonlyArray<Issue>;
|
|
56
|
+
}
|
|
57
|
+
/** The issue interface of the failure output. */
|
|
58
|
+
interface Issue {
|
|
59
|
+
/** The error message of the issue. */
|
|
60
|
+
readonly message: string;
|
|
61
|
+
/** The path of the issue, if any. */
|
|
62
|
+
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
63
|
+
}
|
|
64
|
+
/** The path segment interface of the issue. */
|
|
65
|
+
interface PathSegment {
|
|
66
|
+
/** The key representing a path segment. */
|
|
67
|
+
readonly key: PropertyKey;
|
|
68
|
+
}
|
|
69
|
+
/** The Standard types interface. */
|
|
70
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {
|
|
71
|
+
}
|
|
72
|
+
/** Infers the input type of a Standard. */
|
|
73
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
74
|
+
/** Infers the output type of a Standard. */
|
|
75
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
76
|
+
}
|
|
77
|
+
/** The Standard JSON Schema interface. */
|
|
78
|
+
export interface StandardJSONSchemaV1<Input = unknown, Output = Input> {
|
|
79
|
+
/** The Standard JSON Schema properties. */
|
|
80
|
+
readonly "~standard": StandardJSONSchemaV1.Props<Input, Output>;
|
|
81
|
+
}
|
|
82
|
+
export declare namespace StandardJSONSchemaV1 {
|
|
83
|
+
/** The Standard JSON Schema properties interface. */
|
|
84
|
+
interface Props<Input = unknown, Output = Input> extends StandardTypedV1.Props<Input, Output> {
|
|
85
|
+
/** Methods for generating the input/output JSON Schema. */
|
|
86
|
+
readonly jsonSchema: StandardJSONSchemaV1.Converter;
|
|
87
|
+
}
|
|
88
|
+
/** The Standard JSON Schema converter interface. */
|
|
89
|
+
interface Converter {
|
|
90
|
+
/** Converts the input type to JSON Schema. May throw if conversion is not supported. */
|
|
91
|
+
readonly input: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
92
|
+
/** Converts the output type to JSON Schema. May throw if conversion is not supported. */
|
|
93
|
+
readonly output: (options: StandardJSONSchemaV1.Options) => Record<string, unknown>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* The target version of the generated JSON Schema.
|
|
97
|
+
*
|
|
98
|
+
* It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target.
|
|
99
|
+
*
|
|
100
|
+
* The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`.
|
|
101
|
+
*/
|
|
102
|
+
type Target = "draft-2020-12" | "draft-07" | "openapi-3.0" | ({} & string);
|
|
103
|
+
/** The options for the input/output methods. */
|
|
104
|
+
interface Options {
|
|
105
|
+
/** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */
|
|
106
|
+
readonly target: Target;
|
|
107
|
+
/** Explicit support for additional vendor-specific parameters, if needed. */
|
|
108
|
+
readonly libraryOptions?: Record<string, unknown> | undefined;
|
|
109
|
+
}
|
|
110
|
+
/** The Standard types interface. */
|
|
111
|
+
interface Types<Input = unknown, Output = Input> extends StandardTypedV1.Types<Input, Output> {
|
|
112
|
+
}
|
|
113
|
+
/** Infers the input type of a Standard. */
|
|
114
|
+
type InferInput<Schema extends StandardTypedV1> = StandardTypedV1.InferInput<Schema>;
|
|
115
|
+
/** Infers the output type of a Standard. */
|
|
116
|
+
type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
|
|
117
|
+
}
|