@crypto512/jicon-mcp 0.7.0 → 1.0.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/README.md +133 -381
- package/TOOL_LIST.md +810 -120
- package/dist/config/constants.d.ts +1 -0
- package/dist/config/constants.d.ts.map +1 -1
- package/dist/config/constants.js +1 -0
- package/dist/config/constants.js.map +1 -1
- package/dist/config/loader.d.ts +1 -0
- package/dist/config/loader.d.ts.map +1 -1
- package/dist/config/loader.js +27 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/types.d.ts +8 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +2 -0
- package/dist/config/types.js.map +1 -1
- package/dist/confluence/client.d.ts +38 -0
- package/dist/confluence/client.d.ts.map +1 -1
- package/dist/confluence/client.js +117 -0
- package/dist/confluence/client.js.map +1 -1
- package/dist/confluence/tools.d.ts +102 -75
- package/dist/confluence/tools.d.ts.map +1 -1
- package/dist/confluence/tools.js +510 -151
- package/dist/confluence/tools.js.map +1 -1
- package/dist/confluence/types.d.ts +55 -1
- package/dist/confluence/types.d.ts.map +1 -1
- package/dist/index.js +88 -2
- package/dist/index.js.map +1 -1
- package/dist/jira/tools.d.ts +0 -5
- package/dist/jira/tools.d.ts.map +1 -1
- package/dist/jira/tools.js +40 -87
- package/dist/jira/tools.js.map +1 -1
- package/dist/permissions/filter.d.ts +5 -0
- package/dist/permissions/filter.d.ts.map +1 -1
- package/dist/permissions/filter.js +29 -12
- package/dist/permissions/filter.js.map +1 -1
- package/dist/permissions/tool-registry.d.ts +23 -25
- package/dist/permissions/tool-registry.d.ts.map +1 -1
- package/dist/permissions/tool-registry.js +41 -45
- package/dist/permissions/tool-registry.js.map +1 -1
- package/dist/permissions/write-home-validator.d.ts +35 -0
- package/dist/permissions/write-home-validator.d.ts.map +1 -0
- package/dist/permissions/write-home-validator.js +140 -0
- package/dist/permissions/write-home-validator.js.map +1 -0
- package/dist/tempo/tools.d.ts.map +1 -1
- package/dist/tempo/tools.js +43 -44
- package/dist/tempo/tools.js.map +1 -1
- package/dist/utils/buffer-tools.d.ts +119 -1
- package/dist/utils/buffer-tools.d.ts.map +1 -1
- package/dist/utils/buffer-tools.js +610 -3
- package/dist/utils/buffer-tools.js.map +1 -1
- package/dist/utils/content-buffer.d.ts +46 -0
- package/dist/utils/content-buffer.d.ts.map +1 -1
- package/dist/utils/content-buffer.js +108 -12
- package/dist/utils/content-buffer.js.map +1 -1
- package/dist/utils/http-client.d.ts.map +1 -1
- package/dist/utils/http-client.js +4 -4
- package/dist/utils/http-client.js.map +1 -1
- package/dist/utils/jicon-help.d.ts +29 -0
- package/dist/utils/jicon-help.d.ts.map +1 -0
- package/dist/utils/jicon-help.js +873 -0
- package/dist/utils/jicon-help.js.map +1 -0
- package/dist/utils/plantuml/client.d.ts +40 -0
- package/dist/utils/plantuml/client.d.ts.map +1 -0
- package/dist/utils/plantuml/client.js +306 -0
- package/dist/utils/plantuml/client.js.map +1 -0
- package/dist/utils/plantuml/docker-manager.d.ts +35 -0
- package/dist/utils/plantuml/docker-manager.d.ts.map +1 -0
- package/dist/utils/plantuml/docker-manager.js +280 -0
- package/dist/utils/plantuml/docker-manager.js.map +1 -0
- package/dist/utils/plantuml/index.d.ts +11 -0
- package/dist/utils/plantuml/index.d.ts.map +1 -0
- package/dist/utils/plantuml/index.js +16 -0
- package/dist/utils/plantuml/index.js.map +1 -0
- package/dist/utils/plantuml/service.d.ts +46 -0
- package/dist/utils/plantuml/service.d.ts.map +1 -0
- package/dist/utils/plantuml/service.js +96 -0
- package/dist/utils/plantuml/service.js.map +1 -0
- package/dist/utils/plantuml/tools.d.ts +65 -0
- package/dist/utils/plantuml/tools.d.ts.map +1 -0
- package/dist/utils/plantuml/tools.js +272 -0
- package/dist/utils/plantuml/tools.js.map +1 -0
- package/dist/utils/plantuml/types.d.ts +130 -0
- package/dist/utils/plantuml/types.d.ts.map +1 -0
- package/dist/utils/plantuml/types.js +66 -0
- package/dist/utils/plantuml/types.js.map +1 -0
- package/dist/utils/response-formatter.d.ts +14 -0
- package/dist/utils/response-formatter.d.ts.map +1 -1
- package/dist/utils/response-formatter.js +84 -1
- package/dist/utils/response-formatter.js.map +1 -1
- package/dist/utils/url-tools.d.ts +49 -0
- package/dist/utils/url-tools.d.ts.map +1 -0
- package/dist/utils/url-tools.js +141 -0
- package/dist/utils/url-tools.js.map +1 -0
- package/dist/utils/xhtml/confluence-schema.d.ts +55 -0
- package/dist/utils/xhtml/confluence-schema.d.ts.map +1 -0
- package/dist/utils/xhtml/confluence-schema.js +215 -0
- package/dist/utils/xhtml/confluence-schema.js.map +1 -0
- package/dist/utils/xhtml/index.d.ts +17 -0
- package/dist/utils/xhtml/index.d.ts.map +1 -0
- package/dist/utils/xhtml/index.js +21 -0
- package/dist/utils/xhtml/index.js.map +1 -0
- package/dist/utils/xhtml/operations.d.ts +100 -0
- package/dist/utils/xhtml/operations.d.ts.map +1 -0
- package/dist/utils/xhtml/operations.js +596 -0
- package/dist/utils/xhtml/operations.js.map +1 -0
- package/dist/utils/xhtml/parser.d.ts +64 -0
- package/dist/utils/xhtml/parser.d.ts.map +1 -0
- package/dist/utils/xhtml/parser.js +180 -0
- package/dist/utils/xhtml/parser.js.map +1 -0
- package/dist/utils/xhtml/plantuml.d.ts +112 -0
- package/dist/utils/xhtml/plantuml.d.ts.map +1 -0
- package/dist/utils/xhtml/plantuml.js +251 -0
- package/dist/utils/xhtml/plantuml.js.map +1 -0
- package/dist/utils/xhtml/selector.d.ts +35 -0
- package/dist/utils/xhtml/selector.d.ts.map +1 -0
- package/dist/utils/xhtml/selector.js +358 -0
- package/dist/utils/xhtml/selector.js.map +1 -0
- package/dist/utils/xhtml/serializer.d.ts +26 -0
- package/dist/utils/xhtml/serializer.d.ts.map +1 -0
- package/dist/utils/xhtml/serializer.js +170 -0
- package/dist/utils/xhtml/serializer.js.map +1 -0
- package/dist/utils/xhtml/types.d.ts +134 -0
- package/dist/utils/xhtml/types.d.ts.map +1 -0
- package/dist/utils/xhtml/types.js +65 -0
- package/dist/utils/xhtml/types.js.map +1 -0
- package/dist/utils/xhtml/validator.d.ts +67 -0
- package/dist/utils/xhtml/validator.d.ts.map +1 -0
- package/dist/utils/xhtml/validator.js +300 -0
- package/dist/utils/xhtml/validator.js.map +1 -0
- package/package.json +5 -1
- package/CLAUDE.md +0 -947
- package/CONTRIBUTING.md +0 -371
- package/DEVELOPMENT.md +0 -400
- package/JIRA_API_ANALYSIS.md +0 -275
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PlantUML MCP Tools
|
|
3
|
+
*
|
|
4
|
+
* Tool definitions for PlantUML validation and rendering.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
import { formatSuccess, formatError } from "../response-formatter.js";
|
|
8
|
+
import { contentBuffer } from "../content-buffer.js";
|
|
9
|
+
import { validate, render, getStatus } from "./service.js";
|
|
10
|
+
import { PlantUmlValidateInputSchema, PlantUmlRenderInputSchema, } from "./types.js";
|
|
11
|
+
/**
|
|
12
|
+
* Maximum inline content size before buffering (16KB)
|
|
13
|
+
*/
|
|
14
|
+
const MAX_INLINE_SIZE = 16 * 1024;
|
|
15
|
+
/**
|
|
16
|
+
* Resolve PlantUML code from either direct code or bufferId
|
|
17
|
+
*/
|
|
18
|
+
function resolveCode(args) {
|
|
19
|
+
if (args.code !== undefined) {
|
|
20
|
+
return args.code;
|
|
21
|
+
}
|
|
22
|
+
if (args.bufferId !== undefined) {
|
|
23
|
+
const info = contentBuffer.getInfo(args.bufferId);
|
|
24
|
+
if (!info) {
|
|
25
|
+
throw new Error(`Buffer not found: ${args.bufferId}`);
|
|
26
|
+
}
|
|
27
|
+
const chunk = contentBuffer.getChunk(args.bufferId, 0, info.totalSize);
|
|
28
|
+
if (!chunk) {
|
|
29
|
+
throw new Error(`Failed to read buffer: ${args.bufferId}`);
|
|
30
|
+
}
|
|
31
|
+
return chunk.chunk;
|
|
32
|
+
}
|
|
33
|
+
throw new Error("Either 'code' or 'bufferId' must be provided");
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Inject maxWidth skinparam for ASCII rendering
|
|
37
|
+
*/
|
|
38
|
+
function injectMaxWidth(code, maxWidth) {
|
|
39
|
+
const skinparam = `skinparam maxMessageSize ${maxWidth}`;
|
|
40
|
+
// Inject after @startuml (including any title on same line)
|
|
41
|
+
if (/@startuml\b/i.test(code)) {
|
|
42
|
+
return code.replace(/(@startuml[^\n]*\n)/i, `$1${skinparam}\n`);
|
|
43
|
+
}
|
|
44
|
+
// If no @startuml, prepend the skinparam
|
|
45
|
+
return `${skinparam}\n${code}`;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Create PlantUML tools for MCP server
|
|
49
|
+
*/
|
|
50
|
+
export function createPlantUmlTools() {
|
|
51
|
+
return {
|
|
52
|
+
plantuml_validate: {
|
|
53
|
+
description: `Validate PlantUML diagram syntax before inserting into Confluence.
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
- valid: Whether the diagram syntax is correct
|
|
57
|
+
- diagramType: Detected type (sequence, class, activity, component, state, c4, etc.)
|
|
58
|
+
- errors: Line-level error details if invalid
|
|
59
|
+
|
|
60
|
+
Validate ONE diagram at a time. Do not pass full document content.
|
|
61
|
+
|
|
62
|
+
Example:
|
|
63
|
+
plantuml_validate(code="@startuml\\nA -> B: message\\n@enduml")
|
|
64
|
+
|
|
65
|
+
Workflow: validate → then buffer_edit_xhtml with insert-plantuml
|
|
66
|
+
For syntax help: help(topic="plantuml")`,
|
|
67
|
+
inputSchema: PlantUmlValidateInputSchema,
|
|
68
|
+
handler: async (args) => {
|
|
69
|
+
try {
|
|
70
|
+
const code = resolveCode(args);
|
|
71
|
+
// Detect if this is full document content rather than a single PlantUML diagram
|
|
72
|
+
const hasMarkdownHeaders = /^#+ /m.test(code);
|
|
73
|
+
const diagramCount = (code.match(/@startuml|@startmindmap|@startgantt|@startwbs|@startjson|@startyaml/gi) || []).length;
|
|
74
|
+
if (hasMarkdownHeaders || diagramCount > 1) {
|
|
75
|
+
return formatError({
|
|
76
|
+
error: true,
|
|
77
|
+
message: "Input appears to be document content, not a single PlantUML diagram",
|
|
78
|
+
statusCode: 400,
|
|
79
|
+
details: {
|
|
80
|
+
detected: hasMarkdownHeaders ? "Markdown headers" : `Multiple diagrams (${diagramCount})`,
|
|
81
|
+
hint: "Use plantuml_validate with a single diagram code, not full document content. Call help(topic='plantuml') for workflow.",
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
const result = await validate(code);
|
|
86
|
+
// Check if normalizedCode is large enough to buffer
|
|
87
|
+
const codeSize = Buffer.byteLength(result.normalizedCode, "utf-8");
|
|
88
|
+
if (result.valid) {
|
|
89
|
+
// Buffer large normalizedCode
|
|
90
|
+
if (codeSize > MAX_INLINE_SIZE) {
|
|
91
|
+
const bufferId = contentBuffer.store(result.normalizedCode, {
|
|
92
|
+
type: "plantuml_validate",
|
|
93
|
+
diagramType: result.diagramType,
|
|
94
|
+
});
|
|
95
|
+
return formatSuccess({
|
|
96
|
+
valid: true,
|
|
97
|
+
bufferId,
|
|
98
|
+
normalizedCodeSize: codeSize,
|
|
99
|
+
diagramType: result.diagramType,
|
|
100
|
+
message: `Valid ${result.diagramType || "unknown"} diagram (code buffered due to size)`,
|
|
101
|
+
hint: "Use buffer_get_chunk to retrieve normalizedCode",
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
return formatSuccess({
|
|
105
|
+
valid: true,
|
|
106
|
+
normalizedCode: result.normalizedCode,
|
|
107
|
+
diagramType: result.diagramType,
|
|
108
|
+
message: `Valid ${result.diagramType || "unknown"} diagram`,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
// Invalid diagram - still buffer if large
|
|
112
|
+
if (codeSize > MAX_INLINE_SIZE) {
|
|
113
|
+
const bufferId = contentBuffer.store(result.normalizedCode, {
|
|
114
|
+
type: "plantuml_validate",
|
|
115
|
+
diagramType: result.diagramType,
|
|
116
|
+
valid: false,
|
|
117
|
+
});
|
|
118
|
+
return formatSuccess({
|
|
119
|
+
valid: false,
|
|
120
|
+
bufferId,
|
|
121
|
+
normalizedCodeSize: codeSize,
|
|
122
|
+
diagramType: result.diagramType,
|
|
123
|
+
errors: result.errors,
|
|
124
|
+
message: `Invalid diagram: ${result.errors?.[0]?.message || "Unknown error"}`,
|
|
125
|
+
hint: "Run help(topic=\"plantuml\") for syntax examples",
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return formatSuccess({
|
|
129
|
+
valid: false,
|
|
130
|
+
normalizedCode: result.normalizedCode,
|
|
131
|
+
diagramType: result.diagramType,
|
|
132
|
+
errors: result.errors,
|
|
133
|
+
message: `Invalid diagram: ${result.errors?.[0]?.message || "Unknown error"}`,
|
|
134
|
+
hint: "Run help(topic=\"plantuml\") for syntax examples",
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
catch (error) {
|
|
138
|
+
// Check if it's a Docker-related error
|
|
139
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
140
|
+
if (message.includes("Docker") ||
|
|
141
|
+
message.includes("container") ||
|
|
142
|
+
message.includes("ENOENT")) {
|
|
143
|
+
return formatError({
|
|
144
|
+
error: true,
|
|
145
|
+
message: "PlantUML service unavailable - Docker may not be running",
|
|
146
|
+
statusCode: 503,
|
|
147
|
+
details: {
|
|
148
|
+
originalError: message,
|
|
149
|
+
hint: "Ensure Docker is installed and running",
|
|
150
|
+
},
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
return formatError(error instanceof Error ? error : new Error(message));
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
plantuml_render: {
|
|
158
|
+
description: `Render PlantUML diagram to a visual format for preview or export.
|
|
159
|
+
|
|
160
|
+
Formats:
|
|
161
|
+
- ascii: Text preview in terminal (use maxWidth=80 for readability)
|
|
162
|
+
- svg: Vector graphics (default)
|
|
163
|
+
- png: Image file (base64, use buffer_save_to_file to save)
|
|
164
|
+
- eps: Print-quality vector
|
|
165
|
+
|
|
166
|
+
Use ascii format to preview diagrams before inserting into Confluence.
|
|
167
|
+
|
|
168
|
+
Example:
|
|
169
|
+
plantuml_render(code="@startuml\\nA -> B\\n@enduml", format="ascii")
|
|
170
|
+
plantuml_render(code="...", format="ascii", maxWidth=80)`,
|
|
171
|
+
inputSchema: PlantUmlRenderInputSchema,
|
|
172
|
+
handler: async (args) => {
|
|
173
|
+
try {
|
|
174
|
+
let code = resolveCode(args);
|
|
175
|
+
const format = args.format || "svg";
|
|
176
|
+
// Inject maxWidth for ASCII format
|
|
177
|
+
if (format === "ascii" && args.maxWidth) {
|
|
178
|
+
code = injectMaxWidth(code, args.maxWidth);
|
|
179
|
+
}
|
|
180
|
+
const result = await render(code, format);
|
|
181
|
+
// For binary formats or large outputs, buffer the result
|
|
182
|
+
if (result.content && result.size > MAX_INLINE_SIZE) {
|
|
183
|
+
const bufferId = contentBuffer.store(result.content, {
|
|
184
|
+
type: "plantuml_render",
|
|
185
|
+
format: result.format,
|
|
186
|
+
contentType: result.contentType,
|
|
187
|
+
});
|
|
188
|
+
const hint = format === "png" || format === "eps"
|
|
189
|
+
? "Use buffer_save_to_file to save to disk, or buffer_get_chunk to retrieve base64"
|
|
190
|
+
: "Use buffer_get_chunk to retrieve content";
|
|
191
|
+
return formatSuccess({
|
|
192
|
+
format: result.format,
|
|
193
|
+
contentType: result.contentType,
|
|
194
|
+
size: result.size,
|
|
195
|
+
bufferId,
|
|
196
|
+
message: `Rendered ${format} (buffered due to size)`,
|
|
197
|
+
hint,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
return formatSuccess({
|
|
201
|
+
format: result.format,
|
|
202
|
+
contentType: result.contentType,
|
|
203
|
+
size: result.size,
|
|
204
|
+
content: result.content,
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
catch (error) {
|
|
208
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
209
|
+
// Check for syntax errors in the response
|
|
210
|
+
if (message.includes("syntax error") || message.includes("Syntax Error")) {
|
|
211
|
+
return formatError({
|
|
212
|
+
error: true,
|
|
213
|
+
message: "PlantUML syntax error - diagram cannot be rendered",
|
|
214
|
+
statusCode: 400,
|
|
215
|
+
details: {
|
|
216
|
+
originalError: message,
|
|
217
|
+
hint: "Use plantuml_validate to check syntax first",
|
|
218
|
+
},
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
// Check for Docker-related errors
|
|
222
|
+
if (message.includes("Docker") ||
|
|
223
|
+
message.includes("container") ||
|
|
224
|
+
message.includes("ENOENT")) {
|
|
225
|
+
return formatError({
|
|
226
|
+
error: true,
|
|
227
|
+
message: "PlantUML service unavailable - Docker may not be running",
|
|
228
|
+
statusCode: 503,
|
|
229
|
+
details: {
|
|
230
|
+
originalError: message,
|
|
231
|
+
hint: "Ensure Docker is installed and running",
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
return formatError(error instanceof Error ? error : new Error(message));
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
|
+
plantuml_status: {
|
|
240
|
+
description: `Check if PlantUML rendering is available.
|
|
241
|
+
|
|
242
|
+
Returns availability status. The service starts automatically on first use of plantuml_validate or plantuml_render.`,
|
|
243
|
+
inputSchema: z.object({}),
|
|
244
|
+
handler: async () => {
|
|
245
|
+
const status = getStatus();
|
|
246
|
+
if (status.available) {
|
|
247
|
+
return formatSuccess({
|
|
248
|
+
available: true,
|
|
249
|
+
containerId: status.containerId,
|
|
250
|
+
port: status.port,
|
|
251
|
+
baseUrl: status.baseUrl,
|
|
252
|
+
message: "PlantUML service is running",
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
return formatSuccess({
|
|
256
|
+
available: false,
|
|
257
|
+
message: "PlantUML service not started (will start on first use)",
|
|
258
|
+
hint: "Call plantuml_validate or plantuml_render to start the service",
|
|
259
|
+
});
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Tool names for registry
|
|
266
|
+
*/
|
|
267
|
+
export const PLANTUML_TOOLS = [
|
|
268
|
+
"plantuml_validate",
|
|
269
|
+
"plantuml_render",
|
|
270
|
+
"plantuml_status",
|
|
271
|
+
];
|
|
272
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../src/utils/plantuml/tools.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EACL,2BAA2B,EAC3B,yBAAyB,GAE1B,MAAM,YAAY,CAAC;AAEpB;;GAEG;AACH,MAAM,eAAe,GAAG,EAAE,GAAG,IAAI,CAAC;AAElC;;GAEG;AACH,SAAS,WAAW,CAAC,IAA0C;IAC7D,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,IAAI,GAAG,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxD,CAAC;QACD,MAAM,KAAK,GAAG,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAA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ED,OAAO,WAAW,CAChB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CACpD,CAAC;gBACJ,CAAC;YACH,CAAC;SACF;QAED,eAAe,EAAE;YACf,WAAW,EAAE;;oHAEiG;YAC9G,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;YACzB,OAAO,EAAE,KAAK,IAA6B,EAAE;gBAC3C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;gBAE3B,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;oBACrB,OAAO,aAAa,CAAC;wBACnB,SAAS,EAAE,IAAI;wBACf,WAAW,EAAE,MAAM,CAAC,WAAW;wBAC/B,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,OAAO,EAAE,MAAM,CAAC,OAAO;wBACvB,OAAO,EAAE,6BAA6B;qBACvC,CAAC,CAAC;gBACL,CAAC;gBAED,OAAO,aAAa,CAAC;oBACnB,SAAS,EAAE,KAAK;oBAChB,OAAO,EAAE,wDAAwD;oBACjE,IAAI,EAAE,gEAAgE;iBACvE,CAAC,CAAC;YACL,CAAC;SACF;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,mBAAmB;IACnB,iBAAiB;IACjB,iBAAiB;CACT,CAAC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PlantUML Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the PlantUML Docker-based validation and rendering service.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
/**
|
|
8
|
+
* Supported output formats for PlantUML rendering
|
|
9
|
+
*/
|
|
10
|
+
export declare const RenderFormatSchema: z.ZodEnum<["ascii", "png", "svg", "eps"]>;
|
|
11
|
+
export type RenderFormat = z.infer<typeof RenderFormatSchema>;
|
|
12
|
+
/**
|
|
13
|
+
* PlantUML diagram types that can be detected
|
|
14
|
+
*/
|
|
15
|
+
export type DiagramType = "sequence" | "class" | "activity" | "component" | "state" | "usecase" | "object" | "deployment" | "timing" | "mindmap" | "gantt" | "wbs" | "json" | "yaml" | "c4" | "unknown";
|
|
16
|
+
/**
|
|
17
|
+
* A single validation error with location information
|
|
18
|
+
*/
|
|
19
|
+
export interface PlantUmlError {
|
|
20
|
+
/** Line number (1-based) */
|
|
21
|
+
line: number;
|
|
22
|
+
/** Column number (1-based), if available */
|
|
23
|
+
column?: number;
|
|
24
|
+
/** Error message from PlantUML */
|
|
25
|
+
message: string;
|
|
26
|
+
/** Suggestion for fixing the error, if available */
|
|
27
|
+
suggestion?: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Result of PlantUML syntax validation
|
|
31
|
+
*/
|
|
32
|
+
export interface PlantUmlValidationResult {
|
|
33
|
+
/** Whether the diagram syntax is valid */
|
|
34
|
+
valid: boolean;
|
|
35
|
+
/** Normalized code with @startuml/@enduml ensured */
|
|
36
|
+
normalizedCode: string;
|
|
37
|
+
/** Detected diagram type */
|
|
38
|
+
diagramType?: DiagramType;
|
|
39
|
+
/** Validation errors if invalid */
|
|
40
|
+
errors?: PlantUmlError[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Result of PlantUML rendering
|
|
44
|
+
*/
|
|
45
|
+
export interface PlantUmlRenderResult {
|
|
46
|
+
/** The requested format */
|
|
47
|
+
format: RenderFormat;
|
|
48
|
+
/** Rendered content (for ascii/svg) or base64 (for png/eps) */
|
|
49
|
+
content?: string;
|
|
50
|
+
/** Buffer ID for large outputs */
|
|
51
|
+
bufferId?: string;
|
|
52
|
+
/** Content type MIME */
|
|
53
|
+
contentType: string;
|
|
54
|
+
/** Size in bytes */
|
|
55
|
+
size: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Docker container state
|
|
59
|
+
*/
|
|
60
|
+
export interface ContainerState {
|
|
61
|
+
/** Container ID */
|
|
62
|
+
containerId: string;
|
|
63
|
+
/** Container name */
|
|
64
|
+
containerName: string;
|
|
65
|
+
/** Host port mapped to container's 8080 */
|
|
66
|
+
port: number;
|
|
67
|
+
/** Base URL for PlantUML server */
|
|
68
|
+
baseUrl: string;
|
|
69
|
+
/** Whether container is ready to accept requests */
|
|
70
|
+
ready: boolean;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* PlantUML service configuration
|
|
74
|
+
*/
|
|
75
|
+
export interface PlantUmlConfig {
|
|
76
|
+
/** Docker image to use (default: plantuml/plantuml-server:latest) */
|
|
77
|
+
image?: string;
|
|
78
|
+
/** Timeout for container startup in ms (default: 30000) */
|
|
79
|
+
startupTimeout?: number;
|
|
80
|
+
/** Timeout for requests in ms (default: 30000) */
|
|
81
|
+
requestTimeout?: number;
|
|
82
|
+
/** Port range start for dynamic allocation (default: 49152) */
|
|
83
|
+
portRangeStart?: number;
|
|
84
|
+
/** Port range end for dynamic allocation (default: 65535) */
|
|
85
|
+
portRangeEnd?: number;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Default configuration values
|
|
89
|
+
*/
|
|
90
|
+
export declare const DEFAULT_PLANTUML_CONFIG: Required<PlantUmlConfig>;
|
|
91
|
+
/**
|
|
92
|
+
* Semantic positions for PlantUML insertion in Confluence documents
|
|
93
|
+
*/
|
|
94
|
+
export declare const SemanticPositionSchema: z.ZodEnum<["after-title", "after-heading", "before-content", "end", "after-toc"]>;
|
|
95
|
+
export type SemanticPosition = z.infer<typeof SemanticPositionSchema>;
|
|
96
|
+
/**
|
|
97
|
+
* Schema for plantuml_validate tool input
|
|
98
|
+
* Note: Either 'code' or 'bufferId' must be provided (validated in handler)
|
|
99
|
+
*/
|
|
100
|
+
export declare const PlantUmlValidateInputSchema: z.ZodObject<{
|
|
101
|
+
code: z.ZodOptional<z.ZodString>;
|
|
102
|
+
bufferId: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, "strip", z.ZodTypeAny, {
|
|
104
|
+
bufferId?: string | undefined;
|
|
105
|
+
code?: string | undefined;
|
|
106
|
+
}, {
|
|
107
|
+
bufferId?: string | undefined;
|
|
108
|
+
code?: string | undefined;
|
|
109
|
+
}>;
|
|
110
|
+
/**
|
|
111
|
+
* Schema for plantuml_render tool input
|
|
112
|
+
* Note: Either 'code' or 'bufferId' must be provided (validated in handler)
|
|
113
|
+
*/
|
|
114
|
+
export declare const PlantUmlRenderInputSchema: z.ZodObject<{
|
|
115
|
+
code: z.ZodOptional<z.ZodString>;
|
|
116
|
+
bufferId: z.ZodOptional<z.ZodString>;
|
|
117
|
+
format: z.ZodDefault<z.ZodEnum<["ascii", "png", "svg", "eps"]>>;
|
|
118
|
+
maxWidth: z.ZodOptional<z.ZodNumber>;
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
format: "ascii" | "png" | "svg" | "eps";
|
|
121
|
+
bufferId?: string | undefined;
|
|
122
|
+
code?: string | undefined;
|
|
123
|
+
maxWidth?: number | undefined;
|
|
124
|
+
}, {
|
|
125
|
+
bufferId?: string | undefined;
|
|
126
|
+
code?: string | undefined;
|
|
127
|
+
format?: "ascii" | "png" | "svg" | "eps" | undefined;
|
|
128
|
+
maxWidth?: number | undefined;
|
|
129
|
+
}>;
|
|
130
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/plantuml/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,eAAO,MAAM,kBAAkB,2CAAyC,CAAC;AACzE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,UAAU,GACV,OAAO,GACP,UAAU,GACV,WAAW,GACX,OAAO,GACP,SA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IACf,2DAA2D;IAC3D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kDAAkD;IAClD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+DAA+D;IAC/D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6DAA6D;IAC7D,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,QAAQ,CAAC,cAAc,CAM5D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,mFAMjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE;;;GAGG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;EAStC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;EAoBpC,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PlantUML Types
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for the PlantUML Docker-based validation and rendering service.
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
/**
|
|
8
|
+
* Supported output formats for PlantUML rendering
|
|
9
|
+
*/
|
|
10
|
+
export const RenderFormatSchema = z.enum(["ascii", "png", "svg", "eps"]);
|
|
11
|
+
/**
|
|
12
|
+
* Default configuration values
|
|
13
|
+
*/
|
|
14
|
+
export const DEFAULT_PLANTUML_CONFIG = {
|
|
15
|
+
image: "plantuml/plantuml-server:latest",
|
|
16
|
+
startupTimeout: 30000,
|
|
17
|
+
requestTimeout: 30000,
|
|
18
|
+
portRangeStart: 49152,
|
|
19
|
+
portRangeEnd: 65535,
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Semantic positions for PlantUML insertion in Confluence documents
|
|
23
|
+
*/
|
|
24
|
+
export const SemanticPositionSchema = z.enum([
|
|
25
|
+
"after-title",
|
|
26
|
+
"after-heading",
|
|
27
|
+
"before-content",
|
|
28
|
+
"end",
|
|
29
|
+
"after-toc",
|
|
30
|
+
]);
|
|
31
|
+
/**
|
|
32
|
+
* Schema for plantuml_validate tool input
|
|
33
|
+
* Note: Either 'code' or 'bufferId' must be provided (validated in handler)
|
|
34
|
+
*/
|
|
35
|
+
export const PlantUmlValidateInputSchema = z.object({
|
|
36
|
+
code: z
|
|
37
|
+
.string()
|
|
38
|
+
.optional()
|
|
39
|
+
.describe("PlantUML code (with or without @startuml/@enduml)"),
|
|
40
|
+
bufferId: z
|
|
41
|
+
.string()
|
|
42
|
+
.optional()
|
|
43
|
+
.describe("Buffer ID containing PlantUML code (alternative to code)"),
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Schema for plantuml_render tool input
|
|
47
|
+
* Note: Either 'code' or 'bufferId' must be provided (validated in handler)
|
|
48
|
+
*/
|
|
49
|
+
export const PlantUmlRenderInputSchema = z.object({
|
|
50
|
+
code: z
|
|
51
|
+
.string()
|
|
52
|
+
.optional()
|
|
53
|
+
.describe("PlantUML code (with or without @startuml/@enduml)"),
|
|
54
|
+
bufferId: z
|
|
55
|
+
.string()
|
|
56
|
+
.optional()
|
|
57
|
+
.describe("Buffer ID containing PlantUML code (alternative to code)"),
|
|
58
|
+
format: RenderFormatSchema.default("svg").describe('Output format: "ascii", "png", "svg", or "eps"'),
|
|
59
|
+
maxWidth: z
|
|
60
|
+
.number()
|
|
61
|
+
.min(20)
|
|
62
|
+
.max(200)
|
|
63
|
+
.optional()
|
|
64
|
+
.describe("Max characters for ASCII output (20-200). Injects skinparam maxMessageSize for sequence diagrams."),
|
|
65
|
+
});
|
|
66
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/plantuml/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;G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,CACP,mGAAmG,CACpG;CACJ,CAAC,CAAC"}
|
|
@@ -9,4 +9,18 @@ export declare function getMaxOutputSize(): number;
|
|
|
9
9
|
export declare function formatSuccess(data: unknown, metadata?: Record<string, unknown>): ToolResult;
|
|
10
10
|
export declare function formatError(error: ApiError | Error): ToolResult;
|
|
11
11
|
export declare function isApiError(error: unknown): error is ApiError;
|
|
12
|
+
/**
|
|
13
|
+
* Hint information for conflict errors
|
|
14
|
+
*/
|
|
15
|
+
export interface ConflictHint {
|
|
16
|
+
currentVersion?: number;
|
|
17
|
+
expectedVersion?: number;
|
|
18
|
+
resourceId?: string;
|
|
19
|
+
resourceType?: "confluence_page" | "jira_issue" | "tempo_worklog";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Format a 409 Conflict error with actionable hints for resolution
|
|
23
|
+
* Provides specific guidance based on the resource type
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatConflictError(error: ApiError, hint?: ConflictHint): ToolResult;
|
|
12
26
|
//# sourceMappingURL=response-formatter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-formatter.d.ts","sourceRoot":"","sources":["../../src/utils/response-formatter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAMxD;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CASzC;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"response-formatter.d.ts","sourceRoot":"","sources":["../../src/utils/response-formatter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAMxD;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CASzC;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CAqE3F;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,GAAG,UAAU,CA0B/D;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAO5D;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,iBAAiB,GAAG,YAAY,GAAG,eAAe,CAAC;CACnE;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,UAAU,CAwDpF"}
|
|
@@ -33,6 +33,25 @@ export function formatSuccess(data, metadata) {
|
|
|
33
33
|
}
|
|
34
34
|
// Exceeds limit: store in buffer and return pagination info only
|
|
35
35
|
const bufferId = contentBuffer.store(jsonText, metadata);
|
|
36
|
+
// Determine if this is Confluence content for better hints
|
|
37
|
+
const isConfluence = metadata?.resourceType === "confluence_page" ||
|
|
38
|
+
metadata?.resourceType === "confluence_draft";
|
|
39
|
+
const editHint = isConfluence
|
|
40
|
+
? {
|
|
41
|
+
edit_xhtml: {
|
|
42
|
+
tool: "buffer_edit_xhtml",
|
|
43
|
+
args: { bufferId, operation: "update", selector: "p", content: "<p>new</p>" },
|
|
44
|
+
description: "Structure-aware editing for tables, macros, layouts. Call help(topic=\"storage\") for guide."
|
|
45
|
+
},
|
|
46
|
+
edit_text: {
|
|
47
|
+
tool: "buffer_edit",
|
|
48
|
+
args: { bufferId, old_string: "old", new_string: "new" },
|
|
49
|
+
description: "Simple text replacement"
|
|
50
|
+
},
|
|
51
|
+
}
|
|
52
|
+
: {
|
|
53
|
+
edit: { tool: "buffer_edit", args: { bufferId, old_string: "old", new_string: "new" } },
|
|
54
|
+
};
|
|
36
55
|
return {
|
|
37
56
|
content: [
|
|
38
57
|
{
|
|
@@ -52,7 +71,9 @@ export function formatSuccess(data, metadata) {
|
|
|
52
71
|
args: { bufferId, offset: 0, limit: 5000 },
|
|
53
72
|
},
|
|
54
73
|
alternative_actions: {
|
|
74
|
+
read: { tool: "buffer_get_chunk", args: { bufferId, offset: 0, limit: 5000 } },
|
|
55
75
|
search: { tool: "buffer_grep", args: { bufferId, pattern: "your_search_term" } },
|
|
76
|
+
...editHint,
|
|
56
77
|
list: { tool: "buffer_list", args: {} },
|
|
57
78
|
subagent: { tool: "Task", args: { prompt: "Analyze bufferId: " + bufferId } },
|
|
58
79
|
},
|
|
@@ -69,11 +90,17 @@ export function formatError(error) {
|
|
|
69
90
|
details: { stack: error.stack },
|
|
70
91
|
}
|
|
71
92
|
: error;
|
|
93
|
+
// Add explicit failure indicators to help LLMs understand the operation failed
|
|
94
|
+
const enhancedError = {
|
|
95
|
+
...errorObj,
|
|
96
|
+
FAILED: true, // Redundant but explicit indicator for LLM
|
|
97
|
+
action: "FIX_ERRORS_BEFORE_RETRY",
|
|
98
|
+
};
|
|
72
99
|
return {
|
|
73
100
|
content: [
|
|
74
101
|
{
|
|
75
102
|
type: "text",
|
|
76
|
-
text: JSON.stringify(
|
|
103
|
+
text: JSON.stringify(enhancedError, null, 2),
|
|
77
104
|
},
|
|
78
105
|
],
|
|
79
106
|
isError: true,
|
|
@@ -85,4 +112,60 @@ export function isApiError(error) {
|
|
|
85
112
|
"error" in error &&
|
|
86
113
|
error.error === true);
|
|
87
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Format a 409 Conflict error with actionable hints for resolution
|
|
117
|
+
* Provides specific guidance based on the resource type
|
|
118
|
+
*/
|
|
119
|
+
export function formatConflictError(error, hint) {
|
|
120
|
+
const message = error.message || "Version conflict detected";
|
|
121
|
+
let enhancedMessage = message;
|
|
122
|
+
enhancedMessage += "\n\n--- Version Conflict Resolution ---";
|
|
123
|
+
if (hint?.resourceType === "confluence_page") {
|
|
124
|
+
enhancedMessage += "\n\nThe page was modified since you read it. To resolve:";
|
|
125
|
+
enhancedMessage += "\n1. Re-fetch the page with confluence_get_page to get current version";
|
|
126
|
+
enhancedMessage += "\n2. Review any changes made by other users";
|
|
127
|
+
enhancedMessage += "\n3. Retry the update with the new version number";
|
|
128
|
+
if (hint.resourceId) {
|
|
129
|
+
enhancedMessage += `\n\nSuggested action: confluence_get_page(pageId: "${hint.resourceId}")`;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
else if (hint?.resourceType === "jira_issue") {
|
|
133
|
+
enhancedMessage += "\n\nThe issue was modified since you read it. To resolve:";
|
|
134
|
+
enhancedMessage += "\n1. Re-fetch the issue with jira_get_issue to see current state";
|
|
135
|
+
enhancedMessage += "\n2. Review changes and retry your update";
|
|
136
|
+
if (hint.resourceId) {
|
|
137
|
+
enhancedMessage += `\n\nSuggested action: jira_get_issue(issueKey: "${hint.resourceId}")`;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
else if (hint?.resourceType === "tempo_worklog") {
|
|
141
|
+
enhancedMessage += "\n\nThe worklog was modified since you read it. To resolve:";
|
|
142
|
+
enhancedMessage += "\n1. Re-fetch the worklog with tempo_get_worklog";
|
|
143
|
+
enhancedMessage += "\n2. Review current values and retry";
|
|
144
|
+
if (hint.resourceId) {
|
|
145
|
+
enhancedMessage += `\n\nSuggested action: tempo_get_worklog(worklogId: ${hint.resourceId})`;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
enhancedMessage += "\n\nGeneral resolution steps:";
|
|
150
|
+
enhancedMessage += "\n1. Re-fetch the resource to get current state";
|
|
151
|
+
enhancedMessage += "\n2. Review any concurrent changes";
|
|
152
|
+
enhancedMessage += "\n3. Retry your operation with updated data";
|
|
153
|
+
}
|
|
154
|
+
if (hint?.expectedVersion !== undefined && hint?.currentVersion !== undefined) {
|
|
155
|
+
enhancedMessage += `\n\nVersion mismatch: you provided ${hint.expectedVersion}, server has ${hint.currentVersion}`;
|
|
156
|
+
}
|
|
157
|
+
return {
|
|
158
|
+
content: [
|
|
159
|
+
{
|
|
160
|
+
type: "text",
|
|
161
|
+
text: JSON.stringify({
|
|
162
|
+
...error,
|
|
163
|
+
message: enhancedMessage,
|
|
164
|
+
conflictHint: hint,
|
|
165
|
+
}, null, 2),
|
|
166
|
+
},
|
|
167
|
+
],
|
|
168
|
+
isError: true,
|
|
169
|
+
};
|
|
170
|
+
}
|
|
88
171
|
//# sourceMappingURL=response-formatter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-formatter.js","sourceRoot":"","sources":["../../src/utils/response-formatter.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,4EAA4E;AAC5E,MAAM,kBAAkB,GAAG,KAAK,CAAC;AAEjC;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAC9C,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,MAAM,GAAG,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YACjC,OAAO,MAAM,CAAC;QAChB,CAAC;IACH,CAAC;IACD,OAAO,kBAAkB,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,IAAa,EAAE,QAAkC;IAC7E,MAAM,OAAO,GAAG,gBAAgB,EAAE,CAAC;IACnC,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAE/C,mCAAmC;IACnC,IAAI,QAA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