@claudetools/tools 0.9.0 → 0.9.2

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 (85) hide show
  1. package/dist/cli.js +9 -1
  2. package/dist/codedna/__tests__/examples/mongoose-example.d.ts +6 -0
  3. package/dist/codedna/__tests__/examples/mongoose-example.js +163 -0
  4. package/dist/codedna/__tests__/fixtures/typeorm-production-test.d.ts +1 -0
  5. package/dist/codedna/__tests__/fixtures/typeorm-production-test.js +231 -0
  6. package/dist/codedna/__tests__/fixtures/typeorm-test.d.ts +1 -0
  7. package/dist/codedna/__tests__/fixtures/typeorm-test.js +124 -0
  8. package/dist/codedna/__tests__/laravel-output-review.d.ts +1 -0
  9. package/dist/codedna/__tests__/laravel-output-review.js +249 -0
  10. package/dist/codedna/__tests__/mongoose-output-test.d.ts +1 -0
  11. package/dist/codedna/__tests__/mongoose-output-test.js +178 -0
  12. package/dist/codedna/examples/radix-example.d.ts +2 -0
  13. package/dist/codedna/examples/radix-example.js +259 -0
  14. package/dist/codedna/index.d.ts +5 -3
  15. package/dist/codedna/index.js +6 -3
  16. package/dist/codedna/kappa-ast.d.ts +143 -5
  17. package/dist/codedna/kappa-drizzle-generator.js +8 -5
  18. package/dist/codedna/kappa-gofiber-generator.d.ts +65 -0
  19. package/dist/codedna/kappa-gofiber-generator.js +587 -0
  20. package/dist/codedna/kappa-laravel-generator.d.ts +68 -0
  21. package/dist/codedna/kappa-laravel-generator.js +741 -0
  22. package/dist/codedna/kappa-lexer.d.ts +44 -0
  23. package/dist/codedna/kappa-lexer.js +124 -0
  24. package/dist/codedna/kappa-mantine-generator.d.ts +65 -0
  25. package/dist/codedna/kappa-mantine-generator.js +518 -0
  26. package/dist/codedna/kappa-mongoose-generator.d.ts +44 -0
  27. package/dist/codedna/kappa-mongoose-generator.js +442 -0
  28. package/dist/codedna/kappa-parser.d.ts +43 -1
  29. package/dist/codedna/kappa-parser.js +601 -0
  30. package/dist/codedna/kappa-radix-generator.d.ts +61 -0
  31. package/dist/codedna/kappa-radix-generator.js +566 -0
  32. package/dist/codedna/kappa-typeorm-generator.d.ts +59 -0
  33. package/dist/codedna/kappa-typeorm-generator.js +723 -0
  34. package/dist/codedna/kappa-vitest-generator.d.ts +85 -0
  35. package/dist/codedna/kappa-vitest-generator.js +739 -0
  36. package/dist/codedna/parser.js +26 -1
  37. package/dist/codegen/cloud-client.d.ts +160 -0
  38. package/dist/codegen/cloud-client.js +195 -0
  39. package/dist/codegen/codegen-tool.d.ts +35 -0
  40. package/dist/codegen/codegen-tool.js +312 -0
  41. package/dist/codegen/field-inference.d.ts +24 -0
  42. package/dist/codegen/field-inference.js +101 -0
  43. package/dist/codegen/form-parser.d.ts +13 -0
  44. package/dist/codegen/form-parser.js +186 -0
  45. package/dist/codegen/index.d.ts +2 -0
  46. package/dist/codegen/index.js +4 -0
  47. package/dist/codegen/natural-parser.d.ts +50 -0
  48. package/dist/codegen/natural-parser.js +769 -0
  49. package/dist/handlers/codedna-handlers.d.ts +1 -1
  50. package/dist/handlers/codegen-handlers.d.ts +20 -0
  51. package/dist/handlers/codegen-handlers.js +60 -0
  52. package/dist/handlers/kappa-handlers.d.ts +97 -0
  53. package/dist/handlers/kappa-handlers.js +408 -0
  54. package/dist/handlers/tool-handlers.js +124 -221
  55. package/dist/helpers/api-client.js +48 -3
  56. package/dist/helpers/compact-formatter.d.ts +9 -2
  57. package/dist/helpers/compact-formatter.js +26 -2
  58. package/dist/helpers/config.d.ts +7 -2
  59. package/dist/helpers/config.js +25 -10
  60. package/dist/helpers/session-validation.d.ts +1 -1
  61. package/dist/helpers/session-validation.js +2 -4
  62. package/dist/helpers/tasks.d.ts +21 -0
  63. package/dist/helpers/tasks.js +52 -0
  64. package/dist/helpers/workers.d.ts +1 -1
  65. package/dist/helpers/workers.js +19 -19
  66. package/dist/setup.d.ts +1 -0
  67. package/dist/setup.js +228 -3
  68. package/dist/templates/claude-md.d.ts +1 -1
  69. package/dist/templates/claude-md.js +37 -152
  70. package/dist/templates/orchestrator-prompt.d.ts +2 -2
  71. package/dist/templates/orchestrator-prompt.js +31 -38
  72. package/dist/templates/self-critique.d.ts +50 -0
  73. package/dist/templates/self-critique.js +209 -0
  74. package/dist/templates/worker-prompt.d.ts +3 -3
  75. package/dist/templates/worker-prompt.js +18 -18
  76. package/dist/tools.js +77 -413
  77. package/docs/codedna/generator-testing-summary.md +205 -0
  78. package/docs/codedna/radix-ui-generator.md +478 -0
  79. package/docs/kappa-gofiber-generator.md +274 -0
  80. package/docs/kappa-laravel-fixes.md +172 -0
  81. package/docs/kappa-mongoose-generator.md +322 -0
  82. package/docs/kappa-vitest-generator.md +337 -0
  83. package/package.json +1 -1
  84. package/dist/context/deduplication.test.d.ts +0 -6
  85. package/dist/context/deduplication.test.js +0 -84
