nimai-mcp 0.1.5 → 0.2.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.
@@ -203,6 +203,40 @@ doesn't match your intent. Approved spec = your deployment brief.
203
203
 
204
204
  ---
205
205
 
206
+ ### Prompt 1.5 — Spec-Quality Reviewer
207
+ *Run this on a draft spec before approving it. The reviewing LLM checks whether the spec is agent-ready.*
208
+
209
+ ```
210
+ You are a Specification Quality Reviewer operating under the FORGE framework.
211
+
212
+ Your job is to evaluate the draft spec below for spec quality only — not implementation correctness.
213
+ Do NOT assess any code, code diffs, or implementation output.
214
+
215
+ Evaluate each dimension with a binary PASS or FAIL:
216
+ 1. Binary acceptance criteria — are all sub-task ACs measurable and unambiguous?
217
+ 2. Scope coherence — are in-scope/out-of-scope boundaries clear and non-contradictory?
218
+ 3. Constraint sufficiency — do Must/Must-Not/Prefer/Escalate constraints cover key risks?
219
+ 4. Decomposition realism — can each sub-task be done within 2 hours by a skilled agent?
220
+ 5. Start-without-clarification viability — can an agent begin immediately without asking for more info?
221
+
222
+ Always end your response with a JSON verdict block:
223
+ ## Verdict
224
+ ```json
225
+ {"passed": <true|false>, "issues": ["<issue>", ...]}
226
+ ```
227
+
228
+ Draft spec: [PASTE DRAFT SPEC HERE]
229
+ ```
230
+
231
+ The host agent parses the `## Verdict` JSON block to drive the review loop:
232
+ - `passed: true` → proceed to implementation
233
+ - `passed: false` → refine the spec using the `issues` list, then re-review
234
+ - Block absent or malformed → escalate to the human
235
+
236
+ Use `nimai_spec_review` to generate this prompt automatically from a spec file.
237
+
238
+ ---
239
+
206
240
  ### Prompt 2 — Reviewer / Validator Prompt Generator
207
241
  *Run this after Self-Spec is approved. Paste along with the approved spec.*
208
242
 
