@4da/mcp-server 3.2.0 → 4.0.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/LICENSE +21 -0
- package/README.md +160 -63
- package/dist/db.d.ts +27 -2
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +104 -1
- package/dist/db.js.map +1 -1
- package/dist/doctor.d.ts +15 -0
- package/dist/doctor.d.ts.map +1 -0
- package/dist/doctor.js +98 -0
- package/dist/doctor.js.map +1 -0
- package/dist/http-transport.d.ts +25 -0
- package/dist/http-transport.d.ts.map +1 -0
- package/dist/http-transport.js +126 -0
- package/dist/http-transport.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +130 -10
- package/dist/index.js.map +1 -1
- package/dist/llm.d.ts +20 -2
- package/dist/llm.d.ts.map +1 -1
- package/dist/llm.js +77 -20
- package/dist/llm.js.map +1 -1
- package/dist/schema-registry.d.ts.map +1 -1
- package/dist/schema-registry.js +44 -0
- package/dist/schema-registry.js.map +1 -1
- package/dist/schemas/agent-memory.json +49 -0
- package/dist/schemas/agent-session-brief.json +25 -0
- package/dist/schemas/attention-report.json +13 -0
- package/dist/schemas/autophagy-status.json +13 -0
- package/dist/schemas/compound-advantage.json +14 -0
- package/dist/schemas/decision-enforcement.json +22 -0
- package/dist/schemas/decision-memory.json +54 -0
- package/dist/schemas/decision-windows.json +22 -0
- package/dist/schemas/delegation-score.json +18 -0
- package/dist/schemas/developer-dna.json +219 -0
- package/dist/schemas/export-context.json +17 -0
- package/dist/schemas/knowledge-gaps.json +14 -0
- package/dist/schemas/project-health.json +13 -0
- package/dist/schemas/reverse-mentions.json +13 -0
- package/dist/schemas/semantic-shifts.json +17 -0
- package/dist/schemas/signal-chains.json +19 -0
- package/dist/schemas/tech-radar.json +23 -0
- package/dist/setup.d.ts +17 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/setup.js +137 -0
- package/dist/setup.js.map +1 -0
- package/dist/tools/agent-memory.d.ts +94 -0
- package/dist/tools/agent-memory.d.ts.map +1 -0
- package/dist/tools/agent-memory.js +229 -0
- package/dist/tools/agent-memory.js.map +1 -0
- package/dist/tools/agent-session-brief.d.ts +44 -0
- package/dist/tools/agent-session-brief.d.ts.map +1 -0
- package/dist/tools/agent-session-brief.js +178 -0
- package/dist/tools/agent-session-brief.js.map +1 -0
- package/dist/tools/attention-report.d.ts +6 -5
- package/dist/tools/attention-report.d.ts.map +1 -1
- package/dist/tools/attention-report.js.map +1 -1
- package/dist/tools/autophagy-status.d.ts +25 -0
- package/dist/tools/autophagy-status.d.ts.map +1 -0
- package/dist/tools/autophagy-status.js +56 -0
- package/dist/tools/autophagy-status.js.map +1 -0
- package/dist/tools/compound-advantage.d.ts +27 -0
- package/dist/tools/compound-advantage.d.ts.map +1 -0
- package/dist/tools/compound-advantage.js +76 -0
- package/dist/tools/compound-advantage.js.map +1 -0
- package/dist/tools/decision-enforcement.d.ts +59 -0
- package/dist/tools/decision-enforcement.d.ts.map +1 -0
- package/dist/tools/decision-enforcement.js +184 -0
- package/dist/tools/decision-enforcement.js.map +1 -0
- package/dist/tools/decision-memory.d.ts +130 -0
- package/dist/tools/decision-memory.d.ts.map +1 -0
- package/dist/tools/decision-memory.js +265 -0
- package/dist/tools/decision-memory.js.map +1 -0
- package/dist/tools/decision-windows.d.ts +37 -0
- package/dist/tools/decision-windows.d.ts.map +1 -0
- package/dist/tools/decision-windows.js +67 -0
- package/dist/tools/decision-windows.js.map +1 -0
- package/dist/tools/delegation-score.d.ts +34 -0
- package/dist/tools/delegation-score.d.ts.map +1 -0
- package/dist/tools/delegation-score.js +250 -0
- package/dist/tools/delegation-score.js.map +1 -0
- package/dist/tools/developer-dna.d.ts +79 -0
- package/dist/tools/developer-dna.d.ts.map +1 -0
- package/dist/tools/developer-dna.js +377 -0
- package/dist/tools/developer-dna.js.map +1 -0
- package/dist/tools/export-context.d.ts +14 -6
- package/dist/tools/export-context.d.ts.map +1 -1
- package/dist/tools/export-context.js +13 -13
- package/dist/tools/export-context.js.map +1 -1
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +14 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/knowledge-gaps.d.ts +11 -1
- package/dist/tools/knowledge-gaps.d.ts.map +1 -1
- package/dist/tools/knowledge-gaps.js.map +1 -1
- package/dist/tools/project-health.d.ts +6 -6
- package/dist/tools/project-health.d.ts.map +1 -1
- package/dist/tools/project-health.js +1 -1
- package/dist/tools/project-health.js.map +1 -1
- package/dist/tools/reverse-mentions.d.ts +8 -8
- package/dist/tools/reverse-mentions.d.ts.map +1 -1
- package/dist/tools/reverse-mentions.js.map +1 -1
- package/dist/tools/semantic-shifts.d.ts +17 -1
- package/dist/tools/semantic-shifts.d.ts.map +1 -1
- package/dist/tools/semantic-shifts.js.map +1 -1
- package/dist/tools/signal-chains.d.ts +14 -7
- package/dist/tools/signal-chains.d.ts.map +1 -1
- package/dist/tools/signal-chains.js.map +1 -1
- package/dist/tools/tech-radar.d.ts +38 -0
- package/dist/tools/tech-radar.d.ts.map +1 -0
- package/dist/tools/tech-radar.js +248 -0
- package/dist/tools/tech-radar.js.map +1 -0
- package/dist/types.d.ts +109 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +26 -14
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "developer_dna",
|
|
3
|
+
"description": "Export your Developer DNA — a comprehensive profile of your tech identity built from project scans, engagement data, and learned preferences. Includes primary stack, adjacent tech, top dependencies, engaged topics, blind spots, source engagement rates, and aggregate stats.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"include_blind_spots": {
|
|
8
|
+
"type": "boolean",
|
|
9
|
+
"description": "Include blind spot analysis (dependencies with stale engagement). Default: true",
|
|
10
|
+
"default": true
|
|
11
|
+
},
|
|
12
|
+
"max_dependencies": {
|
|
13
|
+
"type": "number",
|
|
14
|
+
"description": "Maximum dependencies to include. Default: 30",
|
|
15
|
+
"default": 30
|
|
16
|
+
},
|
|
17
|
+
"max_topics": {
|
|
18
|
+
"type": "number",
|
|
19
|
+
"description": "Maximum engaged topics to include. Default: 20",
|
|
20
|
+
"default": 20
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
"outputSchema": {
|
|
25
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
26
|
+
"title": "DeveloperDna",
|
|
27
|
+
"description": "Comprehensive developer identity profile built from local project data and engagement signals.",
|
|
28
|
+
"type": "object",
|
|
29
|
+
"required": [
|
|
30
|
+
"generated_at",
|
|
31
|
+
"primary_stack",
|
|
32
|
+
"adjacent_tech",
|
|
33
|
+
"top_dependencies",
|
|
34
|
+
"interests",
|
|
35
|
+
"top_engaged_topics",
|
|
36
|
+
"blind_spots",
|
|
37
|
+
"source_engagement",
|
|
38
|
+
"stats",
|
|
39
|
+
"identity_summary"
|
|
40
|
+
],
|
|
41
|
+
"properties": {
|
|
42
|
+
"generated_at": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"format": "date-time",
|
|
45
|
+
"description": "ISO 8601 timestamp when this DNA profile was generated."
|
|
46
|
+
},
|
|
47
|
+
"primary_stack": {
|
|
48
|
+
"type": "array",
|
|
49
|
+
"items": { "type": "string" },
|
|
50
|
+
"description": "Technologies from the user's declared tech stack (user_identity + tech_stack tables)."
|
|
51
|
+
},
|
|
52
|
+
"adjacent_tech": {
|
|
53
|
+
"type": "array",
|
|
54
|
+
"items": { "type": "string" },
|
|
55
|
+
"description": "Technologies detected by ACE in local projects but not in the declared stack."
|
|
56
|
+
},
|
|
57
|
+
"top_dependencies": {
|
|
58
|
+
"type": "array",
|
|
59
|
+
"items": { "$ref": "#/outputSchema/definitions/DependencyEntry" },
|
|
60
|
+
"description": "Most-used project dependencies across scanned projects."
|
|
61
|
+
},
|
|
62
|
+
"interests": {
|
|
63
|
+
"type": "array",
|
|
64
|
+
"items": { "type": "string" },
|
|
65
|
+
"description": "Explicit interest topics declared by the user."
|
|
66
|
+
},
|
|
67
|
+
"top_engaged_topics": {
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": { "$ref": "#/outputSchema/definitions/EngagedTopic" },
|
|
70
|
+
"description": "Topics with highest positive engagement from interaction data."
|
|
71
|
+
},
|
|
72
|
+
"blind_spots": {
|
|
73
|
+
"type": "array",
|
|
74
|
+
"items": { "$ref": "#/outputSchema/definitions/BlindSpotEntry" },
|
|
75
|
+
"description": "Dependencies in the codebase with stale or zero engagement."
|
|
76
|
+
},
|
|
77
|
+
"source_engagement": {
|
|
78
|
+
"type": "array",
|
|
79
|
+
"items": { "$ref": "#/outputSchema/definitions/SourceEngagement" },
|
|
80
|
+
"description": "Engagement rates broken down by content source type."
|
|
81
|
+
},
|
|
82
|
+
"stats": {
|
|
83
|
+
"$ref": "#/outputSchema/definitions/DnaStats",
|
|
84
|
+
"description": "Aggregate statistics about the developer's 4DA usage."
|
|
85
|
+
},
|
|
86
|
+
"identity_summary": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "Human-readable one-paragraph summary of the developer's technical identity."
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"definitions": {
|
|
92
|
+
"DependencyEntry": {
|
|
93
|
+
"type": "object",
|
|
94
|
+
"required": ["name", "project_path"],
|
|
95
|
+
"properties": {
|
|
96
|
+
"name": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"description": "Package or library name."
|
|
99
|
+
},
|
|
100
|
+
"project_path": {
|
|
101
|
+
"type": "string",
|
|
102
|
+
"description": "Path to the project that uses this dependency."
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"EngagedTopic": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"required": ["topic", "interactions", "percent_of_total"],
|
|
109
|
+
"properties": {
|
|
110
|
+
"topic": {
|
|
111
|
+
"type": "string",
|
|
112
|
+
"description": "The topic name."
|
|
113
|
+
},
|
|
114
|
+
"interactions": {
|
|
115
|
+
"type": "integer",
|
|
116
|
+
"minimum": 0,
|
|
117
|
+
"description": "Total positive interaction count for this topic."
|
|
118
|
+
},
|
|
119
|
+
"percent_of_total": {
|
|
120
|
+
"type": "number",
|
|
121
|
+
"minimum": 0,
|
|
122
|
+
"maximum": 100,
|
|
123
|
+
"description": "Percentage of total interactions attributed to this topic."
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"BlindSpotEntry": {
|
|
128
|
+
"type": "object",
|
|
129
|
+
"required": ["dependency", "severity", "days_stale"],
|
|
130
|
+
"properties": {
|
|
131
|
+
"dependency": {
|
|
132
|
+
"type": "string",
|
|
133
|
+
"description": "The dependency or technology name."
|
|
134
|
+
},
|
|
135
|
+
"severity": {
|
|
136
|
+
"type": "string",
|
|
137
|
+
"enum": ["critical", "high", "medium", "low"],
|
|
138
|
+
"description": "How urgent the knowledge gap is."
|
|
139
|
+
},
|
|
140
|
+
"days_stale": {
|
|
141
|
+
"type": "integer",
|
|
142
|
+
"minimum": 0,
|
|
143
|
+
"description": "Days since last engagement with content about this dependency."
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"SourceEngagement": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"required": ["source_type", "items_seen", "items_saved", "engagement_rate"],
|
|
150
|
+
"properties": {
|
|
151
|
+
"source_type": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"description": "Content source identifier (e.g., hackernews, reddit, arxiv, rss)."
|
|
154
|
+
},
|
|
155
|
+
"items_seen": {
|
|
156
|
+
"type": "integer",
|
|
157
|
+
"minimum": 0,
|
|
158
|
+
"description": "Total items fetched from this source."
|
|
159
|
+
},
|
|
160
|
+
"items_saved": {
|
|
161
|
+
"type": "integer",
|
|
162
|
+
"minimum": 0,
|
|
163
|
+
"description": "Items the user explicitly saved from this source."
|
|
164
|
+
},
|
|
165
|
+
"engagement_rate": {
|
|
166
|
+
"type": "number",
|
|
167
|
+
"minimum": 0,
|
|
168
|
+
"maximum": 1,
|
|
169
|
+
"description": "Ratio of items_saved to items_seen (0..1)."
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
"DnaStats": {
|
|
174
|
+
"type": "object",
|
|
175
|
+
"required": [
|
|
176
|
+
"total_items_processed",
|
|
177
|
+
"total_relevant",
|
|
178
|
+
"rejection_rate",
|
|
179
|
+
"project_count",
|
|
180
|
+
"dependency_count",
|
|
181
|
+
"days_active"
|
|
182
|
+
],
|
|
183
|
+
"properties": {
|
|
184
|
+
"total_items_processed": {
|
|
185
|
+
"type": "integer",
|
|
186
|
+
"minimum": 0,
|
|
187
|
+
"description": "Total content items ingested by 4DA."
|
|
188
|
+
},
|
|
189
|
+
"total_relevant": {
|
|
190
|
+
"type": "integer",
|
|
191
|
+
"minimum": 0,
|
|
192
|
+
"description": "Items that passed the relevance threshold."
|
|
193
|
+
},
|
|
194
|
+
"rejection_rate": {
|
|
195
|
+
"type": "number",
|
|
196
|
+
"minimum": 0,
|
|
197
|
+
"maximum": 1,
|
|
198
|
+
"description": "Fraction of items rejected as irrelevant (0..1)."
|
|
199
|
+
},
|
|
200
|
+
"project_count": {
|
|
201
|
+
"type": "integer",
|
|
202
|
+
"minimum": 0,
|
|
203
|
+
"description": "Number of distinct projects scanned by ACE."
|
|
204
|
+
},
|
|
205
|
+
"dependency_count": {
|
|
206
|
+
"type": "integer",
|
|
207
|
+
"minimum": 0,
|
|
208
|
+
"description": "Total unique dependencies across all projects."
|
|
209
|
+
},
|
|
210
|
+
"days_active": {
|
|
211
|
+
"type": "integer",
|
|
212
|
+
"minimum": 0,
|
|
213
|
+
"description": "Days since the earliest source item was ingested."
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "export_context_packet",
|
|
3
|
+
"description": "Generate a portable context packet for session handoff between AI agents or tools.\n\nExports the user's current 4DA context including open signals, saved items, and active state into a self-contained packet that another session can consume.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"include_signals": {
|
|
8
|
+
"type": "boolean",
|
|
9
|
+
"description": "Include open signals. Default: true"
|
|
10
|
+
},
|
|
11
|
+
"include_saved": {
|
|
12
|
+
"type": "boolean",
|
|
13
|
+
"description": "Include saved items. Default: true"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "knowledge_gaps",
|
|
3
|
+
"description": "Detect knowledge gaps in your project dependencies.\n\nIdentifies dependencies you use but haven't been tracking content about — blind spots where a breaking change, security advisory, or major release could catch you off guard.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"min_severity": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"enum": ["critical", "high", "medium", "low"],
|
|
10
|
+
"description": "Minimum gap severity to include. Default: medium"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "project_health",
|
|
3
|
+
"description": "Project health radar for dependency freshness and security.\n\nAssesses the health of your scanned projects by analyzing dependency counts, package freshness, and cross-referencing with content signals for security advisories or breaking changes.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"project_path": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Specific project path to check. Omit for all projects."
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "reverse_mentions",
|
|
3
|
+
"description": "Find where your projects are mentioned in sources.\n\nSearches across all indexed content for mentions of your project names, dependencies, and technologies. Useful for discovering discussions about your work or tools you maintain.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"limit": {
|
|
8
|
+
"type": "number",
|
|
9
|
+
"description": "Maximum mentions to return. Default: 20"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "semantic_shifts",
|
|
3
|
+
"description": "Detect narrative shifts in topics you follow.\n\nAnalyzes how the meaning and context of topics are changing over time by comparing content embeddings across time windows. Catches paradigm shifts early.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"period_days": {
|
|
8
|
+
"type": "number",
|
|
9
|
+
"description": "Look-back period in days. Default: 7"
|
|
10
|
+
},
|
|
11
|
+
"min_magnitude": {
|
|
12
|
+
"type": "number",
|
|
13
|
+
"description": "Minimum drift magnitude (0-1). Default: 0.1"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "signal_chains",
|
|
3
|
+
"description": "Get causal signal chains connecting related events over time.\n\nTracks evolving stories across sources — e.g., a security vulnerability first mentioned on HN, then an advisory on GitHub, then a fix release. Chains link related signals into narratives.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"resolution": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"enum": ["open", "resolved", "expired", "all"],
|
|
10
|
+
"description": "Filter by chain resolution status. Default: open"
|
|
11
|
+
},
|
|
12
|
+
"min_priority": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"enum": ["critical", "high", "medium", "low"],
|
|
15
|
+
"description": "Minimum chain priority to include. Default: low"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "tech_radar",
|
|
3
|
+
"description": "Generate a technology radar from decisions and content signals.\n\nPlaces technologies into quadrants (languages, frameworks, tools, platforms) and rings (adopt, trial, assess, hold) based on your decisions, usage patterns, and content engagement.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"quadrant": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"enum": ["languages", "frameworks", "tools", "platforms"],
|
|
10
|
+
"description": "Filter by quadrant. Leave empty for all quadrants."
|
|
11
|
+
},
|
|
12
|
+
"ring": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"enum": ["adopt", "trial", "assess", "hold"],
|
|
15
|
+
"description": "Filter by ring. Leave empty for all rings."
|
|
16
|
+
},
|
|
17
|
+
"search": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"description": "Free-text search to filter entries by name."
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
package/dist/setup.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* 4DA MCP Setup — Zero-friction editor configuration
|
|
4
|
+
*
|
|
5
|
+
* Detects installed editors and writes MCP server configuration so
|
|
6
|
+
* the user can start using 4DA tools immediately after install.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* npx @4da/mcp-server --setup
|
|
10
|
+
* 4da-mcp-setup
|
|
11
|
+
* pnpm run setup
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Run the setup wizard: detect editors and write MCP configurations.
|
|
15
|
+
*/
|
|
16
|
+
export declare function runSetup(): void;
|
|
17
|
+
//# sourceMappingURL=setup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../src/setup.ts"],"names":[],"mappings":";AACA;;;;;;;;;;GAUG;AA6GH;;GAEG;AACH,wBAAgB,QAAQ,IAAI,IAAI,CAuB/B"}
|
package/dist/setup.js
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* 4DA MCP Setup — Zero-friction editor configuration
|
|
4
|
+
*
|
|
5
|
+
* Detects installed editors and writes MCP server configuration so
|
|
6
|
+
* the user can start using 4DA tools immediately after install.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* npx @4da/mcp-server --setup
|
|
10
|
+
* 4da-mcp-setup
|
|
11
|
+
* pnpm run setup
|
|
12
|
+
*/
|
|
13
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
14
|
+
import { join, dirname } from "node:path";
|
|
15
|
+
import { homedir } from "node:os";
|
|
16
|
+
/** MCP config snippet for editors that use the standard mcpServers format */
|
|
17
|
+
const MCP_CONFIG = {
|
|
18
|
+
"4da": {
|
|
19
|
+
command: "npx",
|
|
20
|
+
args: ["@4da/mcp-server"],
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Safely read and parse a JSON file, returning empty object on failure.
|
|
25
|
+
*/
|
|
26
|
+
function readJsonSafe(filePath) {
|
|
27
|
+
if (!existsSync(filePath))
|
|
28
|
+
return {};
|
|
29
|
+
try {
|
|
30
|
+
return JSON.parse(readFileSync(filePath, "utf-8"));
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
return {};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Ensure directory exists and write JSON to file.
|
|
38
|
+
*/
|
|
39
|
+
function writeJsonFile(filePath, data) {
|
|
40
|
+
const dir = dirname(filePath);
|
|
41
|
+
if (!existsSync(dir)) {
|
|
42
|
+
mkdirSync(dir, { recursive: true });
|
|
43
|
+
}
|
|
44
|
+
writeFileSync(filePath, JSON.stringify(data, null, 2) + "\n");
|
|
45
|
+
}
|
|
46
|
+
const editors = [
|
|
47
|
+
{
|
|
48
|
+
name: "Claude Code",
|
|
49
|
+
detect: () => {
|
|
50
|
+
// Project-level config takes priority
|
|
51
|
+
const projectClaudeDir = join(process.cwd(), ".claude");
|
|
52
|
+
if (existsSync(projectClaudeDir)) {
|
|
53
|
+
return join(projectClaudeDir, "settings.json");
|
|
54
|
+
}
|
|
55
|
+
// Fall back to global config
|
|
56
|
+
return join(homedir(), ".claude.json");
|
|
57
|
+
},
|
|
58
|
+
write: (configPath) => {
|
|
59
|
+
const config = readJsonSafe(configPath);
|
|
60
|
+
const mcpServers = (config.mcpServers || {});
|
|
61
|
+
mcpServers["4da"] = MCP_CONFIG["4da"];
|
|
62
|
+
config.mcpServers = mcpServers;
|
|
63
|
+
writeJsonFile(configPath, config);
|
|
64
|
+
console.log(` Written: ${configPath}`);
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "Cursor",
|
|
69
|
+
detect: () => {
|
|
70
|
+
const cursorDir = join(homedir(), ".cursor");
|
|
71
|
+
if (existsSync(cursorDir)) {
|
|
72
|
+
return join(cursorDir, "mcp.json");
|
|
73
|
+
}
|
|
74
|
+
return null;
|
|
75
|
+
},
|
|
76
|
+
write: (configPath) => {
|
|
77
|
+
const config = readJsonSafe(configPath);
|
|
78
|
+
const mcpServers = (config.mcpServers || {});
|
|
79
|
+
mcpServers["4da"] = MCP_CONFIG["4da"];
|
|
80
|
+
config.mcpServers = mcpServers;
|
|
81
|
+
writeJsonFile(configPath, config);
|
|
82
|
+
console.log(` Written: ${configPath}`);
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
name: "VS Code (Copilot)",
|
|
87
|
+
detect: () => {
|
|
88
|
+
const vscodePath = join(homedir(), ".vscode");
|
|
89
|
+
if (existsSync(vscodePath)) {
|
|
90
|
+
return join(vscodePath, "mcp.json");
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
},
|
|
94
|
+
write: (configPath) => {
|
|
95
|
+
const config = readJsonSafe(configPath);
|
|
96
|
+
// VS Code uses "servers" key instead of "mcpServers"
|
|
97
|
+
const servers = (config.servers || {});
|
|
98
|
+
servers["4da"] = {
|
|
99
|
+
type: "stdio",
|
|
100
|
+
command: "npx",
|
|
101
|
+
args: ["@4da/mcp-server"],
|
|
102
|
+
};
|
|
103
|
+
config.servers = servers;
|
|
104
|
+
writeJsonFile(configPath, config);
|
|
105
|
+
console.log(` Written: ${configPath}`);
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
/**
|
|
110
|
+
* Run the setup wizard: detect editors and write MCP configurations.
|
|
111
|
+
*/
|
|
112
|
+
export function runSetup() {
|
|
113
|
+
console.log("\n 4DA MCP Server — Setup\n");
|
|
114
|
+
console.log(" Detecting editors...\n");
|
|
115
|
+
let configured = 0;
|
|
116
|
+
for (const editor of editors) {
|
|
117
|
+
const configPath = editor.detect();
|
|
118
|
+
if (configPath) {
|
|
119
|
+
console.log(` Found: ${editor.name}`);
|
|
120
|
+
editor.write(configPath);
|
|
121
|
+
configured++;
|
|
122
|
+
console.log("");
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
if (configured === 0) {
|
|
126
|
+
console.log(" No supported editors detected.\n");
|
|
127
|
+
console.log(" Manual setup — add to your editor's MCP config:\n");
|
|
128
|
+
console.log(` ${JSON.stringify(MCP_CONFIG, null, 2)}\n`);
|
|
129
|
+
}
|
|
130
|
+
console.log(" Done. Restart your editor to activate 4DA.\n");
|
|
131
|
+
}
|
|
132
|
+
// Run directly if invoked as a script (bin entry or pnpm run setup)
|
|
133
|
+
const isDirectRun = process.argv[1]?.endsWith("setup.js") || process.argv[1]?.endsWith("setup.ts");
|
|
134
|
+
if (isDir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AU,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QACnC,IAAI,UAAU,EAAE,CAAC;YACf,OAAO,CAAC,GAAG,CAAC,YAAY,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;YACvC,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YACzB,UAAU,EAAE,CAAC;YACb,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,IAAI,UAAU,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC;QAClD,OAAO,CAAC,GAAG,CAAC,qDAAqD,CAAC,CAAC;QACnE,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;AAChE,CAAC;AAED,oEAAoE;AACpE,MAAM,WAAW,GACf,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;AACjF,IAAI,WAAW,EAAE,CAAC;IAChB,QAAQ,EAAE,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* agent_memory tool
|
|
3
|
+
*
|
|
4
|
+
* Cross-agent persistent memory. What Claude Code learns, Cursor can access.
|
|
5
|
+
* Enables AI agents to store and recall memories across sessions and tools.
|
|
6
|
+
*/
|
|
7
|
+
import type { FourDADatabase } from "../db.js";
|
|
8
|
+
export interface AgentMemoryParams {
|
|
9
|
+
action: "store" | "recall" | "recall_by_tags" | "get_recent";
|
|
10
|
+
session_id?: string;
|
|
11
|
+
agent_type?: string;
|
|
12
|
+
memory_type?: string;
|
|
13
|
+
subject?: string;
|
|
14
|
+
content?: string;
|
|
15
|
+
context_tags?: string[];
|
|
16
|
+
expires_at?: string;
|
|
17
|
+
query?: string;
|
|
18
|
+
filter_agent?: string;
|
|
19
|
+
limit?: number;
|
|
20
|
+
tags?: string[];
|
|
21
|
+
since?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const agentMemoryTool: {
|
|
24
|
+
name: string;
|
|
25
|
+
description: string;
|
|
26
|
+
inputSchema: {
|
|
27
|
+
type: "object";
|
|
28
|
+
properties: {
|
|
29
|
+
action: {
|
|
30
|
+
type: string;
|
|
31
|
+
enum: string[];
|
|
32
|
+
description: string;
|
|
33
|
+
};
|
|
34
|
+
session_id: {
|
|
35
|
+
type: string;
|
|
36
|
+
description: string;
|
|
37
|
+
};
|
|
38
|
+
agent_type: {
|
|
39
|
+
type: string;
|
|
40
|
+
description: string;
|
|
41
|
+
};
|
|
42
|
+
memory_type: {
|
|
43
|
+
type: string;
|
|
44
|
+
enum: string[];
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
subject: {
|
|
48
|
+
type: string;
|
|
49
|
+
description: string;
|
|
50
|
+
};
|
|
51
|
+
content: {
|
|
52
|
+
type: string;
|
|
53
|
+
description: string;
|
|
54
|
+
};
|
|
55
|
+
context_tags: {
|
|
56
|
+
type: string;
|
|
57
|
+
items: {
|
|
58
|
+
type: string;
|
|
59
|
+
};
|
|
60
|
+
description: string;
|
|
61
|
+
};
|
|
62
|
+
expires_at: {
|
|
63
|
+
type: string;
|
|
64
|
+
description: string;
|
|
65
|
+
};
|
|
66
|
+
query: {
|
|
67
|
+
type: string;
|
|
68
|
+
description: string;
|
|
69
|
+
};
|
|
70
|
+
filter_agent: {
|
|
71
|
+
type: string;
|
|
72
|
+
description: string;
|
|
73
|
+
};
|
|
74
|
+
limit: {
|
|
75
|
+
type: string;
|
|
76
|
+
description: string;
|
|
77
|
+
};
|
|
78
|
+
tags: {
|
|
79
|
+
type: string;
|
|
80
|
+
items: {
|
|
81
|
+
type: string;
|
|
82
|
+
};
|
|
83
|
+
description: string;
|
|
84
|
+
};
|
|
85
|
+
since: {
|
|
86
|
+
type: string;
|
|
87
|
+
description: string;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
required: string[];
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
export declare function executeAgentMemory(db: FourDADatabase, params: AgentMemoryParams): object;
|
|
94
|
+
//# sourceMappingURL=agent-memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-memory.d.ts","sourceRoot":"","sources":["../../src/tools/agent-memory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/C,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,OAAO,GAAG,QAAQ,GAAG,gBAAgB,GAAG,YAAY,CAAC;IAE7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAEhB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAmBD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmE3B,CAAC;AAyBF,wBAAgB,kBAAkB,CAChC,EAAE,EAAE,cAAc,EAClB,MAAM,EAAE,iBAAiB,GACxB,MAAM,CAmKR"}
|