gaunt-sloth-assistant
Version:
> ⚠️ **`gaunt-sloth-assistant` has been renamed to [`gaunt-sloth`](https://www.npmjs.com/package/gaunt-sloth).** > The `1.5.x` series is the final release under the old name — active development continues under > the new package. To switch: > > ```bash >
55 lines (54 loc) • 2.64 kB
TypeScript
import type { CustomToolsConfig, GthConfig, ServerTool } from '@gaunt-sloth/core/config.js';
import { type BaseToolkit, StructuredToolInterface } from '@langchain/core/tools';
export declare const GSLOTH_PR_DISCOVERY_PROMPT = ".gsloth.pr-discovery.md";
export interface PrDiscoveryConfig {
/**
* Enable change requirements discovery when neither PR id nor requirements id is provided.
* @default true
*/
enabled?: boolean;
/**
* Fetch the current-branch PR diff with `gh pr diff` before invoking the discovery agent.
* The discovery agent can still replace it with the `set_diff` tool if needed.
* @default true
*/
deterministicDiff?: boolean;
/**
* Optional tool overrides used only while the discovery agent runs.
* When omitted, the normal configured tools remain available.
*/
filesystem?: string[] | 'all' | 'read' | 'none';
builtInTools?: string[];
customTools?: CustomToolsConfig | false;
tools?: StructuredToolInterface[] | BaseToolkit[] | ServerTool[];
/**
* Restrict the discovery agent to this allow-list of tool names, applied after every tool
* source (filesystem, built-in, custom, MCP, A2A, and `tools`) is resolved. Unlike
* `builtInTools`/`customTools`/`filesystem` (which gate whole tool groups), this trims the
* final tool set by exact name, so it can pare down MCP server tools
* (e.g. "mcp__jira__getJiraIssue") and the discovery helper tools
* ("gh_pr"/"gh_diff"/"gh_issue"/"set_diff") to the minimum needed.
*
* `set_requirements` is always retained regardless, since it is how the discovery agent
* records the requirements it found. When omitted, all resolved tools remain available; an
* empty array keeps only `set_requirements`. The discovery agent never inherits the
* top-level {@link GthConfig.allowedTools}; this property is its only allow-list.
*/
allowedTools?: string[];
}
declare module '@gaunt-sloth/core/config.js' {
interface PrCommandConfig {
/** Change requirements discovery (`gth pr` with no arguments) configuration. */
discovery?: PrDiscoveryConfig;
}
}
/**
* Read the PR discovery agent prompt, honouring project / identity-profile
* overrides and falling back to the default prompt shipped with the assistant package.
*/
export declare function readPrDiscoveryPrompt(config: Pick<GthConfig, 'identityProfile' | 'noDefaultPrompts'>): string;
export interface PrDiscoveryResult {
diff: string;
requirements: string;
}
export declare function runPrDiscovery(config: GthConfig): Promise<PrDiscoveryResult>;