nimai-mcp 0.3.3 → 0.3.5

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.
@@ -57,6 +57,12 @@ export interface ForgeSpecOutput {
57
57
  prompt: string;
58
58
  /** Repo context items extracted for the request */
59
59
  context: ContextItem[];
60
+ /**
61
+ * Existing nimai-managed spec files found in the repo (sorted newest-first).
62
+ * Empty array means no spec file exists yet — call nimai_new before filling the spec.
63
+ * Non-empty means spec files already exist — you may fill one of these instead of creating a new one.
64
+ */
65
+ existing_specs: string[];
60
66
  /**
61
67
  * Concrete follow-up questions when request ambiguity blocks reliable spec drafting.
62
68
  * Triggered when request is under 10 words OR zero repo files matched.
@@ -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;;;;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;I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B,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAID,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDnB,CAAC"}
package/dist/contract.js CHANGED
@@ -39,9 +39,10 @@ exports.TOOL_DESCRIPTORS = {
39
39
  name: 'nimai_spec',
40
40
  description: 'Returns a populated FORGE Self-Spec Agent prompt (Prompt 1) plus extracted repo context. ' +
41
41
  'The host model uses this bundle to fill a draft spec — no LLM call is made inside this tool. ' +
42
- 'FULL LOOP: (1) call nimai_new to scaffold the spec file, (2) call this tool to get the prompt bundle, ' +
43
- '(3) fill the scaffolded spec using the returned prompt, (4) call nimai_validate, ' +
44
- '(5) call nimai_spec_review. Do not skip nimai_new without it there is no spec file to fill.',
42
+ 'Also returns existing_specs: paths of nimai-managed spec files already in the repo. ' +
43
+ 'If existing_specs is empty, call nimai_new first to scaffold a spec file, then fill it using the returned prompt. ' +
44
+ 'If existing_specs is non-empty, fill one of those files instead. ' +
45
+ 'After filling: call nimai_validate, then nimai_spec_review.',
45
46
  inputSchema: exports.ForgeSpecInput,
46
47
  },
47
48
  nimai_review: {
@@ -65,10 +66,14 @@ exports.TOOL_DESCRIPTORS = {
65
66
  },
66
67
  nimai_spec_review: {
67
68
  name: 'nimai_spec_review',
68
- description: 'USE THIS BEFORE BUILDING: evaluates whether a draft spec is ready to hand to a builder. ' +
69
- 'Returns a Prompt 1.5 (spec-quality reviewer) — pass it to an LLM to get a {passed, issues} verdict. ' +
69
+ description: 'USE THIS BEFORE BUILDING: returns a Prompt 1.5 spec-quality reviewer. ' +
70
70
  'Only call this after nimai_validate passes. ' +
71
- 'If passed=false, fix the spec directly using the issues list, re-run nimai_validate, then call this again — do NOT re-call nimai_spec. ' +
71
+ 'IMPORTANT: this tool returns a prompt string it does NOT perform the review itself. ' +
72
+ 'After calling this tool, you MUST use the returned specReviewerPrompt as your next input and evaluate the spec yourself. ' +
73
+ 'Read the prompt, apply the 6 dimensions, then end your response with the JSON verdict block: ' +
74
+ '{"passed": true/false, "schema_version": "2", "issues": [...]}. ' +
75
+ 'The review is NOT complete until you have produced and the human has seen that verdict block. ' +
76
+ 'If passed=false, fix the spec, re-run nimai_validate, then call this again. ' +
72
77
  'For reviewing an implementation against an approved spec, use nimai_review instead.',
73
78
  inputSchema: exports.ForgeSpecReviewInput,
74
79
  },
@@ -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,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,gDAAgD,CAAC;CACzF,CAAC,CAA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B,EAAE;QACjB,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACT,wEAAwE;YACxE,8CAA8C;YAC9C,wFAAwF;YACxF,2HAA2H;YAC3H,+FAA+F;YAC/F,kEAAkE;YAClE,gGAAgG;YAChG,8EAA8E;YAC9E,qFAAqF;QACvF,WAAW,EAAE,4BAAoB;KAClC;CACO,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,CAqB1B"}
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,CAuB1B"}
@@ -47,7 +47,8 @@ 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
- const result = { prompt, context };
50
+ const existingSpecs = (0, nimai_core_1.findNimaiSpecs)(repoPath).map(s => s.filePath);
51
+ const result = { prompt, context, existing_specs: existingSpecs };
51
52
  const clarification = (0, nimai_core_1.detectClarifications)(input.request, context.length);
52
53
  if (clarification.needed) {
53
54
  result.clarifications_needed = clarification.questions;
@@ -1 +1 @@
1
- {"version":3,"file":"spec.js","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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.3.3"
39
+ "nimai-core": "0.3.5"
40
40
  },
41
41
  "scripts": {
42
42
  "build": "tsc",