@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,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* delegation_score tool
|
|
3
|
+
*
|
|
4
|
+
* AI-delegatability assessment. AI agents use this to self-assess:
|
|
5
|
+
* "Should I proceed autonomously or ask the human?"
|
|
6
|
+
*
|
|
7
|
+
* Computes a composite score from pattern stability, security sensitivity,
|
|
8
|
+
* decision density, and AI track record to produce a delegation recommendation.
|
|
9
|
+
*/
|
|
10
|
+
// ============================================================================
|
|
11
|
+
// Tool Definition
|
|
12
|
+
// ============================================================================
|
|
13
|
+
export const delegationScoreTool = {
|
|
14
|
+
name: "delegation_score",
|
|
15
|
+
description: "AI-delegatability assessment. Computes whether an AI agent should proceed autonomously, request review, collaborate in real-time, or defer to the human. Based on pattern stability, security sensitivity, decision density, and AI track record.",
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: "object",
|
|
18
|
+
properties: {
|
|
19
|
+
subject: {
|
|
20
|
+
type: "string",
|
|
21
|
+
description: "The technology, pattern, or topic to assess for delegation",
|
|
22
|
+
},
|
|
23
|
+
task_description: {
|
|
24
|
+
type: "string",
|
|
25
|
+
description: "Optional description of the task being considered for delegation",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
required: ["subject"],
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// Factor Computation
|
|
33
|
+
// ============================================================================
|
|
34
|
+
function computePatternStability(rawDb, subject) {
|
|
35
|
+
const subjectLower = subject.toLowerCase();
|
|
36
|
+
const pattern = `%${subjectLower}%`;
|
|
37
|
+
// Check tech_stack (highest confidence: user explicitly declared this)
|
|
38
|
+
try {
|
|
39
|
+
const techRows = rawDb
|
|
40
|
+
.prepare(`SELECT technology FROM tech_stack WHERE LOWER(technology) LIKE ?`)
|
|
41
|
+
.all(pattern);
|
|
42
|
+
if (techRows.length > 0) {
|
|
43
|
+
return { score: 0.9, reason: `Found in tech stack: ${techRows[0].technology}` };
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
// Table may not exist
|
|
48
|
+
}
|
|
49
|
+
// Check project_dependencies (good confidence: detected in projects)
|
|
50
|
+
try {
|
|
51
|
+
const depRows = rawDb
|
|
52
|
+
.prepare(`SELECT package_name FROM project_dependencies WHERE LOWER(package_name) LIKE ?`)
|
|
53
|
+
.all(pattern);
|
|
54
|
+
if (depRows.length > 0) {
|
|
55
|
+
return { score: 0.7, reason: `Found in project dependencies: ${depRows[0].package_name}` };
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Table may not exist
|
|
60
|
+
}
|
|
61
|
+
// Check detected_tech (moderate confidence: auto-detected)
|
|
62
|
+
try {
|
|
63
|
+
const dtRows = rawDb
|
|
64
|
+
.prepare(`SELECT name FROM detected_tech WHERE LOWER(name) LIKE ?`)
|
|
65
|
+
.all(pattern);
|
|
66
|
+
if (dtRows.length > 0) {
|
|
67
|
+
return { score: 0.4, reason: `Auto-detected tech: ${dtRows[0].name}` };
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
// Table may not exist
|
|
72
|
+
}
|
|
73
|
+
// Check if subject was explicitly rejected in any decision
|
|
74
|
+
try {
|
|
75
|
+
const decisions = rawDb
|
|
76
|
+
.prepare(`SELECT id, alternatives_rejected FROM developer_decisions
|
|
77
|
+
WHERE status = 'active'
|
|
78
|
+
AND LOWER(alternatives_rejected) LIKE ?`)
|
|
79
|
+
.all(pattern);
|
|
80
|
+
if (decisions.length > 0) {
|
|
81
|
+
return { score: 0.1, reason: `Subject was rejected in decision #${decisions[0].id}` };
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch {
|
|
85
|
+
// Table may not exist
|
|
86
|
+
}
|
|
87
|
+
return { score: 0.5, reason: "No prior pattern data found" };
|
|
88
|
+
}
|
|
89
|
+
function computeSecuritySensitivity(rawDb, subject) {
|
|
90
|
+
const pattern = `%${subject.toLowerCase()}%`;
|
|
91
|
+
try {
|
|
92
|
+
// Count security-related source items for this subject in last 90 days
|
|
93
|
+
const sinceDate = new Date(Date.now() - 90 * 24 * 60 * 60 * 1000).toISOString();
|
|
94
|
+
const rows = rawDb
|
|
95
|
+
.prepare(`SELECT COUNT(*) as cnt FROM source_items
|
|
96
|
+
WHERE created_at > ?
|
|
97
|
+
AND LOWER(title) LIKE ?
|
|
98
|
+
AND (
|
|
99
|
+
LOWER(title) LIKE '%security%'
|
|
100
|
+
OR LOWER(title) LIKE '%vulnerability%'
|
|
101
|
+
OR LOWER(title) LIKE '%cve%'
|
|
102
|
+
OR LOWER(title) LIKE '%exploit%'
|
|
103
|
+
OR LOWER(title) LIKE '%advisory%'
|
|
104
|
+
)`)
|
|
105
|
+
.get(sinceDate, pattern);
|
|
106
|
+
const count = rows?.cnt || 0;
|
|
107
|
+
if (count === 0) {
|
|
108
|
+
return { score: 0.1, reason: "No security signals in last 90 days" };
|
|
109
|
+
}
|
|
110
|
+
else if (count <= 2) {
|
|
111
|
+
return { score: 0.5, reason: `${count} security signal(s) in last 90 days` };
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
return { score: 0.9, reason: `${count} security signals in last 90 days — high sensitivity` };
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return { score: 0.3, reason: "Unable to assess security signals" };
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function computeDecisionDensity(rawDb, subject) {
|
|
122
|
+
const pattern = `%${subject.toLowerCase()}%`;
|
|
123
|
+
try {
|
|
124
|
+
const rows = rawDb
|
|
125
|
+
.prepare(`SELECT COUNT(*) as cnt FROM developer_decisions
|
|
126
|
+
WHERE status = 'active'
|
|
127
|
+
AND (LOWER(subject) LIKE ? OR LOWER(context_tags) LIKE ?)`)
|
|
128
|
+
.get(pattern, pattern);
|
|
129
|
+
const count = rows?.cnt || 0;
|
|
130
|
+
if (count === 0) {
|
|
131
|
+
return { score: 0.1, reason: "No active decisions for this subject" };
|
|
132
|
+
}
|
|
133
|
+
else if (count === 1) {
|
|
134
|
+
return { score: 0.3, reason: "1 active decision — some constraints exist" };
|
|
135
|
+
}
|
|
136
|
+
else if (count <= 3) {
|
|
137
|
+
return { score: 0.6, reason: `${count} active decisions — moderate constraint density` };
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
return { score: 0.9, reason: `${count} active decisions — heavily constrained area` };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
catch {
|
|
144
|
+
return { score: 0.3, reason: "Unable to assess decision density" };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
function computeAITrackRecord(rawDb, subject) {
|
|
148
|
+
const pattern = `%${subject.toLowerCase()}%`;
|
|
149
|
+
try {
|
|
150
|
+
const rows = rawDb
|
|
151
|
+
.prepare(`SELECT COUNT(*) as cnt FROM agent_memory
|
|
152
|
+
WHERE memory_type = 'warning'
|
|
153
|
+
AND (LOWER(subject) LIKE ? OR LOWER(content) LIKE ?)`)
|
|
154
|
+
.get(pattern, pattern);
|
|
155
|
+
const warningCount = rows?.cnt || 0;
|
|
156
|
+
if (warningCount === 0) {
|
|
157
|
+
return { score: 0.9, reason: "No prior warnings — clean track record" };
|
|
158
|
+
}
|
|
159
|
+
else if (warningCount === 1) {
|
|
160
|
+
return { score: 0.6, reason: "1 prior warning — proceed with caution" };
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
return { score: 0.3, reason: `${warningCount} prior warnings — needs human oversight` };
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
return { score: 0.7, reason: "Unable to assess track record (no memory table)" };
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
// ============================================================================
|
|
171
|
+
// Execute
|
|
172
|
+
// ============================================================================
|
|
173
|
+
export function executeDelegationScore(db, params) {
|
|
174
|
+
const rawDb = db.getRawDb();
|
|
175
|
+
const subject = params.subject;
|
|
176
|
+
// Compute factors
|
|
177
|
+
const patternStability = computePatternStability(rawDb, subject);
|
|
178
|
+
const securitySensitivity = computeSecuritySensitivity(rawDb, subject);
|
|
179
|
+
const decisionDensity = computeDecisionDensity(rawDb, subject);
|
|
180
|
+
const aiTrackRecord = computeAITrackRecord(rawDb, subject);
|
|
181
|
+
// Composite score
|
|
182
|
+
// Higher = more delegatable
|
|
183
|
+
// pattern_stability: higher is better (known pattern)
|
|
184
|
+
// security_sensitivity: INVERT (lower security risk = more delegatable)
|
|
185
|
+
// decision_density: INVERT (fewer constraints = more delegatable)
|
|
186
|
+
// ai_track_record: higher is better (fewer warnings)
|
|
187
|
+
const composite = patternStability.score * 0.30 +
|
|
188
|
+
(1 - securitySensitivity.score) * 0.25 +
|
|
189
|
+
(1 - decisionDensity.score) * 0.25 +
|
|
190
|
+
aiTrackRecord.score * 0.20;
|
|
191
|
+
const overallScore = Math.max(0, Math.min(1, Math.round(composite * 100) / 100));
|
|
192
|
+
// Map to recommendation
|
|
193
|
+
let recommendation;
|
|
194
|
+
if (overallScore >= 0.8) {
|
|
195
|
+
recommendation = "fully_delegate";
|
|
196
|
+
}
|
|
197
|
+
else if (overallScore >= 0.5) {
|
|
198
|
+
recommendation = "delegate_with_review";
|
|
199
|
+
}
|
|
200
|
+
else if (overallScore >= 0.3) {
|
|
201
|
+
recommendation = "collaborate_realtime";
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
recommendation = "human_only";
|
|
205
|
+
}
|
|
206
|
+
// Build caveats
|
|
207
|
+
const caveats = [];
|
|
208
|
+
if (securitySensitivity.score >= 0.5) {
|
|
209
|
+
caveats.push("Security signals detected — review security implications");
|
|
210
|
+
}
|
|
211
|
+
if (decisionDensity.score >= 0.6) {
|
|
212
|
+
caveats.push("Multiple active decisions constrain this area — check alignment");
|
|
213
|
+
}
|
|
214
|
+
if (patternStability.score <= 0.3) {
|
|
215
|
+
caveats.push("Subject was previously rejected or is unfamiliar — verify approach");
|
|
216
|
+
}
|
|
217
|
+
if (aiTrackRecord.score <= 0.5) {
|
|
218
|
+
caveats.push("Prior warnings exist for this subject — exercise caution");
|
|
219
|
+
}
|
|
220
|
+
return {
|
|
221
|
+
subject,
|
|
222
|
+
task_description: params.task_description || null,
|
|
223
|
+
overall_score: overallScore,
|
|
224
|
+
factors: {
|
|
225
|
+
pattern_stability: {
|
|
226
|
+
score: patternStability.score,
|
|
227
|
+
weight: 0.30,
|
|
228
|
+
reason: patternStability.reason,
|
|
229
|
+
},
|
|
230
|
+
security_sensitivity: {
|
|
231
|
+
score: securitySensitivity.score,
|
|
232
|
+
weight: 0.25,
|
|
233
|
+
reason: securitySensitivity.reason,
|
|
234
|
+
},
|
|
235
|
+
decision_density: {
|
|
236
|
+
score: decisionDensity.score,
|
|
237
|
+
weight: 0.25,
|
|
238
|
+
reason: decisionDensity.reason,
|
|
239
|
+
},
|
|
240
|
+
ai_track_record: {
|
|
241
|
+
score: aiTrackRecord.score,
|
|
242
|
+
weight: 0.20,
|
|
243
|
+
reason: aiTrackRecord.reason,
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
recommendation,
|
|
247
|
+
caveats,
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
//# sourceMappingURL=delegation-score.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegation-score.js","sourceRoot":"","sources":["../../src/tools/delegation-score.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAyCH,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EACT,mPAAmP;IACrP,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,4DAA4D;aAC/D;YACD,gBAAgB,EAAE;gBAChB,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,kEAAkE;aACrE;SACF;QACD,QAAQ,EAAE,CAAC,SAAS,CAAC;KACtB;CACF,CAAC;AAEF,+EAA+E;AAC/E,qBAAqB;AACrB,+EAA+E;AAE/E,SAAS,uBAAuB,CAC9B,KAA6C,EAC7C,OAAe;IAEf,MAAM,YAAY,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAC3C,MAAM,OAAO,GAAG,IAAI,YAAY,GAAG,CAAC;IAEpC,uEAAuE;IACvE,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,KAAK;aACnB,OAAO,CAAC,kEAAkE,CAAC;aAC3E,GAAG,CAAC,OAAO,CAAmB,CAAC;QAElC,IAAI,QAAQ,CAAC,MAAM,GA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AC7B,MAAM,EAAE,IAAI;gBACZ,MAAM,EAAE,gBAAgB,CAAC,MAAM;aAChC;YACD,oBAAoB,EAAE;gBACpB,KAAK,EAAE,mBAAmB,CAAC,KAAK;gBAChC,MAAM,EAAE,IAAI;gBACZ,MAAM,EAAE,mBAAmB,CAAC,MAAM;aACnC;YACD,gBAAgB,EAAE;gBAChB,KAAK,EAAE,eAAe,CAAC,KAAK;gBAC5B,MAAM,EAAE,IAAI;gBACZ,MAAM,EAAE,eAAe,CAAC,MAAM;aAC/B;YACD,eAAe,EAAE;gBACf,KAAK,EAAE,aAAa,CAAC,KAAK;gBAC1B,MAAM,EAAE,IAAI;gBACZ,MAAM,EAAE,aAAa,CAAC,MAAM;aAC7B;SACF;QACD,cAAc;QACd,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* developer_dna tool
|
|
3
|
+
*
|
|
4
|
+
* Export a comprehensive Developer DNA profile built from project scans,
|
|
5
|
+
* engagement data, and learned preferences.
|
|
6
|
+
*/
|
|
7
|
+
import type { FourDADatabase } from "../db.js";
|
|
8
|
+
export interface DeveloperDnaParams {
|
|
9
|
+
include_blind_spots?: boolean;
|
|
10
|
+
max_dependencies?: number;
|
|
11
|
+
max_topics?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const developerDnaTool: {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
inputSchema: {
|
|
17
|
+
type: "object";
|
|
18
|
+
properties: {
|
|
19
|
+
include_blind_spots: {
|
|
20
|
+
type: string;
|
|
21
|
+
description: string;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
max_dependencies: {
|
|
25
|
+
type: string;
|
|
26
|
+
description: string;
|
|
27
|
+
default: number;
|
|
28
|
+
};
|
|
29
|
+
max_topics: {
|
|
30
|
+
type: string;
|
|
31
|
+
description: string;
|
|
32
|
+
default: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
interface DependencyEntry {
|
|
38
|
+
name: string;
|
|
39
|
+
project_path: string;
|
|
40
|
+
}
|
|
41
|
+
interface EngagedTopic {
|
|
42
|
+
topic: string;
|
|
43
|
+
interactions: number;
|
|
44
|
+
percent_of_total: number;
|
|
45
|
+
}
|
|
46
|
+
interface BlindSpotEntry {
|
|
47
|
+
dependency: string;
|
|
48
|
+
severity: string;
|
|
49
|
+
days_stale: number;
|
|
50
|
+
}
|
|
51
|
+
interface SourceEngagement {
|
|
52
|
+
source_type: string;
|
|
53
|
+
items_seen: number;
|
|
54
|
+
items_saved: number;
|
|
55
|
+
engagement_rate: number;
|
|
56
|
+
}
|
|
57
|
+
interface DnaStats {
|
|
58
|
+
total_items_processed: number;
|
|
59
|
+
total_relevant: number;
|
|
60
|
+
rejection_rate: number;
|
|
61
|
+
project_count: number;
|
|
62
|
+
dependency_count: number;
|
|
63
|
+
days_active: number;
|
|
64
|
+
}
|
|
65
|
+
interface DeveloperDna {
|
|
66
|
+
generated_at: string;
|
|
67
|
+
primary_stack: string[];
|
|
68
|
+
adjacent_tech: string[];
|
|
69
|
+
top_dependencies: DependencyEntry[];
|
|
70
|
+
interests: string[];
|
|
71
|
+
top_engaged_topics: EngagedTopic[];
|
|
72
|
+
blind_spots: BlindSpotEntry[];
|
|
73
|
+
source_engagement: SourceEngagement[];
|
|
74
|
+
stats: DnaStats;
|
|
75
|
+
identity_summary: string;
|
|
76
|
+
}
|
|
77
|
+
export declare function executeDeveloperDna(db: FourDADatabase, params: DeveloperDnaParams): DeveloperDna;
|
|
78
|
+
export {};
|
|
79
|
+
//# sourceMappingURL=developer-dna.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"developer-dna.d.ts","sourceRoot":"","sources":["../../src/tools/developer-dna.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,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