import { createRequire } from "node:module";
var __defProp = Object.defineProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, {
      get: all[name],
      enumerable: true,
      configurable: true,
      set: (newValue) => all[name] = () => newValue
    });
};
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
var __require = /* @__PURE__ */ createRequire(import.meta.url);

// 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înes destinées aux utilisateurs, aux LLM et aux développeurs 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és et valeurs de type chaîne.",
        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écuteur d'agent JSON uniquement pour les pipelines déterministes.",
        description: "Default description for the JSON runner spec"
      },
      "agent.json.systemPrompt": {
        value: "Vous êtes un générateur JSON précis.",
        description: "Default system prompt for the JSON runner"
      },
      "knowledge.header": {
        value: "# Connaissances de référence",
        description: "Header for injected knowledge section in system prompt"
      },
      "knowledge.description": {
        value: "Les informations suivantes sont fournies à titre de référence. Utilisez-les pour éclairer vos réponses.",
        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écifiques 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ête de recherche pour trouver des informations pertinentes",
        description: "Parameter description for the query field"
      },
      "tool.knowledge.param.spaceKey": {
        value: "Espace de connaissances spécifique à 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ésultats à retourner",
        description: "Parameter description for the topK field"
      },
      "tool.knowledge.noResults": {
        value: "Aucune information pertinente trouvée 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écuter {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ête à envoyer à 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écutez 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écuter l'outil {name}",
        description: "MCP server: individual tool description",
        placeholders: [
          { name: "name", type: "string", description: "Tool name" }
        ]
      },
      "interop.prompt.agentIdentity": {
        value: "# Identité de l'agent",
        description: "Section header for agent identity in LLM prompt"
      },
      "interop.prompt.youAre": {
        value: "Vous êtes {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ès aux outils suivants :",
        description: "Introduction before listing tools"
      },
      "interop.prompt.parameters": {
        value: "Paramètres :",
        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émentaire",
        description: "Section header for additional context"
      },
      "interop.md.toc": {
        value: "## Table des matières",
        description: "TOC header"
      },
      "interop.md.overview": {
        value: "## Aperçu",
        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é** : `{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é** : {stability}",
        description: "Metadata line for stability",
        placeholders: [{ name: "stability", type: "string" }]
      },
      "interop.md.metaOwners": {
        value: "- **Propriétaires** : {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éma :**",
        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'échec d'outil** : Oui",
        description: "Escalate on tool failure policy line"
      },
      "interop.md.escalateTimeout": {
        value: "- **Escalader en cas de délai d'attente dépassé** : 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écessite un modèle 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é. Exécutez : 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é. Exécutez : npm install @opencode-ai/sdk",
        description: "Error when OpenCode SDK module is not found"
      },
      "error.providerNotInitialized": {
        value: "Fournisseur non initialisé",
        description: "Error when provider has not been initialized before use"
      },
      "error.agentKeyRequired": {
        value: "La clé 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îne de caractères",
        description: "Validation error: version not a string",
        placeholders: [{ name: "key", type: "string" }]
      },
      "error.agentRequiresInstructions": {
        value: "L'agent {key} nécessite 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écification d'agent introuvable pour {name}",
        description: "Error when agent spec is not in the registry",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.specNotFound": {
        value: "Spécification 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é 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 « {name} » 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écution",
        description: "Error when tool lacks an execute function",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.provider.notRegistered": {
        value: "non enregistré",
        description: "Provider availability reason: not registered"
      },
      "error.provider.depsNotInstalled": {
        value: "dépendances non installées ou non configurées",
        description: "Provider availability reason: deps missing"
      },
      "error.provider.sdkNotConfigured": {
        value: "SDK non installé ou clé d'API non configurée",
        description: "Provider availability reason: SDK or key missing"
      },
      "error.provider.claudeSdkMissing": {
        value: "@anthropic-ai/claude-agent-sdk n'est pas installé",
        description: "Error when Claude Agent SDK require.resolve fails"
      },
      "error.provider.opencodeSdkMissing": {
        value: "@opencode-ai/sdk n'est pas installé",
        description: "Error when OpenCode SDK require.resolve fails"
      },
      "error.provider.sdkNotInstalled": {
        value: "SDK non installé",
        description: "Generic provider error: SDK not installed"
      },
      "error.provider.contextCreation": {
        value: "Échec de la création du contexte : {error}",
        description: "Error during provider context creation",
        placeholders: [{ name: "error", type: "string" }]
      },
      "error.provider.executionFailed": {
        value: "Échec de l'exécution : {error}",
        description: "Error during provider execution",
        placeholders: [{ name: "error", type: "string" }]
      },
      "error.provider.streamFailed": {
        value: "Échec 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étadonnées",
        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étaires** : {owners}",
        description: "Metadata line",
        placeholders: [{ name: "owners", type: "string" }]
      },
      "export.metaModel": {
        value: "- **Modèle** : {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émentaire",
        description: "Markdown heading"
      },
      "export.configuration": {
        value: "## Configuration",
        description: "Markdown heading"
      },
      "export.mcpServers": {
        value: "## Serveurs MCP",
        description: "Markdown heading"
      },
      "export.parameters": {
        value: "**Paramètres :**",
        description: "Parameters label"
      },
      "export.requiresApproval": {
        value: "nécessite une approbation",
        description: "Tool flag"
      },
      "export.notAutomationSafe": {
        value: "non compatible avec l'automatisation",
        description: "Tool flag"
      },
      "export.requiresApprovalMd": {
        value: "*(nécessite 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ée",
        description: "Policy line for system prompt"
      },
      "export.escalationPolicyConfigured": {
        value: "- Politique d'escalade configurée",
        description: "Policy line for markdown export"
      },
      "export.featureFlags": {
        value: "- Indicateurs de fonctionnalités : {flags}",
        description: "Feature flags policy line",
        placeholders: [{ name: "flags", type: "string" }]
      },
      "export.generatedFrom": {
        value: "*Généré à partir de ContractSpec : {key}*",
        description: "Footer attribution line",
        placeholders: [{ name: "key", type: "string" }]
      },
      "export.exportedAt": {
        value: "*Exporté 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écification doit avoir une meta.key",
        description: "Validation error"
      },
      "export.validation.requiresInstructions": {
        value: "La spécification doit avoir des instructions",
        description: "Validation error"
      },
      "export.validation.requiresTool": {
        value: "La spécification 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 « {name} » doit être 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ès complet aux outils pour la génération 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écessitent une approbation.",
        description: "Plan agent type description"
      },
      "export.agentType.general": {
        value: "Sous-agent généraliste pour les questions complexes et les tâches en plusieurs étapes.",
        description: "General agent type description"
      },
      "export.agentType.explore": {
        value: "Sous-agent rapide optimisé pour l'exploration de la base de code et la recherche de motifs.",
        description: "Explore agent type description"
      },
      "export.bridge.requiresApproval": {
        value: "(nécessite une approbation)",
        description: "Tool permission label"
      },
      "export.bridge.askMode": {
        value: "(mode interrogation)",
        description: "Tool permission label"
      },
      "approval.toolRequiresApproval": {
        value: "L'outil « {name} » nécessite une approbation",
        description: "Default reason for tool approval requests",
        placeholders: [{ name: "name", type: "string" }]
      },
      "log.unifiedAgent.fallback": {
        value: "[UnifiedAgent] {backend} a échoué, 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 « {key} » n'est pas disponible",
        description: "Warning when a required knowledge space is missing",
        placeholders: [{ name: "key", type: "string" }]
      },
      "log.knowledge.loadFailed": {
        value: "Échec du chargement des connaissances requises « {key} » :",
        description: "Warning when knowledge loading fails",
        placeholders: [{ name: "key", type: "string" }]
      },
      "log.knowledge.queryFailed": {
        value: "Échec 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émarré 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êté",
        description: "Log message when MCP tool server stops",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.telemetry.posthogAiRequired": {
        value: "PostHog LLM Analytics nécessite l'installation de @posthog/ai. Exécutez : npm install @posthog/ai posthog-node",
        description: "Error when PostHog AI dependency is missing"
      },
      "error.telemetry.posthogClientOrKeyRequired": {
        value: "PostHog LLM Analytics nécessite 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écessite l'installation de posthog-node. Exécutez : npm install posthog-node",
        description: "Error when posthog-node dependency is missing"
      },
      "error.provider.notAvailable": {
        value: "Le fournisseur « {provider} » 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 ÚNICAMENTE JSON válido.",
        description: "Regla del ejecutor JSON: la salida debe ser JSON válido"
      },
      "agent.json.rules.noMarkdownFences": {
        value: "No envuelva la salida en bloques de código markdown.",
        description: "Regla del ejecutor JSON: sin bloques de código 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ón predeterminada para la especificación 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ón de conocimiento inyectado en el prompt del sistema"
      },
      "knowledge.description": {
        value: "La siguiente información se proporciona como referencia. Utilícela para fundamentar sus respuestas.",
        description: "Descripción debajo del encabezado de conocimiento"
      },
      "tool.knowledge.description": {
        value: "Consultar bases de conocimiento para obtener información relevante. Utilice esta herramienta cuando necesite buscar información específica que pueda no estar en su contexto.",
        description: "Descripción 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ón de respaldo para espacios de conocimiento sin nombre"
      },
      "tool.knowledge.param.query": {
        value: "La pregunta o consulta de búsqueda para encontrar información relevante",
        description: "Descripción del parámetro para el campo de consulta"
      },
      "tool.knowledge.param.spaceKey": {
        value: "Espacio de conocimiento específico a consultar. Si se omite, busca en todos los espacios disponibles.",
        description: "Descripción del parámetro para el campo spaceKey"
      },
      "tool.knowledge.param.topK": {
        value: "Número máximo de resultados a devolver",
        description: "Descripción del parámetro para el campo topK"
      },
      "tool.knowledge.noResults": {
        value: "No se encontró información 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úsqueda de conocimiento",
        placeholders: [
          {
            name: "index",
            type: "number",
            description: "Índice 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ón de respaldo cuando una herramienta no tiene descripción explícita",
        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ón del parámetro message"
      },
      "tool.mcp.param.sessionId": {
        value: "ID de sesión opcional para continuar una conversación",
        description: "Servidor MCP: descripción del parámetro sessionId"
      },
      "tool.mcp.agentDescription": {
        value: "Interactuar con el agente {key}",
        description: "Servidor MCP: descripción de la herramienta de agente",
        placeholders: [
          {
            name: "key",
            type: "string",
            description: "Clave de la especificación 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ón de herramienta individual",
        placeholders: [
          {
            name: "name",
            type: "string",
            description: "Nombre de la herramienta"
          }
        ]
      },
      "interop.prompt.agentIdentity": {
        value: "# Identidad del agente",
        description: "Encabezado de sección para la identidad del agente en el prompt del LLM"
      },
      "interop.prompt.youAre": {
        value: "Usted es {key} (v{version}).",
        description: "Declaración de identidad del agente en el prompt del LLM",
        placeholders: [
          { name: "key", type: "string" },
          { name: "version", type: "string" }
        ]
      },
      "interop.prompt.description": {
        value: "## Descripción",
        description: "Encabezado de sección para la descripción"
      },
      "interop.prompt.instructions": {
        value: "## Instrucciones",
        description: "Encabezado de sección para las instrucciones"
      },
      "interop.prompt.availableTools": {
        value: "## Herramientas disponibles",
        description: "Encabezado de sección para las herramientas disponibles"
      },
      "interop.prompt.toolsIntro": {
        value: "Usted tiene acceso a las siguientes herramientas:",
        description: "Introducción antes de listar las herramientas"
      },
      "interop.prompt.parameters": {
        value: "Parámetros:",
        description: "Etiqueta antes del bloque de parámetros de la herramienta"
      },
      "interop.prompt.knowledgeContext": {
        value: "## Contexto de conocimiento",
        description: "Encabezado de sección para el contexto de conocimiento"
      },
      "interop.prompt.additionalContext": {
        value: "## Contexto adicional",
        description: "Encabezado de sección 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ítica",
        description: "Encabezado de política"
      },
      "interop.md.metaKey": {
        value: "- **Clave**: `{key}`",
        description: "Línea de metadatos para la clave",
        placeholders: [{ name: "key", type: "string" }]
      },
      "interop.md.metaVersion": {
        value: "- **Versión**: {version}",
        description: "Línea de metadatos para la versión",
        placeholders: [{ name: "version", type: "string" }]
      },
      "interop.md.metaStability": {
        value: "- **Estabilidad**: {stability}",
        description: "Línea de metadatos para la estabilidad",
        placeholders: [{ name: "stability", type: "string" }]
      },
      "interop.md.metaOwners": {
        value: "- **Propietarios**: {owners}",
        description: "Línea de metadatos para los propietarios",
        placeholders: [{ name: "owners", type: "string" }]
      },
      "interop.md.metaTags": {
        value: "- **Etiquetas**: {tags}",
        description: "Línea 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ón**: {value}",
        description: "Campo de seguridad para automatización",
        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ínima**: {min}",
        description: "Línea de política de confianza mínima",
        placeholders: [{ name: "min", type: "number" }]
      },
      "interop.md.escalationThreshold": {
        value: "- **Umbral de escalamiento**: {threshold}",
        description: "Línea de política de umbral de escalamiento",
        placeholders: [{ name: "threshold", type: "number" }]
      },
      "interop.md.escalateToolFailure": {
        value: "- **Escalar ante fallo de herramienta**: Sí",
        description: "Línea de política de escalamiento ante fallo de herramienta"
      },
      "interop.md.escalateTimeout": {
        value: "- **Escalar ante tiempo de espera agotado**: Sí",
        description: "Línea de política de escalamiento ante tiempo de espera"
      },
      "interop.md.yes": { value: "Sí", description: "Etiqueta de Sí" },
      "interop.md.no": { value: "No", description: "Etiqueta de No" },
      "error.jsonRunner.requiresModel": {
        value: "createAgentJsonRunner requiere un modelo o configuración 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á 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á 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ódulo del Claude Agent SDK"
      },
      "error.opencodeSdk.notAvailable": {
        value: "OpenCode SDK no disponible. Instale @opencode-ai/sdk",
        description: "Error cuando el OpenCode SDK no está disponible"
      },
      "error.opencodeSdk.notInstalled": {
        value: "OpenCode SDK no instalado. Ejecute: npm install @opencode-ai/sdk",
        description: "Error cuando no se encuentra el módulo 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ón: falta la clave del agente"
      },
      "error.agentMissingVersion": {
        value: "Al agente {key} le falta una versión de tipo cadena",
        description: "Error de validación: la versión no es una cadena de texto",
        placeholders: [{ name: "key", type: "string" }]
      },
      "error.agentRequiresInstructions": {
        value: "El agente {key} requiere instrucciones",
        description: "Error de validación: faltan instrucciones",
        placeholders: [{ name: "key", type: "string" }]
      },
      "error.agentRequiresTool": {
        value: "El agente {key} debe exponer al menos una herramienta",
        description: "Error de validación: 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ón: nombre de herramienta duplicado",
        placeholders: [
          { name: "key", type: "string" },
          { name: "name", type: "string" }
        ]
      },
      "error.agentSpecNotFound": {
        value: "Especificación de agente no encontrada para {name}",
        description: "Error cuando la especificación del agente no está en el registro",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.specNotFound": {
        value: "Especificación no encontrada: {specKey}",
        description: "Error cuando no se encuentra una clave de especificación",
        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ón desconocido: {format}",
        description: "Error para formato de exportación 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ón de la herramienta falla",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.toolNoExecuteHandler": {
        value: "La herramienta {name} no tiene manejador de ejecución",
        description: "Error cuando la herramienta carece de una función de ejecución",
        placeholders: [{ name: "name", type: "string" }]
      },
      "error.provider.notRegistered": {
        value: "no registrado",
        description: "Razón de disponibilidad del proveedor: no registrado"
      },
      "error.provider.depsNotInstalled": {
        value: "dependencias no instaladas o no configuradas",
        description: "Razón de disponibilidad del proveedor: faltan dependencias"
      },
      "error.provider.sdkNotConfigured": {
        value: "SDK no instalado o clave de API no configurada",
        description: "Razón de disponibilidad del proveedor: falta SDK o clave"
      },
      "error.provider.claudeSdkMissing": {
        value: "@anthropic-ai/claude-agent-sdk no está instalado",
        description: "Error cuando falla require.resolve del Claude Agent SDK"
      },
      "error.provider.opencodeSdkMissing": {
        value: "@opencode-ai/sdk no está instalado",
        description: "Error cuando falla require.resolve del OpenCode SDK"
      },
      "error.provider.sdkNotInstalled": {
        value: "SDK no instalado",
        description: "Error genérico del proveedor: SDK no instalado"
      },
      "error.provider.contextCreation": {
        value: "Error al crear el contexto: {error}",
        description: "Error durante la creación del contexto del proveedor",
        placeholders: [{ name: "error", type: "string" }]
      },
      "error.provider.executionFailed": {
        value: "La ejecución falló: {error}",
        description: "Error durante la ejecución del proveedor",
        placeholders: [{ name: "error", type: "string" }]
      },
      "error.provider.streamFailed": {
        value: "El stream falló: {error}",
        description: "Error durante el streaming del proveedor",
        placeholders: [{ name: "error", type: "string" }]
      },
      "export.agentConfiguration": {
        value: "# Configuración del agente",
        description: "Encabezado Markdown"
      },
      "export.metadata": {
        value: "## Metadatos",
        description: "Encabezado Markdown"
      },
      "export.metaName": {
        value: "- **Nombre**: {name}",
        description: "Línea de metadatos",
        placeholders: [{ name: "name", type: "string" }]
      },
      "export.metaVersion": {
        value: "- **Versión**: {version}",
        description: "Línea de metadatos",
        placeholders: [{ name: "version", type: "string" }]
      },
      "export.metaOwners": {
        value: "- **Propietarios**: {owners}",
        description: "Línea de metadatos",
        placeholders: [{ name: "owners", type: "string" }]
      },
      "export.metaModel": {
        value: "- **Modelo**: {model}",
        description: "Línea 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ítica",
        description: "Encabezado Markdown"
      },
      "export.additionalContext": {
        value: "## Contexto adicional",
        description: "Encabezado Markdown"
      },
      "export.configuration": {
        value: "## Configuración",
        description: "Encabezado Markdown"
      },
      "export.mcpServers": {
        value: "## Servidores MCP",
        description: "Encabezado Markdown"
      },
      "export.parameters": {
        value: "**Parámetros:**",
        description: "Etiqueta de parámetros"
      },
      "export.requiresApproval": {
        value: "requiere aprobación",
        description: "Indicador de herramienta"
      },
      "export.notAutomationSafe": {
        value: "no es seguro para automatización",
        description: "Indicador de herramienta"
      },
      "export.requiresApprovalMd": {
        value: "*(requiere aprobación)*",
        description: "Indicador de herramienta en Markdown"
      },
      "export.notAutomationSafeMd": {
        value: "*(no es seguro para automatización)*",
        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ínima: {min}",
        description: "Línea de política",
        placeholders: [{ name: "min", type: "number" }]
      },
      "export.escalationConfigured": {
        value: "- La política de escalamiento está configurada",
        description: "Línea de política para el prompt del sistema"
      },
      "export.escalationPolicyConfigured": {
        value: "- Política de escalamiento configurada",
        description: "Línea de política para la exportación en Markdown"
      },
      "export.featureFlags": {
        value: "- Indicadores de características: {flags}",
        description: "Línea de política de indicadores de características",
        placeholders: [{ name: "flags", type: "string" }]
      },
      "export.generatedFrom": {
        value: "*Generado desde ContractSpec: {key}*",
        description: "Línea de atribución 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ón",
        description: "Texto de respaldo cuando la herramienta no tiene descripción"
      },
      "export.validation.requiresKey": {
        value: "La especificación debe tener una meta.key",
        description: "Error de validación"
      },
      "export.validation.requiresInstructions": {
        value: "La especificación debe tener instrucciones",
        description: "Error de validación"
      },
      "export.validation.requiresTool": {
        value: "La especificación debe tener al menos una herramienta",
        description: "Error de validación"
      },
      "export.validation.toolRequiresName": {
        value: "Todas las herramientas deben tener un nombre",
        description: "Error de validación"
      },
      "export.validation.toolRequiresDescOrName": {
        value: "La herramienta debe tener una descripción o un nombre",
        description: "Error de validación"
      },
      "export.validation.toolInvalidName": {
        value: "El nombre de herramienta '{name}' debe ser un identificador válido (letras, números, guiones bajos)",
        description: "Error de validación para nombre de herramienta inválido",
        placeholders: [{ name: "name", type: "string" }]
      },
      "export.agentType.build": {
        value: "Agente principal con acceso completo a herramientas para la generación y modificación de código.",
        description: "Descripción del tipo de agente de construcción"
      },
      "export.agentType.plan": {
        value: "Agente restringido para análisis y planificación. Las ediciones de archivos y los comandos bash requieren aprobación.",
        description: "Descripción del tipo de agente de planificación"
      },
      "export.agentType.general": {
        value: "Subagente de propósito general para preguntas complejas y tareas de múltiples pasos.",
        description: "Descripción del tipo de agente general"
      },
      "export.agentType.explore": {
        value: "Subagente rápido optimizado para exploración de código y búsqueda de patrones.",
        description: "Descripción del tipo de agente de exploración"
      },
      "export.bridge.requiresApproval": {
        value: "(requiere aprobación)",
        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ón',
        description: "Razón predeterminada para solicitudes de aprobación de herramientas",
        placeholders: [{ name: "name", type: "string" }]
      },
      "log.unifiedAgent.fallback": {
        value: "[UnifiedAgent] {backend} falló, 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á 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é 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é instalado. Ejecute: npm install posthog-node",
        description: "Error when posthog-node dependency is missing"
      },
      "error.provider.notAvailable": {
        value: "El proveedor '{provider}' no está 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/knowledge/injector.ts
async function injectStaticKnowledge(instructions, knowledgeRefs, retriever, locale) {
  if (!retriever)
    return instructions;
  const requiredRefs = knowledgeRefs.filter((ref) => ref.required);
  if (requiredRefs.length === 0)
    return instructions;
  const i18n = createAgentI18n(locale);
  const blocks = [];
  for (const ref of requiredRefs) {
    if (!retriever.supportsSpace(ref.key)) {
      console.warn(i18n.t("log.knowledge.spaceNotAvailable", { key: ref.key }));
      continue;
    }
    try {
      const content = await retriever.getStatic(ref.key);
      if (content) {
        const header = ref.instructions ? `## ${ref.key}
${ref.instructions}` : `## ${ref.key}`;
        blocks.push(`${header}

${content}`);
      }
    } catch (error) {
      console.warn(i18n.t("log.knowledge.loadFailed", { key: ref.key }), error);
    }
  }
  if (blocks.length === 0)
    return instructions;
  return `${instructions}

---

# ${i18n.t("knowledge.header")}

${i18n.t("knowledge.description")}

${blocks.join(`

---

`)}`;
}
function createKnowledgeInjector(retriever, locale) {
  return {
    inject: (instructions, knowledgeRefs) => injectStaticKnowledge(instructions, knowledgeRefs, retriever, locale),
    hasSpace: (spaceKey) => retriever?.supportsSpace(spaceKey) ?? false,
    listSpaces: () => retriever?.listSpaces() ?? []
  };
}
var init_injector = __esm(() => {
  init_i18n();
});

// src/knowledge/index.ts
init_injector();
export {
  injectStaticKnowledge,
  createKnowledgeInjector
};
