@pathmode/mcp-server 1.5.0 → 1.7.0

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/README.md CHANGED
@@ -28,11 +28,11 @@ The Intent Compiler turns Claude Code into a Socratic product thinking partner.
28
28
  Does that capture it, or is there more to the pain?
29
29
  ```
30
30
 
31
- When the spec is ready, Claude saves it as `intent.md` and optionally exports as `.cursorrules` or `CLAUDE.md` — so every AI agent in your project sees the intent as its implementation context.
31
+ When the spec is ready, Claude saves it as `intent.md` and optionally exports as `.cursorrules`, `CLAUDE.md`, or `AGENTS.md` (Codex/Cursor) — so every AI agent in your project sees the intent as its implementation context.
32
32
 
33
33
  ### Quick Start
34
34
 
35
- Add to `.claude/settings.json`:
35
+ Add to `.mcp.json` in your project root:
36
36
 
37
37
  ```json
38
38
  {
@@ -156,7 +156,7 @@ npx @pathmode/mcp-server@latest setup pm_live_...
156
156
  }
157
157
  ```
158
158
 
159
- Works with Claude Code (`.claude/settings.json`), Claude Desktop (`claude_desktop_config.json`), and Cursor (`.cursor/mcp.json`).
159
+ Works with Claude Code (`.mcp.json` in the project root), Claude Desktop (`claude_desktop_config.json`), and Cursor (`.cursor/mcp.json`).
160
160
 
161
161
  Get your API key from **Settings > API Keys** in the [Pathmode app](https://pathmode.io).
162
162
 
@@ -184,6 +184,10 @@ export interface ApiWorkspace {
184
184
  id: string;
185
185
  category: string;
186
186
  text: string;
187
+ rationale?: string;
188
+ scope?: string;
189
+ enforcement?: 'advisory' | 'required' | 'blocking';
190
+ examples?: string[];
187
191
  isActive: boolean;
188
192
  createdAt: string;
189
193
  }[];
@@ -1 +1 @@
1
- {"version":3,"file":"","sourceRoot":"","sources":["file:///Users/jannelammi/code/Pathmode/packages/mcp-server/src/api-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAQH,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAA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Aa,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa,GAAG,WAAW,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAUxH,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC;IAQ1D,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,SAAS,CAAC;IAQxE,aAAa,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAU/F,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC;IAQhE,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAQ/I,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAQtH"}
package/dist/index.d.ts CHANGED
@@ -12,7 +12,7 @@
12
12
  * The Intent Compiler (compile-intent prompt, intent_save, intent_export tools)
13
13
  * works without an API key — zero-config intent spec building in Claude Code.
14
14
  *
15
- * Add to .claude/settings.json:
15
+ * Add to .mcp.json in the project root:
16
16
  * {
17
17
  * "mcpServers": {
18
18
  * "pathmode": {
package/dist/index.js CHANGED
@@ -5330,7 +5330,7 @@ module.exports = {
5330
5330
 
5331
5331
 
5332
5332
  const { parseSetCookie } = __nccwpck_require__(9000)
5333
- const { stringify, getHeadersList } = __nccwpck_require__(799)
5333
+ const { stringify } = __nccwpck_require__(799)
5334
5334
  const { webidl } = __nccwpck_require__(1523)
5335
5335
  const { Headers } = __nccwpck_require__(8526)
5336
5336
 
@@ -5406,14 +5406,13 @@ function getSetCookies (headers) {
5406
5406
 
5407
5407
  webidl.brandCheck(headers, Headers, { strict: false })
5408
5408
 
5409
- const cookies = getHeadersList(headers).cookies
5409
+ const cookies = headers.getSetCookie()
5410
5410
 
5411
5411
  if (!cookies) {
5412
5412
  return []
5413
5413
  }
5414
5414
 
5415
- // In older versions of undici, cookies is a list of name:value.
5416
- return cookies.map((pair) => parseSetCookie(Array.isArray(pair) ? pair[1] : pair))
5415
+ return cookies.map((pair) => parseSetCookie(pair))
5417
5416
  }
5418
5417
 
5419
5418
  /**
@@ -5841,14 +5840,15 @@ module.exports = {
5841
5840
  /***/ }),
5842
5841
 
5843
5842
  /***/ 799:
5844
- /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
5843
+ /***/ ((module) => {
5845
5844
 
5846
5845
  "use strict";
5847
5846
 
5848
5847
 
5849
- const assert = __nccwpck_require__(2613)
5850
- const { kHeadersList } = __nccwpck_require__(7506)
5851
-
5848
+ /**
5849
+ * @param {string} value
5850
+ * @returns {boolean}
5851
+ */
5852
5852
  function isCTLExcludingHtab (value) {
5853
5853
  if (value.length === 0) {
5854
5854
  return false
@@ -6109,31 +6109,13 @@ function stringify (cookie) {
6109
6109
  return out.join('; ')
6110
6110
  }
6111
6111
 
6112
- let kHeadersListNode
6113
-
6114
- function getHeadersList (headers) {
6115
- if (headers[kHeadersList]) {
6116
- return headers[kHeadersList]
6117
- }
6118
-
6119
- if (!kHeadersListNode) {
6120
- kHeadersListNode = Object.getOwnPropertySymbols(headers).find(
6121
- (symbol) => symbol.description === 'headers list'
6122
- )
6123
-
6124
- assert(kHeadersListNode, 'Headers cannot be parsed')
6125
- }
6126
-
6127
- const headersList = headers[kHeadersListNode]
6128
- assert(headersList)
6129
-
6130
- return headersList
6131
- }
6132
-
6133
6112
  module.exports = {
6134
6113
  isCTLExcludingHtab,
6135
- stringify,
6136
- getHeadersList
6114
+ validateCookieName,
6115
+ validateCookiePath,
6116
+ validateCookieValue,
6117
+ toIMFDate,
6118
+ stringify
6137
6119
  }
6138
6120
 
6139
6121
 
@@ -8062,6 +8044,14 @@ const { isUint8Array, isArrayBuffer } = __nccwpck_require__(8253)
8062
8044
  const { File: UndiciFile } = __nccwpck_require__(3044)
8063
8045
  const { parseMIMEType, serializeAMimeType } = __nccwpck_require__(7845)
8064
8046
 
8047
+ let random
8048
+ try {
8049
+ const crypto = __nccwpck_require__(7598)
8050
+ random = (max) => crypto.randomInt(0, max)
8051
+ } catch {
8052
+ random = (max) => Math.floor(Math.random(max))
8053
+ }
8054
+
8065
8055
  let ReadableStream = globalThis.ReadableStream
8066
8056
 
8067
8057
  /** @type {globalThis['File']} */
@@ -8147,7 +8137,7 @@ function extractBody (object, keepalive = false) {
8147
8137
  // Set source to a copy of the bytes held by object.
8148
8138
  source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength))
8149
8139
  } else if (util.isFormDataLike(object)) {
8150
- const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, '0')}`
8140
+ const boundary = `----formdata-undici-0${`${random(1e11)}`.padStart(11, '0')}`
8151
8141
  const prefix = `--${boundary}\r\nContent-Disposition: form-data`
