eve
Version:
Filesystem-first framework for durable backend AI agents that run anywhere.
41 lines (40 loc) • 2.61 kB
TypeScript
import type { UserContent } from "ai";
import type { GitHubCommentTrigger, GitHubConversationKind, GitHubInboundEvent, GitHubRepositoryRef, GitHubUser } from "#public/channels/github/inbound-types.js";
export type { GitHubAppRef, GitHubCheckRunEvent, GitHubCheckRunWebhookEvent, GitHubCheckSuiteEvent, GitHubCheckSuiteWebhookEvent, GitHubCiEvent, GitHubCiPayload, GitHubCiWebhookEvent, GitHubComment, GitHubCommentTrigger, GitHubConversationKind, GitHubConversationRef, GitHubDelivery, GitHubInboundEvent, GitHubIssueAction, GitHubIssueComment, GitHubIssueCommentEvent, GitHubIssueEvent, GitHubIssueWebhookEvent, GitHubPullRequestAction, GitHubPullRequestEvent, GitHubPullRequestReviewComment, GitHubPullRequestReviewCommentEvent, GitHubPullRequestWebhookEvent, GitHubRepositoryRef, GitHubUser, GitHubWorkflowRunEvent, GitHubWorkflowRunWebhookEvent, } from "#public/channels/github/inbound-types.js";
/** Builds the channel-local continuation token for a GitHub conversation. */
export declare function githubContinuationToken(input: {
readonly conversationKind: GitHubConversationKind;
readonly issueNumber?: number | null;
readonly pullRequestNumber?: number | null;
readonly repositoryId: number;
readonly reviewThreadRootCommentId?: number | null;
}): string;
/** Returns true when a comment @mentions the bot and should wake the channel. */
export declare function shouldDispatchGitHubComment(input: {
readonly author?: GitHubUser;
readonly body: string;
readonly botName?: string;
}): boolean;
/** Extracts and strips the bot `@mention` from a comment body. */
export declare function extractGitHubCommentTrigger(input: {
readonly body: string;
readonly botName?: string;
}): GitHubCommentTrigger | null;
/** Parses GitHub webhook headers and body into an eve-owned event shape. */
export declare function parseGitHubWebhookEvent(input: {
readonly body: string;
readonly contentType?: string;
readonly headers: Headers;
}): GitHubInboundEvent | null;
/** Renders deterministic GitHub metadata for the model-visible turn. */
export declare function formatGitHubContextBlock(input: {
readonly commentUrl?: string;
readonly deliveryId: string;
readonly headSha?: string | null;
readonly issueNumber?: number | null;
readonly pullRequestNumber?: number | null;
readonly repository: GitHubRepositoryRef;
readonly sender: GitHubUser;
}): string;
/** Prepends a `<github_context>` block to the inbound turn message. */
export declare function prependGitHubContext(message: string | UserContent, block: string): string | UserContent;