@@ -67,6 +67,7 @@ export declare const Page: import("chevrotain").TokenType;
67
67
  export declare const Component: import("chevrotain").TokenType;
68
68
  export declare const Form: import("chevrotain").TokenType;
69
69
  export declare const Design: import("chevrotain").TokenType;
70
+ export declare const Test: import("chevrotain").TokenType;
70
71
  export declare const Jwt: import("chevrotain").TokenType;
71
72
  export declare const Session: import("chevrotain").TokenType;
72
73
  export declare const Oauth: import("chevrotain").TokenType;
@@ -177,6 +178,41 @@ export declare const Easing: import("chevrotain").TokenType;
177
178
  export declare const Lighten: import("chevrotain").TokenType;
178
179
  export declare const Alpha: import("chevrotain").TokenType;
179
180
  export declare const Animation: import("chevrotain").TokenType;
181
+ export declare const Describe: import("chevrotain").TokenType;
182
+ export declare const It: import("chevrotain").TokenType;
183
+ export declare const Expect: import("chevrotain").TokenType;
184
+ export declare const Mock: import("chevrotain").TokenType;
185
+ export declare const BeforeAll: import("chevrotain").TokenType;
186
+ export declare const AfterAll: import("chevrotain").TokenType;
187
+ export declare const BeforeEach: import("chevrotain").TokenType;
188
+ export declare const AfterEach: import("chevrotain").TokenType;
189
+ export declare const Setup: import("chevrotain").TokenType;
190
+ export declare const Teardown: import("chevrotain").TokenType;
191
+ export declare const Skip: import("chevrotain").TokenType;
192
+ export declare const Only: import("chevrotain").TokenType;
193
+ export declare const Todo: import("chevrotain").TokenType;
194
+ export declare const Coverage: import("chevrotain").TokenType;
195
+ export declare const Target: import("chevrotain").TokenType;
196
+ export declare const Framework: import("chevrotain").TokenType;
197
+ export declare const Returns: import("chevrotain").TokenType;
198
+ export declare const Vitest: import("chevrotain").TokenType;
199
+ export declare const Jest: import("chevrotain").TokenType;
200
+ export declare const Playwright: import("chevrotain").TokenType;
201
+ export declare const Cypress: import("chevrotain").TokenType;
202
+ export declare const EqualsAssertion: import("chevrotain").TokenType;
203
+ export declare const NotEquals: import("chevrotain").TokenType;
204
+ export declare const Contains: import("chevrotain").TokenType;
205
+ export declare const Matches: import("chevrotain").TokenType;
206
+ export declare const Resolves: import("chevrotain").TokenType;
207
+ export declare const Rejects: import("chevrotain").TokenType;
208
+ export declare const Truthy: import("chevrotain").TokenType;
209
+ export declare const Falsy: import("chevrotain").TokenType;
210
+ export declare const Defined: import("chevrotain").TokenType;
211
+ export declare const Undefined: import("chevrotain").TokenType;
212
+ export declare const Null: import("chevrotain").TokenType;
213
+ export declare const InstanceOf: import("chevrotain").TokenType;
214
+ export declare const LengthOf: import("chevrotain").TokenType;
215
+ export declare const DeepEquals: import("chevrotain").TokenType;
180
216
  export declare const Version: import("chevrotain").TokenType;
