@imenam/mcp-documentor 1.0.38 → 1.0.41

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.
@@ -0,0 +1,40 @@
1
+ import { PrepareExportBundleArgsSchema } from "../../shared/schemas/doc.schema.js";
2
+ import { slugify } from "./create-doc.js";
3
+ export async function prepareExportBundle(storageEngine, args) {
4
+ try {
5
+ const validated = PrepareExportBundleArgsSchema.parse(args);
6
+ const id = slugify(validated.name);
7
+ const now = new Date().toISOString();
8
+ const bundles = storageEngine.getBundles();
9
+ const existingIndex = bundles.findIndex((b) => b.id === id);
10
+ const bundle = {
11
+ id,
12
+ name: validated.name,
13
+ zipFilename: validated.zip_filename.endsWith(".zip")
14
+ ? validated.zip_filename
15
+ : `${validated.zip_filename}.zip`,
16
+ docs: validated.docs,
17
+ ...(validated.description && { description: validated.description }),
18
+ createdAt: existingIndex >= 0 ? bundles[existingIndex].createdAt : now,
19
+ updatedAt: now,
20
+ };
21
+ if (existingIndex >= 0) {
22
+ bundles[existingIndex] = bundle;
23
+ }
24
+ else {
25
+ bundles.push(bundle);
26
+ }
27
+ storageEngine.saveBundles(bundles);
28
+ const action = existingIndex >= 0 ? "updated" : "created";
29
+ return {
30
+ content: [{
31
+ type: "text",
32
+ text: `Export bundle "${validated.name}" (id: "${id}") ${action} with ${validated.docs.length} doc(s). ZIP filename: "${bundle.zipFilename}".`,
33
+ }],
34
+ };
35
+ }
36
+ catch (err) {
37
+ const message = err instanceof Error ? err.message : String(err);
38
+ return { isError: true, content: [{ type: "text", text: `Error preparing export bundle: ${message}` }] };
39
+ }
40
+ }
@@ -1 +1 @@
1
- export declare const APP_VERSION = "1.0.38";
1
+ export declare const APP_VERSION = "1.0.41";
@@ -1,2 +1,2 @@
1
1
  // Auto-generated version file - do not edit manually
2
- export const APP_VERSION = '1.0.38';
2
+ export const APP_VERSION = '1.0.41';