@contractspec/lib.ai-agent 7.0.6 → 7.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -130
- package/dist/agent/agent-factory.d.ts +8 -8
- package/dist/agent/agent-factory.js +1385 -1358
- package/dist/agent/contract-spec-agent.d.ts +8 -8
- package/dist/agent/contract-spec-agent.js +1385 -1358
- package/dist/agent/index.js +1646 -1619
- package/dist/agent/json-runner.d.ts +2 -2
- package/dist/agent/json-runner.js +1385 -1358
- package/dist/agent/unified-agent.d.ts +3 -3
- package/dist/agent/unified-agent.js +1646 -1619
- package/dist/approval/index.d.ts +1 -1
- package/dist/approval/index.js +618 -618
- package/dist/approval/workflow.js +618 -618
- package/dist/exporters/claude-agent-exporter.d.ts +1 -1
- package/dist/exporters/claude-agent-exporter.js +619 -619
- package/dist/exporters/index.d.ts +2 -2
- package/dist/exporters/index.js +626 -625
- package/dist/exporters/opencode-exporter.js +625 -625
- package/dist/exporters/types.d.ts +1 -1
- package/dist/i18n/catalogs/index.d.ts +1 -1
- package/dist/i18n/catalogs/index.js +587 -587
- package/dist/i18n/index.d.ts +7 -7
- package/dist/i18n/index.js +618 -618
- package/dist/i18n/locale.d.ts +1 -1
- package/dist/i18n/locale.js +2 -2
- package/dist/i18n/messages.js +587 -587
- package/dist/index.js +619 -619
- package/dist/interop/index.d.ts +2 -2
- package/dist/interop/index.js +619 -619
- package/dist/interop/spec-consumer.d.ts +1 -1
- package/dist/interop/spec-consumer.js +619 -619
- package/dist/interop/tool-consumer.d.ts +2 -2
- package/dist/interop/tool-consumer.js +619 -619
- package/dist/knowledge/index.js +618 -618
- package/dist/knowledge/injector.js +618 -618
- package/dist/memory/in-memory.d.ts +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/node/agent/agent-factory.js +1385 -1358
- package/dist/node/agent/contract-spec-agent.js +1385 -1358
- package/dist/node/agent/index.js +1646 -1619
- package/dist/node/agent/json-runner.js +1385 -1358
- package/dist/node/agent/unified-agent.js +1646 -1619
- package/dist/node/approval/index.js +618 -618
- package/dist/node/approval/workflow.js +618 -618
- package/dist/node/exporters/claude-agent-exporter.js +619 -619
- package/dist/node/exporters/index.js +626 -625
- package/dist/node/exporters/opencode-exporter.js +625 -625
- package/dist/node/i18n/catalogs/index.js +587 -587
- package/dist/node/i18n/index.js +618 -618
- package/dist/node/i18n/locale.js +2 -2
- package/dist/node/i18n/messages.js +587 -587
- package/dist/node/index.js +619 -619
- package/dist/node/interop/index.js +619 -619
- package/dist/node/interop/spec-consumer.js +619 -619
- package/dist/node/interop/tool-consumer.js +619 -619
- package/dist/node/knowledge/index.js +618 -618
- package/dist/node/knowledge/injector.js +618 -618
- package/dist/node/providers/claude-agent-sdk/adapter.js +799 -799
- package/dist/node/providers/claude-agent-sdk/index.js +799 -799
- package/dist/node/providers/claude-agent-sdk/tool-bridge.js +618 -618
- package/dist/node/providers/index.js +795 -795
- package/dist/node/providers/opencode-sdk/adapter.js +671 -671
- package/dist/node/providers/opencode-sdk/agent-bridge.js +619 -619
- package/dist/node/providers/opencode-sdk/index.js +673 -673
- package/dist/node/providers/opencode-sdk/tool-bridge.js +618 -618
- package/dist/node/providers/registry.js +619 -619
- package/dist/node/providers/types.js +618 -618
- package/dist/node/session/index.js +26 -1
- package/dist/node/session/store.js +26 -1
- package/dist/node/spec/index.js +619 -619
- package/dist/node/spec/registry.js +619 -619
- package/dist/node/spec/spec.js +618 -618
- package/dist/node/telemetry/index.js +622 -620
- package/dist/node/telemetry/posthog.js +622 -620
- package/dist/node/tools/index.js +902 -902
- package/dist/node/tools/knowledge-tool.js +618 -618
- package/dist/node/tools/mcp-server.js +619 -619
- package/dist/node/tools/tool-adapter.js +619 -619
- package/dist/providers/claude-agent-sdk/adapter.d.ts +1 -1
- package/dist/providers/claude-agent-sdk/adapter.js +799 -799
- package/dist/providers/claude-agent-sdk/index.d.ts +1 -1
- package/dist/providers/claude-agent-sdk/index.js +799 -799
- package/dist/providers/claude-agent-sdk/session-bridge.d.ts +1 -2
- package/dist/providers/claude-agent-sdk/tool-bridge.d.ts +1 -1
- package/dist/providers/claude-agent-sdk/tool-bridge.js +618 -618
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +795 -795
- package/dist/providers/opencode-sdk/adapter.d.ts +1 -1
- package/dist/providers/opencode-sdk/adapter.js +671 -671
- package/dist/providers/opencode-sdk/agent-bridge.js +619 -619
- package/dist/providers/opencode-sdk/index.d.ts +1 -1
- package/dist/providers/opencode-sdk/index.js +673 -673
- package/dist/providers/opencode-sdk/tool-bridge.d.ts +1 -1
- package/dist/providers/opencode-sdk/tool-bridge.js +618 -618
- package/dist/providers/registry.js +619 -619
- package/dist/providers/types.d.ts +1 -1
- package/dist/providers/types.js +618 -618
- package/dist/session/index.js +26 -1
- package/dist/session/store.js +26 -1
- package/dist/session/store.test.d.ts +1 -0
- package/dist/spec/index.d.ts +1 -1
- package/dist/spec/index.js +619 -619
- package/dist/spec/registry.d.ts +1 -1
- package/dist/spec/registry.js +619 -619
- package/dist/spec/spec.d.ts +1 -1
- package/dist/spec/spec.js +618 -618
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +622 -620
- package/dist/telemetry/posthog.d.ts +1 -1
- package/dist/telemetry/posthog.js +622 -620
- package/dist/tools/index.d.ts +5 -5
- package/dist/tools/index.js +902 -902
- package/dist/tools/knowledge-tool.d.ts +1 -1
- package/dist/tools/knowledge-tool.js +618 -618
- package/dist/tools/mcp-server.d.ts +1 -1
- package/dist/tools/mcp-server.js +619 -619
- package/dist/tools/tool-adapter.d.ts +2 -2
- package/dist/tools/tool-adapter.js +619 -619
- package/package.json +10 -10
|
@@ -632,602 +632,636 @@ var init_en = __esm(() => {
|
|
|
632
632
|
});
|
|
633
633
|
});
|
|
634
634
|
|
|
635
|
-
// src/i18n/catalogs/
|
|
635
|
+
// src/i18n/catalogs/es.ts
|
|
636
636
|
import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts-spec/translations";
|
|
637
|
-
var
|
|
638
|
-
var
|
|
639
|
-
|
|
637
|
+
var esMessages;
|
|
638
|
+
var init_es = __esm(() => {
|
|
639
|
+
esMessages = defineTranslation2({
|
|
640
640
|
meta: {
|
|
641
641
|
key: "ai-agent.messages",
|
|
642
642
|
version: "1.0.0",
|
|
643
643
|
domain: "ai-agent",
|
|
644
|
-
description: "
|
|
644
|
+
description: "Todas las cadenas de texto orientadas al usuario, al LLM y al desarrollador del paquete ai-agent",
|
|
645
645
|
owners: ["platform"],
|
|
646
646
|
stability: "experimental"
|
|
647
647
|
},
|
|
648
|
-
locale: "
|
|
648
|
+
locale: "es",
|
|
649
649
|
fallback: "en",
|
|
650
650
|
messages: {
|
|
651
651
|
"agent.json.rules.validJsonOnly": {
|
|
652
|
-
value: "
|
|
653
|
-
description: "
|
|
652
|
+
value: "Usted DEBE generar ÚNICAMENTE JSON válido.",
|
|
653
|
+
description: "Regla del ejecutor JSON: la salida debe ser JSON válido"
|
|
654
654
|
},
|
|
655
655
|
"agent.json.rules.noMarkdownFences": {
|
|
656
|
-
value: "
|
|
657
|
-
description: "
|
|
656
|
+
value: "No envuelva la salida en bloques de código markdown.",
|
|
657
|
+
description: "Regla del ejecutor JSON: sin bloques de código markdown"
|
|
658
658
|
},
|
|
659
659
|
"agent.json.rules.noCommentary": {
|
|
660
|
-
value: "
|
|
661
|
-
description: "
|
|
660
|
+
value: "No incluya comentarios ni explicaciones.",
|
|
661
|
+
description: "Regla del ejecutor JSON: sin texto adicional"
|
|
662
662
|
},
|
|
663
663
|
"agent.json.rules.doubleQuotes": {
|
|
664
|
-
value: "
|
|
665
|
-
description: "
|
|
664
|
+
value: "Utilice comillas dobles para todas las claves y valores de cadena.",
|
|
665
|
+
description: "Regla del ejecutor JSON: solo comillas dobles"
|
|
666
666
|
},
|
|
667
667
|
"agent.json.rules.noTrailingCommas": {
|
|
668
|
-
value: "
|
|
669
|
-
description: "
|
|
668
|
+
value: "No incluya comas finales.",
|
|
669
|
+
description: "Regla del ejecutor JSON: sin comas finales"
|
|
670
670
|
},
|
|
671
671
|
"agent.json.defaultDescription": {
|
|
672
|
-
value: "
|
|
673
|
-
description: "
|
|
672
|
+
value: "Ejecutor de agentes exclusivamente JSON para pipelines deterministas.",
|
|
673
|
+
description: "Descripción predeterminada para la especificación del ejecutor JSON"
|
|
674
674
|
},
|
|
675
675
|
"agent.json.systemPrompt": {
|
|
676
|
-
value: "
|
|
677
|
-
description: "
|
|
676
|
+
value: "Usted es un generador preciso de JSON.",
|
|
677
|
+
description: "Prompt de sistema predeterminado para el ejecutor JSON"
|
|
678
678
|
},
|
|
679
679
|
"knowledge.header": {
|
|
680
|
-
value: "#
|
|
681
|
-
description: "
|
|
680
|
+
value: "# Conocimiento de referencia",
|
|
681
|
+
description: "Encabezado para la sección de conocimiento inyectado en el prompt del sistema"
|
|
682
682
|
},
|
|
683
683
|
"knowledge.description": {
|
|
684
|
-
value: "
|
|
685
|
-
description: "
|
|
684
|
+
value: "La siguiente información se proporciona como referencia. Utilícela para fundamentar sus respuestas.",
|
|
685
|
+
description: "Descripción debajo del encabezado de conocimiento"
|
|
686
686
|
},
|
|
687
687
|
"tool.knowledge.description": {
|
|
688
|
-
value: "
|
|
689
|
-
description: "
|
|
688
|
+
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.",
|
|
689
|
+
description: "Descripción de la herramienta de consulta de conocimiento mostrada al LLM"
|
|
690
690
|
},
|
|
691
691
|
"tool.knowledge.availableSpaces": {
|
|
692
|
-
value: "
|
|
693
|
-
description: "
|
|
692
|
+
value: "Espacios de conocimiento disponibles:",
|
|
693
|
+
description: "Etiqueta antes de listar los espacios de conocimiento disponibles"
|
|
694
694
|
},
|
|
695
695
|
"tool.knowledge.spaceDefault": {
|
|
696
|
-
value: "
|
|
697
|
-
description: "
|
|
696
|
+
value: "Espacio de conocimiento",
|
|
697
|
+
description: "Descripción de respaldo para espacios de conocimiento sin nombre"
|
|
698
698
|
},
|
|
699
699
|
"tool.knowledge.param.query": {
|
|
700
|
-
value: "La
|
|
701
|
-
description: "
|
|
700
|
+
value: "La pregunta o consulta de búsqueda para encontrar información relevante",
|
|
701
|
+
description: "Descripción del parámetro para el campo de consulta"
|
|
702
702
|
},
|
|
703
703
|
"tool.knowledge.param.spaceKey": {
|
|
704
|
-
value: "
|
|
705
|
-
description: "
|
|
704
|
+
value: "Espacio de conocimiento específico a consultar. Si se omite, busca en todos los espacios disponibles.",
|
|
705
|
+
description: "Descripción del parámetro para el campo spaceKey"
|
|
706
706
|
},
|
|
707
707
|
"tool.knowledge.param.topK": {
|
|
708
|
-
value: "
|
|
709
|
-
description: "
|
|
708
|
+
value: "Número máximo de resultados a devolver",
|
|
709
|
+
description: "Descripción del parámetro para el campo topK"
|
|
710
710
|
},
|
|
711
711
|
"tool.knowledge.noResults": {
|
|
712
|
-
value: "
|
|
713
|
-
description: "
|
|
712
|
+
value: "No se encontró información relevante en las bases de conocimiento.",
|
|
713
|
+
description: "Mensaje cuando no se encuentran resultados de conocimiento"
|
|
714
714
|
},
|
|
715
715
|
"tool.knowledge.sourceLabel": {
|
|
716
|
-
value: "[
|
|
717
|
-
description: "
|
|
716
|
+
value: "[Fuente {index} - {space}] (relevancia: {score}%)",
|
|
717
|
+
description: "Etiqueta para cada resultado de búsqueda de conocimiento",
|
|
718
718
|
placeholders: [
|
|
719
|
-
{
|
|
720
|
-
|
|
721
|
-
|
|
719
|
+
{
|
|
720
|
+
name: "index",
|
|
721
|
+
type: "number",
|
|
722
|
+
description: "Índice de fuente basado en 1"
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
name: "space",
|
|
726
|
+
type: "string",
|
|
727
|
+
description: "Nombre del espacio de conocimiento"
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
name: "score",
|
|
731
|
+
type: "number",
|
|
732
|
+
description: "Porcentaje de relevancia"
|
|
733
|
+
}
|
|
722
734
|
]
|
|
723
735
|
},
|
|
724
736
|
"tool.fallbackDescription": {
|
|
725
|
-
value: "
|
|
726
|
-
description: "
|
|
737
|
+
value: "Ejecutar {name}",
|
|
738
|
+
description: "Descripción de respaldo cuando una herramienta no tiene descripción explícita",
|
|
727
739
|
placeholders: [
|
|
728
|
-
{
|
|
740
|
+
{
|
|
741
|
+
name: "name",
|
|
742
|
+
type: "string",
|
|
743
|
+
description: "Nombre de la herramienta"
|
|
744
|
+
}
|
|
729
745
|
]
|
|
730
746
|
},
|
|
731
747
|
"tool.mcp.param.message": {
|
|
732
|
-
value: "
|
|
733
|
-
description: "MCP
|
|
748
|
+
value: "El mensaje o consulta a enviar al agente",
|
|
749
|
+
description: "Servidor MCP: descripción del parámetro message"
|
|
734
750
|
},
|
|
735
751
|
"tool.mcp.param.sessionId": {
|
|
736
|
-
value: "
|
|
737
|
-
description: "MCP
|
|
752
|
+
value: "ID de sesión opcional para continuar una conversación",
|
|
753
|
+
description: "Servidor MCP: descripción del parámetro sessionId"
|
|
738
754
|
},
|
|
739
755
|
"tool.mcp.agentDescription": {
|
|
740
|
-
value: "
|
|
741
|
-
description: "MCP
|
|
756
|
+
value: "Interactuar con el agente {key}",
|
|
757
|
+
description: "Servidor MCP: descripción de la herramienta de agente",
|
|
742
758
|
placeholders: [
|
|
743
|
-
{
|
|
759
|
+
{
|
|
760
|
+
name: "key",
|
|
761
|
+
type: "string",
|
|
762
|
+
description: "Clave de la especificación del agente"
|
|
763
|
+
}
|
|
744
764
|
]
|
|
745
765
|
},
|
|
746
766
|
"tool.mcp.executePrompt": {
|
|
747
|
-
value: "
|
|
748
|
-
description: "MCP
|
|
767
|
+
value: "Ejecute la herramienta {name} con los siguientes argumentos: {args}",
|
|
768
|
+
description: "Servidor MCP: prompt enviado al ejecutar una herramienta individual",
|
|
749
769
|
placeholders: [
|
|
750
|
-
{
|
|
770
|
+
{
|
|
771
|
+
name: "name",
|
|
772
|
+
type: "string",
|
|
773
|
+
description: "Nombre de la herramienta"
|
|
774
|
+
},
|
|
751
775
|
{
|
|
752
776
|
name: "args",
|
|
753
777
|
type: "string",
|
|
754
|
-
description: "JSON
|
|
778
|
+
description: "Argumentos serializados como JSON"
|
|
755
779
|
}
|
|
756
780
|
]
|
|
757
781
|
},
|
|
758
782
|
"tool.mcp.toolDescription": {
|
|
759
|
-
value: "
|
|
760
|
-
description: "MCP
|
|
783
|
+
value: "Ejecutar la herramienta {name}",
|
|
784
|
+
description: "Servidor MCP: descripción de herramienta individual",
|
|
761
785
|
placeholders: [
|
|
762
|
-
{
|
|
786
|
+
{
|
|
787
|
+
name: "name",
|
|
788
|
+
type: "string",
|
|
789
|
+
description: "Nombre de la herramienta"
|
|
790
|
+
}
|
|
763
791
|
]
|
|
764
792
|
},
|
|
765
793
|
"interop.prompt.agentIdentity": {
|
|
766
|
-
value: "#
|
|
767
|
-
description: "
|
|
794
|
+
value: "# Identidad del agente",
|
|
795
|
+
description: "Encabezado de sección para la identidad del agente en el prompt del LLM"
|
|
768
796
|
},
|
|
769
797
|
"interop.prompt.youAre": {
|
|
770
|
-
value: "
|
|
771
|
-
description: "
|
|
798
|
+
value: "Usted es {key} (v{version}).",
|
|
799
|
+
description: "Declaración de identidad del agente en el prompt del LLM",
|
|
772
800
|
placeholders: [
|
|
773
801
|
{ name: "key", type: "string" },
|
|
774
802
|
{ name: "version", type: "string" }
|
|
775
803
|
]
|
|
776
804
|
},
|
|
777
805
|
"interop.prompt.description": {
|
|
778
|
-
value: "##
|
|
779
|
-
description: "
|
|
806
|
+
value: "## Descripción",
|
|
807
|
+
description: "Encabezado de sección para la descripción"
|
|
780
808
|
},
|
|
781
809
|
"interop.prompt.instructions": {
|
|
782
|
-
value: "##
|
|
783
|
-
description: "
|
|
810
|
+
value: "## Instrucciones",
|
|
811
|
+
description: "Encabezado de sección para las instrucciones"
|
|
784
812
|
},
|
|
785
813
|
"interop.prompt.availableTools": {
|
|
786
|
-
value: "##
|
|
787
|
-
description: "
|
|
814
|
+
value: "## Herramientas disponibles",
|
|
815
|
+
description: "Encabezado de sección para las herramientas disponibles"
|
|
788
816
|
},
|
|
789
817
|
"interop.prompt.toolsIntro": {
|
|
790
|
-
value: "
|
|
791
|
-
description: "
|
|
818
|
+
value: "Usted tiene acceso a las siguientes herramientas:",
|
|
819
|
+
description: "Introducción antes de listar las herramientas"
|
|
792
820
|
},
|
|
793
821
|
"interop.prompt.parameters": {
|
|
794
|
-
value: "
|
|
795
|
-
description: "
|
|
822
|
+
value: "Parámetros:",
|
|
823
|
+
description: "Etiqueta antes del bloque de parámetros de la herramienta"
|
|
796
824
|
},
|
|
797
825
|
"interop.prompt.knowledgeContext": {
|
|
798
|
-
value: "##
|
|
799
|
-
description: "
|
|
826
|
+
value: "## Contexto de conocimiento",
|
|
827
|
+
description: "Encabezado de sección para el contexto de conocimiento"
|
|
800
828
|
},
|
|
801
829
|
"interop.prompt.additionalContext": {
|
|
802
|
-
value: "##
|
|
803
|
-
description: "
|
|
830
|
+
value: "## Contexto adicional",
|
|
831
|
+
description: "Encabezado de sección para el contexto adicional"
|
|
804
832
|
},
|
|
805
833
|
"interop.md.toc": {
|
|
806
|
-
value: "##
|
|
807
|
-
description: "
|
|
834
|
+
value: "## Tabla de contenidos",
|
|
835
|
+
description: "Encabezado de tabla de contenidos"
|
|
808
836
|
},
|
|
809
837
|
"interop.md.overview": {
|
|
810
|
-
value: "##
|
|
811
|
-
description: "
|
|
838
|
+
value: "## Resumen general",
|
|
839
|
+
description: "Encabezado de resumen general"
|
|
840
|
+
},
|
|
841
|
+
"interop.md.tools": {
|
|
842
|
+
value: "## Herramientas",
|
|
843
|
+
description: "Encabezado de herramientas"
|
|
812
844
|
},
|
|
813
|
-
"interop.md.tools": { value: "## Outils", description: "Tools header" },
|
|
814
845
|
"interop.md.knowledge": {
|
|
815
|
-
value: "##
|
|
816
|
-
description: "
|
|
846
|
+
value: "## Conocimiento",
|
|
847
|
+
description: "Encabezado de conocimiento"
|
|
817
848
|
},
|
|
818
849
|
"interop.md.policy": {
|
|
819
|
-
value: "##
|
|
820
|
-
description: "
|
|
850
|
+
value: "## Política",
|
|
851
|
+
description: "Encabezado de política"
|
|
821
852
|
},
|
|
822
853
|
"interop.md.metaKey": {
|
|
823
|
-
value: "- **
|
|
824
|
-
description: "
|
|
854
|
+
value: "- **Clave**: `{key}`",
|
|
855
|
+
description: "Línea de metadatos para la clave",
|
|
825
856
|
placeholders: [{ name: "key", type: "string" }]
|
|
826
857
|
},
|
|
827
858
|
"interop.md.metaVersion": {
|
|
828
|
-
value: "- **
|
|
829
|
-
description: "
|
|
859
|
+
value: "- **Versión**: {version}",
|
|
860
|
+
description: "Línea de metadatos para la versión",
|
|
830
861
|
placeholders: [{ name: "version", type: "string" }]
|
|
831
862
|
},
|
|
832
863
|
"interop.md.metaStability": {
|
|
833
|
-
value: "- **
|
|
834
|
-
description: "
|
|
864
|
+
value: "- **Estabilidad**: {stability}",
|
|
865
|
+
description: "Línea de metadatos para la estabilidad",
|
|
835
866
|
placeholders: [{ name: "stability", type: "string" }]
|
|
836
867
|
},
|
|
837
868
|
"interop.md.metaOwners": {
|
|
838
|
-
value: "- **
|
|
839
|
-
description: "
|
|
869
|
+
value: "- **Propietarios**: {owners}",
|
|
870
|
+
description: "Línea de metadatos para los propietarios",
|
|
840
871
|
placeholders: [{ name: "owners", type: "string" }]
|
|
841
872
|
},
|
|
842
873
|
"interop.md.metaTags": {
|
|
843
|
-
value: "- **
|
|
844
|
-
description: "
|
|
874
|
+
value: "- **Etiquetas**: {tags}",
|
|
875
|
+
description: "Línea de metadatos para las etiquetas",
|
|
845
876
|
placeholders: [{ name: "tags", type: "string" }]
|
|
846
877
|
},
|
|
847
878
|
"interop.md.schema": {
|
|
848
|
-
value: "**
|
|
849
|
-
description: "
|
|
879
|
+
value: "**Esquema:**",
|
|
880
|
+
description: "Etiqueta de esquema"
|
|
850
881
|
},
|
|
851
882
|
"interop.md.automationSafe": {
|
|
852
|
-
value: "**
|
|
853
|
-
description: "
|
|
883
|
+
value: "**Seguro para automatización**: {value}",
|
|
884
|
+
description: "Campo de seguridad para automatización",
|
|
854
885
|
placeholders: [{ name: "value", type: "string" }]
|
|
855
886
|
},
|
|
856
887
|
"interop.md.required": {
|
|
857
|
-
value: "(
|
|
858
|
-
description: "
|
|
888
|
+
value: "(obligatorio)",
|
|
889
|
+
description: "Marcador de obligatorio"
|
|
859
890
|
},
|
|
860
891
|
"interop.md.optional": {
|
|
861
|
-
value: "(
|
|
862
|
-
description: "
|
|
892
|
+
value: "(opcional)",
|
|
893
|
+
description: "Marcador de opcional"
|
|
863
894
|
},
|
|
864
895
|
"interop.md.minConfidence": {
|
|
865
|
-
value: "- **
|
|
866
|
-
description: "
|
|
896
|
+
value: "- **Confianza mínima**: {min}",
|
|
897
|
+
description: "Línea de política de confianza mínima",
|
|
867
898
|
placeholders: [{ name: "min", type: "number" }]
|
|
868
899
|
},
|
|
869
900
|
"interop.md.escalationThreshold": {
|
|
870
|
-
value: "- **
|
|
871
|
-
description: "
|
|
901
|
+
value: "- **Umbral de escalamiento**: {threshold}",
|
|
902
|
+
description: "Línea de política de umbral de escalamiento",
|
|
872
903
|
placeholders: [{ name: "threshold", type: "number" }]
|
|
873
904
|
},
|
|
874
905
|
"interop.md.escalateToolFailure": {
|
|
875
|
-
value: "- **
|
|
876
|
-
description: "
|
|
906
|
+
value: "- **Escalar ante fallo de herramienta**: Sí",
|
|
907
|
+
description: "Línea de política de escalamiento ante fallo de herramienta"
|
|
877
908
|
},
|
|
878
909
|
"interop.md.escalateTimeout": {
|
|
879
|
-
value: "- **
|
|
880
|
-
description: "
|
|
910
|
+
value: "- **Escalar ante tiempo de espera agotado**: Sí",
|
|
911
|
+
description: "Línea de política de escalamiento ante tiempo de espera"
|
|
881
912
|
},
|
|
882
|
-
"interop.md.yes": { value: "
|
|
883
|
-
"interop.md.no": { value: "
|
|
913
|
+
"interop.md.yes": { value: "Sí", description: "Etiqueta de Sí" },
|
|
914
|
+
"interop.md.no": { value: "No", description: "Etiqueta de No" },
|
|
884
915
|
"error.jsonRunner.requiresModel": {
|
|
885
|
-
value: "createAgentJsonRunner
|
|
886
|
-
description: "Error
|
|
916
|
+
value: "createAgentJsonRunner requiere un modelo o configuración de proveedor",
|
|
917
|
+
description: "Error cuando el ejecutor JSON no tiene modelo ni proveedor"
|
|
887
918
|
},
|
|
888
919
|
"error.missingToolHandler": {
|
|
889
|
-
value: "
|
|
890
|
-
description: "Error
|
|
920
|
+
value: "Falta el manejador para la herramienta: {name}",
|
|
921
|
+
description: "Error cuando un manejador de herramienta no está registrado",
|
|
891
922
|
placeholders: [{ name: "name", type: "string" }]
|
|
892
923
|
},
|
|
893
924
|
"error.unknownBackend": {
|
|
894
|
-
value: "Backend
|
|
895
|
-
description: "Error
|
|
925
|
+
value: "Backend desconocido: {backend}",
|
|
926
|
+
description: "Error cuando se especifica un backend desconocido",
|
|
896
927
|
placeholders: [{ name: "backend", type: "string" }]
|
|
897
928
|
},
|
|
898
929
|
"error.claudeSdk.notAvailable": {
|
|
899
|
-
value: "Claude Agent SDK
|
|
900
|
-
description: "Error
|
|
930
|
+
value: "Claude Agent SDK no disponible. Instale @anthropic-ai/claude-agent-sdk",
|
|
931
|
+
description: "Error cuando el Claude Agent SDK no está disponible"
|
|
901
932
|
},
|
|
902
933
|
"error.claudeSdk.notInstalled": {
|
|
903
|
-
value: "Claude Agent SDK
|
|
904
|
-
description: "Error
|
|
934
|
+
value: "Claude Agent SDK no instalado. Ejecute: npm install @anthropic-ai/claude-agent-sdk",
|
|
935
|
+
description: "Error cuando no se encuentra el módulo del Claude Agent SDK"
|
|
905
936
|
},
|
|
906
937
|
"error.opencodeSdk.notAvailable": {
|
|
907
|
-
value: "OpenCode SDK
|
|
908
|
-
description: "Error
|
|
938
|
+
value: "OpenCode SDK no disponible. Instale @opencode-ai/sdk",
|
|
939
|
+
description: "Error cuando el OpenCode SDK no está disponible"
|
|
909
940
|
},
|
|
910
941
|
"error.opencodeSdk.notInstalled": {
|
|
911
|
-
value: "OpenCode SDK
|
|
912
|
-
description: "Error
|
|
942
|
+
value: "OpenCode SDK no instalado. Ejecute: npm install @opencode-ai/sdk",
|
|
943
|
+
description: "Error cuando no se encuentra el módulo del OpenCode SDK"
|
|
913
944
|
},
|
|
914
945
|
"error.providerNotInitialized": {
|
|
915
|
-
value: "
|
|
916
|
-
description: "Error
|
|
946
|
+
value: "Proveedor no inicializado",
|
|
947
|
+
description: "Error cuando el proveedor no ha sido inicializado antes de su uso"
|
|
917
948
|
},
|
|
918
949
|
"error.agentKeyRequired": {
|
|
919
|
-
value: "La
|
|
920
|
-
description: "
|
|
950
|
+
value: "La clave del agente es obligatoria",
|
|
951
|
+
description: "Error de validación: falta la clave del agente"
|
|
921
952
|
},
|
|
922
953
|
"error.agentMissingVersion": {
|
|
923
|
-
value: "
|
|
924
|
-
description: "
|
|
954
|
+
value: "Al agente {key} le falta una versión de tipo cadena",
|
|
955
|
+
description: "Error de validación: la versión no es una cadena de texto",
|
|
925
956
|
placeholders: [{ name: "key", type: "string" }]
|
|
926
957
|
},
|
|
927
958
|
"error.agentRequiresInstructions": {
|
|
928
|
-
value: "
|
|
929
|
-
description: "
|
|
959
|
+
value: "El agente {key} requiere instrucciones",
|
|
960
|
+
description: "Error de validación: faltan instrucciones",
|
|
930
961
|
placeholders: [{ name: "key", type: "string" }]
|
|
931
962
|
},
|
|
932
963
|
"error.agentRequiresTool": {
|
|
933
|
-
value: "
|
|
934
|
-
description: "
|
|
964
|
+
value: "El agente {key} debe exponer al menos una herramienta",
|
|
965
|
+
description: "Error de validación: no hay herramientas definidas",
|
|
935
966
|
placeholders: [{ name: "key", type: "string" }]
|
|
936
967
|
},
|
|
937
968
|
"error.agentDuplicateTool": {
|
|
938
|
-
value: "
|
|
939
|
-
description: "
|
|
969
|
+
value: "El agente {key} tiene un nombre de herramienta duplicado: {name}",
|
|
970
|
+
description: "Error de validación: nombre de herramienta duplicado",
|
|
940
971
|
placeholders: [
|
|
941
972
|
{ name: "key", type: "string" },
|
|
942
973
|
{ name: "name", type: "string" }
|
|
943
974
|
]
|
|
944
975
|
},
|
|
945
976
|
"error.agentSpecNotFound": {
|
|
946
|
-
value: "
|
|
947
|
-
description: "Error
|
|
977
|
+
value: "Especificación de agente no encontrada para {name}",
|
|
978
|
+
description: "Error cuando la especificación del agente no está en el registro",
|
|
948
979
|
placeholders: [{ name: "name", type: "string" }]
|
|
949
980
|
},
|
|
950
981
|
"error.specNotFound": {
|
|
951
|
-
value: "
|
|
952
|
-
description: "Error
|
|
982
|
+
value: "Especificación no encontrada: {specKey}",
|
|
983
|
+
description: "Error cuando no se encuentra una clave de especificación",
|
|
953
984
|
placeholders: [{ name: "specKey", type: "string" }]
|
|
954
985
|
},
|
|
955
986
|
"error.toolNotFound": {
|
|
956
|
-
value: "
|
|
957
|
-
description: "Error
|
|
987
|
+
value: "Herramienta no encontrada: {name}",
|
|
988
|
+
description: "Error cuando no se encuentra una herramienta",
|
|
958
989
|
placeholders: [{ name: "name", type: "string" }]
|
|
959
990
|
},
|
|
960
991
|
"error.noHandlerForTool": {
|
|
961
|
-
value: "
|
|
962
|
-
description: "Error
|
|
992
|
+
value: "No hay manejador registrado para la herramienta: {name}",
|
|
993
|
+
description: "Error cuando no hay manejador registrado para una herramienta",
|
|
963
994
|
placeholders: [{ name: "name", type: "string" }]
|
|
964
995
|
},
|
|
965
996
|
"error.noToolHandler": {
|
|
966
|
-
value: "
|
|
967
|
-
description: "
|
|
997
|
+
value: "Sin manejador para la herramienta: {name}",
|
|
998
|
+
description: "Error breve cuando no existe manejador",
|
|
968
999
|
placeholders: [{ name: "name", type: "string" }]
|
|
969
1000
|
},
|
|
970
1001
|
"error.unknownExportFormat": {
|
|
971
|
-
value: "
|
|
972
|
-
description: "Error
|
|
1002
|
+
value: "Formato de exportación desconocido: {format}",
|
|
1003
|
+
description: "Error para formato de exportación no soportado",
|
|
973
1004
|
placeholders: [{ name: "format", type: "string" }]
|
|
974
1005
|
},
|
|
975
1006
|
"error.handlerNotFoundForTool": {
|
|
976
|
-
value: "
|
|
977
|
-
description: "Error
|
|
1007
|
+
value: "Manejador no encontrado para la herramienta {name}",
|
|
1008
|
+
description: "Error en el puente de herramientas cuando falta el manejador",
|
|
978
1009
|
placeholders: [{ name: "name", type: "string" }]
|
|
979
1010
|
},
|
|
980
1011
|
"error.toolNotFoundOrNoHandler": {
|
|
981
|
-
value: "
|
|
982
|
-
description: "Error
|
|
1012
|
+
value: "Error: La herramienta '{name}' no fue encontrada o no tiene manejador",
|
|
1013
|
+
description: "Error devuelto al LLM cuando la ejecución de la herramienta falla",
|
|
983
1014
|
placeholders: [{ name: "name", type: "string" }]
|
|
984
1015
|
},
|
|
985
1016
|
"error.toolNoExecuteHandler": {
|
|
986
|
-
value: "
|
|
987
|
-
description: "Error
|
|
1017
|
+
value: "La herramienta {name} no tiene manejador de ejecución",
|
|
1018
|
+
description: "Error cuando la herramienta carece de una función de ejecución",
|
|
988
1019
|
placeholders: [{ name: "name", type: "string" }]
|
|
989
1020
|
},
|
|
990
1021
|
"error.provider.notRegistered": {
|
|
991
|
-
value: "
|
|
992
|
-
description: "
|
|
1022
|
+
value: "no registrado",
|
|
1023
|
+
description: "Razón de disponibilidad del proveedor: no registrado"
|
|
993
1024
|
},
|
|
994
1025
|
"error.provider.depsNotInstalled": {
|
|
995
|
-
value: "
|
|
996
|
-
description: "
|
|
1026
|
+
value: "dependencias no instaladas o no configuradas",
|
|
1027
|
+
description: "Razón de disponibilidad del proveedor: faltan dependencias"
|
|
997
1028
|
},
|
|
998
1029
|
"error.provider.sdkNotConfigured": {
|
|
999
|
-
value: "SDK
|
|
1000
|
-
description: "
|
|
1030
|
+
value: "SDK no instalado o clave de API no configurada",
|
|
1031
|
+
description: "Razón de disponibilidad del proveedor: falta SDK o clave"
|
|
1001
1032
|
},
|
|
1002
1033
|
"error.provider.claudeSdkMissing": {
|
|
1003
|
-
value: "@anthropic-ai/claude-agent-sdk
|
|
1004
|
-
description: "Error
|
|
1034
|
+
value: "@anthropic-ai/claude-agent-sdk no está instalado",
|
|
1035
|
+
description: "Error cuando falla require.resolve del Claude Agent SDK"
|
|
1005
1036
|
},
|
|
1006
1037
|
"error.provider.opencodeSdkMissing": {
|
|
1007
|
-
value: "@opencode-ai/sdk
|
|
1008
|
-
description: "Error
|
|
1038
|
+
value: "@opencode-ai/sdk no está instalado",
|
|
1039
|
+
description: "Error cuando falla require.resolve del OpenCode SDK"
|
|
1009
1040
|
},
|
|
1010
1041
|
"error.provider.sdkNotInstalled": {
|
|
1011
|
-
value: "SDK
|
|
1012
|
-
description: "
|
|
1042
|
+
value: "SDK no instalado",
|
|
1043
|
+
description: "Error genérico del proveedor: SDK no instalado"
|
|
1013
1044
|
},
|
|
1014
1045
|
"error.provider.contextCreation": {
|
|
1015
|
-
value: "
|
|
1016
|
-
description: "Error
|
|
1046
|
+
value: "Error al crear el contexto: {error}",
|
|
1047
|
+
description: "Error durante la creación del contexto del proveedor",
|
|
1017
1048
|
placeholders: [{ name: "error", type: "string" }]
|
|
1018
1049
|
},
|
|
1019
1050
|
"error.provider.executionFailed": {
|
|
1020
|
-
value: "
|
|
1021
|
-
description: "Error
|
|
1051
|
+
value: "La ejecución falló: {error}",
|
|
1052
|
+
description: "Error durante la ejecución del proveedor",
|
|
1022
1053
|
placeholders: [{ name: "error", type: "string" }]
|
|
1023
1054
|
},
|
|
1024
1055
|
"error.provider.streamFailed": {
|
|
1025
|
-
value: "
|
|
1026
|
-
description: "Error
|
|
1056
|
+
value: "El stream falló: {error}",
|
|
1057
|
+
description: "Error durante el streaming del proveedor",
|
|
1027
1058
|
placeholders: [{ name: "error", type: "string" }]
|
|
1028
1059
|
},
|
|
1029
1060
|
"export.agentConfiguration": {
|
|
1030
|
-
value: "#
|
|
1031
|
-
description: "Markdown
|
|
1061
|
+
value: "# Configuración del agente",
|
|
1062
|
+
description: "Encabezado Markdown"
|
|
1032
1063
|
},
|
|
1033
1064
|
"export.metadata": {
|
|
1034
|
-
value: "##
|
|
1035
|
-
description: "Markdown
|
|
1065
|
+
value: "## Metadatos",
|
|
1066
|
+
description: "Encabezado Markdown"
|
|
1036
1067
|
},
|
|
1037
1068
|
"export.metaName": {
|
|
1038
|
-
value: "- **
|
|
1039
|
-
description: "
|
|
1069
|
+
value: "- **Nombre**: {name}",
|
|
1070
|
+
description: "Línea de metadatos",
|
|
1040
1071
|
placeholders: [{ name: "name", type: "string" }]
|
|
1041
1072
|
},
|
|
1042
1073
|
"export.metaVersion": {
|
|
1043
|
-
value: "- **
|
|
1044
|
-
description: "
|
|
1074
|
+
value: "- **Versión**: {version}",
|
|
1075
|
+
description: "Línea de metadatos",
|
|
1045
1076
|
placeholders: [{ name: "version", type: "string" }]
|
|
1046
1077
|
},
|
|
1047
1078
|
"export.metaOwners": {
|
|
1048
|
-
value: "- **
|
|
1049
|
-
description: "
|
|
1079
|
+
value: "- **Propietarios**: {owners}",
|
|
1080
|
+
description: "Línea de metadatos",
|
|
1050
1081
|
placeholders: [{ name: "owners", type: "string" }]
|
|
1051
1082
|
},
|
|
1052
1083
|
"export.metaModel": {
|
|
1053
|
-
value: "- **
|
|
1054
|
-
description: "
|
|
1084
|
+
value: "- **Modelo**: {model}",
|
|
1085
|
+
description: "Línea de metadatos",
|
|
1055
1086
|
placeholders: [{ name: "model", type: "string" }]
|
|
1056
1087
|
},
|
|
1057
1088
|
"export.instructions": {
|
|
1058
|
-
value: "##
|
|
1059
|
-
description: "Markdown
|
|
1089
|
+
value: "## Instrucciones",
|
|
1090
|
+
description: "Encabezado Markdown"
|
|
1060
1091
|
},
|
|
1061
1092
|
"export.availableTools": {
|
|
1062
|
-
value: "##
|
|
1063
|
-
description: "Markdown
|
|
1093
|
+
value: "## Herramientas disponibles",
|
|
1094
|
+
description: "Encabezado Markdown"
|
|
1095
|
+
},
|
|
1096
|
+
"export.tools": {
|
|
1097
|
+
value: "## Herramientas",
|
|
1098
|
+
description: "Encabezado Markdown"
|
|
1064
1099
|
},
|
|
1065
|
-
"export.tools": { value: "## Outils", description: "Markdown heading" },
|
|
1066
1100
|
"export.knowledgeSources": {
|
|
1067
|
-
value: "##
|
|
1068
|
-
description: "Markdown
|
|
1101
|
+
value: "## Fuentes de conocimiento",
|
|
1102
|
+
description: "Encabezado Markdown"
|
|
1069
1103
|
},
|
|
1070
1104
|
"export.policy": {
|
|
1071
|
-
value: "##
|
|
1072
|
-
description: "Markdown
|
|
1105
|
+
value: "## Política",
|
|
1106
|
+
description: "Encabezado Markdown"
|
|
1073
1107
|
},
|
|
1074
1108
|
"export.additionalContext": {
|
|
1075
|
-
value: "##
|
|
1076
|
-
description: "Markdown
|
|
1109
|
+
value: "## Contexto adicional",
|
|
1110
|
+
description: "Encabezado Markdown"
|
|
1077
1111
|
},
|
|
1078
1112
|
"export.configuration": {
|
|
1079
|
-
value: "##
|
|
1080
|
-
description: "Markdown
|
|
1113
|
+
value: "## Configuración",
|
|
1114
|
+
description: "Encabezado Markdown"
|
|
1081
1115
|
},
|
|
1082
1116
|
"export.mcpServers": {
|
|
1083
|
-
value: "##
|
|
1084
|
-
description: "Markdown
|
|
1117
|
+
value: "## Servidores MCP",
|
|
1118
|
+
description: "Encabezado Markdown"
|
|
1085
1119
|
},
|
|
1086
1120
|
"export.parameters": {
|
|
1087
|
-
value: "**
|
|
1088
|
-
description: "
|
|
1121
|
+
value: "**Parámetros:**",
|
|
1122
|
+
description: "Etiqueta de parámetros"
|
|
1089
1123
|
},
|
|
1090
1124
|
"export.requiresApproval": {
|
|
1091
|
-
value: "
|
|
1092
|
-
description: "
|
|
1125
|
+
value: "requiere aprobación",
|
|
1126
|
+
description: "Indicador de herramienta"
|
|
1093
1127
|
},
|
|
1094
1128
|
"export.notAutomationSafe": {
|
|
1095
|
-
value: "
|
|
1096
|
-
description: "
|
|
1129
|
+
value: "no es seguro para automatización",
|
|
1130
|
+
description: "Indicador de herramienta"
|
|
1097
1131
|
},
|
|
1098
1132
|
"export.requiresApprovalMd": {
|
|
1099
|
-
value: "*(
|
|
1100
|
-
description: "
|
|
1133
|
+
value: "*(requiere aprobación)*",
|
|
1134
|
+
description: "Indicador de herramienta en Markdown"
|
|
1101
1135
|
},
|
|
1102
1136
|
"export.notAutomationSafeMd": {
|
|
1103
|
-
value: "*(
|
|
1104
|
-
description: "
|
|
1137
|
+
value: "*(no es seguro para automatización)*",
|
|
1138
|
+
description: "Indicador de herramienta en Markdown"
|
|
1105
1139
|
},
|
|
1106
1140
|
"export.required": {
|
|
1107
|
-
value: "(
|
|
1108
|
-
description: "
|
|
1141
|
+
value: "(obligatorio)",
|
|
1142
|
+
description: "Marcador de obligatorio"
|
|
1109
1143
|
},
|
|
1110
1144
|
"export.optional": {
|
|
1111
|
-
value: "(
|
|
1112
|
-
description: "
|
|
1145
|
+
value: "(opcional)",
|
|
1146
|
+
description: "Marcador de opcional"
|
|
1113
1147
|
},
|
|
1114
1148
|
"export.minConfidence": {
|
|
1115
|
-
value: "-
|
|
1116
|
-
description: "
|
|
1149
|
+
value: "- Confianza mínima: {min}",
|
|
1150
|
+
description: "Línea de política",
|
|
1117
1151
|
placeholders: [{ name: "min", type: "number" }]
|
|
1118
1152
|
},
|
|
1119
1153
|
"export.escalationConfigured": {
|
|
1120
|
-
value: "- La
|
|
1121
|
-
description: "
|
|
1154
|
+
value: "- La política de escalamiento está configurada",
|
|
1155
|
+
description: "Línea de política para el prompt del sistema"
|
|
1122
1156
|
},
|
|
1123
1157
|
"export.escalationPolicyConfigured": {
|
|
1124
|
-
value: "-
|
|
1125
|
-
description: "
|
|
1158
|
+
value: "- Política de escalamiento configurada",
|
|
1159
|
+
description: "Línea de política para la exportación en Markdown"
|
|
1126
1160
|
},
|
|
1127
1161
|
"export.featureFlags": {
|
|
1128
|
-
value: "-
|
|
1129
|
-
description: "
|
|
1162
|
+
value: "- Indicadores de características: {flags}",
|
|
1163
|
+
description: "Línea de política de indicadores de características",
|
|
1130
1164
|
placeholders: [{ name: "flags", type: "string" }]
|
|
1131
1165
|
},
|
|
1132
1166
|
"export.generatedFrom": {
|
|
1133
|
-
value: "*
|
|
1134
|
-
description: "
|
|
1167
|
+
value: "*Generado desde ContractSpec: {key}*",
|
|
1168
|
+
description: "Línea de atribución en el pie",
|
|
1135
1169
|
placeholders: [{ name: "key", type: "string" }]
|
|
1136
1170
|
},
|
|
1137
1171
|
"export.exportedAt": {
|
|
1138
|
-
value: "*
|
|
1139
|
-
description: "
|
|
1172
|
+
value: "*Exportado el: {date}*",
|
|
1173
|
+
description: "Marca de tiempo en el pie",
|
|
1140
1174
|
placeholders: [{ name: "date", type: "string" }]
|
|
1141
1175
|
},
|
|
1142
1176
|
"export.agentType": {
|
|
1143
|
-
value: ">
|
|
1144
|
-
description: "
|
|
1177
|
+
value: "> Tipo de agente: **{type}**",
|
|
1178
|
+
description: "Llamada de tipo de agente",
|
|
1145
1179
|
placeholders: [{ name: "type", type: "string" }]
|
|
1146
1180
|
},
|
|
1147
1181
|
"export.noDescription": {
|
|
1148
|
-
value: "
|
|
1149
|
-
description: "
|
|
1182
|
+
value: "Sin descripción",
|
|
1183
|
+
description: "Texto de respaldo cuando la herramienta no tiene descripción"
|
|
1150
1184
|
},
|
|
1151
1185
|
"export.validation.requiresKey": {
|
|
1152
|
-
value: "La
|
|
1153
|
-
description: "
|
|
1186
|
+
value: "La especificación debe tener una meta.key",
|
|
1187
|
+
description: "Error de validación"
|
|
1154
1188
|
},
|
|
1155
1189
|
"export.validation.requiresInstructions": {
|
|
1156
|
-
value: "La
|
|
1157
|
-
description: "
|
|
1190
|
+
value: "La especificación debe tener instrucciones",
|
|
1191
|
+
description: "Error de validación"
|
|
1158
1192
|
},
|
|
1159
1193
|
"export.validation.requiresTool": {
|
|
1160
|
-
value: "La
|
|
1161
|
-
description: "
|
|
1194
|
+
value: "La especificación debe tener al menos una herramienta",
|
|
1195
|
+
description: "Error de validación"
|
|
1162
1196
|
},
|
|
1163
1197
|
"export.validation.toolRequiresName": {
|
|
1164
|
-
value: "
|
|
1165
|
-
description: "
|
|
1198
|
+
value: "Todas las herramientas deben tener un nombre",
|
|
1199
|
+
description: "Error de validación"
|
|
1166
1200
|
},
|
|
1167
1201
|
"export.validation.toolRequiresDescOrName": {
|
|
1168
|
-
value: "
|
|
1169
|
-
description: "
|
|
1202
|
+
value: "La herramienta debe tener una descripción o un nombre",
|
|
1203
|
+
description: "Error de validación"
|
|
1170
1204
|
},
|
|
1171
1205
|
"export.validation.toolInvalidName": {
|
|
1172
|
-
value: "
|
|
1173
|
-
description: "
|
|
1206
|
+
value: "El nombre de herramienta '{name}' debe ser un identificador válido (letras, números, guiones bajos)",
|
|
1207
|
+
description: "Error de validación para nombre de herramienta inválido",
|
|
1174
1208
|
placeholders: [{ name: "name", type: "string" }]
|
|
1175
1209
|
},
|
|
1176
1210
|
"export.agentType.build": {
|
|
1177
|
-
value: "
|
|
1178
|
-
description: "
|
|
1211
|
+
value: "Agente principal con acceso completo a herramientas para la generación y modificación de código.",
|
|
1212
|
+
description: "Descripción del tipo de agente de construcción"
|
|
1179
1213
|
},
|
|
1180
1214
|
"export.agentType.plan": {
|
|
1181
|
-
value: "
|
|
1182
|
-
description: "
|
|
1215
|
+
value: "Agente restringido para análisis y planificación. Las ediciones de archivos y los comandos bash requieren aprobación.",
|
|
1216
|
+
description: "Descripción del tipo de agente de planificación"
|
|
1183
1217
|
},
|
|
1184
1218
|
"export.agentType.general": {
|
|
1185
|
-
value: "
|
|
1186
|
-
description: "
|
|
1219
|
+
value: "Subagente de propósito general para preguntas complejas y tareas de múltiples pasos.",
|
|
1220
|
+
description: "Descripción del tipo de agente general"
|
|
1187
1221
|
},
|
|
1188
1222
|
"export.agentType.explore": {
|
|
1189
|
-
value: "
|
|
1190
|
-
description: "
|
|
1223
|
+
value: "Subagente rápido optimizado para exploración de código y búsqueda de patrones.",
|
|
1224
|
+
description: "Descripción del tipo de agente de exploración"
|
|
1191
1225
|
},
|
|
1192
1226
|
"export.bridge.requiresApproval": {
|
|
1193
|
-
value: "(
|
|
1194
|
-
description: "
|
|
1227
|
+
value: "(requiere aprobación)",
|
|
1228
|
+
description: "Etiqueta de permiso de herramienta"
|
|
1195
1229
|
},
|
|
1196
1230
|
"export.bridge.askMode": {
|
|
1197
|
-
value: "(
|
|
1198
|
-
description: "
|
|
1231
|
+
value: "(modo consulta)",
|
|
1232
|
+
description: "Etiqueta de permiso de herramienta"
|
|
1199
1233
|
},
|
|
1200
1234
|
"approval.toolRequiresApproval": {
|
|
1201
|
-
value:
|
|
1202
|
-
description: "
|
|
1235
|
+
value: 'La herramienta "{name}" requiere aprobación',
|
|
1236
|
+
description: "Razón predeterminada para solicitudes de aprobación de herramientas",
|
|
1203
1237
|
placeholders: [{ name: "name", type: "string" }]
|
|
1204
1238
|
},
|
|
1205
1239
|
"log.unifiedAgent.fallback": {
|
|
1206
|
-
value: "[UnifiedAgent] {backend}
|
|
1207
|
-
description: "
|
|
1240
|
+
value: "[UnifiedAgent] {backend} falló, recurriendo a {fallback}",
|
|
1241
|
+
description: "Advertencia cuando un backend falla y se utiliza el respaldo",
|
|
1208
1242
|
placeholders: [
|
|
1209
1243
|
{ name: "backend", type: "string" },
|
|
1210
1244
|
{ name: "fallback", type: "string" }
|
|
1211
1245
|
]
|
|
1212
1246
|
},
|
|
1213
1247
|
"log.knowledge.spaceNotAvailable": {
|
|
1214
|
-
value:
|
|
1215
|
-
description: "
|
|
1248
|
+
value: 'El espacio de conocimiento requerido "{key}" no está disponible',
|
|
1249
|
+
description: "Advertencia cuando un espacio de conocimiento requerido no existe",
|
|
1216
1250
|
placeholders: [{ name: "key", type: "string" }]
|
|
1217
1251
|
},
|
|
1218
1252
|
"log.knowledge.loadFailed": {
|
|
1219
|
-
value:
|
|
1220
|
-
description: "
|
|
1253
|
+
value: 'Error al cargar el conocimiento requerido "{key}":',
|
|
1254
|
+
description: "Advertencia cuando falla la carga de conocimiento",
|
|
1221
1255
|
placeholders: [{ name: "key", type: "string" }]
|
|
1222
1256
|
},
|
|
1223
1257
|
"log.knowledge.queryFailed": {
|
|
1224
|
-
value: "
|
|
1225
|
-
description: "
|
|
1258
|
+
value: "Error al consultar el espacio de conocimiento {space}:",
|
|
1259
|
+
description: "Advertencia cuando falla la consulta de conocimiento",
|
|
1226
1260
|
placeholders: [{ name: "space", type: "string" }]
|
|
1227
1261
|
},
|
|
1228
1262
|
"log.mcpServer.started": {
|
|
1229
|
-
value: "[MCPToolServer] {name}@{version}
|
|
1230
|
-
description: "
|
|
1263
|
+
value: "[MCPToolServer] Iniciado {name}@{version} con {count} herramientas",
|
|
1264
|
+
description: "Mensaje de registro cuando el servidor de herramientas MCP se inicia",
|
|
1231
1265
|
placeholders: [
|
|
1232
1266
|
{ name: "name", type: "string" },
|
|
1233
1267
|
{ name: "version", type: "string" },
|
|
@@ -1235,24 +1269,24 @@ var init_fr = __esm(() => {
|
|
|
1235
1269
|
]
|
|
1236
1270
|
},
|
|
1237
1271
|
"log.mcpServer.stopped": {
|
|
1238
|
-
value: "[MCPToolServer] {name}
|
|
1239
|
-
description: "
|
|
1272
|
+
value: "[MCPToolServer] Detenido {name}",
|
|
1273
|
+
description: "Mensaje de registro cuando el servidor de herramientas MCP se detiene",
|
|
1240
1274
|
placeholders: [{ name: "name", type: "string" }]
|
|
1241
1275
|
},
|
|
1242
1276
|
"error.telemetry.posthogAiRequired": {
|
|
1243
|
-
value: "PostHog LLM Analytics
|
|
1277
|
+
value: "PostHog LLM Analytics requiere que @posthog/ai esté instalado. Ejecute: npm install @posthog/ai posthog-node",
|
|
1244
1278
|
description: "Error when PostHog AI dependency is missing"
|
|
1245
1279
|
},
|
|
1246
1280
|
"error.telemetry.posthogClientOrKeyRequired": {
|
|
1247
|
-
value: "PostHog LLM Analytics
|
|
1281
|
+
value: "PostHog LLM Analytics requiere una instancia de cliente o una apiKey.",
|
|
1248
1282
|
description: "Error when PostHog client or API key is not configured"
|
|
1249
1283
|
},
|
|
1250
1284
|
"error.telemetry.posthogNodeRequired": {
|
|
1251
|
-
value: "PostHog LLM Analytics
|
|
1285
|
+
value: "PostHog LLM Analytics requiere que posthog-node esté instalado. Ejecute: npm install posthog-node",
|
|
1252
1286
|
description: "Error when posthog-node dependency is missing"
|
|
1253
1287
|
},
|
|
1254
1288
|
"error.provider.notAvailable": {
|
|
1255
|
-
value: "
|
|
1289
|
+
value: "El proveedor '{provider}' no está disponible{reason}",
|
|
1256
1290
|
description: "Error when a provider is unavailable",
|
|
1257
1291
|
placeholders: [
|
|
1258
1292
|
{ name: "provider", type: "string" },
|
|
@@ -1263,636 +1297,602 @@ var init_fr = __esm(() => {
|
|
|
1263
1297
|
});
|
|
1264
1298
|
});
|
|
1265
1299
|
|
|
1266
|
-
// src/i18n/catalogs/
|
|
1300
|
+
// src/i18n/catalogs/fr.ts
|
|
1267
1301
|
import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts-spec/translations";
|
|
1268
|
-
var
|
|
1269
|
-
var
|
|
1270
|
-
|
|
1302
|
+
var frMessages;
|
|
1303
|
+
var init_fr = __esm(() => {
|
|
1304
|
+
frMessages = defineTranslation3({
|
|
1271
1305
|
meta: {
|
|
1272
1306
|
key: "ai-agent.messages",
|
|
1273
1307
|
version: "1.0.0",
|
|
1274
1308
|
domain: "ai-agent",
|
|
1275
|
-
description: "
|
|
1309
|
+
description: "Toutes les chaînes destinées aux utilisateurs, aux LLM et aux développeurs pour le package ai-agent",
|
|
1276
1310
|
owners: ["platform"],
|
|
1277
1311
|
stability: "experimental"
|
|
1278
1312
|
},
|
|
1279
|
-
locale: "
|
|
1313
|
+
locale: "fr",
|
|
1280
1314
|
fallback: "en",
|
|
1281
1315
|
messages: {
|
|
1282
1316
|
"agent.json.rules.validJsonOnly": {
|
|
1283
|
-
value: "
|
|
1284
|
-
description: "
|
|
1317
|
+
value: "Vous DEVEZ produire uniquement du JSON valide.",
|
|
1318
|
+
description: "JSON runner rule: output must be valid JSON"
|
|
1285
1319
|
},
|
|
1286
1320
|
"agent.json.rules.noMarkdownFences": {
|
|
1287
|
-
value: "
|
|
1288
|
-
description: "
|
|
1321
|
+
value: "N'encapsulez pas la sortie dans des blocs de code markdown.",
|
|
1322
|
+
description: "JSON runner rule: no markdown code fences"
|
|
1289
1323
|
},
|
|
1290
1324
|
"agent.json.rules.noCommentary": {
|
|
1291
|
-
value: "
|
|
1292
|
-
description: "
|
|
1325
|
+
value: "N'incluez ni commentaire ni explication.",
|
|
1326
|
+
description: "JSON runner rule: no extra text"
|
|
1293
1327
|
},
|
|
1294
1328
|
"agent.json.rules.doubleQuotes": {
|
|
1295
|
-
value: "
|
|
1296
|
-
description: "
|
|
1329
|
+
value: "Utilisez des guillemets doubles pour toutes les clés et valeurs de type chaîne.",
|
|
1330
|
+
description: "JSON runner rule: double quotes only"
|
|
1297
1331
|
},
|
|
1298
1332
|
"agent.json.rules.noTrailingCommas": {
|
|
1299
|
-
value: "
|
|
1300
|
-
description: "
|
|
1333
|
+
value: "N'incluez pas de virgules finales.",
|
|
1334
|
+
description: "JSON runner rule: no trailing commas"
|
|
1301
1335
|
},
|
|
1302
1336
|
"agent.json.defaultDescription": {
|
|
1303
|
-
value: "
|
|
1304
|
-
description: "
|
|
1337
|
+
value: "Exécuteur d'agent JSON uniquement pour les pipelines déterministes.",
|
|
1338
|
+
description: "Default description for the JSON runner spec"
|
|
1305
1339
|
},
|
|
1306
1340
|
"agent.json.systemPrompt": {
|
|
1307
|
-
value: "
|
|
1308
|
-
description: "
|
|
1341
|
+
value: "Vous êtes un générateur JSON précis.",
|
|
1342
|
+
description: "Default system prompt for the JSON runner"
|
|
1309
1343
|
},
|
|
1310
1344
|
"knowledge.header": {
|
|
1311
|
-
value: "#
|
|
1312
|
-
description: "
|
|
1345
|
+
value: "# Connaissances de référence",
|
|
1346
|
+
description: "Header for injected knowledge section in system prompt"
|
|
1313
1347
|
},
|
|
1314
1348
|
"knowledge.description": {
|
|
1315
|
-
value: "
|
|
1316
|
-
description: "
|
|
1349
|
+
value: "Les informations suivantes sont fournies à titre de référence. Utilisez-les pour éclairer vos réponses.",
|
|
1350
|
+
description: "Description below the knowledge header"
|
|
1317
1351
|
},
|
|
1318
1352
|
"tool.knowledge.description": {
|
|
1319
|
-
value: "
|
|
1320
|
-
description: "
|
|
1353
|
+
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.",
|
|
1354
|
+
description: "Description for the knowledge query tool shown to the LLM"
|
|
1321
1355
|
},
|
|
1322
1356
|
"tool.knowledge.availableSpaces": {
|
|
1323
|
-
value: "
|
|
1324
|
-
description: "
|
|
1357
|
+
value: "Espaces de connaissances disponibles :",
|
|
1358
|
+
description: "Label before listing available knowledge spaces"
|
|
1325
1359
|
},
|
|
1326
1360
|
"tool.knowledge.spaceDefault": {
|
|
1327
|
-
value: "
|
|
1328
|
-
description: "
|
|
1361
|
+
value: "Espace de connaissances",
|
|
1362
|
+
description: "Fallback description for unnamed knowledge spaces"
|
|
1329
1363
|
},
|
|
1330
1364
|
"tool.knowledge.param.query": {
|
|
1331
|
-
value: "La
|
|
1332
|
-
description: "
|
|
1365
|
+
value: "La question ou la requête de recherche pour trouver des informations pertinentes",
|
|
1366
|
+
description: "Parameter description for the query field"
|
|
1333
1367
|
},
|
|
1334
1368
|
"tool.knowledge.param.spaceKey": {
|
|
1335
|
-
value: "
|
|
1336
|
-
description: "
|
|
1369
|
+
value: "Espace de connaissances spécifique à interroger. Si omis, recherche dans tous les espaces disponibles.",
|
|
1370
|
+
description: "Parameter description for the spaceKey field"
|
|
1337
1371
|
},
|
|
1338
1372
|
"tool.knowledge.param.topK": {
|
|
1339
|
-
value: "
|
|
1340
|
-
description: "
|
|
1373
|
+
value: "Nombre maximum de résultats à retourner",
|
|
1374
|
+
description: "Parameter description for the topK field"
|
|
1341
1375
|
},
|
|
1342
1376
|
"tool.knowledge.noResults": {
|
|
1343
|
-
value: "
|
|
1344
|
-
description: "
|
|
1377
|
+
value: "Aucune information pertinente trouvée dans les bases de connaissances.",
|
|
1378
|
+
description: "Message when no knowledge results are found"
|
|
1345
1379
|
},
|
|
1346
1380
|
"tool.knowledge.sourceLabel": {
|
|
1347
|
-
value: "[
|
|
1348
|
-
description: "
|
|
1381
|
+
value: "[Source {index} - {space}] (pertinence : {score} %)",
|
|
1382
|
+
description: "Label for each knowledge search result",
|
|
1349
1383
|
placeholders: [
|
|
1350
|
-
{
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
description: "Índice de fuente basado en 1"
|
|
1354
|
-
},
|
|
1355
|
-
{
|
|
1356
|
-
name: "space",
|
|
1357
|
-
type: "string",
|
|
1358
|
-
description: "Nombre del espacio de conocimiento"
|
|
1359
|
-
},
|
|
1360
|
-
{
|
|
1361
|
-
name: "score",
|
|
1362
|
-
type: "number",
|
|
1363
|
-
description: "Porcentaje de relevancia"
|
|
1364
|
-
}
|
|
1384
|
+
{ name: "index", type: "number", description: "1-based source index" },
|
|
1385
|
+
{ name: "space", type: "string", description: "Knowledge space name" },
|
|
1386
|
+
{ name: "score", type: "number", description: "Relevance percentage" }
|
|
1365
1387
|
]
|
|
1366
1388
|
},
|
|
1367
1389
|
"tool.fallbackDescription": {
|
|
1368
|
-
value: "
|
|
1369
|
-
description: "
|
|
1390
|
+
value: "Exécuter {name}",
|
|
1391
|
+
description: "Fallback description when a tool has no explicit description",
|
|
1370
1392
|
placeholders: [
|
|
1371
|
-
{
|
|
1372
|
-
name: "name",
|
|
1373
|
-
type: "string",
|
|
1374
|
-
description: "Nombre de la herramienta"
|
|
1375
|
-
}
|
|
1393
|
+
{ name: "name", type: "string", description: "Tool name" }
|
|
1376
1394
|
]
|
|
1377
1395
|
},
|
|
1378
1396
|
"tool.mcp.param.message": {
|
|
1379
|
-
value: "
|
|
1380
|
-
description: "
|
|
1397
|
+
value: "Le message ou la requête à envoyer à l'agent",
|
|
1398
|
+
description: "MCP server: message parameter description"
|
|
1381
1399
|
},
|
|
1382
1400
|
"tool.mcp.param.sessionId": {
|
|
1383
|
-
value: "
|
|
1384
|
-
description: "
|
|
1401
|
+
value: "Identifiant de session optionnel pour poursuivre une conversation",
|
|
1402
|
+
description: "MCP server: sessionId parameter description"
|
|
1385
1403
|
},
|
|
1386
1404
|
"tool.mcp.agentDescription": {
|
|
1387
|
-
value: "
|
|
1388
|
-
description: "
|
|
1405
|
+
value: "Interagir avec l'agent {key}",
|
|
1406
|
+
description: "MCP server: agent tool description",
|
|
1389
1407
|
placeholders: [
|
|
1390
|
-
{
|
|
1391
|
-
name: "key",
|
|
1392
|
-
type: "string",
|
|
1393
|
-
description: "Clave de la especificación del agente"
|
|
1394
|
-
}
|
|
1408
|
+
{ name: "key", type: "string", description: "Agent spec key" }
|
|
1395
1409
|
]
|
|
1396
1410
|
},
|
|
1397
1411
|
"tool.mcp.executePrompt": {
|
|
1398
|
-
value: "
|
|
1399
|
-
description: "
|
|
1412
|
+
value: "Exécutez l'outil {name} avec les arguments suivants : {args}",
|
|
1413
|
+
description: "MCP server: prompt sent when executing an individual tool",
|
|
1400
1414
|
placeholders: [
|
|
1401
|
-
{
|
|
1402
|
-
name: "name",
|
|
1403
|
-
type: "string",
|
|
1404
|
-
description: "Nombre de la herramienta"
|
|
1405
|
-
},
|
|
1415
|
+
{ name: "name", type: "string", description: "Tool name" },
|
|
1406
1416
|
{
|
|
1407
1417
|
name: "args",
|
|
1408
1418
|
type: "string",
|
|
1409
|
-
description: "
|
|
1419
|
+
description: "JSON-stringified arguments"
|
|
1410
1420
|
}
|
|
1411
1421
|
]
|
|
1412
1422
|
},
|
|
1413
1423
|
"tool.mcp.toolDescription": {
|
|
1414
|
-
value: "
|
|
1415
|
-
description: "
|
|
1424
|
+
value: "Exécuter l'outil {name}",
|
|
1425
|
+
description: "MCP server: individual tool description",
|
|
1416
1426
|
placeholders: [
|
|
1417
|
-
{
|
|
1418
|
-
name: "name",
|
|
1419
|
-
type: "string",
|
|
1420
|
-
description: "Nombre de la herramienta"
|
|
1421
|
-
}
|
|
1427
|
+
{ name: "name", type: "string", description: "Tool name" }
|
|
1422
1428
|
]
|
|
1423
1429
|
},
|
|
1424
1430
|
"interop.prompt.agentIdentity": {
|
|
1425
|
-
value: "#
|
|
1426
|
-
description: "
|
|
1431
|
+
value: "# Identité de l'agent",
|
|
1432
|
+
description: "Section header for agent identity in LLM prompt"
|
|
1427
1433
|
},
|
|
1428
1434
|
"interop.prompt.youAre": {
|
|
1429
|
-
value: "
|
|
1430
|
-
description: "
|
|
1435
|
+
value: "Vous êtes {key} (v{version}).",
|
|
1436
|
+
description: "Agent identity statement in LLM prompt",
|
|
1431
1437
|
placeholders: [
|
|
1432
1438
|
{ name: "key", type: "string" },
|
|
1433
1439
|
{ name: "version", type: "string" }
|
|
1434
1440
|
]
|
|
1435
1441
|
},
|
|
1436
1442
|
"interop.prompt.description": {
|
|
1437
|
-
value: "##
|
|
1438
|
-
description: "
|
|
1443
|
+
value: "## Description",
|
|
1444
|
+
description: "Section header for description"
|
|
1439
1445
|
},
|
|
1440
1446
|
"interop.prompt.instructions": {
|
|
1441
|
-
value: "##
|
|
1442
|
-
description: "
|
|
1447
|
+
value: "## Instructions",
|
|
1448
|
+
description: "Section header for instructions"
|
|
1443
1449
|
},
|
|
1444
1450
|
"interop.prompt.availableTools": {
|
|
1445
|
-
value: "##
|
|
1446
|
-
description: "
|
|
1451
|
+
value: "## Outils disponibles",
|
|
1452
|
+
description: "Section header for available tools"
|
|
1447
1453
|
},
|
|
1448
1454
|
"interop.prompt.toolsIntro": {
|
|
1449
|
-
value: "
|
|
1450
|
-
description: "
|
|
1455
|
+
value: "Vous avez accès aux outils suivants :",
|
|
1456
|
+
description: "Introduction before listing tools"
|
|
1451
1457
|
},
|
|
1452
1458
|
"interop.prompt.parameters": {
|
|
1453
|
-
value: "
|
|
1454
|
-
description: "
|
|
1459
|
+
value: "Paramètres :",
|
|
1460
|
+
description: "Label before tool parameters block"
|
|
1455
1461
|
},
|
|
1456
1462
|
"interop.prompt.knowledgeContext": {
|
|
1457
|
-
value: "##
|
|
1458
|
-
description: "
|
|
1463
|
+
value: "## Contexte de connaissances",
|
|
1464
|
+
description: "Section header for knowledge context"
|
|
1459
1465
|
},
|
|
1460
1466
|
"interop.prompt.additionalContext": {
|
|
1461
|
-
value: "##
|
|
1462
|
-
description: "
|
|
1467
|
+
value: "## Contexte supplémentaire",
|
|
1468
|
+
description: "Section header for additional context"
|
|
1463
1469
|
},
|
|
1464
1470
|
"interop.md.toc": {
|
|
1465
|
-
value: "##
|
|
1466
|
-
description: "
|
|
1471
|
+
value: "## Table des matières",
|
|
1472
|
+
description: "TOC header"
|
|
1467
1473
|
},
|
|
1468
1474
|
"interop.md.overview": {
|
|
1469
|
-
value: "##
|
|
1470
|
-
description: "
|
|
1471
|
-
},
|
|
1472
|
-
"interop.md.tools": {
|
|
1473
|
-
value: "## Herramientas",
|
|
1474
|
-
description: "Encabezado de herramientas"
|
|
1475
|
+
value: "## Aperçu",
|
|
1476
|
+
description: "Overview header"
|
|
1475
1477
|
},
|
|
1478
|
+
"interop.md.tools": { value: "## Outils", description: "Tools header" },
|
|
1476
1479
|
"interop.md.knowledge": {
|
|
1477
|
-
value: "##
|
|
1478
|
-
description: "
|
|
1480
|
+
value: "## Connaissances",
|
|
1481
|
+
description: "Knowledge header"
|
|
1479
1482
|
},
|
|
1480
1483
|
"interop.md.policy": {
|
|
1481
|
-
value: "##
|
|
1482
|
-
description: "
|
|
1484
|
+
value: "## Politique",
|
|
1485
|
+
description: "Policy header"
|
|
1483
1486
|
},
|
|
1484
1487
|
"interop.md.metaKey": {
|
|
1485
|
-
value: "- **
|
|
1486
|
-
description: "
|
|
1488
|
+
value: "- **Clé** : `{key}`",
|
|
1489
|
+
description: "Metadata line for key",
|
|
1487
1490
|
placeholders: [{ name: "key", type: "string" }]
|
|
1488
1491
|
},
|
|
1489
1492
|
"interop.md.metaVersion": {
|
|
1490
|
-
value: "- **
|
|
1491
|
-
description: "
|
|
1493
|
+
value: "- **Version** : {version}",
|
|
1494
|
+
description: "Metadata line for version",
|
|
1492
1495
|
placeholders: [{ name: "version", type: "string" }]
|
|
1493
1496
|
},
|
|
1494
1497
|
"interop.md.metaStability": {
|
|
1495
|
-
value: "- **
|
|
1496
|
-
description: "
|
|
1498
|
+
value: "- **Stabilité** : {stability}",
|
|
1499
|
+
description: "Metadata line for stability",
|
|
1497
1500
|
placeholders: [{ name: "stability", type: "string" }]
|
|
1498
1501
|
},
|
|
1499
1502
|
"interop.md.metaOwners": {
|
|
1500
|
-
value: "- **
|
|
1501
|
-
description: "
|
|
1503
|
+
value: "- **Propriétaires** : {owners}",
|
|
1504
|
+
description: "Metadata line for owners",
|
|
1502
1505
|
placeholders: [{ name: "owners", type: "string" }]
|
|
1503
1506
|
},
|
|
1504
1507
|
"interop.md.metaTags": {
|
|
1505
|
-
value: "- **
|
|
1506
|
-
description: "
|
|
1508
|
+
value: "- **Tags** : {tags}",
|
|
1509
|
+
description: "Metadata line for tags",
|
|
1507
1510
|
placeholders: [{ name: "tags", type: "string" }]
|
|
1508
1511
|
},
|
|
1509
1512
|
"interop.md.schema": {
|
|
1510
|
-
value: "**
|
|
1511
|
-
description: "
|
|
1513
|
+
value: "**Schéma :**",
|
|
1514
|
+
description: "Schema label"
|
|
1512
1515
|
},
|
|
1513
1516
|
"interop.md.automationSafe": {
|
|
1514
|
-
value: "**
|
|
1515
|
-
description: "
|
|
1517
|
+
value: "**Compatible avec l'automatisation** : {value}",
|
|
1518
|
+
description: "Automation safe field",
|
|
1516
1519
|
placeholders: [{ name: "value", type: "string" }]
|
|
1517
1520
|
},
|
|
1518
1521
|
"interop.md.required": {
|
|
1519
|
-
value: "(
|
|
1520
|
-
description: "
|
|
1522
|
+
value: "(obligatoire)",
|
|
1523
|
+
description: "Required marker"
|
|
1521
1524
|
},
|
|
1522
1525
|
"interop.md.optional": {
|
|
1523
|
-
value: "(
|
|
1524
|
-
description: "
|
|
1526
|
+
value: "(optionnel)",
|
|
1527
|
+
description: "Optional marker"
|
|
1525
1528
|
},
|
|
1526
1529
|
"interop.md.minConfidence": {
|
|
1527
|
-
value: "- **
|
|
1528
|
-
description: "
|
|
1530
|
+
value: "- **Confiance minimale** : {min}",
|
|
1531
|
+
description: "Minimum confidence policy line",
|
|
1529
1532
|
placeholders: [{ name: "min", type: "number" }]
|
|
1530
1533
|
},
|
|
1531
1534
|
"interop.md.escalationThreshold": {
|
|
1532
|
-
value: "- **
|
|
1533
|
-
description: "
|
|
1535
|
+
value: "- **Seuil d'escalade** : {threshold}",
|
|
1536
|
+
description: "Escalation threshold policy line",
|
|
1534
1537
|
placeholders: [{ name: "threshold", type: "number" }]
|
|
1535
1538
|
},
|
|
1536
1539
|
"interop.md.escalateToolFailure": {
|
|
1537
|
-
value: "- **
|
|
1538
|
-
description: "
|
|
1540
|
+
value: "- **Escalader en cas d'échec d'outil** : Oui",
|
|
1541
|
+
description: "Escalate on tool failure policy line"
|
|
1539
1542
|
},
|
|
1540
1543
|
"interop.md.escalateTimeout": {
|
|
1541
|
-
value: "- **
|
|
1542
|
-
description: "
|
|
1544
|
+
value: "- **Escalader en cas de délai d'attente dépassé** : Oui",
|
|
1545
|
+
description: "Escalate on timeout policy line"
|
|
1543
1546
|
},
|
|
1544
|
-
"interop.md.yes": { value: "
|
|
1545
|
-
"interop.md.no": { value: "
|
|
1547
|
+
"interop.md.yes": { value: "Oui", description: "Yes label" },
|
|
1548
|
+
"interop.md.no": { value: "Non", description: "No label" },
|
|
1546
1549
|
"error.jsonRunner.requiresModel": {
|
|
1547
|
-
value: "createAgentJsonRunner
|
|
1548
|
-
description: "Error
|
|
1550
|
+
value: "createAgentJsonRunner nécessite un modèle ou une configuration de fournisseur",
|
|
1551
|
+
description: "Error when JSON runner has no model or provider"
|
|
1549
1552
|
},
|
|
1550
1553
|
"error.missingToolHandler": {
|
|
1551
|
-
value: "
|
|
1552
|
-
description: "Error
|
|
1554
|
+
value: "Gestionnaire manquant pour l'outil : {name}",
|
|
1555
|
+
description: "Error when a tool handler is not registered",
|
|
1553
1556
|
placeholders: [{ name: "name", type: "string" }]
|
|
1554
1557
|
},
|
|
1555
1558
|
"error.unknownBackend": {
|
|
1556
|
-
value: "Backend
|
|
1557
|
-
description: "Error
|
|
1559
|
+
value: "Backend inconnu : {backend}",
|
|
1560
|
+
description: "Error when an unknown backend is specified",
|
|
1558
1561
|
placeholders: [{ name: "backend", type: "string" }]
|
|
1559
1562
|
},
|
|
1560
1563
|
"error.claudeSdk.notAvailable": {
|
|
1561
|
-
value: "Claude Agent SDK
|
|
1562
|
-
description: "Error
|
|
1564
|
+
value: "Claude Agent SDK non disponible. Installez @anthropic-ai/claude-agent-sdk",
|
|
1565
|
+
description: "Error when Claude Agent SDK is not available"
|
|
1563
1566
|
},
|
|
1564
1567
|
"error.claudeSdk.notInstalled": {
|
|
1565
|
-
value: "Claude Agent SDK
|
|
1566
|
-
description: "Error
|
|
1568
|
+
value: "Claude Agent SDK non installé. Exécutez : npm install @anthropic-ai/claude-agent-sdk",
|
|
1569
|
+
description: "Error when Claude Agent SDK module is not found"
|
|
1567
1570
|
},
|
|
1568
1571
|
"error.opencodeSdk.notAvailable": {
|
|
1569
|
-
value: "OpenCode SDK
|
|
1570
|
-
description: "Error
|
|
1572
|
+
value: "OpenCode SDK non disponible. Installez @opencode-ai/sdk",
|
|
1573
|
+
description: "Error when OpenCode SDK is not available"
|
|
1571
1574
|
},
|
|
1572
1575
|
"error.opencodeSdk.notInstalled": {
|
|
1573
|
-
value: "OpenCode SDK
|
|
1574
|
-
description: "Error
|
|
1576
|
+
value: "OpenCode SDK non installé. Exécutez : npm install @opencode-ai/sdk",
|
|
1577
|
+
description: "Error when OpenCode SDK module is not found"
|
|
1575
1578
|
},
|
|
1576
1579
|
"error.providerNotInitialized": {
|
|
1577
|
-
value: "
|
|
1578
|
-
description: "Error
|
|
1580
|
+
value: "Fournisseur non initialisé",
|
|
1581
|
+
description: "Error when provider has not been initialized before use"
|
|
1579
1582
|
},
|
|
1580
1583
|
"error.agentKeyRequired": {
|
|
1581
|
-
value: "La
|
|
1582
|
-
description: "
|
|
1584
|
+
value: "La clé de l'agent est obligatoire",
|
|
1585
|
+
description: "Validation error: missing agent key"
|
|
1583
1586
|
},
|
|
1584
1587
|
"error.agentMissingVersion": {
|
|
1585
|
-
value: "
|
|
1586
|
-
description: "
|
|
1588
|
+
value: "L'agent {key} n'a pas de version sous forme de chaîne de caractères",
|
|
1589
|
+
description: "Validation error: version not a string",
|
|
1587
1590
|
placeholders: [{ name: "key", type: "string" }]
|
|
1588
1591
|
},
|
|
1589
1592
|
"error.agentRequiresInstructions": {
|
|
1590
|
-
value: "
|
|
1591
|
-
description: "
|
|
1593
|
+
value: "L'agent {key} nécessite des instructions",
|
|
1594
|
+
description: "Validation error: missing instructions",
|
|
1592
1595
|
placeholders: [{ name: "key", type: "string" }]
|
|
1593
1596
|
},
|
|
1594
1597
|
"error.agentRequiresTool": {
|
|
1595
|
-
value: "
|
|
1596
|
-
description: "
|
|
1598
|
+
value: "L'agent {key} doit exposer au moins un outil",
|
|
1599
|
+
description: "Validation error: no tools defined",
|
|
1597
1600
|
placeholders: [{ name: "key", type: "string" }]
|
|
1598
1601
|
},
|
|
1599
1602
|
"error.agentDuplicateTool": {
|
|
1600
|
-
value: "
|
|
1601
|
-
description: "
|
|
1603
|
+
value: "L'agent {key} a un nom d'outil en double : {name}",
|
|
1604
|
+
description: "Validation error: duplicate tool name",
|
|
1602
1605
|
placeholders: [
|
|
1603
1606
|
{ name: "key", type: "string" },
|
|
1604
1607
|
{ name: "name", type: "string" }
|
|
1605
1608
|
]
|
|
1606
1609
|
},
|
|
1607
1610
|
"error.agentSpecNotFound": {
|
|
1608
|
-
value: "
|
|
1609
|
-
description: "Error
|
|
1611
|
+
value: "Spécification d'agent introuvable pour {name}",
|
|
1612
|
+
description: "Error when agent spec is not in the registry",
|
|
1610
1613
|
placeholders: [{ name: "name", type: "string" }]
|
|
1611
1614
|
},
|
|
1612
1615
|
"error.specNotFound": {
|
|
1613
|
-
value: "
|
|
1614
|
-
description: "Error
|
|
1616
|
+
value: "Spécification introuvable : {specKey}",
|
|
1617
|
+
description: "Error when a spec key is not found",
|
|
1615
1618
|
placeholders: [{ name: "specKey", type: "string" }]
|
|
1616
1619
|
},
|
|
1617
1620
|
"error.toolNotFound": {
|
|
1618
|
-
value: "
|
|
1619
|
-
description: "Error
|
|
1621
|
+
value: "Outil introuvable : {name}",
|
|
1622
|
+
description: "Error when a tool is not found",
|
|
1620
1623
|
placeholders: [{ name: "name", type: "string" }]
|
|
1621
1624
|
},
|
|
1622
1625
|
"error.noHandlerForTool": {
|
|
1623
|
-
value: "
|
|
1624
|
-
description: "Error
|
|
1626
|
+
value: "Aucun gestionnaire enregistré pour l'outil : {name}",
|
|
1627
|
+
description: "Error when no handler is registered for a tool",
|
|
1625
1628
|
placeholders: [{ name: "name", type: "string" }]
|
|
1626
1629
|
},
|
|
1627
1630
|
"error.noToolHandler": {
|
|
1628
|
-
value: "
|
|
1629
|
-
description: "
|
|
1631
|
+
value: "Aucun gestionnaire pour l'outil : {name}",
|
|
1632
|
+
description: "Short error when no handler exists",
|
|
1630
1633
|
placeholders: [{ name: "name", type: "string" }]
|
|
1631
1634
|
},
|
|
1632
1635
|
"error.unknownExportFormat": {
|
|
1633
|
-
value: "
|
|
1634
|
-
description: "Error
|
|
1636
|
+
value: "Format d'export inconnu : {format}",
|
|
1637
|
+
description: "Error for unsupported export format",
|
|
1635
1638
|
placeholders: [{ name: "format", type: "string" }]
|
|
1636
1639
|
},
|
|
1637
1640
|
"error.handlerNotFoundForTool": {
|
|
1638
|
-
value: "
|
|
1639
|
-
description: "Error
|
|
1641
|
+
value: "Gestionnaire introuvable pour l'outil {name}",
|
|
1642
|
+
description: "Error in tool bridge when handler is missing",
|
|
1640
1643
|
placeholders: [{ name: "name", type: "string" }]
|
|
1641
1644
|
},
|
|
1642
1645
|
"error.toolNotFoundOrNoHandler": {
|
|
1643
|
-
value: "
|
|
1644
|
-
description: "Error
|
|
1646
|
+
value: "Erreur : L'outil « {name} » est introuvable ou n'a pas de gestionnaire",
|
|
1647
|
+
description: "Error returned to LLM when tool execution fails",
|
|
1645
1648
|
placeholders: [{ name: "name", type: "string" }]
|
|
1646
1649
|
},
|
|
1647
1650
|
"error.toolNoExecuteHandler": {
|
|
1648
|
-
value: "
|
|
1649
|
-
description: "Error
|
|
1651
|
+
value: "L'outil {name} n'a pas de gestionnaire d'exécution",
|
|
1652
|
+
description: "Error when tool lacks an execute function",
|
|
1650
1653
|
placeholders: [{ name: "name", type: "string" }]
|
|
1651
1654
|
},
|
|
1652
1655
|
"error.provider.notRegistered": {
|
|
1653
|
-
value: "
|
|
1654
|
-
description: "
|
|
1656
|
+
value: "non enregistré",
|
|
1657
|
+
description: "Provider availability reason: not registered"
|
|
1655
1658
|
},
|
|
1656
1659
|
"error.provider.depsNotInstalled": {
|
|
1657
|
-
value: "
|
|
1658
|
-
description: "
|
|
1660
|
+
value: "dépendances non installées ou non configurées",
|
|
1661
|
+
description: "Provider availability reason: deps missing"
|
|
1659
1662
|
},
|
|
1660
1663
|
"error.provider.sdkNotConfigured": {
|
|
1661
|
-
value: "SDK
|
|
1662
|
-
description: "
|
|
1664
|
+
value: "SDK non installé ou clé d'API non configurée",
|
|
1665
|
+
description: "Provider availability reason: SDK or key missing"
|
|
1663
1666
|
},
|
|
1664
1667
|
"error.provider.claudeSdkMissing": {
|
|
1665
|
-
value: "@anthropic-ai/claude-agent-sdk
|
|
1666
|
-
description: "Error
|
|
1668
|
+
value: "@anthropic-ai/claude-agent-sdk n'est pas installé",
|
|
1669
|
+
description: "Error when Claude Agent SDK require.resolve fails"
|
|
1667
1670
|
},
|
|
1668
1671
|
"error.provider.opencodeSdkMissing": {
|
|
1669
|
-
value: "@opencode-ai/sdk
|
|
1670
|
-
description: "Error
|
|
1672
|
+
value: "@opencode-ai/sdk n'est pas installé",
|
|
1673
|
+
description: "Error when OpenCode SDK require.resolve fails"
|
|
1671
1674
|
},
|
|
1672
1675
|
"error.provider.sdkNotInstalled": {
|
|
1673
|
-
value: "SDK
|
|
1674
|
-
description: "
|
|
1676
|
+
value: "SDK non installé",
|
|
1677
|
+
description: "Generic provider error: SDK not installed"
|
|
1675
1678
|
},
|
|
1676
1679
|
"error.provider.contextCreation": {
|
|
1677
|
-
value: "
|
|
1678
|
-
description: "Error
|
|
1680
|
+
value: "Échec de la création du contexte : {error}",
|
|
1681
|
+
description: "Error during provider context creation",
|
|
1679
1682
|
placeholders: [{ name: "error", type: "string" }]
|
|
1680
1683
|
},
|
|
1681
1684
|
"error.provider.executionFailed": {
|
|
1682
|
-
value: "
|
|
1683
|
-
description: "Error
|
|
1685
|
+
value: "Échec de l'exécution : {error}",
|
|
1686
|
+
description: "Error during provider execution",
|
|
1684
1687
|
placeholders: [{ name: "error", type: "string" }]
|
|
1685
1688
|
},
|
|
1686
1689
|
"error.provider.streamFailed": {
|
|
1687
|
-
value: "
|
|
1688
|
-
description: "Error
|
|
1690
|
+
value: "Échec du flux : {error}",
|
|
1691
|
+
description: "Error during provider streaming",
|
|
1689
1692
|
placeholders: [{ name: "error", type: "string" }]
|
|
1690
1693
|
},
|
|
1691
1694
|
"export.agentConfiguration": {
|
|
1692
|
-
value: "#
|
|
1693
|
-
description: "
|
|
1695
|
+
value: "# Configuration de l'agent",
|
|
1696
|
+
description: "Markdown heading"
|
|
1694
1697
|
},
|
|
1695
1698
|
"export.metadata": {
|
|
1696
|
-
value: "##
|
|
1697
|
-
description: "
|
|
1699
|
+
value: "## Métadonnées",
|
|
1700
|
+
description: "Markdown heading"
|
|
1698
1701
|
},
|
|
1699
1702
|
"export.metaName": {
|
|
1700
|
-
value: "- **
|
|
1701
|
-
description: "
|
|
1703
|
+
value: "- **Nom** : {name}",
|
|
1704
|
+
description: "Metadata line",
|
|
1702
1705
|
placeholders: [{ name: "name", type: "string" }]
|
|
1703
1706
|
},
|
|
1704
1707
|
"export.metaVersion": {
|
|
1705
|
-
value: "- **
|
|
1706
|
-
description: "
|
|
1708
|
+
value: "- **Version** : {version}",
|
|
1709
|
+
description: "Metadata line",
|
|
1707
1710
|
placeholders: [{ name: "version", type: "string" }]
|
|
1708
1711
|
},
|
|
1709
1712
|
"export.metaOwners": {
|
|
1710
|
-
value: "- **
|
|
1711
|
-
description: "
|
|
1713
|
+
value: "- **Propriétaires** : {owners}",
|
|
1714
|
+
description: "Metadata line",
|
|
1712
1715
|
placeholders: [{ name: "owners", type: "string" }]
|
|
1713
1716
|
},
|
|
1714
1717
|
"export.metaModel": {
|
|
1715
|
-
value: "- **
|
|
1716
|
-
description: "
|
|
1718
|
+
value: "- **Modèle** : {model}",
|
|
1719
|
+
description: "Metadata line",
|
|
1717
1720
|
placeholders: [{ name: "model", type: "string" }]
|
|
1718
1721
|
},
|
|
1719
1722
|
"export.instructions": {
|
|
1720
|
-
value: "##
|
|
1721
|
-
description: "
|
|
1723
|
+
value: "## Instructions",
|
|
1724
|
+
description: "Markdown heading"
|
|
1722
1725
|
},
|
|
1723
1726
|
"export.availableTools": {
|
|
1724
|
-
value: "##
|
|
1725
|
-
description: "
|
|
1726
|
-
},
|
|
1727
|
-
"export.tools": {
|
|
1728
|
-
value: "## Herramientas",
|
|
1729
|
-
description: "Encabezado Markdown"
|
|
1727
|
+
value: "## Outils disponibles",
|
|
1728
|
+
description: "Markdown heading"
|
|
1730
1729
|
},
|
|
1730
|
+
"export.tools": { value: "## Outils", description: "Markdown heading" },
|
|
1731
1731
|
"export.knowledgeSources": {
|
|
1732
|
-
value: "##
|
|
1733
|
-
description: "
|
|
1732
|
+
value: "## Sources de connaissances",
|
|
1733
|
+
description: "Markdown heading"
|
|
1734
1734
|
},
|
|
1735
1735
|
"export.policy": {
|
|
1736
|
-
value: "##
|
|
1737
|
-
description: "
|
|
1736
|
+
value: "## Politique",
|
|
1737
|
+
description: "Markdown heading"
|
|
1738
1738
|
},
|
|
1739
1739
|
"export.additionalContext": {
|
|
1740
|
-
value: "##
|
|
1741
|
-
description: "
|
|
1740
|
+
value: "## Contexte supplémentaire",
|
|
1741
|
+
description: "Markdown heading"
|
|
1742
1742
|
},
|
|
1743
1743
|
"export.configuration": {
|
|
1744
|
-
value: "##
|
|
1745
|
-
description: "
|
|
1744
|
+
value: "## Configuration",
|
|
1745
|
+
description: "Markdown heading"
|
|
1746
1746
|
},
|
|
1747
1747
|
"export.mcpServers": {
|
|
1748
|
-
value: "##
|
|
1749
|
-
description: "
|
|
1748
|
+
value: "## Serveurs MCP",
|
|
1749
|
+
description: "Markdown heading"
|
|
1750
1750
|
},
|
|
1751
1751
|
"export.parameters": {
|
|
1752
|
-
value: "**
|
|
1753
|
-
description: "
|
|
1752
|
+
value: "**Paramètres :**",
|
|
1753
|
+
description: "Parameters label"
|
|
1754
1754
|
},
|
|
1755
1755
|
"export.requiresApproval": {
|
|
1756
|
-
value: "
|
|
1757
|
-
description: "
|
|
1756
|
+
value: "nécessite une approbation",
|
|
1757
|
+
description: "Tool flag"
|
|
1758
1758
|
},
|
|
1759
1759
|
"export.notAutomationSafe": {
|
|
1760
|
-
value: "
|
|
1761
|
-
description: "
|
|
1760
|
+
value: "non compatible avec l'automatisation",
|
|
1761
|
+
description: "Tool flag"
|
|
1762
1762
|
},
|
|
1763
1763
|
"export.requiresApprovalMd": {
|
|
1764
|
-
value: "*(
|
|
1765
|
-
description: "
|
|
1764
|
+
value: "*(nécessite une approbation)*",
|
|
1765
|
+
description: "Markdown tool flag"
|
|
1766
1766
|
},
|
|
1767
1767
|
"export.notAutomationSafeMd": {
|
|
1768
|
-
value: "*(
|
|
1769
|
-
description: "
|
|
1768
|
+
value: "*(non compatible avec l'automatisation)*",
|
|
1769
|
+
description: "Markdown tool flag"
|
|
1770
1770
|
},
|
|
1771
1771
|
"export.required": {
|
|
1772
|
-
value: "(
|
|
1773
|
-
description: "
|
|
1772
|
+
value: "(obligatoire)",
|
|
1773
|
+
description: "Required marker"
|
|
1774
1774
|
},
|
|
1775
1775
|
"export.optional": {
|
|
1776
|
-
value: "(
|
|
1777
|
-
description: "
|
|
1776
|
+
value: "(optionnel)",
|
|
1777
|
+
description: "Optional marker"
|
|
1778
1778
|
},
|
|
1779
1779
|
"export.minConfidence": {
|
|
1780
|
-
value: "-
|
|
1781
|
-
description: "
|
|
1780
|
+
value: "- Confiance minimale : {min}",
|
|
1781
|
+
description: "Policy line",
|
|
1782
1782
|
placeholders: [{ name: "min", type: "number" }]
|
|
1783
1783
|
},
|
|
1784
1784
|
"export.escalationConfigured": {
|
|
1785
|
-
value: "- La
|
|
1786
|
-
description: "
|
|
1785
|
+
value: "- La politique d'escalade est configurée",
|
|
1786
|
+
description: "Policy line for system prompt"
|
|
1787
1787
|
},
|
|
1788
1788
|
"export.escalationPolicyConfigured": {
|
|
1789
|
-
value: "-
|
|
1790
|
-
description: "
|
|
1789
|
+
value: "- Politique d'escalade configurée",
|
|
1790
|
+
description: "Policy line for markdown export"
|
|
1791
1791
|
},
|
|
1792
1792
|
"export.featureFlags": {
|
|
1793
|
-
value: "-
|
|
1794
|
-
description: "
|
|
1793
|
+
value: "- Indicateurs de fonctionnalités : {flags}",
|
|
1794
|
+
description: "Feature flags policy line",
|
|
1795
1795
|
placeholders: [{ name: "flags", type: "string" }]
|
|
1796
1796
|
},
|
|
1797
1797
|
"export.generatedFrom": {
|
|
1798
|
-
value: "*
|
|
1799
|
-
description: "
|
|
1798
|
+
value: "*Généré à partir de ContractSpec : {key}*",
|
|
1799
|
+
description: "Footer attribution line",
|
|
1800
1800
|
placeholders: [{ name: "key", type: "string" }]
|
|
1801
1801
|
},
|
|
1802
1802
|
"export.exportedAt": {
|
|
1803
|
-
value: "*
|
|
1804
|
-
description: "
|
|
1803
|
+
value: "*Exporté le : {date}*",
|
|
1804
|
+
description: "Footer timestamp",
|
|
1805
1805
|
placeholders: [{ name: "date", type: "string" }]
|
|
1806
1806
|
},
|
|
1807
1807
|
"export.agentType": {
|
|
1808
|
-
value: ">
|
|
1809
|
-
description: "
|
|
1808
|
+
value: "> Type d'agent : **{type}**",
|
|
1809
|
+
description: "Agent type callout",
|
|
1810
1810
|
placeholders: [{ name: "type", type: "string" }]
|
|
1811
1811
|
},
|
|
1812
1812
|
"export.noDescription": {
|
|
1813
|
-
value: "
|
|
1814
|
-
description: "
|
|
1813
|
+
value: "Aucune description",
|
|
1814
|
+
description: "Fallback when tool has no description"
|
|
1815
1815
|
},
|
|
1816
1816
|
"export.validation.requiresKey": {
|
|
1817
|
-
value: "La
|
|
1818
|
-
description: "
|
|
1817
|
+
value: "La spécification doit avoir une meta.key",
|
|
1818
|
+
description: "Validation error"
|
|
1819
1819
|
},
|
|
1820
1820
|
"export.validation.requiresInstructions": {
|
|
1821
|
-
value: "La
|
|
1822
|
-
description: "
|
|
1821
|
+
value: "La spécification doit avoir des instructions",
|
|
1822
|
+
description: "Validation error"
|
|
1823
1823
|
},
|
|
1824
1824
|
"export.validation.requiresTool": {
|
|
1825
|
-
value: "La
|
|
1826
|
-
description: "
|
|
1825
|
+
value: "La spécification doit avoir au moins un outil",
|
|
1826
|
+
description: "Validation error"
|
|
1827
1827
|
},
|
|
1828
1828
|
"export.validation.toolRequiresName": {
|
|
1829
|
-
value: "
|
|
1830
|
-
description: "
|
|
1829
|
+
value: "Tous les outils doivent avoir un nom",
|
|
1830
|
+
description: "Validation error"
|
|
1831
1831
|
},
|
|
1832
1832
|
"export.validation.toolRequiresDescOrName": {
|
|
1833
|
-
value: "
|
|
1834
|
-
description: "
|
|
1833
|
+
value: "L'outil doit avoir une description ou un nom",
|
|
1834
|
+
description: "Validation error"
|
|
1835
1835
|
},
|
|
1836
1836
|
"export.validation.toolInvalidName": {
|
|
1837
|
-
value: "
|
|
1838
|
-
description: "
|
|
1837
|
+
value: "Le nom d'outil « {name} » doit être un identifiant valide (lettres, chiffres, underscores)",
|
|
1838
|
+
description: "Validation error for invalid tool name",
|
|
1839
1839
|
placeholders: [{ name: "name", type: "string" }]
|
|
1840
1840
|
},
|
|
1841
1841
|
"export.agentType.build": {
|
|
1842
|
-
value: "
|
|
1843
|
-
description: "
|
|
1842
|
+
value: "Agent principal avec accès complet aux outils pour la génération et la modification de code.",
|
|
1843
|
+
description: "Build agent type description"
|
|
1844
1844
|
},
|
|
1845
1845
|
"export.agentType.plan": {
|
|
1846
|
-
value: "
|
|
1847
|
-
description: "
|
|
1846
|
+
value: "Agent restreint pour l'analyse et la planification. Les modifications de fichiers et les commandes bash nécessitent une approbation.",
|
|
1847
|
+
description: "Plan agent type description"
|
|
1848
1848
|
},
|
|
1849
1849
|
"export.agentType.general": {
|
|
1850
|
-
value: "
|
|
1851
|
-
description: "
|
|
1850
|
+
value: "Sous-agent généraliste pour les questions complexes et les tâches en plusieurs étapes.",
|
|
1851
|
+
description: "General agent type description"
|
|
1852
1852
|
},
|
|
1853
1853
|
"export.agentType.explore": {
|
|
1854
|
-
value: "
|
|
1855
|
-
description: "
|
|
1854
|
+
value: "Sous-agent rapide optimisé pour l'exploration de la base de code et la recherche de motifs.",
|
|
1855
|
+
description: "Explore agent type description"
|
|
1856
1856
|
},
|
|
1857
1857
|
"export.bridge.requiresApproval": {
|
|
1858
|
-
value: "(
|
|
1859
|
-
description: "
|
|
1858
|
+
value: "(nécessite une approbation)",
|
|
1859
|
+
description: "Tool permission label"
|
|
1860
1860
|
},
|
|
1861
1861
|
"export.bridge.askMode": {
|
|
1862
|
-
value: "(
|
|
1863
|
-
description: "
|
|
1862
|
+
value: "(mode interrogation)",
|
|
1863
|
+
description: "Tool permission label"
|
|
1864
1864
|
},
|
|
1865
1865
|
"approval.toolRequiresApproval": {
|
|
1866
|
-
value: '
|
|
1867
|
-
description: "
|
|
1866
|
+
value: "L'outil « {name} » nécessite une approbation",
|
|
1867
|
+
description: "Default reason for tool approval requests",
|
|
1868
1868
|
placeholders: [{ name: "name", type: "string" }]
|
|
1869
1869
|
},
|
|
1870
1870
|
"log.unifiedAgent.fallback": {
|
|
1871
|
-
value: "[UnifiedAgent] {backend}
|
|
1872
|
-
description: "
|
|
1871
|
+
value: "[UnifiedAgent] {backend} a échoué, repli sur {fallback}",
|
|
1872
|
+
description: "Warning when a backend fails and fallback is used",
|
|
1873
1873
|
placeholders: [
|
|
1874
1874
|
{ name: "backend", type: "string" },
|
|
1875
1875
|
{ name: "fallback", type: "string" }
|
|
1876
1876
|
]
|
|
1877
1877
|
},
|
|
1878
1878
|
"log.knowledge.spaceNotAvailable": {
|
|
1879
|
-
value: '
|
|
1880
|
-
description: "
|
|
1879
|
+
value: "L'espace de connaissances requis « {key} » n'est pas disponible",
|
|
1880
|
+
description: "Warning when a required knowledge space is missing",
|
|
1881
1881
|
placeholders: [{ name: "key", type: "string" }]
|
|
1882
1882
|
},
|
|
1883
1883
|
"log.knowledge.loadFailed": {
|
|
1884
|
-
value:
|
|
1885
|
-
description: "
|
|
1884
|
+
value: "Échec du chargement des connaissances requises « {key} » :",
|
|
1885
|
+
description: "Warning when knowledge loading fails",
|
|
1886
1886
|
placeholders: [{ name: "key", type: "string" }]
|
|
1887
1887
|
},
|
|
1888
1888
|
"log.knowledge.queryFailed": {
|
|
1889
|
-
value: "
|
|
1890
|
-
description: "
|
|
1889
|
+
value: "Échec de l'interrogation de l'espace de connaissances {space} :",
|
|
1890
|
+
description: "Warning when knowledge querying fails",
|
|
1891
1891
|
placeholders: [{ name: "space", type: "string" }]
|
|
1892
1892
|
},
|
|
1893
1893
|
"log.mcpServer.started": {
|
|
1894
|
-
value: "[MCPToolServer]
|
|
1895
|
-
description: "
|
|
1894
|
+
value: "[MCPToolServer] {name}@{version} démarré avec {count} outils",
|
|
1895
|
+
description: "Log message when MCP tool server starts",
|
|
1896
1896
|
placeholders: [
|
|
1897
1897
|
{ name: "name", type: "string" },
|
|
1898
1898
|
{ name: "version", type: "string" },
|
|
@@ -1900,24 +1900,24 @@ var init_es = __esm(() => {
|
|
|
1900
1900
|
]
|
|
1901
1901
|
},
|
|
1902
1902
|
"log.mcpServer.stopped": {
|
|
1903
|
-
value: "[MCPToolServer]
|
|
1904
|
-
description: "
|
|
1903
|
+
value: "[MCPToolServer] {name} arrêté",
|
|
1904
|
+
description: "Log message when MCP tool server stops",
|
|
1905
1905
|
placeholders: [{ name: "name", type: "string" }]
|
|
1906
1906
|
},
|
|
1907
1907
|
"error.telemetry.posthogAiRequired": {
|
|
1908
|
-
value: "PostHog LLM Analytics
|
|
1908
|
+
value: "PostHog LLM Analytics nécessite l'installation de @posthog/ai. Exécutez : npm install @posthog/ai posthog-node",
|
|
1909
1909
|
description: "Error when PostHog AI dependency is missing"
|
|
1910
1910
|
},
|
|
1911
1911
|
"error.telemetry.posthogClientOrKeyRequired": {
|
|
1912
|
-
value: "PostHog LLM Analytics
|
|
1912
|
+
value: "PostHog LLM Analytics nécessite soit une instance client, soit une apiKey.",
|
|
1913
1913
|
description: "Error when PostHog client or API key is not configured"
|
|
1914
1914
|
},
|
|
1915
1915
|
"error.telemetry.posthogNodeRequired": {
|
|
1916
|
-
value: "PostHog LLM Analytics
|
|
1916
|
+
value: "PostHog LLM Analytics nécessite l'installation de posthog-node. Exécutez : npm install posthog-node",
|
|
1917
1917
|
description: "Error when posthog-node dependency is missing"
|
|
1918
1918
|
},
|
|
1919
1919
|
"error.provider.notAvailable": {
|
|
1920
|
-
value: "
|
|
1920
|
+
value: "Le fournisseur « {provider} » n'est pas disponible{reason}",
|
|
1921
1921
|
description: "Error when a provider is unavailable",
|
|
1922
1922
|
placeholders: [
|
|
1923
1923
|
{ name: "provider", type: "string" },
|
|
@@ -1928,33 +1928,6 @@ var init_es = __esm(() => {
|
|
|
1928
1928
|
});
|
|
1929
1929
|
});
|
|
1930
1930
|
|
|
1931
|
-
// src/i18n/messages.ts
|
|
1932
|
-
import {
|
|
1933
|
-
createI18nFactory
|
|
1934
|
-
} from "@contractspec/lib.contracts-spec/translations";
|
|
1935
|
-
var factory, createAgentI18n, getDefaultI18n, resetI18nRegistry;
|
|
1936
|
-
var init_messages = __esm(() => {
|
|
1937
|
-
init_en();
|
|
1938
|
-
init_fr();
|
|
1939
|
-
init_es();
|
|
1940
|
-
factory = createI18nFactory({
|
|
1941
|
-
specKey: "ai-agent.messages",
|
|
1942
|
-
catalogs: [enMessages, frMessages, esMessages]
|
|
1943
|
-
});
|
|
1944
|
-
createAgentI18n = factory.create;
|
|
1945
|
-
getDefaultI18n = factory.getDefault;
|
|
1946
|
-
resetI18nRegistry = factory.resetRegistry;
|
|
1947
|
-
});
|
|
1948
|
-
|
|
1949
|
-
// src/i18n/locale.ts
|
|
1950
|
-
import {
|
|
1951
|
-
DEFAULT_LOCALE,
|
|
1952
|
-
SUPPORTED_LOCALES,
|
|
1953
|
-
resolveLocale,
|
|
1954
|
-
isSupportedLocale
|
|
1955
|
-
} from "@contractspec/lib.contracts-spec/translations";
|
|
1956
|
-
var init_locale = () => {};
|
|
1957
|
-
|
|
1958
1931
|
// src/i18n/keys.ts
|
|
1959
1932
|
var AGENT_KEYS, KNOWLEDGE_KEYS, TOOL_KEYS, INTEROP_KEYS, ERROR_KEYS, EXPORT_KEYS, APPROVAL_KEYS, LOG_KEYS, I18N_KEYS;
|
|
1960
1933
|
var init_keys = __esm(() => {
|
|
@@ -2121,492 +2094,426 @@ var init_keys = __esm(() => {
|
|
|
2121
2094
|
};
|
|
2122
2095
|
});
|
|
2123
2096
|
|
|
2097
|
+
// src/i18n/locale.ts
|
|
2098
|
+
import {
|
|
2099
|
+
DEFAULT_LOCALE,
|
|
2100
|
+
isSupportedLocale,
|
|
2101
|
+
resolveLocale,
|
|
2102
|
+
SUPPORTED_LOCALES
|
|
2103
|
+
} from "@contractspec/lib.contracts-spec/translations";
|
|
2104
|
+
var init_locale = () => {};
|
|
2105
|
+
|
|
2106
|
+
// src/i18n/messages.ts
|
|
2107
|
+
import {
|
|
2108
|
+
createI18nFactory
|
|
2109
|
+
} from "@contractspec/lib.contracts-spec/translations";
|
|
2110
|
+
var factory, createAgentI18n, getDefaultI18n, resetI18nRegistry;
|
|
2111
|
+
var init_messages = __esm(() => {
|
|
2112
|
+
init_en();
|
|
2113
|
+
init_es();
|
|
2114
|
+
init_fr();
|
|
2115
|
+
factory = createI18nFactory({
|
|
2116
|
+
specKey: "ai-agent.messages",
|
|
2117
|
+
catalogs: [enMessages, frMessages, esMessages]
|
|
2118
|
+
});
|
|
2119
|
+
createAgentI18n = factory.create;
|
|
2120
|
+
getDefaultI18n = factory.getDefault;
|
|
2121
|
+
resetI18nRegistry = factory.resetRegistry;
|
|
2122
|
+
});
|
|
2123
|
+
|
|
2124
2124
|
// src/i18n/index.ts
|
|
2125
2125
|
var init_i18n = __esm(() => {
|
|
2126
|
-
init_messages();
|
|
2127
|
-
init_locale();
|
|
2128
|
-
init_keys();
|
|
2129
2126
|
init_en();
|
|
2130
|
-
init_fr();
|
|
2131
2127
|
init_es();
|
|
2128
|
+
init_fr();
|
|
2129
|
+
init_keys();
|
|
2130
|
+
init_locale();
|
|
2131
|
+
init_messages();
|
|
2132
2132
|
});
|
|
2133
2133
|
|
|
2134
|
-
// src/
|
|
2135
|
-
function
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
throw new Error(i18n.t("error.agentRequiresTool", { key: spec.meta.key }));
|
|
2148
|
-
}
|
|
2149
|
-
for (const [portName, portRef] of Object.entries(spec.runtime?.ports ?? {})) {
|
|
2150
|
-
if (portRef !== undefined && portRef.trim().length === 0) {
|
|
2151
|
-
throw new Error(`Agent ${spec.meta.key} has invalid runtime config: port "${portName}" must not be empty`);
|
|
2152
|
-
}
|
|
2153
|
-
}
|
|
2154
|
-
const toolNames = new Set;
|
|
2155
|
-
for (const tool of spec.tools) {
|
|
2156
|
-
if (toolNames.has(tool.name)) {
|
|
2157
|
-
throw new Error(i18n.t("error.agentDuplicateTool", {
|
|
2158
|
-
key: spec.meta.key,
|
|
2159
|
-
name: tool.name
|
|
2160
|
-
}));
|
|
2134
|
+
// src/knowledge/injector.ts
|
|
2135
|
+
async function injectStaticKnowledge(instructions, knowledgeRefs, retriever, locale) {
|
|
2136
|
+
if (!retriever)
|
|
2137
|
+
return instructions;
|
|
2138
|
+
const requiredRefs = knowledgeRefs.filter((ref) => ref.required);
|
|
2139
|
+
if (requiredRefs.length === 0)
|
|
2140
|
+
return instructions;
|
|
2141
|
+
const i18n = createAgentI18n(locale);
|
|
2142
|
+
const blocks = [];
|
|
2143
|
+
for (const ref of requiredRefs) {
|
|
2144
|
+
if (!retriever.supportsSpace(ref.key)) {
|
|
2145
|
+
console.warn(i18n.t("log.knowledge.spaceNotAvailable", { key: ref.key }));
|
|
2146
|
+
continue;
|
|
2161
2147
|
}
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2148
|
+
try {
|
|
2149
|
+
const content = await retriever.getStatic(ref.key);
|
|
2150
|
+
if (content) {
|
|
2151
|
+
const header = ref.instructions ? `## ${ref.key}
|
|
2152
|
+
${ref.instructions}` : `## ${ref.key}`;
|
|
2153
|
+
blocks.push(`${header}
|
|
2154
|
+
|
|
2155
|
+
${content}`);
|
|
2156
|
+
}
|
|
2157
|
+
} catch (error) {
|
|
2158
|
+
console.warn(i18n.t("log.knowledge.loadFailed", { key: ref.key }), error);
|
|
2173
2159
|
}
|
|
2174
2160
|
}
|
|
2175
|
-
|
|
2161
|
+
if (blocks.length === 0)
|
|
2162
|
+
return instructions;
|
|
2163
|
+
return `${instructions}
|
|
2164
|
+
|
|
2165
|
+
---
|
|
2166
|
+
|
|
2167
|
+
# ${i18n.t("knowledge.header")}
|
|
2168
|
+
|
|
2169
|
+
${i18n.t("knowledge.description")}
|
|
2170
|
+
|
|
2171
|
+
${blocks.join(`
|
|
2172
|
+
|
|
2173
|
+
---
|
|
2174
|
+
|
|
2175
|
+
`)}`;
|
|
2176
2176
|
}
|
|
2177
|
-
function
|
|
2178
|
-
return
|
|
2177
|
+
function createKnowledgeInjector(retriever, locale) {
|
|
2178
|
+
return {
|
|
2179
|
+
inject: (instructions, knowledgeRefs) => injectStaticKnowledge(instructions, knowledgeRefs, retriever, locale),
|
|
2180
|
+
hasSpace: (spaceKey) => retriever?.supportsSpace(spaceKey) ?? false,
|
|
2181
|
+
listSpaces: () => retriever?.listSpaces() ?? []
|
|
2182
|
+
};
|
|
2179
2183
|
}
|
|
2180
|
-
var
|
|
2184
|
+
var init_injector = __esm(() => {
|
|
2181
2185
|
init_i18n();
|
|
2182
2186
|
});
|
|
2183
2187
|
|
|
2184
|
-
// src/
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
}
|
|
2191
|
-
|
|
2192
|
-
|
|
2188
|
+
// src/session/store.ts
|
|
2189
|
+
class InMemorySessionStore {
|
|
2190
|
+
sessions = new Map;
|
|
2191
|
+
maxSessions;
|
|
2192
|
+
maxMessagesPerSession;
|
|
2193
|
+
maxStepsPerSession;
|
|
2194
|
+
constructor(options = {}) {
|
|
2195
|
+
this.maxSessions = options.maxSessions ?? 500;
|
|
2196
|
+
this.maxMessagesPerSession = options.maxMessagesPerSession ?? 200;
|
|
2197
|
+
this.maxStepsPerSession = options.maxStepsPerSession ?? 200;
|
|
2193
2198
|
}
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
return makeNullable(z.enum(values.map(String)));
|
|
2199
|
+
async get(sessionId) {
|
|
2200
|
+
return this.sessions.get(sessionId) ?? null;
|
|
2197
2201
|
}
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2202
|
+
async create(session) {
|
|
2203
|
+
this.evictIfNeeded();
|
|
2204
|
+
const now = new Date;
|
|
2205
|
+
const fullSession = {
|
|
2206
|
+
...session,
|
|
2207
|
+
createdAt: now,
|
|
2208
|
+
updatedAt: now
|
|
2209
|
+
};
|
|
2210
|
+
this.sessions.set(session.sessionId, fullSession);
|
|
2211
|
+
return fullSession;
|
|
2207
2212
|
}
|
|
2208
|
-
|
|
2209
|
-
const
|
|
2210
|
-
if (
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
...schemas.slice(2)
|
|
2216
|
-
]);
|
|
2213
|
+
async appendStep(sessionId, step) {
|
|
2214
|
+
const session = this.sessions.get(sessionId);
|
|
2215
|
+
if (session) {
|
|
2216
|
+
session.steps.push(step);
|
|
2217
|
+
this.trimArray(session.steps, this.maxStepsPerSession);
|
|
2218
|
+
session.updatedAt = new Date;
|
|
2219
|
+
}
|
|
2217
2220
|
}
|
|
2218
|
-
|
|
2219
|
-
const
|
|
2220
|
-
|
|
2221
|
+
async appendMessage(sessionId, message) {
|
|
2222
|
+
const session = this.sessions.get(sessionId);
|
|
2223
|
+
if (session) {
|
|
2224
|
+
session.messages.push(message);
|
|
2225
|
+
this.trimArray(session.messages, this.maxMessagesPerSession);
|
|
2226
|
+
session.updatedAt = new Date;
|
|
2227
|
+
}
|
|
2221
2228
|
}
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
return makeNullable(buildNumberSchema(s));
|
|
2228
|
-
case "boolean":
|
|
2229
|
-
return makeNullable(z.boolean());
|
|
2230
|
-
case "null":
|
|
2231
|
-
return z.null();
|
|
2232
|
-
case "array":
|
|
2233
|
-
return makeNullable(buildArraySchema(s));
|
|
2234
|
-
case "object":
|
|
2235
|
-
return makeNullable(buildObjectSchema(s));
|
|
2236
|
-
default:
|
|
2237
|
-
return z.unknown();
|
|
2229
|
+
async update(sessionId, updates) {
|
|
2230
|
+
const session = this.sessions.get(sessionId);
|
|
2231
|
+
if (session) {
|
|
2232
|
+
Object.assign(session, updates, { updatedAt: new Date });
|
|
2233
|
+
}
|
|
2238
2234
|
}
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
let zodSchema = z.string();
|
|
2242
|
-
if (schema.description) {
|
|
2243
|
-
zodSchema = zodSchema.describe(schema.description);
|
|
2235
|
+
async delete(sessionId) {
|
|
2236
|
+
return this.sessions.delete(sessionId);
|
|
2244
2237
|
}
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
break;
|
|
2256
|
-
case "date-time":
|
|
2257
|
-
zodSchema = zodSchema.datetime();
|
|
2258
|
-
break;
|
|
2259
|
-
case "date":
|
|
2260
|
-
zodSchema = zodSchema.date();
|
|
2261
|
-
break;
|
|
2238
|
+
async listByAgent(agentId, limit = 100) {
|
|
2239
|
+
const results = [];
|
|
2240
|
+
for (const session of this.sessions.values()) {
|
|
2241
|
+
if (session.agentId === agentId) {
|
|
2242
|
+
results.push(session);
|
|
2243
|
+
if (results.length >= limit)
|
|
2244
|
+
break;
|
|
2245
|
+
}
|
|
2246
|
+
}
|
|
2247
|
+
return results.sort((a, b) => b.updatedAt.getTime() - a.updatedAt.getTime());
|
|
2262
2248
|
}
|
|
2263
|
-
|
|
2264
|
-
|
|
2249
|
+
async listByTenant(tenantId, limit = 100) {
|
|
2250
|
+
const results = [];
|
|
2251
|
+
for (const session of this.sessions.values()) {
|
|
2252
|
+
if (session.tenantId === tenantId) {
|
|
2253
|
+
results.push(session);
|
|
2254
|
+
if (results.length >= limit)
|
|
2255
|
+
break;
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
return results.sort((a, b) => b.updatedAt.getTime() - a.updatedAt.getTime());
|
|
2265
2259
|
}
|
|
2266
|
-
|
|
2267
|
-
|
|
2260
|
+
clear() {
|
|
2261
|
+
this.sessions.clear();
|
|
2268
2262
|
}
|
|
2269
|
-
|
|
2270
|
-
|
|
2263
|
+
evictIfNeeded() {
|
|
2264
|
+
if (this.sessions.size < this.maxSessions) {
|
|
2265
|
+
return;
|
|
2266
|
+
}
|
|
2267
|
+
let oldestSessionId = null;
|
|
2268
|
+
let oldestUpdatedAt = Number.POSITIVE_INFINITY;
|
|
2269
|
+
for (const [sessionId, session] of this.sessions.entries()) {
|
|
2270
|
+
const updatedAt = session.updatedAt.getTime();
|
|
2271
|
+
if (updatedAt < oldestUpdatedAt) {
|
|
2272
|
+
oldestUpdatedAt = updatedAt;
|
|
2273
|
+
oldestSessionId = sessionId;
|
|
2274
|
+
}
|
|
2275
|
+
}
|
|
2276
|
+
if (oldestSessionId) {
|
|
2277
|
+
this.sessions.delete(oldestSessionId);
|
|
2278
|
+
}
|
|
2271
2279
|
}
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2280
|
+
trimArray(items, maxItems) {
|
|
2281
|
+
if (items.length <= maxItems) {
|
|
2282
|
+
return;
|
|
2283
|
+
}
|
|
2284
|
+
const overflow = items.length - maxItems;
|
|
2285
|
+
items.splice(0, overflow);
|
|
2278
2286
|
}
|
|
2279
|
-
|
|
2280
|
-
|
|
2287
|
+
}
|
|
2288
|
+
function createInMemorySessionStore(options) {
|
|
2289
|
+
return new InMemorySessionStore(options);
|
|
2290
|
+
}
|
|
2291
|
+
function createSecureSessionToken() {
|
|
2292
|
+
const cryptoApi = globalThis.crypto;
|
|
2293
|
+
if (typeof cryptoApi?.randomUUID === "function") {
|
|
2294
|
+
return cryptoApi.randomUUID();
|
|
2295
|
+
}
|
|
2296
|
+
if (typeof cryptoApi?.getRandomValues === "function") {
|
|
2297
|
+
const bytes = cryptoApi.getRandomValues(new Uint8Array(16));
|
|
2298
|
+
const versionByte = bytes.at(6);
|
|
2299
|
+
const variantByte = bytes.at(8);
|
|
2300
|
+
if (versionByte === undefined || variantByte === undefined) {
|
|
2301
|
+
throw new Error("Secure session token generation requires 16 random bytes.");
|
|
2302
|
+
}
|
|
2303
|
+
bytes[6] = versionByte & 15 | 64;
|
|
2304
|
+
bytes[8] = variantByte & 63 | 128;
|
|
2305
|
+
const hex = [...bytes].map((byte) => byte.toString(16).padStart(2, "0"));
|
|
2306
|
+
return [
|
|
2307
|
+
hex.slice(0, 4).join(""),
|
|
2308
|
+
hex.slice(4, 6).join(""),
|
|
2309
|
+
hex.slice(6, 8).join(""),
|
|
2310
|
+
hex.slice(8, 10).join(""),
|
|
2311
|
+
hex.slice(10, 16).join("")
|
|
2312
|
+
].join("-");
|
|
2313
|
+
}
|
|
2314
|
+
throw new Error("Secure session IDs require Web Crypto support.");
|
|
2315
|
+
}
|
|
2316
|
+
function generateSessionId() {
|
|
2317
|
+
return `sess_${createSecureSessionToken()}`;
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
// src/spec/spec.ts
|
|
2321
|
+
function defineAgent(spec) {
|
|
2322
|
+
const i18n = createAgentI18n(spec.locale);
|
|
2323
|
+
if (!spec.meta?.key) {
|
|
2324
|
+
throw new Error(i18n.t("error.agentKeyRequired"));
|
|
2281
2325
|
}
|
|
2282
|
-
if (
|
|
2283
|
-
|
|
2326
|
+
if (typeof spec.meta.version !== "string") {
|
|
2327
|
+
throw new Error(i18n.t("error.agentMissingVersion", { key: spec.meta.key }));
|
|
2284
2328
|
}
|
|
2285
|
-
|
|
2286
|
-
}
|
|
2287
|
-
function buildArraySchema(schema) {
|
|
2288
|
-
const itemsSchema = schema.items ? jsonSchemaToZod(schema.items) : z.unknown();
|
|
2289
|
-
let zodSchema = z.array(itemsSchema);
|
|
2290
|
-
if (schema.description) {
|
|
2291
|
-
zodSchema = zodSchema.describe(schema.description);
|
|
2329
|
+
if (!spec.instructions?.trim()) {
|
|
2330
|
+
throw new Error(i18n.t("error.agentRequiresInstructions", { key: spec.meta.key }));
|
|
2292
2331
|
}
|
|
2293
|
-
|
|
2294
|
-
}
|
|
2295
|
-
function buildObjectSchema(schema) {
|
|
2296
|
-
const properties = schema.properties ?? {};
|
|
2297
|
-
const required = new Set(schema.required ?? []);
|
|
2298
|
-
const shape = {};
|
|
2299
|
-
for (const [key, propSchema] of Object.entries(properties)) {
|
|
2300
|
-
const zodProp = jsonSchemaToZod(propSchema);
|
|
2301
|
-
shape[key] = required.has(key) ? zodProp : zodProp.optional();
|
|
2332
|
+
if (!spec.tools?.length) {
|
|
2333
|
+
throw new Error(i18n.t("error.agentRequiresTool", { key: spec.meta.key }));
|
|
2302
2334
|
}
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2335
|
+
for (const [portName, portRef] of Object.entries(spec.runtime?.ports ?? {})) {
|
|
2336
|
+
if (portRef !== undefined && portRef.trim().length === 0) {
|
|
2337
|
+
throw new Error(`Agent ${spec.meta.key} has invalid runtime config: port "${portName}" must not be empty`);
|
|
2338
|
+
}
|
|
2306
2339
|
}
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2340
|
+
const toolNames = new Set;
|
|
2341
|
+
for (const tool of spec.tools) {
|
|
2342
|
+
if (toolNames.has(tool.name)) {
|
|
2343
|
+
throw new Error(i18n.t("error.agentDuplicateTool", {
|
|
2344
|
+
key: spec.meta.key,
|
|
2345
|
+
name: tool.name
|
|
2346
|
+
}));
|
|
2347
|
+
}
|
|
2348
|
+
toolNames.add(tool.name);
|
|
2349
|
+
if (tool.subagentRef && tool.operationRef) {
|
|
2350
|
+
throw new Error(`Agent ${spec.meta.key} tool "${tool.name}" cannot have both subagentRef and operationRef. Use one.`);
|
|
2351
|
+
}
|
|
2352
|
+
const outputRefCount = [
|
|
2353
|
+
tool.outputPresentation,
|
|
2354
|
+
tool.outputForm,
|
|
2355
|
+
tool.outputDataView
|
|
2356
|
+
].filter(Boolean).length;
|
|
2357
|
+
if (outputRefCount > 1) {
|
|
2358
|
+
throw new Error(`Agent ${spec.meta.key} tool "${tool.name}" has multiple output refs (outputPresentation, outputForm, outputDataView). Use at most one.`);
|
|
2359
|
+
}
|
|
2312
2360
|
}
|
|
2313
|
-
return
|
|
2361
|
+
return Object.freeze(spec);
|
|
2314
2362
|
}
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
// src/tools/operation-tool-handler.ts
|
|
2318
|
-
function toolCtxToHandlerCtx(ctx) {
|
|
2319
|
-
return {
|
|
2320
|
-
traceId: ctx.metadata?.traceId,
|
|
2321
|
-
organizationId: ctx.tenantId ?? null,
|
|
2322
|
-
userId: ctx.actorId ?? null,
|
|
2323
|
-
actor: ctx.actorId ? "user" : "anonymous",
|
|
2324
|
-
channel: "agent",
|
|
2325
|
-
roles: []
|
|
2326
|
-
};
|
|
2327
|
-
}
|
|
2328
|
-
function createOperationToolHandler(registry, operationRef) {
|
|
2329
|
-
return async (input, context) => {
|
|
2330
|
-
const handlerCtx = toolCtxToHandlerCtx(context);
|
|
2331
|
-
const result = await registry.execute(operationRef.key, operationRef.version, input ?? {}, handlerCtx);
|
|
2332
|
-
return result;
|
|
2333
|
-
};
|
|
2363
|
+
function agentKey(meta) {
|
|
2364
|
+
return `${meta.key}.v${meta.version}`;
|
|
2334
2365
|
}
|
|
2366
|
+
var init_spec = __esm(() => {
|
|
2367
|
+
init_i18n();
|
|
2368
|
+
});
|
|
2335
2369
|
|
|
2336
|
-
// src/
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
return iterable;
|
|
2370
|
+
// src/telemetry/adapter.ts
|
|
2371
|
+
function parseAgentId(agentId) {
|
|
2372
|
+
const match = agentId.match(/^(.+)\.v(\d+)$/);
|
|
2373
|
+
if (match) {
|
|
2374
|
+
return { name: match[1], version: match[2] };
|
|
2342
2375
|
}
|
|
2343
|
-
return
|
|
2344
|
-
async start(controller) {
|
|
2345
|
-
try {
|
|
2346
|
-
for await (const chunk of iterable) {
|
|
2347
|
-
controller.enqueue(chunk);
|
|
2348
|
-
}
|
|
2349
|
-
} finally {
|
|
2350
|
-
controller.close();
|
|
2351
|
-
}
|
|
2352
|
-
}
|
|
2353
|
-
});
|
|
2376
|
+
return { name: agentId, version: "1.0.0" };
|
|
2354
2377
|
}
|
|
2355
|
-
function
|
|
2356
|
-
|
|
2357
|
-
subagent,
|
|
2358
|
-
description = "Research a topic or question in depth.",
|
|
2359
|
-
taskParam = "task",
|
|
2360
|
-
toModelSummary = true,
|
|
2361
|
-
passConversationHistory = false
|
|
2362
|
-
} = options;
|
|
2363
|
-
const inputSchema = z2.object({
|
|
2364
|
-
[taskParam]: z2.string().describe("The research task to complete")
|
|
2365
|
-
});
|
|
2366
|
-
const execute = async function* (input, options2) {
|
|
2367
|
-
const task = String(input[taskParam] ?? input.task ?? "");
|
|
2368
|
-
const { abortSignal, messages } = options2 ?? {};
|
|
2369
|
-
if (passConversationHistory && messages && messages.length > 0 && typeof subagent.generate === "function") {
|
|
2370
|
-
const result2 = await subagent.generate({
|
|
2371
|
-
messages: [...messages, { role: "user", content: task }],
|
|
2372
|
-
abortSignal
|
|
2373
|
-
});
|
|
2374
|
-
yield { parts: [{ type: "text", text: result2.text }] };
|
|
2375
|
-
return;
|
|
2376
|
-
}
|
|
2377
|
-
const result = await subagent.stream({
|
|
2378
|
-
prompt: task,
|
|
2379
|
-
abortSignal
|
|
2380
|
-
});
|
|
2381
|
-
const uiStream = result.toUIMessageStream();
|
|
2382
|
-
const stream = toReadableStream(uiStream);
|
|
2383
|
-
for await (const message of readUIMessageStream({
|
|
2384
|
-
stream
|
|
2385
|
-
})) {
|
|
2386
|
-
yield message;
|
|
2387
|
-
}
|
|
2388
|
-
};
|
|
2389
|
-
const toolOptions = {
|
|
2390
|
-
description,
|
|
2391
|
-
inputSchema,
|
|
2392
|
-
execute,
|
|
2393
|
-
...toModelSummary && {
|
|
2394
|
-
toModelOutput: ({
|
|
2395
|
-
output
|
|
2396
|
-
}) => {
|
|
2397
|
-
const parts = output?.parts;
|
|
2398
|
-
if (!Array.isArray(parts)) {
|
|
2399
|
-
return { type: "text", value: "Task completed." };
|
|
2400
|
-
}
|
|
2401
|
-
const lastTextPart = [...parts].reverse().find((p) => p?.type === "text");
|
|
2402
|
-
return {
|
|
2403
|
-
type: "text",
|
|
2404
|
-
value: lastTextPart?.text ?? "Task completed."
|
|
2405
|
-
};
|
|
2406
|
-
}
|
|
2407
|
-
}
|
|
2408
|
-
};
|
|
2409
|
-
return tool(toolOptions);
|
|
2378
|
+
function getRecord(value) {
|
|
2379
|
+
return value && typeof value === "object" ? value : undefined;
|
|
2410
2380
|
}
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2381
|
+
function getStepResponse(step) {
|
|
2382
|
+
const response = getRecord(step.response);
|
|
2383
|
+
if (!response)
|
|
2384
|
+
return;
|
|
2385
|
+
return {
|
|
2386
|
+
id: response["id"],
|
|
2387
|
+
modelId: response["modelId"],
|
|
2388
|
+
timestamp: response["timestamp"],
|
|
2389
|
+
headers: response["headers"],
|
|
2390
|
+
body: response["body"],
|
|
2391
|
+
messages: response["messages"]
|
|
2392
|
+
};
|
|
2417
2393
|
}
|
|
2418
|
-
function
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
signal
|
|
2429
|
-
});
|
|
2430
|
-
return tool2({
|
|
2431
|
-
description: specTool.description ?? specTool.name,
|
|
2432
|
-
inputSchema,
|
|
2433
|
-
needsApproval: specTool.requiresApproval ?? !specTool.automationSafe,
|
|
2434
|
-
execute: async function* (input, options) {
|
|
2435
|
-
const now = Date.now();
|
|
2436
|
-
const cooldownMs = normalizeDuration(specTool.cooldownMs);
|
|
2437
|
-
if (cooldownMs && lastInvocationAt !== undefined) {
|
|
2438
|
-
const elapsed = now - lastInvocationAt;
|
|
2439
|
-
if (elapsed < cooldownMs) {
|
|
2440
|
-
const retryAfterMs = cooldownMs - elapsed;
|
|
2441
|
-
throw createToolExecutionError(`Tool "${specTool.name}" is cooling down. Retry in ${retryAfterMs}ms.`, "TOOL_COOLDOWN_ACTIVE", retryAfterMs);
|
|
2442
|
-
}
|
|
2443
|
-
}
|
|
2444
|
-
const timeoutMs = normalizeDuration(specTool.timeoutMs);
|
|
2445
|
-
const signal = options?.abortSignal ?? context.signal;
|
|
2446
|
-
const { signal: timeoutSignal, dispose } = createTimeoutSignal(signal, timeoutMs);
|
|
2447
|
-
try {
|
|
2448
|
-
const execution = handler(input, buildContext(timeoutSignal));
|
|
2449
|
-
if (isAsyncGenerator(execution)) {
|
|
2450
|
-
for await (const raw of execution) {
|
|
2451
|
-
const wrapped = wrapToolOutputForRendering(specTool, raw, operationSpec);
|
|
2452
|
-
yield typeof wrapped === "string" ? wrapped : wrapped;
|
|
2453
|
-
}
|
|
2454
|
-
} else {
|
|
2455
|
-
const raw = timeoutMs ? await withTimeout(Promise.resolve(execution), timeoutMs, specTool.name) : await Promise.resolve(execution);
|
|
2456
|
-
const wrapped = wrapToolOutputForRendering(specTool, raw, operationSpec);
|
|
2457
|
-
yield typeof wrapped === "string" ? wrapped : wrapped;
|
|
2458
|
-
}
|
|
2459
|
-
} finally {
|
|
2460
|
-
dispose();
|
|
2461
|
-
lastInvocationAt = Date.now();
|
|
2462
|
-
}
|
|
2394
|
+
function getRequestBodyValue(request, key) {
|
|
2395
|
+
const body = request?.["body"];
|
|
2396
|
+
if (!body)
|
|
2397
|
+
return;
|
|
2398
|
+
if (typeof body === "string") {
|
|
2399
|
+
try {
|
|
2400
|
+
const parsed = JSON.parse(body);
|
|
2401
|
+
return typeof parsed[key] === "string" ? parsed[key] : undefined;
|
|
2402
|
+
} catch {
|
|
2403
|
+
return;
|
|
2463
2404
|
}
|
|
2464
|
-
}
|
|
2405
|
+
}
|
|
2406
|
+
const record = getRecord(body);
|
|
2407
|
+
return typeof record?.[key] === "string" ? record[key] : undefined;
|
|
2465
2408
|
}
|
|
2466
|
-
function
|
|
2467
|
-
const
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
throw new Error(createAgentI18n(context.locale).t("error.missingToolHandler", {
|
|
2502
|
-
name: specTool.name
|
|
2503
|
-
}));
|
|
2409
|
+
async function trackAgentStep(collector, agentId, step, durationMs, context) {
|
|
2410
|
+
const { name, version } = parseAgentId(agentId);
|
|
2411
|
+
const response = getStepResponse(step);
|
|
2412
|
+
const providerMetadata = step.providerMetadata;
|
|
2413
|
+
const warnings = step.warnings;
|
|
2414
|
+
const rawFinishReason = step.rawFinishReason;
|
|
2415
|
+
const request = getRecord(step.request);
|
|
2416
|
+
const traceId = context?.traceId ?? getRequestBodyValue(request, "$ai_trace_id");
|
|
2417
|
+
const sessionId = context?.sessionId ?? getRequestBodyValue(request, "$ai_session_id");
|
|
2418
|
+
const parentSpanId = response?.id;
|
|
2419
|
+
for (const toolCall of step.toolCalls ?? []) {
|
|
2420
|
+
const toolResult = step.toolResults?.find((r) => r.toolCallId === toolCall.toolCallId);
|
|
2421
|
+
const toolError = getRecord(toolResult?.output)?.["error"];
|
|
2422
|
+
const toolSample = {
|
|
2423
|
+
operation: { name: `${name}.${toolCall.toolName}`, version },
|
|
2424
|
+
durationMs: durationMs ?? 0,
|
|
2425
|
+
success: step.toolResults?.some((r) => r.toolCallId === toolCall.toolCallId && r.output !== undefined) ?? false,
|
|
2426
|
+
timestamp: new Date,
|
|
2427
|
+
metadata: {
|
|
2428
|
+
telemetryEvent: "span",
|
|
2429
|
+
traceId,
|
|
2430
|
+
sessionId,
|
|
2431
|
+
spanId: toolCall.toolCallId,
|
|
2432
|
+
parentSpanId,
|
|
2433
|
+
spanName: `tool.${toolCall.toolName}`,
|
|
2434
|
+
agentId,
|
|
2435
|
+
actorId: context?.actorId,
|
|
2436
|
+
tenantId: context?.tenantId,
|
|
2437
|
+
stepIndex: context?.stepIndex,
|
|
2438
|
+
toolName: toolCall.toolName,
|
|
2439
|
+
toolCallArgs: toolCall.input,
|
|
2440
|
+
toolResultOutput: toolResult?.output,
|
|
2441
|
+
errorMessage: typeof toolError === "string" ? toolError : typeof toolResult?.output === "string" ? toolResult.output : undefined,
|
|
2442
|
+
finishReason: step.finishReason,
|
|
2443
|
+
rawFinishReason
|
|
2504
2444
|
}
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
tools[specTool.name] = specToolToAISDKTool(specTool, handler, context, effectiveInputSchema, op);
|
|
2445
|
+
};
|
|
2446
|
+
await collector.collect(toolSample);
|
|
2508
2447
|
}
|
|
2509
|
-
|
|
2510
|
-
}
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2448
|
+
const stepSample = {
|
|
2449
|
+
operation: { name, version },
|
|
2450
|
+
durationMs: durationMs ?? 0,
|
|
2451
|
+
success: step.finishReason !== "error",
|
|
2452
|
+
timestamp: new Date,
|
|
2453
|
+
metadata: {
|
|
2454
|
+
telemetryEvent: "generation",
|
|
2455
|
+
traceId,
|
|
2456
|
+
sessionId,
|
|
2457
|
+
spanId: response?.id,
|
|
2458
|
+
spanName: `agent.${name}.step`,
|
|
2459
|
+
agentId,
|
|
2460
|
+
actorId: context?.actorId,
|
|
2461
|
+
tenantId: context?.tenantId,
|
|
2462
|
+
stepIndex: context?.stepIndex,
|
|
2463
|
+
stepStartedAt: context?.stepStartedAt,
|
|
2464
|
+
finishReason: step.finishReason,
|
|
2465
|
+
rawFinishReason,
|
|
2466
|
+
tokenUsage: step.usage,
|
|
2467
|
+
totalUsage: step.totalUsage,
|
|
2468
|
+
providerMetadata,
|
|
2469
|
+
warnings,
|
|
2470
|
+
stepText: step.text,
|
|
2471
|
+
stepReasoningText: step.reasoningText,
|
|
2472
|
+
responseId: response?.id,
|
|
2473
|
+
responseModelId: response?.modelId,
|
|
2474
|
+
responseTimestamp: response?.timestamp,
|
|
2475
|
+
responseHeaders: response?.headers,
|
|
2476
|
+
responseBody: response?.body,
|
|
2477
|
+
responseMessages: response?.messages,
|
|
2478
|
+
requestBody: request?.["body"],
|
|
2479
|
+
requestHeaders: request?.["headers"],
|
|
2480
|
+
toolCallCount: step.toolCalls?.length ?? 0,
|
|
2481
|
+
toolCalls: step.toolCalls,
|
|
2482
|
+
toolResults: step.toolResults,
|
|
2483
|
+
errorMessage: step.finishReason === "error" ? step.text : undefined
|
|
2484
|
+
}
|
|
2514
2485
|
};
|
|
2486
|
+
await collector.collect(stepSample);
|
|
2515
2487
|
}
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
const form = specTool.outputForm ?? operationSpec?.outputForm;
|
|
2522
|
-
const dataView = specTool.outputDataView ?? operationSpec?.outputDataView;
|
|
2523
|
-
if (presentation) {
|
|
2524
|
-
return {
|
|
2525
|
-
presentationKey: presentation.key,
|
|
2526
|
-
data: result
|
|
2527
|
-
};
|
|
2528
|
-
}
|
|
2529
|
-
if (form) {
|
|
2530
|
-
return {
|
|
2531
|
-
formKey: form.key,
|
|
2532
|
-
defaultValues: typeof result === "object" && result !== null ? result : {}
|
|
2533
|
-
};
|
|
2534
|
-
}
|
|
2535
|
-
if (dataView) {
|
|
2536
|
-
return {
|
|
2537
|
-
dataViewKey: dataView.key,
|
|
2538
|
-
items: Array.isArray(result) ? result : result != null ? [result] : []
|
|
2539
|
-
};
|
|
2488
|
+
|
|
2489
|
+
class InMemoryTelemetryCollector {
|
|
2490
|
+
samples = [];
|
|
2491
|
+
async collect(sample) {
|
|
2492
|
+
this.samples.push(sample);
|
|
2540
2493
|
}
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
function normalizeDuration(value) {
|
|
2544
|
-
if (value === undefined) {
|
|
2545
|
-
return;
|
|
2494
|
+
getSamples() {
|
|
2495
|
+
return [...this.samples];
|
|
2546
2496
|
}
|
|
2547
|
-
|
|
2548
|
-
return;
|
|
2497
|
+
getSamplesForOperation(operationName) {
|
|
2498
|
+
return this.samples.filter((s) => s.operation.name === operationName);
|
|
2549
2499
|
}
|
|
2550
|
-
|
|
2551
|
-
|
|
2500
|
+
clear() {
|
|
2501
|
+
this.samples.length = 0;
|
|
2552
2502
|
}
|
|
2553
|
-
return Math.round(value);
|
|
2554
2503
|
}
|
|
2555
|
-
function
|
|
2556
|
-
return new
|
|
2557
|
-
const timeoutHandle = setTimeout(() => {
|
|
2558
|
-
reject(createToolExecutionError(`Tool "${toolName}" timed out after ${timeoutMs}ms.`, "TOOL_EXECUTION_TIMEOUT"));
|
|
2559
|
-
}, timeoutMs);
|
|
2560
|
-
execution.then((result) => {
|
|
2561
|
-
clearTimeout(timeoutHandle);
|
|
2562
|
-
resolve(result);
|
|
2563
|
-
}).catch((error) => {
|
|
2564
|
-
clearTimeout(timeoutHandle);
|
|
2565
|
-
reject(error);
|
|
2566
|
-
});
|
|
2567
|
-
});
|
|
2504
|
+
function createInMemoryTelemetryCollector() {
|
|
2505
|
+
return new InMemoryTelemetryCollector;
|
|
2568
2506
|
}
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
if (signal.aborted) {
|
|
2574
|
-
controller.abort();
|
|
2575
|
-
} else {
|
|
2576
|
-
signal.addEventListener("abort", abortFromSource);
|
|
2577
|
-
}
|
|
2578
|
-
}
|
|
2579
|
-
const timeoutHandle = timeoutMs !== undefined ? setTimeout(() => {
|
|
2580
|
-
controller.abort();
|
|
2581
|
-
}, timeoutMs) : undefined;
|
|
2582
|
-
return {
|
|
2583
|
-
signal: controller.signal,
|
|
2584
|
-
dispose: () => {
|
|
2585
|
-
if (timeoutHandle !== undefined) {
|
|
2586
|
-
clearTimeout(timeoutHandle);
|
|
2587
|
-
}
|
|
2588
|
-
if (signal) {
|
|
2589
|
-
signal.removeEventListener("abort", abortFromSource);
|
|
2590
|
-
}
|
|
2591
|
-
}
|
|
2507
|
+
var noopTelemetryCollector;
|
|
2508
|
+
var init_adapter = __esm(() => {
|
|
2509
|
+
noopTelemetryCollector = {
|
|
2510
|
+
collect: async () => {}
|
|
2592
2511
|
};
|
|
2593
|
-
}
|
|
2594
|
-
function createToolExecutionError(message, code, retryAfterMs) {
|
|
2595
|
-
return Object.assign(new Error(message), {
|
|
2596
|
-
code,
|
|
2597
|
-
kind: "retryable",
|
|
2598
|
-
retryAfterMs
|
|
2599
|
-
});
|
|
2600
|
-
}
|
|
2601
|
-
var init_tool_adapter = __esm(() => {
|
|
2602
|
-
init_json_schema_to_zod();
|
|
2603
|
-
init_i18n();
|
|
2604
|
-
init_subagent_tool();
|
|
2605
2512
|
});
|
|
2606
2513
|
|
|
2607
2514
|
// src/tools/knowledge-tool.ts
|
|
2608
|
-
import { tool
|
|
2609
|
-
import * as
|
|
2515
|
+
import { tool } from "ai";
|
|
2516
|
+
import * as z from "zod";
|
|
2610
2517
|
function createKnowledgeQueryTool(retriever, knowledgeRefs, locale) {
|
|
2611
2518
|
const i18n = createAgentI18n(locale);
|
|
2612
2519
|
const optionalSpaces = knowledgeRefs.filter((k) => !k.required).map((k) => k.key).filter((key) => retriever.supportsSpace(key));
|
|
@@ -2615,15 +2522,15 @@ function createKnowledgeQueryTool(retriever, knowledgeRefs, locale) {
|
|
|
2615
2522
|
}
|
|
2616
2523
|
const spaceDescriptions = knowledgeRefs.filter((k) => !k.required && retriever.supportsSpace(k.key)).map((k) => `- ${k.key}: ${k.instructions ?? i18n.t("tool.knowledge.spaceDefault")}`).join(`
|
|
2617
2524
|
`);
|
|
2618
|
-
return
|
|
2525
|
+
return tool({
|
|
2619
2526
|
description: `${i18n.t("tool.knowledge.description")}
|
|
2620
2527
|
|
|
2621
2528
|
${i18n.t("tool.knowledge.availableSpaces")}
|
|
2622
2529
|
${spaceDescriptions}`,
|
|
2623
|
-
inputSchema:
|
|
2624
|
-
query:
|
|
2625
|
-
spaceKey:
|
|
2626
|
-
topK:
|
|
2530
|
+
inputSchema: z.object({
|
|
2531
|
+
query: z.string().describe(i18n.t("tool.knowledge.param.query")),
|
|
2532
|
+
spaceKey: z.enum(optionalSpaces).optional().describe(i18n.t("tool.knowledge.param.spaceKey")),
|
|
2533
|
+
topK: z.number().optional().default(5).describe(i18n.t("tool.knowledge.param.topK"))
|
|
2627
2534
|
}),
|
|
2628
2535
|
execute: async ({ query, spaceKey, topK }) => {
|
|
2629
2536
|
const spacesToSearch = spaceKey ? [spaceKey] : optionalSpaces;
|
|
@@ -2663,33 +2570,6 @@ var init_knowledge_tool = __esm(() => {
|
|
|
2663
2570
|
init_i18n();
|
|
2664
2571
|
});
|
|
2665
2572
|
|
|
2666
|
-
// src/tools/memory-tools.ts
|
|
2667
|
-
import { anthropic } from "@ai-sdk/anthropic";
|
|
2668
|
-
function createAnthropicMemoryTool(store) {
|
|
2669
|
-
const memory = anthropic.tools.memory_20250818({
|
|
2670
|
-
execute: async (action) => {
|
|
2671
|
-
switch (action.command) {
|
|
2672
|
-
case "view":
|
|
2673
|
-
return store.view(action.path ?? "/memories", action.view_range);
|
|
2674
|
-
case "create":
|
|
2675
|
-
return store.create(action.path ?? "/memories/untitled", action.file_text ?? "");
|
|
2676
|
-
case "str_replace":
|
|
2677
|
-
return store.strReplace(action.path ?? "/memories", action.old_str ?? "", action.new_str ?? "");
|
|
2678
|
-
case "insert":
|
|
2679
|
-
return store.insert(action.path ?? "/memories", action.insert_line ?? 0, action.insert_text ?? "");
|
|
2680
|
-
case "delete":
|
|
2681
|
-
return store.delete(action.path ?? "/memories");
|
|
2682
|
-
case "rename":
|
|
2683
|
-
return store.rename(action.old_path ?? "/memories", action.new_path ?? "/memories");
|
|
2684
|
-
default:
|
|
2685
|
-
return `Unknown command: ${action.command}`;
|
|
2686
|
-
}
|
|
2687
|
-
}
|
|
2688
|
-
});
|
|
2689
|
-
return memory;
|
|
2690
|
-
}
|
|
2691
|
-
var init_memory_tools = () => {};
|
|
2692
|
-
|
|
2693
2573
|
// src/tools/mcp-client-helpers.ts
|
|
2694
2574
|
import {
|
|
2695
2575
|
Experimental_StdioMCPTransport as StdioClientTransport
|
|
@@ -2720,8 +2600,8 @@ function prefixToolNames(config, tools) {
|
|
|
2720
2600
|
return tools;
|
|
2721
2601
|
}
|
|
2722
2602
|
const prefixedTools = {};
|
|
2723
|
-
for (const [toolName,
|
|
2724
|
-
prefixedTools[`${prefix}_${toolName}`] =
|
|
2603
|
+
for (const [toolName, tool2] of Object.entries(tools)) {
|
|
2604
|
+
prefixedTools[`${prefix}_${toolName}`] = tool2;
|
|
2725
2605
|
}
|
|
2726
2606
|
return prefixedTools;
|
|
2727
2607
|
}
|
|
@@ -2827,12 +2707,12 @@ async function createMcpToolsets(configs, options = {}) {
|
|
|
2827
2707
|
for (const [serverName, toolNames] of Object.entries(result.serverToolNames)) {
|
|
2828
2708
|
serverToolNames[serverName] = toolNames;
|
|
2829
2709
|
}
|
|
2830
|
-
for (const [toolName,
|
|
2710
|
+
for (const [toolName, tool2] of Object.entries(result.tools)) {
|
|
2831
2711
|
const hasCollision = combinedTools[toolName] !== undefined;
|
|
2832
2712
|
if (hasCollision && collisionStrategy === "error") {
|
|
2833
2713
|
throw new Error(`Duplicate MCP tool name "${toolName}" detected. Use "toolPrefix" or set onNameCollision to "overwrite".`);
|
|
2834
2714
|
}
|
|
2835
|
-
combinedTools[toolName] =
|
|
2715
|
+
combinedTools[toolName] = tool2;
|
|
2836
2716
|
}
|
|
2837
2717
|
}
|
|
2838
2718
|
} catch (error) {
|
|
@@ -2855,309 +2735,454 @@ var init_mcp_client = __esm(() => {
|
|
|
2855
2735
|
init_mcp_client_helpers();
|
|
2856
2736
|
});
|
|
2857
2737
|
|
|
2858
|
-
// src/
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
${content}`);
|
|
2738
|
+
// src/tools/memory-tools.ts
|
|
2739
|
+
import { anthropic } from "@ai-sdk/anthropic";
|
|
2740
|
+
function createAnthropicMemoryTool(store) {
|
|
2741
|
+
const memory = anthropic.tools.memory_20250818({
|
|
2742
|
+
execute: async (action) => {
|
|
2743
|
+
switch (action.command) {
|
|
2744
|
+
case "view":
|
|
2745
|
+
return store.view(action.path ?? "/memories", action.view_range);
|
|
2746
|
+
case "create":
|
|
2747
|
+
return store.create(action.path ?? "/memories/untitled", action.file_text ?? "");
|
|
2748
|
+
case "str_replace":
|
|
2749
|
+
return store.strReplace(action.path ?? "/memories", action.old_str ?? "", action.new_str ?? "");
|
|
2750
|
+
case "insert":
|
|
2751
|
+
return store.insert(action.path ?? "/memories", action.insert_line ?? 0, action.insert_text ?? "");
|
|
2752
|
+
case "delete":
|
|
2753
|
+
return store.delete(action.path ?? "/memories");
|
|
2754
|
+
case "rename":
|
|
2755
|
+
return store.rename(action.old_path ?? "/memories", action.new_path ?? "/memories");
|
|
2756
|
+
default:
|
|
2757
|
+
return `Unknown command: ${action.command}`;
|
|
2880
2758
|
}
|
|
2881
|
-
} catch (error) {
|
|
2882
|
-
console.warn(i18n.t("log.knowledge.loadFailed", { key: ref.key }), error);
|
|
2883
2759
|
}
|
|
2760
|
+
});
|
|
2761
|
+
return memory;
|
|
2762
|
+
}
|
|
2763
|
+
var init_memory_tools = () => {};
|
|
2764
|
+
|
|
2765
|
+
// src/schema/json-schema-to-zod.ts
|
|
2766
|
+
import { z as z2 } from "zod";
|
|
2767
|
+
function jsonSchemaToZod(schema) {
|
|
2768
|
+
const s = schema;
|
|
2769
|
+
const makeNullable = (zodSchema) => {
|
|
2770
|
+
return s.nullable ? z2.union([zodSchema, z2.null()]) : zodSchema;
|
|
2771
|
+
};
|
|
2772
|
+
if (s.const !== undefined) {
|
|
2773
|
+
return z2.literal(s.const);
|
|
2774
|
+
}
|
|
2775
|
+
if (s.enum) {
|
|
2776
|
+
const values = s.enum;
|
|
2777
|
+
return makeNullable(z2.enum(values.map(String)));
|
|
2778
|
+
}
|
|
2779
|
+
if (s.anyOf && s.anyOf.length > 0) {
|
|
2780
|
+
const schemas = s.anyOf.map((sub) => jsonSchemaToZod(sub));
|
|
2781
|
+
if (schemas.length === 1)
|
|
2782
|
+
return schemas[0] ?? z2.unknown();
|
|
2783
|
+
return z2.union([
|
|
2784
|
+
schemas[0] ?? z2.unknown(),
|
|
2785
|
+
schemas[1] ?? z2.unknown(),
|
|
2786
|
+
...schemas.slice(2)
|
|
2787
|
+
]);
|
|
2788
|
+
}
|
|
2789
|
+
if (s.oneOf && s.oneOf.length > 0) {
|
|
2790
|
+
const schemas = s.oneOf.map((sub) => jsonSchemaToZod(sub));
|
|
2791
|
+
if (schemas.length === 1)
|
|
2792
|
+
return schemas[0] ?? z2.unknown();
|
|
2793
|
+
return z2.union([
|
|
2794
|
+
schemas[0] ?? z2.unknown(),
|
|
2795
|
+
schemas[1] ?? z2.unknown(),
|
|
2796
|
+
...schemas.slice(2)
|
|
2797
|
+
]);
|
|
2798
|
+
}
|
|
2799
|
+
if (s.allOf && s.allOf.length > 0) {
|
|
2800
|
+
const schemas = s.allOf.map((sub) => jsonSchemaToZod(sub));
|
|
2801
|
+
return schemas.reduce((acc, curr) => z2.intersection(acc, curr));
|
|
2802
|
+
}
|
|
2803
|
+
switch (s.type) {
|
|
2804
|
+
case "string":
|
|
2805
|
+
return makeNullable(buildStringSchema(s));
|
|
2806
|
+
case "number":
|
|
2807
|
+
case "integer":
|
|
2808
|
+
return makeNullable(buildNumberSchema(s));
|
|
2809
|
+
case "boolean":
|
|
2810
|
+
return makeNullable(z2.boolean());
|
|
2811
|
+
case "null":
|
|
2812
|
+
return z2.null();
|
|
2813
|
+
case "array":
|
|
2814
|
+
return makeNullable(buildArraySchema(s));
|
|
2815
|
+
case "object":
|
|
2816
|
+
return makeNullable(buildObjectSchema(s));
|
|
2817
|
+
default:
|
|
2818
|
+
return z2.unknown();
|
|
2819
|
+
}
|
|
2820
|
+
}
|
|
2821
|
+
function buildStringSchema(schema) {
|
|
2822
|
+
let zodSchema = z2.string();
|
|
2823
|
+
if (schema.description) {
|
|
2824
|
+
zodSchema = zodSchema.describe(schema.description);
|
|
2825
|
+
}
|
|
2826
|
+
switch (schema.format) {
|
|
2827
|
+
case "email":
|
|
2828
|
+
zodSchema = zodSchema.email();
|
|
2829
|
+
break;
|
|
2830
|
+
case "uri":
|
|
2831
|
+
case "url":
|
|
2832
|
+
zodSchema = zodSchema.url();
|
|
2833
|
+
break;
|
|
2834
|
+
case "uuid":
|
|
2835
|
+
zodSchema = zodSchema.uuid();
|
|
2836
|
+
break;
|
|
2837
|
+
case "date-time":
|
|
2838
|
+
zodSchema = zodSchema.datetime();
|
|
2839
|
+
break;
|
|
2840
|
+
case "date":
|
|
2841
|
+
zodSchema = zodSchema.date();
|
|
2842
|
+
break;
|
|
2843
|
+
}
|
|
2844
|
+
if (schema.minLength !== undefined) {
|
|
2845
|
+
zodSchema = zodSchema.min(schema.minLength);
|
|
2846
|
+
}
|
|
2847
|
+
if (schema.maxLength !== undefined) {
|
|
2848
|
+
zodSchema = zodSchema.max(schema.maxLength);
|
|
2849
|
+
}
|
|
2850
|
+
if (schema.pattern) {
|
|
2851
|
+
zodSchema = zodSchema.regex(new RegExp(schema.pattern));
|
|
2852
|
+
}
|
|
2853
|
+
return zodSchema;
|
|
2854
|
+
}
|
|
2855
|
+
function buildNumberSchema(schema) {
|
|
2856
|
+
let zodSchema = schema.type === "integer" ? z2.number().int() : z2.number();
|
|
2857
|
+
if (schema.description) {
|
|
2858
|
+
zodSchema = zodSchema.describe(schema.description);
|
|
2859
|
+
}
|
|
2860
|
+
if (schema.minimum !== undefined) {
|
|
2861
|
+
zodSchema = zodSchema.min(schema.minimum);
|
|
2862
|
+
}
|
|
2863
|
+
if (schema.maximum !== undefined) {
|
|
2864
|
+
zodSchema = zodSchema.max(schema.maximum);
|
|
2865
|
+
}
|
|
2866
|
+
return zodSchema;
|
|
2867
|
+
}
|
|
2868
|
+
function buildArraySchema(schema) {
|
|
2869
|
+
const itemsSchema = schema.items ? jsonSchemaToZod(schema.items) : z2.unknown();
|
|
2870
|
+
let zodSchema = z2.array(itemsSchema);
|
|
2871
|
+
if (schema.description) {
|
|
2872
|
+
zodSchema = zodSchema.describe(schema.description);
|
|
2873
|
+
}
|
|
2874
|
+
return zodSchema;
|
|
2875
|
+
}
|
|
2876
|
+
function buildObjectSchema(schema) {
|
|
2877
|
+
const properties = schema.properties ?? {};
|
|
2878
|
+
const required = new Set(schema.required ?? []);
|
|
2879
|
+
const shape = {};
|
|
2880
|
+
for (const [key, propSchema] of Object.entries(properties)) {
|
|
2881
|
+
const zodProp = jsonSchemaToZod(propSchema);
|
|
2882
|
+
shape[key] = required.has(key) ? zodProp : zodProp.optional();
|
|
2883
|
+
}
|
|
2884
|
+
let zodSchema = z2.object(shape);
|
|
2885
|
+
if (schema.description) {
|
|
2886
|
+
zodSchema = zodSchema.describe(schema.description);
|
|
2887
|
+
}
|
|
2888
|
+
return zodSchema;
|
|
2889
|
+
}
|
|
2890
|
+
function jsonSchemaToZodSafe(schema) {
|
|
2891
|
+
if (!schema || Object.keys(schema).length === 0) {
|
|
2892
|
+
return z2.object({});
|
|
2884
2893
|
}
|
|
2885
|
-
|
|
2886
|
-
return instructions;
|
|
2887
|
-
return `${instructions}
|
|
2888
|
-
|
|
2889
|
-
---
|
|
2890
|
-
|
|
2891
|
-
# ${i18n.t("knowledge.header")}
|
|
2892
|
-
|
|
2893
|
-
${i18n.t("knowledge.description")}
|
|
2894
|
-
|
|
2895
|
-
${blocks.join(`
|
|
2896
|
-
|
|
2897
|
-
---
|
|
2898
|
-
|
|
2899
|
-
`)}`;
|
|
2894
|
+
return jsonSchemaToZod(schema);
|
|
2900
2895
|
}
|
|
2901
|
-
|
|
2896
|
+
var init_json_schema_to_zod = () => {};
|
|
2897
|
+
|
|
2898
|
+
// src/tools/operation-tool-handler.ts
|
|
2899
|
+
function toolCtxToHandlerCtx(ctx) {
|
|
2902
2900
|
return {
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2901
|
+
traceId: ctx.metadata?.traceId,
|
|
2902
|
+
organizationId: ctx.tenantId ?? null,
|
|
2903
|
+
userId: ctx.actorId ?? null,
|
|
2904
|
+
actor: ctx.actorId ? "user" : "anonymous",
|
|
2905
|
+
channel: "agent",
|
|
2906
|
+
roles: []
|
|
2907
|
+
};
|
|
2908
|
+
}
|
|
2909
|
+
function createOperationToolHandler(registry, operationRef) {
|
|
2910
|
+
return async (input, context) => {
|
|
2911
|
+
const handlerCtx = toolCtxToHandlerCtx(context);
|
|
2912
|
+
const result = await registry.execute(operationRef.key, operationRef.version, input ?? {}, handlerCtx);
|
|
2913
|
+
return result;
|
|
2906
2914
|
};
|
|
2907
2915
|
}
|
|
2908
|
-
var init_injector = __esm(() => {
|
|
2909
|
-
init_i18n();
|
|
2910
|
-
});
|
|
2911
2916
|
|
|
2912
|
-
// src/
|
|
2913
|
-
|
|
2914
|
-
|
|
2915
|
-
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
constructor(options = {}) {
|
|
2919
|
-
this.maxSessions = options.maxSessions ?? 500;
|
|
2920
|
-
this.maxMessagesPerSession = options.maxMessagesPerSession ?? 200;
|
|
2921
|
-
this.maxStepsPerSession = options.maxStepsPerSession ?? 200;
|
|
2922
|
-
}
|
|
2923
|
-
async get(sessionId) {
|
|
2924
|
-
return this.sessions.get(sessionId) ?? null;
|
|
2925
|
-
}
|
|
2926
|
-
async create(session) {
|
|
2927
|
-
this.evictIfNeeded();
|
|
2928
|
-
const now = new Date;
|
|
2929
|
-
const fullSession = {
|
|
2930
|
-
...session,
|
|
2931
|
-
createdAt: now,
|
|
2932
|
-
updatedAt: now
|
|
2933
|
-
};
|
|
2934
|
-
this.sessions.set(session.sessionId, fullSession);
|
|
2935
|
-
return fullSession;
|
|
2917
|
+
// src/tools/subagent-tool.ts
|
|
2918
|
+
import { readUIMessageStream, tool as tool2 } from "ai";
|
|
2919
|
+
import { z as z3 } from "zod";
|
|
2920
|
+
function toReadableStream(iterable) {
|
|
2921
|
+
if (iterable instanceof ReadableStream) {
|
|
2922
|
+
return iterable;
|
|
2936
2923
|
}
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2924
|
+
return new ReadableStream({
|
|
2925
|
+
async start(controller) {
|
|
2926
|
+
try {
|
|
2927
|
+
for await (const chunk of iterable) {
|
|
2928
|
+
controller.enqueue(chunk);
|
|
2929
|
+
}
|
|
2930
|
+
} finally {
|
|
2931
|
+
controller.close();
|
|
2932
|
+
}
|
|
2943
2933
|
}
|
|
2944
|
-
}
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2934
|
+
});
|
|
2935
|
+
}
|
|
2936
|
+
function createSubagentTool(options) {
|
|
2937
|
+
const {
|
|
2938
|
+
subagent,
|
|
2939
|
+
description = "Research a topic or question in depth.",
|
|
2940
|
+
taskParam = "task",
|
|
2941
|
+
toModelSummary = true,
|
|
2942
|
+
passConversationHistory = false
|
|
2943
|
+
} = options;
|
|
2944
|
+
const inputSchema = z3.object({
|
|
2945
|
+
[taskParam]: z3.string().describe("The research task to complete")
|
|
2946
|
+
});
|
|
2947
|
+
const execute = async function* (input, options2) {
|
|
2948
|
+
const task = String(input[taskParam] ?? input.task ?? "");
|
|
2949
|
+
const { abortSignal, messages } = options2 ?? {};
|
|
2950
|
+
if (passConversationHistory && messages && messages.length > 0 && typeof subagent.generate === "function") {
|
|
2951
|
+
const result2 = await subagent.generate({
|
|
2952
|
+
messages: [...messages, { role: "user", content: task }],
|
|
2953
|
+
abortSignal
|
|
2954
|
+
});
|
|
2955
|
+
yield { parts: [{ type: "text", text: result2.text }] };
|
|
2956
|
+
return;
|
|
2951
2957
|
}
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2958
|
+
const result = await subagent.stream({
|
|
2959
|
+
prompt: task,
|
|
2960
|
+
abortSignal
|
|
2961
|
+
});
|
|
2962
|
+
const uiStream = result.toUIMessageStream();
|
|
2963
|
+
const stream = toReadableStream(uiStream);
|
|
2964
|
+
for await (const message of readUIMessageStream({
|
|
2965
|
+
stream
|
|
2966
|
+
})) {
|
|
2967
|
+
yield message;
|
|
2957
2968
|
}
|
|
2958
|
-
}
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
+
};
|
|
2970
|
+
const toolOptions = {
|
|
2971
|
+
description,
|
|
2972
|
+
inputSchema,
|
|
2973
|
+
execute,
|
|
2974
|
+
...toModelSummary && {
|
|
2975
|
+
toModelOutput: ({
|
|
2976
|
+
output
|
|
2977
|
+
}) => {
|
|
2978
|
+
const parts = output?.parts;
|
|
2979
|
+
if (!Array.isArray(parts)) {
|
|
2980
|
+
return { type: "text", value: "Task completed." };
|
|
2981
|
+
}
|
|
2982
|
+
const lastTextPart = [...parts].reverse().find((p) => p?.type === "text");
|
|
2983
|
+
return {
|
|
2984
|
+
type: "text",
|
|
2985
|
+
value: lastTextPart?.text ?? "Task completed."
|
|
2986
|
+
};
|
|
2969
2987
|
}
|
|
2970
2988
|
}
|
|
2971
|
-
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2989
|
+
};
|
|
2990
|
+
return tool2(toolOptions);
|
|
2991
|
+
}
|
|
2992
|
+
var init_subagent_tool = () => {};
|
|
2993
|
+
|
|
2994
|
+
// src/tools/tool-adapter.ts
|
|
2995
|
+
import { tool as tool3 } from "ai";
|
|
2996
|
+
function isAsyncGenerator(value) {
|
|
2997
|
+
return typeof value === "object" && value !== null && typeof value.next === "function" && typeof value[Symbol.asyncIterator] === "function";
|
|
2998
|
+
}
|
|
2999
|
+
function specToolToAISDKTool(specTool, handler, context = {}, effectiveInputSchema, operationSpec) {
|
|
3000
|
+
let lastInvocationAt;
|
|
3001
|
+
const inputSchema = effectiveInputSchema ?? jsonSchemaToZodSafe(specTool.schema);
|
|
3002
|
+
const buildContext = (signal) => ({
|
|
3003
|
+
agentId: context.agentId ?? "unknown",
|
|
3004
|
+
sessionId: context.sessionId ?? "unknown",
|
|
3005
|
+
tenantId: context.tenantId,
|
|
3006
|
+
actorId: context.actorId,
|
|
3007
|
+
locale: context.locale,
|
|
3008
|
+
metadata: context.metadata,
|
|
3009
|
+
signal
|
|
3010
|
+
});
|
|
3011
|
+
return tool3({
|
|
3012
|
+
description: specTool.description ?? specTool.name,
|
|
3013
|
+
inputSchema,
|
|
3014
|
+
needsApproval: specTool.requiresApproval ?? !specTool.automationSafe,
|
|
3015
|
+
execute: async function* (input, options) {
|
|
3016
|
+
const now = Date.now();
|
|
3017
|
+
const cooldownMs = normalizeDuration(specTool.cooldownMs);
|
|
3018
|
+
if (cooldownMs && lastInvocationAt !== undefined) {
|
|
3019
|
+
const elapsed = now - lastInvocationAt;
|
|
3020
|
+
if (elapsed < cooldownMs) {
|
|
3021
|
+
const retryAfterMs = cooldownMs - elapsed;
|
|
3022
|
+
throw createToolExecutionError(`Tool "${specTool.name}" is cooling down. Retry in ${retryAfterMs}ms.`, "TOOL_COOLDOWN_ACTIVE", retryAfterMs);
|
|
3023
|
+
}
|
|
2980
3024
|
}
|
|
2981
|
-
|
|
2982
|
-
|
|
2983
|
-
|
|
2984
|
-
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
|
|
2988
|
-
|
|
2989
|
-
|
|
2990
|
-
|
|
2991
|
-
|
|
2992
|
-
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
3025
|
+
const timeoutMs = normalizeDuration(specTool.timeoutMs);
|
|
3026
|
+
const signal = options?.abortSignal ?? context.signal;
|
|
3027
|
+
const { signal: timeoutSignal, dispose } = createTimeoutSignal(signal, timeoutMs);
|
|
3028
|
+
try {
|
|
3029
|
+
const execution = handler(input, buildContext(timeoutSignal));
|
|
3030
|
+
if (isAsyncGenerator(execution)) {
|
|
3031
|
+
for await (const raw of execution) {
|
|
3032
|
+
const wrapped = wrapToolOutputForRendering(specTool, raw, operationSpec);
|
|
3033
|
+
yield typeof wrapped === "string" ? wrapped : wrapped;
|
|
3034
|
+
}
|
|
3035
|
+
} else {
|
|
3036
|
+
const raw = timeoutMs ? await withTimeout(Promise.resolve(execution), timeoutMs, specTool.name) : await Promise.resolve(execution);
|
|
3037
|
+
const wrapped = wrapToolOutputForRendering(specTool, raw, operationSpec);
|
|
3038
|
+
yield typeof wrapped === "string" ? wrapped : wrapped;
|
|
3039
|
+
}
|
|
3040
|
+
} finally {
|
|
3041
|
+
dispose();
|
|
3042
|
+
lastInvocationAt = Date.now();
|
|
2998
3043
|
}
|
|
2999
3044
|
}
|
|
3000
|
-
|
|
3001
|
-
|
|
3045
|
+
});
|
|
3046
|
+
}
|
|
3047
|
+
function specToolsToAISDKTools(specTools, handlers, context = {}, options) {
|
|
3048
|
+
const tools = {};
|
|
3049
|
+
for (const specTool of specTools) {
|
|
3050
|
+
if (specTool.subagentRef && options?.subagentRegistry) {
|
|
3051
|
+
const subagent = options.subagentRegistry.get(specTool.subagentRef.agentId);
|
|
3052
|
+
if (!subagent) {
|
|
3053
|
+
throw new Error(`Subagent not found: ${specTool.subagentRef.agentId}. Register it in subagentRegistry.`);
|
|
3054
|
+
}
|
|
3055
|
+
if (specTool.requiresApproval === true || specTool.automationSafe === false) {
|
|
3056
|
+
console.warn(`[ContractSpec] Subagent tool "${specTool.name}" cannot use needsApproval. ` + `requiresApproval and automationSafe are ignored for subagent tools (AI SDK limitation). ` + `See https://ai-sdk.dev/docs/agents/subagents#no-tool-approvals-in-subagents`);
|
|
3057
|
+
}
|
|
3058
|
+
tools[specTool.name] = createSubagentTool({
|
|
3059
|
+
subagent,
|
|
3060
|
+
description: specTool.description ?? specTool.name,
|
|
3061
|
+
toModelSummary: specTool.subagentRef.toModelSummary ?? true,
|
|
3062
|
+
passConversationHistory: specTool.subagentRef.passConversationHistory
|
|
3063
|
+
});
|
|
3064
|
+
continue;
|
|
3002
3065
|
}
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
|
|
3066
|
+
let handler;
|
|
3067
|
+
let effectiveInputSchema;
|
|
3068
|
+
let op;
|
|
3069
|
+
if (specTool.operationRef && options?.operationRegistry) {
|
|
3070
|
+
op = options.operationRegistry.get(specTool.operationRef.key, specTool.operationRef.version);
|
|
3071
|
+
if (!op) {
|
|
3072
|
+
throw new Error(`Operation not found: ${specTool.operationRef.key}${specTool.operationRef.version ? `.v${specTool.operationRef.version}` : ""}`);
|
|
3073
|
+
}
|
|
3074
|
+
handler = createOperationToolHandler(options.operationRegistry, specTool.operationRef);
|
|
3075
|
+
effectiveInputSchema = op.io.input?.getZod?.();
|
|
3076
|
+
} else {
|
|
3077
|
+
const manualHandler = handlers.get(specTool.name);
|
|
3078
|
+
if (!manualHandler) {
|
|
3079
|
+
if (specTool.subagentRef) {
|
|
3080
|
+
throw new Error(`Subagent tool "${specTool.name}" requires subagentRegistry. Pass subagentRegistry in ContractSpecAgentConfig.`);
|
|
3081
|
+
}
|
|
3082
|
+
throw new Error(createAgentI18n(context.locale).t("error.missingToolHandler", {
|
|
3083
|
+
name: specTool.name
|
|
3084
|
+
}));
|
|
3085
|
+
}
|
|
3086
|
+
handler = manualHandler;
|
|
3007
3087
|
}
|
|
3008
|
-
|
|
3009
|
-
items.splice(0, overflow);
|
|
3088
|
+
tools[specTool.name] = specToolToAISDKTool(specTool, handler, context, effectiveInputSchema, op);
|
|
3010
3089
|
}
|
|
3090
|
+
return tools;
|
|
3011
3091
|
}
|
|
3012
|
-
function
|
|
3013
|
-
return
|
|
3092
|
+
function createToolHandler(handler) {
|
|
3093
|
+
return (input, context) => {
|
|
3094
|
+
return handler(input, context);
|
|
3095
|
+
};
|
|
3014
3096
|
}
|
|
3015
|
-
function
|
|
3016
|
-
return
|
|
3097
|
+
function buildToolHandlers(handlersObj) {
|
|
3098
|
+
return new Map(Object.entries(handlersObj));
|
|
3017
3099
|
}
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
const
|
|
3022
|
-
if (
|
|
3023
|
-
return {
|
|
3100
|
+
function wrapToolOutputForRendering(specTool, result, operationSpec) {
|
|
3101
|
+
const presentation = specTool.outputPresentation ?? operationSpec?.outputPresentation;
|
|
3102
|
+
const form = specTool.outputForm ?? operationSpec?.outputForm;
|
|
3103
|
+
const dataView = specTool.outputDataView ?? operationSpec?.outputDataView;
|
|
3104
|
+
if (presentation) {
|
|
3105
|
+
return {
|
|
3106
|
+
presentationKey: presentation.key,
|
|
3107
|
+
data: result
|
|
3108
|
+
};
|
|
3024
3109
|
}
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
}
|
|
3030
|
-
function getStepResponse(step) {
|
|
3031
|
-
const response = getRecord(step.response);
|
|
3032
|
-
if (!response)
|
|
3033
|
-
return;
|
|
3034
|
-
return {
|
|
3035
|
-
id: response["id"],
|
|
3036
|
-
modelId: response["modelId"],
|
|
3037
|
-
timestamp: response["timestamp"],
|
|
3038
|
-
headers: response["headers"],
|
|
3039
|
-
body: response["body"],
|
|
3040
|
-
messages: response["messages"]
|
|
3041
|
-
};
|
|
3042
|
-
}
|
|
3043
|
-
function getRequestBodyValue(request, key) {
|
|
3044
|
-
const body = request?.["body"];
|
|
3045
|
-
if (!body)
|
|
3046
|
-
return;
|
|
3047
|
-
if (typeof body === "string") {
|
|
3048
|
-
try {
|
|
3049
|
-
const parsed = JSON.parse(body);
|
|
3050
|
-
return typeof parsed[key] === "string" ? parsed[key] : undefined;
|
|
3051
|
-
} catch {
|
|
3052
|
-
return;
|
|
3053
|
-
}
|
|
3110
|
+
if (form) {
|
|
3111
|
+
return {
|
|
3112
|
+
formKey: form.key,
|
|
3113
|
+
defaultValues: typeof result === "object" && result !== null ? result : {}
|
|
3114
|
+
};
|
|
3054
3115
|
}
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
|
|
3058
|
-
|
|
3059
|
-
const { name, version } = parseAgentId(agentId);
|
|
3060
|
-
const response = getStepResponse(step);
|
|
3061
|
-
const providerMetadata = step.providerMetadata;
|
|
3062
|
-
const warnings = step.warnings;
|
|
3063
|
-
const rawFinishReason = step.rawFinishReason;
|
|
3064
|
-
const request = getRecord(step.request);
|
|
3065
|
-
const traceId = context?.traceId ?? getRequestBodyValue(request, "$ai_trace_id");
|
|
3066
|
-
const sessionId = context?.sessionId ?? getRequestBodyValue(request, "$ai_session_id");
|
|
3067
|
-
const parentSpanId = response?.id;
|
|
3068
|
-
for (const toolCall of step.toolCalls ?? []) {
|
|
3069
|
-
const toolResult = step.toolResults?.find((r) => r.toolCallId === toolCall.toolCallId);
|
|
3070
|
-
const toolError = getRecord(toolResult?.output)?.["error"];
|
|
3071
|
-
const toolSample = {
|
|
3072
|
-
operation: { name: `${name}.${toolCall.toolName}`, version },
|
|
3073
|
-
durationMs: durationMs ?? 0,
|
|
3074
|
-
success: step.toolResults?.some((r) => r.toolCallId === toolCall.toolCallId && r.output !== undefined) ?? false,
|
|
3075
|
-
timestamp: new Date,
|
|
3076
|
-
metadata: {
|
|
3077
|
-
telemetryEvent: "span",
|
|
3078
|
-
traceId,
|
|
3079
|
-
sessionId,
|
|
3080
|
-
spanId: toolCall.toolCallId,
|
|
3081
|
-
parentSpanId,
|
|
3082
|
-
spanName: `tool.${toolCall.toolName}`,
|
|
3083
|
-
agentId,
|
|
3084
|
-
actorId: context?.actorId,
|
|
3085
|
-
tenantId: context?.tenantId,
|
|
3086
|
-
stepIndex: context?.stepIndex,
|
|
3087
|
-
toolName: toolCall.toolName,
|
|
3088
|
-
toolCallArgs: toolCall.input,
|
|
3089
|
-
toolResultOutput: toolResult?.output,
|
|
3090
|
-
errorMessage: typeof toolError === "string" ? toolError : typeof toolResult?.output === "string" ? toolResult.output : undefined,
|
|
3091
|
-
finishReason: step.finishReason,
|
|
3092
|
-
rawFinishReason
|
|
3093
|
-
}
|
|
3116
|
+
if (dataView) {
|
|
3117
|
+
return {
|
|
3118
|
+
dataViewKey: dataView.key,
|
|
3119
|
+
items: Array.isArray(result) ? result : result != null ? [result] : []
|
|
3094
3120
|
};
|
|
3095
|
-
await collector.collect(toolSample);
|
|
3096
3121
|
}
|
|
3097
|
-
|
|
3098
|
-
operation: { name, version },
|
|
3099
|
-
durationMs: durationMs ?? 0,
|
|
3100
|
-
success: step.finishReason !== "error",
|
|
3101
|
-
timestamp: new Date,
|
|
3102
|
-
metadata: {
|
|
3103
|
-
telemetryEvent: "generation",
|
|
3104
|
-
traceId,
|
|
3105
|
-
sessionId,
|
|
3106
|
-
spanId: response?.id,
|
|
3107
|
-
spanName: `agent.${name}.step`,
|
|
3108
|
-
agentId,
|
|
3109
|
-
actorId: context?.actorId,
|
|
3110
|
-
tenantId: context?.tenantId,
|
|
3111
|
-
stepIndex: context?.stepIndex,
|
|
3112
|
-
stepStartedAt: context?.stepStartedAt,
|
|
3113
|
-
finishReason: step.finishReason,
|
|
3114
|
-
rawFinishReason,
|
|
3115
|
-
tokenUsage: step.usage,
|
|
3116
|
-
totalUsage: step.totalUsage,
|
|
3117
|
-
providerMetadata,
|
|
3118
|
-
warnings,
|
|
3119
|
-
stepText: step.text,
|
|
3120
|
-
stepReasoningText: step.reasoningText,
|
|
3121
|
-
responseId: response?.id,
|
|
3122
|
-
responseModelId: response?.modelId,
|
|
3123
|
-
responseTimestamp: response?.timestamp,
|
|
3124
|
-
responseHeaders: response?.headers,
|
|
3125
|
-
responseBody: response?.body,
|
|
3126
|
-
responseMessages: response?.messages,
|
|
3127
|
-
requestBody: request?.["body"],
|
|
3128
|
-
requestHeaders: request?.["headers"],
|
|
3129
|
-
toolCallCount: step.toolCalls?.length ?? 0,
|
|
3130
|
-
toolCalls: step.toolCalls,
|
|
3131
|
-
toolResults: step.toolResults,
|
|
3132
|
-
errorMessage: step.finishReason === "error" ? step.text : undefined
|
|
3133
|
-
}
|
|
3134
|
-
};
|
|
3135
|
-
await collector.collect(stepSample);
|
|
3122
|
+
return result;
|
|
3136
3123
|
}
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
async collect(sample) {
|
|
3141
|
-
this.samples.push(sample);
|
|
3142
|
-
}
|
|
3143
|
-
getSamples() {
|
|
3144
|
-
return [...this.samples];
|
|
3124
|
+
function normalizeDuration(value) {
|
|
3125
|
+
if (value === undefined) {
|
|
3126
|
+
return;
|
|
3145
3127
|
}
|
|
3146
|
-
|
|
3147
|
-
return
|
|
3128
|
+
if (!Number.isFinite(value)) {
|
|
3129
|
+
return;
|
|
3148
3130
|
}
|
|
3149
|
-
|
|
3150
|
-
|
|
3131
|
+
if (value <= 0) {
|
|
3132
|
+
return;
|
|
3151
3133
|
}
|
|
3134
|
+
return Math.round(value);
|
|
3152
3135
|
}
|
|
3153
|
-
function
|
|
3154
|
-
return new
|
|
3136
|
+
function withTimeout(execution, timeoutMs, toolName) {
|
|
3137
|
+
return new Promise((resolve, reject) => {
|
|
3138
|
+
const timeoutHandle = setTimeout(() => {
|
|
3139
|
+
reject(createToolExecutionError(`Tool "${toolName}" timed out after ${timeoutMs}ms.`, "TOOL_EXECUTION_TIMEOUT"));
|
|
3140
|
+
}, timeoutMs);
|
|
3141
|
+
execution.then((result) => {
|
|
3142
|
+
clearTimeout(timeoutHandle);
|
|
3143
|
+
resolve(result);
|
|
3144
|
+
}).catch((error) => {
|
|
3145
|
+
clearTimeout(timeoutHandle);
|
|
3146
|
+
reject(error);
|
|
3147
|
+
});
|
|
3148
|
+
});
|
|
3155
3149
|
}
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3150
|
+
function createTimeoutSignal(signal, timeoutMs) {
|
|
3151
|
+
const controller = new AbortController;
|
|
3152
|
+
const abortFromSource = () => controller.abort();
|
|
3153
|
+
if (signal) {
|
|
3154
|
+
if (signal.aborted) {
|
|
3155
|
+
controller.abort();
|
|
3156
|
+
} else {
|
|
3157
|
+
signal.addEventListener("abort", abortFromSource);
|
|
3158
|
+
}
|
|
3159
|
+
}
|
|
3160
|
+
const timeoutHandle = timeoutMs !== undefined ? setTimeout(() => {
|
|
3161
|
+
controller.abort();
|
|
3162
|
+
}, timeoutMs) : undefined;
|
|
3163
|
+
return {
|
|
3164
|
+
signal: controller.signal,
|
|
3165
|
+
dispose: () => {
|
|
3166
|
+
if (timeoutHandle !== undefined) {
|
|
3167
|
+
clearTimeout(timeoutHandle);
|
|
3168
|
+
}
|
|
3169
|
+
if (signal) {
|
|
3170
|
+
signal.removeEventListener("abort", abortFromSource);
|
|
3171
|
+
}
|
|
3172
|
+
}
|
|
3160
3173
|
};
|
|
3174
|
+
}
|
|
3175
|
+
function createToolExecutionError(message, code, retryAfterMs) {
|
|
3176
|
+
return Object.assign(new Error(message), {
|
|
3177
|
+
code,
|
|
3178
|
+
kind: "retryable",
|
|
3179
|
+
retryAfterMs
|
|
3180
|
+
});
|
|
3181
|
+
}
|
|
3182
|
+
var init_tool_adapter = __esm(() => {
|
|
3183
|
+
init_i18n();
|
|
3184
|
+
init_json_schema_to_zod();
|
|
3185
|
+
init_subagent_tool();
|
|
3161
3186
|
});
|
|
3162
3187
|
|
|
3163
3188
|
// src/telemetry/posthog.ts
|
|
@@ -3282,7 +3307,7 @@ function createCompositeTelemetryCollector(collectors) {
|
|
|
3282
3307
|
}
|
|
3283
3308
|
async function importPostHogAI() {
|
|
3284
3309
|
try {
|
|
3285
|
-
return await
|
|
3310
|
+
return await runtimeImport("@posthog/ai");
|
|
3286
3311
|
} catch {
|
|
3287
3312
|
throw new Error(createAgentI18n().t("error.telemetry.posthogAiRequired"));
|
|
3288
3313
|
}
|
|
@@ -3294,7 +3319,7 @@ async function resolvePostHogClient(config) {
|
|
|
3294
3319
|
throw new Error(createAgentI18n().t("error.telemetry.posthogClientOrKeyRequired"));
|
|
3295
3320
|
}
|
|
3296
3321
|
try {
|
|
3297
|
-
const { PostHog } = await
|
|
3322
|
+
const { PostHog } = await runtimeImport("posthog-node");
|
|
3298
3323
|
return new PostHog(config.apiKey, {
|
|
3299
3324
|
host: config.host ?? "https://us.i.posthog.com"
|
|
3300
3325
|
});
|
|
@@ -3341,8 +3366,10 @@ function asDateIso(value) {
|
|
|
3341
3366
|
return value.toISOString();
|
|
3342
3367
|
return;
|
|
3343
3368
|
}
|
|
3369
|
+
var runtimeImport;
|
|
3344
3370
|
var init_posthog = __esm(() => {
|
|
3345
3371
|
init_i18n();
|
|
3372
|
+
runtimeImport = new Function("specifier", "return import(specifier)");
|
|
3346
3373
|
});
|
|
3347
3374
|
|
|
3348
3375
|
// src/agent/contract-spec-agent.ts
|
|
@@ -3350,11 +3377,11 @@ var exports_contract_spec_agent = {};
|
|
|
3350
3377
|
__export(exports_contract_spec_agent, {
|
|
3351
3378
|
ContractSpecAgent: () => ContractSpecAgent
|
|
3352
3379
|
});
|
|
3380
|
+
import { randomUUID } from "node:crypto";
|
|
3353
3381
|
import {
|
|
3354
|
-
|
|
3355
|
-
|
|
3382
|
+
stepCountIs,
|
|
3383
|
+
Experimental_Agent as ToolLoopAgent
|
|
3356
3384
|
} from "ai";
|
|
3357
|
-
import { randomUUID } from "node:crypto";
|
|
3358
3385
|
import * as z4 from "zod";
|
|
3359
3386
|
|
|
3360
3387
|
class ContractSpecAgent {
|
|
@@ -3706,13 +3733,13 @@ function resolveEscalationError(spec, finishReason) {
|
|
|
3706
3733
|
}
|
|
3707
3734
|
var ContractSpecCallOptionsSchema;
|
|
3708
3735
|
var init_contract_spec_agent = __esm(() => {
|
|
3736
|
+
init_injector();
|
|
3709
3737
|
init_spec();
|
|
3710
|
-
|
|
3738
|
+
init_adapter();
|
|
3711
3739
|
init_knowledge_tool();
|
|
3712
|
-
init_memory_tools();
|
|
3713
3740
|
init_mcp_client();
|
|
3714
|
-
|
|
3715
|
-
|
|
3741
|
+
init_memory_tools();
|
|
3742
|
+
init_tool_adapter();
|
|
3716
3743
|
ContractSpecCallOptionsSchema = z4.object({
|
|
3717
3744
|
tenantId: z4.string().optional(),
|
|
3718
3745
|
actorId: z4.string().optional(),
|