8152
8142
 
8153
8143
  /*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */
@@ -10129,6 +10119,7 @@ const {
10129
10119
  isValidHeaderName,
10130
10120
  isValidHeaderValue
10131
10121
  } = __nccwpck_require__(5182)
10122
+ const util = __nccwpck_require__(9023)
10132
10123
  const { webidl } = __nccwpck_require__(1523)
10133
10124
  const assert = __nccwpck_require__(2613)
10134
10125
 
@@ -10682,6 +10673,9 @@ Object.defineProperties(Headers.prototype, {
10682
10673
  [Symbol.toStringTag]: {
10683
10674
  value: 'Headers',
10684
10675
  configurable: true
10676
+ },
10677
+ [util.inspect.custom]: {
10678
+ enumerable: false
10685
10679
  }
10686
10680
  })
10687
10681
 
@@ -19858,6 +19852,20 @@ class Pool extends PoolBase {
19858
19852
  ? { ...options.interceptors }
19859
19853
  : undefined
19860
19854
  this[kFactory] = factory
19855
+
19856
+ this.on('connectionError', (origin, targets, error) => {
19857
+ // If a connection error occurs, we remove the client from the pool,
19858
+ // and emit a connectionError event. They will not be re-used.
19859
+ // Fixes https://github.com/nodejs/undici/issues/3895
19860
+ for (const target of targets) {
19861
+ // Do not use kRemoveClient here, as it will close the client,
19862
+ // but the client cannot be closed in this state.
19863
+ const idx = this[kClients].indexOf(target)
19864
+ if (idx !== -1) {
19865
+ this[kClients].splice(idx, 1)
19866
+ }
19867
+ }
19868
+ })
19861
19869
  }
19862
19870
 
