nimai-mcp 0.4.0 → 0.4.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAIzD,eAAO,MAAM,cAAc;;;;;;;;;EAGzB,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;EAE3B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;EAE7B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;EAExB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAC;AAIH,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB;;;;;OAKG;IACH,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC;AAED,MAAM,WAAW,iBAAiB;IAChC,+EAA+E;IAC/E,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,oDAAoD;IACpD,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAC3B;;;OAGG;IACH,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAID,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AgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyDnB,CAAC"}
package/dist/contract.js CHANGED
@@ -42,7 +42,8 @@ exports.TOOL_DESCRIPTORS = {
42
42
  'Also returns existing_specs: paths of nimai-managed spec files already in the repo. ' +
43
43
  'If existing_specs is empty, you MUST call nimai_new immediately as the next action (no asking, no narration), then fill it using the returned prompt. ' +
44
44
  'If existing_specs is non-empty, fill one of those files instead. ' +
45
- 'After filling: call nimai_validate, then nimai_spec_review. ' +
45
+ 'After filling: call nimai_validate. ' +
46
+ 'After nimai_validate passes, tell the user to open a fresh reviewer session and ask it to call nimai_spec_review. The builder must not perform the review in the same session. ' +
46
47
  'Scope boundary: this tool produces spec prompts/contracts only. ' +
47
48
  'Nimai defines and enforces spec-quality contracts; ChatMasala executes agent workflows against those contracts; context platforms provide the execution substrate. ' +
48
49
  'It does not orchestrate runtime execution, retries, agent routing, or session control.',
@@ -60,7 +61,9 @@ exports.TOOL_DESCRIPTORS = {
60
61
  description: 'Lints a spec file for unresolved placeholder fields (___), [NEEDS HUMAN INPUT] flags, ' +
61
62
  'missing required sections, and pre-checked acceptance criteria. Returns structured issues and a pass/fail result. ' +
62
63
  'Run this after filling a spec and again after every fix. ' +
63
- 'On fix iterations, if passed=true, call nimai_spec_review immediately as the next step.',
64
+ 'If passed: true, tell the user the spec is structurally complete and ready for independent review. ' +
65
+ 'Instruct them to open a fresh reviewer session (no prior builder context) and ask it to call nimai_spec_review({ specPath: \'[path]\' }). ' +
66
+ 'The builder must not perform the review in the same session.',
64
67
  inputSchema: exports.ForgeValidateInput,
65
68
  },
66
69
  nimai_new: {
@@ -70,14 +73,13 @@ exports.TOOL_DESCRIPTORS = {
70
73
  },
71
74
  nimai_spec_review: {
72
75
  name: 'nimai_spec_review',
73
- description: 'USE THIS BEFORE BUILDING: returns a Prompt 1.5 spec-quality reviewer prompt plus reviewer_instructions. ' +
74
- 'Only call this after nimai_validate passes. ' +
75
- 'CRITICAL: do NOT evaluate the specReviewerPrompt yourself. ' +
76
- 'The agent that built the spec must not be its own reviewer — this defeats the purpose of the review. ' +
77
- 'After calling this tool, present the reviewer_instructions to the user verbatim and stop. ' +
78
- 'The user will take the specReviewerPrompt to an independent reviewer (fresh session, different model). ' +
79
- 'Wait for the user to return the verdict block: {"passed": true/false, "schema_version": "2", "issues": [...]}. ' +
80
- 'If passed=false, fix the spec using the issues list, re-run nimai_validate, then call this again. ' +
76
+ description: 'Primary owner: independent reviewer in a fresh session. ' +
77
+ 'Returns Prompt 1.5 spec-quality review checklist for the spec at specPath. ' +
78
+ 'The reviewer evaluates the spec and outputs a verdict. ' +
79
+ 'If passed: false, reviewer must output a Builder Brief ' +
80
+ '(header: \'## Paste this to your builder session:\') with one fix instruction per HARD_FAIL/SOFT_FAIL issue. ' +
81
+ 'The builder must not perform the review in the same session it wrote the spec ' +
82
+ 'independent review requires a fresh session with no builder context. ' +
81
83
  'For reviewing an implementation against an approved spec, use nimai_review instead. ' +
82
84
  'Scope boundary: this tool governs spec quality review contracts only. ' +
83
85
  'Nimai defines and enforces spec-quality contracts; ChatMasala executes agent workflows against those contracts; context platforms provide the execution substrate. ' +
@@ -1 +1 @@
1
- {"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,6BAAwB;AAGxB,iFAAiF;AAEpE,QAAA,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,sCAAsC,CAAC;IACrE,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,8CAA8C,CAAC;CACpF,CAAC,CAAC;AAEU,QAAA,gBAAgB,GAAG,OAAC,CAAC,MAAM,CAAC;IACvC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,Q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B,UAAU,EAAE;QACV,IAAI,EAAE,YAAY;QAClB,WAAW,EACT,2FAA2F;YAC3F,+FAA+F;YAC/F,sFAAsF;YACtF,wJAAwJ;YACxJ,mEAAmE;YACnE,sCAAsC;YACtC,iLAAiL;YACjL,kEAAkE;YAClE,qKAAqK;YACrK,wFAAwF;QAC1F,WAAW,EAAE,sBAAc;KAC5B;IACD,YAAY,EAAE;QACZ,IAAI,EAAE,cAAc;QACpB,WAAW,EACT,8FAA8F;YAC9F,6CAA6C;YAC7C,2EAA2E;QAC7E,WAAW,EAAE,wBAAgB;KAC9B;IACD,cAAc,EAAE;QACd,IAAI,EAAE,gBAAgB;QACtB,WAAW,EACT,wFAAwF;YACxF,oHAAoH;YACpH,2DAA2D;YAC3D,qGAAqG;YACrG,4IAA4I;YAC5I,8DAA8D;QAChE,WAAW,EAAE,0BAAkB;KAChC;IACD,SAAS,EAAE;QACT,IAAI,EAAE,WAAW;QACjB,WAAW,EACT,2FAA2F;QAC7F,WAAW,EAAE,qBAAa;KAC3B;IACD,iBAAiB,EAAE;QACjB,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACT,0DAA0D;YAC1D,6EAA6E;YAC7E,yDAAyD;YACzD,yDAAyD;YACzD,+GAA+G;YAC/G,kFAAkF;YAClF,uEAAuE;YACvE,sFAAsF;YACtF,wEAAwE;YACxE,qKAAqK;YACrK,wEAAwE;QAC1E,WAAW,EAAE,4BAAoB;KAClC;CACO,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"spec-review.d.ts","sourceRoot":"","sources":["../../src/tools/spec-review.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAsB,cAAc,CAClC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,GAC1C,OAAO,CAAC,qBAAqB,CAAC,CAgBhC"}
1
+ {"version":3,"file":"spec-review.d.ts","sourceRoot":"","sources":["../../src/tools/spec-review.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAC1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAsB,cAAc,CAClC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,GAC1C,OAAO,CAAC,qBAAqB,CAAC,CAqBhC"}
@@ -47,7 +47,11 @@ async function toolSpecReview(input) {
47
47
  throw new Error(`Cannot read spec at "${specPath}": ${err.message}`);
48
48
  }
49
49
  const specReviewerPrompt = (0, nimai_core_1.buildPrompt15)(specContent);
50
- const reviewer_instructions = `Paste the following into a fresh reviewer session:\n\n\`\`\`\n${specReviewerPrompt}\n\`\`\``;
50
+ const reviewer_instructions = `Open a fresh reviewer session with nimai-mcp configured.\n` +
51
+ `Ask it to call: nimai_spec_review({ specPath: '${specPath}' })\n` +
52
+ `then evaluate the returned prompt and return a verdict.\n\n` +
53
+ `If the reviewer session does not have nimai-mcp available,\n` +
54
+ `paste the following prompt directly:\n\n\`\`\`\n${specReviewerPrompt}\n\`\`\``;
51
55
  return { specReviewerPrompt, reviewer_instructions };
52
56
  }
53
57
  //# sourceMappingURL=spec-review.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spec-review.js","sourceRoot":"","sources":["../../src/tools/spec-review.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wCAkBC;AAxBD,uCAAyB;AACzB,2CAA6B;AAC7B,2CAA2C;AAIpC,KAAK,UAAU,cAAc,CAClC,KAA2C;IAE3C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,WAAmB,CAAC;IACxB,IAAI,CAAC;QACH,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,wBAAwB,QAAQ,MAAO,GAA6B,CAAC,OAAO,EAAE,CAC/E,CAAC;IACJ,CAAC;IAED,MAAM,kBAAkB,GAAG,IAAA,0BAAa,EAAC,WAAW,CAAC,CAAC;IAEtD,MAAM,qBAAqB,GAAG,iEAAiE,kBAAkB,UAAU,CAAC;IAE5H,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;AACvD,CAAC"}
1
+ {"version":3,"file":"spec-review.js","sourceRoot":"","sources":["../../src/tools/spec-review.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wCAuBC;AA7BD,uCAAyB;AACzB,2CAA6B;AAC7B,2CAA2C;AAIpC,KAAK,UAAU,cAAc,CAClC,KAA2C;IAE3C,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,WAAmB,CAAC;IACxB,IAAI,CAAC;QACH,WAAW,GAAG,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CACb,wBAAwB,QAAQ,MAAO,GAA6B,CAAC,OAAO,EAAE,CAC/E,CAAC;IACJ,CAAC;IAED,MAAM,kBAAkB,GAAG,IAAA,0BAAa,EAAC,WAAW,CAAC,CAAC;IAEtD,MAAM,qBAAqB,GACzB,4DAA4D;QAC5D,kDAAkD,QAAQ,QAAQ;QAClE,6DAA6D;QAC7D,8DAA8D;QAC9D,mDAAmD,kBAAkB,UAAU,CAAC;IAElF,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,CAAC;AACvD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nimai-mcp",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Nimai MCP server — exposes nimai_spec, nimai_review, nimai_validate, nimai_new, nimai_spec_review as tools. No internal LLM calls.",
5
5
  "keywords": [
6
6
  "nimai",
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "@modelcontextprotocol/sdk": "^1.0.0",
38
38
  "zod": "^3.23.8",
39
- "nimai-core": "0.4.0"
39
+ "nimai-core": "0.4.1"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "tsc",