/**
 * @fileoverview `disabledTool()` wrapper — marks a tool definition as present
 * in the manifest (and rendered on the HTTP landing page) but skipped during
 * MCP server registration. The result: clients cannot invoke the tool, but
 * operators reading the landing page see it exists with a reason and an
 * optional hint for how to enable it.
 *
 * Designed to compose with feature-flag conditionals at definition time:
 *
 * ```ts
 * const def = tool('brapi_submit_observations', { ... });
 * export const submitObservations = getServerConfig().enableWrites
 *   ? def
 *   : disabledTool(def, {
 *       reason: 'Writes are disabled in this deployment.',
 *       hint: 'Set BRAPI_ENABLE_WRITES=true to enable.',
 *     });
 * ```
 *
 * The wrapper deliberately leaves the public `ToolDefinition` interface and
 * the `tool()` builder untouched — `disabled` is an internal-facing field
 * that only the registry, manifest, and landing renderer read.
 *
 * @module src/mcp-server/tools/utils/disabled-tool
 */
/**
 * Internal string-keyed marker attached to wrapped definitions. Kept off the
 * public `ToolDefinition` interface so the `tool()` builder stays unchanged;
 * `getDisabledMetadata()` is the only sanctioned reader.
 */
const DISABLED_KEY = '__mcpDisabled';
/**
 * Wrap a tool definition to mark it disabled. The returned definition retains
 * every property of the original (so the linter, manifest, and schema preview
 * all keep working) and adds an internal `__mcpDisabled` field that the
 * registry checks before deciding whether to register the tool with the MCP
 * server.
 *
 * @param def  The original tool definition.
 * @param meta The reason (and optional hint) shown on the landing page.
 * @returns The same definition with the disabled marker attached.
 */
export function disabledTool(def, meta) {
    return { ...def, [DISABLED_KEY]: meta };
}
/**
 * Predicate + extractor in one call: returns the `DisabledMetadata` when the
 * definition was wrapped with `disabledTool()`, or `undefined` otherwise.
 * Internal — used by `ToolRegistry` and `buildServerManifest()`.
 */
export function getDisabledMetadata(def) {
    return def[DISABLED_KEY];
}
//# sourceMappingURL=disabled-tool.js.map