19863
19871
  [kGetDispatcher] () {
@@ -33903,6 +33911,7 @@ exports.getCompileIntentPrompt = getCompileIntentPrompt;
33903
33911
  exports.formatIntentMd = formatIntentMd;
33904
33912
  exports.formatCursorRules = formatCursorRules;
33905
33913
  exports.formatClaudeMdSection = formatClaudeMdSection;
33914
+ exports.formatOutcomeRubric = formatOutcomeRubric;
33906
33915
  /** Extract text from a string or structured outcome. */
33907
33916
  function getOutcomeText(o) {
33908
33917
  return typeof o === 'string' ? o : o.text;
@@ -34000,7 +34009,7 @@ WHEN THE SPEC FEELS READY AND ALL STATUS ITEMS ARE [X]:
34000
34009
  1. Present the full spec as a summary for the user to review
34001
34010
  2. Ask if they want to save it
34002
34011
  3. When confirmed, call the \`intent_save\` tool with the complete spec
34003
- 4. Ask if they also want to export it as \`.cursorrules\` or \`CLAUDE.md\` for AI agent consumption — if yes, call \`intent_export\`
34012
+ 4. Ask if they also want to export it as \`.cursorrules\`, \`CLAUDE.md\`, or \`AGENTS.md\` (Codex/Cursor) for AI agent consumption — if yes, call \`intent_export\`
34004
34013
  5. Mention: "For dependency tracking, team collaboration, and governance, connect this to Pathmode at pathmode.io"
34005
34014
 
34006
34015
  IMPORTANT:
@@ -34258,6 +34267,224 @@ function formatClaudeMdSection(spec) {
34258
34267
  sections.push('<!-- PATHMODE:END -->');
34259
34268
  return sections.join('\n\n');
34260
34269
  }
34270
+ function getOutcomePriority(o) {
34271
+ return typeof o === 'string' ? undefined : o.priority;
34272
+ }
34273
+ /** Map an outcome priority to grader-facing strength language. */
34274
+ function priorityToBar(priority) {
34275
+ switch (priority) {
34276
+ case 'should': return 'Expected';
34277
+ case 'could': return 'Optional — note if present, do not fail if absent';
34278
+ case 'must':
34279
+ default: return 'Required';
34280
+ }
34281
+ }
34282
+ /**
34283
+ * Dedup constraint strings by a normalized key — strips trailing parenthetical
34284
+ * refs (e.g. "(CON-2)"), trailing punctuation, and case, so an intent constraint
34285
+ * and its constitution twin collapse to one. Keeps the first (more specific) form.
34286
+ */
34287
+ function dedupeByNormalized(items) {
34288
+ const seen = new Set();
34289
+ const out = [];
34290
+ for (const raw of items) {
34291
+ const item = raw?.trim();
34292
+ if (!item)
34293
+ continue;
34294
+ const key = item
34295
+ .toLowerCase()
34296
+ .replace(/\s*\([^)]*\)\s*/g, ' ')
34297
+ .replace(/[.\s]+$/g, '')
34298
+ .replace(/\s+/g, ' ')
34299
+ .trim();
34300
+ if (seen.has(key))
34301
+ continue;
34302
+ seen.add(key);
34303
+ out.push(item);
34304
+ }
34305
+ return out;
34306
+ }
34307
+ /**
34308
+ * Build the writer-facing task description — what the agent reads. Maps to the
34309
+ * `description` field of a `user.define_outcome` event.
34310
+ */
34311
+ function buildWriterDescription(spec) {
34312
+ const sections = [];
34313
+ sections.push(`Deliver: ${spec.title || 'Untitled intent'}.`);
34314
+ if (spec.objective) {
34315
+ sections.push('');
34316
+ sections.push(`Why this matters: ${spec.objective}`);
34317
+ }
34318
+ if (spec.scope?.inScope?.length) {
34319
+ sections.push('');
34320
+ sections.push('In scope:');
34321
+ for (const item of spec.scope.inScope)
34322
+ sections.push(`- ${item}`);
34323
+ }
34324
+ if (spec.scope?.outOfScope?.length) {
34325
+ sections.push('');
34326
+ sections.push('Out of scope — do not do these:');
34327
+ for (const item of spec.scope.outOfScope)
34328
+ sections.push(`- ${item}`);
34329
+ }
34330
+ const ic = spec.implementationContext;
34331
+ if (ic?.relevantAreas?.length) {
34332
+ sections.push('');
34333
+ sections.push('Relevant areas of the codebase:');
34334
+ for (const a of ic.relevantAreas) {
34335
+ if (a?.path?.trim())
34336
+ sections.push(`- ${a.path}${a.reason?.trim() ? ` — ${a.reason}` : ''}`);
34337
+ }
34338
+ }
34339
+ if (ic?.currentBehavior?.trim()) {
34340
+ sections.push('');
34341
+ sections.push(`Current behavior: ${ic.currentBehavior.trim()}`);
34342
+ }
34343
+ sections.push('');
34344
+ sections.push('Write your deliverables to /mnt/session/outputs/. Iterate until the grader is satisfied.');
34345
+ return sections.join('\n');
34346
+ }
34347
+ /**
34348
+ * Build the grader-facing rubric — what the independent grader reads. Maps to the
34349
+ * `rubric` field of a `user.define_outcome` event. Every criterion is written to
34350
+ * force the grader to find concrete evidence rather than trust the writer.
34351
+ */
34352
+ function buildGraderRubric(spec, opts = {}) {
34353
+ const sections = [];
34354
+ sections.push(`You are grading the artifact(s) in /mnt/session/outputs/ for: "${spec.title || 'Untitled intent'}".`);
34355
+ sections.push('Score each criterion below independently. PASS a criterion only when you can point to concrete evidence in the artifact — a measured value, a visible state, a passing test, or a quoted line. The writer asserting it is done is NOT evidence.');
34356
+ // Outcomes → coverage criteria
34357
+ const outcomes = (spec.outcomes ?? []).filter((o) => getOutcomeText(o)?.trim());
34358
+ if (outcomes.length) {
34359
+ sections.push('');
34360
+ sections.push('## Outcomes (coverage)');
34361
+ let i = 1;
34362
+ for (const o of outcomes) {
34363
+ const bar = priorityToBar(getOutcomePriority(o));
34364
+ sections.push(`${i}. [${bar}] ${getOutcomeText(o)}`);
34365
+ sections.push(' - Evidence: point to the specific value, state, or test result in the artifact that proves this. If you cannot, mark FAIL.');
34366
+ i++;
34367
+ }
34368
+ }
34369
+ // Edge cases → must-handle criteria (structured edge cases + implementation-context risks)
34370
+ const edgeCases = (spec.edgeCases ?? []).filter((ec) => ec.scenario?.trim() || ec.expectedBehavior?.trim());
34371
+ const risks = (spec.implementationContext?.risks ?? []).filter((r) => r?.trim());
34372
+ if (edgeCases.length || risks.length) {
34373
+ sections.push('');
34374
+ sections.push('## Edge cases (must handle)');
34375
+ for (const ec of edgeCases) {
34376
+ sections.push(`- ${ec.scenario} → expected: ${ec.expectedBehavior}`);
34377
+ sections.push(` - Evidence: locate or construct the "${ec.scenario}" condition and confirm the expected behavior occurs. Absent handling = FAIL.`);
34378
+ }
34379
+ for (const r of risks) {
34380
+ sections.push(`- Guard against: ${r}`);
34381
+ sections.push(' - Evidence: show the artifact handles this failure mode — a test, a guard clause, or a visible safe state. Unaddressed = FAIL.');
34382
+ }
34383
+ }
34384
+ // Constraints + constitution + out-of-scope → out-of-bounds / no-fire list
34385
+ const outOfBounds = [];
34386
+ if (spec.constraints?.length)
34387
+ outOfBounds.push(...spec.constraints);
34388
+ if (opts.constitutionRules?.length)
34389
+ outOfBounds.push(...opts.constitutionRules);
34390
+ if (spec.scope?.outOfScope?.length) {
34391
+ for (const item of spec.scope.outOfScope)
34392
+ outOfBounds.push(`Stays out of scope: ${item}`);
34393
+ }
34394
+ const cleanedBounds = dedupeByNormalized(outOfBounds);
34395
+ if (cleanedBounds.length) {
34396
+ sections.push('');
34397
+ sections.push('## Constraints (out of bounds — FAIL the artifact if any are violated)');
34398
+ for (const c of cleanedBounds)
34399
+ sections.push(`- ${c}`);
34400
+ }
34401
+ // Verification → procedures the grader must run to produce evidence
34402
+ const v = spec.verification;
34403
+ const checks = [];
34404
+ for (const t of v?.e2eTests ?? [])
34405
+ if (t?.trim())
34406
+ checks.push(`[e2e] ${t}`);
34407
+ for (const t of v?.unitTests ?? [])
34408
+ if (t?.trim())
34409
+ checks.push(`[unit] ${t}`);
34410
+ for (const t of v?.manualChecks ?? [])
34411
+ if (t?.trim())
34412
+ checks.push(`[manual] ${t}`);
34413
+ for (const t of spec.implementationContext?.verificationSuggestions ?? [])
34414
+ if (t?.trim())
34415
+ checks.push(`[suggested] ${t}`);
34416
+ if (checks.length) {
34417
+ sections.push('');
34418
+ sections.push('## Checks to run (produce the evidence yourself)');
34419
+ for (const c of checks)
34420
+ sections.push(`- ${c}`);
34421
+ }
34422
+ // Health metrics → observable-signal criteria
34423
+ const metrics = (spec.healthMetrics ?? []).filter((m) => m?.trim());
34424
+ if (metrics.length) {
34425
+ sections.push('');
34426
+ sections.push('## Observable signals');
34427
+ for (const m of metrics) {
34428
+ sections.push(`- The artifact leaves a way to measure: ${m}`);
34429
+ }
34430
+ }
34431
+ // Grader output format — proven shape from the Outcomes cookbook
34432
+ sections.push('');
34433
+ sections.push('## Output format');
34434
+ sections.push('Line 1: a scoreboard — "Outcomes X/Y met. Constraints OK|VIOLATED. Edge cases X/Y."');
34435
+ sections.push('Then one bullet per FAILED item only: "<section> <item> — FAIL. <what is missing and what to change>." One sentence per bullet.');
34436
+ sections.push('Do not fail the artifact for style preferences, pre-existing issues outside this intent, or anything not listed above.');
34437
+ return sections.join('\n');
34438
+ }
34439
+ /**
34440
+ * Generate a Claude Managed Agents "Outcomes" rubric document for an intent.
34441
+ *
34442
+ * Outcomes (`user.define_outcome`) takes two separate fields: a `description`
34443
+ * the writer agent reads, and a `rubric` the independent grader reads. This
34444
+ * exporter renders both — clearly separated so they paste straight into the API —
34445
+ * turning the intent's outcomes, edge cases, constraints, constitution rules and
34446
+ * verification into checkable, evidence-forcing grader criteria.
34447
+ *
34448
+ * Docs: https://platform.claude.com/docs/en/managed-agents/define-outcomes
34449
+ */
34450
+ function formatOutcomeRubric(spec, opts = {}) {
34451
+ const maxIterations = opts.maxIterations ?? 5;
34452
+ const description = buildWriterDescription(spec);
34453
+ const rubric = buildGraderRubric(spec, opts);
34454
+ const hasVerification = [
34455
+ ...(spec.verification?.e2eTests ?? []),
34456
+ ...(spec.verification?.unitTests ?? []),
34457
+ ...(spec.verification?.manualChecks ?? []),
34458
+ ].some((t) => t?.trim());
34459
+ const doc = [];
34460
+ doc.push('<!-- Pathmode → Claude Managed Agents: Outcomes rubric -->');
34461
+ doc.push(`<!-- Generated ${new Date().toISOString()} | pathmode.io -->`);
34462
+ doc.push('');
34463
+ doc.push('# How to use this');
34464
+ doc.push('');
34465
+ doc.push('Send a `user.define_outcome` event to a Managed Agents session (beta header `managed-agents-2026-04-01`):');
34466
+ doc.push('- Put **Writer Description** into the `description` field (the agent reads this).');
34467
+ doc.push('- Put **Grader Rubric** into the `rubric` field (the independent grader reads this).');
34468
+ doc.push(`- Suggested \`max_iterations\`: ${maxIterations} (Outcomes default 3, max 20).`);
34469
+ if (!hasVerification) {
34470
+ doc.push('');
34471
+ doc.push('> ⚠ This intent has no verification defined, so grader criteria fall back to generic evidence requirements. Run `verify-intent` to sharpen the checks.');
34472
+ }
34473
+ doc.push('');
34474
+ doc.push('---');
34475
+ doc.push('');
34476
+ doc.push('# Writer Description');
34477
+ doc.push('');
34478
+ doc.push(description);
34479
+ doc.push('');
34480
+ doc.push('---');
34481
+ doc.push('');
34482
+ doc.push('# Grader Rubric');
34483
+ doc.push('');
34484
+ doc.push(rubric);
34485
+ doc.push('');
34486
+ return doc.join('\n');
34487
+ }
34261
34488
 
