@4da/mcp-server 3.2.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/README.md +135 -0
- package/dist/db.d.ts +64 -0
- package/dist/db.d.ts.map +1 -0
- package/dist/db.js +578 -0
- package/dist/db.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +422 -0
- package/dist/index.js.map +1 -0
- package/dist/llm.d.ts +144 -0
- package/dist/llm.d.ts.map +1 -0
- package/dist/llm.js +447 -0
- package/dist/llm.js.map +1 -0
- package/dist/output-manager.d.ts +156 -0
- package/dist/output-manager.d.ts.map +1 -0
- package/dist/output-manager.js +156 -0
- package/dist/output-manager.js.map +1 -0
- package/dist/schema-registry.d.ts +46 -0
- package/dist/schema-registry.d.ts.map +1 -0
- package/dist/schema-registry.js +133 -0
- package/dist/schema-registry.js.map +1 -0
- package/dist/schemas/config-validator.json +18 -0
- package/dist/schemas/context-analysis.json +25 -0
- package/dist/schemas/daily-briefing.json +34 -0
- package/dist/schemas/explain-relevance.json +19 -0
- package/dist/schemas/get-actionable-signals.json +29 -0
- package/dist/schemas/get-context.json +17 -0
- package/dist/schemas/get-relevant-content.json +26 -0
- package/dist/schemas/llm-status.json +13 -0
- package/dist/schemas/record-feedback.json +24 -0
- package/dist/schemas/score-autopsy.json +30 -0
- package/dist/schemas/source-health.json +17 -0
- package/dist/schemas/topic-connections.json +34 -0
- package/dist/schemas/trend-analysis.json +29 -0
- package/dist/tools/attention-report.d.ts +39 -0
- package/dist/tools/attention-report.d.ts.map +1 -0
- package/dist/tools/attention-report.js +72 -0
- package/dist/tools/attention-report.js.map +1 -0
- package/dist/tools/config-validator.d.ts +59 -0
- package/dist/tools/config-validator.d.ts.map +1 -0
- package/dist/tools/config-validator.js +375 -0
- package/dist/tools/config-validator.js.map +1 -0
- package/dist/tools/context-analysis.d.ts +108 -0
- package/dist/tools/context-analysis.d.ts.map +1 -0
- package/dist/tools/context-analysis.js +300 -0
- package/dist/tools/context-analysis.js.map +1 -0
- package/dist/tools/daily-briefing.d.ts +103 -0
- package/dist/tools/daily-briefing.d.ts.map +1 -0
- package/dist/tools/daily-briefing.js +278 -0
- package/dist/tools/daily-briefing.js.map +1 -0
- package/dist/tools/explain-relevance.d.ts +36 -0
- package/dist/tools/explain-relevance.d.ts.map +1 -0
- package/dist/tools/explain-relevance.js +50 -0
- package/dist/tools/explain-relevance.js.map +1 -0
- package/dist/tools/export-context.d.ts +43 -0
- package/dist/tools/export-context.d.ts.map +1 -0
- package/dist/tools/export-context.js +104 -0
- package/dist/tools/export-context.js.map +1 -0
- package/dist/tools/get-actionable-signals.d.ts +65 -0
- package/dist/tools/get-actionable-signals.d.ts.map +1 -0
- package/dist/tools/get-actionable-signals.js +268 -0
- package/dist/tools/get-actionable-signals.js.map +1 -0
- package/dist/tools/get-context.d.ts +34 -0
- package/dist/tools/get-context.d.ts.map +1 -0
- package/dist/tools/get-context.js +43 -0
- package/dist/tools/get-context.js.map +1 -0
- package/dist/tools/get-relevant-content.d.ts +44 -0
- package/dist/tools/get-relevant-content.d.ts.map +1 -0
- package/dist/tools/get-relevant-content.js +56 -0
- package/dist/tools/get-relevant-content.js.map +1 -0
- package/dist/tools/index.d.ts +40 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +44 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/knowledge-gaps.d.ts +36 -0
- package/dist/tools/knowledge-gaps.d.ts.map +1 -0
- package/dist/tools/knowledge-gaps.js +76 -0
- package/dist/tools/knowledge-gaps.js.map +1 -0
- package/dist/tools/llm-status.d.ts +45 -0
- package/dist/tools/llm-status.d.ts.map +1 -0
- package/dist/tools/llm-status.js +92 -0
- package/dist/tools/llm-status.js.map +1 -0
- package/dist/tools/project-health.d.ts +41 -0
- package/dist/tools/project-health.d.ts.map +1 -0
- package/dist/tools/project-health.js +71 -0
- package/dist/tools/project-health.js.map +1 -0
- package/dist/tools/record-feedback.d.ts +39 -0
- package/dist/tools/record-feedback.d.ts.map +1 -0
- package/dist/tools/record-feedback.js +60 -0
- package/dist/tools/record-feedback.js.map +1 -0
- package/dist/tools/reverse-mentions.d.ts +38 -0
- package/dist/tools/reverse-mentions.d.ts.map +1 -0
- package/dist/tools/reverse-mentions.js +57 -0
- package/dist/tools/reverse-mentions.js.map +1 -0
- package/dist/tools/score-autopsy.d.ts +93 -0
- package/dist/tools/score-autopsy.d.ts.map +1 -0
- package/dist/tools/score-autopsy.js +288 -0
- package/dist/tools/score-autopsy.js.map +1 -0
- package/dist/tools/semantic-shifts.d.ts +37 -0
- package/dist/tools/semantic-shifts.d.ts.map +1 -0
- package/dist/tools/semantic-shifts.js +73 -0
- package/dist/tools/semantic-shifts.js.map +1 -0
- package/dist/tools/signal-chains.d.ts +45 -0
- package/dist/tools/signal-chains.d.ts.map +1 -0
- package/dist/tools/signal-chains.js +60 -0
- package/dist/tools/signal-chains.js.map +1 -0
- package/dist/tools/source-health.d.ts +64 -0
- package/dist/tools/source-health.d.ts.map +1 -0
- package/dist/tools/source-health.js +176 -0
- package/dist/tools/source-health.js.map +1 -0
- package/dist/tools/topic-connections.d.ts +112 -0
- package/dist/tools/topic-connections.d.ts.map +1 -0
- package/dist/tools/topic-connections.js +318 -0
- package/dist/tools/topic-connections.js.map +1 -0
- package/dist/tools/trend-analysis.d.ts +105 -0
- package/dist/tools/trend-analysis.d.ts.map +1 -0
- package/dist/tools/trend-analysis.js +295 -0
- package/dist/tools/trend-analysis.js.map +1 -0
- package/dist/types.d.ts +163 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +61 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output Manager for Dynamic Context Discovery
|
|
3
|
+
*
|
|
4
|
+
* Reduces token usage by ~80% through:
|
|
5
|
+
* - Writing full results to files (referenced by path)
|
|
6
|
+
* - Returning compact summaries inline
|
|
7
|
+
* - Providing retrieval hints for common queries
|
|
8
|
+
*
|
|
9
|
+
* Full results stored at: ~/.local/share/4da/context/results/
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
12
|
+
import { homedir } from "node:os";
|
|
13
|
+
import { join } from "node:path";
|
|
14
|
+
// Base directory for 4DA context files
|
|
15
|
+
const CONTEXT_DIR = join(homedir(), ".local", "share", "4da", "context");
|
|
16
|
+
const RESULTS_DIR = join(CONTEXT_DIR, "results");
|
|
17
|
+
/**
|
|
18
|
+
* Ensure the context directories exist
|
|
19
|
+
*/
|
|
20
|
+
function ensureDirectories() {
|
|
21
|
+
if (!existsSync(CONTEXT_DIR)) {
|
|
22
|
+
mkdirSync(CONTEXT_DIR, { recursive: true });
|
|
23
|
+
}
|
|
24
|
+
if (!existsSync(RESULTS_DIR)) {
|
|
25
|
+
mkdirSync(RESULTS_DIR, { recursive: true });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Write full result to file and return the file path
|
|
30
|
+
*/
|
|
31
|
+
function writeResultFile(toolName, fullResult) {
|
|
32
|
+
ensureDirectories();
|
|
33
|
+
// Generate timestamped filename
|
|
34
|
+
const timestamp = Math.floor(Date.now() / 1000);
|
|
35
|
+
const filename = `${toolName}_${timestamp}.json`;
|
|
36
|
+
const filePath = join(RESULTS_DIR, filename);
|
|
37
|
+
// Write full result to file
|
|
38
|
+
writeFileSync(filePath, JSON.stringify(fullResult, null, 2), "utf-8");
|
|
39
|
+
return filePath;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get the results directory path (for documentation)
|
|
43
|
+
*/
|
|
44
|
+
export function getResultsDir() {
|
|
45
|
+
return RESULTS_DIR;
|
|
46
|
+
}
|
|
47
|
+
export function createDailyBriefingCompact(result) {
|
|
48
|
+
const topTheme = result.themes[0]?.name || "general";
|
|
49
|
+
return {
|
|
50
|
+
summary: `${result.summary.total_items_analyzed} items analyzed, ${result.summary.high_relevance_count} high-priority. Top theme: ${topTheme}. ${result.ai_synthesis ? "AI synthesis included." : ""}`,
|
|
51
|
+
key_data: {
|
|
52
|
+
total_items: result.summary.total_items_analyzed,
|
|
53
|
+
high_priority: result.summary.high_relevance_count,
|
|
54
|
+
top_theme: result.themes[0]?.name || "none",
|
|
55
|
+
tldr: result.summary.tldr,
|
|
56
|
+
executive_brief: result.ai_synthesis?.executive_brief,
|
|
57
|
+
},
|
|
58
|
+
full_result_path: writeResultFile("daily_briefing", result),
|
|
59
|
+
retrieval_hints: [
|
|
60
|
+
"jq '.notable_items' - get high-priority items",
|
|
61
|
+
"jq '.themes' - get topic breakdown",
|
|
62
|
+
"jq '.recommendations' - get action items",
|
|
63
|
+
"jq '.ai_synthesis.executive_brief' - get AI summary",
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export function createTrendAnalysisCompact(result) {
|
|
68
|
+
const anomalyNote = result.anomalies.length > 0 ? ` ${result.anomalies.length} anomalies detected.` : "";
|
|
69
|
+
return {
|
|
70
|
+
summary: `Volume ${result.summary.volume_trend}. Rising: ${result.summary.top_rising_topic || "none"}. Falling: ${result.summary.top_falling_topic || "none"}.${anomalyNote}`,
|
|
71
|
+
key_data: {
|
|
72
|
+
total_items: result.summary.total_items,
|
|
73
|
+
volume_trend: result.summary.volume_trend,
|
|
74
|
+
top_rising: result.summary.top_rising_topic,
|
|
75
|
+
top_falling: result.summary.top_falling_topic,
|
|
76
|
+
anomaly_count: result.anomalies.length,
|
|
77
|
+
narrative: result.ai_interpretation?.narrative,
|
|
78
|
+
},
|
|
79
|
+
full_result_path: writeResultFile("trend_analysis", result),
|
|
80
|
+
retrieval_hints: [
|
|
81
|
+
"jq '.topic_trends' - get all topic trends",
|
|
82
|
+
"jq '.volume_by_day' - get daily volume data",
|
|
83
|
+
"jq '.anomalies' - get detected anomalies",
|
|
84
|
+
"jq '.ai_interpretation.forecast' - get predictions",
|
|
85
|
+
],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
export function createScoreAutopsyCompact(result) {
|
|
89
|
+
const topComponent = result.components.sort((a, b) => b.contribution - a.contribution)[0];
|
|
90
|
+
const assessment = result.ai_analysis?.score_assessment || "unanalyzed";
|
|
91
|
+
return {
|
|
92
|
+
summary: `"${result.item.title.substring(0, 40)}..." scored ${Math.round(result.final_score * 100)}%. Assessment: ${assessment}. Top contributor: ${topComponent?.name || "unknown"}.`,
|
|
93
|
+
key_data: {
|
|
94
|
+
item_title: result.item.title,
|
|
95
|
+
final_score: result.final_score,
|
|
96
|
+
score_assessment: result.ai_analysis?.score_assessment,
|
|
97
|
+
top_contributor: topComponent?.name || "unknown",
|
|
98
|
+
verdict: result.ai_analysis?.verdict,
|
|
99
|
+
},
|
|
100
|
+
full_result_path: writeResultFile("score_autopsy", result),
|
|
101
|
+
retrieval_hints: [
|
|
102
|
+
"jq '.components' - get score breakdown",
|
|
103
|
+
"jq '.matching_context' - get what matched",
|
|
104
|
+
"jq '.similar_items' - get comparison items",
|
|
105
|
+
"jq '.recommendations' - get improvement suggestions",
|
|
106
|
+
],
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
export function createContextAnalysisCompact(result) {
|
|
110
|
+
const quality = Math.round(result.quality_score.overall * 100);
|
|
111
|
+
return {
|
|
112
|
+
summary: `Context quality: ${quality}%. ${result.context_summary.interests_count} interests, ${result.context_summary.tech_stack_count} tech. ${result.coverage_gaps.length} gaps found.`,
|
|
113
|
+
key_data: {
|
|
114
|
+
quality_score: result.quality_score.overall,
|
|
115
|
+
interests_count: result.context_summary.interests_count,
|
|
116
|
+
tech_count: result.context_summary.tech_stack_count,
|
|
117
|
+
gap_count: result.coverage_gaps.length,
|
|
118
|
+
top_recommendation: result.recommendations[0]?.action || "No recommendations",
|
|
119
|
+
personalized_advice: result.ai_advice?.personalized_recommendations,
|
|
120
|
+
},
|
|
121
|
+
full_result_path: writeResultFile("context_analysis", result),
|
|
122
|
+
retrieval_hints: [
|
|
123
|
+
"jq '.quality_score.dimensions' - get quality breakdown",
|
|
124
|
+
"jq '.coverage_gaps' - get what's missing",
|
|
125
|
+
"jq '.recommendations' - get all suggestions",
|
|
126
|
+
"jq '.top_affinities' - get learned preferences",
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
export function createTopicConnectionsCompact(result) {
|
|
131
|
+
const topEdge = result.edges[0];
|
|
132
|
+
const connectionNote = topEdge
|
|
133
|
+
? `Strongest: ${topEdge.from} ↔ ${topEdge.to}.`
|
|
134
|
+
: "No strong connections.";
|
|
135
|
+
return {
|
|
136
|
+
summary: `${result.nodes.length} topics, ${result.edges.length} connections. Central: ${result.central_topics.slice(0, 3).join(", ")}. ${connectionNote}`,
|
|
137
|
+
key_data: {
|
|
138
|
+
items_analyzed: result.analysis_period.items_analyzed,
|
|
139
|
+
node_count: result.nodes.length,
|
|
140
|
+
edge_count: result.edges.length,
|
|
141
|
+
central_topics: result.central_topics.slice(0, 5),
|
|
142
|
+
top_connection: topEdge
|
|
143
|
+
? { from: topEdge.from, to: topEdge.to, strength: topEdge.co_occurrences }
|
|
144
|
+
: null,
|
|
145
|
+
graph_narrative: result.ai_insights?.graph_narrative,
|
|
146
|
+
},
|
|
147
|
+
full_result_path: writeResultFile("topic_connections", result),
|
|
148
|
+
retrieval_hints: [
|
|
149
|
+
"jq '.nodes' - get all topic nodes",
|
|
150
|
+
"jq '.edges' - get all connections",
|
|
151
|
+
"jq '.clusters' - get topic clusters",
|
|
152
|
+
"jq '.path' - get path between topics (if requested)",
|
|
153
|
+
],
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
//# sourceMappingURL=output-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output-manager.js","sourceRoot":"","sources":["../src/output-manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAA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CAAC,KAAK,CAAC,MAAM,YAAY,MAAM,CAAC,KAAK,CAAC,MAAM,0BAA0B,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,cAAc,EAAE;QACzJ,QAAQ,EAAE;YACR,cAAc,EAAE,MAAM,CAAC,eAAe,CAAC,cAAc;YACrD,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;YAC/B,UAAU,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM;YAC/B,cAAc,EAAE,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC;YACjD,cAAc,EAAE,OAAO;gBACrB,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,CAAC,cAAc,EAAE;gBAC1E,CAAC,CAAC,IAAI;YACR,eAAe,EAAE,MAAM,CAAC,WAAW,EAAE,eAAe;SACrD;QACD,gBAAgB,EAAE,eAAe,CAAC,mBAAmB,EAAE,MAAM,CAAC;QAC9D,eAAe,EAAE;YACf,mCAAmC;YACnC,mCAAmC;YACnC,qCAAqC;YACrC,qDAAqD;SACtD;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema Registry for Dynamic Context Discovery
|
|
3
|
+
*
|
|
4
|
+
* Reduces tool listing from ~4500 tokens to ~500 tokens by:
|
|
5
|
+
* - Returning only one-liner summaries in list_tools
|
|
6
|
+
* - Storing full schemas as MCP Resources (lazy-loaded)
|
|
7
|
+
*
|
|
8
|
+
* Full schemas available at: 4da://schema/{tool_name}
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Slim tool registry - one-liner descriptions only
|
|
12
|
+
* Full schemas are stored in schemas/*.json and exposed as MCP Resources
|
|
13
|
+
*/
|
|
14
|
+
export declare const TOOL_REGISTRY: Record<string, {
|
|
15
|
+
summary: string;
|
|
16
|
+
schemaFile: string;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Get slim tool list for list_tools response
|
|
20
|
+
* Returns minimal schema (just type: object) - full schema via resources
|
|
21
|
+
*/
|
|
22
|
+
export declare function getSlimToolList(): Array<{
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
inputSchema: {
|
|
26
|
+
type: "object";
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
/**
|
|
30
|
+
* Get list of schema resources for ListResources
|
|
31
|
+
*/
|
|
32
|
+
export declare function getSchemaResources(): Array<{
|
|
33
|
+
uri: string;
|
|
34
|
+
name: string;
|
|
35
|
+
description: string;
|
|
36
|
+
mimeType: string;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Check if a tool exists
|
|
40
|
+
*/
|
|
41
|
+
export declare function hasToolSchema(toolName: string): boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Get schema filename for a tool
|
|
44
|
+
*/
|
|
45
|
+
export declare function getSchemaFilename(toolName: string): string | null;
|
|
46
|
+
//# sourceMappingURL=schema-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-registry.d.ts","sourceRoot":"","sources":["../src/schema-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAsFjF,CAAC;AAEF;;;GAGG;AACH,wBAAgB,eAAe,IAAI,KAAK,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAA;KAAE,CAAC;CACjC,CAAC,CAMD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,KAAK,CAAC;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC,CAOD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAEvD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEjE"}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schema Registry for Dynamic Context Discovery
|
|
3
|
+
*
|
|
4
|
+
* Reduces tool listing from ~4500 tokens to ~500 tokens by:
|
|
5
|
+
* - Returning only one-liner summaries in list_tools
|
|
6
|
+
* - Storing full schemas as MCP Resources (lazy-loaded)
|
|
7
|
+
*
|
|
8
|
+
* Full schemas available at: 4da://schema/{tool_name}
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Slim tool registry - one-liner descriptions only
|
|
12
|
+
* Full schemas are stored in schemas/*.json and exposed as MCP Resources
|
|
13
|
+
*/
|
|
14
|
+
export const TOOL_REGISTRY = {
|
|
15
|
+
// Core Tools
|
|
16
|
+
get_relevant_content: {
|
|
17
|
+
summary: "Query filtered content by relevance, source, time",
|
|
18
|
+
schemaFile: "get-relevant-content.json",
|
|
19
|
+
},
|
|
20
|
+
get_context: {
|
|
21
|
+
summary: "Get user's interests, tech stack, learned affinities",
|
|
22
|
+
schemaFile: "get-context.json",
|
|
23
|
+
},
|
|
24
|
+
explain_relevance: {
|
|
25
|
+
summary: "Understand why an item scored the way it did",
|
|
26
|
+
schemaFile: "explain-relevance.json",
|
|
27
|
+
},
|
|
28
|
+
record_feedback: {
|
|
29
|
+
summary: "Teach 4DA what you like/dislike (click, save, dismiss)",
|
|
30
|
+
schemaFile: "record-feedback.json",
|
|
31
|
+
},
|
|
32
|
+
// Superpower Tools
|
|
33
|
+
score_autopsy: {
|
|
34
|
+
summary: "Deep forensic analysis of relevance scores (AI-powered)",
|
|
35
|
+
schemaFile: "score-autopsy.json",
|
|
36
|
+
},
|
|
37
|
+
trend_analysis: {
|
|
38
|
+
summary: "Statistical patterns, anomalies, and predictions (AI-powered)",
|
|
39
|
+
schemaFile: "trend-analysis.json",
|
|
40
|
+
},
|
|
41
|
+
daily_briefing: {
|
|
42
|
+
summary: "Executive summary of discoveries (AI-powered)",
|
|
43
|
+
schemaFile: "daily-briefing.json",
|
|
44
|
+
},
|
|
45
|
+
context_analysis: {
|
|
46
|
+
summary: "Optimize your context for better relevance (AI-powered)",
|
|
47
|
+
schemaFile: "context-analysis.json",
|
|
48
|
+
},
|
|
49
|
+
source_health: {
|
|
50
|
+
summary: "Diagnose source fetching and data quality issues",
|
|
51
|
+
schemaFile: "source-health.json",
|
|
52
|
+
},
|
|
53
|
+
topic_connections: {
|
|
54
|
+
summary: "Build knowledge graphs from content (AI-powered)",
|
|
55
|
+
schemaFile: "topic-connections.json",
|
|
56
|
+
},
|
|
57
|
+
config_validator: {
|
|
58
|
+
summary: "Validate configuration and detect issues",
|
|
59
|
+
schemaFile: "config-validator.json",
|
|
60
|
+
},
|
|
61
|
+
llm_status: {
|
|
62
|
+
summary: "Check LLM/Ollama configuration and availability",
|
|
63
|
+
schemaFile: "llm-status.json",
|
|
64
|
+
},
|
|
65
|
+
get_actionable_signals: {
|
|
66
|
+
summary: "Classify content into actionable signals with priority levels",
|
|
67
|
+
schemaFile: "get-actionable-signals.json",
|
|
68
|
+
},
|
|
69
|
+
// Innovation Feature Tools
|
|
70
|
+
export_context_packet: {
|
|
71
|
+
summary: "Generate portable context packet for session handoff",
|
|
72
|
+
schemaFile: "export-context.json",
|
|
73
|
+
},
|
|
74
|
+
knowledge_gaps: {
|
|
75
|
+
summary: "Detect knowledge gaps in your project dependencies",
|
|
76
|
+
schemaFile: "knowledge-gaps.json",
|
|
77
|
+
},
|
|
78
|
+
signal_chains: {
|
|
79
|
+
summary: "Get causal signal chains connecting related events over time",
|
|
80
|
+
schemaFile: "signal-chains.json",
|
|
81
|
+
},
|
|
82
|
+
semantic_shifts: {
|
|
83
|
+
summary: "Detect narrative shifts in topics you follow",
|
|
84
|
+
schemaFile: "semantic-shifts.json",
|
|
85
|
+
},
|
|
86
|
+
reverse_mentions: {
|
|
87
|
+
summary: "Find where your projects are mentioned in sources",
|
|
88
|
+
schemaFile: "reverse-mentions.json",
|
|
89
|
+
},
|
|
90
|
+
attention_report: {
|
|
91
|
+
summary: "Analyze attention allocation vs codebase needs",
|
|
92
|
+
schemaFile: "attention-report.json",
|
|
93
|
+
},
|
|
94
|
+
project_health: {
|
|
95
|
+
summary: "Project health radar for dependency freshness and security",
|
|
96
|
+
schemaFile: "project-health.json",
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* Get slim tool list for list_tools response
|
|
101
|
+
* Returns minimal schema (just type: object) - full schema via resources
|
|
102
|
+
*/
|
|
103
|
+
export function getSlimToolList() {
|
|
104
|
+
return Object.entries(TOOL_REGISTRY).map(([name, info]) => ({
|
|
105
|
+
name,
|
|
106
|
+
description: info.summary,
|
|
107
|
+
inputSchema: { type: "object" },
|
|
108
|
+
}));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get list of schema resources for ListResources
|
|
112
|
+
*/
|
|
113
|
+
export function getSchemaResources() {
|
|
114
|
+
return Object.entries(TOOL_REGISTRY).map(([name, info]) => ({
|
|
115
|
+
uri: `4da://schema/${name}`,
|
|
116
|
+
name: `${name} schema`,
|
|
117
|
+
description: `Full JSON Schema for the ${name} tool`,
|
|
118
|
+
mimeType: "application/json",
|
|
119
|
+
}));
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Check if a tool exists
|
|
123
|
+
*/
|
|
124
|
+
export function hasToolSchema(toolName) {
|
|
125
|
+
return toolName in TOOL_REGISTRY;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get schema filename for a tool
|
|
129
|
+
*/
|
|
130
|
+
export function getSchemaFilename(toolName) {
|
|
131
|
+
return TOOL_REGISTRY[toolName]?.schemaFile || null;
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=schema-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema-registry.js","sourceRoot":"","sources":["../src/schema-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAA4D;IACpF,aAAa;IACb,oBAAoB,EAAE;QACpB,OAAO,EAAE,mDAAmD;QAC5D,UAAU,EAAE,2BAA2B;KACxC;IACD,WAAW,EAAE;QACX,OAAO,EAAE,sDAAsD;QAC/D,UAAU,EAAE,kBAAkB;KAC/B;IACD,iBAAiB,EAAE;QACjB,OAAO,EAAE,8CAA8C;QACvD,UAAU,EAAE,wBAAwB;KACrC;IACD,eAAe,EAAE;QACf,OAAO,EAAE,wDAAwD;QACjE,UAAU,EAAE,sBAAsB;KACnC;IAED,mBAAmB;IACnB,aAAa,EAAE;QACb,OAAO,EAAE,yDAAyD;QAClE,UAAU,EAAE,oBAAoB;KACjC;IACD,cAAc,EAAE;QACd,OAAO,EAAE,+DAA+D;QACxE,UAAU,EAAE,qBAAqB;KAClC;IACD,cAAc,EAAE;QACd,OAAO,EAAE,+CAA+C;QACxD,UAAU,EAAE,qBAAqB;KAClC;IACD,gBAAgB,EAAE;QAChB,OAAO,EAAE,yDAAyD;QAClE,UAAU,EAAE,uBAAuB;KACpC;IACD,aAAa,EAAE;QACb,OAAO,EAAE,kDAAkD;QAC3D,UAAU,EAAE,oBAAoB;KACjC;IACD,iBAAiB,EAAE;QACjB,OAAO,EAAE,kDAAkD;QAC3D,UAAU,EAAE,wBAAwB;KACrC;IACD,gBAAgB,EAAE;QAChB,OAAO,EAAE,0CAA0C;QACnD,UAAU,EAAE,uBAAuB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C3B,IAAI,EAAE,GAAG,IAAI,SAAS;QACtB,WAAW,EAAE,4BAA4B,IAAI,OAAO;QACpD,QAAQ,EAAE,kBAAkB;KAC7B,CAAC,CAAC,CAAC;AACN,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,QAAgB;IAC5C,OAAO,QAAQ,IAAI,aAAa,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAgB;IAChD,OAAO,aAAa,CAAC,QAAQ,CAAC,EAAE,UAAU,IAAI,IAAI,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "config_validator",
|
|
3
|
+
"description": "Validate 4DA configuration and detect issues.\nReturns:\n- Schema validation results\n- Missing required fields\n- Invalid values detected\n- Cross-field consistency checks\n- Recommendations for fixes\n\nUse this when things aren't working as expected.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"section": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"enum": ["all", "sources", "embedding", "llm", "ace", "digest", "ui"],
|
|
10
|
+
"description": "Config section to validate (default: all)"
|
|
11
|
+
},
|
|
12
|
+
"fix_suggestions": {
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"description": "Include fix suggestions (default: true)"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "context_analysis",
|
|
3
|
+
"description": "Analyze your 4DA context and get optimization recommendations.\n\nWith synthesize=true (recommended), uses AI for personalized optimization advice.\n\nReturns:\n- Current context summary (tech stack, interests, topics)\n- Context quality score\n- Coverage gaps (what you care about but isn't tracked)\n- AI-powered personalized recommendations (when enabled)\n\nUse this to tune 4DA for better personalization.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"include_recommendations": {
|
|
8
|
+
"type": "boolean",
|
|
9
|
+
"description": "Include optimization recommendations (default: true)"
|
|
10
|
+
},
|
|
11
|
+
"analyze_gaps": {
|
|
12
|
+
"type": "boolean",
|
|
13
|
+
"description": "Analyze coverage gaps (default: true)"
|
|
14
|
+
},
|
|
15
|
+
"synthesize": {
|
|
16
|
+
"type": "boolean",
|
|
17
|
+
"description": "Use AI for personalized advice (default: true if LLM configured)"
|
|
18
|
+
},
|
|
19
|
+
"compact": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"description": "Return compact result with file reference (default: true for ~80% token reduction)"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "daily_briefing",
|
|
3
|
+
"description": "Generate an executive briefing from 4DA's recent discoveries.\n\nWith synthesize=true (recommended), uses AI to generate genuine insights tailored to your context.\n\nReturns:\n- TL;DR summary (AI-generated when synthesize=true)\n- Key themes with item counts\n- Notable high-scoring items\n- Actionable recommendations\n- Trend highlights\n- AI synthesis (when enabled)\n\nUse this for your daily/weekly content review.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"hours": {
|
|
8
|
+
"type": "number",
|
|
9
|
+
"description": "Hours to look back (default: 24)"
|
|
10
|
+
},
|
|
11
|
+
"min_score": {
|
|
12
|
+
"type": "number",
|
|
13
|
+
"description": "Minimum relevance score (default: 0.5)"
|
|
14
|
+
},
|
|
15
|
+
"max_items": {
|
|
16
|
+
"type": "number",
|
|
17
|
+
"description": "Maximum items to analyze (default: 50)"
|
|
18
|
+
},
|
|
19
|
+
"format": {
|
|
20
|
+
"type": "string",
|
|
21
|
+
"enum": ["full", "brief", "actionable"],
|
|
22
|
+
"description": "Output format (default: full)"
|
|
23
|
+
},
|
|
24
|
+
"synthesize": {
|
|
25
|
+
"type": "boolean",
|
|
26
|
+
"description": "Use AI to generate genuine insights (default: true if LLM configured)"
|
|
27
|
+
},
|
|
28
|
+
"compact": {
|
|
29
|
+
"type": "boolean",
|
|
30
|
+
"description": "Return compact result with file reference (default: true for ~80% token reduction)"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "explain_relevance",
|
|
3
|
+
"description": "Explain why a content item was considered relevant.\n\nProvides a detailed breakdown of:\n- Score components (static match, ACE context, learned preferences, penalties)\n- Matching context elements (interests, tech, topics, affinities)\n- Human-readable explanation\n\nUse this to understand how 4DA scored a particular item.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"item_id": {
|
|
8
|
+
"type": "number",
|
|
9
|
+
"description": "The database ID of the item to explain"
|
|
10
|
+
},
|
|
11
|
+
"source_type": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "The source type: \"hackernews\", \"arxiv\", or \"reddit\"",
|
|
14
|
+
"enum": ["hackernews", "arxiv", "reddit"]
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": ["item_id", "source_type"]
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "get_actionable_signals",
|
|
3
|
+
"description": "Classify content into actionable signal types (security_alert, breaking_change, tool_discovery, tech_trend, learning, competitive_intel) with priority levels. Cross-references against user's tech stack.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"priority_filter": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Filter by priority level",
|
|
10
|
+
"enum": ["critical", "high", "medium", "low"]
|
|
11
|
+
},
|
|
12
|
+
"signal_type": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"description": "Filter by signal type",
|
|
15
|
+
"enum": ["security_alert", "breaking_change", "tool_discovery", "tech_trend", "learning", "competitive_intel"]
|
|
16
|
+
},
|
|
17
|
+
"limit": {
|
|
18
|
+
"type": "number",
|
|
19
|
+
"description": "Maximum signals to return (default: 20, max: 100)",
|
|
20
|
+
"default": 20
|
|
21
|
+
},
|
|
22
|
+
"since_hours": {
|
|
23
|
+
"type": "number",
|
|
24
|
+
"description": "Only include items from last N hours (default: 48)",
|
|
25
|
+
"default": 48
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "get_context",
|
|
3
|
+
"description": "Get the user's context - what 4DA knows about them.\n\nReturns information about:\n- Static Identity: User-declared role, tech stack, domains, interests, and exclusions\n- ACE Context (optional): Auto-detected technologies and active topics from recent activity\n- Learned Preferences (optional): Topic affinities learned from user behavior\n\nUse this to understand what the user is working on and interested in.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"include_ace": {
|
|
8
|
+
"type": "boolean",
|
|
9
|
+
"description": "Include ACE-detected context (detected tech, active topics). Default: true"
|
|
10
|
+
},
|
|
11
|
+
"include_learned": {
|
|
12
|
+
"type": "boolean",
|
|
13
|
+
"description": "Include learned preferences (topic affinities, anti-topics). Default: true"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "get_relevant_content",
|
|
3
|
+
"description": "Get filtered relevant content from 4DA's personalized feed.\n\nReturns content items that match the user's interests, tech stack, and learned preferences.\nItems are scored based on:\n- Explicit interests declared by the user\n- Tech stack and domains\n- ACE-detected context (recent files, projects, git activity)\n- Learned preferences from past interactions\n\nUse this to find content relevant to the user's current context.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"min_score": {
|
|
8
|
+
"type": "number",
|
|
9
|
+
"description": "Minimum relevance score (0.0-1.0). Default: 0.35"
|
|
10
|
+
},
|
|
11
|
+
"source_type": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Filter by source type: \"hackernews\", \"arxiv\", or \"reddit\". Leave empty for all sources.",
|
|
14
|
+
"enum": ["hackernews", "arxiv", "reddit"]
|
|
15
|
+
},
|
|
16
|
+
"limit": {
|
|
17
|
+
"type": "number",
|
|
18
|
+
"description": "Maximum number of items to return. Default: 20, max: 100"
|
|
19
|
+
},
|
|
20
|
+
"since_hours": {
|
|
21
|
+
"type": "number",
|
|
22
|
+
"description": "Only include items discovered in the last N hours. Default: 24"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "llm_status",
|
|
3
|
+
"description": "Check LLM configuration and availability.\nReturns:\n- Current LLM provider configuration\n- Ollama status (if configured)\n- Available models\n- Recommended models for your hardware\n- Configuration recommendations\n\nUse this to diagnose AI synthesis issues.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"check_ollama": {
|
|
8
|
+
"type": "boolean",
|
|
9
|
+
"description": "Check Ollama connectivity (default: true)"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "record_feedback",
|
|
3
|
+
"description": "Record user feedback on a content item.\n\nFeedback actions:\n- \"click\": User clicked/opened the item (moderate positive signal)\n- \"save\": User saved/bookmarked the item (strong positive signal)\n- \"dismiss\": User dismissed the item (weak negative signal)\n- \"mark_irrelevant\": User marked item as not relevant (strong negative signal)\n\nThis feedback helps 4DA learn user preferences over time.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"item_id": {
|
|
8
|
+
"type": "number",
|
|
9
|
+
"description": "The database ID of the item"
|
|
10
|
+
},
|
|
11
|
+
"source_type": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "The source type: \"hackernews\", \"arxiv\", or \"reddit\"",
|
|
14
|
+
"enum": ["hackernews", "arxiv", "reddit"]
|
|
15
|
+
},
|
|
16
|
+
"action": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"description": "The feedback action: \"click\", \"save\", \"dismiss\", or \"mark_irrelevant\"",
|
|
19
|
+
"enum": ["click", "save", "dismiss", "mark_irrelevant"]
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"required": ["item_id", "source_type", "action"]
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "score_autopsy",
|
|
3
|
+
"description": "Perform a complete forensic analysis of why an item scored the way it did.\n\nWith synthesize=true (recommended), uses AI to explain whether the score seems correct.\n\nReturns:\n- Component-by-component score breakdown\n- Matching context (interests, tech, topics)\n- Comparison with similar items\n- Recommendations for improving relevance\n- AI analysis (when enabled)\n\nUse this when you need to understand or debug relevance scores.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"item_id": {
|
|
8
|
+
"type": "number",
|
|
9
|
+
"description": "The item ID to analyze"
|
|
10
|
+
},
|
|
11
|
+
"source_type": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"description": "Source type (e.g., 'hackernews', 'arxiv')"
|
|
14
|
+
},
|
|
15
|
+
"compare_count": {
|
|
16
|
+
"type": "number",
|
|
17
|
+
"description": "Number of similar items to compare (default: 5)"
|
|
18
|
+
},
|
|
19
|
+
"synthesize": {
|
|
20
|
+
"type": "boolean",
|
|
21
|
+
"description": "Use AI to analyze if the score makes sense (default: true if LLM configured)"
|
|
22
|
+
},
|
|
23
|
+
"compact": {
|
|
24
|
+
"type": "boolean",
|
|
25
|
+
"description": "Return compact result with file reference (default: true for ~80% token reduction)"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"required": ["item_id", "source_type"]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "source_health",
|
|
3
|
+
"description": "Diagnose the health of 4DA's content sources.\nReturns:\n- Per-source status (healthy/degraded/failing)\n- Recent fetch statistics\n- Data quality metrics\n- Error patterns detected\n- Recommendations for fixes\n\nUse this when content seems stale or sources aren't working.",
|
|
4
|
+
"inputSchema": {
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"source": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "Specific source to analyze (optional, all if not specified)"
|
|
10
|
+
},
|
|
11
|
+
"hours": {
|
|
12
|
+
"type": "number",
|
|
13
|
+
"description": "Hours to analyze (default: 24)"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|