181
217
  export declare const Stack: import("chevrotain").TokenType;
182
218
  export declare const Database: import("chevrotain").TokenType;
@@ -266,3 +302,11 @@ export declare const FieldModifierKeywords: import("chevrotain").TokenType[];
266
302
  * All effect keywords
267
303
  */
268
304
  export declare const EffectKeywords: import("chevrotain").TokenType[];
305
+ /**
306
+ * All test-related keywords
307
+ */
308
+ export declare const TestKeywords: import("chevrotain").TokenType[];
309
+ /**
310
+ * All assertion type keywords
311
+ */
312
+ export declare const AssertionKeywords: import("chevrotain").TokenType[];
@@ -167,6 +167,7 @@ export const Page = createToken({ name: 'Page', pattern: /page\b/ });
167
167
  export const Component = createToken({ name: 'Component', pattern: /component\b/ });
168
168
  export const Form = createToken({ name: 'Form', pattern: /form\b/ });
169
169
  export const Design = createToken({ name: 'Design', pattern: /design\b/ });
170
+ export const Test = createToken({ name: 'Test', pattern: /test\b/ });
170
171
  // =============================================================================
171
172
  // Auth Keywords
172
173
  // =============================================================================
@@ -312,6 +313,45 @@ export const Lighten = createToken({ name: 'Lighten', pattern: /lighten\b/ });
312
313
  export const Alpha = createToken({ name: 'Alpha', pattern: /alpha\b/ });
313
314
  export const Animation = createToken({ name: 'Animation', pattern: /animation\b/ });
314
315
  // =============================================================================
