import { type Complete } from '../triage/index.js'; import { type Embedder } from '../answer/embed.js'; export { resolveEmbedder, type Embedder, type EmbedKind } from '../answer/embed.js'; import { type VectorStore } from '../answer/vector-store.js'; export { defaultVectorStore, localVectorStore, sqliteVectorStore, postgresVectorStore, type VectorStore, type StoredSection, type SectionMatch } from '../answer/vector-store.js'; export interface HandlerOptions { /** owner/name of the repo that gets the issues. */ repo: string; /** * Needs Issues: write on that one repo. For a private repo also Contents: Read-only, so questions can be answered * from its README. Defaults to BLAZE_GITHUB_TOKEN. */ githubToken?: string; /** Model for triage. Defaults to whichever AI provider has a key configured; without one, keyword rules are used. */ complete?: Complete; /** Extra help docs, searched along with the repo's README when answering customer questions. */ helpDocs?: string; /** * The product's name, so Blazzy answers for it and nothing else. Defaults to BLAZE_PRODUCT_NAME, else the repo's * name (`acme/shop` -> `shop`). */ product?: string; /** * The README on disk, read before GitHub's. By default the one at the root of this app's checkout, when its GitHub * remote is `repo`. A path reads that file; `false` reads none (GitHub only). */ readmePath?: string | false; /** * Where the docs' vectors are kept, when semantic search is on. Defaults to a SQLite file in the product, * `.blazeresolver/vectors.db` (see `localVectorStore`); `sqliteVectorStore` / `postgresVectorStore` use a database the * product has; `false` keeps them in memory only. */ vectorStore?: VectorStore | false; /** * Semantic search over the docs, alongside keyword search. Defaults to whichever provider with embeddings has a key * configured (see `resolveEmbedder`); `false` keeps search keyword-only. */ embed?: Embedder | false; /** Keep the customer's email in the issue so they can be told when it's fixed. Only for private repos. */ storeEmails?: boolean; /** * Reports accepted per IP every 10 minutes, and in total per hour, per server instance. Defaults 10 and 100 * (BLAZE_RATE_LIMIT_PER_HOUR overrides the total). GitHub caps content creation at about 500 per hour per token. */ rateLimit?: { perIp?: number; perHour?: number; /** Atomic shared limiter for serverless deployments. Return true when the limit is exceeded. */ check?: (id: string, max: number, windowMs: number) => boolean | Promise; }; /** Distributed lock for issue deduplication. Defaults to a process-local lock. */ withIssueLock?: (key: string, run: () => Promise) => Promise; /** Set when the widget runs on a different origin than the handler. */ allowOrigin?: string; fetch?: typeof fetch; } /** * A Web-standard `(Request) => Response` handler for the widget. Mount it in Next.js, Cloudflare, Vercel, Deno or Bun as is, * or in Express with `nodeHandler`. It triages a report and files it as a GitHub issue; the workflow in that repo does the rest. * It holds no state and no secrets beyond a token that can only write issues (and read a private repo), and it can't push code. */ export declare function createHandler(options: HandlerOptions): (req: Request) => Promise; /** Adapts the handler to Node's (req, res), for Express and plain http servers. Works with or without a body parser. */ export declare function nodeHandler(handler: (req: Request) => Promise): (req: any, res: any) => Promise; export { createRedisCoordination, createUpstashRestCoordination, type RedisLikeClient, type SharedCoordination, type SharedCoordinationOptions } from './coordination.js'; //# sourceMappingURL=index.d.ts.map