@contractspec/lib.ai-agent 1.60.0 → 1.62.0
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/dist/agent/agent-factory.d.ts +5 -0
- package/dist/agent/agent-factory.d.ts.map +1 -1
- package/dist/agent/agent-factory.js +2256 -29
- package/dist/agent/contract-spec-agent.d.ts +6 -0
- package/dist/agent/contract-spec-agent.d.ts.map +1 -1
- package/dist/agent/contract-spec-agent.js +2255 -29
- package/dist/agent/index.js +2369 -87
- package/dist/agent/json-runner.d.ts +1 -0
- package/dist/agent/json-runner.d.ts.map +1 -1
- package/dist/agent/json-runner.js +2288 -54
- package/dist/agent/unified-agent.d.ts.map +1 -1
- package/dist/agent/unified-agent.js +2336 -62
- package/dist/approval/index.js +2095 -1
- package/dist/approval/workflow.d.ts.map +1 -1
- package/dist/approval/workflow.js +2095 -1
- package/dist/exporters/claude-agent-exporter.d.ts.map +1 -1
- package/dist/exporters/claude-agent-exporter.js +2144 -35
- package/dist/exporters/index.js +2193 -69
- package/dist/exporters/opencode-exporter.d.ts.map +1 -1
- package/dist/exporters/opencode-exporter.js +2152 -39
- package/dist/i18n/catalogs/en.d.ts +9 -0
- package/dist/i18n/catalogs/en.d.ts.map +1 -0
- package/dist/i18n/catalogs/en.js +614 -0
- package/dist/i18n/catalogs/es.d.ts +9 -0
- package/dist/i18n/catalogs/es.d.ts.map +1 -0
- package/dist/i18n/catalogs/es.js +663 -0
- package/dist/i18n/catalogs/fr.d.ts +9 -0
- package/dist/i18n/catalogs/fr.d.ts.map +1 -0
- package/dist/i18n/catalogs/fr.js +629 -0
- package/dist/i18n/catalogs/index.d.ts +9 -0
- package/dist/i18n/catalogs/index.d.ts.map +1 -0
- package/dist/i18n/catalogs/index.js +1875 -0
- package/dist/i18n/i18n.test.d.ts +2 -0
- package/dist/i18n/i18n.test.d.ts.map +1 -0
- package/dist/i18n/index.d.ts +30 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +2127 -0
- package/dist/i18n/keys.d.ts +553 -0
- package/dist/i18n/keys.d.ts.map +1 -0
- package/dist/i18n/keys.js +188 -0
- package/dist/i18n/locale.d.ts +34 -0
- package/dist/i18n/locale.d.ts.map +1 -0
- package/dist/i18n/locale.js +41 -0
- package/dist/i18n/messages.d.ts +66 -0
- package/dist/i18n/messages.d.ts.map +1 -0
- package/dist/i18n/messages.js +1939 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2556 -187
- package/dist/interop/index.js +2182 -47
- package/dist/interop/spec-consumer.d.ts.map +1 -1
- package/dist/interop/spec-consumer.js +2151 -34
- package/dist/interop/tool-consumer.d.ts.map +1 -1
- package/dist/interop/tool-consumer.js +2122 -13
- package/dist/knowledge/index.js +2105 -7
- package/dist/knowledge/injector.d.ts +2 -2
- package/dist/knowledge/injector.d.ts.map +1 -1
- package/dist/knowledge/injector.js +2104 -7
- package/dist/node/agent/agent-factory.js +2256 -29
- package/dist/node/agent/contract-spec-agent.js +2255 -29
- package/dist/node/agent/index.js +2369 -87
- package/dist/node/agent/json-runner.js +2288 -54
- package/dist/node/agent/unified-agent.js +2336 -62
- package/dist/node/approval/index.js +2095 -1
- package/dist/node/approval/workflow.js +2095 -1
- package/dist/node/exporters/claude-agent-exporter.js +2144 -35
- package/dist/node/exporters/index.js +2193 -69
- package/dist/node/exporters/opencode-exporter.js +2152 -39
- package/dist/node/i18n/catalogs/en.js +614 -0
- package/dist/node/i18n/catalogs/es.js +663 -0
- package/dist/node/i18n/catalogs/fr.js +629 -0
- package/dist/node/i18n/catalogs/index.js +1875 -0
- package/dist/node/i18n/index.js +2127 -0
- package/dist/node/i18n/keys.js +188 -0
- package/dist/node/i18n/locale.js +41 -0
- package/dist/node/i18n/messages.js +1939 -0
- package/dist/node/index.js +2556 -187
- package/dist/node/interop/index.js +2182 -47
- package/dist/node/interop/spec-consumer.js +2151 -34
- package/dist/node/interop/tool-consumer.js +2122 -13
- package/dist/node/knowledge/index.js +2105 -7
- package/dist/node/knowledge/injector.js +2104 -7
- package/dist/node/providers/claude-agent-sdk/adapter.js +2143 -22
- package/dist/node/providers/claude-agent-sdk/index.js +2144 -22
- package/dist/node/providers/claude-agent-sdk/tool-bridge.js +2101 -3
- package/dist/node/providers/index.js +2182 -39
- package/dist/node/providers/opencode-sdk/adapter.js +2148 -27
- package/dist/node/providers/opencode-sdk/agent-bridge.js +2110 -10
- package/dist/node/providers/opencode-sdk/index.js +2149 -27
- package/dist/node/providers/opencode-sdk/tool-bridge.js +2101 -3
- package/dist/node/providers/registry.js +2094 -2
- package/dist/node/spec/index.js +2110 -6
- package/dist/node/spec/registry.js +2095 -1
- package/dist/node/spec/spec.js +2105 -5
- package/dist/node/telemetry/index.js +117 -1
- package/dist/node/telemetry/posthog-types.js +0 -0
- package/dist/node/telemetry/posthog.js +132 -0
- package/dist/node/tools/index.js +2117 -17
- package/dist/node/tools/knowledge-tool.js +2105 -11
- package/dist/node/tools/mcp-server.js +2101 -5
- package/dist/node/tools/tool-adapter.js +2093 -1
- package/dist/providers/claude-agent-sdk/adapter.d.ts.map +1 -1
- package/dist/providers/claude-agent-sdk/adapter.js +2143 -22
- package/dist/providers/claude-agent-sdk/index.js +2144 -22
- package/dist/providers/claude-agent-sdk/tool-bridge.d.ts.map +1 -1
- package/dist/providers/claude-agent-sdk/tool-bridge.js +2101 -3
- package/dist/providers/index.js +2182 -39
- package/dist/providers/opencode-sdk/adapter.d.ts.map +1 -1
- package/dist/providers/opencode-sdk/adapter.js +2148 -27
- package/dist/providers/opencode-sdk/agent-bridge.d.ts.map +1 -1
- package/dist/providers/opencode-sdk/agent-bridge.js +2110 -10
- package/dist/providers/opencode-sdk/index.js +2149 -27
- package/dist/providers/opencode-sdk/tool-bridge.d.ts.map +1 -1
- package/dist/providers/opencode-sdk/tool-bridge.js +2101 -3
- package/dist/providers/registry.d.ts.map +1 -1
- package/dist/providers/registry.js +2094 -2
- package/dist/spec/index.js +2110 -6
- package/dist/spec/registry.d.ts.map +1 -1
- package/dist/spec/registry.js +2095 -1
- package/dist/spec/spec.d.ts +2 -0
- package/dist/spec/spec.d.ts.map +1 -1
- package/dist/spec/spec.js +2105 -5
- package/dist/telemetry/index.d.ts +2 -0
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +117 -1
- package/dist/telemetry/posthog-types.d.ts +60 -0
- package/dist/telemetry/posthog-types.d.ts.map +1 -0
- package/dist/telemetry/posthog-types.js +1 -0
- package/dist/telemetry/posthog.d.ts +81 -0
- package/dist/telemetry/posthog.d.ts.map +1 -0
- package/dist/telemetry/posthog.js +132 -0
- package/dist/telemetry/posthog.test.d.ts +2 -0
- package/dist/telemetry/posthog.test.d.ts.map +1 -0
- package/dist/tools/index.js +2117 -17
- package/dist/tools/knowledge-tool.d.ts +1 -1
- package/dist/tools/knowledge-tool.d.ts.map +1 -1
- package/dist/tools/knowledge-tool.js +2105 -11
- package/dist/tools/mcp-server.d.ts.map +1 -1
- package/dist/tools/mcp-server.js +2101 -5
- package/dist/tools/tool-adapter.d.ts.map +1 -1
- package/dist/tools/tool-adapter.js +2093 -1
- package/dist/types.d.ts +4 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +290 -137
package/dist/node/agent/index.js
CHANGED
|
@@ -12,24 +12,2119 @@ var __export = (target, all) => {
|
|
|
12
12
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
13
13
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
14
14
|
|
|
15
|
+
// src/i18n/catalogs/en.ts
|
|
16
|
+
import { defineTranslation } from "@contractspec/lib.contracts/translations";
|
|
17
|
+
var enMessages;
|
|
18
|
+
var init_en = __esm(() => {
|
|
19
|
+
enMessages = defineTranslation({
|
|
20
|
+
meta: {
|
|
21
|
+
key: "ai-agent.messages",
|
|
22
|
+
version: "1.0.0",
|
|
23
|
+
domain: "ai-agent",
|
|
24
|
+
description: "All user-facing, LLM-facing, and developer-facing strings for the ai-agent package",
|
|
25
|
+
owners: ["platform"],
|
|
26
|
+
stability: "experimental"
|
|
27
|
+
},
|
|
28
|
+
locale: "en",
|
|
29
|
+
fallback: "en",
|
|
30
|
+
messages: {
|
|
31
|
+
"agent.json.rules.validJsonOnly": {
|
|
32
|
+
value: "You MUST output valid JSON ONLY.",
|
|
33
|
+
description: "JSON runner rule: output must be valid JSON"
|
|
34
|
+
},
|
|
35
|
+
"agent.json.rules.noMarkdownFences": {
|
|
36
|
+
value: "Do not wrap the output in markdown fences.",
|
|
37
|
+
description: "JSON runner rule: no markdown code fences"
|
|
38
|
+
},
|
|
39
|
+
"agent.json.rules.noCommentary": {
|
|
40
|
+
value: "Do not include commentary or explanation.",
|
|
41
|
+
description: "JSON runner rule: no extra text"
|
|
42
|
+
},
|
|
43
|
+
"agent.json.rules.doubleQuotes": {
|
|
44
|
+
value: "Use double quotes for all keys and string values.",
|
|
45
|
+
description: "JSON runner rule: double quotes only"
|
|
46
|
+
},
|
|
47
|
+
"agent.json.rules.noTrailingCommas": {
|
|
48
|
+
value: "Do not include trailing commas.",
|
|
49
|
+
description: "JSON runner rule: no trailing commas"
|
|
50
|
+
},
|
|
51
|
+
"agent.json.defaultDescription": {
|
|
52
|
+
value: "JSON-only agent runner for deterministic pipelines.",
|
|
53
|
+
description: "Default description for the JSON runner spec"
|
|
54
|
+
},
|
|
55
|
+
"agent.json.systemPrompt": {
|
|
56
|
+
value: "You are a precise JSON generator.",
|
|
57
|
+
description: "Default system prompt for the JSON runner"
|
|
58
|
+
},
|
|
59
|
+
"knowledge.header": {
|
|
60
|
+
value: "# Reference Knowledge",
|
|
61
|
+
description: "Header for injected knowledge section in system prompt"
|
|
62
|
+
},
|
|
63
|
+
"knowledge.description": {
|
|
64
|
+
value: "The following information is provided for your reference. Use it to inform your responses.",
|
|
65
|
+
description: "Description below the knowledge header"
|
|
66
|
+
},
|
|
67
|
+
"tool.knowledge.description": {
|
|
68
|
+
value: "Query knowledge bases for relevant information. Use this tool when you need to look up specific information that may not be in your context.",
|
|
69
|
+
description: "Description for the knowledge query tool shown to the LLM"
|
|
70
|
+
},
|
|
71
|
+
"tool.knowledge.availableSpaces": {
|
|
72
|
+
value: "Available knowledge spaces:",
|
|
73
|
+
description: "Label before listing available knowledge spaces"
|
|
74
|
+
},
|
|
75
|
+
"tool.knowledge.spaceDefault": {
|
|
76
|
+
value: "Knowledge space",
|
|
77
|
+
description: "Fallback description for unnamed knowledge spaces"
|
|
78
|
+
},
|
|
79
|
+
"tool.knowledge.param.query": {
|
|
80
|
+
value: "The question or search query to find relevant information",
|
|
81
|
+
description: "Parameter description for the query field"
|
|
82
|
+
},
|
|
83
|
+
"tool.knowledge.param.spaceKey": {
|
|
84
|
+
value: "Specific knowledge space to query. If omitted, searches all available spaces.",
|
|
85
|
+
description: "Parameter description for the spaceKey field"
|
|
86
|
+
},
|
|
87
|
+
"tool.knowledge.param.topK": {
|
|
88
|
+
value: "Maximum number of results to return",
|
|
89
|
+
description: "Parameter description for the topK field"
|
|
90
|
+
},
|
|
91
|
+
"tool.knowledge.noResults": {
|
|
92
|
+
value: "No relevant information found in the knowledge bases.",
|
|
93
|
+
description: "Message when no knowledge results are found"
|
|
94
|
+
},
|
|
95
|
+
"tool.knowledge.sourceLabel": {
|
|
96
|
+
value: "[Source {index} - {space}] (relevance: {score}%)",
|
|
97
|
+
description: "Label for each knowledge search result",
|
|
98
|
+
placeholders: [
|
|
99
|
+
{ name: "index", type: "number", description: "1-based source index" },
|
|
100
|
+
{ name: "space", type: "string", description: "Knowledge space name" },
|
|
101
|
+
{ name: "score", type: "number", description: "Relevance percentage" }
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
"tool.fallbackDescription": {
|
|
105
|
+
value: "Execute {name}",
|
|
106
|
+
description: "Fallback description when a tool has no explicit description",
|
|
107
|
+
placeholders: [
|
|
108
|
+
{ name: "name", type: "string", description: "Tool name" }
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"tool.mcp.param.message": {
|
|
112
|
+
value: "The message or query to send to the agent",
|
|
113
|
+
description: "MCP server: message parameter description"
|
|
114
|
+
},
|
|
115
|
+
"tool.mcp.param.sessionId": {
|
|
116
|
+
value: "Optional session ID to continue a conversation",
|
|
117
|
+
description: "MCP server: sessionId parameter description"
|
|
118
|
+
},
|
|
119
|
+
"tool.mcp.agentDescription": {
|
|
120
|
+
value: "Interact with {key} agent",
|
|
121
|
+
description: "MCP server: agent tool description",
|
|
122
|
+
placeholders: [
|
|
123
|
+
{ name: "key", type: "string", description: "Agent spec key" }
|
|
124
|
+
]
|
|
125
|
+
},
|
|
126
|
+
"tool.mcp.executePrompt": {
|
|
127
|
+
value: "Execute the {name} tool with the following arguments: {args}",
|
|
128
|
+
description: "MCP server: prompt sent when executing an individual tool",
|
|
129
|
+
placeholders: [
|
|
130
|
+
{ name: "name", type: "string", description: "Tool name" },
|
|
131
|
+
{
|
|
132
|
+
name: "args",
|
|
133
|
+
type: "string",
|
|
134
|
+
description: "JSON-stringified arguments"
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"tool.mcp.toolDescription": {
|
|
139
|
+
value: "Execute {name} tool",
|
|
140
|
+
description: "MCP server: individual tool description",
|
|
141
|
+
placeholders: [
|
|
142
|
+
{ name: "name", type: "string", description: "Tool name" }
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
"interop.prompt.agentIdentity": {
|
|
146
|
+
value: "# Agent Identity",
|
|
147
|
+
description: "Section header for agent identity in LLM prompt"
|
|
148
|
+
},
|
|
149
|
+
"interop.prompt.youAre": {
|
|
150
|
+
value: "You are {key} (v{version}).",
|
|
151
|
+
description: "Agent identity statement in LLM prompt",
|
|
152
|
+
placeholders: [
|
|
153
|
+
{ name: "key", type: "string" },
|
|
154
|
+
{ name: "version", type: "string" }
|
|
155
|
+
]
|
|
156
|
+
},
|
|
157
|
+
"interop.prompt.description": {
|
|
158
|
+
value: "## Description",
|
|
159
|
+
description: "Section header for description"
|
|
160
|
+
},
|
|
161
|
+
"interop.prompt.instructions": {
|
|
162
|
+
value: "## Instructions",
|
|
163
|
+
description: "Section header for instructions"
|
|
164
|
+
},
|
|
165
|
+
"interop.prompt.availableTools": {
|
|
166
|
+
value: "## Available Tools",
|
|
167
|
+
description: "Section header for available tools"
|
|
168
|
+
},
|
|
169
|
+
"interop.prompt.toolsIntro": {
|
|
170
|
+
value: "You have access to the following tools:",
|
|
171
|
+
description: "Introduction before listing tools"
|
|
172
|
+
},
|
|
173
|
+
"interop.prompt.parameters": {
|
|
174
|
+
value: "Parameters:",
|
|
175
|
+
description: "Label before tool parameters block"
|
|
176
|
+
},
|
|
177
|
+
"interop.prompt.knowledgeContext": {
|
|
178
|
+
value: "## Knowledge Context",
|
|
179
|
+
description: "Section header for knowledge context"
|
|
180
|
+
},
|
|
181
|
+
"interop.prompt.additionalContext": {
|
|
182
|
+
value: "## Additional Context",
|
|
183
|
+
description: "Section header for additional context"
|
|
184
|
+
},
|
|
185
|
+
"interop.md.toc": {
|
|
186
|
+
value: "## Table of Contents",
|
|
187
|
+
description: "TOC header"
|
|
188
|
+
},
|
|
189
|
+
"interop.md.overview": {
|
|
190
|
+
value: "## Overview",
|
|
191
|
+
description: "Overview header"
|
|
192
|
+
},
|
|
193
|
+
"interop.md.tools": { value: "## Tools", description: "Tools header" },
|
|
194
|
+
"interop.md.knowledge": {
|
|
195
|
+
value: "## Knowledge",
|
|
196
|
+
description: "Knowledge header"
|
|
197
|
+
},
|
|
198
|
+
"interop.md.policy": { value: "## Policy", description: "Policy header" },
|
|
199
|
+
"interop.md.metaKey": {
|
|
200
|
+
value: "- **Key**: `{key}`",
|
|
201
|
+
description: "Metadata line for key",
|
|
202
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
203
|
+
},
|
|
204
|
+
"interop.md.metaVersion": {
|
|
205
|
+
value: "- **Version**: {version}",
|
|
206
|
+
description: "Metadata line for version",
|
|
207
|
+
placeholders: [{ name: "version", type: "string" }]
|
|
208
|
+
},
|
|
209
|
+
"interop.md.metaStability": {
|
|
210
|
+
value: "- **Stability**: {stability}",
|
|
211
|
+
description: "Metadata line for stability",
|
|
212
|
+
placeholders: [{ name: "stability", type: "string" }]
|
|
213
|
+
},
|
|
214
|
+
"interop.md.metaOwners": {
|
|
215
|
+
value: "- **Owners**: {owners}",
|
|
216
|
+
description: "Metadata line for owners",
|
|
217
|
+
placeholders: [{ name: "owners", type: "string" }]
|
|
218
|
+
},
|
|
219
|
+
"interop.md.metaTags": {
|
|
220
|
+
value: "- **Tags**: {tags}",
|
|
221
|
+
description: "Metadata line for tags",
|
|
222
|
+
placeholders: [{ name: "tags", type: "string" }]
|
|
223
|
+
},
|
|
224
|
+
"interop.md.schema": { value: "**Schema:**", description: "Schema label" },
|
|
225
|
+
"interop.md.automationSafe": {
|
|
226
|
+
value: "**Automation Safe**: {value}",
|
|
227
|
+
description: "Automation safe field",
|
|
228
|
+
placeholders: [{ name: "value", type: "string" }]
|
|
229
|
+
},
|
|
230
|
+
"interop.md.required": {
|
|
231
|
+
value: "(required)",
|
|
232
|
+
description: "Required marker"
|
|
233
|
+
},
|
|
234
|
+
"interop.md.optional": {
|
|
235
|
+
value: "(optional)",
|
|
236
|
+
description: "Optional marker"
|
|
237
|
+
},
|
|
238
|
+
"interop.md.minConfidence": {
|
|
239
|
+
value: "- **Minimum Confidence**: {min}",
|
|
240
|
+
description: "Minimum confidence policy line",
|
|
241
|
+
placeholders: [{ name: "min", type: "number" }]
|
|
242
|
+
},
|
|
243
|
+
"interop.md.escalationThreshold": {
|
|
244
|
+
value: "- **Escalation Threshold**: {threshold}",
|
|
245
|
+
description: "Escalation threshold policy line",
|
|
246
|
+
placeholders: [{ name: "threshold", type: "number" }]
|
|
247
|
+
},
|
|
248
|
+
"interop.md.escalateToolFailure": {
|
|
249
|
+
value: "- **Escalate on Tool Failure**: Yes",
|
|
250
|
+
description: "Escalate on tool failure policy line"
|
|
251
|
+
},
|
|
252
|
+
"interop.md.escalateTimeout": {
|
|
253
|
+
value: "- **Escalate on Timeout**: Yes",
|
|
254
|
+
description: "Escalate on timeout policy line"
|
|
255
|
+
},
|
|
256
|
+
"interop.md.yes": { value: "Yes", description: "Yes label" },
|
|
257
|
+
"interop.md.no": { value: "No", description: "No label" },
|
|
258
|
+
"error.jsonRunner.requiresModel": {
|
|
259
|
+
value: "createAgentJsonRunner requires a model or provider config",
|
|
260
|
+
description: "Error when JSON runner has no model or provider"
|
|
261
|
+
},
|
|
262
|
+
"error.missingToolHandler": {
|
|
263
|
+
value: "Missing handler for tool: {name}",
|
|
264
|
+
description: "Error when a tool handler is not registered",
|
|
265
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
266
|
+
},
|
|
267
|
+
"error.unknownBackend": {
|
|
268
|
+
value: "Unknown backend: {backend}",
|
|
269
|
+
description: "Error when an unknown backend is specified",
|
|
270
|
+
placeholders: [{ name: "backend", type: "string" }]
|
|
271
|
+
},
|
|
272
|
+
"error.claudeSdk.notAvailable": {
|
|
273
|
+
value: "Claude Agent SDK not available. Install @anthropic-ai/claude-agent-sdk",
|
|
274
|
+
description: "Error when Claude Agent SDK is not available"
|
|
275
|
+
},
|
|
276
|
+
"error.claudeSdk.notInstalled": {
|
|
277
|
+
value: "Claude Agent SDK not installed. Run: npm install @anthropic-ai/claude-agent-sdk",
|
|
278
|
+
description: "Error when Claude Agent SDK module is not found"
|
|
279
|
+
},
|
|
280
|
+
"error.opencodeSdk.notAvailable": {
|
|
281
|
+
value: "OpenCode SDK not available. Install @opencode-ai/sdk",
|
|
282
|
+
description: "Error when OpenCode SDK is not available"
|
|
283
|
+
},
|
|
284
|
+
"error.opencodeSdk.notInstalled": {
|
|
285
|
+
value: "OpenCode SDK not installed. Run: npm install @opencode-ai/sdk",
|
|
286
|
+
description: "Error when OpenCode SDK module is not found"
|
|
287
|
+
},
|
|
288
|
+
"error.providerNotInitialized": {
|
|
289
|
+
value: "Provider not initialized",
|
|
290
|
+
description: "Error when provider has not been initialized before use"
|
|
291
|
+
},
|
|
292
|
+
"error.agentKeyRequired": {
|
|
293
|
+
value: "Agent key is required",
|
|
294
|
+
description: "Validation error: missing agent key"
|
|
295
|
+
},
|
|
296
|
+
"error.agentMissingVersion": {
|
|
297
|
+
value: "Agent {key} is missing a string version",
|
|
298
|
+
description: "Validation error: version not a string",
|
|
299
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
300
|
+
},
|
|
301
|
+
"error.agentRequiresInstructions": {
|
|
302
|
+
value: "Agent {key} requires instructions",
|
|
303
|
+
description: "Validation error: missing instructions",
|
|
304
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
305
|
+
},
|
|
306
|
+
"error.agentRequiresTool": {
|
|
307
|
+
value: "Agent {key} must expose at least one tool",
|
|
308
|
+
description: "Validation error: no tools defined",
|
|
309
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
310
|
+
},
|
|
311
|
+
"error.agentDuplicateTool": {
|
|
312
|
+
value: "Agent {key} has duplicate tool name: {name}",
|
|
313
|
+
description: "Validation error: duplicate tool name",
|
|
314
|
+
placeholders: [
|
|
315
|
+
{ name: "key", type: "string" },
|
|
316
|
+
{ name: "name", type: "string" }
|
|
317
|
+
]
|
|
318
|
+
},
|
|
319
|
+
"error.agentSpecNotFound": {
|
|
320
|
+
value: "Agent spec not found for {name}",
|
|
321
|
+
description: "Error when agent spec is not in the registry",
|
|
322
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
323
|
+
},
|
|
324
|
+
"error.specNotFound": {
|
|
325
|
+
value: "Spec not found: {specKey}",
|
|
326
|
+
description: "Error when a spec key is not found",
|
|
327
|
+
placeholders: [{ name: "specKey", type: "string" }]
|
|
328
|
+
},
|
|
329
|
+
"error.toolNotFound": {
|
|
330
|
+
value: "Tool not found: {name}",
|
|
331
|
+
description: "Error when a tool is not found",
|
|
332
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
333
|
+
},
|
|
334
|
+
"error.noHandlerForTool": {
|
|
335
|
+
value: "No handler registered for tool: {name}",
|
|
336
|
+
description: "Error when no handler is registered for a tool",
|
|
337
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
338
|
+
},
|
|
339
|
+
"error.noToolHandler": {
|
|
340
|
+
value: "No handler for tool: {name}",
|
|
341
|
+
description: "Short error when no handler exists",
|
|
342
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
343
|
+
},
|
|
344
|
+
"error.unknownExportFormat": {
|
|
345
|
+
value: "Unknown export format: {format}",
|
|
346
|
+
description: "Error for unsupported export format",
|
|
347
|
+
placeholders: [{ name: "format", type: "string" }]
|
|
348
|
+
},
|
|
349
|
+
"error.handlerNotFoundForTool": {
|
|
350
|
+
value: "Handler not found for tool {name}",
|
|
351
|
+
description: "Error in tool bridge when handler is missing",
|
|
352
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
353
|
+
},
|
|
354
|
+
"error.toolNotFoundOrNoHandler": {
|
|
355
|
+
value: "Error: Tool '{name}' not found or has no handler",
|
|
356
|
+
description: "Error returned to LLM when tool execution fails",
|
|
357
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
358
|
+
},
|
|
359
|
+
"error.toolNoExecuteHandler": {
|
|
360
|
+
value: "Tool {name} has no execute handler",
|
|
361
|
+
description: "Error when tool lacks an execute function",
|
|
362
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
363
|
+
},
|
|
364
|
+
"error.provider.notRegistered": {
|
|
365
|
+
value: "not registered",
|
|
366
|
+
description: "Provider availability reason: not registered"
|
|
367
|
+
},
|
|
368
|
+
"error.provider.depsNotInstalled": {
|
|
369
|
+
value: "dependencies not installed or not configured",
|
|
370
|
+
description: "Provider availability reason: deps missing"
|
|
371
|
+
},
|
|
372
|
+
"error.provider.sdkNotConfigured": {
|
|
373
|
+
value: "SDK not installed or API key not configured",
|
|
374
|
+
description: "Provider availability reason: SDK or key missing"
|
|
375
|
+
},
|
|
376
|
+
"error.provider.claudeSdkMissing": {
|
|
377
|
+
value: "@anthropic-ai/claude-agent-sdk is not installed",
|
|
378
|
+
description: "Error when Claude Agent SDK require.resolve fails"
|
|
379
|
+
},
|
|
380
|
+
"error.provider.opencodeSdkMissing": {
|
|
381
|
+
value: "@opencode-ai/sdk is not installed",
|
|
382
|
+
description: "Error when OpenCode SDK require.resolve fails"
|
|
383
|
+
},
|
|
384
|
+
"error.provider.sdkNotInstalled": {
|
|
385
|
+
value: "SDK not installed",
|
|
386
|
+
description: "Generic provider error: SDK not installed"
|
|
387
|
+
},
|
|
388
|
+
"error.provider.contextCreation": {
|
|
389
|
+
value: "Failed to create context: {error}",
|
|
390
|
+
description: "Error during provider context creation",
|
|
391
|
+
placeholders: [{ name: "error", type: "string" }]
|
|
392
|
+
},
|
|
393
|
+
"error.provider.executionFailed": {
|
|
394
|
+
value: "Execution failed: {error}",
|
|
395
|
+
description: "Error during provider execution",
|
|
396
|
+
placeholders: [{ name: "error", type: "string" }]
|
|
397
|
+
},
|
|
398
|
+
"error.provider.streamFailed": {
|
|
399
|
+
value: "Stream failed: {error}",
|
|
400
|
+
description: "Error during provider streaming",
|
|
401
|
+
placeholders: [{ name: "error", type: "string" }]
|
|
402
|
+
},
|
|
403
|
+
"export.agentConfiguration": {
|
|
404
|
+
value: "# Agent Configuration",
|
|
405
|
+
description: "Markdown heading"
|
|
406
|
+
},
|
|
407
|
+
"export.metadata": {
|
|
408
|
+
value: "## Metadata",
|
|
409
|
+
description: "Markdown heading"
|
|
410
|
+
},
|
|
411
|
+
"export.metaName": {
|
|
412
|
+
value: "- **Name**: {name}",
|
|
413
|
+
description: "Metadata line",
|
|
414
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
415
|
+
},
|
|
416
|
+
"export.metaVersion": {
|
|
417
|
+
value: "- **Version**: {version}",
|
|
418
|
+
description: "Metadata line",
|
|
419
|
+
placeholders: [{ name: "version", type: "string" }]
|
|
420
|
+
},
|
|
421
|
+
"export.metaOwners": {
|
|
422
|
+
value: "- **Owners**: {owners}",
|
|
423
|
+
description: "Metadata line",
|
|
424
|
+
placeholders: [{ name: "owners", type: "string" }]
|
|
425
|
+
},
|
|
426
|
+
"export.metaModel": {
|
|
427
|
+
value: "- **Model**: {model}",
|
|
428
|
+
description: "Metadata line",
|
|
429
|
+
placeholders: [{ name: "model", type: "string" }]
|
|
430
|
+
},
|
|
431
|
+
"export.instructions": {
|
|
432
|
+
value: "## Instructions",
|
|
433
|
+
description: "Markdown heading"
|
|
434
|
+
},
|
|
435
|
+
"export.availableTools": {
|
|
436
|
+
value: "## Available Tools",
|
|
437
|
+
description: "Markdown heading"
|
|
438
|
+
},
|
|
439
|
+
"export.tools": { value: "## Tools", description: "Markdown heading" },
|
|
440
|
+
"export.knowledgeSources": {
|
|
441
|
+
value: "## Knowledge Sources",
|
|
442
|
+
description: "Markdown heading"
|
|
443
|
+
},
|
|
444
|
+
"export.policy": { value: "## Policy", description: "Markdown heading" },
|
|
445
|
+
"export.additionalContext": {
|
|
446
|
+
value: "## Additional Context",
|
|
447
|
+
description: "Markdown heading"
|
|
448
|
+
},
|
|
449
|
+
"export.configuration": {
|
|
450
|
+
value: "## Configuration",
|
|
451
|
+
description: "Markdown heading"
|
|
452
|
+
},
|
|
453
|
+
"export.mcpServers": {
|
|
454
|
+
value: "## MCP Servers",
|
|
455
|
+
description: "Markdown heading"
|
|
456
|
+
},
|
|
457
|
+
"export.parameters": {
|
|
458
|
+
value: "**Parameters:**",
|
|
459
|
+
description: "Parameters label"
|
|
460
|
+
},
|
|
461
|
+
"export.requiresApproval": {
|
|
462
|
+
value: "requires approval",
|
|
463
|
+
description: "Tool flag"
|
|
464
|
+
},
|
|
465
|
+
"export.notAutomationSafe": {
|
|
466
|
+
value: "not automation safe",
|
|
467
|
+
description: "Tool flag"
|
|
468
|
+
},
|
|
469
|
+
"export.requiresApprovalMd": {
|
|
470
|
+
value: "*(requires approval)*",
|
|
471
|
+
description: "Markdown tool flag"
|
|
472
|
+
},
|
|
473
|
+
"export.notAutomationSafeMd": {
|
|
474
|
+
value: "*(not automation safe)*",
|
|
475
|
+
description: "Markdown tool flag"
|
|
476
|
+
},
|
|
477
|
+
"export.required": { value: "(required)", description: "Required marker" },
|
|
478
|
+
"export.optional": { value: "(optional)", description: "Optional marker" },
|
|
479
|
+
"export.minConfidence": {
|
|
480
|
+
value: "- Minimum confidence: {min}",
|
|
481
|
+
description: "Policy line",
|
|
482
|
+
placeholders: [{ name: "min", type: "number" }]
|
|
483
|
+
},
|
|
484
|
+
"export.escalationConfigured": {
|
|
485
|
+
value: "- Escalation policy is configured",
|
|
486
|
+
description: "Policy line for system prompt"
|
|
487
|
+
},
|
|
488
|
+
"export.escalationPolicyConfigured": {
|
|
489
|
+
value: "- Escalation policy configured",
|
|
490
|
+
description: "Policy line for markdown export"
|
|
491
|
+
},
|
|
492
|
+
"export.featureFlags": {
|
|
493
|
+
value: "- Feature flags: {flags}",
|
|
494
|
+
description: "Feature flags policy line",
|
|
495
|
+
placeholders: [{ name: "flags", type: "string" }]
|
|
496
|
+
},
|
|
497
|
+
"export.generatedFrom": {
|
|
498
|
+
value: "*Generated from ContractSpec: {key}*",
|
|
499
|
+
description: "Footer attribution line",
|
|
500
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
501
|
+
},
|
|
502
|
+
"export.exportedAt": {
|
|
503
|
+
value: "*Exported at: {date}*",
|
|
504
|
+
description: "Footer timestamp",
|
|
505
|
+
placeholders: [{ name: "date", type: "string" }]
|
|
506
|
+
},
|
|
507
|
+
"export.agentType": {
|
|
508
|
+
value: "> Agent type: **{type}**",
|
|
509
|
+
description: "Agent type callout",
|
|
510
|
+
placeholders: [{ name: "type", type: "string" }]
|
|
511
|
+
},
|
|
512
|
+
"export.noDescription": {
|
|
513
|
+
value: "No description",
|
|
514
|
+
description: "Fallback when tool has no description"
|
|
515
|
+
},
|
|
516
|
+
"export.validation.requiresKey": {
|
|
517
|
+
value: "Spec must have a meta.key",
|
|
518
|
+
description: "Validation error"
|
|
519
|
+
},
|
|
520
|
+
"export.validation.requiresInstructions": {
|
|
521
|
+
value: "Spec must have instructions",
|
|
522
|
+
description: "Validation error"
|
|
523
|
+
},
|
|
524
|
+
"export.validation.requiresTool": {
|
|
525
|
+
value: "Spec must have at least one tool",
|
|
526
|
+
description: "Validation error"
|
|
527
|
+
},
|
|
528
|
+
"export.validation.toolRequiresName": {
|
|
529
|
+
value: "All tools must have a name",
|
|
530
|
+
description: "Validation error"
|
|
531
|
+
},
|
|
532
|
+
"export.validation.toolRequiresDescOrName": {
|
|
533
|
+
value: "Tool must have a description or name",
|
|
534
|
+
description: "Validation error"
|
|
535
|
+
},
|
|
536
|
+
"export.validation.toolInvalidName": {
|
|
537
|
+
value: "Tool name '{name}' should be a valid identifier (letters, numbers, underscores)",
|
|
538
|
+
description: "Validation error for invalid tool name",
|
|
539
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
540
|
+
},
|
|
541
|
+
"export.agentType.build": {
|
|
542
|
+
value: "Primary agent with full tool access for code generation and modification.",
|
|
543
|
+
description: "Build agent type description"
|
|
544
|
+
},
|
|
545
|
+
"export.agentType.plan": {
|
|
546
|
+
value: "Restricted agent for analysis and planning. File edits and bash commands require approval.",
|
|
547
|
+
description: "Plan agent type description"
|
|
548
|
+
},
|
|
549
|
+
"export.agentType.general": {
|
|
550
|
+
value: "General-purpose subagent for complex questions and multi-step tasks.",
|
|
551
|
+
description: "General agent type description"
|
|
552
|
+
},
|
|
553
|
+
"export.agentType.explore": {
|
|
554
|
+
value: "Fast subagent optimized for codebase exploration and pattern searching.",
|
|
555
|
+
description: "Explore agent type description"
|
|
556
|
+
},
|
|
557
|
+
"export.bridge.requiresApproval": {
|
|
558
|
+
value: "(requires approval)",
|
|
559
|
+
description: "Tool permission label"
|
|
560
|
+
},
|
|
561
|
+
"export.bridge.askMode": {
|
|
562
|
+
value: "(ask mode)",
|
|
563
|
+
description: "Tool permission label"
|
|
564
|
+
},
|
|
565
|
+
"approval.toolRequiresApproval": {
|
|
566
|
+
value: 'Tool "{name}" requires approval',
|
|
567
|
+
description: "Default reason for tool approval requests",
|
|
568
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
569
|
+
},
|
|
570
|
+
"log.unifiedAgent.fallback": {
|
|
571
|
+
value: "[UnifiedAgent] {backend} failed, falling back to {fallback}",
|
|
572
|
+
description: "Warning when a backend fails and fallback is used",
|
|
573
|
+
placeholders: [
|
|
574
|
+
{ name: "backend", type: "string" },
|
|
575
|
+
{ name: "fallback", type: "string" }
|
|
576
|
+
]
|
|
577
|
+
},
|
|
578
|
+
"log.knowledge.spaceNotAvailable": {
|
|
579
|
+
value: 'Required knowledge space "{key}" is not available',
|
|
580
|
+
description: "Warning when a required knowledge space is missing",
|
|
581
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
582
|
+
},
|
|
583
|
+
"log.knowledge.loadFailed": {
|
|
584
|
+
value: 'Failed to load required knowledge "{key}":',
|
|
585
|
+
description: "Warning when knowledge loading fails",
|
|
586
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
587
|
+
},
|
|
588
|
+
"log.knowledge.queryFailed": {
|
|
589
|
+
value: "Failed to query knowledge space {space}:",
|
|
590
|
+
description: "Warning when knowledge querying fails",
|
|
591
|
+
placeholders: [{ name: "space", type: "string" }]
|
|
592
|
+
},
|
|
593
|
+
"log.mcpServer.started": {
|
|
594
|
+
value: "[MCPToolServer] Started {name}@{version} with {count} tools",
|
|
595
|
+
description: "Log message when MCP tool server starts",
|
|
596
|
+
placeholders: [
|
|
597
|
+
{ name: "name", type: "string" },
|
|
598
|
+
{ name: "version", type: "string" },
|
|
599
|
+
{ name: "count", type: "number" }
|
|
600
|
+
]
|
|
601
|
+
},
|
|
602
|
+
"log.mcpServer.stopped": {
|
|
603
|
+
value: "[MCPToolServer] Stopped {name}",
|
|
604
|
+
description: "Log message when MCP tool server stops",
|
|
605
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
});
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
// src/i18n/catalogs/fr.ts
|
|
612
|
+
import { defineTranslation as defineTranslation2 } from "@contractspec/lib.contracts/translations";
|
|
613
|
+
var frMessages;
|
|
614
|
+
var init_fr = __esm(() => {
|
|
615
|
+
frMessages = defineTranslation2({
|
|
616
|
+
meta: {
|
|
617
|
+
key: "ai-agent.messages",
|
|
618
|
+
version: "1.0.0",
|
|
619
|
+
domain: "ai-agent",
|
|
620
|
+
description: "Toutes les chaînes destinées aux utilisateurs, aux LLM et aux développeurs pour le package ai-agent",
|
|
621
|
+
owners: ["platform"],
|
|
622
|
+
stability: "experimental"
|
|
623
|
+
},
|
|
624
|
+
locale: "fr",
|
|
625
|
+
fallback: "en",
|
|
626
|
+
messages: {
|
|
627
|
+
"agent.json.rules.validJsonOnly": {
|
|
628
|
+
value: "Vous DEVEZ produire uniquement du JSON valide.",
|
|
629
|
+
description: "JSON runner rule: output must be valid JSON"
|
|
630
|
+
},
|
|
631
|
+
"agent.json.rules.noMarkdownFences": {
|
|
632
|
+
value: "N'encapsulez pas la sortie dans des blocs de code markdown.",
|
|
633
|
+
description: "JSON runner rule: no markdown code fences"
|
|
634
|
+
},
|
|
635
|
+
"agent.json.rules.noCommentary": {
|
|
636
|
+
value: "N'incluez ni commentaire ni explication.",
|
|
637
|
+
description: "JSON runner rule: no extra text"
|
|
638
|
+
},
|
|
639
|
+
"agent.json.rules.doubleQuotes": {
|
|
640
|
+
value: "Utilisez des guillemets doubles pour toutes les clés et valeurs de type chaîne.",
|
|
641
|
+
description: "JSON runner rule: double quotes only"
|
|
642
|
+
},
|
|
643
|
+
"agent.json.rules.noTrailingCommas": {
|
|
644
|
+
value: "N'incluez pas de virgules finales.",
|
|
645
|
+
description: "JSON runner rule: no trailing commas"
|
|
646
|
+
},
|
|
647
|
+
"agent.json.defaultDescription": {
|
|
648
|
+
value: "Exécuteur d'agent JSON uniquement pour les pipelines déterministes.",
|
|
649
|
+
description: "Default description for the JSON runner spec"
|
|
650
|
+
},
|
|
651
|
+
"agent.json.systemPrompt": {
|
|
652
|
+
value: "Vous êtes un générateur JSON précis.",
|
|
653
|
+
description: "Default system prompt for the JSON runner"
|
|
654
|
+
},
|
|
655
|
+
"knowledge.header": {
|
|
656
|
+
value: "# Connaissances de référence",
|
|
657
|
+
description: "Header for injected knowledge section in system prompt"
|
|
658
|
+
},
|
|
659
|
+
"knowledge.description": {
|
|
660
|
+
value: "Les informations suivantes sont fournies à titre de référence. Utilisez-les pour éclairer vos réponses.",
|
|
661
|
+
description: "Description below the knowledge header"
|
|
662
|
+
},
|
|
663
|
+
"tool.knowledge.description": {
|
|
664
|
+
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.",
|
|
665
|
+
description: "Description for the knowledge query tool shown to the LLM"
|
|
666
|
+
},
|
|
667
|
+
"tool.knowledge.availableSpaces": {
|
|
668
|
+
value: "Espaces de connaissances disponibles :",
|
|
669
|
+
description: "Label before listing available knowledge spaces"
|
|
670
|
+
},
|
|
671
|
+
"tool.knowledge.spaceDefault": {
|
|
672
|
+
value: "Espace de connaissances",
|
|
673
|
+
description: "Fallback description for unnamed knowledge spaces"
|
|
674
|
+
},
|
|
675
|
+
"tool.knowledge.param.query": {
|
|
676
|
+
value: "La question ou la requête de recherche pour trouver des informations pertinentes",
|
|
677
|
+
description: "Parameter description for the query field"
|
|
678
|
+
},
|
|
679
|
+
"tool.knowledge.param.spaceKey": {
|
|
680
|
+
value: "Espace de connaissances spécifique à interroger. Si omis, recherche dans tous les espaces disponibles.",
|
|
681
|
+
description: "Parameter description for the spaceKey field"
|
|
682
|
+
},
|
|
683
|
+
"tool.knowledge.param.topK": {
|
|
684
|
+
value: "Nombre maximum de résultats à retourner",
|
|
685
|
+
description: "Parameter description for the topK field"
|
|
686
|
+
},
|
|
687
|
+
"tool.knowledge.noResults": {
|
|
688
|
+
value: "Aucune information pertinente trouvée dans les bases de connaissances.",
|
|
689
|
+
description: "Message when no knowledge results are found"
|
|
690
|
+
},
|
|
691
|
+
"tool.knowledge.sourceLabel": {
|
|
692
|
+
value: "[Source {index} - {space}] (pertinence : {score} %)",
|
|
693
|
+
description: "Label for each knowledge search result",
|
|
694
|
+
placeholders: [
|
|
695
|
+
{ name: "index", type: "number", description: "1-based source index" },
|
|
696
|
+
{ name: "space", type: "string", description: "Knowledge space name" },
|
|
697
|
+
{ name: "score", type: "number", description: "Relevance percentage" }
|
|
698
|
+
]
|
|
699
|
+
},
|
|
700
|
+
"tool.fallbackDescription": {
|
|
701
|
+
value: "Exécuter {name}",
|
|
702
|
+
description: "Fallback description when a tool has no explicit description",
|
|
703
|
+
placeholders: [
|
|
704
|
+
{ name: "name", type: "string", description: "Tool name" }
|
|
705
|
+
]
|
|
706
|
+
},
|
|
707
|
+
"tool.mcp.param.message": {
|
|
708
|
+
value: "Le message ou la requête à envoyer à l'agent",
|
|
709
|
+
description: "MCP server: message parameter description"
|
|
710
|
+
},
|
|
711
|
+
"tool.mcp.param.sessionId": {
|
|
712
|
+
value: "Identifiant de session optionnel pour poursuivre une conversation",
|
|
713
|
+
description: "MCP server: sessionId parameter description"
|
|
714
|
+
},
|
|
715
|
+
"tool.mcp.agentDescription": {
|
|
716
|
+
value: "Interagir avec l'agent {key}",
|
|
717
|
+
description: "MCP server: agent tool description",
|
|
718
|
+
placeholders: [
|
|
719
|
+
{ name: "key", type: "string", description: "Agent spec key" }
|
|
720
|
+
]
|
|
721
|
+
},
|
|
722
|
+
"tool.mcp.executePrompt": {
|
|
723
|
+
value: "Exécutez l'outil {name} avec les arguments suivants : {args}",
|
|
724
|
+
description: "MCP server: prompt sent when executing an individual tool",
|
|
725
|
+
placeholders: [
|
|
726
|
+
{ name: "name", type: "string", description: "Tool name" },
|
|
727
|
+
{
|
|
728
|
+
name: "args",
|
|
729
|
+
type: "string",
|
|
730
|
+
description: "JSON-stringified arguments"
|
|
731
|
+
}
|
|
732
|
+
]
|
|
733
|
+
},
|
|
734
|
+
"tool.mcp.toolDescription": {
|
|
735
|
+
value: "Exécuter l'outil {name}",
|
|
736
|
+
description: "MCP server: individual tool description",
|
|
737
|
+
placeholders: [
|
|
738
|
+
{ name: "name", type: "string", description: "Tool name" }
|
|
739
|
+
]
|
|
740
|
+
},
|
|
741
|
+
"interop.prompt.agentIdentity": {
|
|
742
|
+
value: "# Identité de l'agent",
|
|
743
|
+
description: "Section header for agent identity in LLM prompt"
|
|
744
|
+
},
|
|
745
|
+
"interop.prompt.youAre": {
|
|
746
|
+
value: "Vous êtes {key} (v{version}).",
|
|
747
|
+
description: "Agent identity statement in LLM prompt",
|
|
748
|
+
placeholders: [
|
|
749
|
+
{ name: "key", type: "string" },
|
|
750
|
+
{ name: "version", type: "string" }
|
|
751
|
+
]
|
|
752
|
+
},
|
|
753
|
+
"interop.prompt.description": {
|
|
754
|
+
value: "## Description",
|
|
755
|
+
description: "Section header for description"
|
|
756
|
+
},
|
|
757
|
+
"interop.prompt.instructions": {
|
|
758
|
+
value: "## Instructions",
|
|
759
|
+
description: "Section header for instructions"
|
|
760
|
+
},
|
|
761
|
+
"interop.prompt.availableTools": {
|
|
762
|
+
value: "## Outils disponibles",
|
|
763
|
+
description: "Section header for available tools"
|
|
764
|
+
},
|
|
765
|
+
"interop.prompt.toolsIntro": {
|
|
766
|
+
value: "Vous avez accès aux outils suivants :",
|
|
767
|
+
description: "Introduction before listing tools"
|
|
768
|
+
},
|
|
769
|
+
"interop.prompt.parameters": {
|
|
770
|
+
value: "Paramètres :",
|
|
771
|
+
description: "Label before tool parameters block"
|
|
772
|
+
},
|
|
773
|
+
"interop.prompt.knowledgeContext": {
|
|
774
|
+
value: "## Contexte de connaissances",
|
|
775
|
+
description: "Section header for knowledge context"
|
|
776
|
+
},
|
|
777
|
+
"interop.prompt.additionalContext": {
|
|
778
|
+
value: "## Contexte supplémentaire",
|
|
779
|
+
description: "Section header for additional context"
|
|
780
|
+
},
|
|
781
|
+
"interop.md.toc": {
|
|
782
|
+
value: "## Table des matières",
|
|
783
|
+
description: "TOC header"
|
|
784
|
+
},
|
|
785
|
+
"interop.md.overview": {
|
|
786
|
+
value: "## Aperçu",
|
|
787
|
+
description: "Overview header"
|
|
788
|
+
},
|
|
789
|
+
"interop.md.tools": { value: "## Outils", description: "Tools header" },
|
|
790
|
+
"interop.md.knowledge": {
|
|
791
|
+
value: "## Connaissances",
|
|
792
|
+
description: "Knowledge header"
|
|
793
|
+
},
|
|
794
|
+
"interop.md.policy": {
|
|
795
|
+
value: "## Politique",
|
|
796
|
+
description: "Policy header"
|
|
797
|
+
},
|
|
798
|
+
"interop.md.metaKey": {
|
|
799
|
+
value: "- **Clé** : `{key}`",
|
|
800
|
+
description: "Metadata line for key",
|
|
801
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
802
|
+
},
|
|
803
|
+
"interop.md.metaVersion": {
|
|
804
|
+
value: "- **Version** : {version}",
|
|
805
|
+
description: "Metadata line for version",
|
|
806
|
+
placeholders: [{ name: "version", type: "string" }]
|
|
807
|
+
},
|
|
808
|
+
"interop.md.metaStability": {
|
|
809
|
+
value: "- **Stabilité** : {stability}",
|
|
810
|
+
description: "Metadata line for stability",
|
|
811
|
+
placeholders: [{ name: "stability", type: "string" }]
|
|
812
|
+
},
|
|
813
|
+
"interop.md.metaOwners": {
|
|
814
|
+
value: "- **Propriétaires** : {owners}",
|
|
815
|
+
description: "Metadata line for owners",
|
|
816
|
+
placeholders: [{ name: "owners", type: "string" }]
|
|
817
|
+
},
|
|
818
|
+
"interop.md.metaTags": {
|
|
819
|
+
value: "- **Tags** : {tags}",
|
|
820
|
+
description: "Metadata line for tags",
|
|
821
|
+
placeholders: [{ name: "tags", type: "string" }]
|
|
822
|
+
},
|
|
823
|
+
"interop.md.schema": {
|
|
824
|
+
value: "**Schéma :**",
|
|
825
|
+
description: "Schema label"
|
|
826
|
+
},
|
|
827
|
+
"interop.md.automationSafe": {
|
|
828
|
+
value: "**Compatible avec l'automatisation** : {value}",
|
|
829
|
+
description: "Automation safe field",
|
|
830
|
+
placeholders: [{ name: "value", type: "string" }]
|
|
831
|
+
},
|
|
832
|
+
"interop.md.required": {
|
|
833
|
+
value: "(obligatoire)",
|
|
834
|
+
description: "Required marker"
|
|
835
|
+
},
|
|
836
|
+
"interop.md.optional": {
|
|
837
|
+
value: "(optionnel)",
|
|
838
|
+
description: "Optional marker"
|
|
839
|
+
},
|
|
840
|
+
"interop.md.minConfidence": {
|
|
841
|
+
value: "- **Confiance minimale** : {min}",
|
|
842
|
+
description: "Minimum confidence policy line",
|
|
843
|
+
placeholders: [{ name: "min", type: "number" }]
|
|
844
|
+
},
|
|
845
|
+
"interop.md.escalationThreshold": {
|
|
846
|
+
value: "- **Seuil d'escalade** : {threshold}",
|
|
847
|
+
description: "Escalation threshold policy line",
|
|
848
|
+
placeholders: [{ name: "threshold", type: "number" }]
|
|
849
|
+
},
|
|
850
|
+
"interop.md.escalateToolFailure": {
|
|
851
|
+
value: "- **Escalader en cas d'échec d'outil** : Oui",
|
|
852
|
+
description: "Escalate on tool failure policy line"
|
|
853
|
+
},
|
|
854
|
+
"interop.md.escalateTimeout": {
|
|
855
|
+
value: "- **Escalader en cas de délai d'attente dépassé** : Oui",
|
|
856
|
+
description: "Escalate on timeout policy line"
|
|
857
|
+
},
|
|
858
|
+
"interop.md.yes": { value: "Oui", description: "Yes label" },
|
|
859
|
+
"interop.md.no": { value: "Non", description: "No label" },
|
|
860
|
+
"error.jsonRunner.requiresModel": {
|
|
861
|
+
value: "createAgentJsonRunner nécessite un modèle ou une configuration de fournisseur",
|
|
862
|
+
description: "Error when JSON runner has no model or provider"
|
|
863
|
+
},
|
|
864
|
+
"error.missingToolHandler": {
|
|
865
|
+
value: "Gestionnaire manquant pour l'outil : {name}",
|
|
866
|
+
description: "Error when a tool handler is not registered",
|
|
867
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
868
|
+
},
|
|
869
|
+
"error.unknownBackend": {
|
|
870
|
+
value: "Backend inconnu : {backend}",
|
|
871
|
+
description: "Error when an unknown backend is specified",
|
|
872
|
+
placeholders: [{ name: "backend", type: "string" }]
|
|
873
|
+
},
|
|
874
|
+
"error.claudeSdk.notAvailable": {
|
|
875
|
+
value: "Claude Agent SDK non disponible. Installez @anthropic-ai/claude-agent-sdk",
|
|
876
|
+
description: "Error when Claude Agent SDK is not available"
|
|
877
|
+
},
|
|
878
|
+
"error.claudeSdk.notInstalled": {
|
|
879
|
+
value: "Claude Agent SDK non installé. Exécutez : npm install @anthropic-ai/claude-agent-sdk",
|
|
880
|
+
description: "Error when Claude Agent SDK module is not found"
|
|
881
|
+
},
|
|
882
|
+
"error.opencodeSdk.notAvailable": {
|
|
883
|
+
value: "OpenCode SDK non disponible. Installez @opencode-ai/sdk",
|
|
884
|
+
description: "Error when OpenCode SDK is not available"
|
|
885
|
+
},
|
|
886
|
+
"error.opencodeSdk.notInstalled": {
|
|
887
|
+
value: "OpenCode SDK non installé. Exécutez : npm install @opencode-ai/sdk",
|
|
888
|
+
description: "Error when OpenCode SDK module is not found"
|
|
889
|
+
},
|
|
890
|
+
"error.providerNotInitialized": {
|
|
891
|
+
value: "Fournisseur non initialisé",
|
|
892
|
+
description: "Error when provider has not been initialized before use"
|
|
893
|
+
},
|
|
894
|
+
"error.agentKeyRequired": {
|
|
895
|
+
value: "La clé de l'agent est obligatoire",
|
|
896
|
+
description: "Validation error: missing agent key"
|
|
897
|
+
},
|
|
898
|
+
"error.agentMissingVersion": {
|
|
899
|
+
value: "L'agent {key} n'a pas de version sous forme de chaîne de caractères",
|
|
900
|
+
description: "Validation error: version not a string",
|
|
901
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
902
|
+
},
|
|
903
|
+
"error.agentRequiresInstructions": {
|
|
904
|
+
value: "L'agent {key} nécessite des instructions",
|
|
905
|
+
description: "Validation error: missing instructions",
|
|
906
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
907
|
+
},
|
|
908
|
+
"error.agentRequiresTool": {
|
|
909
|
+
value: "L'agent {key} doit exposer au moins un outil",
|
|
910
|
+
description: "Validation error: no tools defined",
|
|
911
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
912
|
+
},
|
|
913
|
+
"error.agentDuplicateTool": {
|
|
914
|
+
value: "L'agent {key} a un nom d'outil en double : {name}",
|
|
915
|
+
description: "Validation error: duplicate tool name",
|
|
916
|
+
placeholders: [
|
|
917
|
+
{ name: "key", type: "string" },
|
|
918
|
+
{ name: "name", type: "string" }
|
|
919
|
+
]
|
|
920
|
+
},
|
|
921
|
+
"error.agentSpecNotFound": {
|
|
922
|
+
value: "Spécification d'agent introuvable pour {name}",
|
|
923
|
+
description: "Error when agent spec is not in the registry",
|
|
924
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
925
|
+
},
|
|
926
|
+
"error.specNotFound": {
|
|
927
|
+
value: "Spécification introuvable : {specKey}",
|
|
928
|
+
description: "Error when a spec key is not found",
|
|
929
|
+
placeholders: [{ name: "specKey", type: "string" }]
|
|
930
|
+
},
|
|
931
|
+
"error.toolNotFound": {
|
|
932
|
+
value: "Outil introuvable : {name}",
|
|
933
|
+
description: "Error when a tool is not found",
|
|
934
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
935
|
+
},
|
|
936
|
+
"error.noHandlerForTool": {
|
|
937
|
+
value: "Aucun gestionnaire enregistré pour l'outil : {name}",
|
|
938
|
+
description: "Error when no handler is registered for a tool",
|
|
939
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
940
|
+
},
|
|
941
|
+
"error.noToolHandler": {
|
|
942
|
+
value: "Aucun gestionnaire pour l'outil : {name}",
|
|
943
|
+
description: "Short error when no handler exists",
|
|
944
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
945
|
+
},
|
|
946
|
+
"error.unknownExportFormat": {
|
|
947
|
+
value: "Format d'export inconnu : {format}",
|
|
948
|
+
description: "Error for unsupported export format",
|
|
949
|
+
placeholders: [{ name: "format", type: "string" }]
|
|
950
|
+
},
|
|
951
|
+
"error.handlerNotFoundForTool": {
|
|
952
|
+
value: "Gestionnaire introuvable pour l'outil {name}",
|
|
953
|
+
description: "Error in tool bridge when handler is missing",
|
|
954
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
955
|
+
},
|
|
956
|
+
"error.toolNotFoundOrNoHandler": {
|
|
957
|
+
value: "Erreur : L'outil « {name} » est introuvable ou n'a pas de gestionnaire",
|
|
958
|
+
description: "Error returned to LLM when tool execution fails",
|
|
959
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
960
|
+
},
|
|
961
|
+
"error.toolNoExecuteHandler": {
|
|
962
|
+
value: "L'outil {name} n'a pas de gestionnaire d'exécution",
|
|
963
|
+
description: "Error when tool lacks an execute function",
|
|
964
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
965
|
+
},
|
|
966
|
+
"error.provider.notRegistered": {
|
|
967
|
+
value: "non enregistré",
|
|
968
|
+
description: "Provider availability reason: not registered"
|
|
969
|
+
},
|
|
970
|
+
"error.provider.depsNotInstalled": {
|
|
971
|
+
value: "dépendances non installées ou non configurées",
|
|
972
|
+
description: "Provider availability reason: deps missing"
|
|
973
|
+
},
|
|
974
|
+
"error.provider.sdkNotConfigured": {
|
|
975
|
+
value: "SDK non installé ou clé d'API non configurée",
|
|
976
|
+
description: "Provider availability reason: SDK or key missing"
|
|
977
|
+
},
|
|
978
|
+
"error.provider.claudeSdkMissing": {
|
|
979
|
+
value: "@anthropic-ai/claude-agent-sdk n'est pas installé",
|
|
980
|
+
description: "Error when Claude Agent SDK require.resolve fails"
|
|
981
|
+
},
|
|
982
|
+
"error.provider.opencodeSdkMissing": {
|
|
983
|
+
value: "@opencode-ai/sdk n'est pas installé",
|
|
984
|
+
description: "Error when OpenCode SDK require.resolve fails"
|
|
985
|
+
},
|
|
986
|
+
"error.provider.sdkNotInstalled": {
|
|
987
|
+
value: "SDK non installé",
|
|
988
|
+
description: "Generic provider error: SDK not installed"
|
|
989
|
+
},
|
|
990
|
+
"error.provider.contextCreation": {
|
|
991
|
+
value: "Échec de la création du contexte : {error}",
|
|
992
|
+
description: "Error during provider context creation",
|
|
993
|
+
placeholders: [{ name: "error", type: "string" }]
|
|
994
|
+
},
|
|
995
|
+
"error.provider.executionFailed": {
|
|
996
|
+
value: "Échec de l'exécution : {error}",
|
|
997
|
+
description: "Error during provider execution",
|
|
998
|
+
placeholders: [{ name: "error", type: "string" }]
|
|
999
|
+
},
|
|
1000
|
+
"error.provider.streamFailed": {
|
|
1001
|
+
value: "Échec du flux : {error}",
|
|
1002
|
+
description: "Error during provider streaming",
|
|
1003
|
+
placeholders: [{ name: "error", type: "string" }]
|
|
1004
|
+
},
|
|
1005
|
+
"export.agentConfiguration": {
|
|
1006
|
+
value: "# Configuration de l'agent",
|
|
1007
|
+
description: "Markdown heading"
|
|
1008
|
+
},
|
|
1009
|
+
"export.metadata": {
|
|
1010
|
+
value: "## Métadonnées",
|
|
1011
|
+
description: "Markdown heading"
|
|
1012
|
+
},
|
|
1013
|
+
"export.metaName": {
|
|
1014
|
+
value: "- **Nom** : {name}",
|
|
1015
|
+
description: "Metadata line",
|
|
1016
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1017
|
+
},
|
|
1018
|
+
"export.metaVersion": {
|
|
1019
|
+
value: "- **Version** : {version}",
|
|
1020
|
+
description: "Metadata line",
|
|
1021
|
+
placeholders: [{ name: "version", type: "string" }]
|
|
1022
|
+
},
|
|
1023
|
+
"export.metaOwners": {
|
|
1024
|
+
value: "- **Propriétaires** : {owners}",
|
|
1025
|
+
description: "Metadata line",
|
|
1026
|
+
placeholders: [{ name: "owners", type: "string" }]
|
|
1027
|
+
},
|
|
1028
|
+
"export.metaModel": {
|
|
1029
|
+
value: "- **Modèle** : {model}",
|
|
1030
|
+
description: "Metadata line",
|
|
1031
|
+
placeholders: [{ name: "model", type: "string" }]
|
|
1032
|
+
},
|
|
1033
|
+
"export.instructions": {
|
|
1034
|
+
value: "## Instructions",
|
|
1035
|
+
description: "Markdown heading"
|
|
1036
|
+
},
|
|
1037
|
+
"export.availableTools": {
|
|
1038
|
+
value: "## Outils disponibles",
|
|
1039
|
+
description: "Markdown heading"
|
|
1040
|
+
},
|
|
1041
|
+
"export.tools": { value: "## Outils", description: "Markdown heading" },
|
|
1042
|
+
"export.knowledgeSources": {
|
|
1043
|
+
value: "## Sources de connaissances",
|
|
1044
|
+
description: "Markdown heading"
|
|
1045
|
+
},
|
|
1046
|
+
"export.policy": {
|
|
1047
|
+
value: "## Politique",
|
|
1048
|
+
description: "Markdown heading"
|
|
1049
|
+
},
|
|
1050
|
+
"export.additionalContext": {
|
|
1051
|
+
value: "## Contexte supplémentaire",
|
|
1052
|
+
description: "Markdown heading"
|
|
1053
|
+
},
|
|
1054
|
+
"export.configuration": {
|
|
1055
|
+
value: "## Configuration",
|
|
1056
|
+
description: "Markdown heading"
|
|
1057
|
+
},
|
|
1058
|
+
"export.mcpServers": {
|
|
1059
|
+
value: "## Serveurs MCP",
|
|
1060
|
+
description: "Markdown heading"
|
|
1061
|
+
},
|
|
1062
|
+
"export.parameters": {
|
|
1063
|
+
value: "**Paramètres :**",
|
|
1064
|
+
description: "Parameters label"
|
|
1065
|
+
},
|
|
1066
|
+
"export.requiresApproval": {
|
|
1067
|
+
value: "nécessite une approbation",
|
|
1068
|
+
description: "Tool flag"
|
|
1069
|
+
},
|
|
1070
|
+
"export.notAutomationSafe": {
|
|
1071
|
+
value: "non compatible avec l'automatisation",
|
|
1072
|
+
description: "Tool flag"
|
|
1073
|
+
},
|
|
1074
|
+
"export.requiresApprovalMd": {
|
|
1075
|
+
value: "*(nécessite une approbation)*",
|
|
1076
|
+
description: "Markdown tool flag"
|
|
1077
|
+
},
|
|
1078
|
+
"export.notAutomationSafeMd": {
|
|
1079
|
+
value: "*(non compatible avec l'automatisation)*",
|
|
1080
|
+
description: "Markdown tool flag"
|
|
1081
|
+
},
|
|
1082
|
+
"export.required": {
|
|
1083
|
+
value: "(obligatoire)",
|
|
1084
|
+
description: "Required marker"
|
|
1085
|
+
},
|
|
1086
|
+
"export.optional": {
|
|
1087
|
+
value: "(optionnel)",
|
|
1088
|
+
description: "Optional marker"
|
|
1089
|
+
},
|
|
1090
|
+
"export.minConfidence": {
|
|
1091
|
+
value: "- Confiance minimale : {min}",
|
|
1092
|
+
description: "Policy line",
|
|
1093
|
+
placeholders: [{ name: "min", type: "number" }]
|
|
1094
|
+
},
|
|
1095
|
+
"export.escalationConfigured": {
|
|
1096
|
+
value: "- La politique d'escalade est configurée",
|
|
1097
|
+
description: "Policy line for system prompt"
|
|
1098
|
+
},
|
|
1099
|
+
"export.escalationPolicyConfigured": {
|
|
1100
|
+
value: "- Politique d'escalade configurée",
|
|
1101
|
+
description: "Policy line for markdown export"
|
|
1102
|
+
},
|
|
1103
|
+
"export.featureFlags": {
|
|
1104
|
+
value: "- Indicateurs de fonctionnalités : {flags}",
|
|
1105
|
+
description: "Feature flags policy line",
|
|
1106
|
+
placeholders: [{ name: "flags", type: "string" }]
|
|
1107
|
+
},
|
|
1108
|
+
"export.generatedFrom": {
|
|
1109
|
+
value: "*Généré à partir de ContractSpec : {key}*",
|
|
1110
|
+
description: "Footer attribution line",
|
|
1111
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
1112
|
+
},
|
|
1113
|
+
"export.exportedAt": {
|
|
1114
|
+
value: "*Exporté le : {date}*",
|
|
1115
|
+
description: "Footer timestamp",
|
|
1116
|
+
placeholders: [{ name: "date", type: "string" }]
|
|
1117
|
+
},
|
|
1118
|
+
"export.agentType": {
|
|
1119
|
+
value: "> Type d'agent : **{type}**",
|
|
1120
|
+
description: "Agent type callout",
|
|
1121
|
+
placeholders: [{ name: "type", type: "string" }]
|
|
1122
|
+
},
|
|
1123
|
+
"export.noDescription": {
|
|
1124
|
+
value: "Aucune description",
|
|
1125
|
+
description: "Fallback when tool has no description"
|
|
1126
|
+
},
|
|
1127
|
+
"export.validation.requiresKey": {
|
|
1128
|
+
value: "La spécification doit avoir une meta.key",
|
|
1129
|
+
description: "Validation error"
|
|
1130
|
+
},
|
|
1131
|
+
"export.validation.requiresInstructions": {
|
|
1132
|
+
value: "La spécification doit avoir des instructions",
|
|
1133
|
+
description: "Validation error"
|
|
1134
|
+
},
|
|
1135
|
+
"export.validation.requiresTool": {
|
|
1136
|
+
value: "La spécification doit avoir au moins un outil",
|
|
1137
|
+
description: "Validation error"
|
|
1138
|
+
},
|
|
1139
|
+
"export.validation.toolRequiresName": {
|
|
1140
|
+
value: "Tous les outils doivent avoir un nom",
|
|
1141
|
+
description: "Validation error"
|
|
1142
|
+
},
|
|
1143
|
+
"export.validation.toolRequiresDescOrName": {
|
|
1144
|
+
value: "L'outil doit avoir une description ou un nom",
|
|
1145
|
+
description: "Validation error"
|
|
1146
|
+
},
|
|
1147
|
+
"export.validation.toolInvalidName": {
|
|
1148
|
+
value: "Le nom d'outil « {name} » doit être un identifiant valide (lettres, chiffres, underscores)",
|
|
1149
|
+
description: "Validation error for invalid tool name",
|
|
1150
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1151
|
+
},
|
|
1152
|
+
"export.agentType.build": {
|
|
1153
|
+
value: "Agent principal avec accès complet aux outils pour la génération et la modification de code.",
|
|
1154
|
+
description: "Build agent type description"
|
|
1155
|
+
},
|
|
1156
|
+
"export.agentType.plan": {
|
|
1157
|
+
value: "Agent restreint pour l'analyse et la planification. Les modifications de fichiers et les commandes bash nécessitent une approbation.",
|
|
1158
|
+
description: "Plan agent type description"
|
|
1159
|
+
},
|
|
1160
|
+
"export.agentType.general": {
|
|
1161
|
+
value: "Sous-agent généraliste pour les questions complexes et les tâches en plusieurs étapes.",
|
|
1162
|
+
description: "General agent type description"
|
|
1163
|
+
},
|
|
1164
|
+
"export.agentType.explore": {
|
|
1165
|
+
value: "Sous-agent rapide optimisé pour l'exploration de la base de code et la recherche de motifs.",
|
|
1166
|
+
description: "Explore agent type description"
|
|
1167
|
+
},
|
|
1168
|
+
"export.bridge.requiresApproval": {
|
|
1169
|
+
value: "(nécessite une approbation)",
|
|
1170
|
+
description: "Tool permission label"
|
|
1171
|
+
},
|
|
1172
|
+
"export.bridge.askMode": {
|
|
1173
|
+
value: "(mode interrogation)",
|
|
1174
|
+
description: "Tool permission label"
|
|
1175
|
+
},
|
|
1176
|
+
"approval.toolRequiresApproval": {
|
|
1177
|
+
value: "L'outil « {name} » nécessite une approbation",
|
|
1178
|
+
description: "Default reason for tool approval requests",
|
|
1179
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1180
|
+
},
|
|
1181
|
+
"log.unifiedAgent.fallback": {
|
|
1182
|
+
value: "[UnifiedAgent] {backend} a échoué, repli sur {fallback}",
|
|
1183
|
+
description: "Warning when a backend fails and fallback is used",
|
|
1184
|
+
placeholders: [
|
|
1185
|
+
{ name: "backend", type: "string" },
|
|
1186
|
+
{ name: "fallback", type: "string" }
|
|
1187
|
+
]
|
|
1188
|
+
},
|
|
1189
|
+
"log.knowledge.spaceNotAvailable": {
|
|
1190
|
+
value: "L'espace de connaissances requis « {key} » n'est pas disponible",
|
|
1191
|
+
description: "Warning when a required knowledge space is missing",
|
|
1192
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
1193
|
+
},
|
|
1194
|
+
"log.knowledge.loadFailed": {
|
|
1195
|
+
value: "Échec du chargement des connaissances requises « {key} » :",
|
|
1196
|
+
description: "Warning when knowledge loading fails",
|
|
1197
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
1198
|
+
},
|
|
1199
|
+
"log.knowledge.queryFailed": {
|
|
1200
|
+
value: "Échec de l'interrogation de l'espace de connaissances {space} :",
|
|
1201
|
+
description: "Warning when knowledge querying fails",
|
|
1202
|
+
placeholders: [{ name: "space", type: "string" }]
|
|
1203
|
+
},
|
|
1204
|
+
"log.mcpServer.started": {
|
|
1205
|
+
value: "[MCPToolServer] {name}@{version} démarré avec {count} outils",
|
|
1206
|
+
description: "Log message when MCP tool server starts",
|
|
1207
|
+
placeholders: [
|
|
1208
|
+
{ name: "name", type: "string" },
|
|
1209
|
+
{ name: "version", type: "string" },
|
|
1210
|
+
{ name: "count", type: "number" }
|
|
1211
|
+
]
|
|
1212
|
+
},
|
|
1213
|
+
"log.mcpServer.stopped": {
|
|
1214
|
+
value: "[MCPToolServer] {name} arrêté",
|
|
1215
|
+
description: "Log message when MCP tool server stops",
|
|
1216
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
});
|
|
1220
|
+
});
|
|
1221
|
+
|
|
1222
|
+
// src/i18n/catalogs/es.ts
|
|
1223
|
+
import { defineTranslation as defineTranslation3 } from "@contractspec/lib.contracts/translations";
|
|
1224
|
+
var esMessages;
|
|
1225
|
+
var init_es = __esm(() => {
|
|
1226
|
+
esMessages = defineTranslation3({
|
|
1227
|
+
meta: {
|
|
1228
|
+
key: "ai-agent.messages",
|
|
1229
|
+
version: "1.0.0",
|
|
1230
|
+
domain: "ai-agent",
|
|
1231
|
+
description: "Todas las cadenas de texto orientadas al usuario, al LLM y al desarrollador del paquete ai-agent",
|
|
1232
|
+
owners: ["platform"],
|
|
1233
|
+
stability: "experimental"
|
|
1234
|
+
},
|
|
1235
|
+
locale: "es",
|
|
1236
|
+
fallback: "en",
|
|
1237
|
+
messages: {
|
|
1238
|
+
"agent.json.rules.validJsonOnly": {
|
|
1239
|
+
value: "Usted DEBE generar ÚNICAMENTE JSON válido.",
|
|
1240
|
+
description: "Regla del ejecutor JSON: la salida debe ser JSON válido"
|
|
1241
|
+
},
|
|
1242
|
+
"agent.json.rules.noMarkdownFences": {
|
|
1243
|
+
value: "No envuelva la salida en bloques de código markdown.",
|
|
1244
|
+
description: "Regla del ejecutor JSON: sin bloques de código markdown"
|
|
1245
|
+
},
|
|
1246
|
+
"agent.json.rules.noCommentary": {
|
|
1247
|
+
value: "No incluya comentarios ni explicaciones.",
|
|
1248
|
+
description: "Regla del ejecutor JSON: sin texto adicional"
|
|
1249
|
+
},
|
|
1250
|
+
"agent.json.rules.doubleQuotes": {
|
|
1251
|
+
value: "Utilice comillas dobles para todas las claves y valores de cadena.",
|
|
1252
|
+
description: "Regla del ejecutor JSON: solo comillas dobles"
|
|
1253
|
+
},
|
|
1254
|
+
"agent.json.rules.noTrailingCommas": {
|
|
1255
|
+
value: "No incluya comas finales.",
|
|
1256
|
+
description: "Regla del ejecutor JSON: sin comas finales"
|
|
1257
|
+
},
|
|
1258
|
+
"agent.json.defaultDescription": {
|
|
1259
|
+
value: "Ejecutor de agentes exclusivamente JSON para pipelines deterministas.",
|
|
1260
|
+
description: "Descripción predeterminada para la especificación del ejecutor JSON"
|
|
1261
|
+
},
|
|
1262
|
+
"agent.json.systemPrompt": {
|
|
1263
|
+
value: "Usted es un generador preciso de JSON.",
|
|
1264
|
+
description: "Prompt de sistema predeterminado para el ejecutor JSON"
|
|
1265
|
+
},
|
|
1266
|
+
"knowledge.header": {
|
|
1267
|
+
value: "# Conocimiento de referencia",
|
|
1268
|
+
description: "Encabezado para la sección de conocimiento inyectado en el prompt del sistema"
|
|
1269
|
+
},
|
|
1270
|
+
"knowledge.description": {
|
|
1271
|
+
value: "La siguiente información se proporciona como referencia. Utilícela para fundamentar sus respuestas.",
|
|
1272
|
+
description: "Descripción debajo del encabezado de conocimiento"
|
|
1273
|
+
},
|
|
1274
|
+
"tool.knowledge.description": {
|
|
1275
|
+
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.",
|
|
1276
|
+
description: "Descripción de la herramienta de consulta de conocimiento mostrada al LLM"
|
|
1277
|
+
},
|
|
1278
|
+
"tool.knowledge.availableSpaces": {
|
|
1279
|
+
value: "Espacios de conocimiento disponibles:",
|
|
1280
|
+
description: "Etiqueta antes de listar los espacios de conocimiento disponibles"
|
|
1281
|
+
},
|
|
1282
|
+
"tool.knowledge.spaceDefault": {
|
|
1283
|
+
value: "Espacio de conocimiento",
|
|
1284
|
+
description: "Descripción de respaldo para espacios de conocimiento sin nombre"
|
|
1285
|
+
},
|
|
1286
|
+
"tool.knowledge.param.query": {
|
|
1287
|
+
value: "La pregunta o consulta de búsqueda para encontrar información relevante",
|
|
1288
|
+
description: "Descripción del parámetro para el campo de consulta"
|
|
1289
|
+
},
|
|
1290
|
+
"tool.knowledge.param.spaceKey": {
|
|
1291
|
+
value: "Espacio de conocimiento específico a consultar. Si se omite, busca en todos los espacios disponibles.",
|
|
1292
|
+
description: "Descripción del parámetro para el campo spaceKey"
|
|
1293
|
+
},
|
|
1294
|
+
"tool.knowledge.param.topK": {
|
|
1295
|
+
value: "Número máximo de resultados a devolver",
|
|
1296
|
+
description: "Descripción del parámetro para el campo topK"
|
|
1297
|
+
},
|
|
1298
|
+
"tool.knowledge.noResults": {
|
|
1299
|
+
value: "No se encontró información relevante en las bases de conocimiento.",
|
|
1300
|
+
description: "Mensaje cuando no se encuentran resultados de conocimiento"
|
|
1301
|
+
},
|
|
1302
|
+
"tool.knowledge.sourceLabel": {
|
|
1303
|
+
value: "[Fuente {index} - {space}] (relevancia: {score}%)",
|
|
1304
|
+
description: "Etiqueta para cada resultado de búsqueda de conocimiento",
|
|
1305
|
+
placeholders: [
|
|
1306
|
+
{
|
|
1307
|
+
name: "index",
|
|
1308
|
+
type: "number",
|
|
1309
|
+
description: "Índice de fuente basado en 1"
|
|
1310
|
+
},
|
|
1311
|
+
{
|
|
1312
|
+
name: "space",
|
|
1313
|
+
type: "string",
|
|
1314
|
+
description: "Nombre del espacio de conocimiento"
|
|
1315
|
+
},
|
|
1316
|
+
{
|
|
1317
|
+
name: "score",
|
|
1318
|
+
type: "number",
|
|
1319
|
+
description: "Porcentaje de relevancia"
|
|
1320
|
+
}
|
|
1321
|
+
]
|
|
1322
|
+
},
|
|
1323
|
+
"tool.fallbackDescription": {
|
|
1324
|
+
value: "Ejecutar {name}",
|
|
1325
|
+
description: "Descripción de respaldo cuando una herramienta no tiene descripción explícita",
|
|
1326
|
+
placeholders: [
|
|
1327
|
+
{
|
|
1328
|
+
name: "name",
|
|
1329
|
+
type: "string",
|
|
1330
|
+
description: "Nombre de la herramienta"
|
|
1331
|
+
}
|
|
1332
|
+
]
|
|
1333
|
+
},
|
|
1334
|
+
"tool.mcp.param.message": {
|
|
1335
|
+
value: "El mensaje o consulta a enviar al agente",
|
|
1336
|
+
description: "Servidor MCP: descripción del parámetro message"
|
|
1337
|
+
},
|
|
1338
|
+
"tool.mcp.param.sessionId": {
|
|
1339
|
+
value: "ID de sesión opcional para continuar una conversación",
|
|
1340
|
+
description: "Servidor MCP: descripción del parámetro sessionId"
|
|
1341
|
+
},
|
|
1342
|
+
"tool.mcp.agentDescription": {
|
|
1343
|
+
value: "Interactuar con el agente {key}",
|
|
1344
|
+
description: "Servidor MCP: descripción de la herramienta de agente",
|
|
1345
|
+
placeholders: [
|
|
1346
|
+
{
|
|
1347
|
+
name: "key",
|
|
1348
|
+
type: "string",
|
|
1349
|
+
description: "Clave de la especificación del agente"
|
|
1350
|
+
}
|
|
1351
|
+
]
|
|
1352
|
+
},
|
|
1353
|
+
"tool.mcp.executePrompt": {
|
|
1354
|
+
value: "Ejecute la herramienta {name} con los siguientes argumentos: {args}",
|
|
1355
|
+
description: "Servidor MCP: prompt enviado al ejecutar una herramienta individual",
|
|
1356
|
+
placeholders: [
|
|
1357
|
+
{
|
|
1358
|
+
name: "name",
|
|
1359
|
+
type: "string",
|
|
1360
|
+
description: "Nombre de la herramienta"
|
|
1361
|
+
},
|
|
1362
|
+
{
|
|
1363
|
+
name: "args",
|
|
1364
|
+
type: "string",
|
|
1365
|
+
description: "Argumentos serializados como JSON"
|
|
1366
|
+
}
|
|
1367
|
+
]
|
|
1368
|
+
},
|
|
1369
|
+
"tool.mcp.toolDescription": {
|
|
1370
|
+
value: "Ejecutar la herramienta {name}",
|
|
1371
|
+
description: "Servidor MCP: descripción de herramienta individual",
|
|
1372
|
+
placeholders: [
|
|
1373
|
+
{
|
|
1374
|
+
name: "name",
|
|
1375
|
+
type: "string",
|
|
1376
|
+
description: "Nombre de la herramienta"
|
|
1377
|
+
}
|
|
1378
|
+
]
|
|
1379
|
+
},
|
|
1380
|
+
"interop.prompt.agentIdentity": {
|
|
1381
|
+
value: "# Identidad del agente",
|
|
1382
|
+
description: "Encabezado de sección para la identidad del agente en el prompt del LLM"
|
|
1383
|
+
},
|
|
1384
|
+
"interop.prompt.youAre": {
|
|
1385
|
+
value: "Usted es {key} (v{version}).",
|
|
1386
|
+
description: "Declaración de identidad del agente en el prompt del LLM",
|
|
1387
|
+
placeholders: [
|
|
1388
|
+
{ name: "key", type: "string" },
|
|
1389
|
+
{ name: "version", type: "string" }
|
|
1390
|
+
]
|
|
1391
|
+
},
|
|
1392
|
+
"interop.prompt.description": {
|
|
1393
|
+
value: "## Descripción",
|
|
1394
|
+
description: "Encabezado de sección para la descripción"
|
|
1395
|
+
},
|
|
1396
|
+
"interop.prompt.instructions": {
|
|
1397
|
+
value: "## Instrucciones",
|
|
1398
|
+
description: "Encabezado de sección para las instrucciones"
|
|
1399
|
+
},
|
|
1400
|
+
"interop.prompt.availableTools": {
|
|
1401
|
+
value: "## Herramientas disponibles",
|
|
1402
|
+
description: "Encabezado de sección para las herramientas disponibles"
|
|
1403
|
+
},
|
|
1404
|
+
"interop.prompt.toolsIntro": {
|
|
1405
|
+
value: "Usted tiene acceso a las siguientes herramientas:",
|
|
1406
|
+
description: "Introducción antes de listar las herramientas"
|
|
1407
|
+
},
|
|
1408
|
+
"interop.prompt.parameters": {
|
|
1409
|
+
value: "Parámetros:",
|
|
1410
|
+
description: "Etiqueta antes del bloque de parámetros de la herramienta"
|
|
1411
|
+
},
|
|
1412
|
+
"interop.prompt.knowledgeContext": {
|
|
1413
|
+
value: "## Contexto de conocimiento",
|
|
1414
|
+
description: "Encabezado de sección para el contexto de conocimiento"
|
|
1415
|
+
},
|
|
1416
|
+
"interop.prompt.additionalContext": {
|
|
1417
|
+
value: "## Contexto adicional",
|
|
1418
|
+
description: "Encabezado de sección para el contexto adicional"
|
|
1419
|
+
},
|
|
1420
|
+
"interop.md.toc": {
|
|
1421
|
+
value: "## Tabla de contenidos",
|
|
1422
|
+
description: "Encabezado de tabla de contenidos"
|
|
1423
|
+
},
|
|
1424
|
+
"interop.md.overview": {
|
|
1425
|
+
value: "## Resumen general",
|
|
1426
|
+
description: "Encabezado de resumen general"
|
|
1427
|
+
},
|
|
1428
|
+
"interop.md.tools": {
|
|
1429
|
+
value: "## Herramientas",
|
|
1430
|
+
description: "Encabezado de herramientas"
|
|
1431
|
+
},
|
|
1432
|
+
"interop.md.knowledge": {
|
|
1433
|
+
value: "## Conocimiento",
|
|
1434
|
+
description: "Encabezado de conocimiento"
|
|
1435
|
+
},
|
|
1436
|
+
"interop.md.policy": {
|
|
1437
|
+
value: "## Política",
|
|
1438
|
+
description: "Encabezado de política"
|
|
1439
|
+
},
|
|
1440
|
+
"interop.md.metaKey": {
|
|
1441
|
+
value: "- **Clave**: `{key}`",
|
|
1442
|
+
description: "Línea de metadatos para la clave",
|
|
1443
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
1444
|
+
},
|
|
1445
|
+
"interop.md.metaVersion": {
|
|
1446
|
+
value: "- **Versión**: {version}",
|
|
1447
|
+
description: "Línea de metadatos para la versión",
|
|
1448
|
+
placeholders: [{ name: "version", type: "string" }]
|
|
1449
|
+
},
|
|
1450
|
+
"interop.md.metaStability": {
|
|
1451
|
+
value: "- **Estabilidad**: {stability}",
|
|
1452
|
+
description: "Línea de metadatos para la estabilidad",
|
|
1453
|
+
placeholders: [{ name: "stability", type: "string" }]
|
|
1454
|
+
},
|
|
1455
|
+
"interop.md.metaOwners": {
|
|
1456
|
+
value: "- **Propietarios**: {owners}",
|
|
1457
|
+
description: "Línea de metadatos para los propietarios",
|
|
1458
|
+
placeholders: [{ name: "owners", type: "string" }]
|
|
1459
|
+
},
|
|
1460
|
+
"interop.md.metaTags": {
|
|
1461
|
+
value: "- **Etiquetas**: {tags}",
|
|
1462
|
+
description: "Línea de metadatos para las etiquetas",
|
|
1463
|
+
placeholders: [{ name: "tags", type: "string" }]
|
|
1464
|
+
},
|
|
1465
|
+
"interop.md.schema": {
|
|
1466
|
+
value: "**Esquema:**",
|
|
1467
|
+
description: "Etiqueta de esquema"
|
|
1468
|
+
},
|
|
1469
|
+
"interop.md.automationSafe": {
|
|
1470
|
+
value: "**Seguro para automatización**: {value}",
|
|
1471
|
+
description: "Campo de seguridad para automatización",
|
|
1472
|
+
placeholders: [{ name: "value", type: "string" }]
|
|
1473
|
+
},
|
|
1474
|
+
"interop.md.required": {
|
|
1475
|
+
value: "(obligatorio)",
|
|
1476
|
+
description: "Marcador de obligatorio"
|
|
1477
|
+
},
|
|
1478
|
+
"interop.md.optional": {
|
|
1479
|
+
value: "(opcional)",
|
|
1480
|
+
description: "Marcador de opcional"
|
|
1481
|
+
},
|
|
1482
|
+
"interop.md.minConfidence": {
|
|
1483
|
+
value: "- **Confianza mínima**: {min}",
|
|
1484
|
+
description: "Línea de política de confianza mínima",
|
|
1485
|
+
placeholders: [{ name: "min", type: "number" }]
|
|
1486
|
+
},
|
|
1487
|
+
"interop.md.escalationThreshold": {
|
|
1488
|
+
value: "- **Umbral de escalamiento**: {threshold}",
|
|
1489
|
+
description: "Línea de política de umbral de escalamiento",
|
|
1490
|
+
placeholders: [{ name: "threshold", type: "number" }]
|
|
1491
|
+
},
|
|
1492
|
+
"interop.md.escalateToolFailure": {
|
|
1493
|
+
value: "- **Escalar ante fallo de herramienta**: Sí",
|
|
1494
|
+
description: "Línea de política de escalamiento ante fallo de herramienta"
|
|
1495
|
+
},
|
|
1496
|
+
"interop.md.escalateTimeout": {
|
|
1497
|
+
value: "- **Escalar ante tiempo de espera agotado**: Sí",
|
|
1498
|
+
description: "Línea de política de escalamiento ante tiempo de espera"
|
|
1499
|
+
},
|
|
1500
|
+
"interop.md.yes": { value: "Sí", description: "Etiqueta de Sí" },
|
|
1501
|
+
"interop.md.no": { value: "No", description: "Etiqueta de No" },
|
|
1502
|
+
"error.jsonRunner.requiresModel": {
|
|
1503
|
+
value: "createAgentJsonRunner requiere un modelo o configuración de proveedor",
|
|
1504
|
+
description: "Error cuando el ejecutor JSON no tiene modelo ni proveedor"
|
|
1505
|
+
},
|
|
1506
|
+
"error.missingToolHandler": {
|
|
1507
|
+
value: "Falta el manejador para la herramienta: {name}",
|
|
1508
|
+
description: "Error cuando un manejador de herramienta no está registrado",
|
|
1509
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1510
|
+
},
|
|
1511
|
+
"error.unknownBackend": {
|
|
1512
|
+
value: "Backend desconocido: {backend}",
|
|
1513
|
+
description: "Error cuando se especifica un backend desconocido",
|
|
1514
|
+
placeholders: [{ name: "backend", type: "string" }]
|
|
1515
|
+
},
|
|
1516
|
+
"error.claudeSdk.notAvailable": {
|
|
1517
|
+
value: "Claude Agent SDK no disponible. Instale @anthropic-ai/claude-agent-sdk",
|
|
1518
|
+
description: "Error cuando el Claude Agent SDK no está disponible"
|
|
1519
|
+
},
|
|
1520
|
+
"error.claudeSdk.notInstalled": {
|
|
1521
|
+
value: "Claude Agent SDK no instalado. Ejecute: npm install @anthropic-ai/claude-agent-sdk",
|
|
1522
|
+
description: "Error cuando no se encuentra el módulo del Claude Agent SDK"
|
|
1523
|
+
},
|
|
1524
|
+
"error.opencodeSdk.notAvailable": {
|
|
1525
|
+
value: "OpenCode SDK no disponible. Instale @opencode-ai/sdk",
|
|
1526
|
+
description: "Error cuando el OpenCode SDK no está disponible"
|
|
1527
|
+
},
|
|
1528
|
+
"error.opencodeSdk.notInstalled": {
|
|
1529
|
+
value: "OpenCode SDK no instalado. Ejecute: npm install @opencode-ai/sdk",
|
|
1530
|
+
description: "Error cuando no se encuentra el módulo del OpenCode SDK"
|
|
1531
|
+
},
|
|
1532
|
+
"error.providerNotInitialized": {
|
|
1533
|
+
value: "Proveedor no inicializado",
|
|
1534
|
+
description: "Error cuando el proveedor no ha sido inicializado antes de su uso"
|
|
1535
|
+
},
|
|
1536
|
+
"error.agentKeyRequired": {
|
|
1537
|
+
value: "La clave del agente es obligatoria",
|
|
1538
|
+
description: "Error de validación: falta la clave del agente"
|
|
1539
|
+
},
|
|
1540
|
+
"error.agentMissingVersion": {
|
|
1541
|
+
value: "Al agente {key} le falta una versión de tipo cadena",
|
|
1542
|
+
description: "Error de validación: la versión no es una cadena de texto",
|
|
1543
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
1544
|
+
},
|
|
1545
|
+
"error.agentRequiresInstructions": {
|
|
1546
|
+
value: "El agente {key} requiere instrucciones",
|
|
1547
|
+
description: "Error de validación: faltan instrucciones",
|
|
1548
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
1549
|
+
},
|
|
1550
|
+
"error.agentRequiresTool": {
|
|
1551
|
+
value: "El agente {key} debe exponer al menos una herramienta",
|
|
1552
|
+
description: "Error de validación: no hay herramientas definidas",
|
|
1553
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
1554
|
+
},
|
|
1555
|
+
"error.agentDuplicateTool": {
|
|
1556
|
+
value: "El agente {key} tiene un nombre de herramienta duplicado: {name}",
|
|
1557
|
+
description: "Error de validación: nombre de herramienta duplicado",
|
|
1558
|
+
placeholders: [
|
|
1559
|
+
{ name: "key", type: "string" },
|
|
1560
|
+
{ name: "name", type: "string" }
|
|
1561
|
+
]
|
|
1562
|
+
},
|
|
1563
|
+
"error.agentSpecNotFound": {
|
|
1564
|
+
value: "Especificación de agente no encontrada para {name}",
|
|
1565
|
+
description: "Error cuando la especificación del agente no está en el registro",
|
|
1566
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1567
|
+
},
|
|
1568
|
+
"error.specNotFound": {
|
|
1569
|
+
value: "Especificación no encontrada: {specKey}",
|
|
1570
|
+
description: "Error cuando no se encuentra una clave de especificación",
|
|
1571
|
+
placeholders: [{ name: "specKey", type: "string" }]
|
|
1572
|
+
},
|
|
1573
|
+
"error.toolNotFound": {
|
|
1574
|
+
value: "Herramienta no encontrada: {name}",
|
|
1575
|
+
description: "Error cuando no se encuentra una herramienta",
|
|
1576
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1577
|
+
},
|
|
1578
|
+
"error.noHandlerForTool": {
|
|
1579
|
+
value: "No hay manejador registrado para la herramienta: {name}",
|
|
1580
|
+
description: "Error cuando no hay manejador registrado para una herramienta",
|
|
1581
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1582
|
+
},
|
|
1583
|
+
"error.noToolHandler": {
|
|
1584
|
+
value: "Sin manejador para la herramienta: {name}",
|
|
1585
|
+
description: "Error breve cuando no existe manejador",
|
|
1586
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1587
|
+
},
|
|
1588
|
+
"error.unknownExportFormat": {
|
|
1589
|
+
value: "Formato de exportación desconocido: {format}",
|
|
1590
|
+
description: "Error para formato de exportación no soportado",
|
|
1591
|
+
placeholders: [{ name: "format", type: "string" }]
|
|
1592
|
+
},
|
|
1593
|
+
"error.handlerNotFoundForTool": {
|
|
1594
|
+
value: "Manejador no encontrado para la herramienta {name}",
|
|
1595
|
+
description: "Error en el puente de herramientas cuando falta el manejador",
|
|
1596
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1597
|
+
},
|
|
1598
|
+
"error.toolNotFoundOrNoHandler": {
|
|
1599
|
+
value: "Error: La herramienta '{name}' no fue encontrada o no tiene manejador",
|
|
1600
|
+
description: "Error devuelto al LLM cuando la ejecución de la herramienta falla",
|
|
1601
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1602
|
+
},
|
|
1603
|
+
"error.toolNoExecuteHandler": {
|
|
1604
|
+
value: "La herramienta {name} no tiene manejador de ejecución",
|
|
1605
|
+
description: "Error cuando la herramienta carece de una función de ejecución",
|
|
1606
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1607
|
+
},
|
|
1608
|
+
"error.provider.notRegistered": {
|
|
1609
|
+
value: "no registrado",
|
|
1610
|
+
description: "Razón de disponibilidad del proveedor: no registrado"
|
|
1611
|
+
},
|
|
1612
|
+
"error.provider.depsNotInstalled": {
|
|
1613
|
+
value: "dependencias no instaladas o no configuradas",
|
|
1614
|
+
description: "Razón de disponibilidad del proveedor: faltan dependencias"
|
|
1615
|
+
},
|
|
1616
|
+
"error.provider.sdkNotConfigured": {
|
|
1617
|
+
value: "SDK no instalado o clave de API no configurada",
|
|
1618
|
+
description: "Razón de disponibilidad del proveedor: falta SDK o clave"
|
|
1619
|
+
},
|
|
1620
|
+
"error.provider.claudeSdkMissing": {
|
|
1621
|
+
value: "@anthropic-ai/claude-agent-sdk no está instalado",
|
|
1622
|
+
description: "Error cuando falla require.resolve del Claude Agent SDK"
|
|
1623
|
+
},
|
|
1624
|
+
"error.provider.opencodeSdkMissing": {
|
|
1625
|
+
value: "@opencode-ai/sdk no está instalado",
|
|
1626
|
+
description: "Error cuando falla require.resolve del OpenCode SDK"
|
|
1627
|
+
},
|
|
1628
|
+
"error.provider.sdkNotInstalled": {
|
|
1629
|
+
value: "SDK no instalado",
|
|
1630
|
+
description: "Error genérico del proveedor: SDK no instalado"
|
|
1631
|
+
},
|
|
1632
|
+
"error.provider.contextCreation": {
|
|
1633
|
+
value: "Error al crear el contexto: {error}",
|
|
1634
|
+
description: "Error durante la creación del contexto del proveedor",
|
|
1635
|
+
placeholders: [{ name: "error", type: "string" }]
|
|
1636
|
+
},
|
|
1637
|
+
"error.provider.executionFailed": {
|
|
1638
|
+
value: "La ejecución falló: {error}",
|
|
1639
|
+
description: "Error durante la ejecución del proveedor",
|
|
1640
|
+
placeholders: [{ name: "error", type: "string" }]
|
|
1641
|
+
},
|
|
1642
|
+
"error.provider.streamFailed": {
|
|
1643
|
+
value: "El stream falló: {error}",
|
|
1644
|
+
description: "Error durante el streaming del proveedor",
|
|
1645
|
+
placeholders: [{ name: "error", type: "string" }]
|
|
1646
|
+
},
|
|
1647
|
+
"export.agentConfiguration": {
|
|
1648
|
+
value: "# Configuración del agente",
|
|
1649
|
+
description: "Encabezado Markdown"
|
|
1650
|
+
},
|
|
1651
|
+
"export.metadata": {
|
|
1652
|
+
value: "## Metadatos",
|
|
1653
|
+
description: "Encabezado Markdown"
|
|
1654
|
+
},
|
|
1655
|
+
"export.metaName": {
|
|
1656
|
+
value: "- **Nombre**: {name}",
|
|
1657
|
+
description: "Línea de metadatos",
|
|
1658
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1659
|
+
},
|
|
1660
|
+
"export.metaVersion": {
|
|
1661
|
+
value: "- **Versión**: {version}",
|
|
1662
|
+
description: "Línea de metadatos",
|
|
1663
|
+
placeholders: [{ name: "version", type: "string" }]
|
|
1664
|
+
},
|
|
1665
|
+
"export.metaOwners": {
|
|
1666
|
+
value: "- **Propietarios**: {owners}",
|
|
1667
|
+
description: "Línea de metadatos",
|
|
1668
|
+
placeholders: [{ name: "owners", type: "string" }]
|
|
1669
|
+
},
|
|
1670
|
+
"export.metaModel": {
|
|
1671
|
+
value: "- **Modelo**: {model}",
|
|
1672
|
+
description: "Línea de metadatos",
|
|
1673
|
+
placeholders: [{ name: "model", type: "string" }]
|
|
1674
|
+
},
|
|
1675
|
+
"export.instructions": {
|
|
1676
|
+
value: "## Instrucciones",
|
|
1677
|
+
description: "Encabezado Markdown"
|
|
1678
|
+
},
|
|
1679
|
+
"export.availableTools": {
|
|
1680
|
+
value: "## Herramientas disponibles",
|
|
1681
|
+
description: "Encabezado Markdown"
|
|
1682
|
+
},
|
|
1683
|
+
"export.tools": {
|
|
1684
|
+
value: "## Herramientas",
|
|
1685
|
+
description: "Encabezado Markdown"
|
|
1686
|
+
},
|
|
1687
|
+
"export.knowledgeSources": {
|
|
1688
|
+
value: "## Fuentes de conocimiento",
|
|
1689
|
+
description: "Encabezado Markdown"
|
|
1690
|
+
},
|
|
1691
|
+
"export.policy": {
|
|
1692
|
+
value: "## Política",
|
|
1693
|
+
description: "Encabezado Markdown"
|
|
1694
|
+
},
|
|
1695
|
+
"export.additionalContext": {
|
|
1696
|
+
value: "## Contexto adicional",
|
|
1697
|
+
description: "Encabezado Markdown"
|
|
1698
|
+
},
|
|
1699
|
+
"export.configuration": {
|
|
1700
|
+
value: "## Configuración",
|
|
1701
|
+
description: "Encabezado Markdown"
|
|
1702
|
+
},
|
|
1703
|
+
"export.mcpServers": {
|
|
1704
|
+
value: "## Servidores MCP",
|
|
1705
|
+
description: "Encabezado Markdown"
|
|
1706
|
+
},
|
|
1707
|
+
"export.parameters": {
|
|
1708
|
+
value: "**Parámetros:**",
|
|
1709
|
+
description: "Etiqueta de parámetros"
|
|
1710
|
+
},
|
|
1711
|
+
"export.requiresApproval": {
|
|
1712
|
+
value: "requiere aprobación",
|
|
1713
|
+
description: "Indicador de herramienta"
|
|
1714
|
+
},
|
|
1715
|
+
"export.notAutomationSafe": {
|
|
1716
|
+
value: "no es seguro para automatización",
|
|
1717
|
+
description: "Indicador de herramienta"
|
|
1718
|
+
},
|
|
1719
|
+
"export.requiresApprovalMd": {
|
|
1720
|
+
value: "*(requiere aprobación)*",
|
|
1721
|
+
description: "Indicador de herramienta en Markdown"
|
|
1722
|
+
},
|
|
1723
|
+
"export.notAutomationSafeMd": {
|
|
1724
|
+
value: "*(no es seguro para automatización)*",
|
|
1725
|
+
description: "Indicador de herramienta en Markdown"
|
|
1726
|
+
},
|
|
1727
|
+
"export.required": {
|
|
1728
|
+
value: "(obligatorio)",
|
|
1729
|
+
description: "Marcador de obligatorio"
|
|
1730
|
+
},
|
|
1731
|
+
"export.optional": {
|
|
1732
|
+
value: "(opcional)",
|
|
1733
|
+
description: "Marcador de opcional"
|
|
1734
|
+
},
|
|
1735
|
+
"export.minConfidence": {
|
|
1736
|
+
value: "- Confianza mínima: {min}",
|
|
1737
|
+
description: "Línea de política",
|
|
1738
|
+
placeholders: [{ name: "min", type: "number" }]
|
|
1739
|
+
},
|
|
1740
|
+
"export.escalationConfigured": {
|
|
1741
|
+
value: "- La política de escalamiento está configurada",
|
|
1742
|
+
description: "Línea de política para el prompt del sistema"
|
|
1743
|
+
},
|
|
1744
|
+
"export.escalationPolicyConfigured": {
|
|
1745
|
+
value: "- Política de escalamiento configurada",
|
|
1746
|
+
description: "Línea de política para la exportación en Markdown"
|
|
1747
|
+
},
|
|
1748
|
+
"export.featureFlags": {
|
|
1749
|
+
value: "- Indicadores de características: {flags}",
|
|
1750
|
+
description: "Línea de política de indicadores de características",
|
|
1751
|
+
placeholders: [{ name: "flags", type: "string" }]
|
|
1752
|
+
},
|
|
1753
|
+
"export.generatedFrom": {
|
|
1754
|
+
value: "*Generado desde ContractSpec: {key}*",
|
|
1755
|
+
description: "Línea de atribución en el pie",
|
|
1756
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
1757
|
+
},
|
|
1758
|
+
"export.exportedAt": {
|
|
1759
|
+
value: "*Exportado el: {date}*",
|
|
1760
|
+
description: "Marca de tiempo en el pie",
|
|
1761
|
+
placeholders: [{ name: "date", type: "string" }]
|
|
1762
|
+
},
|
|
1763
|
+
"export.agentType": {
|
|
1764
|
+
value: "> Tipo de agente: **{type}**",
|
|
1765
|
+
description: "Llamada de tipo de agente",
|
|
1766
|
+
placeholders: [{ name: "type", type: "string" }]
|
|
1767
|
+
},
|
|
1768
|
+
"export.noDescription": {
|
|
1769
|
+
value: "Sin descripción",
|
|
1770
|
+
description: "Texto de respaldo cuando la herramienta no tiene descripción"
|
|
1771
|
+
},
|
|
1772
|
+
"export.validation.requiresKey": {
|
|
1773
|
+
value: "La especificación debe tener una meta.key",
|
|
1774
|
+
description: "Error de validación"
|
|
1775
|
+
},
|
|
1776
|
+
"export.validation.requiresInstructions": {
|
|
1777
|
+
value: "La especificación debe tener instrucciones",
|
|
1778
|
+
description: "Error de validación"
|
|
1779
|
+
},
|
|
1780
|
+
"export.validation.requiresTool": {
|
|
1781
|
+
value: "La especificación debe tener al menos una herramienta",
|
|
1782
|
+
description: "Error de validación"
|
|
1783
|
+
},
|
|
1784
|
+
"export.validation.toolRequiresName": {
|
|
1785
|
+
value: "Todas las herramientas deben tener un nombre",
|
|
1786
|
+
description: "Error de validación"
|
|
1787
|
+
},
|
|
1788
|
+
"export.validation.toolRequiresDescOrName": {
|
|
1789
|
+
value: "La herramienta debe tener una descripción o un nombre",
|
|
1790
|
+
description: "Error de validación"
|
|
1791
|
+
},
|
|
1792
|
+
"export.validation.toolInvalidName": {
|
|
1793
|
+
value: "El nombre de herramienta '{name}' debe ser un identificador válido (letras, números, guiones bajos)",
|
|
1794
|
+
description: "Error de validación para nombre de herramienta inválido",
|
|
1795
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1796
|
+
},
|
|
1797
|
+
"export.agentType.build": {
|
|
1798
|
+
value: "Agente principal con acceso completo a herramientas para la generación y modificación de código.",
|
|
1799
|
+
description: "Descripción del tipo de agente de construcción"
|
|
1800
|
+
},
|
|
1801
|
+
"export.agentType.plan": {
|
|
1802
|
+
value: "Agente restringido para análisis y planificación. Las ediciones de archivos y los comandos bash requieren aprobación.",
|
|
1803
|
+
description: "Descripción del tipo de agente de planificación"
|
|
1804
|
+
},
|
|
1805
|
+
"export.agentType.general": {
|
|
1806
|
+
value: "Subagente de propósito general para preguntas complejas y tareas de múltiples pasos.",
|
|
1807
|
+
description: "Descripción del tipo de agente general"
|
|
1808
|
+
},
|
|
1809
|
+
"export.agentType.explore": {
|
|
1810
|
+
value: "Subagente rápido optimizado para exploración de código y búsqueda de patrones.",
|
|
1811
|
+
description: "Descripción del tipo de agente de exploración"
|
|
1812
|
+
},
|
|
1813
|
+
"export.bridge.requiresApproval": {
|
|
1814
|
+
value: "(requiere aprobación)",
|
|
1815
|
+
description: "Etiqueta de permiso de herramienta"
|
|
1816
|
+
},
|
|
1817
|
+
"export.bridge.askMode": {
|
|
1818
|
+
value: "(modo consulta)",
|
|
1819
|
+
description: "Etiqueta de permiso de herramienta"
|
|
1820
|
+
},
|
|
1821
|
+
"approval.toolRequiresApproval": {
|
|
1822
|
+
value: 'La herramienta "{name}" requiere aprobación',
|
|
1823
|
+
description: "Razón predeterminada para solicitudes de aprobación de herramientas",
|
|
1824
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1825
|
+
},
|
|
1826
|
+
"log.unifiedAgent.fallback": {
|
|
1827
|
+
value: "[UnifiedAgent] {backend} falló, recurriendo a {fallback}",
|
|
1828
|
+
description: "Advertencia cuando un backend falla y se utiliza el respaldo",
|
|
1829
|
+
placeholders: [
|
|
1830
|
+
{ name: "backend", type: "string" },
|
|
1831
|
+
{ name: "fallback", type: "string" }
|
|
1832
|
+
]
|
|
1833
|
+
},
|
|
1834
|
+
"log.knowledge.spaceNotAvailable": {
|
|
1835
|
+
value: 'El espacio de conocimiento requerido "{key}" no está disponible',
|
|
1836
|
+
description: "Advertencia cuando un espacio de conocimiento requerido no existe",
|
|
1837
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
1838
|
+
},
|
|
1839
|
+
"log.knowledge.loadFailed": {
|
|
1840
|
+
value: 'Error al cargar el conocimiento requerido "{key}":',
|
|
1841
|
+
description: "Advertencia cuando falla la carga de conocimiento",
|
|
1842
|
+
placeholders: [{ name: "key", type: "string" }]
|
|
1843
|
+
},
|
|
1844
|
+
"log.knowledge.queryFailed": {
|
|
1845
|
+
value: "Error al consultar el espacio de conocimiento {space}:",
|
|
1846
|
+
description: "Advertencia cuando falla la consulta de conocimiento",
|
|
1847
|
+
placeholders: [{ name: "space", type: "string" }]
|
|
1848
|
+
},
|
|
1849
|
+
"log.mcpServer.started": {
|
|
1850
|
+
value: "[MCPToolServer] Iniciado {name}@{version} con {count} herramientas",
|
|
1851
|
+
description: "Mensaje de registro cuando el servidor de herramientas MCP se inicia",
|
|
1852
|
+
placeholders: [
|
|
1853
|
+
{ name: "name", type: "string" },
|
|
1854
|
+
{ name: "version", type: "string" },
|
|
1855
|
+
{ name: "count", type: "number" }
|
|
1856
|
+
]
|
|
1857
|
+
},
|
|
1858
|
+
"log.mcpServer.stopped": {
|
|
1859
|
+
value: "[MCPToolServer] Detenido {name}",
|
|
1860
|
+
description: "Mensaje de registro cuando el servidor de herramientas MCP se detiene",
|
|
1861
|
+
placeholders: [{ name: "name", type: "string" }]
|
|
1862
|
+
}
|
|
1863
|
+
}
|
|
1864
|
+
});
|
|
1865
|
+
});
|
|
1866
|
+
|
|
1867
|
+
// src/i18n/locale.ts
|
|
1868
|
+
function resolveLocale(specLocale, runtimeLocale) {
|
|
1869
|
+
const raw = runtimeLocale ?? specLocale ?? DEFAULT_LOCALE;
|
|
1870
|
+
if (isSupportedLocale(raw)) {
|
|
1871
|
+
return raw;
|
|
1872
|
+
}
|
|
1873
|
+
const base = raw.split("-")[0];
|
|
1874
|
+
if (base && isSupportedLocale(base)) {
|
|
1875
|
+
return base;
|
|
1876
|
+
}
|
|
1877
|
+
return DEFAULT_LOCALE;
|
|
1878
|
+
}
|
|
1879
|
+
function isSupportedLocale(locale) {
|
|
1880
|
+
return SUPPORTED_LOCALES.includes(locale);
|
|
1881
|
+
}
|
|
1882
|
+
var DEFAULT_LOCALE = "en", SUPPORTED_LOCALES;
|
|
1883
|
+
var init_locale = __esm(() => {
|
|
1884
|
+
SUPPORTED_LOCALES = ["en", "fr", "es"];
|
|
1885
|
+
});
|
|
1886
|
+
|
|
1887
|
+
// src/i18n/messages.ts
|
|
1888
|
+
import { TranslationRegistry } from "@contractspec/lib.contracts/translations";
|
|
1889
|
+
function getRegistry() {
|
|
1890
|
+
if (!sharedRegistry) {
|
|
1891
|
+
sharedRegistry = new TranslationRegistry([
|
|
1892
|
+
enMessages,
|
|
1893
|
+
frMessages,
|
|
1894
|
+
esMessages
|
|
1895
|
+
]);
|
|
1896
|
+
}
|
|
1897
|
+
return sharedRegistry;
|
|
1898
|
+
}
|
|
1899
|
+
function interpolate(template, params) {
|
|
1900
|
+
if (!params)
|
|
1901
|
+
return template;
|
|
1902
|
+
return template.replace(/\{(\w+)\}/g, (match, key) => {
|
|
1903
|
+
if (key in params) {
|
|
1904
|
+
return String(params[key]);
|
|
1905
|
+
}
|
|
1906
|
+
return match;
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1909
|
+
function createAgentI18n(specLocale, runtimeLocale) {
|
|
1910
|
+
const locale = resolveLocale(specLocale, runtimeLocale);
|
|
1911
|
+
const registry = getRegistry();
|
|
1912
|
+
return {
|
|
1913
|
+
locale,
|
|
1914
|
+
t(key, params) {
|
|
1915
|
+
const raw = registry.getValue(SPEC_KEY, key, locale, key);
|
|
1916
|
+
return interpolate(raw, params);
|
|
1917
|
+
}
|
|
1918
|
+
};
|
|
1919
|
+
}
|
|
1920
|
+
function getDefaultI18n() {
|
|
1921
|
+
return createAgentI18n(DEFAULT_LOCALE);
|
|
1922
|
+
}
|
|
1923
|
+
function resetI18nRegistry() {
|
|
1924
|
+
sharedRegistry = null;
|
|
1925
|
+
}
|
|
1926
|
+
var SPEC_KEY = "ai-agent.messages", sharedRegistry = null;
|
|
1927
|
+
var init_messages = __esm(() => {
|
|
1928
|
+
init_en();
|
|
1929
|
+
init_fr();
|
|
1930
|
+
init_es();
|
|
1931
|
+
init_locale();
|
|
1932
|
+
});
|
|
1933
|
+
|
|
1934
|
+
// src/i18n/keys.ts
|
|
1935
|
+
var AGENT_KEYS, KNOWLEDGE_KEYS, TOOL_KEYS, INTEROP_KEYS, ERROR_KEYS, EXPORT_KEYS, APPROVAL_KEYS, LOG_KEYS, I18N_KEYS;
|
|
1936
|
+
var init_keys = __esm(() => {
|
|
1937
|
+
AGENT_KEYS = {
|
|
1938
|
+
"agent.json.rules.validJsonOnly": "agent.json.rules.validJsonOnly",
|
|
1939
|
+
"agent.json.rules.noMarkdownFences": "agent.json.rules.noMarkdownFences",
|
|
1940
|
+
"agent.json.rules.noCommentary": "agent.json.rules.noCommentary",
|
|
1941
|
+
"agent.json.rules.doubleQuotes": "agent.json.rules.doubleQuotes",
|
|
1942
|
+
"agent.json.rules.noTrailingCommas": "agent.json.rules.noTrailingCommas",
|
|
1943
|
+
"agent.json.defaultDescription": "agent.json.defaultDescription",
|
|
1944
|
+
"agent.json.systemPrompt": "agent.json.systemPrompt"
|
|
1945
|
+
};
|
|
1946
|
+
KNOWLEDGE_KEYS = {
|
|
1947
|
+
"knowledge.header": "knowledge.header",
|
|
1948
|
+
"knowledge.description": "knowledge.description"
|
|
1949
|
+
};
|
|
1950
|
+
TOOL_KEYS = {
|
|
1951
|
+
"tool.knowledge.description": "tool.knowledge.description",
|
|
1952
|
+
"tool.knowledge.availableSpaces": "tool.knowledge.availableSpaces",
|
|
1953
|
+
"tool.knowledge.spaceDefault": "tool.knowledge.spaceDefault",
|
|
1954
|
+
"tool.knowledge.param.query": "tool.knowledge.param.query",
|
|
1955
|
+
"tool.knowledge.param.spaceKey": "tool.knowledge.param.spaceKey",
|
|
1956
|
+
"tool.knowledge.param.topK": "tool.knowledge.param.topK",
|
|
1957
|
+
"tool.knowledge.noResults": "tool.knowledge.noResults",
|
|
1958
|
+
"tool.knowledge.sourceLabel": "tool.knowledge.sourceLabel",
|
|
1959
|
+
"tool.fallbackDescription": "tool.fallbackDescription",
|
|
1960
|
+
"tool.mcp.param.message": "tool.mcp.param.message",
|
|
1961
|
+
"tool.mcp.param.sessionId": "tool.mcp.param.sessionId",
|
|
1962
|
+
"tool.mcp.agentDescription": "tool.mcp.agentDescription",
|
|
1963
|
+
"tool.mcp.executePrompt": "tool.mcp.executePrompt",
|
|
1964
|
+
"tool.mcp.toolDescription": "tool.mcp.toolDescription"
|
|
1965
|
+
};
|
|
1966
|
+
INTEROP_KEYS = {
|
|
1967
|
+
"interop.prompt.agentIdentity": "interop.prompt.agentIdentity",
|
|
1968
|
+
"interop.prompt.youAre": "interop.prompt.youAre",
|
|
1969
|
+
"interop.prompt.description": "interop.prompt.description",
|
|
1970
|
+
"interop.prompt.instructions": "interop.prompt.instructions",
|
|
1971
|
+
"interop.prompt.availableTools": "interop.prompt.availableTools",
|
|
1972
|
+
"interop.prompt.toolsIntro": "interop.prompt.toolsIntro",
|
|
1973
|
+
"interop.prompt.parameters": "interop.prompt.parameters",
|
|
1974
|
+
"interop.prompt.knowledgeContext": "interop.prompt.knowledgeContext",
|
|
1975
|
+
"interop.prompt.additionalContext": "interop.prompt.additionalContext",
|
|
1976
|
+
"interop.md.toc": "interop.md.toc",
|
|
1977
|
+
"interop.md.overview": "interop.md.overview",
|
|
1978
|
+
"interop.md.tools": "interop.md.tools",
|
|
1979
|
+
"interop.md.knowledge": "interop.md.knowledge",
|
|
1980
|
+
"interop.md.policy": "interop.md.policy",
|
|
1981
|
+
"interop.md.metaKey": "interop.md.metaKey",
|
|
1982
|
+
"interop.md.metaVersion": "interop.md.metaVersion",
|
|
1983
|
+
"interop.md.metaStability": "interop.md.metaStability",
|
|
1984
|
+
"interop.md.metaOwners": "interop.md.metaOwners",
|
|
1985
|
+
"interop.md.metaTags": "interop.md.metaTags",
|
|
1986
|
+
"interop.md.schema": "interop.md.schema",
|
|
1987
|
+
"interop.md.automationSafe": "interop.md.automationSafe",
|
|
1988
|
+
"interop.md.required": "interop.md.required",
|
|
1989
|
+
"interop.md.optional": "interop.md.optional",
|
|
1990
|
+
"interop.md.minConfidence": "interop.md.minConfidence",
|
|
1991
|
+
"interop.md.escalationThreshold": "interop.md.escalationThreshold",
|
|
1992
|
+
"interop.md.escalateToolFailure": "interop.md.escalateToolFailure",
|
|
1993
|
+
"interop.md.escalateTimeout": "interop.md.escalateTimeout",
|
|
1994
|
+
"interop.md.yes": "interop.md.yes",
|
|
1995
|
+
"interop.md.no": "interop.md.no"
|
|
1996
|
+
};
|
|
1997
|
+
ERROR_KEYS = {
|
|
1998
|
+
"error.jsonRunner.requiresModel": "error.jsonRunner.requiresModel",
|
|
1999
|
+
"error.missingToolHandler": "error.missingToolHandler",
|
|
2000
|
+
"error.unknownBackend": "error.unknownBackend",
|
|
2001
|
+
"error.claudeSdk.notAvailable": "error.claudeSdk.notAvailable",
|
|
2002
|
+
"error.claudeSdk.notInstalled": "error.claudeSdk.notInstalled",
|
|
2003
|
+
"error.opencodeSdk.notAvailable": "error.opencodeSdk.notAvailable",
|
|
2004
|
+
"error.opencodeSdk.notInstalled": "error.opencodeSdk.notInstalled",
|
|
2005
|
+
"error.providerNotInitialized": "error.providerNotInitialized",
|
|
2006
|
+
"error.agentKeyRequired": "error.agentKeyRequired",
|
|
2007
|
+
"error.agentMissingVersion": "error.agentMissingVersion",
|
|
2008
|
+
"error.agentRequiresInstructions": "error.agentRequiresInstructions",
|
|
2009
|
+
"error.agentRequiresTool": "error.agentRequiresTool",
|
|
2010
|
+
"error.agentDuplicateTool": "error.agentDuplicateTool",
|
|
2011
|
+
"error.agentSpecNotFound": "error.agentSpecNotFound",
|
|
2012
|
+
"error.specNotFound": "error.specNotFound",
|
|
2013
|
+
"error.toolNotFound": "error.toolNotFound",
|
|
2014
|
+
"error.noHandlerForTool": "error.noHandlerForTool",
|
|
2015
|
+
"error.noToolHandler": "error.noToolHandler",
|
|
2016
|
+
"error.unknownExportFormat": "error.unknownExportFormat",
|
|
2017
|
+
"error.handlerNotFoundForTool": "error.handlerNotFoundForTool",
|
|
2018
|
+
"error.toolNotFoundOrNoHandler": "error.toolNotFoundOrNoHandler",
|
|
2019
|
+
"error.toolNoExecuteHandler": "error.toolNoExecuteHandler",
|
|
2020
|
+
"error.provider.notRegistered": "error.provider.notRegistered",
|
|
2021
|
+
"error.provider.depsNotInstalled": "error.provider.depsNotInstalled",
|
|
2022
|
+
"error.provider.sdkNotConfigured": "error.provider.sdkNotConfigured",
|
|
2023
|
+
"error.provider.claudeSdkMissing": "error.provider.claudeSdkMissing",
|
|
2024
|
+
"error.provider.opencodeSdkMissing": "error.provider.opencodeSdkMissing",
|
|
2025
|
+
"error.provider.sdkNotInstalled": "error.provider.sdkNotInstalled",
|
|
2026
|
+
"error.provider.contextCreation": "error.provider.contextCreation",
|
|
2027
|
+
"error.provider.executionFailed": "error.provider.executionFailed",
|
|
2028
|
+
"error.provider.streamFailed": "error.provider.streamFailed"
|
|
2029
|
+
};
|
|
2030
|
+
EXPORT_KEYS = {
|
|
2031
|
+
"export.agentConfiguration": "export.agentConfiguration",
|
|
2032
|
+
"export.metadata": "export.metadata",
|
|
2033
|
+
"export.metaName": "export.metaName",
|
|
2034
|
+
"export.metaVersion": "export.metaVersion",
|
|
2035
|
+
"export.metaOwners": "export.metaOwners",
|
|
2036
|
+
"export.metaModel": "export.metaModel",
|
|
2037
|
+
"export.instructions": "export.instructions",
|
|
2038
|
+
"export.availableTools": "export.availableTools",
|
|
2039
|
+
"export.tools": "export.tools",
|
|
2040
|
+
"export.knowledgeSources": "export.knowledgeSources",
|
|
2041
|
+
"export.policy": "export.policy",
|
|
2042
|
+
"export.additionalContext": "export.additionalContext",
|
|
2043
|
+
"export.configuration": "export.configuration",
|
|
2044
|
+
"export.mcpServers": "export.mcpServers",
|
|
2045
|
+
"export.parameters": "export.parameters",
|
|
2046
|
+
"export.requiresApproval": "export.requiresApproval",
|
|
2047
|
+
"export.notAutomationSafe": "export.notAutomationSafe",
|
|
2048
|
+
"export.requiresApprovalMd": "export.requiresApprovalMd",
|
|
2049
|
+
"export.notAutomationSafeMd": "export.notAutomationSafeMd",
|
|
2050
|
+
"export.required": "export.required",
|
|
2051
|
+
"export.optional": "export.optional",
|
|
2052
|
+
"export.minConfidence": "export.minConfidence",
|
|
2053
|
+
"export.escalationConfigured": "export.escalationConfigured",
|
|
2054
|
+
"export.escalationPolicyConfigured": "export.escalationPolicyConfigured",
|
|
2055
|
+
"export.featureFlags": "export.featureFlags",
|
|
2056
|
+
"export.generatedFrom": "export.generatedFrom",
|
|
2057
|
+
"export.exportedAt": "export.exportedAt",
|
|
2058
|
+
"export.agentType": "export.agentType",
|
|
2059
|
+
"export.noDescription": "export.noDescription",
|
|
2060
|
+
"export.validation.requiresKey": "export.validation.requiresKey",
|
|
2061
|
+
"export.validation.requiresInstructions": "export.validation.requiresInstructions",
|
|
2062
|
+
"export.validation.requiresTool": "export.validation.requiresTool",
|
|
2063
|
+
"export.validation.toolRequiresName": "export.validation.toolRequiresName",
|
|
2064
|
+
"export.validation.toolRequiresDescOrName": "export.validation.toolRequiresDescOrName",
|
|
2065
|
+
"export.validation.toolInvalidName": "export.validation.toolInvalidName",
|
|
2066
|
+
"export.agentType.build": "export.agentType.build",
|
|
2067
|
+
"export.agentType.plan": "export.agentType.plan",
|
|
2068
|
+
"export.agentType.general": "export.agentType.general",
|
|
2069
|
+
"export.agentType.explore": "export.agentType.explore",
|
|
2070
|
+
"export.bridge.requiresApproval": "export.bridge.requiresApproval",
|
|
2071
|
+
"export.bridge.askMode": "export.bridge.askMode"
|
|
2072
|
+
};
|
|
2073
|
+
APPROVAL_KEYS = {
|
|
2074
|
+
"approval.toolRequiresApproval": "approval.toolRequiresApproval"
|
|
2075
|
+
};
|
|
2076
|
+
LOG_KEYS = {
|
|
2077
|
+
"log.unifiedAgent.fallback": "log.unifiedAgent.fallback",
|
|
2078
|
+
"log.knowledge.spaceNotAvailable": "log.knowledge.spaceNotAvailable",
|
|
2079
|
+
"log.knowledge.loadFailed": "log.knowledge.loadFailed",
|
|
2080
|
+
"log.knowledge.queryFailed": "log.knowledge.queryFailed",
|
|
2081
|
+
"log.mcpServer.started": "log.mcpServer.started",
|
|
2082
|
+
"log.mcpServer.stopped": "log.mcpServer.stopped"
|
|
2083
|
+
};
|
|
2084
|
+
I18N_KEYS = {
|
|
2085
|
+
...AGENT_KEYS,
|
|
2086
|
+
...KNOWLEDGE_KEYS,
|
|
2087
|
+
...TOOL_KEYS,
|
|
2088
|
+
...INTEROP_KEYS,
|
|
2089
|
+
...ERROR_KEYS,
|
|
2090
|
+
...EXPORT_KEYS,
|
|
2091
|
+
...APPROVAL_KEYS,
|
|
2092
|
+
...LOG_KEYS
|
|
2093
|
+
};
|
|
2094
|
+
});
|
|
2095
|
+
|
|
2096
|
+
// src/i18n/index.ts
|
|
2097
|
+
var init_i18n = __esm(() => {
|
|
2098
|
+
init_messages();
|
|
2099
|
+
init_locale();
|
|
2100
|
+
init_keys();
|
|
2101
|
+
init_en();
|
|
2102
|
+
init_fr();
|
|
2103
|
+
init_es();
|
|
2104
|
+
});
|
|
2105
|
+
|
|
15
2106
|
// src/spec/spec.ts
|
|
16
2107
|
function defineAgent(spec) {
|
|
2108
|
+
const i18n = getDefaultI18n();
|
|
17
2109
|
if (!spec.meta?.key) {
|
|
18
|
-
throw new Error("
|
|
2110
|
+
throw new Error(i18n.t("error.agentKeyRequired"));
|
|
19
2111
|
}
|
|
20
2112
|
if (typeof spec.meta.version !== "string") {
|
|
21
|
-
throw new Error(
|
|
2113
|
+
throw new Error(i18n.t("error.agentMissingVersion", { key: spec.meta.key }));
|
|
22
2114
|
}
|
|
23
2115
|
if (!spec.instructions?.trim()) {
|
|
24
|
-
throw new Error(
|
|
2116
|
+
throw new Error(i18n.t("error.agentRequiresInstructions", { key: spec.meta.key }));
|
|
25
2117
|
}
|
|
26
2118
|
if (!spec.tools?.length) {
|
|
27
|
-
throw new Error(
|
|
2119
|
+
throw new Error(i18n.t("error.agentRequiresTool", { key: spec.meta.key }));
|
|
28
2120
|
}
|
|
29
2121
|
const toolNames = new Set;
|
|
30
2122
|
for (const tool of spec.tools) {
|
|
31
2123
|
if (toolNames.has(tool.name)) {
|
|
32
|
-
throw new Error(
|
|
2124
|
+
throw new Error(i18n.t("error.agentDuplicateTool", {
|
|
2125
|
+
key: spec.meta.key,
|
|
2126
|
+
name: tool.name
|
|
2127
|
+
}));
|
|
33
2128
|
}
|
|
34
2129
|
toolNames.add(tool.name);
|
|
35
2130
|
}
|
|
@@ -38,6 +2133,9 @@ function defineAgent(spec) {
|
|
|
38
2133
|
function agentKey(meta) {
|
|
39
2134
|
return `${meta.key}.v${meta.version}`;
|
|
40
2135
|
}
|
|
2136
|
+
var init_spec = __esm(() => {
|
|
2137
|
+
init_i18n();
|
|
2138
|
+
});
|
|
41
2139
|
|
|
42
2140
|
// src/schema/json-schema-to-zod.ts
|
|
43
2141
|
import { z } from "zod";
|
|
@@ -197,7 +2295,7 @@ function specToolsToAISDKTools(specTools, handlers, context = {}) {
|
|
|
197
2295
|
for (const specTool of specTools) {
|
|
198
2296
|
const handler = handlers.get(specTool.name);
|
|
199
2297
|
if (!handler) {
|
|
200
|
-
throw new Error(
|
|
2298
|
+
throw new Error(getDefaultI18n().t("error.missingToolHandler", { name: specTool.name }));
|
|
201
2299
|
}
|
|
202
2300
|
tools[specTool.name] = specToolToAISDKTool(specTool, handler, context);
|
|
203
2301
|
}
|
|
@@ -213,27 +2311,29 @@ function buildToolHandlers(handlersObj) {
|
|
|
213
2311
|
}
|
|
214
2312
|
var init_tool_adapter = __esm(() => {
|
|
215
2313
|
init_json_schema_to_zod();
|
|
2314
|
+
init_i18n();
|
|
216
2315
|
});
|
|
217
2316
|
|
|
218
2317
|
// src/tools/knowledge-tool.ts
|
|
219
2318
|
import { tool as tool2 } from "ai";
|
|
220
2319
|
import * as z2 from "zod";
|
|
221
|
-
function createKnowledgeQueryTool(retriever, knowledgeRefs) {
|
|
2320
|
+
function createKnowledgeQueryTool(retriever, knowledgeRefs, locale) {
|
|
2321
|
+
const i18n = createAgentI18n(locale);
|
|
222
2322
|
const optionalSpaces = knowledgeRefs.filter((k) => !k.required).map((k) => k.key).filter((key) => retriever.supportsSpace(key));
|
|
223
2323
|
if (optionalSpaces.length === 0) {
|
|
224
2324
|
return null;
|
|
225
2325
|
}
|
|
226
|
-
const spaceDescriptions = knowledgeRefs.filter((k) => !k.required && retriever.supportsSpace(k.key)).map((k) => `- ${k.key}: ${k.instructions ?? "
|
|
2326
|
+
const spaceDescriptions = knowledgeRefs.filter((k) => !k.required && retriever.supportsSpace(k.key)).map((k) => `- ${k.key}: ${k.instructions ?? i18n.t("tool.knowledge.spaceDefault")}`).join(`
|
|
227
2327
|
`);
|
|
228
2328
|
return tool2({
|
|
229
|
-
description:
|
|
2329
|
+
description: `${i18n.t("tool.knowledge.description")}
|
|
230
2330
|
|
|
231
|
-
|
|
2331
|
+
${i18n.t("tool.knowledge.availableSpaces")}
|
|
232
2332
|
${spaceDescriptions}`,
|
|
233
2333
|
inputSchema: z2.object({
|
|
234
|
-
query: z2.string().describe("
|
|
235
|
-
spaceKey: z2.enum(optionalSpaces).optional().describe("
|
|
236
|
-
topK: z2.number().optional().default(5).describe("
|
|
2334
|
+
query: z2.string().describe(i18n.t("tool.knowledge.param.query")),
|
|
2335
|
+
spaceKey: z2.enum(optionalSpaces).optional().describe(i18n.t("tool.knowledge.param.spaceKey")),
|
|
2336
|
+
topK: z2.number().optional().default(5).describe(i18n.t("tool.knowledge.param.topK"))
|
|
237
2337
|
}),
|
|
238
2338
|
execute: async ({ query, spaceKey, topK }) => {
|
|
239
2339
|
const spacesToSearch = spaceKey ? [spaceKey] : optionalSpaces;
|
|
@@ -252,15 +2352,15 @@ ${spaceDescriptions}`,
|
|
|
252
2352
|
});
|
|
253
2353
|
}
|
|
254
2354
|
} catch (error) {
|
|
255
|
-
console.warn(
|
|
2355
|
+
console.warn(i18n.t("log.knowledge.queryFailed", { space }), error);
|
|
256
2356
|
}
|
|
257
2357
|
}
|
|
258
2358
|
if (allResults.length === 0) {
|
|
259
|
-
return "
|
|
2359
|
+
return i18n.t("tool.knowledge.noResults");
|
|
260
2360
|
}
|
|
261
2361
|
allResults.sort((a, b) => b.score - a.score);
|
|
262
2362
|
const topResults = allResults.slice(0, topK ?? 5);
|
|
263
|
-
return topResults.map((r, i) =>
|
|
2363
|
+
return topResults.map((r, i) => `${i18n.t("tool.knowledge.sourceLabel", { index: i + 1, space: r.space, score: (r.score * 100).toFixed(0) })}
|
|
264
2364
|
${r.content}`).join(`
|
|
265
2365
|
|
|
266
2366
|
---
|
|
@@ -269,19 +2369,22 @@ ${r.content}`).join(`
|
|
|
269
2369
|
}
|
|
270
2370
|
});
|
|
271
2371
|
}
|
|
272
|
-
var init_knowledge_tool = () => {
|
|
2372
|
+
var init_knowledge_tool = __esm(() => {
|
|
2373
|
+
init_i18n();
|
|
2374
|
+
});
|
|
273
2375
|
|
|
274
2376
|
// src/knowledge/injector.ts
|
|
275
|
-
async function injectStaticKnowledge(instructions, knowledgeRefs, retriever) {
|
|
2377
|
+
async function injectStaticKnowledge(instructions, knowledgeRefs, retriever, locale) {
|
|
276
2378
|
if (!retriever)
|
|
277
2379
|
return instructions;
|
|
278
2380
|
const requiredRefs = knowledgeRefs.filter((ref) => ref.required);
|
|
279
2381
|
if (requiredRefs.length === 0)
|
|
280
2382
|
return instructions;
|
|
2383
|
+
const i18n = createAgentI18n(locale);
|
|
281
2384
|
const blocks = [];
|
|
282
2385
|
for (const ref of requiredRefs) {
|
|
283
2386
|
if (!retriever.supportsSpace(ref.key)) {
|
|
284
|
-
console.warn(
|
|
2387
|
+
console.warn(i18n.t("log.knowledge.spaceNotAvailable", { key: ref.key }));
|
|
285
2388
|
continue;
|
|
286
2389
|
}
|
|
287
2390
|
try {
|
|
@@ -294,7 +2397,7 @@ ${ref.instructions}` : `## ${ref.key}`;
|
|
|
294
2397
|
${content}`);
|
|
295
2398
|
}
|
|
296
2399
|
} catch (error) {
|
|
297
|
-
console.warn(
|
|
2400
|
+
console.warn(i18n.t("log.knowledge.loadFailed", { key: ref.key }), error);
|
|
298
2401
|
}
|
|
299
2402
|
}
|
|
300
2403
|
if (blocks.length === 0)
|
|
@@ -303,9 +2406,9 @@ ${content}`);
|
|
|
303
2406
|
|
|
304
2407
|
---
|
|
305
2408
|
|
|
306
|
-
#
|
|
2409
|
+
# ${i18n.t("knowledge.header")}
|
|
307
2410
|
|
|
308
|
-
|
|
2411
|
+
${i18n.t("knowledge.description")}
|
|
309
2412
|
|
|
310
2413
|
${blocks.join(`
|
|
311
2414
|
|
|
@@ -313,13 +2416,16 @@ ${blocks.join(`
|
|
|
313
2416
|
|
|
314
2417
|
`)}`;
|
|
315
2418
|
}
|
|
316
|
-
function createKnowledgeInjector(retriever) {
|
|
2419
|
+
function createKnowledgeInjector(retriever, locale) {
|
|
317
2420
|
return {
|
|
318
|
-
inject: (instructions, knowledgeRefs) => injectStaticKnowledge(instructions, knowledgeRefs, retriever),
|
|
2421
|
+
inject: (instructions, knowledgeRefs) => injectStaticKnowledge(instructions, knowledgeRefs, retriever, locale),
|
|
319
2422
|
hasSpace: (spaceKey) => retriever?.supportsSpace(spaceKey) ?? false,
|
|
320
2423
|
listSpaces: () => retriever?.listSpaces() ?? []
|
|
321
2424
|
};
|
|
322
2425
|
}
|
|
2426
|
+
var init_injector = __esm(() => {
|
|
2427
|
+
init_i18n();
|
|
2428
|
+
});
|
|
323
2429
|
|
|
324
2430
|
// src/session/store.ts
|
|
325
2431
|
class InMemorySessionStore {
|
|
@@ -457,6 +2563,118 @@ var init_adapter = __esm(() => {
|
|
|
457
2563
|
};
|
|
458
2564
|
});
|
|
459
2565
|
|
|
2566
|
+
// src/telemetry/posthog.ts
|
|
2567
|
+
var exports_posthog = {};
|
|
2568
|
+
__export(exports_posthog, {
|
|
2569
|
+
createPostHogTracedModel: () => createPostHogTracedModel,
|
|
2570
|
+
createPostHogTelemetryCollector: () => createPostHogTelemetryCollector,
|
|
2571
|
+
createCompositeTelemetryCollector: () => createCompositeTelemetryCollector,
|
|
2572
|
+
PostHogTelemetryCollector: () => PostHogTelemetryCollector,
|
|
2573
|
+
CompositeTelemetryCollector: () => CompositeTelemetryCollector
|
|
2574
|
+
});
|
|
2575
|
+
async function createPostHogTracedModel(model, config, overrides) {
|
|
2576
|
+
const { withTracing } = await importPostHogAI();
|
|
2577
|
+
const phClient = await resolvePostHogClient(config);
|
|
2578
|
+
const tracingOptions = {
|
|
2579
|
+
...config.defaults,
|
|
2580
|
+
...overrides
|
|
2581
|
+
};
|
|
2582
|
+
return withTracing(model, phClient, tracingOptions);
|
|
2583
|
+
}
|
|
2584
|
+
|
|
2585
|
+
class PostHogTelemetryCollector {
|
|
2586
|
+
phClient;
|
|
2587
|
+
config;
|
|
2588
|
+
initPromise;
|
|
2589
|
+
constructor(config) {
|
|
2590
|
+
this.config = config;
|
|
2591
|
+
this.phClient = config.client;
|
|
2592
|
+
}
|
|
2593
|
+
async collect(sample) {
|
|
2594
|
+
const client = await this.getClient();
|
|
2595
|
+
const distinctId = this.config.defaults?.posthogDistinctId ?? sample.metadata?.["actorId"] ?? "system";
|
|
2596
|
+
client.capture({
|
|
2597
|
+
distinctId,
|
|
2598
|
+
event: "$ai_generation",
|
|
2599
|
+
properties: {
|
|
2600
|
+
$ai_model: sample.operation.name,
|
|
2601
|
+
$ai_provider: "contractspec",
|
|
2602
|
+
$ai_latency: sample.durationMs / 1000,
|
|
2603
|
+
$ai_is_error: !sample.success,
|
|
2604
|
+
$ai_trace_id: this.config.defaults?.posthogTraceId,
|
|
2605
|
+
...sample.metadata?.["tokenUsage"] ? mapTokenUsage(sample.metadata["tokenUsage"]) : {},
|
|
2606
|
+
...this.config.defaults?.posthogProperties,
|
|
2607
|
+
contractspec_operation: sample.operation.name,
|
|
2608
|
+
contractspec_version: sample.operation.version,
|
|
2609
|
+
contractspec_agent_id: sample.metadata?.["agentId"],
|
|
2610
|
+
contractspec_finish_reason: sample.metadata?.["finishReason"],
|
|
2611
|
+
contractspec_tool_count: sample.metadata?.["toolCallCount"]
|
|
2612
|
+
},
|
|
2613
|
+
groups: this.config.defaults?.posthogGroups
|
|
2614
|
+
});
|
|
2615
|
+
}
|
|
2616
|
+
async shutdown() {
|
|
2617
|
+
if (this.phClient?.shutdown) {
|
|
2618
|
+
await this.phClient.shutdown();
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
async getClient() {
|
|
2622
|
+
if (this.phClient)
|
|
2623
|
+
return this.phClient;
|
|
2624
|
+
if (!this.initPromise) {
|
|
2625
|
+
this.initPromise = resolvePostHogClient(this.config).then((client) => {
|
|
2626
|
+
this.phClient = client;
|
|
2627
|
+
return client;
|
|
2628
|
+
});
|
|
2629
|
+
}
|
|
2630
|
+
return this.initPromise;
|
|
2631
|
+
}
|
|
2632
|
+
}
|
|
2633
|
+
function createPostHogTelemetryCollector(config) {
|
|
2634
|
+
return new PostHogTelemetryCollector(config);
|
|
2635
|
+
}
|
|
2636
|
+
|
|
2637
|
+
class CompositeTelemetryCollector {
|
|
2638
|
+
collectors;
|
|
2639
|
+
constructor(collectors) {
|
|
2640
|
+
this.collectors = collectors;
|
|
2641
|
+
}
|
|
2642
|
+
async collect(sample) {
|
|
2643
|
+
await Promise.all(this.collectors.map((c) => c.collect(sample)));
|
|
2644
|
+
}
|
|
2645
|
+
}
|
|
2646
|
+
function createCompositeTelemetryCollector(collectors) {
|
|
2647
|
+
return new CompositeTelemetryCollector(collectors);
|
|
2648
|
+
}
|
|
2649
|
+
async function importPostHogAI() {
|
|
2650
|
+
try {
|
|
2651
|
+
return await import("@posthog/ai");
|
|
2652
|
+
} catch {
|
|
2653
|
+
throw new Error("PostHog LLM Analytics requires @posthog/ai to be installed. Run: npm install @posthog/ai posthog-node");
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
async function resolvePostHogClient(config) {
|
|
2657
|
+
if (config.client)
|
|
2658
|
+
return config.client;
|
|
2659
|
+
if (!config.apiKey) {
|
|
2660
|
+
throw new Error("PostHog LLM Analytics requires either a client instance or an apiKey.");
|
|
2661
|
+
}
|
|
2662
|
+
try {
|
|
2663
|
+
const { PostHog } = await import("posthog-node");
|
|
2664
|
+
return new PostHog(config.apiKey, {
|
|
2665
|
+
host: config.host ?? "https://us.i.posthog.com"
|
|
2666
|
+
});
|
|
2667
|
+
} catch {
|
|
2668
|
+
throw new Error("PostHog LLM Analytics requires posthog-node to be installed. Run: npm install posthog-node");
|
|
2669
|
+
}
|
|
2670
|
+
}
|
|
2671
|
+
function mapTokenUsage(usage) {
|
|
2672
|
+
return {
|
|
2673
|
+
$ai_input_tokens: usage["promptTokens"],
|
|
2674
|
+
$ai_output_tokens: usage["completionTokens"]
|
|
2675
|
+
};
|
|
2676
|
+
}
|
|
2677
|
+
|
|
460
2678
|
// src/agent/contract-spec-agent.ts
|
|
461
2679
|
var exports_contract_spec_agent = {};
|
|
462
2680
|
__export(exports_contract_spec_agent, {
|
|
@@ -494,15 +2712,21 @@ class ContractSpecAgent {
|
|
|
494
2712
|
});
|
|
495
2713
|
}
|
|
496
2714
|
static async create(config) {
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
2715
|
+
let effectiveConfig = config;
|
|
2716
|
+
if (config.posthogConfig) {
|
|
2717
|
+
const { createPostHogTracedModel: createPostHogTracedModel2 } = await Promise.resolve().then(() => exports_posthog);
|
|
2718
|
+
const tracedModel = await createPostHogTracedModel2(config.model, config.posthogConfig, config.posthogConfig.tracingOptions);
|
|
2719
|
+
effectiveConfig = { ...config, model: tracedModel };
|
|
2720
|
+
}
|
|
2721
|
+
const instructions = await injectStaticKnowledge(effectiveConfig.spec.instructions, effectiveConfig.spec.knowledge ?? [], effectiveConfig.knowledgeRetriever);
|
|
2722
|
+
const specTools = specToolsToAISDKTools(effectiveConfig.spec.tools, effectiveConfig.toolHandlers, { agentId: agentKey(effectiveConfig.spec.meta) });
|
|
2723
|
+
const knowledgeTool = effectiveConfig.knowledgeRetriever ? createKnowledgeQueryTool(effectiveConfig.knowledgeRetriever, effectiveConfig.spec.knowledge ?? []) : null;
|
|
500
2724
|
const tools = {
|
|
501
2725
|
...specTools,
|
|
502
2726
|
...knowledgeTool ? { query_knowledge: knowledgeTool } : {},
|
|
503
|
-
...
|
|
2727
|
+
...effectiveConfig.additionalTools ?? {}
|
|
504
2728
|
};
|
|
505
|
-
return new ContractSpecAgent(
|
|
2729
|
+
return new ContractSpecAgent(effectiveConfig, instructions, tools);
|
|
506
2730
|
}
|
|
507
2731
|
async generate(params) {
|
|
508
2732
|
const sessionId = params.options?.sessionId ?? generateSessionId();
|
|
@@ -590,8 +2814,10 @@ ${params.prompt}` : params.prompt;
|
|
|
590
2814
|
}
|
|
591
2815
|
var ContractSpecCallOptionsSchema;
|
|
592
2816
|
var init_contract_spec_agent = __esm(() => {
|
|
2817
|
+
init_spec();
|
|
593
2818
|
init_tool_adapter();
|
|
594
2819
|
init_knowledge_tool();
|
|
2820
|
+
init_injector();
|
|
595
2821
|
init_adapter();
|
|
596
2822
|
ContractSpecCallOptionsSchema = z3.object({
|
|
597
2823
|
tenantId: z3.string().optional(),
|
|
@@ -640,7 +2866,7 @@ var init_types = __esm(() => {
|
|
|
640
2866
|
function specToolToClaudeAgentTool(tool3, handler, context) {
|
|
641
2867
|
return {
|
|
642
2868
|
name: tool3.name,
|
|
643
|
-
description: tool3.description ??
|
|
2869
|
+
description: tool3.description ?? getDefaultI18n().t("tool.fallbackDescription", { name: tool3.name }),
|
|
644
2870
|
input_schema: normalizeSchema(tool3.schema),
|
|
645
2871
|
requires_confirmation: tool3.requiresApproval ?? !tool3.automationSafe,
|
|
646
2872
|
execute: async (input) => {
|
|
@@ -660,7 +2886,9 @@ function specToolsToClaudeAgentTools(tools, handlers, context) {
|
|
|
660
2886
|
return tools.filter((tool3) => handlers.has(tool3.name)).map((tool3) => {
|
|
661
2887
|
const handler = handlers.get(tool3.name);
|
|
662
2888
|
if (!handler) {
|
|
663
|
-
throw new Error(
|
|
2889
|
+
throw new Error(getDefaultI18n().t("error.handlerNotFoundForTool", {
|
|
2890
|
+
name: tool3.name
|
|
2891
|
+
}));
|
|
664
2892
|
}
|
|
665
2893
|
return specToolToClaudeAgentTool(tool3, handler, context);
|
|
666
2894
|
});
|
|
@@ -691,7 +2919,7 @@ function claudeAgentToolsToSpecTools(claudeTools) {
|
|
|
691
2919
|
function specToolToExternalTool(tool3, handler, context) {
|
|
692
2920
|
return {
|
|
693
2921
|
name: tool3.name,
|
|
694
|
-
description: tool3.description ??
|
|
2922
|
+
description: tool3.description ?? getDefaultI18n().t("tool.fallbackDescription", { name: tool3.name }),
|
|
695
2923
|
inputSchema: tool3.schema ?? { type: "object" },
|
|
696
2924
|
requiresApproval: tool3.requiresApproval ?? !tool3.automationSafe,
|
|
697
2925
|
execute: handler ? async (input) => {
|
|
@@ -732,6 +2960,9 @@ function extractToolCalls(response) {
|
|
|
732
2960
|
args: block.input
|
|
733
2961
|
}));
|
|
734
2962
|
}
|
|
2963
|
+
var init_tool_bridge = __esm(() => {
|
|
2964
|
+
init_i18n();
|
|
2965
|
+
});
|
|
735
2966
|
|
|
736
2967
|
// src/providers/claude-agent-sdk/session-bridge.ts
|
|
737
2968
|
function toClaudeAgentSession(state) {
|
|
@@ -884,7 +3115,7 @@ class ClaudeAgentSDKProvider {
|
|
|
884
3115
|
}
|
|
885
3116
|
async createContext(spec) {
|
|
886
3117
|
if (!this.isAvailable()) {
|
|
887
|
-
throw new ProviderNotAvailableError(this.name, "
|
|
3118
|
+
throw new ProviderNotAvailableError(this.name, getDefaultI18n().t("error.provider.sdkNotConfigured"));
|
|
888
3119
|
}
|
|
889
3120
|
try {
|
|
890
3121
|
const toolSet = {};
|
|
@@ -909,7 +3140,9 @@ class ClaudeAgentSDKProvider {
|
|
|
909
3140
|
cleanup: async () => {}
|
|
910
3141
|
};
|
|
911
3142
|
} catch (error) {
|
|
912
|
-
throw new ContextCreationError(this.name,
|
|
3143
|
+
throw new ContextCreationError(this.name, getDefaultI18n().t("error.provider.contextCreation", {
|
|
3144
|
+
error: error instanceof Error ? error.message : String(error)
|
|
3145
|
+
}), error instanceof Error ? error : undefined);
|
|
913
3146
|
}
|
|
914
3147
|
}
|
|
915
3148
|
async execute(context, params) {
|
|
@@ -965,7 +3198,9 @@ ${params.systemOverride}` : context.spec.instructions;
|
|
|
965
3198
|
}
|
|
966
3199
|
};
|
|
967
3200
|
} catch (error) {
|
|
968
|
-
throw new ProviderExecutionError(this.name,
|
|
3201
|
+
throw new ProviderExecutionError(this.name, getDefaultI18n().t("error.provider.executionFailed", {
|
|
3202
|
+
error: error instanceof Error ? error.message : String(error)
|
|
3203
|
+
}), error instanceof Error ? error : undefined);
|
|
969
3204
|
}
|
|
970
3205
|
}
|
|
971
3206
|
async* stream(context, params) {
|
|
@@ -1045,7 +3280,9 @@ ${params.systemOverride}` : context.spec.instructions;
|
|
|
1045
3280
|
}
|
|
1046
3281
|
};
|
|
1047
3282
|
} catch (error) {
|
|
1048
|
-
throw new ProviderExecutionError(this.name,
|
|
3283
|
+
throw new ProviderExecutionError(this.name, getDefaultI18n().t("error.provider.streamFailed", {
|
|
3284
|
+
error: error instanceof Error ? error.message : String(error)
|
|
3285
|
+
}), error instanceof Error ? error : undefined);
|
|
1049
3286
|
}
|
|
1050
3287
|
}
|
|
1051
3288
|
async loadSDK() {
|
|
@@ -1053,7 +3290,7 @@ ${params.systemOverride}` : context.spec.instructions;
|
|
|
1053
3290
|
const module = __require("@anthropic-ai/claude-agent-sdk");
|
|
1054
3291
|
return module.default ?? module;
|
|
1055
3292
|
} catch {
|
|
1056
|
-
throw new ProviderNotAvailableError(this.name, "
|
|
3293
|
+
throw new ProviderNotAvailableError(this.name, getDefaultI18n().t("error.provider.claudeSdkMissing"));
|
|
1057
3294
|
}
|
|
1058
3295
|
}
|
|
1059
3296
|
prepareToolsForSDK(context, params) {
|
|
@@ -1063,7 +3300,9 @@ ${params.systemOverride}` : context.spec.instructions;
|
|
|
1063
3300
|
if (externalTool?.execute) {
|
|
1064
3301
|
handlers.set(tool3.name, async (input) => {
|
|
1065
3302
|
if (!externalTool.execute) {
|
|
1066
|
-
throw new Error(
|
|
3303
|
+
throw new Error(getDefaultI18n().t("error.toolNoExecuteHandler", {
|
|
3304
|
+
name: tool3.name
|
|
3305
|
+
}));
|
|
1067
3306
|
}
|
|
1068
3307
|
const result = await externalTool.execute(input);
|
|
1069
3308
|
return typeof result === "string" ? result : JSON.stringify(result);
|
|
@@ -1085,7 +3324,9 @@ ${params.systemOverride}` : context.spec.instructions;
|
|
|
1085
3324
|
return {
|
|
1086
3325
|
toolCallId: toolCall.toolCallId,
|
|
1087
3326
|
toolName: toolCall.toolName,
|
|
1088
|
-
output:
|
|
3327
|
+
output: getDefaultI18n().t("error.toolNotFoundOrNoHandler", {
|
|
3328
|
+
name: toolCall.toolName
|
|
3329
|
+
})
|
|
1089
3330
|
};
|
|
1090
3331
|
}
|
|
1091
3332
|
try {
|
|
@@ -1127,7 +3368,11 @@ ${params.systemOverride}` : context.spec.instructions;
|
|
|
1127
3368
|
}
|
|
1128
3369
|
}
|
|
1129
3370
|
var init_adapter2 = __esm(() => {
|
|
3371
|
+
init_spec();
|
|
1130
3372
|
init_types();
|
|
3373
|
+
init_tool_bridge();
|
|
3374
|
+
init_injector();
|
|
3375
|
+
init_i18n();
|
|
1131
3376
|
});
|
|
1132
3377
|
|
|
1133
3378
|
// src/providers/claude-agent-sdk/index.ts
|
|
@@ -1157,13 +3402,14 @@ __export(exports_claude_agent_sdk, {
|
|
|
1157
3402
|
});
|
|
1158
3403
|
var init_claude_agent_sdk = __esm(() => {
|
|
1159
3404
|
init_adapter2();
|
|
3405
|
+
init_tool_bridge();
|
|
1160
3406
|
});
|
|
1161
3407
|
|
|
1162
3408
|
// src/providers/opencode-sdk/tool-bridge.ts
|
|
1163
3409
|
function specToolToOpenCodeTool(tool3) {
|
|
1164
3410
|
return {
|
|
1165
3411
|
name: tool3.name,
|
|
1166
|
-
description: tool3.description ??
|
|
3412
|
+
description: tool3.description ?? getDefaultI18n().t("tool.fallbackDescription", { name: tool3.name }),
|
|
1167
3413
|
parameters: normalizeToOpenCodeParameters(tool3.schema),
|
|
1168
3414
|
permission: getPermissionLevel(tool3)
|
|
1169
3415
|
};
|
|
@@ -1195,7 +3441,7 @@ function openCodeToolsToSpecTools(openCodeTools) {
|
|
|
1195
3441
|
function specToolToExternalToolForOpenCode(tool3, handler, context) {
|
|
1196
3442
|
return {
|
|
1197
3443
|
name: tool3.name,
|
|
1198
|
-
description: tool3.description ??
|
|
3444
|
+
description: tool3.description ?? getDefaultI18n().t("tool.fallbackDescription", { name: tool3.name }),
|
|
1199
3445
|
inputSchema: tool3.schema ?? { type: "object" },
|
|
1200
3446
|
requiresApproval: tool3.requiresApproval ?? !tool3.automationSafe,
|
|
1201
3447
|
execute: handler ? async (input) => {
|
|
@@ -1259,7 +3505,9 @@ async function executeToolCall(toolCall, handlers) {
|
|
|
1259
3505
|
if (!handler) {
|
|
1260
3506
|
return {
|
|
1261
3507
|
tool_call_id: toolCall.id,
|
|
1262
|
-
output:
|
|
3508
|
+
output: getDefaultI18n().t("error.toolNotFoundOrNoHandler", {
|
|
3509
|
+
name: toolCall.name
|
|
3510
|
+
}),
|
|
1263
3511
|
is_error: true
|
|
1264
3512
|
};
|
|
1265
3513
|
}
|
|
@@ -1277,6 +3525,9 @@ async function executeToolCall(toolCall, handlers) {
|
|
|
1277
3525
|
};
|
|
1278
3526
|
}
|
|
1279
3527
|
}
|
|
3528
|
+
var init_tool_bridge2 = __esm(() => {
|
|
3529
|
+
init_i18n();
|
|
3530
|
+
});
|
|
1280
3531
|
|
|
1281
3532
|
// src/providers/opencode-sdk/agent-bridge.ts
|
|
1282
3533
|
function inferAgentType(spec) {
|
|
@@ -1351,6 +3602,7 @@ function specToOpenCodeMarkdown(spec, options) {
|
|
|
1351
3602
|
};
|
|
1352
3603
|
}
|
|
1353
3604
|
function buildMarkdownBody(spec) {
|
|
3605
|
+
const i18n = getDefaultI18n();
|
|
1354
3606
|
const lines = [];
|
|
1355
3607
|
lines.push(`# ${spec.meta.key}`);
|
|
1356
3608
|
lines.push("");
|
|
@@ -1358,24 +3610,24 @@ function buildMarkdownBody(spec) {
|
|
|
1358
3610
|
lines.push(spec.description ?? spec.meta.description ?? "");
|
|
1359
3611
|
lines.push("");
|
|
1360
3612
|
}
|
|
1361
|
-
lines.push("
|
|
3613
|
+
lines.push(i18n.t("export.instructions"));
|
|
1362
3614
|
lines.push("");
|
|
1363
3615
|
lines.push(spec.instructions);
|
|
1364
3616
|
lines.push("");
|
|
1365
3617
|
if (spec.tools.length > 0) {
|
|
1366
|
-
lines.push("
|
|
3618
|
+
lines.push(i18n.t("export.tools"));
|
|
1367
3619
|
lines.push("");
|
|
1368
3620
|
for (const tool3 of spec.tools) {
|
|
1369
|
-
const permission = tool3.requiresApproval ? "
|
|
1370
|
-
lines.push(`- **${tool3.name}**: ${tool3.description ?? "
|
|
3621
|
+
const permission = tool3.requiresApproval ? i18n.t("export.bridge.requiresApproval") : tool3.automationSafe === false ? i18n.t("export.bridge.askMode") : "";
|
|
3622
|
+
lines.push(`- **${tool3.name}**: ${tool3.description ?? i18n.t("export.noDescription")} ${permission}`.trim());
|
|
1371
3623
|
}
|
|
1372
3624
|
lines.push("");
|
|
1373
3625
|
}
|
|
1374
3626
|
if (spec.knowledge && spec.knowledge.length > 0) {
|
|
1375
|
-
lines.push("
|
|
3627
|
+
lines.push(i18n.t("export.knowledgeSources"));
|
|
1376
3628
|
lines.push("");
|
|
1377
3629
|
for (const k of spec.knowledge) {
|
|
1378
|
-
const required = k.required ? "
|
|
3630
|
+
const required = k.required ? i18n.t("export.required") : i18n.t("export.optional");
|
|
1379
3631
|
lines.push(`- ${k.key} ${required}`);
|
|
1380
3632
|
}
|
|
1381
3633
|
lines.push("");
|
|
@@ -1434,7 +3686,10 @@ function openCodeConfigToSpec(config) {
|
|
|
1434
3686
|
maxSteps: config.config?.max_steps ?? 10
|
|
1435
3687
|
};
|
|
1436
3688
|
}
|
|
1437
|
-
var init_agent_bridge = () => {
|
|
3689
|
+
var init_agent_bridge = __esm(() => {
|
|
3690
|
+
init_tool_bridge2();
|
|
3691
|
+
init_i18n();
|
|
3692
|
+
});
|
|
1438
3693
|
|
|
1439
3694
|
// src/providers/opencode-sdk/adapter.ts
|
|
1440
3695
|
class OpenCodeSDKProvider {
|
|
@@ -1469,7 +3724,7 @@ class OpenCodeSDKProvider {
|
|
|
1469
3724
|
}
|
|
1470
3725
|
async createContext(spec) {
|
|
1471
3726
|
if (!this.isAvailable()) {
|
|
1472
|
-
throw new ProviderNotAvailableError(this.name, "
|
|
3727
|
+
throw new ProviderNotAvailableError(this.name, getDefaultI18n().t("error.provider.sdkNotInstalled"));
|
|
1473
3728
|
}
|
|
1474
3729
|
try {
|
|
1475
3730
|
const sdk = await this.loadSDK();
|
|
@@ -1508,7 +3763,9 @@ class OpenCodeSDKProvider {
|
|
|
1508
3763
|
}
|
|
1509
3764
|
};
|
|
1510
3765
|
} catch (error) {
|
|
1511
|
-
throw new ContextCreationError(this.name,
|
|
3766
|
+
throw new ContextCreationError(this.name, getDefaultI18n().t("error.provider.contextCreation", {
|
|
3767
|
+
error: error instanceof Error ? error.message : String(error)
|
|
3768
|
+
}), error instanceof Error ? error : undefined);
|
|
1512
3769
|
}
|
|
1513
3770
|
}
|
|
1514
3771
|
async execute(context, params) {
|
|
@@ -1556,7 +3813,9 @@ ${params.systemOverride}` : context.spec.instructions;
|
|
|
1556
3813
|
}
|
|
1557
3814
|
};
|
|
1558
3815
|
} catch (error) {
|
|
1559
|
-
throw new ProviderExecutionError(this.name,
|
|
3816
|
+
throw new ProviderExecutionError(this.name, getDefaultI18n().t("error.provider.executionFailed", {
|
|
3817
|
+
error: error instanceof Error ? error.message : String(error)
|
|
3818
|
+
}), error instanceof Error ? error : undefined);
|
|
1560
3819
|
}
|
|
1561
3820
|
}
|
|
1562
3821
|
async* stream(context, params) {
|
|
@@ -1642,7 +3901,9 @@ ${params.systemOverride}` : context.spec.instructions;
|
|
|
1642
3901
|
}
|
|
1643
3902
|
};
|
|
1644
3903
|
} catch (error) {
|
|
1645
|
-
throw new ProviderExecutionError(this.name,
|
|
3904
|
+
throw new ProviderExecutionError(this.name, getDefaultI18n().t("error.provider.streamFailed", {
|
|
3905
|
+
error: error instanceof Error ? error.message : String(error)
|
|
3906
|
+
}), error instanceof Error ? error : undefined);
|
|
1646
3907
|
}
|
|
1647
3908
|
}
|
|
1648
3909
|
async loadSDK() {
|
|
@@ -1650,7 +3911,7 @@ ${params.systemOverride}` : context.spec.instructions;
|
|
|
1650
3911
|
const module = __require("@opencode-ai/sdk");
|
|
1651
3912
|
return module;
|
|
1652
3913
|
} catch {
|
|
1653
|
-
throw new ProviderNotAvailableError(this.name, "
|
|
3914
|
+
throw new ProviderNotAvailableError(this.name, getDefaultI18n().t("error.provider.opencodeSdkMissing"));
|
|
1654
3915
|
}
|
|
1655
3916
|
}
|
|
1656
3917
|
getHostname() {
|
|
@@ -1694,8 +3955,12 @@ ${params.systemOverride}` : context.spec.instructions;
|
|
|
1694
3955
|
}
|
|
1695
3956
|
}
|
|
1696
3957
|
var init_adapter3 = __esm(() => {
|
|
3958
|
+
init_spec();
|
|
1697
3959
|
init_types();
|
|
3960
|
+
init_tool_bridge2();
|
|
1698
3961
|
init_agent_bridge();
|
|
3962
|
+
init_injector();
|
|
3963
|
+
init_i18n();
|
|
1699
3964
|
});
|
|
1700
3965
|
|
|
1701
3966
|
// src/providers/opencode-sdk/index.ts
|
|
@@ -1717,40 +3982,48 @@ __export(exports_opencode_sdk, {
|
|
|
1717
3982
|
});
|
|
1718
3983
|
var init_opencode_sdk = __esm(() => {
|
|
1719
3984
|
init_adapter3();
|
|
3985
|
+
init_tool_bridge2();
|
|
1720
3986
|
init_agent_bridge();
|
|
1721
3987
|
});
|
|
1722
3988
|
|
|
1723
3989
|
// src/agent/json-runner.ts
|
|
3990
|
+
init_i18n();
|
|
1724
3991
|
init_contract_spec_agent();
|
|
1725
3992
|
import { createProvider } from "@contractspec/lib.ai-providers/factory";
|
|
1726
3993
|
import { StabilityEnum } from "@contractspec/lib.contracts/ownership";
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
3994
|
+
function getJsonOnlyRules(locale) {
|
|
3995
|
+
const i18n = createAgentI18n(locale);
|
|
3996
|
+
return [
|
|
3997
|
+
i18n.t("agent.json.rules.validJsonOnly"),
|
|
3998
|
+
i18n.t("agent.json.rules.noMarkdownFences"),
|
|
3999
|
+
i18n.t("agent.json.rules.noCommentary"),
|
|
4000
|
+
i18n.t("agent.json.rules.doubleQuotes"),
|
|
4001
|
+
i18n.t("agent.json.rules.noTrailingCommas")
|
|
4002
|
+
].join(`
|
|
1734
4003
|
`);
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
}
|
|
4004
|
+
}
|
|
4005
|
+
function getDefaultSpec(locale) {
|
|
4006
|
+
const i18n = createAgentI18n(locale);
|
|
4007
|
+
return {
|
|
4008
|
+
meta: {
|
|
4009
|
+
key: "agent.json-runner",
|
|
4010
|
+
version: "1.0.0",
|
|
4011
|
+
description: i18n.t("agent.json.defaultDescription"),
|
|
4012
|
+
stability: StabilityEnum.Experimental,
|
|
4013
|
+
owners: ["platform.core"],
|
|
4014
|
+
tags: ["json", "agent"]
|
|
4015
|
+
},
|
|
4016
|
+
instructions: i18n.t("agent.json.systemPrompt"),
|
|
4017
|
+
tools: []
|
|
4018
|
+
};
|
|
4019
|
+
}
|
|
1747
4020
|
function resolveModel(options) {
|
|
1748
4021
|
if (options.model)
|
|
1749
4022
|
return options.model;
|
|
1750
4023
|
if (options.provider) {
|
|
1751
4024
|
return createProvider(options.provider).getModel();
|
|
1752
4025
|
}
|
|
1753
|
-
throw new Error("
|
|
4026
|
+
throw new Error(getDefaultI18n().t("error.jsonRunner.requiresModel"));
|
|
1754
4027
|
}
|
|
1755
4028
|
function applyModelSettings(model, settings) {
|
|
1756
4029
|
const { temperature } = settings;
|
|
@@ -1762,15 +4035,15 @@ function applyModelSettings(model, settings) {
|
|
|
1762
4035
|
}
|
|
1763
4036
|
return model;
|
|
1764
4037
|
}
|
|
1765
|
-
function buildInstructions(base, system) {
|
|
1766
|
-
return [base,
|
|
4038
|
+
function buildInstructions(base, locale, system) {
|
|
4039
|
+
return [base, getJsonOnlyRules(locale), system].filter(Boolean).join(`
|
|
1767
4040
|
|
|
1768
4041
|
`);
|
|
1769
4042
|
}
|
|
1770
4043
|
function ensureToolHandlers(spec, handlers) {
|
|
1771
4044
|
for (const tool3 of spec.tools) {
|
|
1772
4045
|
if (!handlers.has(tool3.name)) {
|
|
1773
|
-
throw new Error(
|
|
4046
|
+
throw new Error(getDefaultI18n().t("error.missingToolHandler", { name: tool3.name }));
|
|
1774
4047
|
}
|
|
1775
4048
|
}
|
|
1776
4049
|
}
|
|
@@ -1778,10 +4051,11 @@ async function createAgentJsonRunner(options) {
|
|
|
1778
4051
|
const model = applyModelSettings(resolveModel(options), {
|
|
1779
4052
|
temperature: options.temperature ?? 0
|
|
1780
4053
|
});
|
|
1781
|
-
const baseSpec = options.spec ??
|
|
4054
|
+
const baseSpec = options.spec ?? getDefaultSpec(options.locale);
|
|
1782
4055
|
const spec = {
|
|
1783
4056
|
...baseSpec,
|
|
1784
|
-
|
|
4057
|
+
locale: options.spec?.locale ?? options.locale,
|
|
4058
|
+
instructions: buildInstructions(baseSpec.instructions, options.locale, options.system),
|
|
1785
4059
|
maxSteps: options.maxSteps ?? baseSpec.maxSteps
|
|
1786
4060
|
};
|
|
1787
4061
|
const toolHandlers = options.toolHandlers ?? new Map;
|
|
@@ -1800,6 +4074,7 @@ async function createAgentJsonRunner(options) {
|
|
|
1800
4074
|
}
|
|
1801
4075
|
|
|
1802
4076
|
// src/agent/unified-agent.ts
|
|
4077
|
+
init_i18n();
|
|
1803
4078
|
import { createProvider as createProvider2 } from "@contractspec/lib.ai-providers/factory";
|
|
1804
4079
|
|
|
1805
4080
|
class UnifiedAgent {
|
|
@@ -1833,12 +4108,17 @@ class UnifiedAgent {
|
|
|
1833
4108
|
await this.initializeOpenCodeSDK();
|
|
1834
4109
|
break;
|
|
1835
4110
|
default:
|
|
1836
|
-
throw new Error(
|
|
4111
|
+
throw new Error(getDefaultI18n().t("error.unknownBackend", {
|
|
4112
|
+
backend: String(backend)
|
|
4113
|
+
}));
|
|
1837
4114
|
}
|
|
1838
4115
|
} catch (error) {
|
|
1839
4116
|
this.state.lastError = error instanceof Error ? error : new Error(String(error));
|
|
1840
4117
|
if (this.config.fallbackBackend && this.config.fallbackBackend !== backend) {
|
|
1841
|
-
console.warn(
|
|
4118
|
+
console.warn(getDefaultI18n().t("log.unifiedAgent.fallback", {
|
|
4119
|
+
backend: String(backend),
|
|
4120
|
+
fallback: String(this.config.fallbackBackend)
|
|
4121
|
+
}));
|
|
1842
4122
|
this.state.backend = this.config.fallbackBackend;
|
|
1843
4123
|
await this.initialize();
|
|
1844
4124
|
} else {
|
|
@@ -1852,13 +4132,13 @@ class UnifiedAgent {
|
|
|
1852
4132
|
const config = this.config.config;
|
|
1853
4133
|
this.provider = new ClaudeAgentSDKProvider2(config ?? {});
|
|
1854
4134
|
if (!this.provider.isAvailable()) {
|
|
1855
|
-
throw new Error("
|
|
4135
|
+
throw new Error(getDefaultI18n().t("error.claudeSdk.notAvailable"));
|
|
1856
4136
|
}
|
|
1857
4137
|
this.context = await this.provider.createContext(this.spec);
|
|
1858
4138
|
this.state.isReady = true;
|
|
1859
4139
|
} catch (error) {
|
|
1860
4140
|
if (error.code === "MODULE_NOT_FOUND") {
|
|
1861
|
-
throw new Error("
|
|
4141
|
+
throw new Error(getDefaultI18n().t("error.claudeSdk.notInstalled"));
|
|
1862
4142
|
}
|
|
1863
4143
|
throw error;
|
|
1864
4144
|
}
|
|
@@ -1869,13 +4149,13 @@ class UnifiedAgent {
|
|
|
1869
4149
|
const config = this.config.config;
|
|
1870
4150
|
this.provider = new OpenCodeSDKProvider2(config ?? {});
|
|
1871
4151
|
if (!this.provider.isAvailable()) {
|
|
1872
|
-
throw new Error("
|
|
4152
|
+
throw new Error(getDefaultI18n().t("error.opencodeSdk.notAvailable"));
|
|
1873
4153
|
}
|
|
1874
4154
|
this.context = await this.provider.createContext(this.spec);
|
|
1875
4155
|
this.state.isReady = true;
|
|
1876
4156
|
} catch (error) {
|
|
1877
4157
|
if (error.code === "MODULE_NOT_FOUND") {
|
|
1878
|
-
throw new Error("
|
|
4158
|
+
throw new Error(getDefaultI18n().t("error.opencodeSdk.notInstalled"));
|
|
1879
4159
|
}
|
|
1880
4160
|
throw error;
|
|
1881
4161
|
}
|
|
@@ -1894,7 +4174,9 @@ class UnifiedAgent {
|
|
|
1894
4174
|
case "opencode-sdk":
|
|
1895
4175
|
return await this.runWithExternalProvider(message, options);
|
|
1896
4176
|
default:
|
|
1897
|
-
throw new Error(
|
|
4177
|
+
throw new Error(getDefaultI18n().t("error.unknownBackend", {
|
|
4178
|
+
backend: String(backend)
|
|
4179
|
+
}));
|
|
1898
4180
|
}
|
|
1899
4181
|
} catch (error) {
|
|
1900
4182
|
this.state.lastError = error instanceof Error ? error : new Error(String(error));
|
|
@@ -1916,7 +4198,7 @@ class UnifiedAgent {
|
|
|
1916
4198
|
}
|
|
1917
4199
|
async runWithExternalProvider(message, options) {
|
|
1918
4200
|
if (!this.provider || !this.context) {
|
|
1919
|
-
throw new Error("
|
|
4201
|
+
throw new Error(getDefaultI18n().t("error.providerNotInitialized"));
|
|
1920
4202
|
}
|
|
1921
4203
|
const result = await this.provider.execute(this.context, {
|
|
1922
4204
|
prompt: message,
|