// @bun
var __defProp = Object.defineProperty;
var __returnValue = (v) => v;
function __exportSetter(name, newValue) {
  this[name] = __returnValue.bind(null, newValue);
}
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, {
      get: all[name],
      enumerable: true,
      configurable: true,
      set: __exportSetter.bind(all, name)
    });
};
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
var __require = import.meta.require;

// src/i18n/catalogs/en.ts
import { defineTranslation } from "@contractspec/lib.contracts-spec/translations";
var enMessages;
var init_en = __esm(() => {
  enMessages = defineTranslation({
    meta: {
      key: "ai-agent.messages",
      version: "1.0.0",
      domain: "ai-agent",
      description: "All user-facing, LLM-facing, and developer-facing strings for the ai-agent package",
      owners: ["platform"],
      stability: "experimental"
    },
    locale: "en",
    fallback: "en",
    messages: {
      "agent.json.rules.validJsonOnly": {
        value: "You MUST output valid JSON ONLY.",
        description: "JSON runner rule: output must be valid JSON"
      },
      "agent.json.rules.noMarkdownFences": {
        value: "Do not wrap the output in markdown fences.",
        description: "JSON runner rule: no markdown code fences"
      },
      "agent.json.rules.noCommentary": {
        value: "Do not include commentary or explanation.",
        description: "JSON runner rule: no extra text"
      },
      "agent.json.rules.doubleQuotes": {
        value: "Use double quotes for all keys and string values.",
        description: "JSON runner rule: double quotes only"
      },
      "agent.json.rules.noTrailingCommas": {
        value: "Do not include trailing commas.",
        description: "JSON runner rule: no trailing commas"
      },
      "agent.json.defaultDescription": {
        value: "JSON-only agent runner for deterministic pipelines.",
        description: "Default description for the JSON runner spec"
      },
      "agent.json.systemPrompt": {
        value: "You are a precise JSON generator.",
        description: "Default system prompt for the JSON runner"
      },
      "knowledge.header": {
        value: "# Reference Knowledge",
        description: "Header for injected knowledge section in system prompt"
      },
      "knowledge.description": {
        value: "The following information is provided for your reference. Use it to inform your responses.",
        description: "Description below the knowledge header"
      },
      "tool.knowledge.description": {
        value: "Query knowledge bases for relevant information. Use this tool when you need to look up specific information that may not be in your context.",
        description: "Description for the knowledge query tool shown to the LLM"
      },
      "tool.knowledge.availableSpaces": {
        value: "Available knowledge spaces:",
        description: "Label before listing available knowledge spaces"
      },
      "tool.knowledge.spaceDefault": {
        value: "Knowledge space",
        description: "Fallback description for unnamed knowledge spaces"
      },
      "tool.knowledge.param.query": {
        value: "The question or search query to find relevant information",
        description: "Parameter description for the query field"
      },
      "tool.knowledge.param.spaceKey": {
        value: "Specific knowledge space to query. If omitted, searches all available spaces.",
        description: "Parameter description for the spaceKey field"
      },
      "tool.knowledge.param.topK": {
        value: "Maximum number of results to return",
        description: "Parameter description for the topK field"
      },
      "tool.knowledge.noResults": {
        value: "No relevant information found in the knowledge bases.",
        description: "Message when no knowledge results are found"
      },
      "tool.knowledge.sourceLabel": {
        value: "[Source {index} - {space}] (relevance: {score}%)",
        description: "Label for each knowledge search result",
        placeholders: [
          { name: "index", type: "number", description: "1-based source index" },
          { name: "space", type: "string", description: "Knowledge space name" },
          { name: "score", type: "number", description: "Relevance percentage" }
        ]
      },
      "tool.fallbackDescription": {
        value: "Execute {name}",
        description: "Fallback description when a tool has no explicit description",
        placeholders: [
          { name: "name", type: "string", description: "Tool name" }
        ]
      },
      "tool.mcp.param.message": {
        value: "The message or query to send to the agent",
        description: "MCP server: message parameter description"
      },
      "tool.mcp.param.sessionId": {
        value: "Optional session ID to continue a conversation",
        description: "MCP server: sessionId parameter description"
      },
      "tool.mcp.agentDescription": {
        value: "Interact with {key} agent",
        description: "MCP server: agent tool description",
        placeholders: [
          { name: "key", type: "string", description: "Agent spec key" }
        ]
      },
      "tool.mcp.executePrompt": {
        value: "Execute the {name} tool with the following arguments: {args}",
        description: "MCP server: prompt sent when executing an individual tool",
        placeholders: [
          { name: "name", type: "string", description: "Tool name" },
          {
            name: "args",
            type: "string",
            description: "JSON-stringified arguments"
          }
        ]
      },
      "tool.mcp.toolDescription": {
        value: "Execute {name} tool",
        description: "MCP server: individual tool description",
        placeholders: [
          { name: "name", type: "string", description: "Tool name" }
        ]
      },
      "interop.prompt.agentIdentity": {
        value: "# Agent Identity",
        description: "Section header for agent identity in LLM prompt"
      },
      "interop.prompt.youAre": {
        value: "You are {key} (v{version}).",
        description: "Agent identity statement in LLM prompt",
        placeholders: [
          { name: "key", type: "string" },
          { name: "version", type: "string" }
        ]
      },
      "interop.prompt.description": {
        value: "## Description",
        description: "Section header for description"
      },
      "interop.prompt.instructions": {
        value: "## Instructions",
        description: "Section header for instructions"
      },
      "interop.prompt.availableTools": {
        value: "## Available Tools",
        description: "Section header for available tools"
      },
      "interop.prompt.toolsIntro": {
        value: "You have access to the following tools:",
        description: "Introduction before listing tools"
      },
      "interop.prompt.parameters": {
        value: "Parameters:",
        description: "Label before tool parameters block"
      },
      "interop.prompt.knowledgeContext": {
        value: "## Knowledge Context",
        description: "Section header for knowledge context"
      },
      "interop.prompt.additionalContext": {
        value: "## Additional Context",
        description: "Section header for additional context"
      },
      "interop.md.toc": {
        value: "## Table of Contents",
        description: "TOC header"
      },
      "interop.md.overview": {
        value: "## Overview",
        description: "Overview header"
      },
      "interop.md.tools": { value: "## Tools", description: "Tools header" },
      "interop.md.knowledge": {
        value: "## Knowledge",
        description: "Knowledge header"
      },
      "interop.md.policy": { value: "## Policy", description: "Policy header" },
      "interop.md.metaKey": {
        value: "- **Key**: `{key}`",
        description: "Metadata line for key",
        placeholders: [{ name: "key", type: "string" }]
      },
      "interop.md.metaVersion": {
        value: "- **Version**: {version}",
        description: "Metadata line for version",
        placeholders: [{ name: "version", type: "string" }]
      },
      "interop.md.metaStability": {
        value: "- **Stability**: {stability}",
        description: "Metadata line for stability",
        placeholders: [{ name: "stability", type: "string" }]
      },
      "interop.md.metaOwners": {
        value: "- **Owners**: {owners}",
        description: "Metadata line for owners",
        placeholders: [{ name: "owners", type: "string" }]
      },
      "interop.md.metaTags": {
        value: "- **Tags**: {tags}",
        description: "Metadata line for tags",
        placeholders: [{ name: "tags", type: "string" }]
      },
      "interop.md.schema": { value: "**Schema:**", description: "Schema label" },
      "interop.md.automationSafe": {
        value: "**Automation Safe**: {value}",
        description: "Automation safe field",
        placeholders: [{ name: "value", type: "string" }]
      },
      "interop.md.required": {
        value: "(required)",
        description: "Required marker"
      },
      "interop.md.optional": {
        value: "(optional)",
        description: "Optional marker"
      },
      "interop.md.minConfidence": {
        value: "- **Minimum Confidence**: {min}",
        description: "Minimum confidence policy line",
        placeholders: [{ name: "min", type: "number" }]
      },
      "interop.md.escalationThreshold": {
        value: "- **Escalation Threshold**: {threshold}",
        description: "Escalation threshold policy line",
        placeholders: [{ name: "threshold", type: "number" }]
      },
      "interop.md.escalateToolFailure": {
        value: "- **Escalate on Tool Failure**: Yes",
        description: "Escalate on tool failure policy line"
      },
      "interop.md.escalateTimeout": {
        value: "- **Escalate on Timeout**: Yes",
        description: "Escalate on timeout policy line"
      },
      "interop.md.yes": { value: "Yes", description: "Yes label" },
      "interop.md.no": { value: "No", description: "No label" },
      "error.jsonRunner.requiresModel": {
        value: "createAgentJsonRunner requires a model or provider config",
        description: "Error when JSON runner has no model or provider"
      },
      "error.missingToolHandler": {
        value: "Missing handler for tool: {name}",
        description: "Error when a tool handler is not registered",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.unknownBackend": {
        value: "Unknown backend: {backend}",
        description: "Error when an unknown backend is specified",
        placeholders: [{ name: "backend", type: "string" }]
      },
      "error.claudeSdk.notAvailable": {
        value: "Claude Agent SDK not available. Install @anthropic-ai/claude-agent-sdk",
        description: "Error when Claude Agent SDK is not available"
      },
      "error.claudeSdk.notInstalled": {
        value: "Claude Agent SDK not installed. Run: npm install @anthropic-ai/claude-agent-sdk",
        description: "Error when Claude Agent SDK module is not found"
      },
      "error.opencodeSdk.notAvailable": {
        value: "OpenCode SDK not available. Install @opencode-ai/sdk",
        description: "Error when OpenCode SDK is not available"
      },
      "error.opencodeSdk.notInstalled": {
        value: "OpenCode SDK not installed. Run: npm install @opencode-ai/sdk",
        description: "Error when OpenCode SDK module is not found"
      },
      "error.providerNotInitialized": {
        value: "Provider not initialized",
        description: "Error when provider has not been initialized before use"
      },
      "error.agentKeyRequired": {
        value: "Agent key is required",
        description: "Validation error: missing agent key"
      },
      "error.agentMissingVersion": {
        value: "Agent {key} is missing a string version",
        description: "Validation error: version not a string",
        placeholders: [{ name: "key", type: "string" }]
      },
      "error.agentRequiresInstructions": {
        value: "Agent {key} requires instructions",
        description: "Validation error: missing instructions",
        placeholders: [{ name: "key", type: "string" }]
      },
      "error.agentRequiresTool": {
        value: "Agent {key} must expose at least one tool",
        description: "Validation error: no tools defined",
        placeholders: [{ name: "key", type: "string" }]
      },
      "error.agentDuplicateTool": {
        value: "Agent {key} has duplicate tool name: {name}",
        description: "Validation error: duplicate tool name",
        placeholders: [
          { name: "key", type: "string" },
          { name: "name", type: "string" }
        ]
      },
      "error.agentSpecNotFound": {
        value: "Agent spec not found for {name}",
        description: "Error when agent spec is not in the registry",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.specNotFound": {
        value: "Spec not found: {specKey}",
        description: "Error when a spec key is not found",
        placeholders: [{ name: "specKey", type: "string" }]
      },
      "error.toolNotFound": {
        value: "Tool not found: {name}",
        description: "Error when a tool is not found",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.noHandlerForTool": {
        value: "No handler registered for tool: {name}",
        description: "Error when no handler is registered for a tool",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.noToolHandler": {
        value: "No handler for tool: {name}",
        description: "Short error when no handler exists",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.unknownExportFormat": {
        value: "Unknown export format: {format}",
        description: "Error for unsupported export format",
        placeholders: [{ name: "format", type: "string" }]
      },
      "error.handlerNotFoundForTool": {
        value: "Handler not found for tool {name}",
        description: "Error in tool bridge when handler is missing",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.toolNotFoundOrNoHandler": {
        value: "Error: Tool '{name}' not found or has no handler",
        description: "Error returned to LLM when tool execution fails",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.toolNoExecuteHandler": {
        value: "Tool {name} has no execute handler",
        description: "Error when tool lacks an execute function",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.provider.notRegistered": {
        value: "not registered",
        description: "Provider availability reason: not registered"
      },
      "error.provider.depsNotInstalled": {
        value: "dependencies not installed or not configured",
        description: "Provider availability reason: deps missing"
      },
      "error.provider.sdkNotConfigured": {
        value: "SDK not installed or API key not configured",
        description: "Provider availability reason: SDK or key missing"
      },
      "error.provider.claudeSdkMissing": {
        value: "@anthropic-ai/claude-agent-sdk is not installed",
        description: "Error when Claude Agent SDK require.resolve fails"
      },
      "error.provider.opencodeSdkMissing": {
        value: "@opencode-ai/sdk is not installed",
        description: "Error when OpenCode SDK require.resolve fails"
      },
      "error.provider.sdkNotInstalled": {
        value: "SDK not installed",
        description: "Generic provider error: SDK not installed"
      },
      "error.provider.contextCreation": {
        value: "Failed to create context: {error}",
        description: "Error during provider context creation",
        placeholders: [{ name: "error", type: "string" }]
      },
      "error.provider.executionFailed": {
        value: "Execution failed: {error}",
        description: "Error during provider execution",
        placeholders: [{ name: "error", type: "string" }]
      },
      "error.provider.streamFailed": {
        value: "Stream failed: {error}",
        description: "Error during provider streaming",
        placeholders: [{ name: "error", type: "string" }]
      },
      "export.agentConfiguration": {
        value: "# Agent Configuration",
        description: "Markdown heading"
      },
      "export.metadata": {
        value: "## Metadata",
        description: "Markdown heading"
      },
      "export.metaName": {
        value: "- **Name**: {name}",
        description: "Metadata line",
        placeholders: [{ name: "name", type: "string" }]
      },
      "export.metaVersion": {
        value: "- **Version**: {version}",
        description: "Metadata line",
        placeholders: [{ name: "version", type: "string" }]
      },
      "export.metaOwners": {
        value: "- **Owners**: {owners}",
        description: "Metadata line",
        placeholders: [{ name: "owners", type: "string" }]
      },
      "export.metaModel": {
        value: "- **Model**: {model}",
        description: "Metadata line",
        placeholders: [{ name: "model", type: "string" }]
      },
      "export.instructions": {
        value: "## Instructions",
        description: "Markdown heading"
      },
      "export.availableTools": {
        value: "## Available Tools",
        description: "Markdown heading"
      },
      "export.tools": { value: "## Tools", description: "Markdown heading" },
      "export.knowledgeSources": {
        value: "## Knowledge Sources",
        description: "Markdown heading"
      },
      "export.policy": { value: "## Policy", description: "Markdown heading" },
      "export.additionalContext": {
        value: "## Additional Context",
        description: "Markdown heading"
      },
      "export.configuration": {
        value: "## Configuration",
        description: "Markdown heading"
      },
      "export.mcpServers": {
        value: "## MCP Servers",
        description: "Markdown heading"
      },
      "export.parameters": {
        value: "**Parameters:**",
        description: "Parameters label"
      },
      "export.requiresApproval": {
        value: "requires approval",
        description: "Tool flag"
      },
      "export.notAutomationSafe": {
        value: "not automation safe",
        description: "Tool flag"
      },
      "export.requiresApprovalMd": {
        value: "*(requires approval)*",
        description: "Markdown tool flag"
      },
      "export.notAutomationSafeMd": {
        value: "*(not automation safe)*",
        description: "Markdown tool flag"
      },
      "export.required": { value: "(required)", description: "Required marker" },
      "export.optional": { value: "(optional)", description: "Optional marker" },
      "export.minConfidence": {
        value: "- Minimum confidence: {min}",
        description: "Policy line",
        placeholders: [{ name: "min", type: "number" }]
      },
      "export.escalationConfigured": {
        value: "- Escalation policy is configured",
        description: "Policy line for system prompt"
      },
      "export.escalationPolicyConfigured": {
        value: "- Escalation policy configured",
        description: "Policy line for markdown export"
      },
      "export.featureFlags": {
        value: "- Feature flags: {flags}",
        description: "Feature flags policy line",
        placeholders: [{ name: "flags", type: "string" }]
      },
      "export.generatedFrom": {
        value: "*Generated from ContractSpec: {key}*",
        description: "Footer attribution line",
        placeholders: [{ name: "key", type: "string" }]
      },
      "export.exportedAt": {
        value: "*Exported at: {date}*",
        description: "Footer timestamp",
        placeholders: [{ name: "date", type: "string" }]
      },
      "export.agentType": {
        value: "> Agent type: **{type}**",
        description: "Agent type callout",
        placeholders: [{ name: "type", type: "string" }]
      },
      "export.noDescription": {
        value: "No description",
        description: "Fallback when tool has no description"
      },
      "export.validation.requiresKey": {
        value: "Spec must have a meta.key",
        description: "Validation error"
      },
      "export.validation.requiresInstructions": {
        value: "Spec must have instructions",
        description: "Validation error"
      },
      "export.validation.requiresTool": {
        value: "Spec must have at least one tool",
        description: "Validation error"
      },
      "export.validation.toolRequiresName": {
        value: "All tools must have a name",
        description: "Validation error"
      },
      "export.validation.toolRequiresDescOrName": {
        value: "Tool must have a description or name",
        description: "Validation error"
      },
      "export.validation.toolInvalidName": {
        value: "Tool name '{name}' should be a valid identifier (letters, numbers, underscores)",
        description: "Validation error for invalid tool name",
        placeholders: [{ name: "name", type: "string" }]
      },
      "export.agentType.build": {
        value: "Primary agent with full tool access for code generation and modification.",
        description: "Build agent type description"
      },
      "export.agentType.plan": {
        value: "Restricted agent for analysis and planning. File edits and bash commands require approval.",
        description: "Plan agent type description"
      },
      "export.agentType.general": {
        value: "General-purpose subagent for complex questions and multi-step tasks.",
        description: "General agent type description"
      },
      "export.agentType.explore": {
        value: "Fast subagent optimized for codebase exploration and pattern searching.",
        description: "Explore agent type description"
      },
      "export.bridge.requiresApproval": {
        value: "(requires approval)",
        description: "Tool permission label"
      },
      "export.bridge.askMode": {
        value: "(ask mode)",
        description: "Tool permission label"
      },
      "approval.toolRequiresApproval": {
        value: 'Tool "{name}" requires approval',
        description: "Default reason for tool approval requests",
        placeholders: [{ name: "name", type: "string" }]
      },
      "log.unifiedAgent.fallback": {
        value: "[UnifiedAgent] {backend} failed, falling back to {fallback}",
        description: "Warning when a backend fails and fallback is used",
        placeholders: [
          { name: "backend", type: "string" },
          { name: "fallback", type: "string" }
        ]
      },
      "log.knowledge.spaceNotAvailable": {
        value: 'Required knowledge space "{key}" is not available',
        description: "Warning when a required knowledge space is missing",
        placeholders: [{ name: "key", type: "string" }]
      },
      "log.knowledge.loadFailed": {
        value: 'Failed to load required knowledge "{key}":',
        description: "Warning when knowledge loading fails",
        placeholders: [{ name: "key", type: "string" }]
      },
      "log.knowledge.queryFailed": {
        value: "Failed to query knowledge space {space}:",
        description: "Warning when knowledge querying fails",
        placeholders: [{ name: "space", type: "string" }]
      },
      "log.mcpServer.started": {
        value: "[MCPToolServer] Started {name}@{version} with {count} tools",
        description: "Log message when MCP tool server starts",
        placeholders: [
          { name: "name", type: "string" },
          { name: "version", type: "string" },
          { name: "count", type: "number" }
        ]
      },
      "log.mcpServer.stopped": {
        value: "[MCPToolServer] Stopped {name}",
        description: "Log message when MCP tool server stops",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.telemetry.posthogAiRequired": {
        value: "PostHog LLM Analytics requires @posthog/ai to be installed. Run: npm install @posthog/ai posthog-node",
        description: "Error when PostHog AI dependency is missing"
      },
      "error.telemetry.posthogClientOrKeyRequired": {
        value: "PostHog LLM Analytics requires either a client instance or an apiKey.",
        description: "Error when PostHog client or API key is not configured"
      },
      "error.telemetry.posthogNodeRequired": {
        value: "PostHog LLM Analytics requires posthog-node to be installed. Run: npm install posthog-node",
        description: "Error when posthog-node dependency is missing"
      },
      "error.provider.notAvailable": {
        value: "Provider '{provider}' is not available{reason}",
        description: "Error when a provider is unavailable",
        placeholders: [
          { name: "provider", type: "string" },
          { name: "reason", type: "string" }
        ]
      }
    }
  });
});

