@grainulation/wheat 1.0.10 → 1.0.12
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/bin/wheat.js +11 -0
- package/compiler/wheat-compiler.js +2 -0
- package/lib/init.js +5 -0
- package/lib/serve-mcp.js +9 -0
- package/package.json +2 -2
package/bin/wheat.js
CHANGED
|
@@ -104,6 +104,16 @@ if (subcommand === "--version" || subcommand === "-v") {
|
|
|
104
104
|
process.exit(0);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
|
+
// ─── Fast MCP dispatch ──────────────────────────────────────────────────────
|
|
108
|
+
// MCP is machine-invoked via stdio — skip install-prompt and arg parsing.
|
|
109
|
+
// This matches mill/silo's pattern of early bail-out before any overhead.
|
|
110
|
+
if (subcommand === "mcp") {
|
|
111
|
+
const { startServer } = await import(
|
|
112
|
+
new URL("../lib/serve-mcp.js", import.meta.url).href
|
|
113
|
+
);
|
|
114
|
+
startServer(targetDir);
|
|
115
|
+
} else {
|
|
116
|
+
|
|
107
117
|
// ─── Install prompt tracking ─────────────────────────────────────────────────
|
|
108
118
|
// Track npx usage and maybe suggest installing. Both calls are sync, <5ms,
|
|
109
119
|
// and fail silently. Only fires for real subcommands (not --help/--version).
|
|
@@ -215,3 +225,4 @@ handler.run(targetDir, subArgs).catch((err) => {
|
|
|
215
225
|
if (process.env.WHEAT_DEBUG) console.error(err.stack);
|
|
216
226
|
process.exit(1);
|
|
217
227
|
});
|
|
228
|
+
} // end else (non-mcp subcommands)
|
|
@@ -836,7 +836,9 @@ function compile(inputPath, outputPath, dir, opts = {}) {
|
|
|
836
836
|
id: c.id,
|
|
837
837
|
type: c.type,
|
|
838
838
|
topic: c.topic,
|
|
839
|
+
content: c.content,
|
|
839
840
|
evidence: c.evidence,
|
|
841
|
+
confidence: c.confidence,
|
|
840
842
|
status: c.status,
|
|
841
843
|
phase_added: c.phase_added,
|
|
842
844
|
source: c.source,
|
package/lib/init.js
CHANGED
|
@@ -341,6 +341,11 @@ fi
|
|
|
341
341
|
// ─── .mcp.json & AGENTS.md ──────────────────────────────────────────────────
|
|
342
342
|
|
|
343
343
|
function writeMcpJson(dir) {
|
|
344
|
+
if (process.env.CLAUDE_PLUGIN_ROOT) {
|
|
345
|
+
console.log(" - .mcp.json (skipped — plugin provides MCP servers)");
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
|
|
344
349
|
const mcpPath = target(dir, ".mcp.json");
|
|
345
350
|
const wheatEntry = {
|
|
346
351
|
command: "npx",
|
package/lib/serve-mcp.js
CHANGED
|
@@ -221,6 +221,15 @@ function toolResolve(dir, args) {
|
|
|
221
221
|
if (!loserClaim)
|
|
222
222
|
return { status: "error", message: `Claim "${loser}" not found.` };
|
|
223
223
|
|
|
224
|
+
const winnerConflicts = winnerClaim.conflicts_with || [];
|
|
225
|
+
const loserConflicts = loserClaim.conflicts_with || [];
|
|
226
|
+
if (!winnerConflicts.includes(loser) && !loserConflicts.includes(winner)) {
|
|
227
|
+
return {
|
|
228
|
+
status: "error",
|
|
229
|
+
message: `Cannot resolve: "${winner}" and "${loser}" have no conflicts_with relationship.`,
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
|
|
224
233
|
// Clear conflict references
|
|
225
234
|
winnerClaim.conflicts_with = (winnerClaim.conflicts_with || []).filter(
|
|
226
235
|
(cid) => cid !== loser
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grainulation/wheat",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.12",
|
|
4
4
|
"description": "Research-driven development framework — structured claims, compiled evidence, deterministic output",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "grainulation contributors",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"bin": {
|
|
39
39
|
"wheat": "bin/wheat.js",
|
|
40
|
-
"wheat-mcp": "bin/wheat-mcp.
|
|
40
|
+
"wheat-mcp": "bin/wheat-mcp.cjs"
|
|
41
41
|
},
|
|
42
42
|
"files": [
|
|
43
43
|
"bin/",
|