316
+ // Test Keywords
317
+ // =============================================================================
318
+ export const Describe = createToken({ name: 'Describe', pattern: /describe\b/ });
319
+ export const It = createToken({ name: 'It', pattern: /it\b/ });
320
+ export const Expect = createToken({ name: 'Expect', pattern: /expect\b/ });
321
+ export const Mock = createToken({ name: 'Mock', pattern: /mock\b/ });
322
+ export const BeforeAll = createToken({ name: 'BeforeAll', pattern: /beforeAll\b/ });
323
+ export const AfterAll = createToken({ name: 'AfterAll', pattern: /afterAll\b/ });
324
+ export const BeforeEach = createToken({ name: 'BeforeEach', pattern: /beforeEach\b/ });
325
+ export const AfterEach = createToken({ name: 'AfterEach', pattern: /afterEach\b/ });
326
+ export const Setup = createToken({ name: 'Setup', pattern: /setup\b/ });
327
+ export const Teardown = createToken({ name: 'Teardown', pattern: /teardown\b/ });
328
+ export const Skip = createToken({ name: 'Skip', pattern: /skip\b/ });
329
+ export const Only = createToken({ name: 'Only', pattern: /only\b/ });
330
+ export const Todo = createToken({ name: 'Todo', pattern: /todo\b/ });
331
+ export const Coverage = createToken({ name: 'Coverage', pattern: /coverage\b/ });
332
+ export const Target = createToken({ name: 'Target', pattern: /target\b/ });
333
+ export const Framework = createToken({ name: 'Framework', pattern: /framework\b/ });
334
+ export const Returns = createToken({ name: 'Returns', pattern: /returns\b/ });
335
+ export const Vitest = createToken({ name: 'Vitest', pattern: /vitest\b/ });
336
+ export const Jest = createToken({ name: 'Jest', pattern: /jest\b/ });
337
+ export const Playwright = createToken({ name: 'Playwright', pattern: /playwright\b/ });
338
+ export const Cypress = createToken({ name: 'Cypress', pattern: /cypress\b/ });
339
+ // Assertion types
340
+ export const EqualsAssertion = createToken({ name: 'EqualsAssertion', pattern: /equals\b/ });
341
+ export const NotEquals = createToken({ name: 'NotEquals', pattern: /notEquals\b/ });
342
+ export const Contains = createToken({ name: 'Contains', pattern: /contains\b/ });
343
+ export const Matches = createToken({ name: 'Matches', pattern: /matches\b/ });
344
+ export const Resolves = createToken({ name: 'Resolves', pattern: /resolves\b/ });
345
+ export const Rejects = createToken({ name: 'Rejects', pattern: /rejects\b/ });
346
+ export const Truthy = createToken({ name: 'Truthy', pattern: /truthy\b/ });
347
+ export const Falsy = createToken({ name: 'Falsy', pattern: /falsy\b/ });
348
+ export const Defined = createToken({ name: 'Defined', pattern: /defined\b/ });
349
+ export const Undefined = createToken({ name: 'Undefined', pattern: /undefined\b/ });
350
+ export const Null = createToken({ name: 'Null', pattern: /null\b/ });
351
+ export const InstanceOf = createToken({ name: 'InstanceOf', pattern: /instanceOf\b/ });
352
+ export const LengthOf = createToken({ name: 'LengthOf', pattern: /lengthOf\b/ });
353
+ export const DeepEquals = createToken({ name: 'DeepEquals', pattern: /deepEquals\b/ });
354
+ // =============================================================================
315
355
  // Project Keywords
316
356
  // =============================================================================
317
357
  export const Version = createToken({ name: 'Version', pattern: /version\b/ });
