@voicenter-team/nuxt-llms-generator 0.1.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.
@@ -0,0 +1,5 @@
1
+ module.exports = function(...args) {
2
+ return import('./module.mjs').then(m => m.default.call(this, ...args))
3
+ }
4
+ const _meta = module.exports.meta = require('./module.json')
5
+ module.exports.getMeta = () => Promise.resolve(_meta)
@@ -0,0 +1,138 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ interface LLMSConfig {
4
+ anthropicApiKey: string;
5
+ umbracoDataPath: string;
6
+ templatesOutputDir: string;
7
+ finalOutputDir: string;
8
+ cacheDir?: string;
9
+ anthropicModel?: string;
10
+ maxConcurrent?: number;
11
+ enableLLMSFullTxt?: boolean;
12
+ enableIndividualMd?: boolean;
13
+ enableAutoCleanup?: boolean;
14
+ cleanupOrphaned?: boolean;
15
+ cleanupHidden?: boolean;
16
+ }
17
+ interface UmbracoUrlItem {
18
+ nodeID: number;
19
+ url: string;
20
+ Jpath: string;
21
+ TemplateAlias: string;
22
+ }
23
+ interface UmbracoPageContent {
24
+ nodeID: number;
25
+ pageTitle?: string;
26
+ pageTittle?: string;
27
+ pageDescription?: string;
28
+ headerBlockTitle?: string;
29
+ headerBlockSubtitle?: string;
30
+ content?: string;
31
+ title?: string;
32
+ description?: string;
33
+ hidePage?: string | number | boolean | null;
34
+ children?: Record<string, UmbracoPageContent>;
35
+ [key: string]: any;
36
+ }
37
+ interface UmbracoSiteData {
38
+ pageTitle?: string;
39
+ pageDescription?: string;
40
+ mainHeaderBlockTitle?: string;
41
+ ogDescription?: string;
42
+ children?: Record<string, UmbracoPageContent>;
43
+ [key: string]: any;
44
+ }
45
+ interface UmbracoData {
46
+ urlList: UmbracoUrlItem[];
47
+ SiteData: UmbracoSiteData;
48
+ }
49
+ interface PageContentHash {
50
+ pageId: string;
51
+ jpath: string;
52
+ templateAlias: string;
53
+ structureHash: string;
54
+ lastUpdated: Date;
55
+ }
56
+ interface TemplateCache {
57
+ [pageId: string]: {
58
+ hash: string;
59
+ template: string;
60
+ metadata: PageContentHash;
61
+ };
62
+ }
63
+ interface GeneratedTemplate {
64
+ pageId: string;
65
+ templatePath: string;
66
+ template: string;
67
+ hash: string;
68
+ metadata: {
69
+ url: string;
70
+ templateAlias: string;
71
+ jpath: string;
72
+ generatedAt: Date;
73
+ };
74
+ }
75
+ interface LLMSFiles {
76
+ llmsTxt: {
77
+ path: string;
78
+ content: string;
79
+ };
80
+ llmsFullTxt?: {
81
+ path: string;
82
+ content: string;
83
+ };
84
+ individualMdFiles?: Array<{
85
+ path: string;
86
+ content: string;
87
+ url: string;
88
+ pageId: string;
89
+ }>;
90
+ }
91
+ interface AnthropicGenerationRequest {
92
+ pageContent: Record<string, any>;
93
+ templateAlias: string;
94
+ url: string;
95
+ jpath: string;
96
+ }
97
+ interface AnthropicGenerationResponse {
98
+ template: string;
99
+ metadata?: {
100
+ title?: string;
101
+ description?: string;
102
+ tags?: string[];
103
+ };
104
+ }
105
+ interface LLMSGeneratorOptions {
106
+ config: LLMSConfig;
107
+ umbracoData: UmbracoData;
108
+ templateCache?: TemplateCache;
109
+ }
110
+ interface PageStructureInfo {
111
+ keys: string[];
112
+ excludedKeys: string[];
113
+ hasChildren: boolean;
114
+ childrenCount: number;
115
+ }
116
+ interface HashGenerationOptions {
117
+ excludeChildren?: boolean;
118
+ excludeKeys?: string[];
119
+ includeOnlyKeys?: string[];
120
+ }
121
+ interface GenerationStats {
122
+ totalPages: number;
123
+ templatesGenerated: number;
124
+ templatesFromCache: number;
125
+ mdFilesGenerated: number;
126
+ llmsTxtGenerated: true;
127
+ llmsFullTxtGenerated: boolean;
128
+ duration: number;
129
+ apiCallsUsed: number;
130
+ }
131
+
132
+ interface LLMSModuleOptions extends Partial<LLMSConfig> {
133
+ enabled?: boolean;
134
+ }
135
+ declare const _default: _nuxt_schema.NuxtModule<LLMSModuleOptions, LLMSModuleOptions, false>;
136
+
137
+ export { _default as default };
138
+ export type { AnthropicGenerationRequest, AnthropicGenerationResponse, GeneratedTemplate, GenerationStats, HashGenerationOptions, LLMSConfig, LLMSFiles, LLMSGeneratorOptions, PageContentHash, PageStructureInfo, TemplateCache, UmbracoData, UmbracoPageContent, UmbracoSiteData, UmbracoUrlItem };
@@ -0,0 +1,138 @@
1
+ import * as _nuxt_schema from '@nuxt/schema';
2
+
3
+ interface LLMSConfig {
4
+ anthropicApiKey: string;
5
+ umbracoDataPath: string;
6
+ templatesOutputDir: string;
7
+ finalOutputDir: string;
8
+ cacheDir?: string;
9
+ anthropicModel?: string;
10
+ maxConcurrent?: number;
11
+ enableLLMSFullTxt?: boolean;
12
+ enableIndividualMd?: boolean;
13
+ enableAutoCleanup?: boolean;
14
+ cleanupOrphaned?: boolean;
15
+ cleanupHidden?: boolean;
16
+ }
17
+ interface UmbracoUrlItem {
18
+ nodeID: number;
19
+ url: string;
20
+ Jpath: string;
21
+ TemplateAlias: string;
22
+ }
23
+ interface UmbracoPageContent {
24
+ nodeID: number;
25
+ pageTitle?: string;
26
+ pageTittle?: string;
27
+ pageDescription?: string;
28
+ headerBlockTitle?: string;
29
+ headerBlockSubtitle?: string;
30
+ content?: string;
31
+ title?: string;
32
+ description?: string;
33
+ hidePage?: string | number | boolean | null;
34
+ children?: Record<string, UmbracoPageContent>;
35
+ [key: string]: any;
36
+ }
37
+ interface UmbracoSiteData {
38
+ pageTitle?: string;
39
+ pageDescription?: string;
40
+ mainHeaderBlockTitle?: string;
41
+ ogDescription?: string;
42
+ children?: Record<string, UmbracoPageContent>;
43
+ [key: string]: any;
44
+ }
45
+ interface UmbracoData {
46
+ urlList: UmbracoUrlItem[];
47
+ SiteData: UmbracoSiteData;
48
+ }
49
+ interface PageContentHash {
50
+ pageId: string;
51
+ jpath: string;
52
+ templateAlias: string;
53
+ structureHash: string;
54
+ lastUpdated: Date;
55
+ }
56
+ interface TemplateCache {
57
+ [pageId: string]: {
58
+ hash: string;
59
+ template: string;
60
+ metadata: PageContentHash;
61
+ };
62
+ }
63
+ interface GeneratedTemplate {
64
+ pageId: string;
65
+ templatePath: string;
66
+ template: string;
67
+ hash: string;
68
+ metadata: {
69
+ url: string;
70
+ templateAlias: string;
71
+ jpath: string;
72
+ generatedAt: Date;
73
+ };
74
+ }
75
+ interface LLMSFiles {
76
+ llmsTxt: {
77
+ path: string;
78
+ content: string;
79
+ };
80
+ llmsFullTxt?: {
81
+ path: string;
82
+ content: string;
83
+ };
84
+ individualMdFiles?: Array<{
85
+ path: string;
86
+ content: string;
87
+ url: string;
88
+ pageId: string;
89
+ }>;
90
+ }
91
+ interface AnthropicGenerationRequest {
92
+ pageContent: Record<string, any>;
93
+ templateAlias: string;
94
+ url: string;
95
+ jpath: string;
96
+ }
97
+ interface AnthropicGenerationResponse {
98
+ template: string;
99
+ metadata?: {
100
+ title?: string;
101
+ description?: string;
102
+ tags?: string[];
103
+ };
104
+ }
105
+ interface LLMSGeneratorOptions {
106
+ config: LLMSConfig;
107
+ umbracoData: UmbracoData;
108
+ templateCache?: TemplateCache;
109
+ }
110
+ interface PageStructureInfo {
111
+ keys: string[];
112
+ excludedKeys: string[];
113
+ hasChildren: boolean;
114
+ childrenCount: number;
115
+ }
116
+ interface HashGenerationOptions {
117
+ excludeChildren?: boolean;
118
+ excludeKeys?: string[];
119
+ includeOnlyKeys?: string[];
120
+ }
121
+ interface GenerationStats {
122
+ totalPages: number;
123
+ templatesGenerated: number;
124
+ templatesFromCache: number;
125
+ mdFilesGenerated: number;
126
+ llmsTxtGenerated: true;
127
+ llmsFullTxtGenerated: boolean;
128
+ duration: number;
129
+ apiCallsUsed: number;
130
+ }
131
+
132
+ interface LLMSModuleOptions extends Partial<LLMSConfig> {
133
+ enabled?: boolean;
134
+ }
135
+ declare const _default: _nuxt_schema.NuxtModule<LLMSModuleOptions, LLMSModuleOptions, false>;
136
+
137
+ export { _default as default };
138
+ export type { AnthropicGenerationRequest, AnthropicGenerationResponse, GeneratedTemplate, GenerationStats, HashGenerationOptions, LLMSConfig, LLMSFiles, LLMSGeneratorOptions, PageContentHash, PageStructureInfo, TemplateCache, UmbracoData, UmbracoPageContent, UmbracoSiteData, UmbracoUrlItem };
@@ -0,0 +1,8 @@
1
+ {
2
+ "name": "nuxt-llms-generator",
3
+ "configKey": "llmsGenerator",
4
+ "compatibility": {
5
+ "nuxt": "^3.0.0"
6
+ },
7
+ "version": "0.1.0"
8
+ }
@@ -0,0 +1,5 @@
1
+ export { l as default } from './shared/nuxt-llms-generator.dc009f50.mjs';
2
+ import '@nuxt/kit';
3
+ import 'fs';
4
+ import 'path';
5
+ import 'zod';
@@ -0,0 +1,327 @@
1
+ import { defineNuxtModule, useLogger, addTemplate } from '@nuxt/kit';
2
+ import { existsSync, readFileSync } from 'fs';
3
+ import { resolve } from 'path';
4
+ import { z } from 'zod';
5
+
6
+ const existingPath = z.string().refine(
7
+ (path) => existsSync(path)
8
+ );
9
+ const anthropicApiKey = z.string().min(10, "API key must be at least 10 characters").regex(/^sk-ant-/, "API key must start with sk-ant-");
10
+ const LLMSConfigSchema = z.object({
11
+ anthropicApiKey,
12
+ umbracoDataPath: existingPath,
13
+ templatesOutputDir: z.string().min(1, "Templates output directory is required"),
14
+ finalOutputDir: z.string().optional().default("public"),
15
+ cacheDir: z.string().optional().default(".llms-cache"),
16
+ anthropicModel: z.string().optional(),
17
+ maxConcurrent: z.number().int().min(1, "maxConcurrent must be at least 1").max(10, "maxConcurrent should not exceed 10 to avoid rate limits").optional().default(3),
18
+ enableLLMSFullTxt: z.boolean().optional().default(true),
19
+ enableIndividualMd: z.boolean().optional().default(true),
20
+ enableAutoCleanup: z.boolean().optional().default(true),
21
+ cleanupOrphaned: z.boolean().optional().default(true),
22
+ cleanupHidden: z.boolean().optional().default(true)
23
+ }).strict();
24
+ class SchemaValidator {
25
+ static validateConfig(config) {
26
+ try {
27
+ return LLMSConfigSchema.parse(config);
28
+ } catch (error) {
29
+ if (error instanceof z.ZodError) {
30
+ const { errors } = z.treeifyError(error);
31
+ const message = ["Configuration validation failed:", ...errors].join("\n");
32
+ throw new Error(message);
33
+ }
34
+ throw error;
35
+ }
36
+ }
37
+ }
38
+
39
+ var ErrorCode = /* @__PURE__ */ ((ErrorCode2) => {
40
+ ErrorCode2["INVALID_CONFIG"] = "INVALID_CONFIG";
41
+ ErrorCode2["MISSING_API_KEY"] = "MISSING_API_KEY";
42
+ ErrorCode2["INVALID_DATA_PATH"] = "INVALID_DATA_PATH";
43
+ ErrorCode2["INVALID_UMBRACO_DATA"] = "INVALID_UMBRACO_DATA";
44
+ ErrorCode2["PAGE_CONTENT_EXTRACTION_FAILED"] = "PAGE_CONTENT_EXTRACTION_FAILED";
45
+ ErrorCode2["INVALID_JPATH"] = "INVALID_JPATH";
46
+ ErrorCode2["ANTHROPIC_API_ERROR"] = "ANTHROPIC_API_ERROR";
47
+ ErrorCode2["ANTHROPIC_CONNECTION_FAILED"] = "ANTHROPIC_CONNECTION_FAILED";
48
+ ErrorCode2["TEMPLATE_GENERATION_FAILED"] = "TEMPLATE_GENERATION_FAILED";
49
+ ErrorCode2["RATE_LIMIT_EXCEEDED"] = "RATE_LIMIT_EXCEEDED";
50
+ ErrorCode2["TEMPLATE_VALIDATION_FAILED"] = "TEMPLATE_VALIDATION_FAILED";
51
+ ErrorCode2["TEMPLATE_RENDERING_FAILED"] = "TEMPLATE_RENDERING_FAILED";
52
+ ErrorCode2["MUSTACHE_SYNTAX_ERROR"] = "MUSTACHE_SYNTAX_ERROR";
53
+ ErrorCode2["FILE_READ_ERROR"] = "FILE_READ_ERROR";
54
+ ErrorCode2["FILE_WRITE_ERROR"] = "FILE_WRITE_ERROR";
55
+ ErrorCode2["DIRECTORY_CREATION_FAILED"] = "DIRECTORY_CREATION_FAILED";
56
+ ErrorCode2["CACHE_READ_ERROR"] = "CACHE_READ_ERROR";
57
+ ErrorCode2["CACHE_WRITE_ERROR"] = "CACHE_WRITE_ERROR";
58
+ ErrorCode2["CACHE_CORRUPTED"] = "CACHE_CORRUPTED";
59
+ return ErrorCode2;
60
+ })(ErrorCode || {});
61
+ class LLMSError extends Error {
62
+ code;
63
+ context;
64
+ cause;
65
+ constructor(code, message, context, cause) {
66
+ super(message);
67
+ this.name = "LLMSError";
68
+ this.code = code;
69
+ this.context = context;
70
+ this.cause = cause;
71
+ if (Error.captureStackTrace) {
72
+ Error.captureStackTrace(this, LLMSError);
73
+ }
74
+ }
75
+ }
76
+ class ConfigurationError extends LLMSError {
77
+ constructor(message, context, cause) {
78
+ super("INVALID_CONFIG" /* INVALID_CONFIG */, message, context, cause);
79
+ this.name = "ConfigurationError";
80
+ }
81
+ }
82
+ class DataProcessingError extends LLMSError {
83
+ constructor(code, message, context, cause) {
84
+ super(code, message, context, cause);
85
+ this.name = "DataProcessingError";
86
+ }
87
+ }
88
+ class AnthropicAPIError extends LLMSError {
89
+ statusCode;
90
+ retryable;
91
+ constructor(code, message, statusCode, retryable = false, context, cause) {
92
+ super(code, message, context, cause);
93
+ this.name = "AnthropicAPIError";
94
+ this.statusCode = statusCode;
95
+ this.retryable = retryable;
96
+ }
97
+ }
98
+ class TemplateError extends LLMSError {
99
+ constructor(code, message, context, cause) {
100
+ super(code, message, context, cause);
101
+ this.name = "TemplateError";
102
+ }
103
+ }
104
+ class FileSystemError extends LLMSError {
105
+ path;
106
+ constructor(code, message, path, context, cause) {
107
+ super(code, message, context, cause);
108
+ this.name = "FileSystemError";
109
+ this.path = path;
110
+ }
111
+ }
112
+ class CacheError extends LLMSError {
113
+ constructor(code, message, context, cause) {
114
+ super(code, message, context, cause);
115
+ this.name = "CacheError";
116
+ }
117
+ }
118
+ class ErrorHandler {
119
+ static handleError(error, context) {
120
+ if (error instanceof LLMSError) {
121
+ return error;
122
+ }
123
+ if (error.message.includes("ENOENT")) {
124
+ return new FileSystemError(
125
+ "FILE_READ_ERROR" /* FILE_READ_ERROR */,
126
+ `File not found: ${error.message}`,
127
+ void 0,
128
+ context,
129
+ error
130
+ );
131
+ }
132
+ if (error.message.includes("EACCES")) {
133
+ return new FileSystemError(
134
+ "FILE_WRITE_ERROR" /* FILE_WRITE_ERROR */,
135
+ `Permission denied: ${error.message}`,
136
+ void 0,
137
+ context,
138
+ error
139
+ );
140
+ }
141
+ if (error.message.includes("rate limit")) {
142
+ return new AnthropicAPIError(
143
+ "RATE_LIMIT_EXCEEDED" /* RATE_LIMIT_EXCEEDED */,
144
+ error.message,
145
+ 429,
146
+ true,
147
+ context,
148
+ error
149
+ );
150
+ }
151
+ if (error.message.includes("API key")) {
152
+ return new ConfigurationError(
153
+ "Invalid or missing Anthropic API key",
154
+ context,
155
+ error
156
+ );
157
+ }
158
+ return new LLMSError(
159
+ "TEMPLATE_GENERATION_FAILED" /* TEMPLATE_GENERATION_FAILED */,
160
+ // Default code
161
+ error.message,
162
+ context,
163
+ error
164
+ );
165
+ }
166
+ static logError(error, logger = console) {
167
+ const logData = {
168
+ name: error.name,
169
+ code: error.code,
170
+ message: error.message,
171
+ context: error.context,
172
+ stack: error.stack
173
+ };
174
+ if (error instanceof ConfigurationError || error instanceof DataProcessingError) {
175
+ logger.error("LLMS Generator Error:", logData);
176
+ } else if (error instanceof AnthropicAPIError && error.retryable) {
177
+ logger.warn("LLMS API Error (retryable):", logData);
178
+ } else if (error instanceof CacheError || error instanceof FileSystemError) {
179
+ logger.error("LLMS System Error:", logData);
180
+ } else {
181
+ logger.error("LLMS Unknown Error:", logData);
182
+ }
183
+ }
184
+ static isRetryable(error) {
185
+ if (error instanceof AnthropicAPIError) {
186
+ return error.retryable;
187
+ }
188
+ if (error.message.includes("network") || error.message.includes("timeout")) {
189
+ return true;
190
+ }
191
+ return false;
192
+ }
193
+ }
194
+ async function withErrorHandling(operation, context) {
195
+ try {
196
+ return await operation();
197
+ } catch (error) {
198
+ const llmsError = ErrorHandler.handleError(error instanceof Error ? error : new Error(String(error)), context);
199
+ ErrorHandler.logError(llmsError);
200
+ throw llmsError;
201
+ }
202
+ }
203
+
204
+ const DEFAULT_OPTIONS = {
205
+ anthropicModel: "claude-3-7-sonnet-latest",
206
+ maxConcurrent: 5,
207
+ enableLLMSFullTxt: true,
208
+ enableIndividualMd: true,
209
+ cacheDir: ".llms-cache",
210
+ finalOutputDir: "public",
211
+ enableAutoCleanup: true,
212
+ cleanupOrphaned: true,
213
+ cleanupHidden: true
214
+ };
215
+ const llmsModule = defineNuxtModule({
216
+ meta: {
217
+ name: "nuxt-llms-generator",
218
+ configKey: "llmsGenerator",
219
+ compatibility: {
220
+ nuxt: "^3.0.0"
221
+ }
222
+ },
223
+ defaults: {
224
+ enabled: true,
225
+ ...DEFAULT_OPTIONS
226
+ },
227
+ async setup(options, nuxt) {
228
+ const logger = useLogger("llms-generator");
229
+ if (!options.enabled) {
230
+ logger.info("LLMS Generator is disabled");
231
+ return;
232
+ }
233
+ if (!options.anthropicApiKey) {
234
+ logger.warn("No Anthropic API key provided. LLMS Generator will be disabled.");
235
+ return;
236
+ }
237
+ if (!options.umbracoDataPath) {
238
+ logger.warn("No Umbraco data path provided. LLMS Generator will be disabled.");
239
+ return;
240
+ }
241
+ if (!options.templatesOutputDir) {
242
+ logger.warn("No templates output directory provided. LLMS Generator will be disabled.");
243
+ return;
244
+ }
245
+ const configForValidation = {
246
+ anthropicApiKey: options.anthropicApiKey,
247
+ umbracoDataPath: resolve(nuxt.options.rootDir, options.umbracoDataPath),
248
+ templatesOutputDir: resolve(nuxt.options.rootDir, options.templatesOutputDir),
249
+ finalOutputDir: resolve(nuxt.options.rootDir, options.finalOutputDir ?? "public"),
250
+ cacheDir: options.cacheDir ? resolve(nuxt.options.rootDir, options.cacheDir) : void 0,
251
+ anthropicModel: options.anthropicModel || DEFAULT_OPTIONS.anthropicModel,
252
+ maxConcurrent: options.maxConcurrent || DEFAULT_OPTIONS.maxConcurrent,
253
+ enableLLMSFullTxt: options.enableLLMSFullTxt ?? DEFAULT_OPTIONS.enableLLMSFullTxt,
254
+ enableIndividualMd: options.enableIndividualMd ?? DEFAULT_OPTIONS.enableIndividualMd,
255
+ enableAutoCleanup: options.enableAutoCleanup ?? DEFAULT_OPTIONS.enableAutoCleanup,
256
+ cleanupOrphaned: options.cleanupOrphaned ?? DEFAULT_OPTIONS.cleanupOrphaned,
257
+ cleanupHidden: options.cleanupHidden ?? DEFAULT_OPTIONS.cleanupHidden
258
+ };
259
+ let moduleOptions;
260
+ try {
261
+ moduleOptions = SchemaValidator.validateConfig(configForValidation);
262
+ logger.success("LLMS Generator configuration validated successfully");
263
+ } catch (error) {
264
+ logger.error("LLMS Generator configuration validation failed:");
265
+ const cause = error instanceof Error ? error : new Error(String(error));
266
+ logger.error(cause.message);
267
+ throw new ConfigurationError(
268
+ "Invalid LLMS Generator configuration",
269
+ { providedConfig: configForValidation },
270
+ cause
271
+ );
272
+ }
273
+ try {
274
+ const umbracoDataContent = readFileSync(moduleOptions.umbracoDataPath, "utf-8");
275
+ const umbracoData = JSON.parse(umbracoDataContent);
276
+ logger.info(`Loaded Umbraco data with ${umbracoData.urlList.length} pages`);
277
+ nuxt.options.runtimeConfig.llmsGenerator = {
278
+ enabled: true,
279
+ config: moduleOptions,
280
+ pagesCount: umbracoData.urlList.length
281
+ };
282
+ addTemplate({
283
+ filename: "llms-module-options.mjs",
284
+ getContents: () => `export default ${JSON.stringify(moduleOptions, null, 2)}`
285
+ });
286
+ if (nuxt.options.dev) {
287
+ logger.info("LLMS Generator: Development mode - templates will be generated on demand");
288
+ } else {
289
+ logger.info("LLMS Generator: Production mode - templates and files will be generated during build");
290
+ nuxt.hook("build:before", async () => {
291
+ logger.info("Starting LLMS template generation...");
292
+ await generateLLMSFiles(moduleOptions, umbracoData, logger);
293
+ });
294
+ }
295
+ } catch (error) {
296
+ logger.error("Failed to load Umbraco data:", error);
297
+ nuxt.options.runtimeConfig.llmsGenerator = { enabled: false };
298
+ }
299
+ }
300
+ });
301
+ async function generateLLMSFiles(config, umbracoData, logger) {
302
+ try {
303
+ const { LLMSFilesGenerator } = await import('../chunks/llms-files-generator.mjs');
304
+ const generator = new LLMSFilesGenerator(config);
305
+ logger.info("Testing Anthropic API connection...");
306
+ const connectionOk = await generator["templateGenerator"].testConnection();
307
+ if (!connectionOk) {
308
+ logger.warn("Anthropic API connection test failed. Check your API key.");
309
+ return;
310
+ }
311
+ logger.success("Anthropic API connection successful");
312
+ const files = await generator.generateAllFiles(umbracoData);
313
+ logger.success("Generated LLMS files:");
314
+ logger.info(`- llms.txt: ${files.llmsTxt.path}`);
315
+ if (files.llmsFullTxt) {
316
+ logger.info(`- llms-full.txt: ${files.llmsFullTxt.path}`);
317
+ }
318
+ if (files.individualMdFiles) {
319
+ logger.info(`- Individual MD files: ${files.individualMdFiles.length}`);
320
+ }
321
+ } catch (error) {
322
+ logger.error("LLMS file generation failed:", error);
323
+ throw error;
324
+ }
325
+ }
326
+
327
+ export { ErrorCode as E, TemplateError as T, llmsModule as l, withErrorHandling as w };
@@ -0,0 +1,8 @@
1
+
2
+ import type { } from './module.js'
3
+
4
+
5
+
6
+
7
+
8
+ export type { default } from './module.js'
@@ -0,0 +1,8 @@
1
+
2
+ import type { } from './module'
3
+
4
+
5
+
6
+
7
+
8
+ export type { default } from './module'