@4da/mcp-server 4.3.0 → 4.6.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 +61 -81
- package/dist/db.d.ts +12 -1
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +71 -8
- package/dist/db.js.map +1 -1
- package/dist/index.d.ts +9 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -17
- package/dist/index.js.map +1 -1
- package/dist/live/crates-registry.d.ts +18 -0
- package/dist/live/crates-registry.d.ts.map +1 -0
- package/dist/live/crates-registry.js +133 -0
- package/dist/live/crates-registry.js.map +1 -0
- package/dist/live/go-registry.d.ts +19 -0
- package/dist/live/go-registry.d.ts.map +1 -0
- package/dist/live/go-registry.js +127 -0
- package/dist/live/go-registry.js.map +1 -0
- package/dist/live/http-utils.d.ts +3 -0
- package/dist/live/http-utils.d.ts.map +1 -0
- package/dist/live/http-utils.js +20 -0
- package/dist/live/http-utils.js.map +1 -0
- package/dist/live/index.d.ts +7 -2
- package/dist/live/index.d.ts.map +1 -1
- package/dist/live/index.js +71 -0
- package/dist/live/index.js.map +1 -1
- package/dist/live/npm-registry.d.ts +19 -0
- package/dist/live/npm-registry.d.ts.map +1 -0
- package/dist/live/npm-registry.js +132 -0
- package/dist/live/npm-registry.js.map +1 -0
- package/dist/live/osv-scanner.d.ts.map +1 -1
- package/dist/live/osv-scanner.js +1 -10
- package/dist/live/osv-scanner.js.map +1 -1
- package/dist/live/pypi-registry.d.ts +18 -0
- package/dist/live/pypi-registry.d.ts.map +1 -0
- package/dist/live/pypi-registry.js +142 -0
- package/dist/live/pypi-registry.js.map +1 -0
- package/dist/live/rate-limiter.d.ts +12 -0
- package/dist/live/rate-limiter.d.ts.map +1 -1
- package/dist/live/rate-limiter.js +4 -0
- package/dist/live/rate-limiter.js.map +1 -1
- package/dist/live/semver-utils.d.ts +5 -0
- package/dist/live/semver-utils.d.ts.map +1 -0
- package/dist/live/semver-utils.js +28 -0
- package/dist/live/semver-utils.js.map +1 -0
- package/dist/live/types.d.ts +41 -0
- package/dist/live/types.d.ts.map +1 -1
- package/dist/schema-registry.d.ts +4 -2
- package/dist/schema-registry.d.ts.map +1 -1
- package/dist/schema-registry.js +55 -221
- package/dist/schema-registry.js.map +1 -1
- package/dist/schemas/dependency-health.json +27 -0
- package/dist/schemas/upgrade-planner.json +22 -0
- package/dist/tool-dispatch.d.ts +1 -7
- package/dist/tool-dispatch.d.ts.map +1 -1
- package/dist/tool-dispatch.js +14 -46
- package/dist/tool-dispatch.js.map +1 -1
- package/dist/tools/dependency-health.d.ts +45 -0
- package/dist/tools/dependency-health.d.ts.map +1 -0
- package/dist/tools/dependency-health.js +152 -0
- package/dist/tools/dependency-health.js.map +1 -0
- package/dist/tools/index.d.ts +13 -40
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +18 -52
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/upgrade-planner.d.ts +59 -0
- package/dist/tools/upgrade-planner.d.ts.map +1 -0
- package/dist/tools/upgrade-planner.js +167 -0
- package/dist/tools/upgrade-planner.js.map +1 -0
- package/dist/tools/what-should-i-know.d.ts +4 -12
- package/dist/tools/what-should-i-know.d.ts.map +1 -1
- package/dist/tools/what-should-i-know.js +11 -102
- package/dist/tools/what-should-i-know.js.map +1 -1
- package/package.json +2 -2
- package/dist/schemas/agent-feedback-stats.json +0 -14
- package/dist/schemas/agent-session-brief.json +0 -25
- package/dist/schemas/attention-report.json +0 -13
- package/dist/schemas/autophagy-status.json +0 -13
- package/dist/schemas/compound-advantage.json +0 -14
- package/dist/schemas/config-validator.json +0 -18
- package/dist/schemas/context-analysis.json +0 -25
- package/dist/schemas/daily-briefing.json +0 -34
- package/dist/schemas/decision-windows.json +0 -22
- package/dist/schemas/delegation-score.json +0 -18
- package/dist/schemas/explain-relevance.json +0 -19
- package/dist/schemas/export-context.json +0 -17
- package/dist/schemas/llm-status.json +0 -13
- package/dist/schemas/preemption-feed.json +0 -18
- package/dist/schemas/project-health.json +0 -13
- package/dist/schemas/record-agent-feedback.json +0 -28
- package/dist/schemas/reverse-mentions.json +0 -13
- package/dist/schemas/score-autopsy.json +0 -30
- package/dist/schemas/semantic-shifts.json +0 -17
- package/dist/schemas/signal-chains.json +0 -19
- package/dist/schemas/source-health.json +0 -17
- package/dist/schemas/tech-radar.json +0 -23
- package/dist/schemas/topic-connections.json +0 -34
- package/dist/schemas/trend-analysis.json +0 -29
- package/dist/schemas/trust-summary.json +0 -13
- package/dist/tools/agent-feedback-stats.d.ts +0 -30
- package/dist/tools/agent-feedback-stats.d.ts.map +0 -1
- package/dist/tools/agent-feedback-stats.js +0 -41
- package/dist/tools/agent-feedback-stats.js.map +0 -1
- package/dist/tools/agent-session-brief.d.ts +0 -44
- package/dist/tools/agent-session-brief.d.ts.map +0 -1
- package/dist/tools/agent-session-brief.js +0 -179
- package/dist/tools/agent-session-brief.js.map +0 -1
- package/dist/tools/attention-report.d.ts +0 -40
- package/dist/tools/attention-report.d.ts.map +0 -1
- package/dist/tools/attention-report.js +0 -73
- package/dist/tools/attention-report.js.map +0 -1
- package/dist/tools/autophagy-status.d.ts +0 -25
- package/dist/tools/autophagy-status.d.ts.map +0 -1
- package/dist/tools/autophagy-status.js +0 -56
- package/dist/tools/autophagy-status.js.map +0 -1
- package/dist/tools/compound-advantage.d.ts +0 -30
- package/dist/tools/compound-advantage.d.ts.map +0 -1
- package/dist/tools/compound-advantage.js +0 -133
- package/dist/tools/compound-advantage.js.map +0 -1
- package/dist/tools/config-validator.d.ts +0 -59
- package/dist/tools/config-validator.d.ts.map +0 -1
- package/dist/tools/config-validator.js +0 -417
- package/dist/tools/config-validator.js.map +0 -1
- package/dist/tools/context-analysis.d.ts +0 -108
- package/dist/tools/context-analysis.d.ts.map +0 -1
- package/dist/tools/context-analysis.js +0 -301
- package/dist/tools/context-analysis.js.map +0 -1
- package/dist/tools/daily-briefing.d.ts +0 -103
- package/dist/tools/daily-briefing.d.ts.map +0 -1
- package/dist/tools/daily-briefing.js +0 -294
- package/dist/tools/daily-briefing.js.map +0 -1
- package/dist/tools/decision-windows.d.ts +0 -37
- package/dist/tools/decision-windows.d.ts.map +0 -1
- package/dist/tools/decision-windows.js +0 -67
- package/dist/tools/decision-windows.js.map +0 -1
- package/dist/tools/delegation-score.d.ts +0 -34
- package/dist/tools/delegation-score.d.ts.map +0 -1
- package/dist/tools/delegation-score.js +0 -260
- package/dist/tools/delegation-score.js.map +0 -1
- package/dist/tools/explain-relevance.d.ts +0 -36
- package/dist/tools/explain-relevance.d.ts.map +0 -1
- package/dist/tools/explain-relevance.js +0 -51
- package/dist/tools/explain-relevance.js.map +0 -1
- package/dist/tools/export-context.d.ts +0 -60
- package/dist/tools/export-context.d.ts.map +0 -1
- package/dist/tools/export-context.js +0 -179
- package/dist/tools/export-context.js.map +0 -1
- package/dist/tools/llm-status.d.ts +0 -45
- package/dist/tools/llm-status.d.ts.map +0 -1
- package/dist/tools/llm-status.js +0 -93
- package/dist/tools/llm-status.js.map +0 -1
- package/dist/tools/muse-context.d.ts +0 -195
- package/dist/tools/muse-context.d.ts.map +0 -1
- package/dist/tools/muse-context.js +0 -284
- package/dist/tools/muse-context.js.map +0 -1
- package/dist/tools/preemption-feed.d.ts +0 -55
- package/dist/tools/preemption-feed.d.ts.map +0 -1
- package/dist/tools/preemption-feed.js +0 -124
- package/dist/tools/preemption-feed.js.map +0 -1
- package/dist/tools/project-health.d.ts +0 -53
- package/dist/tools/project-health.d.ts.map +0 -1
- package/dist/tools/project-health.js +0 -122
- package/dist/tools/project-health.js.map +0 -1
- package/dist/tools/record-agent-feedback.d.ts +0 -46
- package/dist/tools/record-agent-feedback.d.ts.map +0 -1
- package/dist/tools/record-agent-feedback.js +0 -71
- package/dist/tools/record-agent-feedback.js.map +0 -1
- package/dist/tools/reverse-mentions.d.ts +0 -38
- package/dist/tools/reverse-mentions.d.ts.map +0 -1
- package/dist/tools/reverse-mentions.js +0 -75
- package/dist/tools/reverse-mentions.js.map +0 -1
- package/dist/tools/score-autopsy.d.ts +0 -93
- package/dist/tools/score-autopsy.d.ts.map +0 -1
- package/dist/tools/score-autopsy.js +0 -295
- package/dist/tools/score-autopsy.js.map +0 -1
- package/dist/tools/semantic-shifts.d.ts +0 -53
- package/dist/tools/semantic-shifts.d.ts.map +0 -1
- package/dist/tools/semantic-shifts.js +0 -74
- package/dist/tools/semantic-shifts.js.map +0 -1
- package/dist/tools/signal-chains.d.ts +0 -52
- package/dist/tools/signal-chains.d.ts.map +0 -1
- package/dist/tools/signal-chains.js +0 -63
- package/dist/tools/signal-chains.js.map +0 -1
- package/dist/tools/source-health.d.ts +0 -64
- package/dist/tools/source-health.d.ts.map +0 -1
- package/dist/tools/source-health.js +0 -205
- package/dist/tools/source-health.js.map +0 -1
- package/dist/tools/tech-radar.d.ts +0 -38
- package/dist/tools/tech-radar.d.ts.map +0 -1
- package/dist/tools/tech-radar.js +0 -249
- package/dist/tools/tech-radar.js.map +0 -1
- package/dist/tools/topic-connections.d.ts +0 -112
- package/dist/tools/topic-connections.d.ts.map +0 -1
- package/dist/tools/topic-connections.js +0 -319
- package/dist/tools/topic-connections.js.map +0 -1
- package/dist/tools/trend-analysis.d.ts +0 -105
- package/dist/tools/trend-analysis.d.ts.map +0 -1
- package/dist/tools/trend-analysis.js +0 -296
- package/dist/tools/trend-analysis.js.map +0 -1
- package/dist/tools/trust-summary.d.ts +0 -38
- package/dist/tools/trust-summary.d.ts.map +0 -1
- package/dist/tools/trust-summary.js +0 -89
- package/dist/tools/trust-summary.js.map +0 -1
|
@@ -1,19 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "topic_connections",
|
|
3
|
-
"description": "Discover connections between topics in your content.\n\nWith synthesize=true (recommended), uses AI to explain the significance of connections.\n\nReturns:\n- Topic co-occurrence graph\n- Strongest topic relationships\n- Central/hub topics\n- Path finding between topics\n- AI insights about connections (when enabled)\n\nUse this to understand how your interests connect.",
|
|
4
|
-
"inputSchema": {
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"topics": {
|
|
8
|
-
"type": "array",
|
|
9
|
-
"items": { "type": "string" },
|
|
10
|
-
"description": "Specific topics to analyze (optional, auto-detect if not specified)"
|
|
11
|
-
},
|
|
12
|
-
"find_path": {
|
|
13
|
-
"type": "object",
|
|
14
|
-
"properties": {
|
|
15
|
-
"from": { "type": "string" },
|
|
16
|
-
"to": { "type": "string" }
|
|
17
|
-
},
|
|
18
|
-
"description": "Find connection path between two topics"
|
|
19
|
-
},
|
|
20
|
-
"days": {
|
|
21
|
-
"type": "number",
|
|
22
|
-
"description": "Days of content to analyze (default: 30)"
|
|
23
|
-
},
|
|
24
|
-
"synthesize": {
|
|
25
|
-
"type": "boolean",
|
|
26
|
-
"description": "Use AI to explain connection significance (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
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "trend_analysis",
|
|
3
|
-
"description": "Analyze patterns and trends in 4DA's content over time.\n\nWith synthesize=true (recommended), uses AI to interpret trends and predict what matters.\n\nReturns:\n- Topic frequency trends (rising/falling)\n- Volume anomalies detected\n- Week-over-week comparisons\n- Source performance trends\n- AI predictions (when enabled)\n\nUse this to understand what's changing in your information landscape.",
|
|
4
|
-
"inputSchema": {
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"days": {
|
|
8
|
-
"type": "number",
|
|
9
|
-
"description": "Analysis period in days (default: 30)"
|
|
10
|
-
},
|
|
11
|
-
"topic": {
|
|
12
|
-
"type": "string",
|
|
13
|
-
"description": "Specific topic to analyze (optional)"
|
|
14
|
-
},
|
|
15
|
-
"detect_anomalies": {
|
|
16
|
-
"type": "boolean",
|
|
17
|
-
"description": "Include anomaly detection (default: true)"
|
|
18
|
-
},
|
|
19
|
-
"synthesize": {
|
|
20
|
-
"type": "boolean",
|
|
21
|
-
"description": "Use AI to interpret trends and predict (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
|
-
}
|
|
29
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "trust_summary",
|
|
3
|
-
"description": "Get intelligence quality metrics — precision, action conversion rate, false positive rate, and preemption wins.\n\nReturns trust ledger data for a configurable time window. Use this to assess how reliable 4DA's signals are before acting on them.",
|
|
4
|
-
"inputSchema": {
|
|
5
|
-
"type": "object",
|
|
6
|
-
"properties": {
|
|
7
|
-
"days": {
|
|
8
|
-
"type": "number",
|
|
9
|
-
"description": "Number of days to analyze. Default: 30"
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* get_agent_feedback_stats tool
|
|
3
|
-
*
|
|
4
|
-
* Get statistics on how agents have used 4DA recommendations.
|
|
5
|
-
* Shows which sources and topics are most valuable for AI-assisted development.
|
|
6
|
-
*/
|
|
7
|
-
import type { FourDADatabase } from "../db.js";
|
|
8
|
-
import type { GetAgentFeedbackStatsParams, AgentFeedbackStats } from "../types.js";
|
|
9
|
-
/**
|
|
10
|
-
* Tool definition for MCP registration
|
|
11
|
-
*/
|
|
12
|
-
export declare const agentFeedbackStatsTool: {
|
|
13
|
-
name: string;
|
|
14
|
-
description: string;
|
|
15
|
-
inputSchema: {
|
|
16
|
-
type: "object";
|
|
17
|
-
properties: {
|
|
18
|
-
days: {
|
|
19
|
-
type: string;
|
|
20
|
-
description: string;
|
|
21
|
-
default: number;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Execute the get_agent_feedback_stats tool
|
|
28
|
-
*/
|
|
29
|
-
export declare function executeGetAgentFeedbackStats(db: FourDADatabase, params: GetAgentFeedbackStatsParams): AgentFeedbackStats;
|
|
30
|
-
//# sourceMappingURL=agent-feedback-stats.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-feedback-stats.d.ts","sourceRoot":"","sources":["../../src/tools/agent-feedback-stats.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEnF;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;CAsBlC,CAAC;AAEF;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,EAAE,EAAE,cAAc,EAClB,MAAM,EAAE,2BAA2B,GAClC,kBAAkB,CAGpB"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: FSL-1.1-Apache-2.0
|
|
2
|
-
/**
|
|
3
|
-
* get_agent_feedback_stats tool
|
|
4
|
-
*
|
|
5
|
-
* Get statistics on how agents have used 4DA recommendations.
|
|
6
|
-
* Shows which sources and topics are most valuable for AI-assisted development.
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Tool definition for MCP registration
|
|
10
|
-
*/
|
|
11
|
-
export const agentFeedbackStatsTool = {
|
|
12
|
-
name: "get_agent_feedback_stats",
|
|
13
|
-
description: `Get statistics on how agents have used 4DA recommendations.
|
|
14
|
-
|
|
15
|
-
Shows which sources and topics are most valuable for AI-assisted development:
|
|
16
|
-
- Total recommendations: used / rejected / partially_used counts
|
|
17
|
-
- By source type: which sources produce the most agent-useful content
|
|
18
|
-
- Top used item IDs (most frequently recommended and accepted)
|
|
19
|
-
- Recent feedback entries
|
|
20
|
-
|
|
21
|
-
Use this to understand what content is actually being used by AI agents
|
|
22
|
-
and where PASIFA scoring can be improved.`,
|
|
23
|
-
inputSchema: {
|
|
24
|
-
type: "object",
|
|
25
|
-
properties: {
|
|
26
|
-
days: {
|
|
27
|
-
type: "number",
|
|
28
|
-
description: "Number of days to look back (default: 30, max: 365)",
|
|
29
|
-
default: 30,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Execute the get_agent_feedback_stats tool
|
|
36
|
-
*/
|
|
37
|
-
export function executeGetAgentFeedbackStats(db, params) {
|
|
38
|
-
const days = Math.max(1, Math.min(365, params.days ?? 30));
|
|
39
|
-
return db.getAgentFeedbackStats(days);
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=agent-feedback-stats.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-feedback-stats.js","sourceRoot":"","sources":["../../src/tools/agent-feedback-stats.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C;;;;;GAKG;AAKH;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,IAAI,EAAE,0BAA0B;IAChC,WAAW,EAAE;;;;;;;;;0CAS2B;IACxC,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qDAAqD;gBAClE,OAAO,EAAE,EAAE;aACZ;SACF;KACF;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,4BAA4B,CAC1C,EAAkB,EAClB,MAAmC;IAEnC,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3D,OAAO,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* agent_session_brief tool
|
|
3
|
-
*
|
|
4
|
-
* Tailored session startup context for AI agents.
|
|
5
|
-
* Call at the START of every agent session to get caught up on:
|
|
6
|
-
* - Active developer decisions
|
|
7
|
-
* - Ecosystem changes (security, breaking, releases)
|
|
8
|
-
* - Recent agent memories from all agents
|
|
9
|
-
* - Latest briefing text
|
|
10
|
-
*/
|
|
11
|
-
import type { FourDADatabase } from "../db.js";
|
|
12
|
-
export interface AgentSessionBriefParams {
|
|
13
|
-
agent_type?: string;
|
|
14
|
-
since?: string;
|
|
15
|
-
include_decisions?: boolean;
|
|
16
|
-
include_memories?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export declare const agentSessionBriefTool: {
|
|
19
|
-
name: string;
|
|
20
|
-
description: string;
|
|
21
|
-
inputSchema: {
|
|
22
|
-
type: "object";
|
|
23
|
-
properties: {
|
|
24
|
-
agent_type: {
|
|
25
|
-
type: string;
|
|
26
|
-
description: string;
|
|
27
|
-
};
|
|
28
|
-
since: {
|
|
29
|
-
type: string;
|
|
30
|
-
description: string;
|
|
31
|
-
};
|
|
32
|
-
include_decisions: {
|
|
33
|
-
type: string;
|
|
34
|
-
description: string;
|
|
35
|
-
};
|
|
36
|
-
include_memories: {
|
|
37
|
-
type: string;
|
|
38
|
-
description: string;
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
export declare function executeAgentSessionBrief(db: FourDADatabase, params: AgentSessionBriefParams): object;
|
|
44
|
-
//# sourceMappingURL=agent-session-brief.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-session-brief.d.ts","sourceRoot":"","sources":["../../src/tools/agent-session-brief.ts"],"names":[],"mappings":"AACA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAM/C,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAmCD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;CA2BjC,CAAC;AAMF,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,cAAc,EAClB,MAAM,EAAE,uBAAuB,GAC9B,MAAM,CAwJR"}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: FSL-1.1-Apache-2.0
|
|
2
|
-
/**
|
|
3
|
-
* agent_session_brief tool
|
|
4
|
-
*
|
|
5
|
-
* Tailored session startup context for AI agents.
|
|
6
|
-
* Call at the START of every agent session to get caught up on:
|
|
7
|
-
* - Active developer decisions
|
|
8
|
-
* - Ecosystem changes (security, breaking, releases)
|
|
9
|
-
* - Recent agent memories from all agents
|
|
10
|
-
* - Latest briefing text
|
|
11
|
-
*/
|
|
12
|
-
// ============================================================================
|
|
13
|
-
// Tool Definition
|
|
14
|
-
// ============================================================================
|
|
15
|
-
export const agentSessionBriefTool = {
|
|
16
|
-
name: "agent_session_brief",
|
|
17
|
-
description: "Tailored session startup context for AI agents. Returns active decisions, ecosystem changes, recent agent memories, and latest briefing. Call at START of every agent session.",
|
|
18
|
-
inputSchema: {
|
|
19
|
-
type: "object",
|
|
20
|
-
properties: {
|
|
21
|
-
agent_type: {
|
|
22
|
-
type: "string",
|
|
23
|
-
description: "Agent identifier (e.g. claude_code, cursor). Filters memories to this agent if provided.",
|
|
24
|
-
},
|
|
25
|
-
since: {
|
|
26
|
-
type: "string",
|
|
27
|
-
description: "ISO datetime to look back from. Default: 24 hours ago.",
|
|
28
|
-
},
|
|
29
|
-
include_decisions: {
|
|
30
|
-
type: "boolean",
|
|
31
|
-
description: "Include active developer decisions. Default: true.",
|
|
32
|
-
},
|
|
33
|
-
include_memories: {
|
|
34
|
-
type: "boolean",
|
|
35
|
-
description: "Include recent agent memories. Default: true.",
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
// ============================================================================
|
|
41
|
-
// Execute
|
|
42
|
-
// ============================================================================
|
|
43
|
-
export function executeAgentSessionBrief(db, params) {
|
|
44
|
-
const rawDb = db.getRawDb();
|
|
45
|
-
const agentType = params.agent_type || "unknown";
|
|
46
|
-
const since = params.since ||
|
|
47
|
-
new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
|
|
48
|
-
const includeDecisions = params.include_decisions !== false;
|
|
49
|
-
const includeMemories = params.include_memories !== false;
|
|
50
|
-
// 1. Active decisions
|
|
51
|
-
let activeDecisions = [];
|
|
52
|
-
if (includeDecisions) {
|
|
53
|
-
try {
|
|
54
|
-
const rows = rawDb
|
|
55
|
-
.prepare(`SELECT id, subject, decision, decision_type, confidence
|
|
56
|
-
FROM developer_decisions
|
|
57
|
-
WHERE status = 'active'
|
|
58
|
-
ORDER BY confidence DESC
|
|
59
|
-
LIMIT 20`)
|
|
60
|
-
.all();
|
|
61
|
-
activeDecisions = rows.map((r) => ({
|
|
62
|
-
id: r.id,
|
|
63
|
-
subject: r.subject,
|
|
64
|
-
decision: r.decision,
|
|
65
|
-
type: r.decision_type,
|
|
66
|
-
confidence: r.confidence,
|
|
67
|
-
}));
|
|
68
|
-
}
|
|
69
|
-
catch {
|
|
70
|
-
// developer_decisions table may not exist yet
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
// 2. Ecosystem changes (security, breaking, releases, updates)
|
|
74
|
-
let ecosystemChanges = [];
|
|
75
|
-
try {
|
|
76
|
-
const rows = rawDb
|
|
77
|
-
.prepare(`SELECT id, title, source_type, created_at
|
|
78
|
-
FROM source_items
|
|
79
|
-
WHERE created_at > ?
|
|
80
|
-
AND (
|
|
81
|
-
LOWER(title) LIKE '%security%'
|
|
82
|
-
OR LOWER(title) LIKE '%breaking%'
|
|
83
|
-
OR LOWER(title) LIKE '%release%'
|
|
84
|
-
OR LOWER(title) LIKE '%update%'
|
|
85
|
-
)
|
|
86
|
-
ORDER BY created_at DESC
|
|
87
|
-
LIMIT 20`)
|
|
88
|
-
.all(since);
|
|
89
|
-
ecosystemChanges = rows.map((r) => {
|
|
90
|
-
const titleLower = r.title.toLowerCase();
|
|
91
|
-
let changeType = "update";
|
|
92
|
-
if (titleLower.includes("security"))
|
|
93
|
-
changeType = "security";
|
|
94
|
-
else if (titleLower.includes("breaking"))
|
|
95
|
-
changeType = "breaking_change";
|
|
96
|
-
else if (titleLower.includes("release"))
|
|
97
|
-
changeType = "release";
|
|
98
|
-
return {
|
|
99
|
-
change_type: changeType,
|
|
100
|
-
subject: r.title,
|
|
101
|
-
summary: `[${r.source_type}] ${r.title}`,
|
|
102
|
-
};
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
catch {
|
|
106
|
-
// source_items table may not exist yet
|
|
107
|
-
}
|
|
108
|
-
// 3. Recent agent memories
|
|
109
|
-
let agentMemories = [];
|
|
110
|
-
if (includeMemories) {
|
|
111
|
-
try {
|
|
112
|
-
let memorySql = `SELECT id, agent_type, memory_type, subject, content, created_at
|
|
113
|
-
FROM agent_memory
|
|
114
|
-
WHERE created_at > ?`;
|
|
115
|
-
const memoryParams = [since];
|
|
116
|
-
if (params.agent_type) {
|
|
117
|
-
memorySql += ` AND agent_type = ?`;
|
|
118
|
-
memoryParams.push(params.agent_type);
|
|
119
|
-
}
|
|
120
|
-
memorySql += ` ORDER BY created_at DESC LIMIT 30`;
|
|
121
|
-
const rows = rawDb
|
|
122
|
-
.prepare(memorySql)
|
|
123
|
-
.all(...memoryParams);
|
|
124
|
-
agentMemories = rows.map((r) => ({
|
|
125
|
-
id: r.id,
|
|
126
|
-
agent_type: r.agent_type,
|
|
127
|
-
memory_type: r.memory_type,
|
|
128
|
-
subject: r.subject,
|
|
129
|
-
content: r.content.length > 200
|
|
130
|
-
? r.content.substring(0, 200) + "..."
|
|
131
|
-
: r.content,
|
|
132
|
-
created_at: r.created_at,
|
|
133
|
-
}));
|
|
134
|
-
}
|
|
135
|
-
catch {
|
|
136
|
-
// agent_memory table may not exist yet
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
// 4. Latest briefing
|
|
140
|
-
let recentBriefing = null;
|
|
141
|
-
try {
|
|
142
|
-
const row = rawDb
|
|
143
|
-
.prepare(`SELECT content, created_at FROM briefings ORDER BY created_at DESC LIMIT 1`)
|
|
144
|
-
.get();
|
|
145
|
-
if (row) {
|
|
146
|
-
recentBriefing = row.content;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
catch {
|
|
150
|
-
// briefings table may not exist yet
|
|
151
|
-
}
|
|
152
|
-
// 5. Build summary
|
|
153
|
-
const summaryParts = [];
|
|
154
|
-
if (activeDecisions.length > 0) {
|
|
155
|
-
summaryParts.push(`${activeDecisions.length} active decisions`);
|
|
156
|
-
}
|
|
157
|
-
if (ecosystemChanges.length > 0) {
|
|
158
|
-
summaryParts.push(`${ecosystemChanges.length} ecosystem changes`);
|
|
159
|
-
}
|
|
160
|
-
if (agentMemories.length > 0) {
|
|
161
|
-
summaryParts.push(`${agentMemories.length} recent memories`);
|
|
162
|
-
}
|
|
163
|
-
if (recentBriefing) {
|
|
164
|
-
summaryParts.push("briefing available");
|
|
165
|
-
}
|
|
166
|
-
const summary = summaryParts.length > 0
|
|
167
|
-
? `Session brief for ${agentType}: ${summaryParts.join(", ")}`
|
|
168
|
-
: `No recent activity found since ${since}`;
|
|
169
|
-
return {
|
|
170
|
-
generated_at: new Date().toISOString(),
|
|
171
|
-
agent_type: agentType,
|
|
172
|
-
active_decisions: activeDecisions,
|
|
173
|
-
ecosystem_changes: ecosystemChanges,
|
|
174
|
-
agent_memories: agentMemories,
|
|
175
|
-
recent_briefing: recentBriefing,
|
|
176
|
-
summary,
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
//# sourceMappingURL=agent-session-brief.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-session-brief.js","sourceRoot":"","sources":["../../src/tools/agent-session-brief.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C;;;;;;;;;GASG;AA4CH,+EAA+E;AAC/E,kBAAkB;AAClB,+EAA+E;AAE/E,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EACT,gLAAgL;IAClL,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,UAAU,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,0FAA0F;aAC7F;YACD,KAAK,EAAE;gBACL,IAAI,EAAE,QAAQ;gBACd,WAAW,EACT,wDAAwD;aAC3D;YACD,iBAAiB,EAAE;gBACjB,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,oDAAoD;aAClE;YACD,gBAAgB,EAAE;gBAChB,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,+CAA+C;aAC7D;SACF;KACF;CACF,CAAC;AAEF,+EAA+E;AAC/E,UAAU;AACV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CAAC,oBAAoB,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,OAAO,GACX,YAAY,CAAC,MAAM,GAAG,CAAC;QACrB,CAAC,CAAC,qBAAqB,SAAS,KAAK,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;QAC9D,CAAC,CAAC,kCAAkC,KAAK,EAAE,CAAC;IAEhD,OAAO;QACL,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACtC,UAAU,EAAE,SAAS;QACrB,gBAAgB,EAAE,eAAe;QACjC,iBAAiB,EAAE,gBAAgB;QACnC,cAAc,EAAE,aAAa;QAC7B,eAAe,EAAE,cAAc;QAC/B,OAAO;KACR,CAAC;AACJ,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* attention_report tool
|
|
3
|
-
*
|
|
4
|
-
* Analyze where your attention goes vs. where your code needs it.
|
|
5
|
-
*/
|
|
6
|
-
import type { FourDADatabase } from "../db.js";
|
|
7
|
-
import type { EngagementRow, TopicAffinityRow, CodebaseTopicRow } from "../types.js";
|
|
8
|
-
export interface AttentionReportParams {
|
|
9
|
-
period_days?: number;
|
|
10
|
-
}
|
|
11
|
-
export declare const attentionReportTool: {
|
|
12
|
-
name: string;
|
|
13
|
-
description: string;
|
|
14
|
-
inputSchema: {
|
|
15
|
-
type: "object";
|
|
16
|
-
properties: {
|
|
17
|
-
period_days: {
|
|
18
|
-
type: string;
|
|
19
|
-
description: string;
|
|
20
|
-
default: number;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export declare function executeAttentionReport(db: FourDADatabase, params: AttentionReportParams): {
|
|
26
|
-
period_days: number;
|
|
27
|
-
total_interactions: number;
|
|
28
|
-
engagement_by_source: EngagementRow[];
|
|
29
|
-
topic_affinities: TopicAffinityRow[];
|
|
30
|
-
codebase_topics: CodebaseTopicRow[];
|
|
31
|
-
blind_spots: {
|
|
32
|
-
topic: string;
|
|
33
|
-
in_codebase: boolean;
|
|
34
|
-
engagement_level: number;
|
|
35
|
-
risk_level: string;
|
|
36
|
-
gap_description: string;
|
|
37
|
-
}[];
|
|
38
|
-
summary: string;
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=attention-report.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attention-report.d.ts","sourceRoot":"","sources":["../../src/tools/attention-report.ts"],"names":[],"mappings":"AACA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAErF,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;CAa/B,CAAC;AAEF,wBAAgB,sBAAsB,CACpC,EAAE,EAAE,cAAc,EAClB,MAAM,EAAE,qBAAqB;;;;;;;;;;;;;;EAsE9B"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: FSL-1.1-Apache-2.0
|
|
2
|
-
/**
|
|
3
|
-
* attention_report tool
|
|
4
|
-
*
|
|
5
|
-
* Analyze where your attention goes vs. where your code needs it.
|
|
6
|
-
*/
|
|
7
|
-
export const attentionReportTool = {
|
|
8
|
-
name: "attention_report",
|
|
9
|
-
description: `Analyze your attention allocation - where you focus vs. where your codebase needs attention. Identifies blind spots and engagement patterns.`,
|
|
10
|
-
inputSchema: {
|
|
11
|
-
type: "object",
|
|
12
|
-
properties: {
|
|
13
|
-
period_days: {
|
|
14
|
-
type: "number",
|
|
15
|
-
description: "Analysis period in days. Default: 7",
|
|
16
|
-
default: 7,
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
export function executeAttentionReport(db, params) {
|
|
22
|
-
const rawDb = db.getRawDb();
|
|
23
|
-
const days = params.period_days || 7;
|
|
24
|
-
// Get engagement by topic from interactions + source items
|
|
25
|
-
const engagementRows = rawDb
|
|
26
|
-
.prepare(`SELECT si.source_type, COUNT(*) as interactions
|
|
27
|
-
FROM interactions i
|
|
28
|
-
JOIN source_items si ON i.source_item_id = si.id
|
|
29
|
-
WHERE i.timestamp >= datetime('now', '-' || ? || ' days')
|
|
30
|
-
GROUP BY si.source_type
|
|
31
|
-
ORDER BY interactions DESC`)
|
|
32
|
-
.all(days);
|
|
33
|
-
// Get topic affinities (learned attention)
|
|
34
|
-
const topicAffinities = rawDb
|
|
35
|
-
.prepare(`SELECT topic, positive_signals, negative_signals,
|
|
36
|
-
(positive_signals - negative_signals * 0.5) as attention_score
|
|
37
|
-
FROM topic_affinities
|
|
38
|
-
WHERE total_exposures > 0
|
|
39
|
-
ORDER BY attention_score DESC
|
|
40
|
-
LIMIT 15`)
|
|
41
|
-
.all();
|
|
42
|
-
// Get codebase topics from detected tech
|
|
43
|
-
const codebaseTopics = rawDb
|
|
44
|
-
.prepare(`SELECT name as topic, category, confidence
|
|
45
|
-
FROM detected_tech
|
|
46
|
-
ORDER BY confidence DESC
|
|
47
|
-
LIMIT 15`)
|
|
48
|
-
.all();
|
|
49
|
-
// Identify blind spots: in codebase but low engagement
|
|
50
|
-
const engagedTopics = new Set(topicAffinities
|
|
51
|
-
.filter((t) => t.attention_score > 0)
|
|
52
|
-
.map((t) => t.topic.toLowerCase()));
|
|
53
|
-
const blindSpots = codebaseTopics
|
|
54
|
-
.filter((ct) => !engagedTopics.has(ct.topic.toLowerCase()))
|
|
55
|
-
.map((ct) => ({
|
|
56
|
-
topic: ct.topic,
|
|
57
|
-
in_codebase: true,
|
|
58
|
-
engagement_level: 0,
|
|
59
|
-
risk_level: ct.confidence > 0.8 ? "high" : "medium",
|
|
60
|
-
gap_description: `${ct.topic} is in your codebase (${ct.category}) but has low engagement`,
|
|
61
|
-
}));
|
|
62
|
-
const totalInteractions = engagementRows.reduce((sum, r) => sum + r.interactions, 0);
|
|
63
|
-
return {
|
|
64
|
-
period_days: days,
|
|
65
|
-
total_interactions: totalInteractions,
|
|
66
|
-
engagement_by_source: engagementRows,
|
|
67
|
-
topic_affinities: topicAffinities.slice(0, 10),
|
|
68
|
-
codebase_topics: codebaseTopics,
|
|
69
|
-
blind_spots: blindSpots,
|
|
70
|
-
summary: `${totalInteractions} interactions over ${days} days, ${blindSpots.length} blind spot${blindSpots.length !== 1 ? "s" : ""} detected`,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
//# sourceMappingURL=attention-report.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"attention-report.js","sourceRoot":"","sources":["../../src/tools/attention-report.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C;;;;GAIG;AASH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,8IAA8I;IAC3J,WAAW,EAAE;QACX,IAAI,EAAE,QAAiB;QACvB,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,qCAAqC;gBAClD,OAAO,EAAE,CAAC;aACX;SACF;KACF;CACF,CAAC;AAEF,MAAM,UAAU,sBAAsB,CACpC,EAAkB,EAClB,MAA6B;IAE7B,MAAM,KAAK,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;IAC5B,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,IAAI,CAAC,CAAC;IAErC,2DAA2D;IAC3D,MAAM,cAAc,GAAG,KAAK;SACzB,OAAO,CACN;;;;;kCAK4B,CAC7B;SACA,GAAG,CAAC,IAAI,CAAoB,CAAC;IAEhC,2CAA2C;IAC3C,MAAM,eAAe,GAAG,KAAK;SAC1B,OAAO,CACN;;;;;gBAKU,CACX;SACA,GAAG,EAAwB,CAAC;IAE/B,yCAAyC;IACzC,MAAM,cAAc,GAAG,KAAK;SAC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AAc,UAAU,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,WAAW;KAC9I,CAAC;AACJ,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* autophagy_status tool
|
|
3
|
-
*
|
|
4
|
-
* Intelligence metabolism status — autophagy cycles, calibrations, anti-patterns.
|
|
5
|
-
*/
|
|
6
|
-
import type { FourDADatabase } from "../db.js";
|
|
7
|
-
export interface AutophagyStatusParams {
|
|
8
|
-
limit?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare const autophagyStatusTool: {
|
|
11
|
-
name: string;
|
|
12
|
-
description: string;
|
|
13
|
-
inputSchema: {
|
|
14
|
-
type: "object";
|
|
15
|
-
properties: {
|
|
16
|
-
limit: {
|
|
17
|
-
type: string;
|
|
18
|
-
description: string;
|
|
19
|
-
default: number;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
export declare function executeAutophagyStatus(db: FourDADatabase, params: AutophagyStatusParams): object;
|
|
25
|
-
//# sourceMappingURL=autophagy-status.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"autophagy-status.d.ts","sourceRoot":"","sources":["../../src/tools/autophagy-status.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,WAAW,qBAAqB;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAmBD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;CAc/B,CAAC;AAOF,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,qBAAqB,GAAG,MAAM,CAwChG"}
|