@@ -488,6 +528,7 @@ export const allTokens = [
488
528
  Component,
489
529
  Form,
490
530
  Design,
531
+ Test,
491
532
  // Auth keywords
492
533
  Jwt,
493
534
  Session,
@@ -612,6 +653,42 @@ export const allTokens = [
612
653
  Lighten,
613
654
  Alpha,
614
655
  Animation,
656
+ // Test keywords (longer first)
657
+ BeforeAll,
658
+ AfterAll,
659
+ BeforeEach,
660
+ AfterEach,
661
+ DeepEquals,
662
+ NotEquals,
663
+ InstanceOf,
664
+ LengthOf,
665
+ Playwright,
666
+ Undefined,
667
+ Teardown,
668
+ Coverage,
669
+ Framework,
670
+ Describe,
671
+ Resolves,
672
+ Rejects,
673
+ Contains,
674
+ Matches,
675
+ Returns,
676
+ Cypress,
677
+ Vitest,
678
+ Target,
679
+ Expect,
680
+ Truthy,
681
+ Falsy,
682
+ Defined,
683
+ Setup,
684
+ Jest,
685
+ Mock,
686
+ Skip,
687
+ Only,
688
+ Todo,
689
+ Null,
690
+ It,
691
+ EqualsAssertion,
615
692
  // Project keywords
616
693
  Version,
617
694
  Stack,
@@ -710,6 +787,7 @@ export const BlockKeywords = [
710
787
  Component,
711
788
  Form,
712
789
  Design,
790
+ Test,
713
791
  ];
714
792
  /**
715
793
  * All type keywords
@@ -755,3 +833,49 @@ export const EffectKeywords = [
755
833
  CacheEffect,
756
834
  External,
757
835
  ];
836
+ /**
837
+ * All test-related keywords
838
+ */
839
+ export const TestKeywords = [
840
+ Test,
841
+ Describe,
842
+ It,
843
+ Expect,
844
+ Mock,
845
+ BeforeAll,
846
+ AfterAll,
847
+ BeforeEach,
848
+ AfterEach,
849
+ Setup,
850
+ Teardown,
851
+ Skip,
852
+ Only,
853
+ Todo,
854
+ Coverage,
855
+ Target,
856
+ Framework,
857
+ Returns,
858
+ Vitest,
859
+ Jest,
860
+ Playwright,
861
+ Cypress,
862
+ ];
863
+ /**
864
+ * All assertion type keywords
865
+ */
866
+ export const AssertionKeywords = [
867
+ EqualsAssertion,
868
+ NotEquals,
869
+ Contains,
870
+ Matches,
871
+ Resolves,
872
+ Rejects,
873
+ Truthy,
874
+ Falsy,
875
+ Defined,
876
+ Undefined,
877
+ Null,
878
+ InstanceOf,
879
+ LengthOf,
880
+ DeepEquals,
881
+ ];
@@ -0,0 +1,65 @@
1
+ import type { ComponentBlock, FormBlock } from './kappa-ast.js';
2
+ export interface MantineGeneratorOptions {
3
+ /** Add provenance comments (default: true) */
4
+ provenance?: boolean;
5
+ /** Generate TypeScript (default: true) */
6
+ typescript?: boolean;
7
+ /** Use Zod for validation (default: true) */
8
+ zod?: boolean;
9
+ /** Use forwardRef for components (default: false) */
10
+ forwardRef?: boolean;
11
+ /** Base path for components (default: 'components') */
12
+ basePath?: string;
13
+ }
14
+ export interface GeneratedMantineFile {
15
+ /** File path */
16
+ path: string;
17
+ /** File content */
18
+ content: string;
19
+ }
20
+ export interface GeneratedMantineOutput {
21
+ /** Generated component/form files */
22
+ files: GeneratedMantineFile[];
23
+ }
24
+ export declare class KappaMantineGenerator {
25
+ private provenance;
26
+ private typescript;
27
+ private zod;
28
+ private forwardRef;
29
+ private basePath;
30
+ constructor(options?: MantineGeneratorOptions);
31
+ /**
32
+ * Generate components from ComponentBlock AST nodes
33
+ */
34
+ generateComponents(components: ComponentBlock[]): GeneratedMantineOutput;
35
+ /**
36
+ * Generate forms from FormBlock AST nodes
37
+ */
38
+ generateForms(forms: FormBlock[]): GeneratedMantineOutput;
39
+ private generateComponent;
40
+ private generateComponentPropsInterface;
41
+ private generateFunctionComponent;
42
+ private generateForwardRefComponent;
43
+ private generateCompoundComponent;
44
+ private generateCompoundPart;
45
+ private generateStructureJSX;
46
+ private getDestructuredProps;
47
+ private generateForm;
48
+ private generateZodSchema;
49
+ private fieldTypeToZod;
50
+ private getInitialValues;
51
+ private generateLayoutRow;
52
+ private generateMantineField;
53
+ private mapPropType;
54
+ private mapToMantineComponent;
55
+ private toCamelCase;
56
+ private toKebabCase;
57
+ }
58
+ /**
59
+ * Generate Mantine components from Kappa ComponentBlock nodes
60
+ */
61
+ export declare function generateMantineComponents(components: ComponentBlock[], options?: MantineGeneratorOptions): GeneratedMantineOutput;
62
+ /**
63
+ * Generate Mantine forms from Kappa FormBlock nodes
64
+ */
65
+ export declare function generateMantineForms(forms: FormBlock[], options?: MantineGeneratorOptions): GeneratedMantineOutput;