// src/i18n/catalogs/fr.ts
import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
var frMessages;
var init_fr = __esm(() => {
  frMessages = defineTranslation2({
    meta: {
      key: "ai-agent.messages",
      version: "1.0.0",
      domain: "ai-agent",
      description: "Toutes les cha\xEEnes destin\xE9es aux utilisateurs, aux LLM et aux d\xE9veloppeurs pour le package ai-agent",
      owners: ["platform"],
      stability: "experimental"
    },
    locale: "fr",
    fallback: "en",
    messages: {
      "agent.json.rules.validJsonOnly": {
        value: "Vous DEVEZ produire uniquement du JSON valide.",
        description: "JSON runner rule: output must be valid JSON"
      },
      "agent.json.rules.noMarkdownFences": {
        value: "N'encapsulez pas la sortie dans des blocs de code markdown.",
        description: "JSON runner rule: no markdown code fences"
      },
      "agent.json.rules.noCommentary": {
        value: "N'incluez ni commentaire ni explication.",
        description: "JSON runner rule: no extra text"
      },
      "agent.json.rules.doubleQuotes": {
        value: "Utilisez des guillemets doubles pour toutes les cl\xE9s et valeurs de type cha\xEEne.",
        description: "JSON runner rule: double quotes only"
      },
      "agent.json.rules.noTrailingCommas": {
        value: "N'incluez pas de virgules finales.",
        description: "JSON runner rule: no trailing commas"
      },
      "agent.json.defaultDescription": {
        value: "Ex\xE9cuteur d'agent JSON uniquement pour les pipelines d\xE9terministes.",
        description: "Default description for the JSON runner spec"
      },
      "agent.json.systemPrompt": {
        value: "Vous \xEAtes un g\xE9n\xE9rateur JSON pr\xE9cis.",
        description: "Default system prompt for the JSON runner"
      },
      "knowledge.header": {
        value: "# Connaissances de r\xE9f\xE9rence",
        description: "Header for injected knowledge section in system prompt"
      },
      "knowledge.description": {
        value: "Les informations suivantes sont fournies \xE0 titre de r\xE9f\xE9rence. Utilisez-les pour \xE9clairer vos r\xE9ponses.",
        description: "Description below the knowledge header"
      },
      "tool.knowledge.description": {
        value: "Interrogez les bases de connaissances pour obtenir des informations pertinentes. Utilisez cet outil lorsque vous avez besoin de rechercher des informations sp\xE9cifiques qui ne sont pas dans votre contexte.",
        description: "Description for the knowledge query tool shown to the LLM"
      },
      "tool.knowledge.availableSpaces": {
        value: "Espaces de connaissances disponibles :",
        description: "Label before listing available knowledge spaces"
      },
      "tool.knowledge.spaceDefault": {
        value: "Espace de connaissances",
        description: "Fallback description for unnamed knowledge spaces"
      },
      "tool.knowledge.param.query": {
        value: "La question ou la requ\xEAte de recherche pour trouver des informations pertinentes",
        description: "Parameter description for the query field"
      },
      "tool.knowledge.param.spaceKey": {
        value: "Espace de connaissances sp\xE9cifique \xE0 interroger. Si omis, recherche dans tous les espaces disponibles.",
        description: "Parameter description for the spaceKey field"
      },
      "tool.knowledge.param.topK": {
        value: "Nombre maximum de r\xE9sultats \xE0 retourner",
        description: "Parameter description for the topK field"
      },
      "tool.knowledge.noResults": {
        value: "Aucune information pertinente trouv\xE9e dans les bases de connaissances.",
        description: "Message when no knowledge results are found"
      },
      "tool.knowledge.sourceLabel": {
        value: "[Source {index} - {space}] (pertinence : {score} %)",
        description: "Label for each knowledge search result",
        placeholders: [
          { name: "index", type: "number", description: "1-based source index" },
          { name: "space", type: "string", description: "Knowledge space name" },
          { name: "score", type: "number", description: "Relevance percentage" }
        ]
      },
      "tool.fallbackDescription": {
        value: "Ex\xE9cuter {name}",
        description: "Fallback description when a tool has no explicit description",
        placeholders: [
          { name: "name", type: "string", description: "Tool name" }
        ]
      },
      "tool.mcp.param.message": {
        value: "Le message ou la requ\xEAte \xE0 envoyer \xE0 l'agent",
        description: "MCP server: message parameter description"
      },
      "tool.mcp.param.sessionId": {
        value: "Identifiant de session optionnel pour poursuivre une conversation",
        description: "MCP server: sessionId parameter description"
      },
      "tool.mcp.agentDescription": {
        value: "Interagir avec l'agent {key}",
        description: "MCP server: agent tool description",
        placeholders: [
          { name: "key", type: "string", description: "Agent spec key" }
        ]
      },
      "tool.mcp.executePrompt": {
        value: "Ex\xE9cutez l'outil {name} avec les arguments suivants : {args}",
        description: "MCP server: prompt sent when executing an individual tool",
        placeholders: [
          { name: "name", type: "string", description: "Tool name" },
          {
            name: "args",
            type: "string",
            description: "JSON-stringified arguments"
          }
        ]
      },
      "tool.mcp.toolDescription": {
        value: "Ex\xE9cuter l'outil {name}",
        description: "MCP server: individual tool description",
        placeholders: [
          { name: "name", type: "string", description: "Tool name" }
        ]
      },
      "interop.prompt.agentIdentity": {
        value: "# Identit\xE9 de l'agent",
        description: "Section header for agent identity in LLM prompt"
      },
      "interop.prompt.youAre": {
        value: "Vous \xEAtes {key} (v{version}).",
        description: "Agent identity statement in LLM prompt",
        placeholders: [
          { name: "key", type: "string" },
          { name: "version", type: "string" }
        ]
      },
      "interop.prompt.description": {
        value: "## Description",
        description: "Section header for description"
      },
      "interop.prompt.instructions": {
        value: "## Instructions",
        description: "Section header for instructions"
      },
      "interop.prompt.availableTools": {
        value: "## Outils disponibles",
        description: "Section header for available tools"
      },
      "interop.prompt.toolsIntro": {
        value: "Vous avez acc\xE8s aux outils suivants :",
        description: "Introduction before listing tools"
      },
      "interop.prompt.parameters": {
        value: "Param\xE8tres :",
        description: "Label before tool parameters block"
      },
      "interop.prompt.knowledgeContext": {
        value: "## Contexte de connaissances",
        description: "Section header for knowledge context"
      },
      "interop.prompt.additionalContext": {
        value: "## Contexte suppl\xE9mentaire",
        description: "Section header for additional context"
      },
      "interop.md.toc": {
        value: "## Table des mati\xE8res",
        description: "TOC header"
      },
      "interop.md.overview": {
        value: "## Aper\xE7u",
        description: "Overview header"
      },
      "interop.md.tools": { value: "## Outils", description: "Tools header" },
      "interop.md.knowledge": {
        value: "## Connaissances",
        description: "Knowledge header"
      },
      "interop.md.policy": {
        value: "## Politique",
        description: "Policy header"
      },
      "interop.md.metaKey": {
        value: "- **Cl\xE9** : `{key}`",
        description: "Metadata line for key",
        placeholders: [{ name: "key", type: "string" }]
      },
      "interop.md.metaVersion": {
        value: "- **Version** : {version}",
        description: "Metadata line for version",
        placeholders: [{ name: "version", type: "string" }]
      },
      "interop.md.metaStability": {
        value: "- **Stabilit\xE9** : {stability}",
        description: "Metadata line for stability",
        placeholders: [{ name: "stability", type: "string" }]
      },
      "interop.md.metaOwners": {
        value: "- **Propri\xE9taires** : {owners}",
        description: "Metadata line for owners",
        placeholders: [{ name: "owners", type: "string" }]
      },
      "interop.md.metaTags": {
        value: "- **Tags** : {tags}",
        description: "Metadata line for tags",
        placeholders: [{ name: "tags", type: "string" }]
      },
      "interop.md.schema": {
        value: "**Sch\xE9ma :**",
        description: "Schema label"
      },
      "interop.md.automationSafe": {
        value: "**Compatible avec l'automatisation** : {value}",
        description: "Automation safe field",
        placeholders: [{ name: "value", type: "string" }]
      },
      "interop.md.required": {
        value: "(obligatoire)",
        description: "Required marker"
      },
      "interop.md.optional": {
        value: "(optionnel)",
        description: "Optional marker"
      },
      "interop.md.minConfidence": {
        value: "- **Confiance minimale** : {min}",
        description: "Minimum confidence policy line",
        placeholders: [{ name: "min", type: "number" }]
      },
      "interop.md.escalationThreshold": {
        value: "- **Seuil d'escalade** : {threshold}",
        description: "Escalation threshold policy line",
        placeholders: [{ name: "threshold", type: "number" }]
      },
      "interop.md.escalateToolFailure": {
        value: "- **Escalader en cas d'\xE9chec d'outil** : Oui",
        description: "Escalate on tool failure policy line"
      },
      "interop.md.escalateTimeout": {
        value: "- **Escalader en cas de d\xE9lai d'attente d\xE9pass\xE9** : Oui",
        description: "Escalate on timeout policy line"
      },
      "interop.md.yes": { value: "Oui", description: "Yes label" },
      "interop.md.no": { value: "Non", description: "No label" },
      "error.jsonRunner.requiresModel": {
        value: "createAgentJsonRunner n\xE9cessite un mod\xE8le ou une configuration de fournisseur",
        description: "Error when JSON runner has no model or provider"
      },
      "error.missingToolHandler": {
        value: "Gestionnaire manquant pour l'outil : {name}",
        description: "Error when a tool handler is not registered",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.unknownBackend": {
        value: "Backend inconnu : {backend}",
        description: "Error when an unknown backend is specified",
        placeholders: [{ name: "backend", type: "string" }]
      },
      "error.claudeSdk.notAvailable": {
        value: "Claude Agent SDK non disponible. Installez @anthropic-ai/claude-agent-sdk",
        description: "Error when Claude Agent SDK is not available"
      },
      "error.claudeSdk.notInstalled": {
        value: "Claude Agent SDK non install\xE9. Ex\xE9cutez : npm install @anthropic-ai/claude-agent-sdk",
        description: "Error when Claude Agent SDK module is not found"
      },
      "error.opencodeSdk.notAvailable": {
        value: "OpenCode SDK non disponible. Installez @opencode-ai/sdk",
        description: "Error when OpenCode SDK is not available"
      },
      "error.opencodeSdk.notInstalled": {
        value: "OpenCode SDK non install\xE9. Ex\xE9cutez : npm install @opencode-ai/sdk",
        description: "Error when OpenCode SDK module is not found"
      },
      "error.providerNotInitialized": {
        value: "Fournisseur non initialis\xE9",
        description: "Error when provider has not been initialized before use"
      },
      "error.agentKeyRequired": {
        value: "La cl\xE9 de l'agent est obligatoire",
        description: "Validation error: missing agent key"
      },
      "error.agentMissingVersion": {
        value: "L'agent {key} n'a pas de version sous forme de cha\xEEne de caract\xE8res",
        description: "Validation error: version not a string",
        placeholders: [{ name: "key", type: "string" }]
      },
      "error.agentRequiresInstructions": {
        value: "L'agent {key} n\xE9cessite des instructions",
        description: "Validation error: missing instructions",
        placeholders: [{ name: "key", type: "string" }]
      },
      "error.agentRequiresTool": {
        value: "L'agent {key} doit exposer au moins un outil",
        description: "Validation error: no tools defined",
        placeholders: [{ name: "key", type: "string" }]
      },
      "error.agentDuplicateTool": {
        value: "L'agent {key} a un nom d'outil en double : {name}",
        description: "Validation error: duplicate tool name",
        placeholders: [
          { name: "key", type: "string" },
          { name: "name", type: "string" }
        ]
      },
      "error.agentSpecNotFound": {
        value: "Sp\xE9cification d'agent introuvable pour {name}",
        description: "Error when agent spec is not in the registry",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.specNotFound": {
        value: "Sp\xE9cification introuvable : {specKey}",
        description: "Error when a spec key is not found",
        placeholders: [{ name: "specKey", type: "string" }]
      },
      "error.toolNotFound": {
        value: "Outil introuvable : {name}",
        description: "Error when a tool is not found",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.noHandlerForTool": {
        value: "Aucun gestionnaire enregistr\xE9 pour l'outil : {name}",
        description: "Error when no handler is registered for a tool",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.noToolHandler": {
        value: "Aucun gestionnaire pour l'outil : {name}",
        description: "Short error when no handler exists",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.unknownExportFormat": {
        value: "Format d'export inconnu : {format}",
        description: "Error for unsupported export format",
        placeholders: [{ name: "format", type: "string" }]
      },
      "error.handlerNotFoundForTool": {
        value: "Gestionnaire introuvable pour l'outil {name}",
        description: "Error in tool bridge when handler is missing",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.toolNotFoundOrNoHandler": {
        value: "Erreur : L'outil \xAB {name} \xBB est introuvable ou n'a pas de gestionnaire",
        description: "Error returned to LLM when tool execution fails",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.toolNoExecuteHandler": {
        value: "L'outil {name} n'a pas de gestionnaire d'ex\xE9cution",
        description: "Error when tool lacks an execute function",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.provider.notRegistered": {
        value: "non enregistr\xE9",
        description: "Provider availability reason: not registered"
      },
      "error.provider.depsNotInstalled": {
        value: "d\xE9pendances non install\xE9es ou non configur\xE9es",
        description: "Provider availability reason: deps missing"
      },
      "error.provider.sdkNotConfigured": {
        value: "SDK non install\xE9 ou cl\xE9 d'API non configur\xE9e",
        description: "Provider availability reason: SDK or key missing"
      },
      "error.provider.claudeSdkMissing": {
        value: "@anthropic-ai/claude-agent-sdk n'est pas install\xE9",
        description: "Error when Claude Agent SDK require.resolve fails"
      },
      "error.provider.opencodeSdkMissing": {
        value: "@opencode-ai/sdk n'est pas install\xE9",
        description: "Error when OpenCode SDK require.resolve fails"
      },
      "error.provider.sdkNotInstalled": {
        value: "SDK non install\xE9",
        description: "Generic provider error: SDK not installed"
      },
      "error.provider.contextCreation": {
        value: "\xC9chec de la cr\xE9ation du contexte : {error}",
        description: "Error during provider context creation",
        placeholders: [{ name: "error", type: "string" }]
      },
      "error.provider.executionFailed": {
        value: "\xC9chec de l'ex\xE9cution : {error}",
        description: "Error during provider execution",
        placeholders: [{ name: "error", type: "string" }]
      },
      "error.provider.streamFailed": {
        value: "\xC9chec du flux : {error}",
        description: "Error during provider streaming",
        placeholders: [{ name: "error", type: "string" }]
      },
      "export.agentConfiguration": {
        value: "# Configuration de l'agent",
        description: "Markdown heading"
      },
      "export.metadata": {
        value: "## M\xE9tadonn\xE9es",
        description: "Markdown heading"
      },
      "export.metaName": {
        value: "- **Nom** : {name}",
        description: "Metadata line",
        placeholders: [{ name: "name", type: "string" }]
      },
      "export.metaVersion": {
        value: "- **Version** : {version}",
        description: "Metadata line",
        placeholders: [{ name: "version", type: "string" }]
      },
      "export.metaOwners": {
        value: "- **Propri\xE9taires** : {owners}",
        description: "Metadata line",
        placeholders: [{ name: "owners", type: "string" }]
      },
      "export.metaModel": {
        value: "- **Mod\xE8le** : {model}",
        description: "Metadata line",
        placeholders: [{ name: "model", type: "string" }]
      },
      "export.instructions": {
        value: "## Instructions",
        description: "Markdown heading"
      },
      "export.availableTools": {
        value: "## Outils disponibles",
        description: "Markdown heading"
      },
      "export.tools": { value: "## Outils", description: "Markdown heading" },
      "export.knowledgeSources": {
        value: "## Sources de connaissances",
        description: "Markdown heading"
      },
      "export.policy": {
        value: "## Politique",
        description: "Markdown heading"
      },
      "export.additionalContext": {
        value: "## Contexte suppl\xE9mentaire",
        description: "Markdown heading"
      },
      "export.configuration": {
        value: "## Configuration",
        description: "Markdown heading"
      },
      "export.mcpServers": {
        value: "## Serveurs MCP",
        description: "Markdown heading"
      },
      "export.parameters": {
        value: "**Param\xE8tres :**",
        description: "Parameters label"
      },
      "export.requiresApproval": {
        value: "n\xE9cessite une approbation",
        description: "Tool flag"
      },
      "export.notAutomationSafe": {
        value: "non compatible avec l'automatisation",
        description: "Tool flag"
      },
      "export.requiresApprovalMd": {
        value: "*(n\xE9cessite une approbation)*",
        description: "Markdown tool flag"
      },
      "export.notAutomationSafeMd": {
        value: "*(non compatible avec l'automatisation)*",
        description: "Markdown tool flag"
      },
      "export.required": {
        value: "(obligatoire)",
        description: "Required marker"
      },
      "export.optional": {
        value: "(optionnel)",
        description: "Optional marker"
      },
      "export.minConfidence": {
        value: "- Confiance minimale : {min}",
        description: "Policy line",
        placeholders: [{ name: "min", type: "number" }]
      },
      "export.escalationConfigured": {
        value: "- La politique d'escalade est configur\xE9e",
        description: "Policy line for system prompt"
      },
      "export.escalationPolicyConfigured": {
        value: "- Politique d'escalade configur\xE9e",
        description: "Policy line for markdown export"
      },
      "export.featureFlags": {
        value: "- Indicateurs de fonctionnalit\xE9s : {flags}",
        description: "Feature flags policy line",
        placeholders: [{ name: "flags", type: "string" }]
      },
      "export.generatedFrom": {
        value: "*G\xE9n\xE9r\xE9 \xE0 partir de ContractSpec : {key}*",
        description: "Footer attribution line",
        placeholders: [{ name: "key", type: "string" }]
      },
      "export.exportedAt": {
        value: "*Export\xE9 le : {date}*",
        description: "Footer timestamp",
        placeholders: [{ name: "date", type: "string" }]
      },
      "export.agentType": {
        value: "> Type d'agent : **{type}**",
        description: "Agent type callout",
        placeholders: [{ name: "type", type: "string" }]
      },
      "export.noDescription": {
        value: "Aucune description",
        description: "Fallback when tool has no description"
      },
      "export.validation.requiresKey": {
        value: "La sp\xE9cification doit avoir une meta.key",
        description: "Validation error"
      },
      "export.validation.requiresInstructions": {
        value: "La sp\xE9cification doit avoir des instructions",
        description: "Validation error"
      },
      "export.validation.requiresTool": {
        value: "La sp\xE9cification doit avoir au moins un outil",
        description: "Validation error"
      },
      "export.validation.toolRequiresName": {
        value: "Tous les outils doivent avoir un nom",
        description: "Validation error"
      },
      "export.validation.toolRequiresDescOrName": {
        value: "L'outil doit avoir une description ou un nom",
        description: "Validation error"
      },
      "export.validation.toolInvalidName": {
        value: "Le nom d'outil \xAB {name} \xBB doit \xEAtre un identifiant valide (lettres, chiffres, underscores)",
        description: "Validation error for invalid tool name",
        placeholders: [{ name: "name", type: "string" }]
      },
      "export.agentType.build": {
        value: "Agent principal avec acc\xE8s complet aux outils pour la g\xE9n\xE9ration et la modification de code.",
        description: "Build agent type description"
      },
      "export.agentType.plan": {
        value: "Agent restreint pour l'analyse et la planification. Les modifications de fichiers et les commandes bash n\xE9cessitent une approbation.",
        description: "Plan agent type description"
      },
      "export.agentType.general": {
        value: "Sous-agent g\xE9n\xE9raliste pour les questions complexes et les t\xE2ches en plusieurs \xE9tapes.",
        description: "General agent type description"
      },
      "export.agentType.explore": {
        value: "Sous-agent rapide optimis\xE9 pour l'exploration de la base de code et la recherche de motifs.",
        description: "Explore agent type description"
      },
      "export.bridge.requiresApproval": {
        value: "(n\xE9cessite une approbation)",
        description: "Tool permission label"
      },
      "export.bridge.askMode": {
        value: "(mode interrogation)",
        description: "Tool permission label"
      },
      "approval.toolRequiresApproval": {
        value: "L'outil \xAB {name} \xBB n\xE9cessite une approbation",
        description: "Default reason for tool approval requests",
        placeholders: [{ name: "name", type: "string" }]
      },
      "log.unifiedAgent.fallback": {
        value: "[UnifiedAgent] {backend} a \xE9chou\xE9, repli sur {fallback}",
        description: "Warning when a backend fails and fallback is used",
        placeholders: [
          { name: "backend", type: "string" },
          { name: "fallback", type: "string" }
        ]
      },
      "log.knowledge.spaceNotAvailable": {
        value: "L'espace de connaissances requis \xAB {key} \xBB n'est pas disponible",
        description: "Warning when a required knowledge space is missing",
        placeholders: [{ name: "key", type: "string" }]
      },
      "log.knowledge.loadFailed": {
        value: "\xC9chec du chargement des connaissances requises \xAB {key} \xBB :",
        description: "Warning when knowledge loading fails",
        placeholders: [{ name: "key", type: "string" }]
      },
      "log.knowledge.queryFailed": {
        value: "\xC9chec de l'interrogation de l'espace de connaissances {space} :",
        description: "Warning when knowledge querying fails",
        placeholders: [{ name: "space", type: "string" }]
      },
      "log.mcpServer.started": {
        value: "[MCPToolServer] {name}@{version} d\xE9marr\xE9 avec {count} outils",
        description: "Log message when MCP tool server starts",
        placeholders: [
          { name: "name", type: "string" },
          { name: "version", type: "string" },
          { name: "count", type: "number" }
        ]
      },
      "log.mcpServer.stopped": {
        value: "[MCPToolServer] {name} arr\xEAt\xE9",
        description: "Log message when MCP tool server stops",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.telemetry.posthogAiRequired": {
        value: "PostHog LLM Analytics n\xE9cessite l'installation de @posthog/ai. Ex\xE9cutez : npm install @posthog/ai posthog-node",
        description: "Error when PostHog AI dependency is missing"
      },
      "error.telemetry.posthogClientOrKeyRequired": {
        value: "PostHog LLM Analytics n\xE9cessite soit une instance client, soit une apiKey.",
        description: "Error when PostHog client or API key is not configured"
      },
      "error.telemetry.posthogNodeRequired": {
        value: "PostHog LLM Analytics n\xE9cessite l'installation de posthog-node. Ex\xE9cutez : npm install posthog-node",
        description: "Error when posthog-node dependency is missing"
      },
      "error.provider.notAvailable": {
        value: "Le fournisseur \xAB {provider} \xBB n'est pas disponible{reason}",
        description: "Error when a provider is unavailable",
        placeholders: [
          { name: "provider", type: "string" },
          { name: "reason", type: "string" }
        ]
      }
    }
  });
});

