backlog-mcp-server 0.18.0 → 0.19.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.
Files changed (86) hide show
  1. package/README.ja.md +16 -0
  2. package/README.md +17 -0
  3. package/build/auth/oauthRoutes.js +1 -1
  4. package/build/backlog/customFields.js +12 -9
  5. package/build/handlers/builders/composeDynamicToolHandler.d.ts +147 -0
  6. package/build/handlers/builders/composeDynamicToolHandler.js +55 -0
  7. package/build/httpMcpServer.js +8 -1
  8. package/build/lib.d.ts +2 -0
  9. package/build/lib.js +1 -0
  10. package/build/loadDescriptionOverrides.js +2 -2
  11. package/build/registerTools.js +18 -0
  12. package/build/tools/addDocument.d.ts +1 -1
  13. package/build/tools/addDocument.js +2 -1
  14. package/build/tools/addIssue.d.ts +1 -1
  15. package/build/tools/addIssueComment.d.ts +1 -1
  16. package/build/tools/addProject.d.ts +1 -1
  17. package/build/tools/addPullRequest.d.ts +1 -1
  18. package/build/tools/addPullRequestComment.d.ts +1 -1
  19. package/build/tools/addRelatedIssue.d.ts +1 -1
  20. package/build/tools/addVersionMilestone.d.ts +1 -1
  21. package/build/tools/addWatching.d.ts +1 -1
  22. package/build/tools/addWiki.d.ts +1 -1
  23. package/build/tools/countIssues.d.ts +1 -1
  24. package/build/tools/deleteIssue.d.ts +1 -1
  25. package/build/tools/deleteProject.d.ts +1 -1
  26. package/build/tools/deleteVersion.d.ts +1 -1
  27. package/build/tools/deleteWatching.d.ts +1 -1
  28. package/build/tools/getCategories.d.ts +1 -1
  29. package/build/tools/getCustomFields.d.ts +1 -1
  30. package/build/tools/getDocument.d.ts +1 -1
  31. package/build/tools/getDocument.js +1 -0
  32. package/build/tools/getDocumentTree.d.ts +1 -1
  33. package/build/tools/getDocuments.d.ts +1 -1
  34. package/build/tools/getDocuments.js +1 -0
  35. package/build/tools/getGitRepositories.d.ts +1 -1
  36. package/build/tools/getGitRepository.d.ts +1 -1
  37. package/build/tools/getIssue.d.ts +1 -1
  38. package/build/tools/getIssueAttachment.d.ts +16 -0
  39. package/build/tools/getIssueAttachment.js +345 -0
  40. package/build/tools/getIssueComments.d.ts +1 -1
  41. package/build/tools/getIssueTypes.d.ts +1 -1
  42. package/build/tools/getIssues.d.ts +15 -15
  43. package/build/tools/getMyself.d.ts +1 -1
  44. package/build/tools/getNotifications.d.ts +1 -1
  45. package/build/tools/getNotifications.js +3 -0
  46. package/build/tools/getNotificationsCount.d.ts +1 -1
  47. package/build/tools/getPriorities.d.ts +1 -1
  48. package/build/tools/getProject.d.ts +1 -1
  49. package/build/tools/getProjectList.d.ts +1 -1
  50. package/build/tools/getProjectUsers.d.ts +1 -1
  51. package/build/tools/getPullRequest.d.ts +1 -1
  52. package/build/tools/getPullRequestComments.d.ts +1 -1
  53. package/build/tools/getPullRequests.d.ts +1 -1
  54. package/build/tools/getPullRequestsCount.d.ts +1 -1
  55. package/build/tools/getRelatedIssues.d.ts +1 -1
  56. package/build/tools/getResolutions.d.ts +1 -1
  57. package/build/tools/getSpace.d.ts +1 -1
  58. package/build/tools/getSpaceActivities.d.ts +1 -1
  59. package/build/tools/getUserRecentUpdates.d.ts +1 -1
  60. package/build/tools/getUserStarsCount.d.ts +1 -1
  61. package/build/tools/getUsers.d.ts +1 -1
  62. package/build/tools/getVersionMilestoneList.d.ts +1 -1
  63. package/build/tools/getWatchingListCount.d.ts +1 -1
  64. package/build/tools/getWatchingListItems.d.ts +1 -1
  65. package/build/tools/getWiki.d.ts +1 -1
  66. package/build/tools/getWikiPages.d.ts +1 -1
  67. package/build/tools/getWikisCount.d.ts +1 -1
  68. package/build/tools/markNotificationAsRead.d.ts +1 -1
  69. package/build/tools/markWatchingAsRead.d.ts +1 -1
  70. package/build/tools/removeRelatedIssue.d.ts +1 -1
  71. package/build/tools/resetUnreadNotificationCount.d.ts +1 -1
  72. package/build/tools/shared/customFieldFiltersSchema.d.ts +1 -1
  73. package/build/tools/tools.js +2 -0
  74. package/build/tools/updateIssue.d.ts +1 -1
  75. package/build/tools/updateIssueComment.d.ts +1 -1
  76. package/build/tools/updateProject.d.ts +1 -1
  77. package/build/tools/updatePullRequest.d.ts +1 -1
  78. package/build/tools/updatePullRequestComment.d.ts +1 -1
  79. package/build/tools/updateVersionMilestone.d.ts +1 -1
  80. package/build/tools/updateWatching.d.ts +1 -1
  81. package/build/tools/updateWiki.d.ts +1 -1
  82. package/build/types/tool.d.ts +1 -1
  83. package/build/types/toolsets.d.ts +12 -1
  84. package/build/utils/logger.js +41 -3
  85. package/build/utils/resolveIdOrKey.d.ts +2 -2
  86. package/package.json +18 -25
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getGitRepositoriesSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getGitRepositoriesSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  };
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getGitRepositorySchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getGitRepositorySchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  repoId: z.ZodOptional<z.ZodNumber>;
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getIssueSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getIssueSchema: (t: DescriptionHelper['t']) => {
7
7
  issueId: z.ZodOptional<z.ZodNumber>;
8
8
  issueKey: z.ZodOptional<z.ZodString>;
9
9
  };
