@claudetools/tools 0.3.8 → 0.4.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.
- package/dist/codedna/generators/base.d.ts +41 -0
- package/dist/codedna/generators/base.js +102 -0
- package/dist/codedna/generators/express-api.d.ts +12 -0
- package/dist/codedna/generators/express-api.js +61 -0
- package/dist/codedna/index.d.ts +4 -0
- package/dist/codedna/index.js +7 -0
- package/dist/codedna/parser.d.ts +80 -0
- package/dist/codedna/parser.js +176 -0
- package/dist/codedna/registry.d.ts +60 -0
- package/dist/codedna/registry.js +214 -0
- package/dist/codedna/template-engine.d.ts +17 -0
- package/dist/codedna/template-engine.js +149 -0
- package/dist/codedna/types.d.ts +64 -0
- package/dist/codedna/types.js +4 -0
- package/dist/handlers/codedna-handlers.d.ts +122 -0
- package/dist/handlers/codedna-handlers.js +167 -0
- package/dist/handlers/tool-handlers.js +593 -14
- package/dist/helpers/api-client.d.ts +37 -0
- package/dist/helpers/api-client.js +63 -0
- package/dist/helpers/config-manager.js +1 -1
- package/dist/helpers/library-detection.d.ts +26 -0
- package/dist/helpers/library-detection.js +145 -0
- package/dist/helpers/tasks-retry.d.ts +49 -0
- package/dist/helpers/tasks-retry.js +168 -0
- package/dist/helpers/tasks.d.ts +24 -1
- package/dist/helpers/tasks.js +146 -50
- package/dist/helpers/workers.d.ts +25 -0
- package/dist/helpers/workers.js +80 -0
- package/dist/setup.js +19 -3
- package/dist/templates/claude-md.d.ts +1 -1
- package/dist/templates/claude-md.js +16 -5
- package/dist/tools.js +314 -0
- package/package.json +3 -1
package/dist/tools.js
CHANGED
|
@@ -668,6 +668,128 @@ export function registerToolDefinitions(server) {
|
|
|
668
668
|
properties: {},
|
|
669
669
|
},
|
|
670
670
|
},
|
|
671
|
+
{
|
|
672
|
+
name: 'task_epic_status',
|
|
673
|
+
description: 'Get epic progress status with task counts by status. Auto-completes epic when all child tasks are done. Use this to track epic progress and see completion percentage.',
|
|
674
|
+
inputSchema: {
|
|
675
|
+
type: 'object',
|
|
676
|
+
properties: {
|
|
677
|
+
epic_id: {
|
|
678
|
+
type: 'string',
|
|
679
|
+
description: 'The epic ID to get status for',
|
|
680
|
+
},
|
|
681
|
+
},
|
|
682
|
+
required: ['epic_id'],
|
|
683
|
+
},
|
|
684
|
+
},
|
|
685
|
+
{
|
|
686
|
+
name: 'task_detect_timeouts',
|
|
687
|
+
description: 'Detect tasks that have timed out (lock expired while in_progress). These are likely abandoned or failed tasks that need attention.',
|
|
688
|
+
inputSchema: {
|
|
689
|
+
type: 'object',
|
|
690
|
+
properties: {
|
|
691
|
+
project_id: {
|
|
692
|
+
type: 'string',
|
|
693
|
+
description: 'Project ID (optional, uses default if not provided)',
|
|
694
|
+
},
|
|
695
|
+
},
|
|
696
|
+
},
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
name: 'task_retry',
|
|
700
|
+
description: 'Retry a failed or timed-out task. Resets task to ready status if under retry limit, or marks as failed permanently if limit exceeded.',
|
|
701
|
+
inputSchema: {
|
|
702
|
+
type: 'object',
|
|
703
|
+
properties: {
|
|
704
|
+
task_id: {
|
|
705
|
+
type: 'string',
|
|
706
|
+
description: 'The task ID to retry',
|
|
707
|
+
},
|
|
708
|
+
max_retries: {
|
|
709
|
+
type: 'number',
|
|
710
|
+
description: 'Maximum number of retries allowed (default: 3)',
|
|
711
|
+
},
|
|
712
|
+
error_context: {
|
|
713
|
+
type: 'string',
|
|
714
|
+
description: 'Description of the error or failure reason',
|
|
715
|
+
},
|
|
716
|
+
project_id: {
|
|
717
|
+
type: 'string',
|
|
718
|
+
description: 'Project ID (optional, uses default if not provided)',
|
|
719
|
+
},
|
|
720
|
+
},
|
|
721
|
+
required: ['task_id'],
|
|
722
|
+
},
|
|
723
|
+
},
|
|
724
|
+
{
|
|
725
|
+
name: 'task_fail',
|
|
726
|
+
description: 'Explicitly mark a task as failed with error context. Use when a task cannot be completed.',
|
|
727
|
+
inputSchema: {
|
|
728
|
+
type: 'object',
|
|
729
|
+
properties: {
|
|
730
|
+
task_id: {
|
|
731
|
+
type: 'string',
|
|
732
|
+
description: 'The task ID to mark as failed',
|
|
733
|
+
},
|
|
734
|
+
error_context: {
|
|
735
|
+
type: 'string',
|
|
736
|
+
description: 'Description of why the task failed',
|
|
737
|
+
},
|
|
738
|
+
agent_id: {
|
|
739
|
+
type: 'string',
|
|
740
|
+
description: 'Agent ID (optional, defaults to "claude-code")',
|
|
741
|
+
},
|
|
742
|
+
project_id: {
|
|
743
|
+
type: 'string',
|
|
744
|
+
description: 'Project ID (optional, uses default if not provided)',
|
|
745
|
+
},
|
|
746
|
+
},
|
|
747
|
+
required: ['task_id', 'error_context'],
|
|
748
|
+
},
|
|
749
|
+
},
|
|
750
|
+
{
|
|
751
|
+
name: 'task_auto_retry_timeouts',
|
|
752
|
+
description: 'Automatically detect and retry all timed-out tasks. Tasks under retry limit are reset to ready, those exceeding limit are marked as failed.',
|
|
753
|
+
inputSchema: {
|
|
754
|
+
type: 'object',
|
|
755
|
+
properties: {
|
|
756
|
+
max_retries: {
|
|
757
|
+
type: 'number',
|
|
758
|
+
description: 'Maximum number of retries per task (default: 3)',
|
|
759
|
+
},
|
|
760
|
+
project_id: {
|
|
761
|
+
type: 'string',
|
|
762
|
+
description: 'Project ID (optional, uses default if not provided)',
|
|
763
|
+
},
|
|
764
|
+
},
|
|
765
|
+
},
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
name: 'task_orchestrate',
|
|
769
|
+
description: 'Orchestrate autonomous multi-agent execution for an epic. Dispatches parallel workers, monitors progress, handles failures, and continues until completion.',
|
|
770
|
+
inputSchema: {
|
|
771
|
+
type: 'object',
|
|
772
|
+
properties: {
|
|
773
|
+
epic_id: {
|
|
774
|
+
type: 'string',
|
|
775
|
+
description: 'Epic ID to orchestrate',
|
|
776
|
+
},
|
|
777
|
+
max_parallel: {
|
|
778
|
+
type: 'number',
|
|
779
|
+
description: 'Max parallel tasks (default: 5)',
|
|
780
|
+
},
|
|
781
|
+
max_retries: {
|
|
782
|
+
type: 'number',
|
|
783
|
+
description: 'Max retries per task (default: 3)',
|
|
784
|
+
},
|
|
785
|
+
dry_run: {
|
|
786
|
+
type: 'boolean',
|
|
787
|
+
description: 'Preview without executing (default: false)',
|
|
788
|
+
},
|
|
789
|
+
},
|
|
790
|
+
required: ['epic_id'],
|
|
791
|
+
},
|
|
792
|
+
},
|
|
671
793
|
// =========================================================================
|
|
672
794
|
// CODEBASE MAPPING TOOLS
|
|
673
795
|
// =========================================================================
|
|
@@ -743,6 +865,198 @@ export function registerToolDefinitions(server) {
|
|
|
743
865
|
required: ['function_name'],
|
|
744
866
|
},
|
|
745
867
|
},
|
|
868
|
+
// =========================================================================
|
|
869
|
+
// DOCUMENTATION CACHING TOOLS
|
|
870
|
+
// =========================================================================
|
|
871
|
+
{
|
|
872
|
+
name: 'docs_cache',
|
|
873
|
+
description: 'Ensure documentation for a library is cached. Automatically fetches from Context7 if not already cached. Use simple library names like "react", "next.js", "zod", "tanstack-query".',
|
|
874
|
+
inputSchema: {
|
|
875
|
+
type: 'object',
|
|
876
|
+
properties: {
|
|
877
|
+
library: {
|
|
878
|
+
type: 'string',
|
|
879
|
+
description: 'Library name to cache docs for (e.g., "react", "next.js", "zod", "tanstack-query", "supabase")',
|
|
880
|
+
},
|
|
881
|
+
topic: {
|
|
882
|
+
type: 'string',
|
|
883
|
+
description: 'Optional topic to focus on (e.g., "routing", "authentication")',
|
|
884
|
+
},
|
|
885
|
+
},
|
|
886
|
+
required: ['library'],
|
|
887
|
+
},
|
|
888
|
+
},
|
|
889
|
+
{
|
|
890
|
+
name: 'docs_list',
|
|
891
|
+
description: 'List all cached documentation libraries (global cache shared across projects).',
|
|
892
|
+
inputSchema: {
|
|
893
|
+
type: 'object',
|
|
894
|
+
properties: {},
|
|
895
|
+
},
|
|
896
|
+
},
|
|
897
|
+
{
|
|
898
|
+
name: 'docs_get',
|
|
899
|
+
description: 'Get cached documentation for a specific library. Returns the full cached content.',
|
|
900
|
+
inputSchema: {
|
|
901
|
+
type: 'object',
|
|
902
|
+
properties: {
|
|
903
|
+
library: {
|
|
904
|
+
type: 'string',
|
|
905
|
+
description: 'Library name to get docs for (e.g., "react", "next.js")',
|
|
906
|
+
},
|
|
907
|
+
topic: {
|
|
908
|
+
type: 'string',
|
|
909
|
+
description: 'Optional topic to filter docs by',
|
|
910
|
+
},
|
|
911
|
+
},
|
|
912
|
+
required: ['library'],
|
|
913
|
+
},
|
|
914
|
+
},
|
|
915
|
+
// =========================================================================
|
|
916
|
+
// CODEDNA CODE GENERATION TOOLS
|
|
917
|
+
// =========================================================================
|
|
918
|
+
{
|
|
919
|
+
name: 'codedna_generate_api',
|
|
920
|
+
description: 'Generate a complete REST API with CRUD operations from an Entity DSL specification. Saves 95-99% tokens vs writing code manually. Example: codedna_generate_api("User(email:string:unique, password:string:hashed)", "express", { auth: true })',
|
|
921
|
+
inputSchema: {
|
|
922
|
+
type: 'object',
|
|
923
|
+
properties: {
|
|
924
|
+
spec: {
|
|
925
|
+
type: 'string',
|
|
926
|
+
description: 'Entity DSL specification (e.g., "User(email:string:unique:required, password:string:hashed, age:integer:min(18))")',
|
|
927
|
+
},
|
|
928
|
+
framework: {
|
|
929
|
+
type: 'string',
|
|
930
|
+
enum: ['express', 'fastapi', 'nestjs'],
|
|
931
|
+
description: 'API framework to use',
|
|
932
|
+
},
|
|
933
|
+
options: {
|
|
934
|
+
type: 'object',
|
|
935
|
+
properties: {
|
|
936
|
+
auth: {
|
|
937
|
+
type: 'boolean',
|
|
938
|
+
description: 'Include JWT authentication middleware',
|
|
939
|
+
},
|
|
940
|
+
validation: {
|
|
941
|
+
type: 'boolean',
|
|
942
|
+
description: 'Add input validation',
|
|
943
|
+
},
|
|
944
|
+
tests: {
|
|
945
|
+
type: 'boolean',
|
|
946
|
+
description: 'Generate test files',
|
|
947
|
+
},
|
|
948
|
+
database: {
|
|
949
|
+
type: 'string',
|
|
950
|
+
enum: ['postgresql', 'mysql', 'mongodb'],
|
|
951
|
+
description: 'Target database',
|
|
952
|
+
},
|
|
953
|
+
},
|
|
954
|
+
},
|
|
955
|
+
},
|
|
956
|
+
required: ['spec', 'framework'],
|
|
957
|
+
},
|
|
958
|
+
},
|
|
959
|
+
{
|
|
960
|
+
name: 'codedna_generate_frontend',
|
|
961
|
+
description: 'Generate frontend application with forms and tables from Entity DSL. Saves 95-99% tokens vs writing components manually.',
|
|
962
|
+
inputSchema: {
|
|
963
|
+
type: 'object',
|
|
964
|
+
properties: {
|
|
965
|
+
spec: {
|
|
966
|
+
type: 'string',
|
|
967
|
+
description: 'Entity DSL specification',
|
|
968
|
+
},
|
|
969
|
+
framework: {
|
|
970
|
+
type: 'string',
|
|
971
|
+
enum: ['nextjs', 'react', 'vue'],
|
|
972
|
+
description: 'Frontend framework to use',
|
|
973
|
+
},
|
|
974
|
+
options: {
|
|
975
|
+
type: 'object',
|
|
976
|
+
properties: {
|
|
977
|
+
ui: {
|
|
978
|
+
type: 'string',
|
|
979
|
+
enum: ['shadcn', 'mui', 'chakra'],
|
|
980
|
+
description: 'UI component library',
|
|
981
|
+
},
|
|
982
|
+
forms: {
|
|
983
|
+
type: 'boolean',
|
|
984
|
+
description: 'Generate forms',
|
|
985
|
+
},
|
|
986
|
+
tables: {
|
|
987
|
+
type: 'boolean',
|
|
988
|
+
description: 'Generate data tables',
|
|
989
|
+
},
|
|
990
|
+
routing: {
|
|
991
|
+
type: 'boolean',
|
|
992
|
+
description: 'Setup routing',
|
|
993
|
+
},
|
|
994
|
+
},
|
|
995
|
+
},
|
|
996
|
+
},
|
|
997
|
+
required: ['spec', 'framework'],
|
|
998
|
+
},
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
name: 'codedna_generate_component',
|
|
1002
|
+
description: 'Generate single UI component (form, table, card, modal) from Entity DSL.',
|
|
1003
|
+
inputSchema: {
|
|
1004
|
+
type: 'object',
|
|
1005
|
+
properties: {
|
|
1006
|
+
spec: {
|
|
1007
|
+
type: 'string',
|
|
1008
|
+
description: 'Entity DSL specification or component spec',
|
|
1009
|
+
},
|
|
1010
|
+
type: {
|
|
1011
|
+
type: 'string',
|
|
1012
|
+
enum: ['form', 'table', 'card', 'modal'],
|
|
1013
|
+
description: 'Component type to generate',
|
|
1014
|
+
},
|
|
1015
|
+
framework: {
|
|
1016
|
+
type: 'string',
|
|
1017
|
+
enum: ['react', 'vue', 'svelte'],
|
|
1018
|
+
description: 'Frontend framework',
|
|
1019
|
+
},
|
|
1020
|
+
options: {
|
|
1021
|
+
type: 'object',
|
|
1022
|
+
properties: {
|
|
1023
|
+
ui: {
|
|
1024
|
+
type: 'string',
|
|
1025
|
+
enum: ['shadcn', 'mui', 'chakra'],
|
|
1026
|
+
description: 'UI library',
|
|
1027
|
+
},
|
|
1028
|
+
validation: {
|
|
1029
|
+
type: 'boolean',
|
|
1030
|
+
description: 'Include validation',
|
|
1031
|
+
},
|
|
1032
|
+
},
|
|
1033
|
+
},
|
|
1034
|
+
},
|
|
1035
|
+
required: ['spec', 'type', 'framework'],
|
|
1036
|
+
},
|
|
1037
|
+
},
|
|
1038
|
+
{
|
|
1039
|
+
name: 'codedna_list_generators',
|
|
1040
|
+
description: 'List all available code generators and their capabilities.',
|
|
1041
|
+
inputSchema: {
|
|
1042
|
+
type: 'object',
|
|
1043
|
+
properties: {},
|
|
1044
|
+
},
|
|
1045
|
+
},
|
|
1046
|
+
{
|
|
1047
|
+
name: 'codedna_validate_spec',
|
|
1048
|
+
description: 'Validate Entity DSL syntax without generating code. Returns parsed structure or errors.',
|
|
1049
|
+
inputSchema: {
|
|
1050
|
+
type: 'object',
|
|
1051
|
+
properties: {
|
|
1052
|
+
spec: {
|
|
1053
|
+
type: 'string',
|
|
1054
|
+
description: 'Entity DSL specification to validate',
|
|
1055
|
+
},
|
|
1056
|
+
},
|
|
1057
|
+
required: ['spec'],
|
|
1058
|
+
},
|
|
1059
|
+
},
|
|
746
1060
|
],
|
|
747
1061
|
}));
|
|
748
1062
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claudetools/tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Persistent AI memory, task management, and codebase intelligence for Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -48,11 +48,13 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
50
50
|
"chalk": "^5.6.2",
|
|
51
|
+
"nunjucks": "^3.2.4",
|
|
51
52
|
"ora": "^9.0.0",
|
|
52
53
|
"prompts": "^2.4.2"
|
|
53
54
|
},
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"@types/node": "^20.10.0",
|
|
57
|
+
"@types/nunjucks": "^3.2.6",
|
|
56
58
|
"@types/prompts": "^2.4.9",
|
|
57
59
|
"@vitest/ui": "^4.0.15",
|
|
58
60
|
"tsx": "^4.7.0",
|