// src/i18n/catalogs/es.ts
import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
var esMessages;
var init_es = __esm(() => {
  esMessages = defineTranslation3({
    meta: {
      key: "ai-agent.messages",
      version: "1.0.0",
      domain: "ai-agent",
      description: "Todas las cadenas de texto orientadas al usuario, al LLM y al desarrollador del paquete ai-agent",
      owners: ["platform"],
      stability: "experimental"
    },
    locale: "es",
    fallback: "en",
    messages: {
      "agent.json.rules.validJsonOnly": {
        value: "Usted DEBE generar \xDANICAMENTE JSON v\xE1lido.",
        description: "Regla del ejecutor JSON: la salida debe ser JSON v\xE1lido"
      },
      "agent.json.rules.noMarkdownFences": {
        value: "No envuelva la salida en bloques de c\xF3digo markdown.",
        description: "Regla del ejecutor JSON: sin bloques de c\xF3digo markdown"
      },
      "agent.json.rules.noCommentary": {
        value: "No incluya comentarios ni explicaciones.",
        description: "Regla del ejecutor JSON: sin texto adicional"
      },
      "agent.json.rules.doubleQuotes": {
        value: "Utilice comillas dobles para todas las claves y valores de cadena.",
        description: "Regla del ejecutor JSON: solo comillas dobles"
      },
      "agent.json.rules.noTrailingCommas": {
        value: "No incluya comas finales.",
        description: "Regla del ejecutor JSON: sin comas finales"
      },
      "agent.json.defaultDescription": {
        value: "Ejecutor de agentes exclusivamente JSON para pipelines deterministas.",
        description: "Descripci\xF3n predeterminada para la especificaci\xF3n del ejecutor JSON"
      },
      "agent.json.systemPrompt": {
        value: "Usted es un generador preciso de JSON.",
        description: "Prompt de sistema predeterminado para el ejecutor JSON"
      },
      "knowledge.header": {
        value: "# Conocimiento de referencia",
        description: "Encabezado para la secci\xF3n de conocimiento inyectado en el prompt del sistema"
      },
      "knowledge.description": {
        value: "La siguiente informaci\xF3n se proporciona como referencia. Util\xEDcela para fundamentar sus respuestas.",
        description: "Descripci\xF3n debajo del encabezado de conocimiento"
      },
      "tool.knowledge.description": {
        value: "Consultar bases de conocimiento para obtener informaci\xF3n relevante. Utilice esta herramienta cuando necesite buscar informaci\xF3n espec\xEDfica que pueda no estar en su contexto.",
        description: "Descripci\xF3n de la herramienta de consulta de conocimiento mostrada al LLM"
      },
      "tool.knowledge.availableSpaces": {
        value: "Espacios de conocimiento disponibles:",
        description: "Etiqueta antes de listar los espacios de conocimiento disponibles"
      },
      "tool.knowledge.spaceDefault": {
        value: "Espacio de conocimiento",
        description: "Descripci\xF3n de respaldo para espacios de conocimiento sin nombre"
      },
      "tool.knowledge.param.query": {
        value: "La pregunta o consulta de b\xFAsqueda para encontrar informaci\xF3n relevante",
        description: "Descripci\xF3n del par\xE1metro para el campo de consulta"
      },
      "tool.knowledge.param.spaceKey": {
        value: "Espacio de conocimiento espec\xEDfico a consultar. Si se omite, busca en todos los espacios disponibles.",
        description: "Descripci\xF3n del par\xE1metro para el campo spaceKey"
      },
      "tool.knowledge.param.topK": {
        value: "N\xFAmero m\xE1ximo de resultados a devolver",
        description: "Descripci\xF3n del par\xE1metro para el campo topK"
      },
      "tool.knowledge.noResults": {
        value: "No se encontr\xF3 informaci\xF3n relevante en las bases de conocimiento.",
        description: "Mensaje cuando no se encuentran resultados de conocimiento"
      },
      "tool.knowledge.sourceLabel": {
        value: "[Fuente {index} - {space}] (relevancia: {score}%)",
        description: "Etiqueta para cada resultado de b\xFAsqueda de conocimiento",
        placeholders: [
          {
            name: "index",
            type: "number",
            description: "\xCDndice de fuente basado en 1"
          },
          {
            name: "space",
            type: "string",
            description: "Nombre del espacio de conocimiento"
          },
          {
            name: "score",
            type: "number",
            description: "Porcentaje de relevancia"
          }
        ]
      },
      "tool.fallbackDescription": {
        value: "Ejecutar {name}",
        description: "Descripci\xF3n de respaldo cuando una herramienta no tiene descripci\xF3n expl\xEDcita",
        placeholders: [
          {
            name: "name",
            type: "string",
            description: "Nombre de la herramienta"
          }
        ]
      },
      "tool.mcp.param.message": {
        value: "El mensaje o consulta a enviar al agente",
        description: "Servidor MCP: descripci\xF3n del par\xE1metro message"
      },
      "tool.mcp.param.sessionId": {
        value: "ID de sesi\xF3n opcional para continuar una conversaci\xF3n",
        description: "Servidor MCP: descripci\xF3n del par\xE1metro sessionId"
      },
      "tool.mcp.agentDescription": {
        value: "Interactuar con el agente {key}",
        description: "Servidor MCP: descripci\xF3n de la herramienta de agente",
        placeholders: [
          {
            name: "key",
            type: "string",
            description: "Clave de la especificaci\xF3n del agente"
          }
        ]
      },
      "tool.mcp.executePrompt": {
        value: "Ejecute la herramienta {name} con los siguientes argumentos: {args}",
        description: "Servidor MCP: prompt enviado al ejecutar una herramienta individual",
        placeholders: [
          {
            name: "name",
            type: "string",
            description: "Nombre de la herramienta"
          },
          {
            name: "args",
            type: "string",
            description: "Argumentos serializados como JSON"
          }
        ]
      },
      "tool.mcp.toolDescription": {
        value: "Ejecutar la herramienta {name}",
        description: "Servidor MCP: descripci\xF3n de herramienta individual",
        placeholders: [
          {
            name: "name",
            type: "string",
            description: "Nombre de la herramienta"
          }
        ]
      },
      "interop.prompt.agentIdentity": {
        value: "# Identidad del agente",
        description: "Encabezado de secci\xF3n para la identidad del agente en el prompt del LLM"
      },
      "interop.prompt.youAre": {
        value: "Usted es {key} (v{version}).",
        description: "Declaraci\xF3n de identidad del agente en el prompt del LLM",
        placeholders: [
          { name: "key", type: "string" },
          { name: "version", type: "string" }
        ]
      },
      "interop.prompt.description": {
        value: "## Descripci\xF3n",
        description: "Encabezado de secci\xF3n para la descripci\xF3n"
      },
      "interop.prompt.instructions": {
        value: "## Instrucciones",
        description: "Encabezado de secci\xF3n para las instrucciones"
      },
      "interop.prompt.availableTools": {
        value: "## Herramientas disponibles",
        description: "Encabezado de secci\xF3n para las herramientas disponibles"
      },
      "interop.prompt.toolsIntro": {
        value: "Usted tiene acceso a las siguientes herramientas:",
        description: "Introducci\xF3n antes de listar las herramientas"
      },
      "interop.prompt.parameters": {
        value: "Par\xE1metros:",
        description: "Etiqueta antes del bloque de par\xE1metros de la herramienta"
      },
      "interop.prompt.knowledgeContext": {
        value: "## Contexto de conocimiento",
        description: "Encabezado de secci\xF3n para el contexto de conocimiento"
      },
      "interop.prompt.additionalContext": {
        value: "## Contexto adicional",
        description: "Encabezado de secci\xF3n para el contexto adicional"
      },
      "interop.md.toc": {
        value: "## Tabla de contenidos",
        description: "Encabezado de tabla de contenidos"
      },
      "interop.md.overview": {
        value: "## Resumen general",
        description: "Encabezado de resumen general"
      },
      "interop.md.tools": {
        value: "## Herramientas",
        description: "Encabezado de herramientas"
      },
      "interop.md.knowledge": {
        value: "## Conocimiento",
        description: "Encabezado de conocimiento"
      },
      "interop.md.policy": {
        value: "## Pol\xEDtica",
        description: "Encabezado de pol\xEDtica"
      },
      "interop.md.metaKey": {
        value: "- **Clave**: `{key}`",
        description: "L\xEDnea de metadatos para la clave",
        placeholders: [{ name: "key", type: "string" }]
      },
      "interop.md.metaVersion": {
        value: "- **Versi\xF3n**: {version}",
        description: "L\xEDnea de metadatos para la versi\xF3n",
        placeholders: [{ name: "version", type: "string" }]
      },
      "interop.md.metaStability": {
        value: "- **Estabilidad**: {stability}",
        description: "L\xEDnea de metadatos para la estabilidad",
        placeholders: [{ name: "stability", type: "string" }]
      },
      "interop.md.metaOwners": {
        value: "- **Propietarios**: {owners}",
        description: "L\xEDnea de metadatos para los propietarios",
        placeholders: [{ name: "owners", type: "string" }]
      },
      "interop.md.metaTags": {
        value: "- **Etiquetas**: {tags}",
        description: "L\xEDnea de metadatos para las etiquetas",
        placeholders: [{ name: "tags", type: "string" }]
      },
      "interop.md.schema": {
        value: "**Esquema:**",
        description: "Etiqueta de esquema"
      },
      "interop.md.automationSafe": {
        value: "**Seguro para automatizaci\xF3n**: {value}",
        description: "Campo de seguridad para automatizaci\xF3n",
        placeholders: [{ name: "value", type: "string" }]
      },
      "interop.md.required": {
        value: "(obligatorio)",
        description: "Marcador de obligatorio"
      },
      "interop.md.optional": {
        value: "(opcional)",
        description: "Marcador de opcional"
      },
      "interop.md.minConfidence": {
        value: "- **Confianza m\xEDnima**: {min}",
        description: "L\xEDnea de pol\xEDtica de confianza m\xEDnima",
        placeholders: [{ name: "min", type: "number" }]
      },
      "interop.md.escalationThreshold": {
        value: "- **Umbral de escalamiento**: {threshold}",
        description: "L\xEDnea de pol\xEDtica de umbral de escalamiento",
        placeholders: [{ name: "threshold", type: "number" }]
      },
      "interop.md.escalateToolFailure": {
        value: "- **Escalar ante fallo de herramienta**: S\xED",
        description: "L\xEDnea de pol\xEDtica de escalamiento ante fallo de herramienta"
      },
      "interop.md.escalateTimeout": {
        value: "- **Escalar ante tiempo de espera agotado**: S\xED",
        description: "L\xEDnea de pol\xEDtica de escalamiento ante tiempo de espera"
      },
      "interop.md.yes": { value: "S\xED", description: "Etiqueta de S\xED" },
      "interop.md.no": { value: "No", description: "Etiqueta de No" },
      "error.jsonRunner.requiresModel": {
        value: "createAgentJsonRunner requiere un modelo o configuraci\xF3n de proveedor",
        description: "Error cuando el ejecutor JSON no tiene modelo ni proveedor"
      },
      "error.missingToolHandler": {
        value: "Falta el manejador para la herramienta: {name}",
        description: "Error cuando un manejador de herramienta no est\xE1 registrado",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.unknownBackend": {
        value: "Backend desconocido: {backend}",
        description: "Error cuando se especifica un backend desconocido",
        placeholders: [{ name: "backend", type: "string" }]
      },
      "error.claudeSdk.notAvailable": {
        value: "Claude Agent SDK no disponible. Instale @anthropic-ai/claude-agent-sdk",
        description: "Error cuando el Claude Agent SDK no est\xE1 disponible"
      },
      "error.claudeSdk.notInstalled": {
        value: "Claude Agent SDK no instalado. Ejecute: npm install @anthropic-ai/claude-agent-sdk",
        description: "Error cuando no se encuentra el m\xF3dulo del Claude Agent SDK"
      },
      "error.opencodeSdk.notAvailable": {
        value: "OpenCode SDK no disponible. Instale @opencode-ai/sdk",
        description: "Error cuando el OpenCode SDK no est\xE1 disponible"
      },
      "error.opencodeSdk.notInstalled": {
        value: "OpenCode SDK no instalado. Ejecute: npm install @opencode-ai/sdk",
        description: "Error cuando no se encuentra el m\xF3dulo del OpenCode SDK"
      },
      "error.providerNotInitialized": {
        value: "Proveedor no inicializado",
        description: "Error cuando el proveedor no ha sido inicializado antes de su uso"
      },
      "error.agentKeyRequired": {
        value: "La clave del agente es obligatoria",
        description: "Error de validaci\xF3n: falta la clave del agente"
      },
      "error.agentMissingVersion": {
        value: "Al agente {key} le falta una versi\xF3n de tipo cadena",
        description: "Error de validaci\xF3n: la versi\xF3n no es una cadena de texto",
        placeholders: [{ name: "key", type: "string" }]
      },
      "error.agentRequiresInstructions": {
        value: "El agente {key} requiere instrucciones",
        description: "Error de validaci\xF3n: faltan instrucciones",
        placeholders: [{ name: "key", type: "string" }]
      },
      "error.agentRequiresTool": {
        value: "El agente {key} debe exponer al menos una herramienta",
        description: "Error de validaci\xF3n: no hay herramientas definidas",
        placeholders: [{ name: "key", type: "string" }]
      },
      "error.agentDuplicateTool": {
        value: "El agente {key} tiene un nombre de herramienta duplicado: {name}",
        description: "Error de validaci\xF3n: nombre de herramienta duplicado",
        placeholders: [
          { name: "key", type: "string" },
          { name: "name", type: "string" }
        ]
      },
      "error.agentSpecNotFound": {
        value: "Especificaci\xF3n de agente no encontrada para {name}",
        description: "Error cuando la especificaci\xF3n del agente no est\xE1 en el registro",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.specNotFound": {
        value: "Especificaci\xF3n no encontrada: {specKey}",
        description: "Error cuando no se encuentra una clave de especificaci\xF3n",
        placeholders: [{ name: "specKey", type: "string" }]
      },
      "error.toolNotFound": {
        value: "Herramienta no encontrada: {name}",
        description: "Error cuando no se encuentra una herramienta",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.noHandlerForTool": {
        value: "No hay manejador registrado para la herramienta: {name}",
        description: "Error cuando no hay manejador registrado para una herramienta",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.noToolHandler": {
        value: "Sin manejador para la herramienta: {name}",
        description: "Error breve cuando no existe manejador",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.unknownExportFormat": {
        value: "Formato de exportaci\xF3n desconocido: {format}",
        description: "Error para formato de exportaci\xF3n no soportado",
        placeholders: [{ name: "format", type: "string" }]
      },
      "error.handlerNotFoundForTool": {
        value: "Manejador no encontrado para la herramienta {name}",
        description: "Error en el puente de herramientas cuando falta el manejador",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.toolNotFoundOrNoHandler": {
        value: "Error: La herramienta '{name}' no fue encontrada o no tiene manejador",
        description: "Error devuelto al LLM cuando la ejecuci\xF3n de la herramienta falla",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.toolNoExecuteHandler": {
        value: "La herramienta {name} no tiene manejador de ejecuci\xF3n",
        description: "Error cuando la herramienta carece de una funci\xF3n de ejecuci\xF3n",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.provider.notRegistered": {
        value: "no registrado",
        description: "Raz\xF3n de disponibilidad del proveedor: no registrado"
      },
      "error.provider.depsNotInstalled": {
        value: "dependencias no instaladas o no configuradas",
        description: "Raz\xF3n de disponibilidad del proveedor: faltan dependencias"
      },
      "error.provider.sdkNotConfigured": {
        value: "SDK no instalado o clave de API no configurada",
        description: "Raz\xF3n de disponibilidad del proveedor: falta SDK o clave"
      },
      "error.provider.claudeSdkMissing": {
        value: "@anthropic-ai/claude-agent-sdk no est\xE1 instalado",
        description: "Error cuando falla require.resolve del Claude Agent SDK"
      },
      "error.provider.opencodeSdkMissing": {
        value: "@opencode-ai/sdk no est\xE1 instalado",
        description: "Error cuando falla require.resolve del OpenCode SDK"
      },
      "error.provider.sdkNotInstalled": {
        value: "SDK no instalado",
        description: "Error gen\xE9rico del proveedor: SDK no instalado"
      },
      "error.provider.contextCreation": {
        value: "Error al crear el contexto: {error}",
        description: "Error durante la creaci\xF3n del contexto del proveedor",
        placeholders: [{ name: "error", type: "string" }]
      },
      "error.provider.executionFailed": {
        value: "La ejecuci\xF3n fall\xF3: {error}",
        description: "Error durante la ejecuci\xF3n del proveedor",
        placeholders: [{ name: "error", type: "string" }]
      },
      "error.provider.streamFailed": {
        value: "El stream fall\xF3: {error}",
        description: "Error durante el streaming del proveedor",
        placeholders: [{ name: "error", type: "string" }]
      },
      "export.agentConfiguration": {
        value: "# Configuraci\xF3n del agente",
        description: "Encabezado Markdown"
      },
      "export.metadata": {
        value: "## Metadatos",
        description: "Encabezado Markdown"
      },
      "export.metaName": {
        value: "- **Nombre**: {name}",
        description: "L\xEDnea de metadatos",
        placeholders: [{ name: "name", type: "string" }]
      },
      "export.metaVersion": {
        value: "- **Versi\xF3n**: {version}",
        description: "L\xEDnea de metadatos",
        placeholders: [{ name: "version", type: "string" }]
      },
      "export.metaOwners": {
        value: "- **Propietarios**: {owners}",
        description: "L\xEDnea de metadatos",
        placeholders: [{ name: "owners", type: "string" }]
      },
      "export.metaModel": {
        value: "- **Modelo**: {model}",
        description: "L\xEDnea de metadatos",
        placeholders: [{ name: "model", type: "string" }]
      },
      "export.instructions": {
        value: "## Instrucciones",
        description: "Encabezado Markdown"
      },
      "export.availableTools": {
        value: "## Herramientas disponibles",
        description: "Encabezado Markdown"
      },
      "export.tools": {
        value: "## Herramientas",
        description: "Encabezado Markdown"
      },
      "export.knowledgeSources": {
        value: "## Fuentes de conocimiento",
        description: "Encabezado Markdown"
      },
      "export.policy": {
        value: "## Pol\xEDtica",
        description: "Encabezado Markdown"
      },
      "export.additionalContext": {
        value: "## Contexto adicional",
        description: "Encabezado Markdown"
      },
      "export.configuration": {
        value: "## Configuraci\xF3n",
        description: "Encabezado Markdown"
      },
      "export.mcpServers": {
        value: "## Servidores MCP",
        description: "Encabezado Markdown"
      },
      "export.parameters": {
        value: "**Par\xE1metros:**",
        description: "Etiqueta de par\xE1metros"
      },
      "export.requiresApproval": {
        value: "requiere aprobaci\xF3n",
        description: "Indicador de herramienta"
      },
      "export.notAutomationSafe": {
        value: "no es seguro para automatizaci\xF3n",
        description: "Indicador de herramienta"
      },
      "export.requiresApprovalMd": {
        value: "*(requiere aprobaci\xF3n)*",
        description: "Indicador de herramienta en Markdown"
      },
      "export.notAutomationSafeMd": {
        value: "*(no es seguro para automatizaci\xF3n)*",
        description: "Indicador de herramienta en Markdown"
      },
      "export.required": {
        value: "(obligatorio)",
        description: "Marcador de obligatorio"
      },
      "export.optional": {
        value: "(opcional)",
        description: "Marcador de opcional"
      },
      "export.minConfidence": {
        value: "- Confianza m\xEDnima: {min}",
        description: "L\xEDnea de pol\xEDtica",
        placeholders: [{ name: "min", type: "number" }]
      },
      "export.escalationConfigured": {
        value: "- La pol\xEDtica de escalamiento est\xE1 configurada",
        description: "L\xEDnea de pol\xEDtica para el prompt del sistema"
      },
      "export.escalationPolicyConfigured": {
        value: "- Pol\xEDtica de escalamiento configurada",
        description: "L\xEDnea de pol\xEDtica para la exportaci\xF3n en Markdown"
      },
      "export.featureFlags": {
        value: "- Indicadores de caracter\xEDsticas: {flags}",
        description: "L\xEDnea de pol\xEDtica de indicadores de caracter\xEDsticas",
        placeholders: [{ name: "flags", type: "string" }]
      },
      "export.generatedFrom": {
        value: "*Generado desde ContractSpec: {key}*",
        description: "L\xEDnea de atribuci\xF3n en el pie",
        placeholders: [{ name: "key", type: "string" }]
      },
      "export.exportedAt": {
        value: "*Exportado el: {date}*",
        description: "Marca de tiempo en el pie",
        placeholders: [{ name: "date", type: "string" }]
      },
      "export.agentType": {
        value: "> Tipo de agente: **{type}**",
        description: "Llamada de tipo de agente",
        placeholders: [{ name: "type", type: "string" }]
      },
      "export.noDescription": {
        value: "Sin descripci\xF3n",
        description: "Texto de respaldo cuando la herramienta no tiene descripci\xF3n"
      },
      "export.validation.requiresKey": {
        value: "La especificaci\xF3n debe tener una meta.key",
        description: "Error de validaci\xF3n"
      },
      "export.validation.requiresInstructions": {
        value: "La especificaci\xF3n debe tener instrucciones",
        description: "Error de validaci\xF3n"
      },
      "export.validation.requiresTool": {
        value: "La especificaci\xF3n debe tener al menos una herramienta",
        description: "Error de validaci\xF3n"
      },
      "export.validation.toolRequiresName": {
        value: "Todas las herramientas deben tener un nombre",
        description: "Error de validaci\xF3n"
      },
      "export.validation.toolRequiresDescOrName": {
        value: "La herramienta debe tener una descripci\xF3n o un nombre",
        description: "Error de validaci\xF3n"
      },
      "export.validation.toolInvalidName": {
        value: "El nombre de herramienta '{name}' debe ser un identificador v\xE1lido (letras, n\xFAmeros, guiones bajos)",
        description: "Error de validaci\xF3n para nombre de herramienta inv\xE1lido",
        placeholders: [{ name: "name", type: "string" }]
      },
      "export.agentType.build": {
        value: "Agente principal con acceso completo a herramientas para la generaci\xF3n y modificaci\xF3n de c\xF3digo.",
        description: "Descripci\xF3n del tipo de agente de construcci\xF3n"
      },
      "export.agentType.plan": {
        value: "Agente restringido para an\xE1lisis y planificaci\xF3n. Las ediciones de archivos y los comandos bash requieren aprobaci\xF3n.",
        description: "Descripci\xF3n del tipo de agente de planificaci\xF3n"
      },
      "export.agentType.general": {
        value: "Subagente de prop\xF3sito general para preguntas complejas y tareas de m\xFAltiples pasos.",
        description: "Descripci\xF3n del tipo de agente general"
      },
      "export.agentType.explore": {
        value: "Subagente r\xE1pido optimizado para exploraci\xF3n de c\xF3digo y b\xFAsqueda de patrones.",
        description: "Descripci\xF3n del tipo de agente de exploraci\xF3n"
      },
      "export.bridge.requiresApproval": {
        value: "(requiere aprobaci\xF3n)",
        description: "Etiqueta de permiso de herramienta"
      },
      "export.bridge.askMode": {
        value: "(modo consulta)",
        description: "Etiqueta de permiso de herramienta"
      },
      "approval.toolRequiresApproval": {
        value: 'La herramienta "{name}" requiere aprobaci\xF3n',
        description: "Raz\xF3n predeterminada para solicitudes de aprobaci\xF3n de herramientas",
        placeholders: [{ name: "name", type: "string" }]
      },
      "log.unifiedAgent.fallback": {
        value: "[UnifiedAgent] {backend} fall\xF3, recurriendo a {fallback}",
        description: "Advertencia cuando un backend falla y se utiliza el respaldo",
        placeholders: [
          { name: "backend", type: "string" },
          { name: "fallback", type: "string" }
        ]
      },
      "log.knowledge.spaceNotAvailable": {
        value: 'El espacio de conocimiento requerido "{key}" no est\xE1 disponible',
        description: "Advertencia cuando un espacio de conocimiento requerido no existe",
        placeholders: [{ name: "key", type: "string" }]
      },
      "log.knowledge.loadFailed": {
        value: 'Error al cargar el conocimiento requerido "{key}":',
        description: "Advertencia cuando falla la carga de conocimiento",
        placeholders: [{ name: "key", type: "string" }]
      },
      "log.knowledge.queryFailed": {
        value: "Error al consultar el espacio de conocimiento {space}:",
        description: "Advertencia cuando falla la consulta de conocimiento",
        placeholders: [{ name: "space", type: "string" }]
      },
      "log.mcpServer.started": {
        value: "[MCPToolServer] Iniciado {name}@{version} con {count} herramientas",
        description: "Mensaje de registro cuando el servidor de herramientas MCP se inicia",
        placeholders: [
          { name: "name", type: "string" },
          { name: "version", type: "string" },
          { name: "count", type: "number" }
        ]
      },
      "log.mcpServer.stopped": {
        value: "[MCPToolServer] Detenido {name}",
        description: "Mensaje de registro cuando el servidor de herramientas MCP se detiene",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.telemetry.posthogAiRequired": {
        value: "PostHog LLM Analytics requiere que @posthog/ai est\xE9 instalado. Ejecute: npm install @posthog/ai posthog-node",
        description: "Error when PostHog AI dependency is missing"
      },
      "error.telemetry.posthogClientOrKeyRequired": {
        value: "PostHog LLM Analytics requiere una instancia de cliente o una apiKey.",
        description: "Error when PostHog client or API key is not configured"
      },
      "error.telemetry.posthogNodeRequired": {
        value: "PostHog LLM Analytics requiere que posthog-node est\xE9 instalado. Ejecute: npm install posthog-node",
        description: "Error when posthog-node dependency is missing"
      },
      "error.provider.notAvailable": {
        value: "El proveedor '{provider}' no est\xE1 disponible{reason}",
        description: "Error when a provider is unavailable",
        placeholders: [
          { name: "provider", type: "string" },
          { name: "reason", type: "string" }
        ]
      }
    }
  });
});

