@claudetools/tools 0.3.9 → 0.5.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 (47) hide show
  1. package/README.md +60 -4
  2. package/dist/cli.js +0 -0
  3. package/dist/codedna/generators/base.d.ts +41 -0
  4. package/dist/codedna/generators/base.js +102 -0
  5. package/dist/codedna/generators/express-api.d.ts +12 -0
  6. package/dist/codedna/generators/express-api.js +61 -0
  7. package/dist/codedna/index.d.ts +4 -0
  8. package/dist/codedna/index.js +7 -0
  9. package/dist/codedna/parser.d.ts +117 -0
  10. package/dist/codedna/parser.js +233 -0
  11. package/dist/codedna/registry.d.ts +60 -0
  12. package/dist/codedna/registry.js +217 -0
  13. package/dist/codedna/template-engine.d.ts +17 -0
  14. package/dist/codedna/template-engine.js +183 -0
  15. package/dist/codedna/types.d.ts +64 -0
  16. package/dist/codedna/types.js +4 -0
  17. package/dist/handlers/codedna-handlers.d.ts +122 -0
  18. package/dist/handlers/codedna-handlers.js +194 -0
  19. package/dist/handlers/tool-handlers.js +593 -14
  20. package/dist/helpers/api-client.d.ts +37 -0
  21. package/dist/helpers/api-client.js +70 -0
  22. package/dist/helpers/codedna-monitoring.d.ts +34 -0
  23. package/dist/helpers/codedna-monitoring.js +159 -0
  24. package/dist/helpers/error-tracking.d.ts +73 -0
  25. package/dist/helpers/error-tracking.js +164 -0
  26. package/dist/helpers/library-detection.d.ts +26 -0
  27. package/dist/helpers/library-detection.js +145 -0
  28. package/dist/helpers/tasks-retry.d.ts +49 -0
  29. package/dist/helpers/tasks-retry.js +168 -0
  30. package/dist/helpers/tasks.d.ts +24 -1
  31. package/dist/helpers/tasks.js +146 -50
  32. package/dist/helpers/usage-analytics.d.ts +91 -0
  33. package/dist/helpers/usage-analytics.js +256 -0
  34. package/dist/helpers/workers.d.ts +25 -0
  35. package/dist/helpers/workers.js +80 -0
  36. package/dist/templates/claude-md.d.ts +1 -1
  37. package/dist/templates/claude-md.js +16 -5
  38. package/dist/tools.js +314 -0
  39. package/docs/AUTO-REGISTRATION.md +353 -0
  40. package/docs/CLAUDE4_PROMPT_ANALYSIS.md +589 -0
  41. package/docs/ENTITY_DSL_REFERENCE.md +685 -0
  42. package/docs/MODERN_STACK_COMPLETE_GUIDE.md +706 -0
  43. package/docs/PROMPT_STANDARDIZATION_RESULTS.md +324 -0
  44. package/docs/PROMPT_TIER_TEMPLATES.md +787 -0
  45. package/docs/RESEARCH_METHODOLOGY_EXTRACTION.md +336 -0
  46. package/package.json +14 -3
  47. package/scripts/verify-prompt-compliance.sh +197 -0