@@ -230,11 +264,13 @@ Approved spec: [PASTE APPROVED SPEC HERE]
230
264
  ```
231
265
  Loose request
232
266
 
233
- Self-Spec Agent → draft spec
267
+ Self-Spec Agent (Prompt 1) → draft spec
234
268
 
269
+ Spec-Quality Reviewer (Prompt 1.5) → passed? → NO → refine spec → loop
270
+ ↓ YES
235
271
  Human reviews + resolves [NEEDS HUMAN INPUT] flags
236
272
 
237
- Approved spec → Reviewer Prompt Generator → validator prompt
273
+ Approved spec → Reviewer Prompt Generator (Prompt 2) → validator prompt
238
274
 
239
275
  Deploy executing agent with approved spec
240
276
 
@@ -374,3 +374,5 @@ Acceptance criteria: _____________________________________
374
374
 
375
375
  *FORGE Spec Template v1.0 — companion to the FORGE system. A blank field is an unresolved decision.*
376
376
  *System docs: Quick Reference · Canonical Framework · Spec Template (this doc)*
377
+
378
+ <!-- nimai-spec -->
@@ -45,11 +45,24 @@ export declare const ForgeNewInput: z.ZodObject<{
45
45
  }, {
46
46
  outputPath: string;
47
47
  }>;
48
+ export declare const ForgeSpecReviewInput: z.ZodObject<{
49
+ specPath: z.ZodString;
50
+ }, "strip", z.ZodTypeAny, {
51
+ specPath: string;
52
+ }, {
53
+ specPath: string;
54
+ }>;
48
55
  export interface ForgeSpecOutput {
49
56
  /** The populated FORGE Prompt 1 (Self-Spec Agent), ready to pass to a model */
50
57
  prompt: string;
51
58
  /** Repo context items extracted for the request */
52
59
  context: ContextItem[];
60
+ /**
61
+ * Concrete follow-up questions when request ambiguity blocks reliable spec drafting.
62
+ * Triggered when request is under 10 words OR zero repo files matched.
63
+ * Optional — absent when no clarification is needed.
64
+ */
65
+ clarifications_needed?: string[];
53
66
  }
54
67
  export interface ForgeReviewOutput {
55
68
  /** The populated FORGE Prompt 2 (Reviewer/Validator), derived from the spec */
@@ -57,7 +70,7 @@ export interface ForgeReviewOutput {
57
70
  }
58
71
  export interface ForgeValidateOutput {
59
72
  issues: LintIssue[];
60
- /** true if zero issues found */
73
+ /** true if zero hard (non-advisory) issues found */
61
74
  passed: boolean;
62
75
  }
63
76
  export interface ForgeNewOutput {
@@ -66,6 +79,14 @@ export interface ForgeNewOutput {
66
79
  /** Content written to the file */
67
80
  content: string;
68
81
  }
82
+ export interface ForgeSpecReviewOutput {
83
+ /**
84
+ * FORGE Prompt 1.5 — Spec-Quality Reviewer prompt.
85
+ * Pass this to a reviewing LLM. The LLM will respond with a JSON verdict block
86
+ * containing {passed: boolean, issues: string[]}.
87
+ */
88
+ specReviewerPrompt: string;
89
+ }
69
90
  export declare const TOOL_DESCRIPTORS: {
70
91
  readonly nimai_spec: {
71
92
  readonly name: "nimai_spec";
@@ -114,5 +135,16 @@ export declare const TOOL_DESCRIPTORS: {
114
135
  outputPath: string;
115
136
  }>;
116
137
  };
138
+ readonly nimai_spec_review: {
139
+ readonly name: "nimai_spec_review";
140
+ readonly description: string;
141
+ readonly inputSchema: z.ZodObject<{
142
+ specPath: z.ZodString;
143
+ }, "strip", z.ZodTypeAny, {
144
+ specPath: string;
145
+ }, {
146
+ specPath: string;
147
+ }>;
148
+ };
117
149
  };
118
150
  //# sourceMappingURL=contract.d.ts.map
@@ -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;AAIH,MAAM,WAAW,eAAe;IAC9B,+EAA+E;IAC/E,MAAM,EAAE,MAAM,CAAC;IACf,mDAAmD;IACnD,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;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,gCAAgC;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B,EAAE,MAAM,CAAC;CAC5B;AAID,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsCnB,CAAC"}
package/dist/contract.js CHANGED
@@ -14,7 +14,7 @@
14
14
  * - outputPath for nimai_new: parent directory is created if missing; write errors surface as tool errors
15
15
  */
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.TOOL_DESCRIPTORS = exports.ForgeNewInput = exports.ForgeValidateInput = exports.ForgeReviewInput = exports.ForgeSpecInput = void 0;
17
+ exports.TOOL_DESCRIPTORS = exports.ForgeSpecReviewInput = exports.ForgeNewInput = exports.ForgeValidateInput = exports.ForgeReviewInput = exports.ForgeSpecInput = void 0;
18
18
  const zod_1 = require("zod");
19
19
  // ─── Input Schemas ────────────────────────────────────────────────────────────
20
20
  exports.ForgeSpecInput = zod_1.z.object({
@@ -30,6 +30,9 @@ exports.ForgeValidateInput = zod_1.z.object({
30
30
  exports.ForgeNewInput = zod_1.z.object({
31
31
  outputPath: zod_1.z.string().min(1).describe('Path where the new spec file should be written'),
32
32
  });
33
+ exports.ForgeSpecReviewInput = zod_1.z.object({
34
+ specPath: zod_1.z.string().describe('Path to the draft spec markdown file to evaluate'),
35
+ });
33
36
  // ─── Tool Descriptors (used to register tools in the MCP server) ──────────────
34
37
  exports.TOOL_DESCRIPTORS = {
35
38
  nimai_spec: {
@@ -40,8 +43,9 @@ exports.TOOL_DESCRIPTORS = {
40
43
  },
41
44
  nimai_review: {
42
45
  name: 'nimai_review',
43
- description: 'Returns a populated FORGE Reviewer/Validator prompt (Prompt 2) derived from an approved spec file. ' +
44
- 'The host model uses this to validate agent output against the spec.',
46
+ description: 'USE THIS AFTER BUILDING: returns a Reviewer/Validator prompt (Prompt 2) to check whether an ' +
47
+ 'implementation satisfies an approved spec. ' +
48
+ 'For checking spec quality BEFORE building, use nimai_spec_review instead.',
45
49
  inputSchema: exports.ForgeReviewInput,
46
50
  },
47
51
  nimai_validate: {
@@ -55,5 +59,13 @@ exports.TOOL_DESCRIPTORS = {
55
59
  description: 'Scaffolds a new FORGE spec file from the canonical template at the specified output path.',
56
60
  inputSchema: exports.ForgeNewInput,
57
61
  },
62
+ nimai_spec_review: {
63
+ name: 'nimai_spec_review',
64
+ description: 'USE THIS BEFORE BUILDING: evaluates whether a draft spec is ready to hand to a builder. ' +
65
+ 'Returns a Prompt 1.5 (spec-quality reviewer) — pass it to an LLM to get a {passed, issues} verdict. ' +
66
+ 'If passed=false, loop back to nimai_spec with the issues. ' +
67
+ 'For reviewing an implementation against an approved spec, use nimai_review instead.',
68
+ inputSchema: exports.ForgeSpecReviewInput,
69
+ },
58
70
  };
59
71
  //# sourceMappingURL=contract.js.map
@@ -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,QAAQ,CAAC,yCAAyC,CAAC;CACzE,CAAC,CAAC;AAEU,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;CACxE,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,UAAU,EAAE,OAAC,CAAC,MAAM,EA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
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAgBnE,wBAAgB,YAAY,IAAI,MAAM,CAuErC;AAED,wBAAsB,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC,CAIjD"}
package/dist/server.js CHANGED
@@ -10,8 +10,11 @@ const spec_1 = require("./tools/spec");
10
10
  const review_1 = require("./tools/review");
11
11
  const validate_1 = require("./tools/validate");
12
12
  const new_1 = require("./tools/new");
13
+ const spec_review_1 = require("./tools/spec-review");
14
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
15
+ const { version } = require('../package.json');
13
16
  function createServer() {
14
- const server = new index_js_1.Server({ name: 'nimai', version: '0.1.0' }, { capabilities: { tools: {} } });
17
+ const server = new index_js_1.Server({ name: 'nimai', version }, { capabilities: { tools: {} } });
15
18
  server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => ({
16
19
  tools: Object.values(contract_1.TOOL_DESCRIPTORS).map(descriptor => ({
17
20
  name: descriptor.name,
@@ -51,6 +54,11 @@ function createServer() {
51
54
  result = await (0, new_1.toolNew)(input);
52
55
  break;
53
56
  }
57
+ case 'nimai_spec_review': {
58
+ const input = contract_1.ForgeSpecReviewInput.parse(args);
59
+ result = await (0, spec_review_1.toolSpecReview)(input);
60
+ break;
61
+ }
54
62
  default:
55
63
  throw new Error(`Unknown tool: ${name}`);
56
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":";;AAYA,oCAkEC;AAED,kCAIC;AApFD,wEAAmE;AACnE,wEAAiF;AACjF,iEAG4C;AAC5C,yCAAmH;AACnH,uCAAwC;AACxC,2CAA4C;AAC5C,+CAAgD;AAChD,qCAAsC;AAEtC,SAAgB,YAAY;IAC1B,MAAM,MAAM,GAAG,IAAI,iBAAM,CACvB,EAAE,IAAI,EAAE,OAAO,EAAE,OAA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oBACrC,MAAM;gBACR,CAAC;gBACD;oBACE,MAAM,IAAI,KAAK,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAC;YAC7C,CAAC;YAED,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aAC5E,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,UAAW,GAAa,CAAC,OAAO,EAAE,EAAE,CAAC;gBAC9E,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC;AAEM,KAAK,UAAU,WAAW;IAC/B,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,SAAS,GAAG,IAAI,+BAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ForgeSpecReviewInput, ForgeSpecReviewOutput } from '../contract';
2
+ import { z } from 'zod';
3
+ export declare function toolSpecReview(input: z.infer<typeof ForgeSpecReviewInput>): Promise<ForgeSpecReviewOutput>;
4
+ //# sourceMappingURL=spec-review.d.ts.map
@@ -0,0 +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,CAYhC"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.toolSpecReview = toolSpecReview;
37
+ const fs = __importStar(require("fs"));
38
+ const path = __importStar(require("path"));
39
+ const nimai_core_1 = require("nimai-core");
40
+ async function toolSpecReview(input) {
41
+ const specPath = path.resolve(input.specPath);
42
+ let specContent;
43
+ try {
44
+ specContent = fs.readFileSync(specPath, 'utf-8');
45
+ }
46
+ catch (err) {
47
+ throw new Error(`Cannot read spec at "${specPath}": ${err.message}`);
48
+ }
49
+ return { specReviewerPrompt: (0, nimai_core_1.buildPrompt15)(specContent) };
50
+ }
51
+ //# sourceMappingURL=spec-review.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-review.js","sourceRoot":"","sources":["../../src/tools/spec-review.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wCAcC;AApBD,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,OAAO,EAAE,kBAAkB,EAAE,IAAA,0BAAa,EAAC,WAAW,CAAC,EAAE,CAAC;AAC5D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../src/tools/spec.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,GACpC,OAAO,CAAC,eAAe,CAAC,CAc1B"}
1
+ {"version":3,"file":"spec.d.ts","sourceRoot":"","sources":["../../src/tools/spec.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,wBAAsB,QAAQ,CAC5B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,GACpC,OAAO,CAAC,eAAe,CAAC,CAqB1B"}
@@ -47,6 +47,11 @@ async function toolSpec(input) {
47
47
  .map(item => `[${item.file}]\n${item.snippet}`)
48
48
  .join('\n\n---\n\n');
49
49
  const prompt = (0, nimai_core_1.buildPrompt1)(input.request, contextSummary);
50
- return { prompt, context };
50
+ const result = { prompt, context };
51
+ const clarification = (0, nimai_core_1.detectClarifications)(input.request, context.length);
52
+ if (clarification.needed) {
53
+ result.clarifications_needed = clarification.questions;
54
+ }
55
+ return result;
51
56
  }
52
57
  //# sourceMappingURL=spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spec.js","sourceRoot":"","sources":["../../src/tools/spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,4BAgBC;AAtBD,uCAAyB;AACzB,2CAA6B;AAC7B,2CAA0D;AAInD,KAAK,UAAU,QAAQ,CAC5B,KAAqC;IAErC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;IACD,MAAM,OAAO,GAAG,IAAA,2BAAc,EAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAExD,MAAM,cAAc,GAAG,OAAO;SAC3B,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;SAC9C,IAAI,CAAC,aAAa,CAAC,CAAC;IAEvB,MAAM,MAAM,GAAG,IAAA,yBAAY,EAAC,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAE3D,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC"}
1
+ {"version":3,"file":"spec.js","sourceRoot":"","sources":["../../src/tools/spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,4BAuBC;AA7BD,uCAAyB;AACzB,2CAA6B;AAC7B,2CAAgF;AAIzE,KAAK,UAAU,QAAQ,CAC5B,KAAqC;IAErC,MAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,4BAA4B,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;IACD,MAAM,OAAO,GAAG,IAAA,2BAAc,EAAC,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IAExD,MAAM,cAAc,GAAG,OAAO;SAC3B,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE,CAAC;SAC9C,IAAI,CAAC,aAAa,CAAC,CAAC;IAEvB,MAAM,MAAM,GAAG,IAAA,yBAAY,EAAC,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;IAE3D,MAAM,MAAM,GAAoB,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;IAEpD,MAAM,aAAa,GAAG,IAAA,iCAAoB,EAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1E,IAAI,aAAa,CAAC,MAAM,EAAE,CAAC;QACzB,MAAM,CAAC,qBAAqB,GAAG,aAAa,CAAC,SAAS,CAAC;IACzD,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -4,6 +4,6 @@ exports.toolValidate = toolValidate;
4
4
  const nimai_core_1 = require("nimai-core");
5
5
  async function toolValidate(input) {
6
6
  const issues = (0, nimai_core_1.lintSpec)(input.specPath);
7
- return { issues, passed: issues.length === 0 };
7
+ return { issues, passed: issues.filter(i => !i.advisory).length === 0 };
8
8
  }
9
9
  //# sourceMappingURL=validate.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/tools/validate.ts"],"names":[],"mappings":";;AAIA,oCAKC;AATD,2CAAsC;AAI/B,KAAK,UAAU,YAAY,CAChC,KAAyC;IAEzC,MAAM,MAAM,GAAG,IAAA,qBAAQ,EAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;AACjD,CAAC"}
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/tools/validate.ts"],"names":[],"mappings":";;AAIA,oCAKC;AATD,2CAAsC;AAI/B,KAAK,UAAU,YAAY,CAChC,KAAyC;IAEzC,MAAM,MAAM,GAAG,IAAA,qBAAQ,EAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;AAC1E,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nimai-mcp",
3
- "version": "0.1.5",
3
+ "version": "0.2.1",
4
4
  "description": "Nimai MCP server — exposes nimai_spec, nimai_review, nimai_validate, nimai_new 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.1.2"
39
+ "nimai-core": "0.2.0"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "tsc",