import { z, type ZodRawShape } from 'zod'; import type { InstanceAuthSummary } from '@salesforce/b2c-tooling-sdk/auth'; /** Input shared by MCP tools that resolve files or configuration from a project. */ export interface ProjectContextInput { /** Per-call project directory override. */ projectDirectory?: string; /** Per-call explicit primary dw.json-format configuration path. */ configPath?: string; /** Per-call named instance selection. */ instanceName?: string; } /** Effective project directory and the source that selected it. */ export interface ProjectDirectoryInfo { path: string; source: 'argument' | 'config' | 'cwd'; } /** How the selected dw.json file entered the configuration resolver. */ export type ConfigurationResolutionSource = 'argument' | 'globalDefault' | 'none' | 'projectDirectory' | 'projectEnvironment' | 'server'; /** Compact selected-configuration provenance returned by project-aware tools. */ export interface ConfigurationResolutionInfo { hostname?: string; instanceName?: string; path?: string; source: ConfigurationResolutionSource; } /** Provenance for a specialized project-relative directory. */ export interface DirectoryResolutionInfo { path: string; source: 'argument' | 'projectDirectory'; } /** * How one kind of request to the instance authenticates. `browser-login` is an * Account Manager sign-in in the user's browser; its session belongs to the * client, not the instance, so it can also serve other instances. */ export interface AuthPathResolutionInfo { method: 'basic' | 'browser-login' | 'client-credentials' | 'jwt' | 'none'; /** `built-in` for the toolkit's public client, otherwise the client ID. */ client?: string; /** Browser-login session state; `none` means the next call opens a sign-in. */ session?: 'expired' | 'none' | 'renewable' | 'signed-in'; /** Account Manager user of the session, when signed in. */ user?: string; } /** How a tool call authenticated against the instance, per request type. */ export interface AuthResolutionInfo { ocapi: AuthPathResolutionInfo; scapi: AuthPathResolutionInfo; webdav: AuthPathResolutionInfo; } /** Compact, common provenance block returned by project/config-aware tools. */ export interface ToolResolution { auth?: AuthResolutionInfo; configuration?: ConfigurationResolutionInfo; directories?: Record; projectDirectory: ProjectDirectoryInfo; } /** Reduce an instance auth summary to the compact form attached to tool results. */ export declare function toAuthResolution(summary: InstanceAuthSummary): AuthResolutionInfo; /** Whether a tool needs only a project root or full configuration selection. */ export type ProjectContextKind = 'configuration' | 'project'; /** Build the canonical project-directory field. */ export declare function createProjectDirectoryInput(): z.ZodOptional; /** Build the canonical explicit primary dw.json field. */ export declare function createConfigPathInput(): z.ZodOptional; /** Build the canonical named-instance selection field. */ export declare function createInstanceNameInput(): z.ZodOptional; /** Build flat canonical schema fields for a local-project or configuration-aware tool. */ export declare function createProjectContextInputSchema(kind: ProjectContextKind): ZodRawShape; /** Static field for schemas declared outside the shared adapter. */ export declare const projectDirectoryInput: z.ZodOptional; /** Static configuration schema for legacy/manual tool definitions. */ export declare const projectContextInputSchema: Readonly<{ [k: string]: z.core.$ZodType>; }>;