eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
57 lines (56 loc) • 2.73 kB
TypeScript
import { type GitHubApiOptions } from "#public/channels/github/api.js";
import type { GitHubChannelCredentials } from "#public/channels/github/auth.js";
/**
* Built-in glob patterns excluded from the diff loaded into model context.
*
* These files are large and generated; their patch text seldom helps the model
* and consumes context budget. They are still listed with their stats so the
* agent knows they changed, and the full file is always available from the
* checkout.
*/
export declare const GITHUB_DEFAULT_EXCLUDED_DIFF_FILES: readonly string[];
/** Controls the pull-request diff injected into GitHub-triggered turns. */
export interface GitHubPullRequestContextConfig {
/**
* Additional glob patterns excluded from the diff loaded into model context.
* Extends the built-in {@link GITHUB_DEFAULT_EXCLUDED_DIFF_FILES} list; it
* does not replace it. Excluded files are still listed with their stats; only
* the patch body is omitted.
*/
readonly excludedFiles?: readonly string[];
}
/** Input for building one-shot model context for a pull request. */
export interface GitHubPullRequestContextInput {
readonly api?: GitHubApiOptions;
/**
* When set with {@link headSha}, file patches load via the compare API for
* this exact base/head pair instead of `/pulls/{number}/files` (current head).
*/
readonly baseSha?: string | null;
readonly config?: GitHubPullRequestContextConfig;
readonly credentials?: GitHubChannelCredentials;
/**
* Webhook-resolved head SHA for this turn. When set, metadata and diffs pin to
* this commit so injected context matches sandbox checkout.
*/
readonly headSha?: string | null;
readonly installationId?: number;
readonly owner: string;
readonly pullRequestNumber: number | null;
readonly repo: string;
}
/**
* Builds bounded, one-shot pull-request background for a GitHub turn: PR
* metadata plus the changed-file diff (noisy files excluded from the patch).
*
* The returned strings are intended for `SendPayload.context`; each is appended
* as a `role: "user"` message to session history before the delivery message.
*/
export declare function buildGitHubPullRequestContext(input: GitHubPullRequestContextInput): Promise<readonly string[] | undefined>;
/** Merges channel-generated PR context before hook-provided context. */
export declare function mergeGitHubContext(input: {
readonly github?: readonly string[];
readonly hook?: readonly string[];
}): readonly string[] | undefined;
/** Returns true when a file path matches any of the provided glob patterns. */
export declare function fileMatchesAnyGlob(filename: string, patterns: readonly string[]): boolean;