@@ -0,0 +1,60 @@
1
+ import { GeneratorMetadata } from './types.js';
2
+ export interface RegistryResponse {
3
+ generators: GeneratorMetadata[];
4
+ version: string;
5
+ updated: string;
6
+ }
7
+ export declare class TemplateRegistry {
8
+ private baseUrl;
9
+ private cacheDir;
10
+ private useCache;
11
+ constructor(baseUrl?: string, useCache?: boolean);
12
+ /**
13
+ * List all available generators
14
+ */
15
+ listGenerators(): Promise<GeneratorMetadata[]>;
16
+ /**
17
+ * Get metadata for specific generator
18
+ */
19
+ getGeneratorMetadata(generatorId: string): Promise<GeneratorMetadata>;
20
+ /**
21
+ * Get template file content
22
+ */
23
+ getTemplate(generatorId: string, templateFile: string): Promise<string>;
24
+ /**
25
+ * Get multiple templates at once
26
+ */
27
+ getTemplates(generatorId: string, templateFiles: string[]): Promise<Record<string, string>>;
28
+ /**
29
+ * Check if template is cached locally
30
+ */
31
+ private getCachedTemplate;
32
+ /**
33
+ * Cache template locally
34
+ */
35
+ private cacheTemplate;
36
+ /**
37
+ * Get local generators (fallback)
38
+ */
39
+ private getLocalGenerators;
40
+ /**
41
+ * Get local metadata (fallback)
42
+ */
43
+ private getLocalMetadata;
44
+ /**
45
+ * Get local template (fallback)
46
+ */
47
+ private getLocalTemplate;
48
+ /**
49
+ * Clear local cache
50
+ */
51
+ clearCache(): Promise<void>;
52
+ /**
53
+ * Get cache statistics
54
+ */
55
+ getCacheStats(): Promise<{
56
+ cachedGenerators: string[];
57
+ totalFiles: number;
58
+ totalSize: number;
59
+ }>;
60
+ }
@@ -0,0 +1,217 @@
1
+ // =============================================================================
2
+ // Template Registry Client
3
+ // =============================================================================
4
+ //
5
+ // HTTP client for Cloudflare Workers template registry with local caching
6
+ // and fallback to bundled templates on network failure.
7
+ //
8
+ import fs from 'fs/promises';
9
+ import path from 'path';
10
+ import { fileURLToPath } from 'url';
11
+ import { errorTracker } from '../helpers/error-tracking.js';
12
+ const __dirname = path.dirname(fileURLToPath(import.meta.url));
13
+ export class TemplateRegistry {
14
+ baseUrl;
15
+ cacheDir;
16
+ useCache;
17
+ constructor(baseUrl = 'https://api.claudetools.dev/api/v1/codedna', useCache = true) {
18
+ this.baseUrl = baseUrl;
19
+ this.cacheDir = path.join(__dirname, '../../templates');
20
+ this.useCache = useCache;
21
+ }
22
+ /**
23
+ * List all available generators
24
+ */
25
+ async listGenerators() {
26
+ try {
27
+ const response = await fetch(`${this.baseUrl}/registry`, {
28
+ signal: AbortSignal.timeout(5000), // 5 second timeout
29
+ });
30
+ if (!response.ok) {
31
+ throw new Error(`Registry fetch failed: ${response.statusText}`);
32
+ }
33
+ const data = await response.json();
34
+ return data.generators;
35
+ }
36
+ catch (error) {
37
+ console.warn('Failed to fetch from registry, using local fallback:', error);
38
+ return this.getLocalGenerators();
39
+ }
40
+ }
41
+ /**
42
+ * Get metadata for specific generator
43
+ */
44
+ async getGeneratorMetadata(generatorId) {
45
+ try {
46
+ const response = await fetch(`${this.baseUrl}/metadata/${generatorId}`, {
47
+ signal: AbortSignal.timeout(5000),
48
+ });
49
+ if (!response.ok) {
50
+ throw new Error(`Metadata fetch failed: ${response.statusText}`);
51
+ }
52
+ return await response.json();
53
+ }
54
+ catch (error) {
55
+ console.warn('Failed to fetch metadata from registry, using local fallback:', error);
56
+ return this.getLocalMetadata(generatorId);
57
+ }
58
+ }
59
+ /**
60
+ * Get template file content
61
+ */
62
+ async getTemplate(generatorId, templateFile) {
63
+ // Check cache first
64
+ if (this.useCache) {
65
+ const cached = await this.getCachedTemplate(generatorId, templateFile);
66
+ if (cached)
67
+ return cached;
68
+ }
69
+ // Fetch from registry
70
+ try {
71
+ const response = await fetch(`${this.baseUrl}/templates/${generatorId}/${templateFile}`, {
72
+ signal: AbortSignal.timeout(10000), // 10 second timeout for templates
73
+ });
74
+ if (!response.ok) {
75
+ throw new Error(`Template fetch failed: ${response.statusText}`);
76
+ }
77
+ const content = await response.text();
78
+ // Cache it
79
+ if (this.useCache) {
80
+ await this.cacheTemplate(generatorId, templateFile, content);
81
+ }
82
+ return content;
83
+ }
84
+ catch (error) {
85
+ console.warn('Failed to fetch template from registry, using local fallback:', error);
86
+ // Track template fetch error
87
+ await errorTracker.trackTemplateFetchError(generatorId, templateFile, error instanceof Error ? error : new Error(String(error)));
88
+ return this.getLocalTemplate(generatorId, templateFile);
89
+ }
90
+ }
91
+ /**
92
+ * Get multiple templates at once
93
+ */
94
+ async getTemplates(generatorId, templateFiles) {
95
+ const results = {};
96
+ await Promise.all(templateFiles.map(async (file) => {
97
+ results[file] = await this.getTemplate(generatorId, file);
98
+ }));
99
+ return results;
100
+ }
101
+ /**
102
+ * Check if template is cached locally
103
+ */
104
+ async getCachedTemplate(generatorId, templateFile) {
105
+ try {
106
+ const cachePath = path.join(this.cacheDir, generatorId, templateFile);
107
+ return await fs.readFile(cachePath, 'utf-8');
108
+ }
109
+ catch {
110
+ return null;
111
+ }
112
+ }
113
+ /**
114
+ * Cache template locally
115
+ */
116
+ async cacheTemplate(generatorId, templateFile, content) {
117
+ try {
118
+ const cachePath = path.join(this.cacheDir, generatorId, templateFile);
119
+ await fs.mkdir(path.dirname(cachePath), { recursive: true });
120
+ await fs.writeFile(cachePath, content, 'utf-8');
121
+ }
122
+ catch (error) {
123
+ console.warn('Failed to cache template:', error);
124
+ }
125
+ }
126
+ /**
127
+ * Get local generators (fallback)
128
+ */
129
+ async getLocalGenerators() {
130
+ // Return hardcoded list of bundled generators
131
+ return [
132
+ {
133
+ id: 'express-api',
134
+ name: 'Express REST API',
135
+ framework: 'express',
136
+ description: 'Generate TypeScript Express API with CRUD operations',
137
+ features: ['auth', 'validation', 'tests'],
138
+ databases: ['postgresql', 'mysql', 'mongodb'],
139
+ version: '1.0.0',
140
+ templates: [
141
+ 'controller.ts.j2',
142
+ 'model.ts.j2',
143
+ 'route.ts.j2',
144
+ 'middleware.ts.j2',
145
+ 'validator.ts.j2',
146
+ ],
147
+ },
148
+ ];
149
+ }
150
+ /**
151
+ * Get local metadata (fallback)
152
+ */
153
+ async getLocalMetadata(generatorId) {
154
+ const generators = await this.getLocalGenerators();
155
+ const generator = generators.find(g => g.id === generatorId);
156
+ if (!generator) {
157
+ throw new Error(`Generator not found: ${generatorId}`);
158
+ }
159
+ return generator;
160
+ }
161
+ /**
162
+ * Get local template (fallback)
163
+ */
164
+ async getLocalTemplate(generatorId, templateFile) {
165
+ // Try to load from local bundled templates
166
+ const localPath = path.join(__dirname, '../../../cloudflare/templates', generatorId, templateFile);
167
+ try {
168
+ return await fs.readFile(localPath, 'utf-8');
169
+ }
170
+ catch (error) {
171
+ throw new Error(`Template not found: ${generatorId}/${templateFile}. Registry unavailable and local fallback missing.`);
172
+ }
173
+ }
174
+ /**
175
+ * Clear local cache
176
+ */
177
+ async clearCache() {
178
+ try {
179
+ await fs.rm(this.cacheDir, { recursive: true, force: true });
180
+ }
181
+ catch (error) {
182
+ console.warn('Failed to clear cache:', error);
183
+ }
184
+ }
185
+ /**
186
+ * Get cache statistics
187
+ */
188
+ async getCacheStats() {
189
+ try {
190
+ const entries = await fs.readdir(this.cacheDir, { withFileTypes: true });
191
+ const generators = entries.filter(e => e.isDirectory()).map(e => e.name);
192
+ let totalFiles = 0;
193
+ let totalSize = 0;
194
+ for (const gen of generators) {
195
+ const genPath = path.join(this.cacheDir, gen);
196
+ const files = await fs.readdir(genPath);
197
+ totalFiles += files.length;
198
+ for (const file of files) {
199
+ const stats = await fs.stat(path.join(genPath, file));
200
+ totalSize += stats.size;
201
+ }
202
+ }
203
+ return {
204
+ cachedGenerators: generators,
205
+ totalFiles,
206
+ totalSize,
207
+ };
208
+ }
209
+ catch {
210
+ return {
211
+ cachedGenerators: [],
212
+ totalFiles: 0,
213
+ totalSize: 0,
214
+ };
215
+ }
216
+ }
217
+ }
@@ -0,0 +1,17 @@
1
+ import { EntitySpec } from './parser.js';
2
+ export declare class TemplateEngine {
3
+ private env;
4
+ constructor();
5
+ /**
6
+ * Render template string with context
7
+ */
8
+ render(template: string, context: any): string;
9
+ /**
10
+ * Add custom filters for code generation
11
+ */
12
+ private addFilters;
13
+ }
14
+ /**
15
+ * Helper to build template context from EntitySpec
16
+ */
17
+ export declare function buildContext(entity: EntitySpec, options?: any): any;
@@ -0,0 +1,183 @@
1
+ // =============================================================================
2
+ // Template Engine with Custom Filters
3
+ // =============================================================================
4
+ //
5
+ // Jinja2-style template engine using nunjucks with custom filters for
6
+ // code generation (plural, camelCase, TypeScript types, SQL types, etc.)
7
+ //
8
+ import nunjucks from 'nunjucks';
9
+ export class TemplateEngine {
10
+ env;
11
+ constructor() {
12
+ // Configure nunjucks
13
+ this.env = new nunjucks.Environment(null, {
14
+ autoescape: false,
15
+ trimBlocks: true,
16
+ lstripBlocks: true,
17
+ });
18
+ // Add custom filters
19
+ this.addFilters();
20
+ }
21
+ /**
22
+ * Render template string with context
23
+ */
24
+ render(template, context) {
25
+ return this.env.renderString(template, context);
26
+ }
27
+ /**
28
+ * Add custom filters for code generation
29
+ */
30
+ addFilters() {
31
+ // Pluralize: User → Users
32
+ this.env.addFilter('plural', (str) => {
33
+ if (str === 'person')
34
+ return 'people';
35
+ if (str.endsWith('y'))
36
+ return str.slice(0, -1) + 'ies';
37
+ if (str.endsWith('s'))
38
+ return str + 'es';
39
+ return str + 's';
40
+ });
41
+ // Lowercase: User → user
42
+ this.env.addFilter('lower', (str) => {
43
+ return str.toLowerCase();
44
+ });
45
+ // Uppercase: user → USER
46
+ this.env.addFilter('upper', (str) => {
47
+ return str.toUpperCase();
48
+ });
49
+ // camelCase: user_name → userName, first-name → firstName, my value → myValue
50
+ this.env.addFilter('camel', (str) => {
51
+ return str
52
+ .replace(/[-_\s]([a-zA-Z])/g, (_, letter) => letter.toUpperCase())
53
+ .replace(/^[A-Z]/, letter => letter.toLowerCase());
54
+ });
55
+ // PascalCase: user_name → UserName, first-name → FirstName, my value → MyValue
56
+ this.env.addFilter('pascal', (str) => {
57
+ const camel = str.replace(/[-_\s]([a-zA-Z])/g, (_, letter) => letter.toUpperCase());
58
+ return camel.charAt(0).toUpperCase() + camel.slice(1);
59
+ });
60
+ // snake_case: userName → user_name, FirstName → first_name
61
+ this.env.addFilter('snake', (str) => {
62
+ return str
63
+ .replace(/[A-Z]/g, letter => '_' + letter.toLowerCase())
64
+ .replace(/^_/, '');
65
+ });
66
+ // kebab-case: userName → user-name, FirstName → first-name
67
+ this.env.addFilter('kebab', (str) => {
68
+ return str
69
+ .replace(/[A-Z]/g, letter => '-' + letter.toLowerCase())
70
+ .replace(/^-/, '');
71
+ });
72
+ // Check if array includes value
73
+ this.env.addFilter('includes', (arr, val) => {
74
+ return Array.isArray(arr) && arr.includes(val);
75
+ });
76
+ // Get TypeScript type for field type
77
+ this.env.addFilter('tsType', (type) => {
78
+ if (type.kind === 'primitive') {
79
+ const typeMap = {
80
+ string: 'string',
81
+ integer: 'number',
82
+ decimal: 'number',
83
+ boolean: 'boolean',
84
+ datetime: 'Date',
85
+ email: 'string',
86
+ url: 'string',
87
+ json: 'any',
88
+ };
89
+ return typeMap[type.value] || 'any';
90
+ }
91
+ if (type.kind === 'array') {
92
+ const itemTypeMap = {
93
+ string: 'string',
94
+ integer: 'number',
95
+ decimal: 'number',
96
+ boolean: 'boolean',
97
+ };
98
+ return `${itemTypeMap[type.itemType]}[]`;
99
+ }
100
+ if (type.kind === 'reference') {
101
+ return type.entity;
102
+ }
103
+ if (type.kind === 'enum') {
104
+ return type.values.map((v) => `'${v}'`).join(' | ');
105
+ }
106
+ if (type.kind === 'computed') {
107
+ return 'any'; // Computed fields can be any type
108
+ }
109
+ return 'any';
110
+ });
111
+ // Get SQL type for field type
112
+ this.env.addFilter('sqlType', (type) => {
113
+ if (type.kind === 'primitive') {
114
+ const typeMap = {
115
+ string: 'VARCHAR(255)',
116
+ integer: 'INTEGER',
117
+ decimal: 'DECIMAL(10,2)',
118
+ boolean: 'BOOLEAN',
119
+ datetime: 'TIMESTAMP',
120
+ email: 'VARCHAR(255)',
121
+ url: 'VARCHAR(512)',
122
+ json: 'JSONB',
123
+ };
124
+ return typeMap[type.value] || 'TEXT';
125
+ }
126
+ if (type.kind === 'array') {
127
+ // PostgreSQL array syntax
128
+ const itemTypeMap = {
129
+ string: 'TEXT',
130
+ integer: 'INTEGER',
131
+ decimal: 'DECIMAL(10,2)',
132
+ boolean: 'BOOLEAN',
133
+ };
134
+ return `${itemTypeMap[type.itemType]}[]`;
135
+ }
136
+ if (type.kind === 'reference') {
137
+ return 'INTEGER'; // Foreign key
138
+ }
139
+ if (type.kind === 'enum') {
140
+ return `ENUM(${type.values.map((v) => `'${v}'`).join(',')})`;
141
+ }
142
+ if (type.kind === 'computed') {
143
+ return 'GENERATED'; // Virtual/computed column
144
+ }
145
+ return 'TEXT';
146
+ });
147
+ // Check if field has specific constraint
148
+ this.env.addFilter('hasConstraint', (field, constraintKind) => {
149
+ return field.constraints.some(c => c.kind === constraintKind);
150
+ });
151
+ // Get constraint object (for min, max, default)
152
+ this.env.addFilter('getConstraint', (field, constraintKind) => {
153
+ return field.constraints.find(c => c.kind === constraintKind) || null;
154
+ });
155
+ // Join array with custom separator
156
+ this.env.addFilter('joinWith', (arr, separator) => {
157
+ return arr.join(separator);
158
+ });
159
+ // First letter uppercase, rest lowercase
160
+ this.env.addFilter('capitalize', (str) => {
161
+ return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
162
+ });
163
+ // Indent lines
164
+ this.env.addFilter('indent', (str, spaces = 2) => {
165
+ const indent = ' '.repeat(spaces);
166
+ return str.split('\n').map(line => indent + line).join('\n');
167
+ });
168
+ }
169
+ }
170
+ /**
171
+ * Helper to build template context from EntitySpec
172
+ */
173
+ export function buildContext(entity, options = {}) {
174
+ return {
175
+ entity,
176
+ options,
177
+ // Helper data
178
+ hasRequiredFields: entity.fields.some(f => f.constraints.some(c => c.kind === 'required')),
179
+ hasUniqueFields: entity.fields.some(f => f.constraints.some(c => c.kind === 'unique')),
180
+ hasHashedFields: entity.fields.some(f => f.constraints.some(c => c.kind === 'hashed')),
181
+ hasReferences: entity.fields.some(f => f.type.kind === 'reference'),
182
+ };
183
+ }
@@ -0,0 +1,64 @@
1
+ import { EntitySpec } from './parser.js';
2
+ /**
3
+ * Options for API generation
4
+ */
5
+ export interface GenerateApiOptions {
6
+ auth?: boolean;
7
+ validation?: boolean;
8
+ tests?: boolean;
9
+ database?: 'postgresql' | 'mysql' | 'mongodb';
10
+ }
11
+ /**
12
+ * Options for frontend generation
13
+ */
14
+ export interface GenerateFrontendOptions {
15
+ ui?: 'shadcn' | 'mui' | 'chakra';
16
+ forms?: boolean;
17
+ tables?: boolean;
18
+ routing?: boolean;
19
+ }
20
+ /**
21
+ * Options for component generation
22
+ */
23
+ export interface GenerateComponentOptions {
24
+ ui?: 'shadcn' | 'mui' | 'chakra';
25
+ validation?: boolean;
26
+ }
27
+ /**
28
+ * Generated code result
29
+ */
30
+ export interface GenerationResult {
31
+ files: Record<string, string>;
32
+ metadata: GenerationMetadata;
33
+ }
34
+ /**
35
+ * Metadata about generated code
36
+ */
37
+ export interface GenerationMetadata {
38
+ generator: string;
39
+ framework: string;
40
+ entities: string[];
41
+ filesGenerated: number;
42
+ linesOfCode: number;
43
+ estimatedTokensSaved: number;
44
+ }
45
+ /**
46
+ * Generator metadata from registry
47
+ */
48
+ export interface GeneratorMetadata {
49
+ id: string;
50
+ name: string;
51
+ framework: string;
52
+ description: string;
53
+ features: string[];
54
+ databases?: string[];
55
+ version: string;
56
+ templates: string[];
57
+ }
58
+ /**
59
+ * Template context for rendering
60
+ */
61
+ export interface TemplateContext {
62
+ entity: EntitySpec;
63
+ options: any;
64
+ }
@@ -0,0 +1,4 @@
1
+ // =============================================================================
2
+ // CodeDNA TypeScript Types
3
+ // =============================================================================
4
+ export {};
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Handle codedna_generate_api tool call
3
+ */
4
+ export declare function handleGenerateApi(args: any): Promise<{
5
+ error: string;
6
+ details: string[] | undefined;
7
+ message?: undefined;
8
+ supported?: undefined;
9
+ success?: undefined;
10
+ files?: undefined;
11
+ metadata?: undefined;
12
+ tokenSavings?: undefined;
13
+ } | {
14
+ error: string;
15
+ message: string;
16
+ details?: undefined;
17
+ supported?: undefined;
18
+ success?: undefined;
19
+ files?: undefined;
20
+ metadata?: undefined;
21
+ tokenSavings?: undefined;
22
+ } | {
23
+ error: string;
24
+ supported: string[];
25
+ details?: undefined;
26
+ message?: undefined;
27
+ success?: undefined;
28
+ files?: undefined;
29
+ metadata?: undefined;
30
+ tokenSavings?: undefined;
31
+ } | {
32
+ success: boolean;
33
+ files: Record<string, string>;
34
+ metadata: import("../codedna/types.js").GenerationMetadata;
35
+ tokenSavings: {
36
+ traditional: number;
37
+ codedna: number;
38
+ saved: number;
39
+ percentSaved: string;
40
+ };
41
+ error?: undefined;
42
+ details?: undefined;
43
+ message?: undefined;
44
+ supported?: undefined;
45
+ }>;
46
+ /**
47
+ * Handle codedna_generate_frontend tool call
48
+ */
49
+ export declare function handleGenerateFrontend(args: any): Promise<{
50
+ error: string;
51
+ details: string[] | undefined;
52
+ message?: undefined;
53
+ frameworks?: undefined;
54
+ status?: undefined;
55
+ } | {
56
+ error: string;
57
+ message: string;
58
+ frameworks: string[];
59
+ status: string;
60
+ details?: undefined;
61
+ }>;
62
+ /**
63
+ * Handle codedna_generate_component tool call
64
+ */
65
+ export declare function handleGenerateComponent(args: any): Promise<{
66
+ error: string;
67
+ details: string[] | undefined;
68
+ message?: undefined;
69
+ types?: undefined;
70
+ frameworks?: undefined;
71
+ status?: undefined;
72
+ } | {
73
+ error: string;
74
+ message: string;
75
+ types: string[];
76
+ frameworks: string[];
77
+ status: string;
78
+ details?: undefined;
79
+ }>;
80
+ /**
81
+ * Handle codedna_list_generators tool call
82
+ */
83
+ export declare function handleListGenerators(): Promise<{
84
+ generators: import("../codedna/types.js").GeneratorMetadata[];
85
+ summary: {
86
+ total: number;
87
+ byFramework: any;
88
+ };
89
+ error?: undefined;
90
+ message?: undefined;
91
+ } | {
92
+ error: string;
93
+ message: string;
94
+ generators?: undefined;
95
+ summary?: undefined;
96
+ }>;
97
+ /**
98
+ * Handle codedna_validate_spec tool call
99
+ */
100
+ export declare function handleValidateSpec(args: any): Promise<{
101
+ valid: boolean;
102
+ entity: {
103
+ name: string;
104
+ fields: {
105
+ name: string;
106
+ type: import("../codedna/parser.js").FieldType;
107
+ constraints: ("default" | "length" | "email" | "min" | "max" | "url" | "required" | "pattern" | "nullable" | "unique" | "hashed" | "index" | "immutable")[];
108
+ }[];
109
+ };
110
+ summary: {
111
+ totalFields: number;
112
+ hasReferences: boolean;
113
+ hasEnums: boolean;
114
+ hasConstraints: boolean;
115
+ };
116
+ errors?: undefined;
117
+ } | {
118
+ valid: boolean;
119
+ errors: string[] | undefined;
120
+ entity?: undefined;
121
+ summary?: undefined;
122
+ }>;