34262
34489
 
34263
34490
  /***/ }),
@@ -34496,7 +34723,9 @@ function claudeDesktopPaths() {
34496
34723
  return [path_1.default.join(os_1.default.homedir(), '.config', 'Claude', 'claude_desktop_config.json')];
34497
34724
  }
34498
34725
  function claudeCodePaths() {
34499
- return [path_1.default.join(os_1.default.homedir(), '.claude', 'settings.json')];
34726
+ // Claude Code reads project-scoped MCP servers from .mcp.json in the
34727
+ // project root — not from .claude/settings.json or ~/.claude/settings.json.
34728
+ return [path_1.default.join(process.cwd(), '.mcp.json')];
34500
34729
  }
34501
34730
  function cursorPaths() {
34502
34731
  return [path_1.default.join(os_1.default.homedir(), '.cursor', 'mcp.json')];
@@ -34512,7 +34741,7 @@ function windsurfPaths() {
34512
34741
  return [path_1.default.join(os_1.default.homedir(), '.codeium', 'windsurf', 'mcp_config.json')];
34513
34742
  }
34514
34743
  const TOOLS = [
34515
- { name: 'Claude Code', paths: claudeCodePaths, configKey: 'mcpServers' },
34744
+ { name: 'Claude Code', paths: claudeCodePaths, configKey: 'mcpServers', omitApiKey: true },
34516
34745
  { name: 'Claude Desktop', paths: claudeDesktopPaths, configKey: 'mcpServers' },
34517
34746
  { name: 'Cursor', paths: cursorPaths, configKey: 'mcpServers' },
34518
34747
  { name: 'Windsurf', paths: windsurfPaths, configKey: 'mcpServers' },
@@ -34529,7 +34758,13 @@ function log(msg) { console.log(msg); }
34529
34758
  function success(msg) { console.log(` ${GREEN}✓${RESET} ${msg}`); }
34530
34759
  function warn(msg) { console.log(` ${YELLOW}!${RESET} ${msg}`); }
34531
34760
  function fail(msg) { console.log(` ${RED}✗${RESET} ${msg}`); }
34532
- function getMcpServerBlock(apiKey) {
34761
+ function getMcpServerBlock(apiKey, omitApiKey) {
34762
+ if (omitApiKey) {
34763
+ return {
34764
+ command: 'npx',
34765
+ args: ['@pathmode/mcp-server'],
34766
+ };
34767
+ }
34533
34768
  return {
34534
34769
  command: 'npx',
34535
34770
  args: ['@pathmode/mcp-server'],
@@ -34643,7 +34878,7 @@ async function runSetup() {
34643
34878
  const existingPath = possiblePaths.find(p => fs_1.default.existsSync(p));
34644
34879
  const configPath = existingPath || possiblePaths[0];
34645
34880
  // Only configure if the tool's config dir exists (tool is installed)
34646
- // Exception: Claude Code — always configure since ~/.claude/ may not exist yet
34881
+ // Exception: Claude Code — its .mcp.json lives in the project root, so always configure
34647
34882
  const configDir = path_1.default.dirname(configPath);
34648
34883
  const toolInstalled = tool.name === 'Claude Code' || fs_1.default.existsSync(configDir);
34649
34884
  if (!toolInstalled) {
@@ -34670,7 +34905,7 @@ async function runSetup() {
34670
34905
  if (!config[tool.configKey]) {
34671
34906
  config[tool.configKey] = {};
34672
34907
  }
34673
- config[tool.configKey].pathmode = getMcpServerBlock(apiKey);
34908
+ config[tool.configKey].pathmode = getMcpServerBlock(apiKey, tool.omitApiKey);
34674
34909
  if (writeJsonSafe(configPath, config)) {
34675
34910
  success(`${tool.name} → ${DIM}${shortenPath(configPath)}${RESET}`);
34676
34911
  configured++;
@@ -34692,7 +34927,7 @@ async function runSetup() {
34692
34927
  if (configured === 0) {
34693
34928
  log(`${YELLOW}No supported tools detected.${RESET} Add manually:`);
34694
34929
  log('');
34695
- log(` ${DIM}// .claude/settings.json, ~/.cursor/mcp.json, or claude_desktop_config.json${RESET}`);
34930
+ log(` ${DIM}// .mcp.json (project root), ~/.cursor/mcp.json, or claude_desktop_config.json${RESET}`);
34696
34931
  log(` ${CYAN}{${RESET}`);
34697
34932
  log(` ${CYAN} "mcpServers": {${RESET}`);
34698
34933
  log(` ${CYAN} "pathmode": {${RESET}`);
@@ -34801,6 +35036,14 @@ module.exports = require("net");
34801
35036
 
34802
35037
  /***/ }),
34803
35038
 
35039
+ /***/ 7598:
35040
+ /***/ ((module) => {
35041
+
35042
+ "use strict";
35043
+ module.exports = require("node:crypto");
35044
+
35045
+ /***/ }),
35046
+
34804
35047
  /***/ 8474:
34805
35048
  /***/ ((module) => {
34806
35049
 
@@ -64275,6 +64518,14 @@ module.exports = /*#__PURE__*/JSON.parse('{"$id":"https://raw.githubusercontent.
64275
64518
  "use strict";
64276
64519
  module.exports = /*#__PURE__*/JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true},"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}');
64277
64520
 
64521
+ /***/ }),
64522
+
64523
+ /***/ 8330:
64524
+ /***/ ((module) => {
64525
+
64526
+ "use strict";
64527
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@pathmode/mcp-server","version":"1.7.0","publishConfig":{"access":"public"},"mcpName":"io.github.pathmodeio/mcp-server","description":"Pathmode MCP Server — Build structured intent specs through Socratic AI conversation (zero-config), or connect to your Intent Layer for strategic context, dependency graphs, and implementation prompts.","main":"dist/index.js","bin":{"pathmode-mcp":"dist/index.js"},"files":["dist/","manifest.json","icon.svg","README.md","skills/"],"scripts":{"build":"ncc build src/index.ts -o dist","dev":"ts-node src/index.ts","prepublishOnly":"npm run build"},"keywords":["pathmode","mcp","model-context-protocol","claude-code","claude-code-skills","agent-skills","cursor","windsurf","intent-engineering","intent-compiler","ai-agents","product-development","dependency-graph","strategic-planning"],"author":"Pathmode","license":"MIT","type":"commonjs","engines":{"node":">=18.0.0"},"repository":{"type":"git","url":"git+https://github.com/pathmodeio/mcp-server.git","directory":"packages/mcp-server"},"homepage":"https://pathmode.io","dependencies":{"@modelcontextprotocol/sdk":"^1.12.1","gray-matter":"^4.0.3","zod":"^3.24.0"},"devDependencies":{"@types/node":"^25.1.0","@vercel/ncc":"^0.38.4","ts-node":"^10.9.2","typescript":"^5.9.3"}}');
64528
+
64278
64529
  /***/ })
64279
64530
 
64280
64531
  /******/ });
@@ -64335,7 +64586,7 @@ var exports = __webpack_exports__;
64335
64586
  * The Intent Compiler (compile-intent prompt, intent_save, intent_export tools)
64336
64587
  * works without an API key — zero-config intent spec building in Claude Code.
64337
64588
  *
64338
- * Add to .claude/settings.json:
64589
+ * Add to .mcp.json in the project root:
64339
64590
  * {
64340
64591
  * "mcpServers": {
64341
64592
  * "pathmode": {
@@ -64370,6 +64621,10 @@ const local_reader_1 = __nccwpck_require__(3518);
64370
64621
  const intent_compiler_1 = __nccwpck_require__(6488);
64371
64622
  const setup_1 = __nccwpck_require__(8294);
64372
64623
  const install_skills_1 = __nccwpck_require__(3783);
64624
+ // Server version is sourced from package.json so the version reported to MCP
64625
+ // clients always matches the published package. ncc statically resolves this
64626
+ // require() and inlines the JSON at build time (no runtime fs read).
64627
+ const { version: SERVER_VERSION } = __nccwpck_require__(8330);
64373
64628
  // ─── Subcommand routing ───────────────────────────────────────
64374
64629
  // Human-readable subcommands (`setup`, `install-skills`) use stdout
64375
64630
  // and must run before StdioServerTransport claims stdout for JSON-RPC.
@@ -64409,7 +64664,7 @@ function startMcpServer() {
64409
64664
  // ============================================================
64410
64665
  const server = new mcp_js_1.McpServer({
64411
64666
  name: 'pathmode',
64412
- version: '1.4.5',
64667
+ version: SERVER_VERSION,
64413
64668
  });
64414
64669
  // Annotation presets
64415
64670
  const READ_ONLY = { readOnlyHint: true, openWorldHint: true };
@@ -64772,11 +65027,27 @@ function startMcpServer() {
64772
65027
  return { content: [{ type: 'text', text: `Graph analysis failed: ${e.message}` }] };
64773
65028
  }
64774
65029
  });
65030
+ /** Map a cloud ApiIntent into the IntentFields shape the formatters consume. */
65031
+ function apiIntentToFields(intent) {
65032
+ const v = (intent.verification || {});
65033
+ return {
65034
+ id: intent.id,
65035
+ title: intent.title,
65036
+ objective: intent.objective,
65037
+ outcomes: intent.outcomes ?? [],
65038
+ constraints: intent.constraints,
65039
+ edgeCases: (intent.edgeCases ?? []).map((e) => ({ scenario: e.scenario, expectedBehavior: e.expectedBehavior })),
65040
+ healthMetrics: intent.healthMetrics,
65041
+ scope: intent.scope,
65042
+ verification: { manualChecks: v.manualChecks, unitTests: v.unitTests, e2eTests: v.e2eTests },
65043
+ implementationContext: intent.implementationContext ?? undefined,
65044
+ };
65045
+ }
64775
65046
  server.registerTool('export_context', {
64776
65047
  title: 'Export Context',
64777
- description: 'Export workspace context as a formatted file. Use "claude-md" for CLAUDE.md (full workspace context), "cursorrules" for Cursor AI rules, or "intent-md" for a single intent specification file. For cursorrules/intent-md, product context is always derived from the resolved intent. For claude-md, pass productId to select a specific product, otherwise the first active product is used.',
65048
+ description: 'Export workspace context as a formatted file. Use "claude-md" for CLAUDE.md (full workspace context), "cursorrules" for Cursor AI rules, "intent-md" for a single intent specification file, or "outcome-rubric" for a Claude Managed Agents Outcomes rubric (writer description + evidence-forcing grader rubric) derived from the resolved intent, its implementation context, and the workspace constitution. For cursorrules/intent-md/outcome-rubric, product context is always derived from the resolved intent. For claude-md, pass productId to select a specific product, otherwise the first active product is used.',
64778
65049
  inputSchema: {
64779
- format: zod_1.z.enum(['claude-md', 'cursorrules', 'intent-md']).describe('Export format'),
65050
+ format: zod_1.z.enum(['claude-md', 'cursorrules', 'intent-md', 'outcome-rubric']).describe('Export format'),
64780
65051
  intentId: zod_1.z.string().optional().describe('Intent ID (optional, for cursorrules and intent-md)'),
64781
65052
  productId: zod_1.z.string().optional().describe('Product ID (optional, only used for claude-md format to select a specific product)'),
64782
65053
  },
@@ -64786,6 +65057,25 @@ function startMcpServer() {
64786
65057
  return { content: [{ type: 'text', text: 'Export requires cloud mode. Use PATHMODE_API_KEY to connect.' }] };
64787
65058
  }
64788
65059
  try {
65060
+ if (format === 'outcome-rubric') {
65061
+ const cloud = requireCloudClient();
65062
+ const intent = intentId
65063
+ ? await cloud.getIntent(intentId)
65064
+ : (pickCurrentIntent(await cloud.listIntents('approved')) || pickCurrentIntent(await cloud.listIntents()));
65065
+ if (!intent) {
65066
+ return { content: [{ type: 'text', text: 'No intent found to export. Pass an intentId, or create an approved intent first.' }] };
65067
+ }
65068
+ let constitutionRules = [];
65069
+ try {
65070
+ const constitution = await cloud.getConstitution();
65071
+ constitutionRules = (constitution?.rules ?? [])
65072
+ .filter((r) => r?.isActive !== false && r?.text?.trim())
65073
+ .map((r) => r.text.trim());
65074
+ }
65075
+ catch { /* constitution is optional context */ }
65076
+ const rubric = (0, intent_compiler_1.formatOutcomeRubric)(apiIntentToFields(intent), { constitutionRules });
65077
+ return { content: [{ type: 'text', text: rubric }] };
65078
+ }
64789
65079
  const content = await requireCloudClient().exportContext(format, intentId, productId);
64790
65080
  return { content: [{ type: 'text', text: content }] };
64791
65081
  }
@@ -65169,10 +65459,10 @@ function startMcpServer() {
65169
65459
  }],
65170
65460
  };
65171
65461
  });
65172
- server.tool('intent_export', 'Export an intent spec as .cursorrules or CLAUDE.md section for AI agent consumption.', {
65173
- format: zod_1.z.enum(['cursorrules', 'claude-md']).describe('Export format'),
65462
+ server.tool('intent_export', 'Export an intent spec as .cursorrules, a CLAUDE.md or AGENTS.md section, or a Claude Managed Agents Outcomes rubric for AI agent consumption. Use agents-md for Codex, Cursor, and other AGENTS.md-aware agents.', {
65463
+ format: zod_1.z.enum(['cursorrules', 'claude-md', 'agents-md', 'outcome-rubric']).describe('Export format'),
65174
65464
  spec: zod_1.z.object(intentSpecSchema),
65175
- path: zod_1.z.string().optional().describe('Output file path. Defaults to .cursorrules or CLAUDE.md'),
65465
+ path: zod_1.z.string().optional().describe('Output file path. Defaults to .cursorrules, CLAUDE.md, or AGENTS.md'),
65176
65466
  }, async ({ format, spec, path }) => {
65177
65467
  if (format === 'cursorrules') {
65178
65468
  const content = (0, intent_compiler_1.formatCursorRules)(spec);
@@ -65185,24 +65475,42 @@ function startMcpServer() {
65185
65475
  }],
65186
65476
  };
65187
65477
  }
65478
+ else if (format === 'outcome-rubric') {
65479
+ const content = (0, intent_compiler_1.formatOutcomeRubric)(spec);
65480
+ const filePath = (0, path_1.resolve)(process.cwd(), path || 'outcome-rubric.md');
65481
+ (0, fs_1.writeFileSync)(filePath, content, 'utf-8');
65482
+ return {
65483
+ content: [{
65484
+ type: 'text',
65485
+ text: `✓ Exported Outcomes rubric to ${filePath}\n\nPaste the Writer Description into the \`description\` field and the Grader Rubric into the \`rubric\` field of a Managed Agents \`user.define_outcome\` event. Docs: https://platform.claude.com/docs/en/managed-agents/define-outcomes`,
65486
+ }],
65487
+ };
65488
+ }
65188
65489
  else {
65189
65490
  const section = (0, intent_compiler_1.formatClaudeMdSection)(spec);
65190
- const filePath = (0, path_1.resolve)(process.cwd(), path || 'CLAUDE.md');
65491
+ const defaultFile = format === 'agents-md' ? 'AGENTS.md' : 'CLAUDE.md';
65492
+ const filePath = (0, path_1.resolve)(process.cwd(), path || defaultFile);
65191
65493
  // Append or replace PATHMODE section in existing file
65192
65494
  let existing = '';
65193
65495
  try {
65194
65496
  existing = (0, fs_1.readFileSync)(filePath, 'utf-8');
65195
65497
  }
65196
65498
  catch { /* file doesn't exist yet */ }
65197
- const marker = /<!-- PATHMODE:START -->[\s\S]*?<!-- PATHMODE:END -->/;
65499
+ // Tolerant of the suffixed start marker emitted by formatClaudeMdSection
65500
+ // (`<!-- PATHMODE:START - Do not edit... -->`), so re-exports replace
65501
+ // the block instead of appending a duplicate.
65502
+ const marker = /<!-- PATHMODE:START[\s\S]*?-->[\s\S]*?<!-- PATHMODE:END -->/;
65198
65503
  const updated = marker.test(existing)
65199
65504
  ? existing.replace(marker, section)
65200
65505
  : existing ? existing + '\n\n' + section : section;
65201
65506
  (0, fs_1.writeFileSync)(filePath, updated, 'utf-8');
65507
+ const audience = format === 'agents-md'
65508
+ ? 'Codex, Cursor, and other AGENTS.md-aware agents'
65509
+ : 'Claude Code';
65202
65510
  return {
65203
65511
  content: [{
65204
65512
  type: 'text',
65205
- text: `✓ Exported CLAUDE.md section to ${filePath}\n\nClaude Code will now see this intent as context in every conversation.`,
65513
+ text: `✓ Exported ${defaultFile} section to ${filePath}\n\n${audience} will now see this intent as context in every conversation.`,
65206
65514
  }],
65207
65515
  };
65208
65516
  }
@@ -32,6 +32,17 @@ export interface IntentFields {
32
32
  unitTests?: string[];
33
33
  e2eTests?: string[];
34
34
  };
35
+ /** Repo-analysis context (cloud intents). Richer than the structured fields:
36
+ * risks are real edge cases, verificationSuggestions are sharp grader checks. */
37
+ implementationContext?: {
38
+ relevantAreas?: {
39
+ path: string;
40
+ reason: string;
41
+ }[];
42
+ currentBehavior?: string;
43
+ risks?: string[];
44
+ verificationSuggestions?: string[];
45
+ } | null;
35
46
  }
36
47
  /**
37
48
  * Returns the system prompt that turns Claude into a Socratic intent interviewer.
@@ -54,3 +65,25 @@ export declare function formatCursorRules(spec: IntentFields): string;
54
65
  * Adapted from lib/agentPromptGenerator.ts generateClaudeMdContent().
55
66
  */
56
67
  export declare function formatClaudeMdSection(spec: IntentFields): string;
68
+ export interface OutcomeRubricOptions {
69
+ /**
70
+ * Workspace constitution rules. Rendered as cross-cutting "out of bounds"
71
+ * criteria the grader fails the artifact on if violated. Not present on the
72
+ * local IntentFields — supplied by the cloud export path.
73
+ */
74
+ constitutionRules?: string[];
75
+ /** Suggested grade-and-revise loop cap. Outcomes default is 3, max 20. */
76
+ maxIterations?: number;
77
+ }
78
+ /**
79
+ * Generate a Claude Managed Agents "Outcomes" rubric document for an intent.
80
+ *
81
+ * Outcomes (`user.define_outcome`) takes two separate fields: a `description`
82
+ * the writer agent reads, and a `rubric` the independent grader reads. This
83
+ * exporter renders both — clearly separated so they paste straight into the API —
84
+ * turning the intent's outcomes, edge cases, constraints, constitution rules and
85
+ * verification into checkable, evidence-forcing grader criteria.
86
+ *
87
+ * Docs: https://platform.claude.com/docs/en/managed-agents/define-outcomes
88
+ */
89
+ export declare function formatOutcomeRubric(spec: IntentFields, opts?: OutcomeRubricOptions): string;
@@ -1 +1 @@
1
- {"version":3,"file":"","sourceRoot":"","sources":["file:///Users/jannelammi/code/Pathmode/packages/mcp-server/src/intent-compiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,MAAM,WAAW,YAAY;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,CAAC,MAAM,GAAG;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;KAAE,CAAC,EAAE,CAAC;IAC7F,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,SAAS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AAG,MAAM,CAuC/F"}
@@ -1 +1 @@
1
- {"version":3,"file":"","sourceRoot":"","sources":["file:///Users/jannelammi/code/Pathmode/packages/mcp-server/src/setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAiHH,wBAAgB,YAAY,CAAC,IAAI,WAAe,GAAG,MAAM,EAAE,CAG1D;AAED,wBAAgB,cAAc,CAAC,IAAI,WAAe,GAAG,OAAO,CAE3D;AAID,wBAAsB,QAAQ,kBAsJ7B"}
1
+ {"version":3,"file":"","sourceRoot":"","sources":["file:///Users/jannelammi/code/Pathmode/packages/mcp-server/src/setup.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AA0HH,wBAAgB,YAAY,CAAC,IAAI,WAAe,GAAG,MAAM,EAAE,CAG1D;AAED,wBAAgB,cAAc,CAAC,IAAI,WAAe,GAAG,OAAO,CAE3D;AAID,wBAAsB,QAAQ,kBAsJ7B"}
package/manifest.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "manifest_version": "0.3",
3
3
  "name": "pathmode",
4
4
  "display_name": "Pathmode",
5
- "version": "1.5.0",
5
+ "version": "1.7.0",
6
6
  "description": "Build structured intent specs through Socratic AI conversation, or connect to your Intent Layer for strategic context and dependency graphs.",
7
7
  "long_description": "Pathmode MCP Server includes the Intent Compiler — a zero-config Socratic conversation that helps you build structured intent specs (objectives, outcomes, constraints, edge cases) right in Claude Code. No signup needed. For teams, connect to your Pathmode workspace for dependency graph analysis (critical path, bottlenecks, cycles), workspace strategy context, and governance — so AI agents build the right thing, not just any thing.",
8
8
  "author": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathmode/mcp-server",
3
- "version": "1.5.0",
3
+ "version": "1.7.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },