@happyvertical/smrt-dev-mcp 0.40.59 → 0.40.61
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/AGENTS.md +14 -3
- package/README.md +41 -1
- package/dist/index.d.ts +2 -908
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +103 -17
- package/dist/index.js.map +1 -1
- package/mcp.json +9 -0
- package/package.json +9 -5
- package/plugin.json +5 -0
- package/schemas/agent-plugins-1.0.0/README.md +16 -0
- package/schemas/agent-plugins-1.0.0/mcp.schema.json +120 -0
- package/schemas/agent-plugins-1.0.0/plugin.schema.json +65 -0
- /package/{agent-skills → skills}/smrt-code-review/SKILL.md +0 -0
- /package/{agent-skills → skills}/smrt-code-review/references/review-output.md +0 -0
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAGL,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAKH,OAAO,EAGL,MAAM,EACN,KAAK,IAAI,EACV,MAAM,8BAA8B,CAAC;AAqBtC,eAAO,MAAM,cAAc,QAAuB,CAAC;AAwenD,eAAO,MAAM,KAAK,EAAE,IAAI,EAO0C,CAAC;AAEnE,wBAAgB,YAAY,IAAI,MAAM,CAgfrC"}
|
package/dist/index.js
CHANGED
|
@@ -12,9 +12,9 @@ import { ManifestGenerator } from "@happyvertical/smrt-core/scanner";
|
|
|
12
12
|
var AGENT_SKILLS = [{
|
|
13
13
|
name: "smrt-code-review",
|
|
14
14
|
description: "Harness-agnostic downstream SMRT code review workflow using smrt-dev-mcp deterministic context and prompt bundles.",
|
|
15
|
-
path: "
|
|
16
|
-
skillFile: "
|
|
17
|
-
references: ["
|
|
15
|
+
path: "skills/smrt-code-review/SKILL.md",
|
|
16
|
+
skillFile: "skills/smrt-code-review/SKILL.md",
|
|
17
|
+
references: ["skills/smrt-code-review/references/review-output.md"]
|
|
18
18
|
}];
|
|
19
19
|
function listAgentSkills() {
|
|
20
20
|
return AGENT_SKILLS.map(({ skillFile: _skillFile, ...skill }) => skill);
|
|
@@ -733,7 +733,7 @@ async function buildPackageContexts(projectPath) {
|
|
|
733
733
|
packageJsonPath,
|
|
734
734
|
json,
|
|
735
735
|
dependencies: collectDependencies(json),
|
|
736
|
-
scripts: isRecord(json.scripts) ? json.scripts : {},
|
|
736
|
+
scripts: isRecord$1(json.scripts) ? json.scripts : {},
|
|
737
737
|
imports: /* @__PURE__ */ new Map(),
|
|
738
738
|
sourceFiles: []
|
|
739
739
|
};
|
|
@@ -967,7 +967,7 @@ function collectDependencies(packageJson) {
|
|
|
967
967
|
const dependencies = /* @__PURE__ */ new Set();
|
|
968
968
|
for (const sectionName of DEPENDENCY_SECTIONS) {
|
|
969
969
|
const section = packageJson[sectionName];
|
|
970
|
-
if (!isRecord(section)) continue;
|
|
970
|
+
if (!isRecord$1(section)) continue;
|
|
971
971
|
for (const dependencyName of Object.keys(section)) dependencies.add(dependencyName);
|
|
972
972
|
}
|
|
973
973
|
return dependencies;
|
|
@@ -1037,7 +1037,7 @@ function lineNumber(content, needle) {
|
|
|
1037
1037
|
if (index < 0) return void 0;
|
|
1038
1038
|
return content.slice(0, index).split("\n").length;
|
|
1039
1039
|
}
|
|
1040
|
-
function isRecord(value) {
|
|
1040
|
+
function isRecord$1(value) {
|
|
1041
1041
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
1042
1042
|
}
|
|
1043
1043
|
async function pathExists(path) {
|
|
@@ -1067,6 +1067,49 @@ var DOMAIN_CODE_REVIEW_PROMPT = "domain-code-review";
|
|
|
1067
1067
|
var DOMAIN_ARCHITECTURE_PROMPT = "domain-architecture";
|
|
1068
1068
|
var KNOWLEDGE_PROJECT_URI = "smrt://knowledge/project";
|
|
1069
1069
|
var KNOWLEDGE_PACKAGE_PREFIX = "smrt://knowledge/package/";
|
|
1070
|
+
var DEPLOY_STATIC_CATALOG_CACHE_HINT = {
|
|
1071
|
+
ttlMs: 864e5,
|
|
1072
|
+
cacheScope: "private"
|
|
1073
|
+
};
|
|
1074
|
+
var LIVE_KNOWLEDGE_CACHE_HINT = {
|
|
1075
|
+
ttlMs: 0,
|
|
1076
|
+
cacheScope: "private"
|
|
1077
|
+
};
|
|
1078
|
+
var JSON_SCHEMA_2020_12 = "https://json-schema.org/draft/2020-12/schema";
|
|
1079
|
+
function compareToolNames(left, right) {
|
|
1080
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
1081
|
+
}
|
|
1082
|
+
/**
|
|
1083
|
+
* Stable success/error envelope for development tools. `data` preserves each
|
|
1084
|
+
* tool's existing payload exactly; coverage/diagnostics are promoted only when
|
|
1085
|
+
* the underlying result actually reports them.
|
|
1086
|
+
*/
|
|
1087
|
+
var DEV_MCP_OUTPUT_SCHEMA = {
|
|
1088
|
+
$schema: JSON_SCHEMA_2020_12,
|
|
1089
|
+
type: "object",
|
|
1090
|
+
additionalProperties: false,
|
|
1091
|
+
required: [
|
|
1092
|
+
"ok",
|
|
1093
|
+
"coverage",
|
|
1094
|
+
"diagnostics",
|
|
1095
|
+
"data"
|
|
1096
|
+
],
|
|
1097
|
+
properties: {
|
|
1098
|
+
ok: { type: "boolean" },
|
|
1099
|
+
coverage: {
|
|
1100
|
+
type: ["object", "null"],
|
|
1101
|
+
additionalProperties: true
|
|
1102
|
+
},
|
|
1103
|
+
diagnostics: {
|
|
1104
|
+
type: "array",
|
|
1105
|
+
items: {
|
|
1106
|
+
type: "object",
|
|
1107
|
+
additionalProperties: true
|
|
1108
|
+
}
|
|
1109
|
+
},
|
|
1110
|
+
data: {}
|
|
1111
|
+
}
|
|
1112
|
+
};
|
|
1070
1113
|
var TOOLS = [
|
|
1071
1114
|
{
|
|
1072
1115
|
name: "generate-smrt-class",
|
|
@@ -1518,17 +1561,32 @@ var TOOLS = [
|
|
|
1518
1561
|
required: ["name"]
|
|
1519
1562
|
}
|
|
1520
1563
|
}
|
|
1521
|
-
]
|
|
1564
|
+
].map((tool) => ({
|
|
1565
|
+
...tool,
|
|
1566
|
+
inputSchema: {
|
|
1567
|
+
...tool.inputSchema,
|
|
1568
|
+
$schema: JSON_SCHEMA_2020_12
|
|
1569
|
+
},
|
|
1570
|
+
outputSchema: DEV_MCP_OUTPUT_SCHEMA
|
|
1571
|
+
})).sort((left, right) => compareToolNames(left.name, right.name));
|
|
1522
1572
|
function createServer() {
|
|
1523
1573
|
if (DEBUG) console.error(`[${SERVER_NAME}] Starting server v${SERVER_VERSION}`);
|
|
1524
1574
|
const server = new Server({
|
|
1525
1575
|
name: SERVER_NAME,
|
|
1526
1576
|
version: SERVER_VERSION
|
|
1527
|
-
}, {
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1577
|
+
}, {
|
|
1578
|
+
capabilities: {
|
|
1579
|
+
prompts: {},
|
|
1580
|
+
resources: {},
|
|
1581
|
+
tools: {}
|
|
1582
|
+
},
|
|
1583
|
+
cacheHints: {
|
|
1584
|
+
"tools/list": DEPLOY_STATIC_CATALOG_CACHE_HINT,
|
|
1585
|
+
"prompts/list": DEPLOY_STATIC_CATALOG_CACHE_HINT,
|
|
1586
|
+
"resources/list": LIVE_KNOWLEDGE_CACHE_HINT,
|
|
1587
|
+
"resources/read": LIVE_KNOWLEDGE_CACHE_HINT
|
|
1588
|
+
}
|
|
1589
|
+
});
|
|
1532
1590
|
server.setRequestHandler("tools/list", async () => {
|
|
1533
1591
|
if (DEBUG) console.error(`[${SERVER_NAME}] ListTools request`);
|
|
1534
1592
|
return { tools: TOOLS };
|
|
@@ -1781,10 +1839,13 @@ function createServer() {
|
|
|
1781
1839
|
break;
|
|
1782
1840
|
default: throw new Error(`Unknown tool: ${name}`);
|
|
1783
1841
|
}
|
|
1784
|
-
return {
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1842
|
+
return {
|
|
1843
|
+
content: [{
|
|
1844
|
+
type: "text",
|
|
1845
|
+
text: result
|
|
1846
|
+
}],
|
|
1847
|
+
structuredContent: toDevToolStructuredContent(result)
|
|
1848
|
+
};
|
|
1788
1849
|
} catch (error) {
|
|
1789
1850
|
const errorMessage = error instanceof Error ? error.message : "Unknown error";
|
|
1790
1851
|
console.error(`[${SERVER_NAME}] Error:`, error);
|
|
@@ -1793,7 +1854,16 @@ function createServer() {
|
|
|
1793
1854
|
type: "text",
|
|
1794
1855
|
text: `Error executing tool ${name}: ${errorMessage}`
|
|
1795
1856
|
}],
|
|
1796
|
-
isError: true
|
|
1857
|
+
isError: true,
|
|
1858
|
+
structuredContent: {
|
|
1859
|
+
ok: false,
|
|
1860
|
+
coverage: null,
|
|
1861
|
+
diagnostics: [{
|
|
1862
|
+
severity: "error",
|
|
1863
|
+
message: errorMessage
|
|
1864
|
+
}],
|
|
1865
|
+
data: null
|
|
1866
|
+
}
|
|
1797
1867
|
};
|
|
1798
1868
|
}
|
|
1799
1869
|
});
|
|
@@ -1925,6 +1995,22 @@ function detailArg(args) {
|
|
|
1925
1995
|
const detail = args?.detail;
|
|
1926
1996
|
return typeof detail === "string" ? detail : void 0;
|
|
1927
1997
|
}
|
|
1998
|
+
function toDevToolStructuredContent(result) {
|
|
1999
|
+
let data = result;
|
|
2000
|
+
try {
|
|
2001
|
+
data = JSON.parse(result);
|
|
2002
|
+
} catch {}
|
|
2003
|
+
const source = isRecord(data) ? data : void 0;
|
|
2004
|
+
return {
|
|
2005
|
+
ok: true,
|
|
2006
|
+
coverage: isRecord(source?.coverage) ? source.coverage : null,
|
|
2007
|
+
diagnostics: Array.isArray(source?.diagnostics) ? source.diagnostics.filter(isRecord) : [],
|
|
2008
|
+
data
|
|
2009
|
+
};
|
|
2010
|
+
}
|
|
2011
|
+
function isRecord(value) {
|
|
2012
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
2013
|
+
}
|
|
1928
2014
|
function sanitizeKnowledgePackage(pkg) {
|
|
1929
2015
|
const { directory: _directory, objects, checkedObjectPaths, ...rest } = pkg;
|
|
1930
2016
|
return {
|