// src/i18n/messages.ts
import {
  createI18nFactory
} from "@contractspec/lib.contracts-spec/translations";
var factory, createAgentI18n, getDefaultI18n, resetI18nRegistry;
var init_messages = __esm(() => {
  init_en();
  init_fr();
  init_es();
  factory = createI18nFactory({
    specKey: "ai-agent.messages",
    catalogs: [enMessages, frMessages, esMessages]
  });
  createAgentI18n = factory.create;
  getDefaultI18n = factory.getDefault;
  resetI18nRegistry = factory.resetRegistry;
});

// src/i18n/locale.ts
import {
  DEFAULT_LOCALE,
  SUPPORTED_LOCALES,
  resolveLocale,
  isSupportedLocale
} from "@contractspec/lib.contracts-spec/translations";
var init_locale = () => {};

// src/i18n/keys.ts
var AGENT_KEYS, KNOWLEDGE_KEYS, TOOL_KEYS, INTEROP_KEYS, ERROR_KEYS, EXPORT_KEYS, APPROVAL_KEYS, LOG_KEYS, I18N_KEYS;
var init_keys = __esm(() => {
  AGENT_KEYS = {
    "agent.json.rules.validJsonOnly": "agent.json.rules.validJsonOnly",
    "agent.json.rules.noMarkdownFences": "agent.json.rules.noMarkdownFences",
    "agent.json.rules.noCommentary": "agent.json.rules.noCommentary",
    "agent.json.rules.doubleQuotes": "agent.json.rules.doubleQuotes",
    "agent.json.rules.noTrailingCommas": "agent.json.rules.noTrailingCommas",
    "agent.json.defaultDescription": "agent.json.defaultDescription",
    "agent.json.systemPrompt": "agent.json.systemPrompt"
  };
  KNOWLEDGE_KEYS = {
    "knowledge.header": "knowledge.header",
    "knowledge.description": "knowledge.description"
  };
  TOOL_KEYS = {
    "tool.knowledge.description": "tool.knowledge.description",
    "tool.knowledge.availableSpaces": "tool.knowledge.availableSpaces",
    "tool.knowledge.spaceDefault": "tool.knowledge.spaceDefault",
    "tool.knowledge.param.query": "tool.knowledge.param.query",
    "tool.knowledge.param.spaceKey": "tool.knowledge.param.spaceKey",
    "tool.knowledge.param.topK": "tool.knowledge.param.topK",
    "tool.knowledge.noResults": "tool.knowledge.noResults",
    "tool.knowledge.sourceLabel": "tool.knowledge.sourceLabel",
    "tool.fallbackDescription": "tool.fallbackDescription",
    "tool.mcp.param.message": "tool.mcp.param.message",
    "tool.mcp.param.sessionId": "tool.mcp.param.sessionId",
    "tool.mcp.agentDescription": "tool.mcp.agentDescription",
    "tool.mcp.executePrompt": "tool.mcp.executePrompt",
    "tool.mcp.toolDescription": "tool.mcp.toolDescription"
  };
  INTEROP_KEYS = {
    "interop.prompt.agentIdentity": "interop.prompt.agentIdentity",
    "interop.prompt.youAre": "interop.prompt.youAre",
    "interop.prompt.description": "interop.prompt.description",
    "interop.prompt.instructions": "interop.prompt.instructions",
    "interop.prompt.availableTools": "interop.prompt.availableTools",
    "interop.prompt.toolsIntro": "interop.prompt.toolsIntro",
    "interop.prompt.parameters": "interop.prompt.parameters",
    "interop.prompt.knowledgeContext": "interop.prompt.knowledgeContext",
    "interop.prompt.additionalContext": "interop.prompt.additionalContext",
    "interop.md.toc": "interop.md.toc",
    "interop.md.overview": "interop.md.overview",
    "interop.md.tools": "interop.md.tools",
    "interop.md.knowledge": "interop.md.knowledge",
    "interop.md.policy": "interop.md.policy",
    "interop.md.metaKey": "interop.md.metaKey",
    "interop.md.metaVersion": "interop.md.metaVersion",
    "interop.md.metaStability": "interop.md.metaStability",
    "interop.md.metaOwners": "interop.md.metaOwners",
    "interop.md.metaTags": "interop.md.metaTags",
    "interop.md.schema": "interop.md.schema",
    "interop.md.automationSafe": "interop.md.automationSafe",
    "interop.md.required": "interop.md.required",
    "interop.md.optional": "interop.md.optional",
    "interop.md.minConfidence": "interop.md.minConfidence",
    "interop.md.escalationThreshold": "interop.md.escalationThreshold",
    "interop.md.escalateToolFailure": "interop.md.escalateToolFailure",
    "interop.md.escalateTimeout": "interop.md.escalateTimeout",
    "interop.md.yes": "interop.md.yes",
    "interop.md.no": "interop.md.no"
  };
  ERROR_KEYS = {
    "error.jsonRunner.requiresModel": "error.jsonRunner.requiresModel",
    "error.missingToolHandler": "error.missingToolHandler",
    "error.unknownBackend": "error.unknownBackend",
    "error.claudeSdk.notAvailable": "error.claudeSdk.notAvailable",
    "error.claudeSdk.notInstalled": "error.claudeSdk.notInstalled",
    "error.opencodeSdk.notAvailable": "error.opencodeSdk.notAvailable",
    "error.opencodeSdk.notInstalled": "error.opencodeSdk.notInstalled",
    "error.providerNotInitialized": "error.providerNotInitialized",
    "error.agentKeyRequired": "error.agentKeyRequired",
    "error.agentMissingVersion": "error.agentMissingVersion",
    "error.agentRequiresInstructions": "error.agentRequiresInstructions",
    "error.agentRequiresTool": "error.agentRequiresTool",
    "error.agentDuplicateTool": "error.agentDuplicateTool",
    "error.agentSpecNotFound": "error.agentSpecNotFound",
    "error.specNotFound": "error.specNotFound",
    "error.toolNotFound": "error.toolNotFound",
    "error.noHandlerForTool": "error.noHandlerForTool",
    "error.noToolHandler": "error.noToolHandler",
    "error.unknownExportFormat": "error.unknownExportFormat",
    "error.handlerNotFoundForTool": "error.handlerNotFoundForTool",
    "error.toolNotFoundOrNoHandler": "error.toolNotFoundOrNoHandler",
    "error.toolNoExecuteHandler": "error.toolNoExecuteHandler",
    "error.provider.notRegistered": "error.provider.notRegistered",
    "error.provider.depsNotInstalled": "error.provider.depsNotInstalled",
    "error.provider.sdkNotConfigured": "error.provider.sdkNotConfigured",
    "error.provider.claudeSdkMissing": "error.provider.claudeSdkMissing",
    "error.provider.opencodeSdkMissing": "error.provider.opencodeSdkMissing",
    "error.provider.sdkNotInstalled": "error.provider.sdkNotInstalled",
    "error.provider.contextCreation": "error.provider.contextCreation",
    "error.provider.executionFailed": "error.provider.executionFailed",
    "error.provider.streamFailed": "error.provider.streamFailed",
    "error.provider.notAvailable": "error.provider.notAvailable",
    "error.telemetry.posthogAiRequired": "error.telemetry.posthogAiRequired",
    "error.telemetry.posthogClientOrKeyRequired": "error.telemetry.posthogClientOrKeyRequired",
    "error.telemetry.posthogNodeRequired": "error.telemetry.posthogNodeRequired"
  };
  EXPORT_KEYS = {
    "export.agentConfiguration": "export.agentConfiguration",
    "export.metadata": "export.metadata",
    "export.metaName": "export.metaName",
    "export.metaVersion": "export.metaVersion",
    "export.metaOwners": "export.metaOwners",
    "export.metaModel": "export.metaModel",
    "export.instructions": "export.instructions",
    "export.availableTools": "export.availableTools",
    "export.tools": "export.tools",
    "export.knowledgeSources": "export.knowledgeSources",
    "export.policy": "export.policy",
    "export.additionalContext": "export.additionalContext",
    "export.configuration": "export.configuration",
    "export.mcpServers": "export.mcpServers",
    "export.parameters": "export.parameters",
    "export.requiresApproval": "export.requiresApproval",
    "export.notAutomationSafe": "export.notAutomationSafe",
    "export.requiresApprovalMd": "export.requiresApprovalMd",
    "export.notAutomationSafeMd": "export.notAutomationSafeMd",
    "export.required": "export.required",
    "export.optional": "export.optional",
    "export.minConfidence": "export.minConfidence",
    "export.escalationConfigured": "export.escalationConfigured",
    "export.escalationPolicyConfigured": "export.escalationPolicyConfigured",
    "export.featureFlags": "export.featureFlags",
    "export.generatedFrom": "export.generatedFrom",
    "export.exportedAt": "export.exportedAt",
    "export.agentType": "export.agentType",
    "export.noDescription": "export.noDescription",
    "export.validation.requiresKey": "export.validation.requiresKey",
    "export.validation.requiresInstructions": "export.validation.requiresInstructions",
    "export.validation.requiresTool": "export.validation.requiresTool",
    "export.validation.toolRequiresName": "export.validation.toolRequiresName",
    "export.validation.toolRequiresDescOrName": "export.validation.toolRequiresDescOrName",
    "export.validation.toolInvalidName": "export.validation.toolInvalidName",
    "export.agentType.build": "export.agentType.build",
    "export.agentType.plan": "export.agentType.plan",
    "export.agentType.general": "export.agentType.general",
    "export.agentType.explore": "export.agentType.explore",
    "export.bridge.requiresApproval": "export.bridge.requiresApproval",
    "export.bridge.askMode": "export.bridge.askMode"
  };
  APPROVAL_KEYS = {
    "approval.toolRequiresApproval": "approval.toolRequiresApproval"
  };
  LOG_KEYS = {
    "log.unifiedAgent.fallback": "log.unifiedAgent.fallback",
    "log.knowledge.spaceNotAvailable": "log.knowledge.spaceNotAvailable",
    "log.knowledge.loadFailed": "log.knowledge.loadFailed",
    "log.knowledge.queryFailed": "log.knowledge.queryFailed",
    "log.mcpServer.started": "log.mcpServer.started",
    "log.mcpServer.stopped": "log.mcpServer.stopped"
  };
  I18N_KEYS = {
    ...AGENT_KEYS,
    ...KNOWLEDGE_KEYS,
    ...TOOL_KEYS,
    ...INTEROP_KEYS,
    ...ERROR_KEYS,
    ...EXPORT_KEYS,
    ...APPROVAL_KEYS,
    ...LOG_KEYS
  };
});

