import { Hono } from 'hono'; import { type McpServerConfig } from '../../services/mcp-manager.js'; /** A connected Salesforce org as surfaced to the web console. */ export type ConnectedOrg = { alias: string; username: string; isDefaultUsername: boolean; instanceUrl: string; }; export declare function isValidAlias(alias: unknown): alias is string; /** * Instance URL must be an https URL whose host is exactly `salesforce.com` or a * subdomain of it (e.g. `login.salesforce.com`, `myorg.my.salesforce.com`). * This blocks attacker-controlled login hosts and non-https schemes. */ export declare function isValidInstanceUrl(instanceUrl: unknown): instanceUrl is string; /** Build the argv for `sf org login web`. Exported for unit testing. */ export declare function buildLoginArgs(alias: string, instanceUrl: string): string[]; /** Build the argv for `sf config set target-org`. Exported for unit testing. */ export declare function buildSetDefaultArgs(alias: string): string[]; /** * Build the argv for `sf config unset target-org`. Clears the default-org config * WITHOUT logging the org out — the auth/connection survives, only the default * pointer is removed. Exported for unit testing. */ export declare function buildUnsetDefaultArgs(): string[]; /** The MCP server name written for the Salesforce MCP entry. */ export declare const SALESFORCE_MCP_SERVER_NAME = "salesforce"; /** * Build the MCP server config for `@salesforce/mcp` scoped to one org alias. * Runs via `npx -y @salesforce/mcp -o --toolsets `. Exported * for unit testing. The alias is passed as a discrete argv element (never shell * interpolated) and must already be validated by `isValidAlias`. */ export declare function buildSalesforceMcpConfig(alias: string, toolset?: 'all' | 'core'): McpServerConfig; type SfOrgEntry = { alias?: string; username?: string; isDefaultUsername?: boolean; instanceUrl?: string; }; type SfOrgListResult = { result?: { nonScratchOrgs?: SfOrgEntry[]; scratchOrgs?: SfOrgEntry[]; }; }; /** * Normalize a raw `sf org list --json` payload into the console org shape. * * `defaultTargets` is the set of identifiers that may name the default org (the * raw `target-org` config value plus, when it's an alias, the username it * resolves to) — needed because `--skip-connection-status` leaves every entry's * `isDefaultUsername` false (that flag is only populated during the full * connection resolution we skip for speed). We mark the default by matching each * org's alias or username against that set. */ export declare function mapOrgList(parsed: SfOrgListResult, defaultTargets?: ReadonlySet): ConnectedOrg[]; export declare function orgsRoute(cwd: string): Hono; export {};