@@ -0,0 +1,16 @@
1
+ import { Backlog } from 'backlog-js';
2
+ import { z } from 'zod';
3
+ import { DescriptionHelper } from '../createDescriptionHelper.js';
4
+ import { DynamicToolDefinition } from '../types/tool.js';
5
+ declare const getIssueAttachmentSchema: (t: DescriptionHelper['t']) => {
6
+ issueId: z.ZodOptional<z.ZodNumber>;
7
+ issueKey: z.ZodOptional<z.ZodString>;
8
+ attachmentId: z.ZodNumber;
9
+ format: z.ZodOptional<z.ZodEnum<{
10
+ auto: "auto";
11
+ base64: "base64";
12
+ }>>;
13
+ maxBytes: z.ZodOptional<z.ZodNumber>;
14
+ };
15
+ export declare const getIssueAttachmentTool: (backlog: Backlog, { t }: DescriptionHelper) => DynamicToolDefinition<ReturnType<typeof getIssueAttachmentSchema>>;
16
+ export {};
@@ -0,0 +1,345 @@
1
+ import { z } from 'zod';
2
+ import { buildToolSchema } from '../types/tool.js';
3
+ import { resolveIdOrKey } from '../utils/resolveIdOrKey.js';
4
+ const MEBIBYTE = 1024 * 1024;
5
+ /**
6
+ * Both limits are about what survives the transport, not about what Backlog
7
+ * allows. Base64 inflates by 4/3, and the MCP SDK caps a single stdio message
8
+ * at 10 MiB by default, so 7 MiB of raw bytes is the point beyond which a
9
+ * successful download would still fail to reach the client.
10
+ */
11
+ const DEFAULT_MAX_BYTES = 5 * MEBIBYTE;
12
+ const MAX_ATTACHMENT_BYTES = 7 * MEBIBYTE;
13
+ /**
14
+ * The raster types this tool returns as MCP `image` content.
15
+ *
16
+ * Narrower than the raster types Backlog serves, and the limit
17
+ * does not come from MCP — `ImageContent.mimeType` is an unconstrained string
18
+ * in the schema. It comes from the far end: a Claude-backed host forwards the
19
+ * block to the Messages API, which documents support for `image/jpeg`,
20
+ * `image/png`, `image/gif` and `image/webp` and nothing else
21
+ * (https://platform.claude.com/docs/en/build-with-claude/vision). An
22
+ * `image/bmp` block is rejected there, and a rejected block costs the caller
23
+ * the metadata as well as the file rather than merely failing to draw.
24
+ *
25
+ * These four are therefore what is safe to inline. A host backed by something
26
+ * other than Claude may well accept more; nothing here asserts otherwise, it
27
+ * just does not rely on it.
28
+ *
29
+ * `image/svg+xml` is absent for an unrelated reason — an SVG can carry script,
30
+ * and it is text, so it goes down the text path below where it can be read
31
+ * rather than executed.
32
+ *
33
+ * Anything not here is returned as an embedded resource, which every client
34
+ * can hold.
35
+ */
36
+ const INLINE_IMAGE_TYPES = new Set([
37
+ 'image/gif',
38
+ 'image/jpeg',
39
+ 'image/png',
40
+ 'image/webp',
41
+ ]);
42
+ /**
43
+ * Types whose bytes are meant to be read rather than rendered.
44
+ *
45
+ * These are returned as `resource.text`. Handing a caller base64 of a CSV is
46
+ * the same as handing it nothing: the point of fetching a log or a spreadsheet
47
+ * is the content, and base64 has to be decoded by something that can already
48
+ * read the file.
49
+ */
50
+ const TEXT_TYPES = new Set([
51
+ 'application/json',
52
+ 'application/xml',
53
+ 'image/svg+xml',
54
+ 'text/csv',
55
+ 'text/html',
56
+ 'text/plain',
57
+ ]);
58
+ const getIssueAttachmentSchema = buildToolSchema((t) => ({
59
+ issueId: z
60
+ .number()
61
+ .int()
62
+ .optional()
63
+ .describe(t('TOOL_GET_ISSUE_ATTACHMENT_ISSUE_ID', 'The numeric ID of the issue (e.g., 12345)')),
64
+ issueKey: z
65
+ .string()
66
+ .optional()
67
+ .describe(t('TOOL_GET_ISSUE_ATTACHMENT_ISSUE_KEY', "The key of the issue (e.g., 'PROJ-123')")),
68
+ attachmentId: z
69
+ .number()
70
+ .int()
71
+ .positive()
72
+ .describe(t('TOOL_GET_ISSUE_ATTACHMENT_ATTACHMENT_ID', "The numeric ID of the attachment. Get it from get_issue (the issue's `attachments` array).")),
73
+ format: z
74
+ .enum(['auto', 'base64'])
75
+ .optional()
76
+ .describe(t('TOOL_GET_ISSUE_ATTACHMENT_FORMAT', "How to return the file. 'auto' (default) returns a verified raster image as MCP image content and anything else as an embedded resource, so a client can render it. 'base64' returns a single JSON object with the encoded bytes in `content`, for callers that process the file programmatically — note that this puts the whole encoding in the caller's context.")),
77
+ maxBytes: z
78
+ .number()
79
+ .int()
80
+ .positive()
81
+ .max(MAX_ATTACHMENT_BYTES)
82
+ .optional()
83
+ .describe(t('TOOL_GET_ISSUE_ATTACHMENT_MAX_BYTES', `Maximum raw attachment size in bytes. Defaults to ${DEFAULT_MAX_BYTES} and cannot exceed ${MAX_ATTACHMENT_BYTES}.`)),
84
+ }));
85
+ function isReadableByteStream(body) {
86
+ return (typeof body === 'object' &&
87
+ body !== null &&
88
+ 'getReader' in body &&
89
+ typeof body.getReader === 'function');
90
+ }
91
+ /**
92
+ * Reads the whole body, refusing to buffer more than `maxBytes`.
93
+ *
94
+ * The limit is checked per chunk rather than against a `Content-Length`:
95
+ * `backlog-js` does not surface response headers, and a header would be the
96
+ * server's claim rather than what actually arrived.
97
+ */
98
+ async function readBody(body, maxBytes) {
99
+ if (!isReadableByteStream(body)) {
100
+ throw new Error('Backlog returned an unsupported attachment body.');
101
+ }
102
+ const reader = body.getReader();
103
+ const chunks = [];
104
+ let size = 0;
105
+ let finished = false;
106
+ try {
107
+ while (true) {
108
+ const { done, value } = await reader.read();
109
+ if (done) {
110
+ finished = true;
111
+ break;
112
+ }
113
+ if (!(value instanceof Uint8Array)) {
114
+ throw new Error('Backlog returned a non-binary attachment chunk.');
115
+ }
116
+ size += value.byteLength;
117
+ if (size > maxBytes) {
118
+ throw new Error(`Attachment exceeds the ${maxBytes}-byte response limit. Raise maxBytes (up to ${MAX_ATTACHMENT_BYTES}) if the file really is this large.`);
119
+ }
120
+ chunks.push(value);
121
+ }
122
+ }
123
+ finally {
124
+ // Leaving the loop before the stream ends leaves the response in flight —
125
+ // `releaseLock` detaches the reader, it does not abort what is arriving.
126
+ // Cancelling here rather than at each `throw` covers every way out,
127
+ // including a `read()` that rejects, and cannot be forgotten by the next
128
+ // early return added above.
129
+ if (!finished) {
130
+ try {
131
+ await reader.cancel();
132
+ }
133
+ catch {
134
+ // Best effort: keep whatever error got us here.
135
+ }
136
+ }
137
+ reader.releaseLock();
138
+ }
139
+ const bytes = new Uint8Array(size);
140
+ let offset = 0;
141
+ for (const chunk of chunks) {
142
+ bytes.set(chunk, offset);
143
+ offset += chunk.byteLength;
144
+ }
145
+ return { bytes, size };
146
+ }
147
+ /**
148
+ * `btoa` over a string built in 32 KiB slices.
149
+ *
150
+ * `String.fromCharCode(...bytes)` on a multi-megabyte array overflows the call
151
+ * stack, and `Buffer` is not available to this module: `src/lib.ts` exposes the
152
+ * tool layer to consumers that do not run on Node.
153
+ */
154
+ function toBase64(bytes) {
155
+ const chunks = [];
156
+ const chunkSize = 0x8000;
157
+ for (let offset = 0; offset < bytes.length; offset += chunkSize) {
158
+ chunks.push(String.fromCharCode(...bytes.subarray(offset, offset + chunkSize)));
159
+ }
160
+ return globalThis.btoa(chunks.join(''));
161
+ }
162
+ /**
163
+ * A name safe to put in metadata and a resource URI.
164
+ *
165
+ * `backlog-js` decodes `Content-Disposition` since 0.20.1, so what arrives is
166
+ * already the real name. What is left is that it is the server's string: strip
167
+ * any directory part and control characters rather than pass those on, and
168
+ * fall back to the id when nothing usable remains.
169
+ */
170
+ function normalizeFilename(rawName, attachmentId) {
171
+ const basename = (rawName ?? '').split(/[/\\]/).pop() ?? '';
172
+ const cleaned = Array.from(basename)
173
+ .filter((character) => {
174
+ const codePoint = character.codePointAt(0) ?? 0;
175
+ return codePoint > 0x1f && codePoint !== 0x7f;
176
+ })
177
+ .join('')
178
+ .trim();
179
+ return !cleaned || cleaned === '.' || cleaned === '..'
180
+ ? `attachment-${attachmentId}`
181
+ : cleaned;
182
+ }
183
+ /**
184
+ * The bare MIME type of a raw `Content-Type` header.
185
+ *
186
+ * `File.FileData.contentType` is the header verbatim — `backlog-js` reads it
187
+ * with `response.headers.get('Content-Type')` and hands it over unparsed — so
188
+ * it may carry parameters and any casing. Every decision below is an exact
189
+ * lookup in `INLINE_IMAGE_TYPES` or `TEXT_TYPES`, and `text/csv;charset=UTF-8`
190
+ * misses both: the CSV would come back as base64, which is the case this tool
191
+ * exists to serve.
192
+ */
193
+ function bareMimeType(rawContentType) {
194
+ return rawContentType.split(';')[0].trim().toLowerCase();
195
+ }
196
+ function startsWith(bytes, signature) {
197
+ return signature.every((byte, index) => bytes[index] === byte);
198
+ }
199
+ /**
200
+ * Whether the bytes really are the raster format the extension promises.
201
+ *
202
+ * A client renders `image` content without checking it, so an attachment named
203
+ * `.png` that is not a PNG would otherwise become a broken image with no
204
+ * explanation. Mismatches fall back to an embedded resource.
205
+ */
206
+ function isExpectedImage(bytes, contentType) {
207
+ switch (contentType) {
208
+ case 'image/gif':
209
+ return (startsWith(bytes, [0x47, 0x49, 0x46, 0x38, 0x37, 0x61]) ||
210
+ startsWith(bytes, [0x47, 0x49, 0x46, 0x38, 0x39, 0x61]));
211
+ case 'image/jpeg':
212
+ return startsWith(bytes, [0xff, 0xd8, 0xff]);
213
+ case 'image/png':
214
+ return startsWith(bytes, [0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);
215
+ case 'image/webp':
216
+ return (startsWith(bytes, [0x52, 0x49, 0x46, 0x46]) &&
217
+ bytes[8] === 0x57 &&
218
+ bytes[9] === 0x45 &&
219
+ bytes[10] === 0x42 &&
220
+ bytes[11] === 0x50);
221
+ default:
222
+ return false;
223
+ }
224
+ }
225
+ /**
226
+ * The raster type the bytes actually are, if it is one this tool inlines.
227
+ *
228
+ * A file saved under the wrong extension — a PNG named `.jpg` is the common
229
+ * one — is served happily by Backlog. Trusting the name and giving up would
230
+ * turn it into an opaque blob no client draws, when the bytes needed to
231
+ * identify it are already in hand.
232
+ */
233
+ function sniffImageType(bytes) {
234
+ for (const type of INLINE_IMAGE_TYPES) {
235
+ if (isExpectedImage(bytes, type)) {
236
+ return type;
237
+ }
238
+ }
239
+ return undefined;
240
+ }
241
+ /**
242
+ * `undefined` rather than replacement characters when the bytes are not UTF-8,
243
+ * so a binary file under a `.txt` name falls back to a blob instead of
244
+ * arriving as mojibake that reads like a successful download.
245
+ */
246
+ function decodeUtf8(bytes) {
247
+ try {
248
+ return new TextDecoder('utf-8', { fatal: true }).decode(bytes);
249
+ }
250
+ catch {
251
+ return undefined;
252
+ }
253
+ }
254
+ function getSpaceNamespace(sourceUrl) {
255
+ try {
256
+ return new URL(sourceUrl).host || 'unknown-space';
257
+ }
258
+ catch {
259
+ return 'unknown-space';
260
+ }
261
+ }
262
+ /**
263
+ * A synthetic `backlog://` URI, never the URL the download came from.
264
+ *
265
+ * In API-key mode `backlog-js` puts the key in the query string, and
266
+ * `File.FileData.url` carries it verbatim — echoing it into a resource URI
267
+ * would hand the caller a working credential.
268
+ */
269
+ function buildResourceUri(sourceUrl, issueIdOrKey, attachmentId, filename) {
270
+ const space = encodeURIComponent(getSpaceNamespace(sourceUrl));
271
+ return `backlog://attachments/${space}/issues/${encodeURIComponent(String(issueIdOrKey))}/attachments/${attachmentId}/${encodeURIComponent(filename)}`;
272
+ }
273
+ function errorResult(message) {
274
+ return {
275
+ isError: true,
276
+ content: [{ type: 'text', text: message }],
277
+ };
278
+ }
279
+ export const getIssueAttachmentTool = (backlog, { t }) => {
280
+ return {
281
+ name: 'get_issue_attachment',
282
+ description: t('TOOL_GET_ISSUE_ATTACHMENT_DESCRIPTION', "Downloads one attachment of an issue. Returns it as MCP image or embedded resource content by default, or as base64 in a JSON object with `format: 'base64'`. Call get_issue first to obtain the attachmentId from the issue's `attachments` array."),
283
+ schema: z.object(getIssueAttachmentSchema(t)),
284
+ handler: async ({ issueId, issueKey, attachmentId, format, maxBytes }) => {
285
+ const resolved = resolveIdOrKey('issue', { id: issueId, key: issueKey }, t);
286
+ if (!resolved.ok) {
287
+ return errorResult(resolved.error.message);
288
+ }
289
+ const fileData = await backlog.getIssueAttachment(resolved.value, attachmentId);
290
+ const filename = normalizeFilename('filename' in fileData ? fileData.filename : undefined, attachmentId);
291
+ const { bytes, size } = await readBody(fileData.body, maxBytes ?? DEFAULT_MAX_BYTES);
292
+ // What the bytes are beats what the server says, because Backlog derives
293
+ // `Content-Type` from the extension too — an attachment saved as `.jpg`
294
+ // whose bytes are a PNG is served as `image/jpeg`. Only when nothing
295
+ // matches and the server promised a raster does the type become opaque:
296
+ // saying `image/png` for something that is not one makes a client draw a
297
+ // broken image with no explanation.
298
+ const declaredType = bareMimeType(fileData.contentType) || 'application/octet-stream';
299
+ const contentType = sniffImageType(bytes) ??
300
+ (INLINE_IMAGE_TYPES.has(declaredType)
301
+ ? 'application/octet-stream'
302
+ : declaredType);
303
+ if (format === 'base64') {
304
+ const data = toBase64(bytes);
305
+ return {
306
+ content: [
307
+ {
308
+ type: 'text',
309
+ text: JSON.stringify({ filename, contentType, size, content: data }, null, 2),
310
+ },
311
+ ],
312
+ };
313
+ }
314
+ const metadata = {
315
+ filename,
316
+ contentType,
317
+ size,
318
+ attachmentId,
319
+ issueIdOrKey: resolved.value,
320
+ };
321
+ if (INLINE_IMAGE_TYPES.has(contentType)) {
322
+ return {
323
+ content: [
324
+ { type: 'text', text: JSON.stringify(metadata, null, 2) },
325
+ { type: 'image', data: toBase64(bytes), mimeType: contentType },
326
+ ],
327
+ };
328
+ }
329
+ const uri = buildResourceUri(fileData.url, resolved.value, attachmentId, filename);
330
+ const text = TEXT_TYPES.has(contentType) ? decodeUtf8(bytes) : undefined;
331
+ const binaryContent = {
332
+ type: 'resource',
333
+ resource: text === undefined
334
+ ? { uri, blob: toBase64(bytes), mimeType: contentType }
335
+ : { uri, text, mimeType: contentType },
336
+ };
337
+ return {
338
+ content: [
339
+ { type: 'text', text: JSON.stringify(metadata, null, 2) },
340
+ binaryContent,
341
+ ],
342
+ };
343
+ },
344
+ };
345
+ };
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getIssueCommentsSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getIssueCommentsSchema: (t: DescriptionHelper['t']) => {
7
7
  issueId: z.ZodOptional<z.ZodNumber>;
8
8
  issueKey: z.ZodOptional<z.ZodString>;
9
9
  minId: z.ZodOptional<z.ZodNumber>;
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getIssueTypesSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getIssueTypesSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  };
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getIssuesSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getIssuesSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
8
8
  issueTypeId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
9
9
  categoryId: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
@@ -25,25 +25,25 @@ declare const getIssuesSchema: (t: DescriptionHelper["t"]) => {
25
25
  updatedSince: z.ZodOptional<z.ZodString>;
26
26
  updatedUntil: z.ZodOptional<z.ZodString>;
27
27
  sort: z.ZodOptional<z.ZodEnum<{
28
- version: "version";
29
- priority: "priority";
30
- summary: "summary";
31
- startDate: "startDate";
32
- dueDate: "dueDate";
33
- estimatedHours: "estimatedHours";
34
28
  actualHours: "actualHours";
35
- issueType: "issueType";
36
- status: "status";
37
29
  assignee: "assignee";
30
+ attachment: "attachment";
38
31
  category: "category";
39
- milestone: "milestone";
40
- createdUser: "createdUser";
32
+ childIssue: "childIssue";
41
33
  created: "created";
42
- updatedUser: "updatedUser";
43
- updated: "updated";
44
- attachment: "attachment";
34
+ createdUser: "createdUser";
35
+ dueDate: "dueDate";
36
+ estimatedHours: "estimatedHours";
37
+ issueType: "issueType";
38
+ milestone: "milestone";
39
+ priority: "priority";
45
40
  sharedFile: "sharedFile";
46
- childIssue: "childIssue";
41
+ startDate: "startDate";
42
+ status: "status";
43
+ summary: "summary";
44
+ updated: "updated";
45
+ updatedUser: "updatedUser";
46
+ version: "version";
47
47
  }>>;
48
48
  order: z.ZodOptional<z.ZodEnum<{
49
49
  asc: "asc";
@@ -2,6 +2,6 @@ import type { Entity } from 'backlog-js';
2
2
  import { Backlog } from 'backlog-js';
3
3
  import { ToolDefinition } from '../types/tool.js';
4
4
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- declare const getMyselfSchema: (t: DescriptionHelper["t"]) => {};
5
+ declare const getMyselfSchema: (t: DescriptionHelper['t']) => {};
6
6
  export declare const getMyselfTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getMyselfSchema>, Entity.User.User>;
7
7
  export {};
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getNotificationsSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getNotificationsSchema: (t: DescriptionHelper['t']) => {
7
7
  minId: z.ZodOptional<z.ZodNumber>;
8
8
  maxId: z.ZodOptional<z.ZodNumber>;
9
9
  count: z.ZodOptional<z.ZodNumber>;
@@ -35,6 +35,9 @@ export const getNotificationsTool = (backlog, { t }) => {
35
35
  'comment',
36
36
  'pullRequest',
37
37
  'pullRequestComment',
38
+ 'document',
39
+ 'documentComment',
40
+ 'documentCommentReply',
38
41
  'sender',
39
42
  'created',
40
43
  ]),
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getNotificationsCountSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getNotificationsCountSchema: (t: DescriptionHelper['t']) => {
7
7
  alreadyRead: z.ZodBoolean;
8
8
  resourceAlreadyRead: z.ZodBoolean;
9
9
  };
@@ -2,6 +2,6 @@ import type { Entity } from 'backlog-js';
2
2
  import { Backlog } from 'backlog-js';
3
3
  import { ToolDefinition } from '../types/tool.js';
4
4
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- declare const getPrioritiesSchema: (t: DescriptionHelper["t"]) => {};
5
+ declare const getPrioritiesSchema: (t: DescriptionHelper['t']) => {};
6
6
  export declare const getPrioritiesTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getPrioritiesSchema>, Entity.Issue.Priority>;
7
7
  export {};
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getProjectSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getProjectSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  };
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getProjectListSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getProjectListSchema: (t: DescriptionHelper['t']) => {
7
7
  archived: z.ZodOptional<z.ZodBoolean>;
8
8
  all: z.ZodOptional<z.ZodBoolean>;
9
9
  };
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getProjectUsersSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getProjectUsersSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  };
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getPullRequestSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getPullRequestSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  repoId: z.ZodOptional<z.ZodNumber>;
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getPullRequestCommentsSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getPullRequestCommentsSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  repoId: z.ZodOptional<z.ZodNumber>;
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getPullRequestsSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getPullRequestsSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  repoId: z.ZodOptional<z.ZodNumber>;
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getPullRequestsCountSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getPullRequestsCountSchema: (t: DescriptionHelper['t']) => {
7
7
  projectId: z.ZodOptional<z.ZodNumber>;
8
8
  projectKey: z.ZodOptional<z.ZodString>;
9
9
  repoId: z.ZodOptional<z.ZodNumber>;
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getRelatedIssuesSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getRelatedIssuesSchema: (t: DescriptionHelper['t']) => {
7
7
  issueId: z.ZodOptional<z.ZodNumber>;
8
8
  issueKey: z.ZodOptional<z.ZodString>;
9
9
  };
@@ -2,6 +2,6 @@ import type { Entity } from 'backlog-js';
2
2
  import { Backlog } from 'backlog-js';
3
3
  import { ToolDefinition } from '../types/tool.js';
4
4
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- declare const getResolutionsSchema: (t: DescriptionHelper["t"]) => {};
5
+ declare const getResolutionsSchema: (t: DescriptionHelper['t']) => {};
6
6
  export declare const getResolutionsTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getResolutionsSchema>, Entity.Issue.Resolution>;
7
7
  export {};
@@ -2,6 +2,6 @@ import type { Entity } from 'backlog-js';
2
2
  import { Backlog } from 'backlog-js';
3
3
  import { ToolDefinition } from '../types/tool.js';
4
4
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- declare const getSpaceSchema: (t: DescriptionHelper["t"]) => {};
5
+ declare const getSpaceSchema: (t: DescriptionHelper['t']) => {};
6
6
  export declare const getSpaceTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getSpaceSchema>, Entity.Space.Space>;
7
7
  export {};
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getSpaceActivitiesSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getSpaceActivitiesSchema: (t: DescriptionHelper['t']) => {
7
7
  activityTypeId: z.ZodOptional<z.ZodArray<z.ZodEnum<{
8
8
  Undefined: number;
9
9
  IssueCreated: number;
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getUserRecentUpdatesSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getUserRecentUpdatesSchema: (t: DescriptionHelper['t']) => {
7
7
  userId: z.ZodNumber;
8
8
  activityTypeId: z.ZodOptional<z.ZodArray<z.ZodEnum<{
9
9
  Undefined: number;
@@ -3,7 +3,7 @@ import type { Entity } from 'backlog-js';
3
3
  import { Backlog } from 'backlog-js';
4
4
  import { ToolDefinition } from '../types/tool.js';
5
5
  import { DescriptionHelper } from '../createDescriptionHelper.js';
6
- declare const getUserStarsCountSchema: (t: DescriptionHelper["t"]) => {
6
+ declare const getUserStarsCountSchema: (t: DescriptionHelper['t']) => {
7
7
  userId: z.ZodNumber;
8
8
  since: z.ZodOptional<z.ZodString>;
9
9
  until: z.ZodOptional<z.ZodString>;
@@ -2,6 +2,6 @@ import type { Entity } from 'backlog-js';
2
2
  import { Backlog } from 'backlog-js';
3
3
  import { ToolDefinition } from '../types/tool.js';
4
4
  import { DescriptionHelper } from '../createDescriptionHelper.js';
5
- declare const getUsersSchema: (t: DescriptionHelper["t"]) => {};
5
+ declare const getUsersSchema: (t: DescriptionHelper['t']) => {};
6
6
  export declare const getUsersTool: (backlog: Backlog, { t }: DescriptionHelper) => ToolDefinition<ReturnType<typeof getUsersSchema>, Entity.User.User>;
7
7
  export {};