@babelize/mcp 1.0.4 → 1.0.6
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/server.d.ts.map +1 -1
- package/dist/server.js +187 -59
- package/dist/server.js.map +1 -1
- package/dist/tools/babel-get.d.ts +2 -8
- package/dist/tools/babel-get.d.ts.map +1 -1
- package/dist/tools/babel-get.js +18 -26
- package/dist/tools/babel-get.js.map +1 -1
- package/dist/tools/babel-list.d.ts +2 -8
- package/dist/tools/babel-list.d.ts.map +1 -1
- package/dist/tools/babel-list.js +17 -28
- package/dist/tools/babel-list.js.map +1 -1
- package/dist/tools/engine-analyze.d.ts +2 -8
- package/dist/tools/engine-analyze.d.ts.map +1 -1
- package/dist/tools/engine-analyze.js +7 -16
- package/dist/tools/engine-analyze.js.map +1 -1
- package/dist/tools/glossary-delete.d.ts +2 -8
- package/dist/tools/glossary-delete.d.ts.map +1 -1
- package/dist/tools/glossary-delete.js +5 -14
- package/dist/tools/glossary-delete.js.map +1 -1
- package/dist/tools/glossary-export.d.ts +2 -8
- package/dist/tools/glossary-export.d.ts.map +1 -1
- package/dist/tools/glossary-export.js +6 -22
- package/dist/tools/glossary-export.js.map +1 -1
- package/dist/tools/glossary-get.d.ts +2 -8
- package/dist/tools/glossary-get.d.ts.map +1 -1
- package/dist/tools/glossary-get.js +13 -24
- package/dist/tools/glossary-get.js.map +1 -1
- package/dist/tools/glossary-import.d.ts +2 -8
- package/dist/tools/glossary-import.d.ts.map +1 -1
- package/dist/tools/glossary-import.js +11 -28
- package/dist/tools/glossary-import.js.map +1 -1
- package/dist/tools/glossary-set.d.ts +2 -8
- package/dist/tools/glossary-set.d.ts.map +1 -1
- package/dist/tools/glossary-set.js +12 -24
- package/dist/tools/glossary-set.js.map +1 -1
- package/dist/tools/invitation-send.d.ts +2 -8
- package/dist/tools/invitation-send.d.ts.map +1 -1
- package/dist/tools/invitation-send.js +10 -25
- package/dist/tools/invitation-send.js.map +1 -1
- package/dist/tools/language-codes.d.ts +2 -8
- package/dist/tools/language-codes.d.ts.map +1 -1
- package/dist/tools/language-codes.js +19 -37
- package/dist/tools/language-codes.js.map +1 -1
- package/dist/tools/language-list.d.ts +2 -8
- package/dist/tools/language-list.d.ts.map +1 -1
- package/dist/tools/language-list.js +9 -19
- package/dist/tools/language-list.js.map +1 -1
- package/dist/tools/me.d.ts +2 -8
- package/dist/tools/me.d.ts.map +1 -1
- package/dist/tools/me.js +13 -20
- package/dist/tools/me.js.map +1 -1
- package/dist/tools/member-list.d.ts +2 -8
- package/dist/tools/member-list.d.ts.map +1 -1
- package/dist/tools/member-list.js +21 -21
- package/dist/tools/member-list.js.map +1 -1
- package/dist/tools/pr-raise.d.ts +2 -8
- package/dist/tools/pr-raise.d.ts.map +1 -1
- package/dist/tools/pr-raise.js +12 -25
- package/dist/tools/pr-raise.js.map +1 -1
- package/dist/tools/project-create.d.ts +2 -8
- package/dist/tools/project-create.d.ts.map +1 -1
- package/dist/tools/project-create.js +26 -34
- package/dist/tools/project-create.js.map +1 -1
- package/dist/tools/project-download.d.ts +3 -8
- package/dist/tools/project-download.d.ts.map +1 -1
- package/dist/tools/project-download.js +15 -21
- package/dist/tools/project-download.js.map +1 -1
- package/dist/tools/project-get.d.ts +2 -8
- package/dist/tools/project-get.d.ts.map +1 -1
- package/dist/tools/project-get.js +15 -23
- package/dist/tools/project-get.js.map +1 -1
- package/dist/tools/project-language-add.d.ts +2 -8
- package/dist/tools/project-language-add.d.ts.map +1 -1
- package/dist/tools/project-language-add.js +9 -20
- package/dist/tools/project-language-add.js.map +1 -1
- package/dist/tools/project-language-remove.d.ts +2 -8
- package/dist/tools/project-language-remove.d.ts.map +1 -1
- package/dist/tools/project-language-remove.js +9 -14
- package/dist/tools/project-language-remove.js.map +1 -1
- package/dist/tools/project-list.d.ts +2 -8
- package/dist/tools/project-list.d.ts.map +1 -1
- package/dist/tools/project-list.js +21 -28
- package/dist/tools/project-list.js.map +1 -1
- package/dist/tools/project-sync.d.ts +2 -8
- package/dist/tools/project-sync.d.ts.map +1 -1
- package/dist/tools/project-sync.js +12 -21
- package/dist/tools/project-sync.js.map +1 -1
- package/dist/tools/provider-tokens-list.d.ts +2 -8
- package/dist/tools/provider-tokens-list.d.ts.map +1 -1
- package/dist/tools/provider-tokens-list.js +10 -20
- package/dist/tools/provider-tokens-list.js.map +1 -1
- package/dist/tools/run-and-wait.d.ts +19 -0
- package/dist/tools/run-and-wait.d.ts.map +1 -0
- package/dist/tools/run-and-wait.js +99 -0
- package/dist/tools/run-and-wait.js.map +1 -0
- package/dist/tools/run.d.ts +2 -8
- package/dist/tools/run.d.ts.map +1 -1
- package/dist/tools/run.js +17 -31
- package/dist/tools/run.js.map +1 -1
- package/dist/tools/scan.d.ts.map +1 -1
- package/dist/tools/scan.js +4 -7
- package/dist/tools/scan.js.map +1 -1
- package/dist/tools/status.d.ts +2 -8
- package/dist/tools/status.d.ts.map +1 -1
- package/dist/tools/status.js +33 -19
- package/dist/tools/status.js.map +1 -1
- package/dist/tools/tm-export.d.ts +2 -8
- package/dist/tools/tm-export.d.ts.map +1 -1
- package/dist/tools/tm-export.js +6 -22
- package/dist/tools/tm-export.js.map +1 -1
- package/dist/tools/tm-get.d.ts +2 -8
- package/dist/tools/tm-get.d.ts.map +1 -1
- package/dist/tools/tm-get.js +21 -31
- package/dist/tools/tm-get.js.map +1 -1
- package/dist/tools/tm-set.d.ts +2 -8
- package/dist/tools/tm-set.d.ts.map +1 -1
- package/dist/tools/tm-set.js +14 -35
- package/dist/tools/tm-set.js.map +1 -1
- package/dist/utils/api.d.ts +6 -0
- package/dist/utils/api.d.ts.map +1 -0
- package/dist/utils/api.js +45 -0
- package/dist/utils/api.js.map +1 -0
- package/dist/utils/errors.d.ts +9 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +84 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/response.d.ts +8 -0
- package/dist/utils/response.d.ts.map +1 -0
- package/dist/utils/response.js +17 -0
- package/dist/utils/response.js.map +1 -0
- package/dist/utils/scan-strings.d.ts +1 -1
- package/dist/utils/scan-strings.d.ts.map +1 -1
- package/dist/utils/scan-strings.js +129 -51
- package/dist/utils/scan-strings.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-create.d.ts","sourceRoot":"","sources":["../../src/tools/project-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"project-create.d.ts","sourceRoot":"","sources":["../../src/tools/project-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAKtC,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,mBAAmB;;;;;;iDA0B3F"}
|
|
@@ -1,43 +1,35 @@
|
|
|
1
|
+
import { toErrorResponse } from '../utils/errors.js';
|
|
2
|
+
import { success } from '../utils/response.js';
|
|
3
|
+
import { asString } from '../utils/api.js';
|
|
1
4
|
export async function handleProjectCreate(client, params) {
|
|
2
|
-
const { name, source_language, target_languages, repo_url, branch, brand_voice } = params;
|
|
3
5
|
try {
|
|
4
|
-
const body = { name };
|
|
5
|
-
if (
|
|
6
|
-
body.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
body.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
6
|
+
const body = { name: params.name };
|
|
7
|
+
if (params.repo_url) {
|
|
8
|
+
body.repo_url = params.repo_url;
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
body.source = 'manual';
|
|
12
|
+
body.status = 'created';
|
|
13
|
+
}
|
|
14
|
+
if (params.source_language)
|
|
15
|
+
body.source_language = params.source_language;
|
|
16
|
+
if (params.target_languages)
|
|
17
|
+
body.target_languages = params.target_languages;
|
|
18
|
+
if (params.branch)
|
|
19
|
+
body.branch = params.branch;
|
|
20
|
+
if (params.brand_voice)
|
|
21
|
+
body.brand_voice = params.brand_voice;
|
|
15
22
|
const response = await client.post('/projects', body);
|
|
16
23
|
const p = response.data;
|
|
17
|
-
return
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
` Name: ${String(p.name ?? name)}`,
|
|
24
|
-
` ID: ${String(p.id ?? '?')}`,
|
|
25
|
-
` Status: ${String(p.status ?? 'created')}`,
|
|
26
|
-
].join('\n'),
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
};
|
|
24
|
+
return success([
|
|
25
|
+
'✅ Project created!',
|
|
26
|
+
` Name: ${asString(p.name, params.name)}`,
|
|
27
|
+
` ID: ${asString(p.id)}`,
|
|
28
|
+
` Status: ${asString(p.status, 'created')}`,
|
|
29
|
+
].join('\n'));
|
|
30
30
|
}
|
|
31
31
|
catch (err) {
|
|
32
|
-
|
|
33
|
-
? (err.response?.data?.error || 'Unknown error')
|
|
34
|
-
: err instanceof Error
|
|
35
|
-
? err.message
|
|
36
|
-
: 'Unknown error';
|
|
37
|
-
return {
|
|
38
|
-
content: [{ type: 'text', text: `❌ Failed to create project: ${message}` }],
|
|
39
|
-
isError: true,
|
|
40
|
-
};
|
|
32
|
+
return toErrorResponse(err, 'Failed to create project');
|
|
41
33
|
}
|
|
42
34
|
}
|
|
43
35
|
//# sourceMappingURL=project-create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-create.js","sourceRoot":"","sources":["../../src/tools/project-create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-create.js","sourceRoot":"","sources":["../../src/tools/project-create.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAW3C,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,MAAqB,EAAE,MAA2B;IAC1F,IAAI,CAAC;QACH,MAAM,IAAI,GAA4B,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QAC5D,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACpB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAClC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC;YACvB,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;QAC1B,CAAC;QACD,IAAI,MAAM,CAAC,eAAe;YAAE,IAAI,CAAC,eAAe,GAAG,MAAM,CAAC,eAAe,CAAC;QAC1E,IAAI,MAAM,CAAC,gBAAgB;YAAE,IAAI,CAAC,gBAAgB,GAAG,MAAM,CAAC,gBAAgB,CAAC;QAC7E,IAAI,MAAM,CAAC,MAAM;YAAE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC/C,IAAI,MAAM,CAAC,WAAW;YAAE,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;QAE9D,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;QACtD,MAAM,CAAC,GAAG,QAAQ,CAAC,IAA+B,CAAC;QAEnD,OAAO,OAAO,CAAC;YACb,oBAAoB;YACpB,aAAa,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE;YAC5C,aAAa,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;YAC7B,aAAa,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE;SAC7C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChB,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,OAAO,eAAe,CAAC,GAAG,EAAE,0BAA0B,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
import { AxiosInstance } from 'axios';
|
|
2
2
|
interface ProjectDownloadParams {
|
|
3
3
|
project_id: string;
|
|
4
|
+
output_path?: string;
|
|
4
5
|
}
|
|
5
6
|
export declare function handleProjectDownload(client: AxiosInstance, params: ProjectDownloadParams): Promise<{
|
|
6
7
|
content: {
|
|
7
8
|
type: "text";
|
|
8
9
|
text: string;
|
|
9
10
|
}[];
|
|
10
|
-
isError
|
|
11
|
-
} |
|
|
12
|
-
content: {
|
|
13
|
-
type: "text";
|
|
14
|
-
text: string;
|
|
15
|
-
}[];
|
|
16
|
-
isError: boolean;
|
|
17
|
-
}>;
|
|
11
|
+
isError: true;
|
|
12
|
+
} | import("../utils/response.js").ToolResponse>;
|
|
18
13
|
export {};
|
|
19
14
|
//# sourceMappingURL=project-download.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-download.d.ts","sourceRoot":"","sources":["../../src/tools/project-download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"project-download.d.ts","sourceRoot":"","sources":["../../src/tools/project-download.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAOtC,UAAU,qBAAqB;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAsB,qBAAqB,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,qBAAqB;;;;;;iDAqB/F"}
|
|
@@ -1,32 +1,26 @@
|
|
|
1
|
+
import { writeFile, mkdir } from 'node:fs/promises';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { tmpdir } from 'node:os';
|
|
4
|
+
import { toErrorResponse } from '../utils/errors.js';
|
|
5
|
+
import { success } from '../utils/response.js';
|
|
1
6
|
export async function handleProjectDownload(client, params) {
|
|
2
|
-
const { project_id } = params;
|
|
3
7
|
try {
|
|
4
|
-
const response = await client.get(`/projects/${project_id}/download`, {
|
|
8
|
+
const response = await client.get(`/projects/${params.project_id}/download`, {
|
|
5
9
|
responseType: 'arraybuffer',
|
|
6
10
|
});
|
|
11
|
+
const buffer = response.data;
|
|
7
12
|
const contentLength = response.headers['content-length'];
|
|
8
|
-
const size = contentLength ? `${(Number(contentLength) / 1024
|
|
13
|
+
const size = contentLength ? `${(Number(contentLength) / 1024).toFixed(1)} KB` : `${buffer.byteLength} bytes`;
|
|
9
14
|
const disposition = response.headers['content-disposition'] ?? '';
|
|
10
|
-
const filename = disposition.match(/filename="?(.+?)"?$/)?.[1] ?? `project-${project_id}.zip`;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
],
|
|
18
|
-
};
|
|
15
|
+
const filename = disposition.match(/filename="?(.+?)"?$/)?.[1] ?? `project-${params.project_id}.zip`;
|
|
16
|
+
const destDir = params.output_path ?? tmpdir();
|
|
17
|
+
await mkdir(destDir, { recursive: true });
|
|
18
|
+
const destPath = path.join(destDir, filename);
|
|
19
|
+
await writeFile(destPath, Buffer.from(buffer));
|
|
20
|
+
return success(`✅ Project downloaded to disk.\n File: ${destPath}\n Size: ${size}`);
|
|
19
21
|
}
|
|
20
22
|
catch (err) {
|
|
21
|
-
|
|
22
|
-
? (err.response?.data?.error || 'Unknown error')
|
|
23
|
-
: err instanceof Error
|
|
24
|
-
? err.message
|
|
25
|
-
: 'Unknown error';
|
|
26
|
-
return {
|
|
27
|
-
content: [{ type: 'text', text: `❌ Failed to download project: ${message}` }],
|
|
28
|
-
isError: true,
|
|
29
|
-
};
|
|
23
|
+
return toErrorResponse(err, 'Failed to download project');
|
|
30
24
|
}
|
|
31
25
|
}
|
|
32
26
|
//# sourceMappingURL=project-download.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-download.js","sourceRoot":"","sources":["../../src/tools/project-download.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-download.js","sourceRoot":"","sources":["../../src/tools/project-download.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAO/C,MAAM,CAAC,KAAK,UAAU,qBAAqB,CAAC,MAAqB,EAAE,MAA6B;IAC9F,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,aAAa,MAAM,CAAC,UAAU,WAAW,EAAE;YAC3E,YAAY,EAAE,aAAa;SAC5B,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAmB,CAAC;QAC5C,MAAM,aAAa,GAAG,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC;QACzD,MAAM,IAAI,GAAG,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,UAAU,QAAQ,CAAC;QAC9G,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,qBAAqB,CAAC,IAAI,EAAE,CAAC;QAClE,MAAM,QAAQ,GAAG,WAAW,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,WAAW,MAAM,CAAC,UAAU,MAAM,CAAC;QAErG,MAAM,OAAO,GAAG,MAAM,CAAC,WAAW,IAAI,MAAM,EAAE,CAAC;QAC/C,MAAM,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;QAC9C,MAAM,SAAS,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAE/C,OAAO,OAAO,CAAC,0CAA0C,QAAQ,aAAa,IAAI,EAAE,CAAC,CAAC;IACxF,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,OAAO,eAAe,CAAC,GAAG,EAAE,4BAA4B,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC"}
|
|
@@ -7,13 +7,7 @@ export declare function handleProjectGet(client: AxiosInstance, params: ProjectG
|
|
|
7
7
|
type: "text";
|
|
8
8
|
text: string;
|
|
9
9
|
}[];
|
|
10
|
-
isError
|
|
11
|
-
} |
|
|
12
|
-
content: {
|
|
13
|
-
type: "text";
|
|
14
|
-
text: string;
|
|
15
|
-
}[];
|
|
16
|
-
isError: boolean;
|
|
17
|
-
}>;
|
|
10
|
+
isError: true;
|
|
11
|
+
} | import("../utils/response.js").ToolResponse>;
|
|
18
12
|
export {};
|
|
19
13
|
//# sourceMappingURL=project-get.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-get.d.ts","sourceRoot":"","sources":["../../src/tools/project-get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"project-get.d.ts","sourceRoot":"","sources":["../../src/tools/project-get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAKtC,UAAU,gBAAgB;IACxB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,gBAAgB,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,gBAAgB;;;;;;iDAwBrF"}
|
|
@@ -1,35 +1,27 @@
|
|
|
1
|
+
import { toErrorResponse } from '../utils/errors.js';
|
|
2
|
+
import { success } from '../utils/response.js';
|
|
3
|
+
import { asString, joinArray } from '../utils/api.js';
|
|
1
4
|
export async function handleProjectGet(client, params) {
|
|
2
|
-
const { project_id } = params;
|
|
3
5
|
try {
|
|
4
|
-
const response = await client.get(`/projects/${project_id}`);
|
|
6
|
+
const response = await client.get(`/projects/${params.project_id}`);
|
|
5
7
|
const p = response.data;
|
|
6
8
|
const lines = [
|
|
7
|
-
`📁 Project: ${
|
|
8
|
-
|
|
9
|
-
` ID: ${
|
|
10
|
-
` Status: ${
|
|
11
|
-
` Source language: ${
|
|
12
|
-
` Target langs: ${
|
|
13
|
-
` Source: ${
|
|
14
|
-
` Created: ${
|
|
9
|
+
`📁 Project: ${asString(p.name, 'Unnamed')}`,
|
|
10
|
+
'',
|
|
11
|
+
` ID: ${asString(p.id)}`,
|
|
12
|
+
` Status: ${asString(p.status, 'unknown')}`,
|
|
13
|
+
` Source language: ${asString(p.source_language)}`,
|
|
14
|
+
` Target langs: ${joinArray(p.target_languages, 'none')}`,
|
|
15
|
+
` Source: ${asString(p.source)}`,
|
|
16
|
+
` Created: ${asString(p.created_at)}`,
|
|
15
17
|
];
|
|
16
18
|
if (p.brand_voice) {
|
|
17
|
-
lines.push(` Brand voice: ${
|
|
19
|
+
lines.push(` Brand voice: ${asString(p.brand_voice)}`);
|
|
18
20
|
}
|
|
19
|
-
return
|
|
20
|
-
content: [{ type: 'text', text: lines.join('\n') }],
|
|
21
|
-
};
|
|
21
|
+
return success(lines.join('\n'));
|
|
22
22
|
}
|
|
23
23
|
catch (err) {
|
|
24
|
-
|
|
25
|
-
? (err.response?.data?.error || 'Unknown error')
|
|
26
|
-
: err instanceof Error
|
|
27
|
-
? err.message
|
|
28
|
-
: 'Unknown error';
|
|
29
|
-
return {
|
|
30
|
-
content: [{ type: 'text', text: `❌ Failed to get project: ${message}` }],
|
|
31
|
-
isError: true,
|
|
32
|
-
};
|
|
24
|
+
return toErrorResponse(err, 'Failed to get project');
|
|
33
25
|
}
|
|
34
26
|
}
|
|
35
27
|
//# sourceMappingURL=project-get.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-get.js","sourceRoot":"","sources":["../../src/tools/project-get.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-get.js","sourceRoot":"","sources":["../../src/tools/project-get.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAMtD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,MAAqB,EAAE,MAAwB;IACpF,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,aAAa,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;QACpE,MAAM,CAAC,GAAG,QAAQ,CAAC,IAA+B,CAAC;QAEnD,MAAM,KAAK,GAAa;YACtB,eAAe,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE;YAC5C,EAAE;YACF,sBAAsB,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE;YACtC,sBAAsB,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,EAAE;YACrD,sBAAsB,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE;YACnD,sBAAsB,SAAS,CAAC,CAAC,CAAC,gBAAgB,EAAE,MAAM,CAAC,EAAE;YAC7D,sBAAsB,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE;YAC1C,sBAAsB,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,EAAE;SAC/C,CAAC;QAEF,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC;YAClB,KAAK,CAAC,IAAI,CAAC,sBAAsB,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;QAC9D,CAAC;QAED,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,OAAO,eAAe,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;IACvD,CAAC;AACH,CAAC"}
|
|
@@ -8,13 +8,7 @@ export declare function handleProjectLanguageAdd(client: AxiosInstance, params:
|
|
|
8
8
|
type: "text";
|
|
9
9
|
text: string;
|
|
10
10
|
}[];
|
|
11
|
-
isError
|
|
12
|
-
} |
|
|
13
|
-
content: {
|
|
14
|
-
type: "text";
|
|
15
|
-
text: string;
|
|
16
|
-
}[];
|
|
17
|
-
isError: boolean;
|
|
18
|
-
}>;
|
|
11
|
+
isError: true;
|
|
12
|
+
} | import("../utils/response.js").ToolResponse>;
|
|
19
13
|
export {};
|
|
20
14
|
//# sourceMappingURL=project-language-add.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-language-add.d.ts","sourceRoot":"","sources":["../../src/tools/project-language-add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"project-language-add.d.ts","sourceRoot":"","sources":["../../src/tools/project-language-add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,UAAU,wBAAwB;IAChC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,wBAAwB;;;;;;iDAYrG"}
|
|
@@ -1,27 +1,16 @@
|
|
|
1
|
+
import { toErrorResponse } from '../utils/errors.js';
|
|
2
|
+
import { success } from '../utils/response.js';
|
|
1
3
|
export async function handleProjectLanguageAdd(client, params) {
|
|
2
|
-
const { project_id, language_id } = params;
|
|
3
4
|
try {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
text: `✅ Language added to project.\n Project: ${project_id}\n Language ID: ${language_id}`,
|
|
11
|
-
},
|
|
12
|
-
],
|
|
13
|
-
};
|
|
5
|
+
await client.post(`/projects/${params.project_id}/languages`, { language_id: params.language_id });
|
|
6
|
+
return success([
|
|
7
|
+
'✅ Language added to project.',
|
|
8
|
+
` Project: ${params.project_id}`,
|
|
9
|
+
` Language ID: ${params.language_id}`,
|
|
10
|
+
].join('\n'));
|
|
14
11
|
}
|
|
15
12
|
catch (err) {
|
|
16
|
-
|
|
17
|
-
? (err.response?.data?.error || 'Unknown error')
|
|
18
|
-
: err instanceof Error
|
|
19
|
-
? err.message
|
|
20
|
-
: 'Unknown error';
|
|
21
|
-
return {
|
|
22
|
-
content: [{ type: 'text', text: `❌ Failed to add language: ${message}` }],
|
|
23
|
-
isError: true,
|
|
24
|
-
};
|
|
13
|
+
return toErrorResponse(err, 'Failed to add language');
|
|
25
14
|
}
|
|
26
15
|
}
|
|
27
16
|
//# sourceMappingURL=project-language-add.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-language-add.js","sourceRoot":"","sources":["../../src/tools/project-language-add.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-language-add.js","sourceRoot":"","sources":["../../src/tools/project-language-add.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAO/C,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAAC,MAAqB,EAAE,MAAgC;IACpG,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,IAAI,CAAC,aAAa,MAAM,CAAC,UAAU,YAAY,EAAE,EAAE,WAAW,EAAE,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QAEnG,OAAO,OAAO,CAAC;YACb,8BAA8B;YAC9B,cAAc,MAAM,CAAC,UAAU,EAAE;YACjC,kBAAkB,MAAM,CAAC,WAAW,EAAE;SACvC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChB,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,OAAO,eAAe,CAAC,GAAG,EAAE,wBAAwB,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
|
|
@@ -8,13 +8,7 @@ export declare function handleProjectLanguageRemove(client: AxiosInstance, param
|
|
|
8
8
|
type: "text";
|
|
9
9
|
text: string;
|
|
10
10
|
}[];
|
|
11
|
-
isError
|
|
12
|
-
} |
|
|
13
|
-
content: {
|
|
14
|
-
type: "text";
|
|
15
|
-
text: string;
|
|
16
|
-
}[];
|
|
17
|
-
isError: boolean;
|
|
18
|
-
}>;
|
|
11
|
+
isError: true;
|
|
12
|
+
} | import("../utils/response.js").ToolResponse>;
|
|
19
13
|
export {};
|
|
20
14
|
//# sourceMappingURL=project-language-remove.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-language-remove.d.ts","sourceRoot":"","sources":["../../src/tools/project-language-remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"project-language-remove.d.ts","sourceRoot":"","sources":["../../src/tools/project-language-remove.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,UAAU,2BAA2B;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAsB,2BAA2B,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,2BAA2B;;;;;;iDAY3G"}
|
|
@@ -1,21 +1,16 @@
|
|
|
1
|
+
import { toErrorResponse } from '../utils/errors.js';
|
|
2
|
+
import { success } from '../utils/response.js';
|
|
1
3
|
export async function handleProjectLanguageRemove(client, params) {
|
|
2
|
-
const { project_id, language_id } = params;
|
|
3
4
|
try {
|
|
4
|
-
await client.delete(`/projects/${project_id}/languages/${language_id}`);
|
|
5
|
-
return
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
await client.delete(`/projects/${params.project_id}/languages/${params.language_id}`);
|
|
6
|
+
return success([
|
|
7
|
+
'✅ Language removed from project.',
|
|
8
|
+
` Project: ${params.project_id}`,
|
|
9
|
+
` Language ID: ${params.language_id}`,
|
|
10
|
+
].join('\n'));
|
|
8
11
|
}
|
|
9
12
|
catch (err) {
|
|
10
|
-
|
|
11
|
-
? (err.response?.data?.error || 'Unknown error')
|
|
12
|
-
: err instanceof Error
|
|
13
|
-
? err.message
|
|
14
|
-
: 'Unknown error';
|
|
15
|
-
return {
|
|
16
|
-
content: [{ type: 'text', text: `❌ Failed to remove language: ${message}` }],
|
|
17
|
-
isError: true,
|
|
18
|
-
};
|
|
13
|
+
return toErrorResponse(err, 'Failed to remove language');
|
|
19
14
|
}
|
|
20
15
|
}
|
|
21
16
|
//# sourceMappingURL=project-language-remove.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-language-remove.js","sourceRoot":"","sources":["../../src/tools/project-language-remove.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-language-remove.js","sourceRoot":"","sources":["../../src/tools/project-language-remove.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAO/C,MAAM,CAAC,KAAK,UAAU,2BAA2B,CAAC,MAAqB,EAAE,MAAmC;IAC1G,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,MAAM,CAAC,aAAa,MAAM,CAAC,UAAU,cAAc,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QAEtF,OAAO,OAAO,CAAC;YACb,kCAAkC;YAClC,cAAc,MAAM,CAAC,UAAU,EAAE;YACjC,kBAAkB,MAAM,CAAC,WAAW,EAAE;SACvC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAChB,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,OAAO,eAAe,CAAC,GAAG,EAAE,2BAA2B,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC"}
|
|
@@ -8,13 +8,7 @@ export declare function handleProjectList(client: AxiosInstance, params: Project
|
|
|
8
8
|
type: "text";
|
|
9
9
|
text: string;
|
|
10
10
|
}[];
|
|
11
|
-
isError
|
|
12
|
-
} |
|
|
13
|
-
content: {
|
|
14
|
-
type: "text";
|
|
15
|
-
text: string;
|
|
16
|
-
}[];
|
|
17
|
-
isError: boolean;
|
|
18
|
-
}>;
|
|
11
|
+
isError: true;
|
|
12
|
+
} | import("../utils/response.js").ToolResponse>;
|
|
19
13
|
export {};
|
|
20
14
|
//# sourceMappingURL=project-list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-list.d.ts","sourceRoot":"","sources":["../../src/tools/project-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"project-list.d.ts","sourceRoot":"","sources":["../../src/tools/project-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAKtC,UAAU,iBAAiB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,iBAAiB;;;;;;iDAkCvF"}
|
|
@@ -1,46 +1,39 @@
|
|
|
1
|
+
import { toErrorResponse } from '../utils/errors.js';
|
|
2
|
+
import { success, successWithData } from '../utils/response.js';
|
|
3
|
+
import { asString, joinArray, extractList } from '../utils/api.js';
|
|
1
4
|
export async function handleProjectList(client, params) {
|
|
2
|
-
const { page, limit } = params;
|
|
3
5
|
try {
|
|
4
6
|
const query = new URLSearchParams();
|
|
5
|
-
if (page)
|
|
6
|
-
query.set('page', String(page));
|
|
7
|
-
if (limit)
|
|
8
|
-
query.set('limit', String(limit));
|
|
7
|
+
if (params.page)
|
|
8
|
+
query.set('page', String(params.page));
|
|
9
|
+
if (params.limit)
|
|
10
|
+
query.set('limit', String(params.limit));
|
|
9
11
|
const qs = query.toString();
|
|
10
12
|
const url = `/projects${qs ? `?${qs}` : ''}`;
|
|
11
13
|
const response = await client.get(url);
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
+
const projects = extractList(response.data, 'data');
|
|
15
|
+
const pagination = response.data.pagination;
|
|
14
16
|
if (projects.length === 0) {
|
|
15
|
-
return
|
|
16
|
-
content: [{ type: 'text', text: '📁 No projects found. Create one with babelize_project_create.' }],
|
|
17
|
-
};
|
|
17
|
+
return success('📁 No projects found. Create one with babelize_project_create.');
|
|
18
18
|
}
|
|
19
|
-
const
|
|
19
|
+
const total = pagination?.total ?? projects.length;
|
|
20
|
+
const page = pagination?.page ?? 1;
|
|
21
|
+
const totalPages = pagination?.totalPages ?? 1;
|
|
22
|
+
const lines = [`📁 Projects (${total} total, page ${page}/${totalPages}):`, ''];
|
|
20
23
|
for (const p of projects) {
|
|
21
|
-
const name =
|
|
22
|
-
const id =
|
|
23
|
-
const status =
|
|
24
|
-
const source =
|
|
25
|
-
const targets =
|
|
24
|
+
const name = asString(p.name, 'Unnamed');
|
|
25
|
+
const id = asString(p.id);
|
|
26
|
+
const status = asString(p.status, 'unknown');
|
|
27
|
+
const source = asString(p.source_language);
|
|
28
|
+
const targets = joinArray(p.target_languages, 'none');
|
|
26
29
|
lines.push(` • ${name}`);
|
|
27
30
|
lines.push(` ID: ${id} | Status: ${status} | Source: ${source} | Targets: ${targets}`);
|
|
28
31
|
lines.push('');
|
|
29
32
|
}
|
|
30
|
-
return
|
|
31
|
-
content: [{ type: 'text', text: lines.join('\n') }],
|
|
32
|
-
};
|
|
33
|
+
return successWithData(lines.join('\n'), 'babelize://projects', projects);
|
|
33
34
|
}
|
|
34
35
|
catch (err) {
|
|
35
|
-
|
|
36
|
-
? (err.response?.data?.error || 'Unknown error')
|
|
37
|
-
: err instanceof Error
|
|
38
|
-
? err.message
|
|
39
|
-
: 'Unknown error';
|
|
40
|
-
return {
|
|
41
|
-
content: [{ type: 'text', text: `❌ Failed to list projects: ${message}` }],
|
|
42
|
-
isError: true,
|
|
43
|
-
};
|
|
36
|
+
return toErrorResponse(err, 'Failed to list projects');
|
|
44
37
|
}
|
|
45
38
|
}
|
|
46
39
|
//# sourceMappingURL=project-list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-list.js","sourceRoot":"","sources":["../../src/tools/project-list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-list.js","sourceRoot":"","sources":["../../src/tools/project-list.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAOnE,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAqB,EAAE,MAAyB;IACtF,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;QACpC,IAAI,MAAM,CAAC,IAAI;YAAE,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACxD,IAAI,MAAM,CAAC,KAAK;YAAE,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3D,MAAM,EAAE,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC5B,MAAM,GAAG,GAAG,YAAY,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QAC7C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACvC,MAAM,QAAQ,GAAG,WAAW,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAA8B,CAAC;QACjF,MAAM,UAAU,GAAI,QAAQ,CAAC,IAAgC,CAAC,UAAiD,CAAC;QAEhH,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1B,OAAO,OAAO,CAAC,gEAAgE,CAAC,CAAC;QACnF,CAAC;QAED,MAAM,KAAK,GAAG,UAAU,EAAE,KAAK,IAAI,QAAQ,CAAC,MAAM,CAAC;QACnD,MAAM,IAAI,GAAG,UAAU,EAAE,IAAI,IAAI,CAAC,CAAC;QACnC,MAAM,UAAU,GAAG,UAAU,EAAE,UAAU,IAAI,CAAC,CAAC;QAC/C,MAAM,KAAK,GAAa,CAAC,gBAAgB,KAAK,gBAAgB,IAAI,IAAI,UAAU,IAAI,EAAE,EAAE,CAAC,CAAC;QAC1F,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;YACzB,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YACzC,MAAM,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;YAC1B,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;YAC7C,MAAM,MAAM,GAAG,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC;YAC3C,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;YACtD,KAAK,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;YAC1B,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,gBAAgB,MAAM,gBAAgB,MAAM,iBAAiB,OAAO,EAAE,CAAC,CAAC;YAChG,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACjB,CAAC;QAED,OAAO,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,qBAAqB,EAAE,QAAQ,CAAC,CAAC;IAC5E,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,OAAO,eAAe,CAAC,GAAG,EAAE,yBAAyB,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
|
|
@@ -7,13 +7,7 @@ export declare function handleProjectSync(client: AxiosInstance, params: Project
|
|
|
7
7
|
type: "text";
|
|
8
8
|
text: string;
|
|
9
9
|
}[];
|
|
10
|
-
isError
|
|
11
|
-
} |
|
|
12
|
-
content: {
|
|
13
|
-
type: "text";
|
|
14
|
-
text: string;
|
|
15
|
-
}[];
|
|
16
|
-
isError: boolean;
|
|
17
|
-
}>;
|
|
10
|
+
isError: true;
|
|
11
|
+
} | import("../utils/response.js").ToolResponse>;
|
|
18
12
|
export {};
|
|
19
13
|
//# sourceMappingURL=project-sync.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-sync.d.ts","sourceRoot":"","sources":["../../src/tools/project-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"project-sync.d.ts","sourceRoot":"","sources":["../../src/tools/project-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAItC,UAAU,iBAAiB;IACzB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,iBAAiB;;;;;;iDAkBvF"}
|
|
@@ -1,29 +1,20 @@
|
|
|
1
|
+
import { toErrorResponse } from '../utils/errors.js';
|
|
2
|
+
import { success } from '../utils/response.js';
|
|
1
3
|
export async function handleProjectSync(client, params) {
|
|
2
|
-
const { project_id } = params;
|
|
3
4
|
try {
|
|
4
|
-
const response = await client.post(`/projects/${project_id}/sync`);
|
|
5
|
+
const response = await client.post(`/projects/${params.project_id}/sync`);
|
|
5
6
|
const result = response.data;
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
],
|
|
15
|
-
};
|
|
7
|
+
const lines = [
|
|
8
|
+
'🔄 Project sync triggered.',
|
|
9
|
+
` Project: ${params.project_id}`,
|
|
10
|
+
];
|
|
11
|
+
if (result.message) {
|
|
12
|
+
lines.push(` Message: ${String(result.message)}`);
|
|
13
|
+
}
|
|
14
|
+
return success(lines.join('\n'));
|
|
16
15
|
}
|
|
17
16
|
catch (err) {
|
|
18
|
-
|
|
19
|
-
? (err.response?.data?.error || 'Unknown error')
|
|
20
|
-
: err instanceof Error
|
|
21
|
-
? err.message
|
|
22
|
-
: 'Unknown error';
|
|
23
|
-
return {
|
|
24
|
-
content: [{ type: 'text', text: `❌ Failed to sync project: ${message}` }],
|
|
25
|
-
isError: true,
|
|
26
|
-
};
|
|
17
|
+
return toErrorResponse(err, 'Failed to sync project');
|
|
27
18
|
}
|
|
28
19
|
}
|
|
29
20
|
//# sourceMappingURL=project-sync.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-sync.js","sourceRoot":"","sources":["../../src/tools/project-sync.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"project-sync.js","sourceRoot":"","sources":["../../src/tools/project-sync.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAM/C,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,MAAqB,EAAE,MAAyB;IACtF,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,IAAI,CAAC,aAAa,MAAM,CAAC,UAAU,OAAO,CAAC,CAAC;QAC1E,MAAM,MAAM,GAAG,QAAQ,CAAC,IAA+B,CAAC;QAExD,MAAM,KAAK,GAAa;YACtB,4BAA4B;YAC5B,cAAc,MAAM,CAAC,UAAU,EAAE;SAClC,CAAC;QAEF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,KAAK,CAAC,IAAI,CAAC,cAAc,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACrD,CAAC;QAED,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,OAAO,eAAe,CAAC,GAAG,EAAE,wBAAwB,CAAC,CAAC;IACxD,CAAC;AACH,CAAC"}
|
|
@@ -4,12 +4,6 @@ export declare function handleProviderTokensList(client: AxiosInstance): Promise
|
|
|
4
4
|
type: "text";
|
|
5
5
|
text: string;
|
|
6
6
|
}[];
|
|
7
|
-
isError
|
|
8
|
-
} |
|
|
9
|
-
content: {
|
|
10
|
-
type: "text";
|
|
11
|
-
text: string;
|
|
12
|
-
}[];
|
|
13
|
-
isError: boolean;
|
|
14
|
-
}>;
|
|
7
|
+
isError: true;
|
|
8
|
+
} | import("../utils/response.js").ToolResponse>;
|
|
15
9
|
//# sourceMappingURL=provider-tokens-list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-tokens-list.d.ts","sourceRoot":"","sources":["../../src/tools/provider-tokens-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"provider-tokens-list.d.ts","sourceRoot":"","sources":["../../src/tools/provider-tokens-list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAKtC,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,aAAa;;;;;;iDAoBnE"}
|