@shrkcrft/mcp-server 0.1.0-alpha.15 → 0.1.0-alpha.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/server/columnar-format.d.ts +34 -0
- package/dist/server/columnar-format.d.ts.map +1 -0
- package/dist/server/columnar-format.js +95 -0
- package/dist/server/create-mcp-server.d.ts +3 -0
- package/dist/server/create-mcp-server.d.ts.map +1 -1
- package/dist/server/create-mcp-server.js +5 -2
- package/dist/server/fit-array-to-budget.d.ts +24 -0
- package/dist/server/fit-array-to-budget.d.ts.map +1 -0
- package/dist/server/fit-array-to-budget.js +60 -0
- package/dist/server/serialize-tool-data.d.ts +15 -0
- package/dist/server/serialize-tool-data.d.ts.map +1 -0
- package/dist/server/serialize-tool-data.js +22 -0
- package/dist/server/tool-definition.d.ts +15 -0
- package/dist/server/tool-definition.d.ts.map +1 -1
- package/dist/server/tool-input-validators.d.ts.map +1 -1
- package/dist/server/tool-input-validators.js +43 -0
- package/dist/tools/agent-brief.tool.d.ts.map +1 -1
- package/dist/tools/agent-brief.tool.js +20 -0
- package/dist/tools/align-cache.tool.d.ts +11 -0
- package/dist/tools/align-cache.tool.d.ts.map +1 -0
- package/dist/tools/align-cache.tool.js +76 -0
- package/dist/tools/all-tools.d.ts.map +1 -1
- package/dist/tools/all-tools.js +7 -0
- package/dist/tools/architecture-map.tool.d.ts.map +1 -1
- package/dist/tools/architecture-map.tool.js +4 -2
- package/dist/tools/code-find-usages.tool.d.ts.map +1 -1
- package/dist/tools/code-find-usages.tool.js +15 -10
- package/dist/tools/command-catalog.tool.d.ts.map +1 -1
- package/dist/tools/command-catalog.tool.js +11 -7
- package/dist/tools/compress-context.tool.d.ts +8 -0
- package/dist/tools/compress-context.tool.d.ts.map +1 -0
- package/dist/tools/compress-context.tool.js +81 -0
- package/dist/tools/dashboard-summary.tool.d.ts.map +1 -1
- package/dist/tools/dashboard-summary.tool.js +2 -4
- package/dist/tools/deps-audit.tool.d.ts.map +1 -1
- package/dist/tools/deps-audit.tool.js +36 -2
- package/dist/tools/get-code-intelligence-state.tool.d.ts.map +1 -1
- package/dist/tools/get-code-intelligence-state.tool.js +8 -7
- package/dist/tools/get-graph-callers.tool.d.ts.map +1 -1
- package/dist/tools/get-graph-callers.tool.js +9 -8
- package/dist/tools/get-graph-context.tool.d.ts.map +1 -1
- package/dist/tools/get-graph-context.tool.js +19 -19
- package/dist/tools/get-graph-cycles.tool.d.ts.map +1 -1
- package/dist/tools/get-graph-cycles.tool.js +11 -10
- package/dist/tools/get-graph-impact-analysis.tool.d.ts.map +1 -1
- package/dist/tools/get-graph-impact-analysis.tool.js +3 -1
- package/dist/tools/get-graph-impact.tool.d.ts.map +1 -1
- package/dist/tools/get-graph-impact.tool.js +14 -13
- package/dist/tools/get-graph-search.tool.d.ts.map +1 -1
- package/dist/tools/get-graph-search.tool.js +9 -8
- package/dist/tools/get-graph-unresolved.tool.d.ts.map +1 -1
- package/dist/tools/get-graph-unresolved.tool.js +13 -9
- package/dist/tools/get-knowledge-graph.tool.d.ts +7 -0
- package/dist/tools/get-knowledge-graph.tool.d.ts.map +1 -1
- package/dist/tools/get-knowledge-graph.tool.js +62 -3
- package/dist/tools/get-relevant-context.tool.d.ts.map +1 -1
- package/dist/tools/get-relevant-context.tool.js +30 -6
- package/dist/tools/get-task-packet.tool.d.ts.map +1 -1
- package/dist/tools/get-task-packet.tool.js +26 -22
- package/dist/tools/list-boundary-rules.tool.d.ts.map +1 -1
- package/dist/tools/list-boundary-rules.tool.js +20 -16
- package/dist/tools/list-knowledge.tool.d.ts.map +1 -1
- package/dist/tools/list-knowledge.tool.js +14 -13
- package/dist/tools/list-packs.tool.d.ts.map +1 -1
- package/dist/tools/list-packs.tool.js +19 -15
- package/dist/tools/list-path-conventions.tool.d.ts.map +1 -1
- package/dist/tools/list-path-conventions.tool.js +19 -15
- package/dist/tools/list-pipelines.tool.d.ts.map +1 -1
- package/dist/tools/list-pipelines.tool.js +18 -14
- package/dist/tools/list-presets.tool.d.ts.map +1 -1
- package/dist/tools/list-presets.tool.js +25 -21
- package/dist/tools/list-rules.tool.d.ts.map +1 -1
- package/dist/tools/list-rules.tool.js +18 -14
- package/dist/tools/list-templates.tool.d.ts.map +1 -1
- package/dist/tools/list-templates.tool.js +18 -14
- package/dist/tools/primary-tools.d.ts.map +1 -1
- package/dist/tools/primary-tools.js +5 -0
- package/dist/tools/retrieve-original.tool.d.ts +9 -0
- package/dist/tools/retrieve-original.tool.d.ts.map +1 -0
- package/dist/tools/retrieve-original.tool.js +47 -0
- package/dist/tools/runtime-reports.tool.d.ts.map +1 -1
- package/dist/tools/runtime-reports.tool.js +1 -3
- package/dist/tools/safety-audit.tool.d.ts.map +1 -1
- package/dist/tools/safety-audit.tool.js +1 -4
- package/dist/tools/search-knowledge.tool.d.ts.map +1 -1
- package/dist/tools/search-knowledge.tool.js +17 -13
- package/dist/tools/search.tool.d.ts.map +1 -1
- package/dist/tools/search.tool.js +11 -8
- package/dist/tools/smart-context-bundle.tool.d.ts.map +1 -1
- package/dist/tools/smart-context-bundle.tool.js +4 -2
- package/package.json +27 -26
- package/dist/tools/r22-extras.tool.d.ts +0 -4
- package/dist/tools/r22-extras.tool.d.ts.map +0 -1
- package/dist/tools/r22-extras.tool.js +0 -42
- package/dist/tools/r26-ingest.tool.d.ts +0 -10
- package/dist/tools/r26-ingest.tool.d.ts.map +0 -1
- package/dist/tools/r26-ingest.tool.js +0 -174
- package/dist/tools/r34-search-unified.tool.d.ts +0 -3
- package/dist/tools/r34-search-unified.tool.d.ts.map +0 -1
- package/dist/tools/r34-search-unified.tool.js +0 -38
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import * as nodePath from 'node:path';
|
|
2
|
-
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
-
import { buildContradictionReport, buildGeneratedCodeReport, buildIngestAdoptionPlan, buildRepositoryKnowledgeModel, buildStabilityMap, IngestDepth, IngestSection, } from '@shrkcrft/inspector';
|
|
4
|
-
function nextHint(cmd) {
|
|
5
|
-
return `Next: \`${cmd}\` (CLI is the only write path).`;
|
|
6
|
-
}
|
|
7
|
-
function parseDepth(raw) {
|
|
8
|
-
if (typeof raw !== 'string')
|
|
9
|
-
return IngestDepth.Standard;
|
|
10
|
-
const lower = raw.toLowerCase();
|
|
11
|
-
for (const d of Object.values(IngestDepth))
|
|
12
|
-
if (d === lower)
|
|
13
|
-
return d;
|
|
14
|
-
return IngestDepth.Standard;
|
|
15
|
-
}
|
|
16
|
-
function parseSections(raw) {
|
|
17
|
-
if (!Array.isArray(raw))
|
|
18
|
-
return undefined;
|
|
19
|
-
const out = [];
|
|
20
|
-
for (const s of raw) {
|
|
21
|
-
if (typeof s !== 'string')
|
|
22
|
-
continue;
|
|
23
|
-
for (const v of Object.values(IngestSection)) {
|
|
24
|
-
if (v === s)
|
|
25
|
-
out.push(v);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return out.length > 0 ? out : undefined;
|
|
29
|
-
}
|
|
30
|
-
export const createRepositoryIngestionPlanTool = {
|
|
31
|
-
name: 'create_repository_ingestion_plan',
|
|
32
|
-
description: 'Build a SharkCraft repository knowledge model (read-only). Returns the model + a next-command hint. MCP never writes; pass --write-drafts to the CLI to materialise drafts under sharkcraft/ingestion/.',
|
|
33
|
-
inputSchema: {
|
|
34
|
-
type: 'object',
|
|
35
|
-
additionalProperties: false,
|
|
36
|
-
properties: {
|
|
37
|
-
depth: { type: 'string' },
|
|
38
|
-
include: { type: 'array', items: { type: 'string' } },
|
|
39
|
-
exclude: { type: 'array', items: { type: 'string' } },
|
|
40
|
-
presets: { type: 'array', items: { type: 'string' } },
|
|
41
|
-
task: { type: 'string' },
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
async handler(input, ctx) {
|
|
45
|
-
const model = await buildRepositoryKnowledgeModel({
|
|
46
|
-
inspection: ctx.inspection,
|
|
47
|
-
depth: parseDepth(input.depth),
|
|
48
|
-
selectedSections: parseSections(input.include),
|
|
49
|
-
excludedSections: parseSections(input.exclude),
|
|
50
|
-
forcedPresetIds: Array.isArray(input.presets) ? input.presets.filter((p) => typeof p === 'string') : undefined,
|
|
51
|
-
...(typeof input.task === 'string' ? { task: input.task } : {}),
|
|
52
|
-
});
|
|
53
|
-
return {
|
|
54
|
-
text: nextHint('shrk ingest repository --write-drafts'),
|
|
55
|
-
data: model,
|
|
56
|
-
};
|
|
57
|
-
},
|
|
58
|
-
};
|
|
59
|
-
export const getRepositoryKnowledgeModelTool = {
|
|
60
|
-
name: 'get_repository_knowledge_model',
|
|
61
|
-
description: 'Return the previously-saved repository knowledge model (`sharkcraft/ingestion/repository-knowledge-model.json`). Read-only.',
|
|
62
|
-
inputSchema: { type: 'object', properties: {}, additionalProperties: false },
|
|
63
|
-
handler(_input, ctx) {
|
|
64
|
-
const file = nodePath.join(ctx.cwd, 'sharkcraft', 'ingestion', 'repository-knowledge-model.json');
|
|
65
|
-
if (!existsSync(file)) {
|
|
66
|
-
return {
|
|
67
|
-
isError: true,
|
|
68
|
-
error: { code: 'not-found', message: 'No saved knowledge model. Run `shrk ingest repository --write-drafts` first.' },
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
try {
|
|
72
|
-
const body = JSON.parse(readFileSync(file, 'utf8'));
|
|
73
|
-
return {
|
|
74
|
-
text: nextHint('shrk ingest report --format markdown'),
|
|
75
|
-
data: body,
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
catch (err) {
|
|
79
|
-
return {
|
|
80
|
-
isError: true,
|
|
81
|
-
error: { code: 'parse-failed', message: err.message },
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
};
|
|
86
|
-
export const getRepositoryIngestionStatusTool = {
|
|
87
|
-
name: 'get_repository_ingestion_status',
|
|
88
|
-
description: 'Report whether ingest drafts/adoption files exist on disk. Read-only.',
|
|
89
|
-
inputSchema: { type: 'object', properties: {}, additionalProperties: false },
|
|
90
|
-
handler(_input, ctx) {
|
|
91
|
-
const base = nodePath.join(ctx.cwd, 'sharkcraft', 'ingestion');
|
|
92
|
-
const modelExists = existsSync(nodePath.join(base, 'repository-knowledge-model.json'));
|
|
93
|
-
const adoptionExists = existsSync(nodePath.join(base, 'adoption', 'ingest-adoption-state.json'));
|
|
94
|
-
return {
|
|
95
|
-
text: nextHint('shrk ingest status'),
|
|
96
|
-
data: {
|
|
97
|
-
ingestDirExists: existsSync(base),
|
|
98
|
-
modelExists,
|
|
99
|
-
adoptionExists,
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
export const getRepositoryIngestionReportTool = {
|
|
105
|
-
name: 'get_repository_ingestion_report',
|
|
106
|
-
description: 'Return a markdown summary of the saved repository knowledge model. Read-only.',
|
|
107
|
-
inputSchema: { type: 'object', properties: {}, additionalProperties: false },
|
|
108
|
-
async handler(_input, ctx) {
|
|
109
|
-
const file = nodePath.join(ctx.cwd, 'sharkcraft', 'ingestion', 'REPOSITORY_KNOWLEDGE_MODEL.md');
|
|
110
|
-
if (!existsSync(file)) {
|
|
111
|
-
return {
|
|
112
|
-
isError: true,
|
|
113
|
-
error: { code: 'not-found', message: 'No saved report — run `shrk ingest repository --write-drafts` first.' },
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
return {
|
|
117
|
-
text: nextHint('shrk ingest report --format markdown'),
|
|
118
|
-
data: { markdown: readFileSync(file, 'utf8') },
|
|
119
|
-
};
|
|
120
|
-
},
|
|
121
|
-
};
|
|
122
|
-
export const getContradictionReportTool = {
|
|
123
|
-
name: 'get_contradiction_report',
|
|
124
|
-
description: 'Detect documentation/code contradictions (missing paths, deprecated CLI usage, missing commands). Read-only.',
|
|
125
|
-
inputSchema: { type: 'object', properties: {}, additionalProperties: false },
|
|
126
|
-
async handler(_input, ctx) {
|
|
127
|
-
const report = buildContradictionReport({ inspection: ctx.inspection });
|
|
128
|
-
return {
|
|
129
|
-
text: nextHint('shrk contradictions --format markdown'),
|
|
130
|
-
data: report,
|
|
131
|
-
};
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
export const getGeneratedCodeReportTool = {
|
|
135
|
-
name: 'get_generated_code_report',
|
|
136
|
-
description: 'Classify generated vs hand-written files; surface protect/policy recommendations. Read-only.',
|
|
137
|
-
inputSchema: { type: 'object', properties: {}, additionalProperties: false },
|
|
138
|
-
async handler(_input, ctx) {
|
|
139
|
-
const report = buildGeneratedCodeReport({ inspection: ctx.inspection });
|
|
140
|
-
return {
|
|
141
|
-
text: nextHint('shrk generated report --format markdown'),
|
|
142
|
-
data: report,
|
|
143
|
-
};
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
export const getStabilityMapTool = {
|
|
147
|
-
name: 'get_stability_map',
|
|
148
|
-
description: 'Classify repo areas as stable/experimental/deprecated/legacy/generated/internal/public-api/high-risk. Read-only.',
|
|
149
|
-
inputSchema: { type: 'object', properties: {}, additionalProperties: false },
|
|
150
|
-
async handler(_input, ctx) {
|
|
151
|
-
const generated = buildGeneratedCodeReport({ inspection: ctx.inspection });
|
|
152
|
-
const map = buildStabilityMap({
|
|
153
|
-
inspection: ctx.inspection,
|
|
154
|
-
generatedRoots: generated.generatedRoots.map((r) => r.path),
|
|
155
|
-
});
|
|
156
|
-
return {
|
|
157
|
-
text: nextHint('shrk stability map --format markdown'),
|
|
158
|
-
data: map,
|
|
159
|
-
};
|
|
160
|
-
},
|
|
161
|
-
};
|
|
162
|
-
export const getIngestAdoptionPreviewTool = {
|
|
163
|
-
name: 'get_ingest_adoption_preview',
|
|
164
|
-
description: 'Preview the ingest-adoption plan (safe-append / manual-review / low-confidence / already-covered / generated-protected). Read-only.',
|
|
165
|
-
inputSchema: { type: 'object', properties: {}, additionalProperties: false },
|
|
166
|
-
async handler(_input, ctx) {
|
|
167
|
-
const model = await buildRepositoryKnowledgeModel({ inspection: ctx.inspection });
|
|
168
|
-
const plan = buildIngestAdoptionPlan({ model });
|
|
169
|
-
return {
|
|
170
|
-
text: nextHint('shrk ingest adopt --write-patch'),
|
|
171
|
-
data: plan,
|
|
172
|
-
};
|
|
173
|
-
},
|
|
174
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"r34-search-unified.tool.d.ts","sourceRoot":"","sources":["../../src/tools/r34-search-unified.tool.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,eAAO,MAAM,iBAAiB,EAAE,eA4B/B,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Read-only MCP tool for unified search.
|
|
3
|
-
*/
|
|
4
|
-
import { buildUniversalSearch } from '@shrkcrft/inspector';
|
|
5
|
-
export const searchUnifiedTool = {
|
|
6
|
-
name: 'search_unified',
|
|
7
|
-
description: 'Universal search palette across every contribution kind. Returns the 7-section unified output + uncertainty footer. Read-only.',
|
|
8
|
-
inputSchema: {
|
|
9
|
-
type: 'object',
|
|
10
|
-
additionalProperties: false,
|
|
11
|
-
required: ['query'],
|
|
12
|
-
properties: {
|
|
13
|
-
query: { type: 'string' },
|
|
14
|
-
kind: { type: 'string' },
|
|
15
|
-
source: { type: 'string' },
|
|
16
|
-
limit: { type: 'number' },
|
|
17
|
-
commandsOnly: { type: 'boolean' },
|
|
18
|
-
actionsOnly: { type: 'boolean' },
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
async handler(input, ctx) {
|
|
22
|
-
const query = typeof input.query === 'string' ? input.query : '';
|
|
23
|
-
if (!query)
|
|
24
|
-
return { isError: true, error: { code: 'invalid-input', message: 'query is required' } };
|
|
25
|
-
const opts = {};
|
|
26
|
-
if (typeof input.kind === 'string')
|
|
27
|
-
opts.kind = input.kind;
|
|
28
|
-
if (typeof input.source === 'string')
|
|
29
|
-
opts.source = input.source;
|
|
30
|
-
if (typeof input.limit === 'number')
|
|
31
|
-
opts.limit = input.limit;
|
|
32
|
-
if (input.commandsOnly === true)
|
|
33
|
-
opts.commandsOnly = true;
|
|
34
|
-
if (input.actionsOnly === true)
|
|
35
|
-
opts.actionsOnly = true;
|
|
36
|
-
return { data: await buildUniversalSearch(ctx.inspection, query, opts) };
|
|
37
|
-
},
|
|
38
|
-
};
|