@github-tools/sdk 1.21.0 → 1.23.0

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.
Files changed (61) hide show
  1. package/README.md +9 -9
  2. package/dist/{approval-policy-CEMMPq92.mjs → approval-policy-DJlImo7H.mjs} +3 -4
  3. package/dist/{approval-policy-CEMMPq92.mjs.map → approval-policy-DJlImo7H.mjs.map} +1 -1
  4. package/dist/connect/eve.d.mts +2 -4
  5. package/dist/connect/eve.d.mts.map +1 -1
  6. package/dist/connect/eve.mjs +3 -4
  7. package/dist/connect/eve.mjs.map +1 -1
  8. package/dist/connect.d.mts +3 -9
  9. package/dist/connect.d.mts.map +1 -1
  10. package/dist/connect.mjs +3 -4
  11. package/dist/{cores-meFAMt2D.mjs → cores-H6HKlwFZ.mjs} +3 -4
  12. package/dist/{cores-meFAMt2D.mjs.map → cores-H6HKlwFZ.mjs.map} +1 -1
  13. package/dist/{dry-run-DXckOam2.d.mts → dry-run-BAbes7Mv.d.mts} +2 -28
  14. package/dist/dry-run-BAbes7Mv.d.mts.map +1 -0
  15. package/dist/{evaluation-DJHINyAu.mjs → evaluation-Dlf-571x.mjs} +4 -6
  16. package/dist/{evaluation-DJHINyAu.mjs.map → evaluation-Dlf-571x.mjs.map} +1 -1
  17. package/dist/{eve-runtime-B_CJE9JV.d.mts → eve-runtime-CoBSN8nF.d.mts} +66 -15
  18. package/dist/eve-runtime-CoBSN8nF.d.mts.map +1 -0
  19. package/dist/{eve-runtime-DPzMPCLt.mjs → eve-runtime-DEdQqbCs.mjs} +214 -27
  20. package/dist/eve-runtime-DEdQqbCs.mjs.map +1 -0
  21. package/dist/eve-runtime.d.mts +5 -5
  22. package/dist/eve-runtime.mjs +4 -4
  23. package/dist/eve.d.mts +67 -69
  24. package/dist/eve.d.mts.map +1 -1
  25. package/dist/eve.mjs +67 -68
  26. package/dist/eve.mjs.map +1 -1
  27. package/dist/{index-CzzrtCVj.d.mts → index-v5n5OLs7.d.mts} +29 -54
  28. package/dist/index-v5n5OLs7.d.mts.map +1 -0
  29. package/dist/index.d.mts +2 -2
  30. package/dist/index.mjs +3 -3
  31. package/dist/{interrupts-BSDPwdJ2.d.mts → interrupts-MwQ_v_PF.d.mts} +1 -3
  32. package/dist/interrupts-MwQ_v_PF.d.mts.map +1 -0
  33. package/dist/rolldown-runtime-D8jQpDG7.mjs +12 -0
  34. package/dist/{src-BlhrSieS.mjs → src-BRZIY_PZ.mjs} +21 -38
  35. package/dist/{src-BlhrSieS.mjs.map → src-BRZIY_PZ.mjs.map} +1 -1
  36. package/dist/tanstack/interrupts.d.mts +1 -1
  37. package/dist/tanstack/interrupts.mjs +1 -2
  38. package/dist/tanstack.d.mts +3 -20
  39. package/dist/tanstack.d.mts.map +1 -1
  40. package/dist/tanstack.mjs +8 -13
  41. package/dist/tanstack.mjs.map +1 -1
  42. package/dist/{token-BLps09gm.mjs → token-DZu9uttC.mjs} +6 -10
  43. package/dist/{token-BLps09gm.mjs.map → token-DZu9uttC.mjs.map} +1 -1
  44. package/dist/{types-Bln8U42J.d.mts → types-8KtcPTao.d.mts} +3 -7
  45. package/dist/types-8KtcPTao.d.mts.map +1 -0
  46. package/dist/{types-C7O2lwwz.d.mts → types-C-BIKmas.d.mts} +2 -4
  47. package/dist/types-C-BIKmas.d.mts.map +1 -0
  48. package/dist/workflow.d.mts +2 -4
  49. package/dist/workflow.d.mts.map +1 -1
  50. package/dist/workflow.mjs +3 -4
  51. package/dist/{write-tools-w-8tjnDQ.mjs → write-tools-C-962T9O.mjs} +57 -88
  52. package/dist/write-tools-C-962T9O.mjs.map +1 -0
  53. package/package.json +1 -1
  54. package/dist/dry-run-DXckOam2.d.mts.map +0 -1
  55. package/dist/eve-runtime-B_CJE9JV.d.mts.map +0 -1
  56. package/dist/eve-runtime-DPzMPCLt.mjs.map +0 -1
  57. package/dist/index-CzzrtCVj.d.mts.map +0 -1
  58. package/dist/interrupts-BSDPwdJ2.d.mts.map +0 -1
  59. package/dist/types-Bln8U42J.d.mts.map +0 -1
  60. package/dist/types-C7O2lwwz.d.mts.map +0 -1
  61. package/dist/write-tools-w-8tjnDQ.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eve-runtime-DEdQqbCs.mjs","names":[],"sources":["../src/eve/load-eve.ts","../src/eve/approval.ts","../src/eve/registry.ts","../src/eve/steps.ts","../src/eve/build.ts","../src/core/caller-access.ts","../src/core/attribution.ts"],"sourcesContent":["import * as eveTools from 'eve/tools'\nimport * as eveApproval from 'eve/tools/approval'\n\n/**\n * Static ESM imports so bundlers (eve/Nitro/Vercel) can resolve `eve` when it is\n * compiled into the output rather than left as `node_modules/eve` at runtime.\n * Runtime `createRequire(\"eve/tools\")` fails in those targets.\n */\nexport type EveToolsModule = typeof import('eve/tools')\nexport type EveApprovalModule = typeof import('eve/tools/approval')\n\n/**\n * @deprecated Never thrown since eve moved to static ESM imports — a missing\n * `eve` package now fails at module resolution with the bundler/runtime's own\n * error. Kept only for backward compatibility of the public export; do not\n * match on it. Will be removed in the next major.\n */\nexport const MISSING_EVE_MESSAGE =\n 'The \"eve\" package is required to use @github-tools/sdk/eve. Install it with: pnpm add eve'\n\nexport function getEveTools(): EveToolsModule {\n return eveTools\n}\n\nexport function getEveApprovalHelpers(): EveApprovalModule {\n return eveApproval\n}\n","import type { Approval, ApprovalPolicy } from 'eve/tools/approval'\nimport type { GithubWriteToolName } from '../core/write-tools'\nimport { getEveApprovalHelpers } from './load-eve'\nimport type { EveApprovalConfig, EveApprovalValue } from './types'\n\n/**\n * `false` / `'never'` should omit the tool `approval` field entirely.\n * eve treats a missing `approval` like `never()`; attaching `never()` is\n * redundant and has caused approval UI noise on some channels.\n */\nexport function isEveApprovalDisabled(value: EveApprovalValue | undefined): boolean {\n return value === false || value === 'never'\n}\n\nexport function mapEveApprovalValue(value: EveApprovalValue): ApprovalPolicy {\n if (typeof value === 'function') return value\n // Object-shaped eve `ApprovalConfiguration` — the request-time policy lives on `request`.\n if (typeof value === 'object') return value.request\n\n const { always, never, once } = getEveApprovalHelpers()\n\n if (value === true || value === 'always') return always()\n if (value === false || value === 'never') return never()\n return once()\n}\n\nexport function resolveEveApproval(\n toolName: GithubWriteToolName,\n config: EveApprovalConfig | undefined,\n): ApprovalPolicy {\n if (config === undefined) return getEveApprovalHelpers().always()\n if (config === true) return getEveApprovalHelpers().always()\n if (config === false) return getEveApprovalHelpers().never()\n\n const value = config[toolName]\n if (value === undefined) return getEveApprovalHelpers().always()\n\n return mapEveApprovalValue(value)\n}\n\n/**\n * Approval to attach on a write tool, or `undefined` to omit the field.\n * Prefer this when building `defineTool` values so `false` / `'never'` do not\n * attach a redundant `never()` handler.\n */\nexport function resolveEveToolApproval(\n toolName: GithubWriteToolName,\n config: EveApprovalConfig | undefined,\n override?: EveApprovalValue,\n): Approval | undefined {\n const value = override !== undefined\n ? override\n : typeof config === 'object' && config !== null\n ? config[toolName]\n : config\n\n if (value === undefined) return getEveApprovalHelpers().always()\n if (isEveApprovalDisabled(value)) return undefined\n // Pass policies and `ApprovalConfiguration` objects through unchanged so a\n // response-time authorizer (`response`) survives onto `defineTool`.\n if (typeof value === 'function' || typeof value === 'object') return value\n return mapEveApprovalValue(value)\n}\n","import type { ToolModelOutput } from 'eve/tools'\nimport type { z } from 'zod'\nimport type { CommitIdentity } from '../types'\nimport { GITHUB_TOOL_CATALOG, isGithubWriteToolName } from '../core/catalog'\nimport { GITHUB_TOOL_CORES } from '../core/cores'\nimport { mergeContextArgs, softenContextSchema, type GithubToolsContext } from '../core/context'\nimport {\n compareCommitsToModelOutput,\n getCommitToModelOutput,\n getFileContentToModelOutput,\n getPullRequestContextToModelOutput,\n getRepositoryTreeToModelOutput,\n listPullRequestFilesToModelOutput,\n} from '../core/model-output'\nimport { stripRateLimit } from '../core/rate-limit'\nimport { resolveGithubToken, type GithubTokenInput } from '../core/token'\nimport type { GithubGuardrails } from '../core/guardrails'\nimport type { GithubDryRunApproval } from '../core/dry-run'\nimport type { GithubWriteToolName } from '../core/write-tools'\nimport { ALL_GITHUB_TOOL_NAMES, type GithubToolName } from '../core/tool-names'\nexport type { GithubToolName } from '../core/tool-names'\nexport { ALL_GITHUB_TOOL_NAMES } from '../core/tool-names'\n\nexport type ToolBuildContext = {\n token: GithubTokenInput\n context?: GithubToolsContext\n author?: CommitIdentity\n committer?: CommitIdentity\n coAuthors?: CommitIdentity[]\n guardrails?: GithubGuardrails\n dryRun?: boolean\n dryRunApproval?: GithubDryRunApproval\n}\n\ntype ToolRegistryEntry = {\n name: GithubToolName\n writeTool?: GithubWriteToolName\n description: string\n inputSchema: z.ZodType\n execute: (args: Record<string, unknown>) => Promise<unknown>\n toModelOutput?: (output: unknown) => ToolModelOutput\n}\n\nfunction withToken<T extends Record<string, unknown>>(\n core: (args: T & { token: string }) => Promise<unknown>,\n ctx: ToolBuildContext,\n extra?: Record<string, unknown>,\n guard?: Record<string, unknown>,\n) {\n return async (input: Record<string, unknown>) =>\n core({\n token: await resolveGithubToken(ctx.token),\n ...extra,\n ...mergeContextArgs(input, ctx.context ?? {}),\n ...guard,\n } as T & { token: string })\n}\n\nfunction modelOutputAdapter(\n fn: (options: { toolCallId: string, input: unknown, output: unknown }) => { type: 'json' | 'text', value: unknown },\n) {\n return (output: unknown) => fn({ toolCallId: '', input: {}, output }) as ToolModelOutput\n}\n\nconst GITHUB_EVE_TOOL_MODEL_OUTPUT = {\n getFileContent: modelOutputAdapter(getFileContentToModelOutput),\n getRepositoryTree: modelOutputAdapter(getRepositoryTreeToModelOutput),\n listPullRequestFiles: modelOutputAdapter(listPullRequestFilesToModelOutput),\n getPullRequestContext: modelOutputAdapter(getPullRequestContextToModelOutput),\n getCommit: modelOutputAdapter(getCommitToModelOutput),\n compareCommits: modelOutputAdapter(compareCommitsToModelOutput),\n} satisfies Partial<Record<GithubToolName, (output: unknown) => ToolModelOutput>>\n\nconst EVE_TOOL_MODEL_OUTPUTS: Partial<Record<GithubToolName, (output: unknown) => ToolModelOutput>> = GITHUB_EVE_TOOL_MODEL_OUTPUT\n\n/** Whether a GitHub tool has a built-in eve `toModelOutput` projection. */\nexport function hasGithubEveToolModelOutput(name: GithubToolName): boolean {\n return Object.hasOwn(GITHUB_EVE_TOOL_MODEL_OUTPUT, name)\n}\n\n/**\n * Apply the built-in eve `toModelOutput` projection for a tool.\n * Strips `rateLimit` so it never reaches the model. Tools without a dedicated\n * formatter get `{ type: 'json', value }` of the remaining payload.\n * Used by `@github-tools/eve-extension` so the callback only closes over a serializable tool name.\n */\nexport function formatGithubEveToolOutput(name: GithubToolName, output: unknown): ToolModelOutput {\n const stripped = stripRateLimit(output)\n const format = GITHUB_EVE_TOOL_MODEL_OUTPUT[name as keyof typeof GITHUB_EVE_TOOL_MODEL_OUTPUT]\n if (!format) {\n return { type: 'json', value: stripped }\n }\n return format(stripped)\n}\n\nexport function createToolRegistry(\n ctx: ToolBuildContext,\n names: readonly GithubToolName[] = ALL_GITHUB_TOOL_NAMES,\n): ToolRegistryEntry[] {\n // Commit-identity options are session-level, not model inputs, so they ride\n // alongside the token instead of living in the tool's input schema.\n const commitExtras: Partial<Record<GithubToolName, Record<string, unknown>>> = {\n createOrUpdateFile: { author: ctx.author, committer: ctx.committer, coAuthors: ctx.coAuthors },\n editFiles: { author: ctx.author, committer: ctx.committer, coAuthors: ctx.coAuthors },\n mergePullRequest: { coAuthors: ctx.coAuthors },\n enablePullRequestAutoMerge: { coAuthors: ctx.coAuthors },\n }\n // Spread after the input, so the branches a merge or branch update may write can't come from the model.\n const branches = ctx.guardrails?.branches\n const guardExtras: Partial<Record<GithubToolName, Record<string, unknown>>> = {\n ...branches && { mergePullRequest: { branches }, enablePullRequestAutoMerge: { branches } },\n ...ctx.guardrails && { updatePullRequestBranch: { guardrails: ctx.guardrails } },\n }\n\n const entries = names.map((name): ToolRegistryEntry => {\n const descriptor = GITHUB_TOOL_CATALOG[name]\n // Argument types vary per tool; `withToken` re-narrows at the dispatch boundary.\n const core = GITHUB_TOOL_CORES[name] as (args: Record<string, unknown> & { token: string }) => Promise<unknown>\n const toModelOutput = EVE_TOOL_MODEL_OUTPUTS[name]\n return {\n name,\n ...(isGithubWriteToolName(name) && { writeTool: name }),\n description: descriptor.description,\n inputSchema: descriptor.inputSchema,\n execute: withToken(core, ctx, commitExtras[name], guardExtras[name]),\n ...(toModelOutput && { toModelOutput }),\n }\n })\n\n if (!ctx.context) return entries\n\n return entries.map(entry => ({\n ...entry,\n inputSchema: softenContextSchema(entry.inputSchema, ctx.context!),\n }))\n}\n","import { mergeContextArgs } from '../core/context'\nimport { EvlogError, githubToolsErrors, toModelErrorPayload } from '../core/errors'\nimport { guardrailViolation } from '../core/guardrails'\nimport { dryRunWrite } from '../core/dry-run'\nimport { isGithubWriteToolName } from '../core/catalog'\nimport { githubTokenCall, resolveGithubToken } from '../core/token'\nimport { ALL_GITHUB_TOOL_NAMES, createToolRegistry, type GithubToolName, type ToolBuildContext } from './registry'\n\nasync function executeGithubToolStep(\n name: GithubToolName,\n input: Record<string, unknown>,\n ctx: ToolBuildContext,\n) {\n 'use step'\n const [entry] = createToolRegistry(ctx, ALL_GITHUB_TOOL_NAMES.filter(tool => tool === name))\n if (!entry) {\n throw new Error(`Unknown GitHub tool: ${name}`)\n }\n return entry.execute(input)\n}\n\n/** Why `guardrails` block a call once `context` defaults are applied, or `undefined` when they allow it. */\nexport function githubGuardrailViolation(\n name: GithubToolName,\n input: Record<string, unknown>,\n { context, guardrails }: Pick<ToolBuildContext, 'context' | 'guardrails'>,\n) {\n return guardrailViolation(githubTokenCall(name, mergeContextArgs(input, context ?? {})), guardrails)\n}\n\nfunction isErrorResult(result: unknown): result is { error: string } {\n return typeof result === 'object' && result !== null && 'error' in result && typeof result.error === 'string'\n}\n\n// An Octokit error holds the request's URL, headers, and body, and its response.\nfunction withoutRequest(error: unknown) {\n if (!(error instanceof Error) || !('request' in error || 'response' in error)) return error\n const reduced = new Error(error.message)\n reduced.name = error.name\n return reduced\n}\n\nexport async function runGithubToolStep(\n name: GithubToolName,\n input: Record<string, unknown>,\n ctx: ToolBuildContext,\n) {\n try {\n // Resolve the token before entering the step so only a serializable string crosses the boundary.\n const call = githubTokenCall(name, mergeContextArgs(input, ctx.context ?? {}))\n const reason = guardrailViolation(call, ctx.guardrails)\n if (reason) throw githubToolsErrors.GUARDRAIL_BLOCKED({ reason })\n if (ctx.dryRun && isGithubWriteToolName(name)) return dryRunWrite(name, call.input as Record<string, unknown>, ctx.guardrails, () => ctx.dryRunApproval)\n const token = await resolveGithubToken(ctx.token, call)\n const result = await executeGithubToolStep(name, input, { ...ctx, token })\n // Some GraphQL tools return `{ error }` when GitHub has no such repository, thread, or discussion.\n if (isErrorResult(result)) throw new Error(result.error)\n return result\n } catch (error) {\n // eve gives the model a thrown error's message, and reads `code` and `message` from it for `call.settled`.\n // A catalog error's message is its { code, message, why, fix, link } so the model can recover.\n // eve also logs the error with its cause chain, so what is thrown holds nothing from the GitHub request.\n if (EvlogError.isEvlogError(error)) throw new Error(JSON.stringify(toModelErrorPayload(error)), { cause: { code: error.code, status: error.status } })\n throw withoutRequest(error)\n }\n}\n","import type { ToolDefinition } from 'eve/tools'\nimport { resolvePresetTools, type CombinedPresetToolNames, type GithubToolPreset, type PresetToolName } from '../core/presets'\nimport { createGithubTokenResolver } from '../core/token'\nimport { isEveApprovalDisabled, mapEveApprovalValue, resolveEveToolApproval } from './approval'\nimport { getEveTools } from './load-eve'\nimport { ALL_GITHUB_TOOL_NAMES, createToolRegistry, formatGithubEveToolOutput, hasGithubEveToolModelOutput, type GithubToolName, type ToolBuildContext } from './registry'\nimport { runGithubToolStep } from './steps'\nimport type { EveGithubToolsOptions, EveToolFactoryOptions, EveToolOverrides } from './types'\n\ntype BuildOptions = EveGithubToolsOptions | (EveToolFactoryOptions & { preset?: EveGithubToolsOptions['preset'] })\ntype EveToolMap = Partial<Record<GithubToolName, ToolDefinition>>\n\nfunction resolveAllowedToolNames(\n options: Pick<EveGithubToolsOptions, 'preset' | 'include' | 'exclude'>,\n): (name: GithubToolName) => boolean {\n const presetAllowed = options.preset ? resolvePresetTools(options.preset) : null\n const includeAllowed = options.include ? new Set(options.include) : null\n const excluded = options.exclude ? new Set(options.exclude) : null\n\n // `preset` and `include` compose as a union (add tools a preset is missing);\n // `exclude` always subtracts from that combined set afterward.\n const allowed = presetAllowed && includeAllowed\n ? new Set([...presetAllowed, ...includeAllowed])\n : presetAllowed ?? includeAllowed\n\n return name => (!allowed || allowed.has(name)) && !excluded?.has(name)\n}\n\nfunction applyOverrides<T extends ToolDefinition>(\n tool: T,\n name: GithubToolName,\n overrides?: EveToolOverrides,\n): T {\n const override = overrides?.[name]\n if (!override) return tool\n\n const next: T = {\n ...tool,\n ...override.description !== undefined && { description: override.description },\n ...override.toModelOutput !== undefined && { toModelOutput: override.toModelOutput },\n ...override.outputSchema !== undefined && { outputSchema: override.outputSchema },\n }\n\n if (override.approval === undefined) return next\n if (isEveApprovalDisabled(override.approval)) {\n const rest = { ...next }\n delete (rest as { approval?: unknown }).approval\n return rest\n }\n // Preserve policies and `ApprovalConfiguration` objects as-is; only literals need mapping.\n const approval = typeof override.approval === 'function' || typeof override.approval === 'object'\n ? override.approval\n : mapEveApprovalValue(override.approval)\n return { ...next, approval }\n}\n\nexport function buildEveToolDefinition(\n name: GithubToolName,\n options: BuildOptions = {},\n): ToolDefinition {\n const { defineTool } = getEveTools()\n const ctx: ToolBuildContext = {\n token: createGithubTokenResolver(options.token),\n context: options.context,\n author: options.author,\n committer: options.committer,\n coAuthors: options.coAuthors,\n guardrails: options.guardrails,\n dryRun: options.dryRun,\n dryRunApproval: options.dryRunApproval,\n }\n\n const [entry] = createToolRegistry(ctx, ALL_GITHUB_TOOL_NAMES.filter(tool => tool === name))\n if (!entry) {\n throw new Error(`Unknown GitHub tool: ${name}`)\n }\n\n const approval = entry.writeTool\n ? resolveEveToolApproval(entry.writeTool, options.requireApproval)\n : undefined\n\n // Annotated so defineTool resolves to its ToolDefinition overload — inference\n // from the bare literal picks the background-tool overload on eve 0.45+.\n const definition: ToolDefinition = {\n description: entry.description,\n inputSchema: entry.inputSchema,\n ...(approval && { approval }),\n toModelOutput: (output: unknown) => formatGithubEveToolOutput(name, output),\n execute: async (input) => runGithubToolStep(name, input as Record<string, unknown>, ctx),\n }\n\n return applyOverrides(defineTool(definition), name, options.overrides)\n}\n\nexport function buildEveToolMap(options: EveGithubToolsOptions = {}): EveToolMap {\n const { defineTool } = getEveTools()\n const ctx: ToolBuildContext = {\n token: createGithubTokenResolver(options.token),\n context: options.context,\n author: options.author,\n committer: options.committer,\n coAuthors: options.coAuthors,\n guardrails: options.guardrails,\n dryRun: options.dryRun,\n dryRunApproval: options.dryRunApproval,\n }\n\n const isAllowed = resolveAllowedToolNames(options)\n const registry = createToolRegistry(ctx)\n const tools = {} as EveToolMap\n\n for (const entry of registry) {\n if (!isAllowed(entry.name)) continue\n\n const approval = entry.writeTool\n ? resolveEveToolApproval(entry.writeTool, options.requireApproval)\n : undefined\n\n const definition: ToolDefinition = {\n description: entry.description,\n inputSchema: entry.inputSchema,\n ...(approval && { approval }),\n toModelOutput: (output: unknown) => formatGithubEveToolOutput(entry.name, output),\n execute: async (input) => runGithubToolStep(entry.name, input as Record<string, unknown>, ctx),\n }\n\n tools[entry.name] = applyOverrides(defineTool(definition), entry.name, options.overrides)\n }\n\n return tools\n}\n\nexport function createEveGithubToolsDynamic(options: EveGithubToolsOptions = {}) {\n const { defineDynamic } = getEveTools()\n\n // TODO(eve-auth): resolve token from ctx.getToken('github') when eve-managed auth lands.\n // Deferred — eve does not yet expose managed GitHub tokens on the session context.\n return defineDynamic(() => buildEveToolMap(options))\n}\n\nexport function listResolvedEveToolNames(options?: { preset?: undefined, include?: undefined, exclude?: undefined }): GithubToolName[]\nexport function listResolvedEveToolNames<P extends GithubToolPreset>(options: { preset: P, include?: undefined, exclude?: undefined }): PresetToolName<P>[]\nexport function listResolvedEveToolNames<P extends readonly GithubToolPreset[]>(options: { preset: P, include?: undefined, exclude?: undefined }): CombinedPresetToolNames<P>[]\nexport function listResolvedEveToolNames(options: Pick<EveGithubToolsOptions, 'preset' | 'include' | 'exclude'>): GithubToolName[]\nexport function listResolvedEveToolNames(options: Pick<EveGithubToolsOptions, 'preset' | 'include' | 'exclude'> = {}): GithubToolName[] {\n const isAllowed = resolveAllowedToolNames(options)\n return ALL_GITHUB_TOOL_NAMES.filter(isAllowed)\n}\n\n/**\n * Tool descriptors (no `execute`) for authored eve `defineTool` loops.\n * Prefer this when registering tools outside the SDK package so durable transforms can hoist inline execute.\n */\nexport function listEveToolDescriptors(options: EveGithubToolsOptions = {}) {\n const ctx: ToolBuildContext = {\n token: createGithubTokenResolver(options.token),\n context: options.context,\n author: options.author,\n committer: options.committer,\n coAuthors: options.coAuthors,\n guardrails: options.guardrails,\n dryRun: options.dryRun,\n dryRunApproval: options.dryRunApproval,\n }\n\n const names = listResolvedEveToolNames(options)\n return createToolRegistry(ctx, names)\n .map(entry => ({\n name: entry.name,\n description: entry.description,\n inputSchema: entry.inputSchema,\n writeTool: entry.writeTool,\n toModelOutput: entry.toModelOutput,\n }))\n}\n\nexport { formatGithubEveToolOutput, hasGithubEveToolModelOutput }\n\n/**\n * Execute a GitHub tool by name with the given eve options (token/context/attribution).\n * A failed call throws, so eve settles it as `failed`. For a catalog error, the message is\n * its `{ code, message, why, fix, link }` as JSON and `cause` is its `{ code, status }`.\n * The thrown error holds nothing from the GitHub request.\n * Used by `@github-tools/eve-extension` so `execute` only closes over a serializable tool name.\n */\nexport async function executeGithubEveTool(\n name: GithubToolName,\n input: Record<string, unknown>,\n options: EveGithubToolsOptions = {},\n) {\n const ctx: ToolBuildContext = {\n token: createGithubTokenResolver(options.token),\n context: options.context,\n author: options.author,\n committer: options.committer,\n coAuthors: options.coAuthors,\n guardrails: options.guardrails,\n dryRun: options.dryRun,\n dryRunApproval: options.dryRunApproval,\n }\n return runGithubToolStep(name, input, ctx)\n}\n","import { createOctokit } from '../client'\nimport { isGithubWriteToolName } from './catalog'\nimport { EvlogError, githubToolsErrors } from './errors'\nimport { getCollaboratorPermissionCore } from './repository'\nimport { createGithubTokenResolver, type GithubTokenInput, type GithubTokenResolver } from './token'\nimport type { GithubToolName } from './tool-names'\n\n/** GitHub's repository roles, lowest first. */\nexport const GITHUB_ROLES = ['read', 'triage', 'write', 'maintain', 'admin'] as const\n\nexport type GithubRole = typeof GITHUB_ROLES[number]\n\n/**\n * Rank of an answer from GitHub's collaborator permission endpoint in {@link GITHUB_ROLES}, or `-1`\n * without access. A custom role ranks as the base permission GitHub reports for it.\n */\nexport function githubRoleRank({ permission, roleName }: { permission: string, roleName?: string }): number {\n const role = GITHUB_ROLES.indexOf(roleName as GithubRole)\n return role >= 0 ? role : GITHUB_ROLES.indexOf(permission as GithubRole)\n}\n\ntype Repository = { owner: string, repo: string }\n\n/** A person the tools act for with a token that isn't theirs, such as a GitHub App's. */\nexport type GithubCaller = {\n /** Their GitHub login. */\n login: string\n /** The repository they asked from. A search runs only when its token reaches this repository and no other. */\n repository?: Repository\n}\n\n// A role is read on every call, so an agent turn would otherwise ask GitHub the same question many times.\nconst ROLE_TTL_MS = 60_000\nconst MAX_CACHED_ROLES = 500\nconst roles = new Map<string, { expires: number, rank: Promise<number> }>()\n\nfunction callerRank(resolve: GithubTokenResolver, login: string, { owner, repo }: Repository): Promise<number> {\n const key = `${login}\\n${owner}/${repo}`.toLowerCase()\n const cached = roles.get(key)\n if (cached && cached.expires > Date.now()) return cached.rank\n const input = { owner, repo, username: login }\n const rank = resolve({ toolName: 'getCollaboratorPermission', input, owner, repo })\n .then(token => getCollaboratorPermissionCore({ token, ...input }))\n .then(githubRoleRank)\n roles.set(key, { expires: Date.now() + ROLE_TTL_MS, rank })\n rank.catch(() => roles.delete(key))\n if (roles.size > MAX_CACHED_ROLES) roles.delete(roles.keys().next().value!)\n return rank\n}\n\nconst refusal = (reason: string) => githubToolsErrors.CALLER_FORBIDDEN({ reason })\n\nasync function requireRole(resolve: GithubTokenResolver, login: string, toolName: GithubToolName, repository: Repository, role: GithubRole) {\n const rank = await callerRank(resolve, login, repository)\n if (rank < GITHUB_ROLES.indexOf(role)) {\n throw refusal(`${login} has ${rank < 0 ? 'no' : GITHUB_ROLES[rank]} access to ${repository.owner}/${repository.repo}, and \\`${toolName}\\` needs ${role} access.`)\n }\n}\n\nconst REVIEW_THREAD_REPOSITORY = /* GraphQL */ `\n query ReviewThreadRepository($threadId: ID!) {\n node(id: $threadId) {\n ... on PullRequestReviewThread {\n repository {\n name\n owner {\n login\n }\n }\n }\n }\n }\n`\n\nasync function reviewThreadRepository(token: string, threadId: unknown): Promise<Repository | undefined> {\n const data = await createOctokit(token).graphql<{ node: { repository?: { name: string, owner: { login: string } } } | null }>(REVIEW_THREAD_REPOSITORY, { threadId })\n const repository = data.node?.repository\n return repository && { owner: repository.owner.login, repo: repository.name }\n}\n\n// A search has no target to check a role on, so it may only run with a token that sees one repository.\n// Only an installation token can list what it reaches: GitHub answers 403 or 404 to any other.\nasync function reachesOnly(token: string, { owner, repo }: Repository): Promise<boolean> {\n try {\n const { data } = await createOctokit(token).rest.apps.listReposAccessibleToInstallation({ per_page: 2 })\n return data.total_count === 1 && data.repositories[0]?.full_name.toLowerCase() === `${owner}/${repo}`.toLowerCase()\n } catch (error) {\n if (EvlogError.isEvlogError(error) && (error.status === 403 || error.status === 404)) return false\n throw error\n }\n}\n\nconst SEARCH_TOOLS: ReadonlySet<GithubToolName> = new Set(['searchCode', 'searchIssues', 'searchRepositories'])\n\n/**\n * Wrap a token so every call it resolves for is first checked against what `caller` may do, read\n * from GitHub with that same token. Use it when the tools run with a GitHub App's token for a person\n * who can't get their own, such as someone commenting on GitHub: the App then does nothing that\n * person couldn't. A refused call throws `github_tools.CALLER_FORBIDDEN` before it reaches GitHub.\n *\n * - A call on a repository needs the Read role there for a read and Write for a write, which is\n * stricter than GitHub for the writes a reader can make, such as a comment. `addSubIssue` also\n * needs Read on the sub-issue's repository.\n * - `resolveReviewThread` needs Write on the repository the thread is in.\n * - A search needs `caller.repository`, the Read role there, and a token that reaches that\n * repository and no other, so it can't return results from one the caller can't see.\n * - Every other call without a repository is refused, since no role on a repository covers it:\n * gists, notifications, `createRepository` and `forkRepository`.\n */\nexport function withGithubCallerAccess(token: GithubTokenInput | undefined, caller: GithubCaller): GithubTokenResolver {\n const resolve = createGithubTokenResolver(token)\n const { login } = caller\n return async (call) => {\n if (!call) throw new Error('`withGithubCallerAccess` needs the tool call to check the caller\\'s access.')\n const { toolName } = call\n if (toolName === 'createRepository' || toolName === 'forkRepository') {\n throw refusal(`\\`${toolName}\\` creates a repository, which no role on a repository allows, so it can't run for ${login}.`)\n }\n if (call.owner && call.repo) {\n const { owner } = call\n await requireRole(resolve, login, toolName, { owner, repo: call.repo }, isGithubWriteToolName(toolName) ? 'write' : 'read')\n const { subIssueRepo } = call.input as Record<string, unknown>\n if (toolName === 'addSubIssue' && typeof subIssueRepo === 'string') await requireRole(resolve, login, toolName, { owner, repo: subIssueRepo }, 'read')\n return resolve(call)\n }\n if (toolName === 'resolveReviewThread') {\n const { threadId } = call.input as Record<string, unknown>\n const repository = await reviewThreadRepository(await resolve({ ...call, ...caller.repository }), threadId)\n if (!repository) throw refusal(`The review thread can't be found, so ${login}'s role on its repository can't be checked.`)\n await requireRole(resolve, login, toolName, repository, 'write')\n return resolve({ ...call, ...repository })\n }\n if (SEARCH_TOOLS.has(toolName) && caller.repository) {\n const { owner, repo } = caller.repository\n await requireRole(resolve, login, toolName, caller.repository, 'read')\n const scoped = await resolve({ ...call, owner, repo })\n if (!await reachesOnly(scoped, caller.repository)) {\n throw refusal(`\\`${toolName}\\` would search every repository the agent's token reaches, not only ${owner}/${repo}, and ${login}'s role can't be checked on all of them.`)\n }\n return scoped\n }\n throw refusal(`\\`${toolName}\\` names no repository, so ${login}'s role can't be checked for it.`)\n }\n}\n","import { createOctokit } from '../client'\nimport type { CommitIdentity } from '../types'\nimport { githubToolsErrors } from './errors'\nimport type { GithubToolName } from './tool-names'\n\n/** A GitHub App's bot account, the identity GitHub shows for what the App writes. */\nexport type GithubAppBot = {\n /** The App's slug, as in `https://github.com/apps/<slug>`. */\n slug: string\n /** The bot's login, `<slug>[bot]`. */\n login: string\n /** The bot's numeric user id. */\n id: number\n}\n\n/** The tools that create a commit and add `coAuthors` to its message. */\nexport const GITHUB_COMMIT_TOOLS: ReadonlySet<GithubToolName> = new Set([\n 'createOrUpdateFile',\n 'editFiles',\n 'mergePullRequest',\n 'enablePullRequestAutoMerge',\n])\n\n/**\n * Read the bot of the GitHub App that issued `token`, a user access token. GitHub lists only that\n * App's installations to such a token, so the first one names the App.\n */\nexport async function githubAppBot(token: string): Promise<GithubAppBot> {\n const octokit = createOctokit(token)\n const { data } = await octokit.rest.apps.listInstallationsForAuthenticatedUser({ per_page: 1 })\n const slug = data.installations[0]?.app_slug\n if (!slug) throw githubToolsErrors.APP_BOT_UNKNOWN()\n const { data: bot } = await octokit.rest.users.getByUsername({ username: `${slug}[bot]` })\n return { slug, login: bot.login, id: bot.id }\n}\n\n/** The bot as a commit identity, with the noreply address GitHub links to its account. */\nexport function githubAppBotIdentity(bot: GithubAppBot): CommitIdentity {\n return { name: bot.login, email: `${bot.id}+${bot.login}@users.noreply.github.com` }\n}\n\n/** `body` with a closing line saying the App generated the pull request. */\nexport function withGithubAppFooter(body: string | undefined, bot: GithubAppBot): string {\n const footer = `Generated by [${bot.slug}](https://github.com/apps/${bot.slug}).`\n return body?.trim() ? `${body.trimEnd()}\\n\\n---\\n\\n${footer}` : footer\n}\n"],"mappings":";;;;;;;;;;;;AAiBA,MAAa,sBACX;AAEF,SAAgB,cAA8B;CAC5C,OAAO;AACT;AAEA,SAAgB,wBAA2C;CACzD,OAAO;AACT;;;;;;;AChBA,SAAgB,sBAAsB,OAA8C;CAClF,OAAO,UAAU,SAAS,UAAU;AACtC;AAEA,SAAgB,oBAAoB,OAAyC;CAC3E,IAAI,OAAO,UAAU,YAAY,OAAO;CAExC,IAAI,OAAO,UAAU,UAAU,OAAO,MAAM;CAE5C,MAAM,EAAE,Q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AE,MAAM,QAAQ,MAAM,QAAQ,KAAK,MAAM,cAAc,EAAE,UAAU,GAAG,KAAK,OAAO,CAAC;CACzF,OAAO;EAAE;EAAM,OAAO,IAAI;EAAO,IAAI,IAAI;CAAG;AAC9C;;AAGA,SAAgB,qBAAqB,KAAmC;CACtE,OAAO;EAAE,MAAM,IAAI;EAAO,OAAO,GAAG,IAAI,GAAG,GAAG,IAAI,MAAM;CAA2B;AACrF;;AAGA,SAAgB,oBAAoB,MAA0B,KAA2B;CACvF,MAAM,SAAS,iBAAiB,IAAI,KAAK,4BAA4B,IAAI,KAAK;CAC9E,OAAO,MAAM,KAAK,IAAI,GAAG,KAAK,QAAQ,EAAE,aAAa,WAAW;AAClE"}
@@ -1,5 +1,5 @@
1
- import { B as PRESET_TOOLS, C as fallbackTools, D as selectTools, E as selectPresets, G as GithubWriteToolName, H as GITHUB_TOOL_NAMES, I as GithubGuardrails, M as GithubTokenCall, O as GITHUB_WRITE_TOOLS, P as resolveGithubToken, R as CombinedPresetToolNames, S as fallbackPresets, T as needsAutoApproval, V as PresetToolName, W as GithubToolName, _ as AutoApprovalDecision, a as GithubToolsForPreset, b as evaluatePresets, c as CommitIdentity, k as AUTO_APPROVAL_TOOLS, n as GithubDryRunResult, o as PickGithubTools, r as AllGithubTools, t as GithubDryRunApproval, v as GithubEvaluationOptions, w as latestUserText, x as evaluateTools, y as autoApprovalDecision, z as GithubToolPreset } from "./dry-run-DXckOam2.mjs";
2
- import { a as EveToolOverrides, i as EveToolFactoryOptions, n as EveApprovalValue, r as EveGithubToolsOptions, t as EveApprovalConfig } from "./types-C7O2lwwz.mjs";
3
- import { $t as resolveToolGuidance, a as GithubRateLimit, i as githubToolsErrors } from "./index-CzzrtCVj.mjs";
4
- import { a as resolveEveApproval, c as buildEveToolMap, d as listEveToolDescriptors, f as listResolvedEveToolNames, i as mapEveApprovalValue, l as createEveGithubToolsDynamic, m as hasGithubEveToolModelOutput, n as githubGuardrailViolation, o as resolveEveToolApproval, p as formatGithubEveToolOutput, r as isEveApprovalDisabled, s as buildEveToolDefinition, t as MISSING_EVE_MESSAGE, u as executeGithubEveTool } from "./eve-runtime-B_CJE9JV.mjs";
5
- export { AUTO_APPROVAL_TOOLS, type AllGithubTools, type AutoApprovalDecision, type CombinedPresetToolNames, type CommitIdentity, type EveApprovalConfig, type EveApprovalValue, type EveGithubToolsOptions, type EveToolFactoryOptions, type EveToolOverrides, GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS, type GithubDryRunApproval, type GithubDryRunResult, type GithubEvaluationOptions, type GithubGuardrails, type GithubRateLimit, type GithubTokenCall, type GithubToolName, type GithubToolPreset, type GithubToolsForPreset, type GithubWriteToolName, MISSING_EVE_MESSAGE, PRESET_TOOLS, type PickGithubTools, type PresetToolName, autoApprovalDecision, buildEveToolDefinition, buildEveToolMap, createEveGithubToolsDynamic, evaluatePresets, evaluateTools, executeGithubEveTool, fallbackPresets, fallbackTools, formatGithubEveToolOutput, githubGuardrailViolation, githubToolsErrors, hasGithubEveToolModelOutput, isEveApprovalDisabled, latestUserText, listEveToolDescriptors, listResolvedEveToolNames, mapEveApprovalValue, needsAutoApproval, resolveEveApproval, resolveEveToolApproval, resolveGithubToken, resolveToolGuidance, selectPresets, selectTools };
1
+ import { B as GithubToolPreset, C as fallbackTools, D as selectTools, E as selectPresets, F as resolveGithubToken, G as GithubToolName, H as PresetToolName, K as GithubWriteToolName, L as GithubGuardrails, M as GithubTokenCall, O as GITHUB_WRITE_TOOLS, S as fallbackPresets, T as needsAutoApproval, U as GITHUB_TOOL_NAMES, V as PRESET_TOOLS, _ as AutoApprovalDecision, a as GithubToolsForPreset, b as evaluatePresets, c as CommitIdentity, k as AUTO_APPROVAL_TOOLS, n as GithubDryRunResult, o as PickGithubTools, r as AllGithubTools, t as GithubDryRunApproval, v as GithubEvaluationOptions, w as latestUserText, x as evaluateTools, y as autoApprovalDecision, z as CombinedPresetToolNames } from "./dry-run-BAbes7Mv.mjs";
2
+ import { a as EveToolOverrides, i as EveToolFactoryOptions, n as EveApprovalValue, r as EveGithubToolsOptions, t as EveApprovalConfig } from "./types-C-BIKmas.mjs";
3
+ import { $t as resolveToolGuidance, a as GithubRateLimit, i as githubToolsErrors } from "./index-v5n5OLs7.mjs";
4
+ import { C as formatGithubEveToolOutput, S as listResolvedEveToolNames, _ as buildEveToolDefinition, a as githubAppBotIdentity, b as executeGithubEveTool, c as GithubCaller, d as withGithubCallerAccess, f as githubGuardrailViolation, g as resolveEveToolApproval, h as resolveEveApproval, i as githubAppBot, l as GithubRole, m as mapEveApprovalValue, n as GITHUB_COMMIT_TOOLS, o as withGithubAppFooter, p as isEveApprovalDisabled, r as GithubAppBot, s as GITHUB_ROLES, t as MISSING_EVE_MESSAGE, u as githubRoleRank, v as buildEveToolMap, w as hasGithubEveToolModelOutput, x as listEveToolDescriptors, y as createEveGithubToolsDynamic } from "./eve-runtime-CoBSN8nF.mjs";
5
+ export { AUTO_APPROVAL_TOOLS, type AllGithubTools, type AutoApprovalDecision, type CombinedPresetToolNames, type CommitIdentity, type EveApprovalConfig, type EveApprovalValue, type EveGithubToolsOptions, type EveToolFactoryOptions, type EveToolOverrides, GITHUB_COMMIT_TOOLS, GITHUB_ROLES, GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS, type GithubAppBot, type GithubCaller, type GithubDryRunApproval, type GithubDryRunResult, type GithubEvaluationOptions, type GithubGuardrails, type GithubRateLimit, type GithubRole, type GithubTokenCall, type GithubToolName, type GithubToolPreset, type GithubToolsForPreset, type GithubWriteToolName, MISSING_EVE_MESSAGE, PRESET_TOOLS, type PickGithubTools, type PresetToolName, autoApprovalDecision, buildEveToolDefinition, buildEveToolMap, createEveGithubToolsDynamic, evaluatePresets, evaluateTools, executeGithubEveTool, fallbackPresets, fallbackTools, formatGithubEveToolOutput, githubAppBot, githubAppBotIdentity, githubGuardrailViolation, githubRoleRank, githubToolsErrors, hasGithubEveToolModelOutput, isEveApprovalDisabled, latestUserText, listEveToolDescriptors, listResolvedEveToolNames, mapEveApprovalValue, needsAutoApproval, resolveEveApproval, resolveEveToolApproval, resolveGithubToken, resolveToolGuidance, selectPresets, selectTools, withGithubAppFooter, withGithubCallerAccess };
@@ -1,4 +1,4 @@
1
- import { S as resolveGithubToken, Za as githubToolsErrors, c as AUTO_APPROVAL_TOOLS, g as GITHUB_TOOL_NAMES, r as resolveToolGuidance, t as GITHUB_WRITE_TOOLS, v as PRESET_TOOLS } from "./write-tools-w-8tjnDQ.mjs";
2
- import { c as latestUserText, d as selectTools, i as evaluateTools, l as needsAutoApproval, n as autoApprovalDecision, o as fallbackPresets, r as evaluatePresets, s as fallbackTools, u as selectPresets } from "./evaluation-DJHINyAu.mjs";
3
- import { a as listEveToolDescriptors, c as formatGithubEveToolOutput, d as mapEveApprovalValue, f as resolveEveApproval, i as executeGithubEveTool, l as hasGithubEveToolModelOutput, m as MISSING_EVE_MESSAGE, n as buildEveToolMap, o as listResolvedEveToolNames, p as resolveEveToolApproval, r as createEveGithubToolsDynamic, s as githubGuardrailViolation, t as buildEveToolDefinition, u as isEveApprovalDisabled } from "./eve-runtime-DPzMPCLt.mjs";
4
- export { AUTO_APPROVAL_TOOLS, GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS, MISSING_EVE_MESSAGE, PRESET_TOOLS, autoApprovalDecision, buildEveToolDefinition, buildEveToolMap, createEveGithubToolsDynamic, evaluatePresets, evaluateTools, executeGithubEveTool, fallbackPresets, fallbackTools, formatGithubEveToolOutput, githubGuardrailViolation, githubToolsErrors, hasGithubEveToolModelOutput, isEveApprovalDisabled, latestUserText, listEveToolDescriptors, listResolvedEveToolNames, mapEveApprovalValue, needsAutoApproval, resolveEveApproval, resolveEveToolApproval, resolveGithubToken, resolveToolGuidance, selectPresets, selectTools };
1
+ import { S as resolveGithubToken, Za as githubToolsErrors, c as AUTO_APPROVAL_TOOLS, g as GITHUB_TOOL_NAMES, r as resolveToolGuidance, t as GITHUB_WRITE_TOOLS, v as PRESET_TOOLS } from "./write-tools-C-962T9O.mjs";
2
+ import { c as latestUserText, d as selectTools, i as evaluateTools, l as needsAutoApproval, n as autoApprovalDecision, o as fallbackPresets, r as evaluatePresets, s as fallbackTools, u as selectPresets } from "./evaluation-Dlf-571x.mjs";
3
+ import { _ as isEveApprovalDisabled, a as GITHUB_ROLES, b as resolveEveToolApproval, c as buildEveToolDefinition, d as executeGithubEveTool, f as listEveToolDescriptors, g as hasGithubEveToolModelOutput, h as formatGithubEveToolOutput, i as withGithubAppFooter, l as buildEveToolMap, m as githubGuardrailViolation, n as githubAppBot, o as githubRoleRank, p as listResolvedEveToolNames, r as githubAppBotIdentity, s as withGithubCallerAccess, t as GITHUB_COMMIT_TOOLS, u as createEveGithubToolsDynamic, v as mapEveApprovalValue, x as MISSING_EVE_MESSAGE, y as resolveEveApproval } from "./eve-runtime-DEdQqbCs.mjs";
4
+ export { AUTO_APPROVAL_TOOLS, GITHUB_COMMIT_TOOLS, GITHUB_ROLES, GITHUB_TOOL_NAMES, GITHUB_WRITE_TOOLS, MISSING_EVE_MESSAGE, PRESET_TOOLS, autoApprovalDecision, buildEveToolDefinition, buildEveToolMap, createEveGithubToolsDynamic, evaluatePresets, evaluateTools, executeGithubEveTool, fallbackPresets, fallbackTools, formatGithubEveToolOutput, githubAppBot, githubAppBotIdentity, githubGuardrailViolation, githubRoleRank, githubToolsErrors, hasGithubEveToolModelOutput, isEveApprovalDisabled, latestUserText, listEveToolDescriptors, listResolvedEveToolNames, mapEveApprovalValue, needsAutoApproval, resolveEveApproval, resolveEveToolApproval, resolveGithubToken, resolveToolGuidance, selectPresets, selectTools, withGithubAppFooter, withGithubCallerAccess };