// src/i18n/index.ts
var init_i18n = __esm(() => {
  init_messages();
  init_locale();
  init_keys();
  init_en();
  init_fr();
  init_es();
});

// src/providers/claude-agent-sdk/tool-bridge.ts
function specToolToClaudeAgentTool(tool, handler, context) {
  return {
    name: tool.name,
    description: tool.description ?? createAgentI18n().t("tool.fallbackDescription", { name: tool.name }),
    input_schema: normalizeSchema(tool.schema),
    requires_confirmation: tool.requiresApproval ?? !tool.automationSafe,
    execute: async (input) => {
      const fullContext = {
        agentId: context.agentId ?? "unknown",
        sessionId: context.sessionId ?? "unknown",
        tenantId: context.tenantId,
        actorId: context.actorId,
        metadata: context.metadata,
        signal: context.signal
      };
      return handler(input, fullContext);
    }
  };
}
function specToolsToClaudeAgentTools(tools, handlers, context) {
  return tools.filter((tool) => handlers.has(tool.name)).map((tool) => {
    const handler = handlers.get(tool.name);
    if (!handler) {
      throw new Error(createAgentI18n().t("error.handlerNotFoundForTool", {
        name: tool.name
      }));
    }
    return specToolToClaudeAgentTool(tool, handler, context);
  });
}
function claudeAgentToolToSpecTool(claudeTool, execute) {
  const config = {
    name: claudeTool.name,
    description: claudeTool.description,
    schema: claudeTool.input_schema,
    requiresApproval: claudeTool.requires_confirmation,
    automationSafe: !claudeTool.requires_confirmation
  };
  const handler = execute ? async (input, _ctx) => String(await execute(input)) : undefined;
  return { config, handler };
}
function claudeAgentToolsToSpecTools(claudeTools) {
  const configs = [];
  const handlers = new Map;
  for (const claudeTool of claudeTools) {
    const { config, handler } = claudeAgentToolToSpecTool(claudeTool, claudeTool.execute);
    configs.push(config);
    if (handler) {
      handlers.set(config.name, handler);
    }
  }
  return { configs, handlers };
}
function specToolToExternalTool(tool, handler, context) {
  return {
    name: tool.name,
    description: tool.description ?? createAgentI18n().t("tool.fallbackDescription", { name: tool.name }),
    inputSchema: tool.schema ?? { type: "object" },
    requiresApproval: tool.requiresApproval ?? !tool.automationSafe,
    execute: handler ? async (input) => {
      const fullContext = {
        agentId: context?.agentId ?? "unknown",
        sessionId: context?.sessionId ?? "unknown",
        tenantId: context?.tenantId,
        actorId: context?.actorId,
        metadata: context?.metadata,
        signal: context?.signal
      };
      return handler(input, fullContext);
    } : undefined
  };
}
function normalizeSchema(schema) {
  if (!schema) {
    return { type: "object" };
  }
  if (schema.type === "object") {
    return schema;
  }
  return {
    type: "object",
    properties: {
      value: schema
    },
    required: ["value"]
  };
}
function extractToolCalls(response) {
  if (!response.content) {
    return [];
  }
  return response.content.filter((block) => block.type === "tool_use").map((block) => ({
    toolCallId: block.id ?? "",
    toolName: block.name ?? "",
    args: block.input
  }));
}
var init_tool_bridge = __esm(() => {
  init_i18n();
});
init_tool_bridge();

export {
  specToolsToClaudeAgentTools,
  specToolToExternalTool,
  specToolToClaudeAgentTool,
  extractToolCalls,
  claudeAgentToolsToSpecTools,
  claudeAgentToolToSpecTool
};
