@pathmode/mcp-server 1.4.2 → 1.4.4

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
@@ -6,7 +6,7 @@ No signup. No API key. Just add the MCP server and start talking.
6
6
 
7
7
  ## Intent Compiler
8
8
 
9
- The Intent Compiler turns Claude Code into a Socratic product thinking partner. Describe a problem, paste a support ticket, or explain what's broken — Claude challenges vague thinking, asks pointed questions, and builds a structured spec.
9
+ The Intent Compiler turns Claude Code into a Socratic product thinking partner. Describe a problem, paste a support ticket, or explain what's broken — Claude challenges vague thinking, asks pointed questions, runs live quality checks on weak fields, and builds a structured spec.
10
10
 
11
11
  ```
12
12
  > Help me write an intent spec for our checkout flow
@@ -185,9 +185,9 @@ Read `intent.md` files from your project directory without an API key:
185
185
 
186
186
  | Tool | Description |
187
187
  |------|-------------|
188
- | `export_context` | Generate CLAUDE.md, .cursorrules, or intent.md files |
188
+ | `export_context` | Generate CLAUDE.md, .cursorrules, or intent.md files. For claude-md, optionally pass a product ID; for cursorrules/intent-md, product is derived from the resolved intent |
189
189
  | `get_agent_prompt` | Get a structured execution prompt for an intent |
190
- | `get_workspace` | Get workspace details including strategy and constitution |
190
+ | `get_workspace` | Get workspace details including strategy, active products, and constitution |
191
191
  | `get_constitution` | Get mandatory constraint rules for the workspace |
192
192
 
193
193
  #### Team Prompts
@@ -7,6 +7,11 @@ export interface PathmodeConfig {
7
7
  apiUrl: string;
8
8
  workspaceId: string;
9
9
  }
10
+ export interface ApiStructuredOutcome {
11
+ id: string;
12
+ text: string;
13
+ priority?: 'must' | 'should' | 'could';
14
+ }
10
15
  export interface ApiIntent {
11
16
  id: string;
12
17
  workspaceId: string;
@@ -19,8 +24,12 @@ export interface ApiIntent {
19
24
  objective: string;
20
25
  problemSeverity?: string;
21
26
  title: string;
22
- outcomes: string[];
27
+ outcomes: ApiStructuredOutcome[];
23
28
  healthMetrics: string[];
29
+ scope?: {
30
+ inScope?: string[];
31
+ outOfScope?: string[];
32
+ };
24
33
  strategicAlignment?: string;
25
34
  alignmentNotes?: string;
26
35
  context: Record<string, any>;
@@ -47,7 +56,10 @@ export interface CreateIntentInput {
47
56
  title: string;
48
57
  objective: string;
49
58
  productId: string;
50
- outcomes?: string[];
59
+ outcomes?: (string | {
60
+ text: string;
61
+ priority?: string;
62
+ })[];
51
63
  constraints?: string[];
52
64
  healthMetrics?: string[];
53
65
  edgeCases?: {
@@ -60,11 +72,18 @@ export interface CreateIntentInput {
60
72
  e2eTests?: string[];
61
73
  };
62
74
  problemSeverity?: string;
75
+ scope?: {
76
+ inScope?: string[];
77
+ outOfScope?: string[];
78
+ };
63
79
  }
64
80
  export interface UpdateIntentInput {
65
81
  title?: string;
66
82
  objective?: string;
67
- outcomes?: string[];
83
+ outcomes?: (string | {
84
+ text: string;
85
+ priority?: string;
86
+ })[];
68
87
  constraints?: string[];
69
88
  healthMetrics?: string[];
70
89
  edgeCases?: {
@@ -78,6 +97,10 @@ export interface UpdateIntentInput {
78
97
  };
79
98
  problemSeverity?: string;
80
99
  evidenceAnchors?: Record<string, string[]>;
100
+ scope?: {
101
+ inScope?: string[];
102
+ outOfScope?: string[];
103
+ };
81
104
  }
82
105
  export interface EvidenceQuery {
83
106
  productId?: string;
@@ -140,6 +163,7 @@ export interface ApiWorkspace {
140
163
  nonNegotiables?: string[];
141
164
  architecturePrinciples?: string[];
142
165
  } | null;
166
+ products?: ApiProduct[];
143
167
  constitutionRules: {
144
168
  id: string;
145
169
  category: string;
@@ -148,6 +172,24 @@ export interface ApiWorkspace {
148
172
  createdAt: string;
149
173
  }[];
150
174
  }
175
+ export interface ApiProduct {
176
+ id: string;
177
+ workspaceId: string;
178
+ name: string;
179
+ slug: string;
180
+ description?: string;
181
+ productVision?: string;
182
+ northStar?: string;
183
+ targetAudience?: string;
184
+ defaultContext?: Record<string, any>;
185
+ manifest?: Record<string, any>;
186
+ icon?: string;
187
+ color?: string;
188
+ status: string;
189
+ createdBy: string;
190
+ createdAt: string;
191
+ updatedAt: string;
192
+ }
151
193
  export declare function loadConfig(): PathmodeConfig | null;
152
194
  export declare class PathmodeClient {
153
195
  private apiKey;
@@ -177,7 +219,7 @@ export declare class PathmodeClient {
177
219
  getWorkspace(): Promise<ApiWorkspace>;
178
220
  getConstitution(): Promise<any>;
179
221
  exportClaudeMd(): Promise<string>;
180
- exportContext(format: 'claude-md' | 'cursorrules' | 'intent-md', intentId?: string): Promise<string>;
222
+ exportContext(format: 'claude-md' | 'cursorrules' | 'intent-md', intentId?: string, productId?: string): Promise<string>;
181
223
  createIntent(input: CreateIntentInput): Promise<ApiIntent>;
182
224
  updateIntent(id: string, updates: UpdateIntentInput): Promise<ApiIntent>;
183
225
  queryEvidence(filters?: EvidenceQuery): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"","sourceRoot":"","sources":["file:///Users/jannelammi/code/Pathmode/packages/mcp-server/src/api-client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,SAAS;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,cAAc,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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.js CHANGED
@@ -33619,10 +33619,12 @@ class PathmodeClient {
33619
33619
  const res = await this.fetch('/export?format=claude-md');
33620
33620
  return res.text();
33621
33621
  }
33622
- async exportContext(format, intentId) {
33622
+ async exportContext(format, intentId, productId) {
33623
33623
  const params = new URLSearchParams({ format });
33624
33624
  if (intentId)
33625
33625
  params.set('intent_id', intentId);
33626
+ if (productId)
33627
+ params.set('product_id', productId);
33626
33628
  const res = await this.fetch(`/export?${params.toString()}`);
33627
33629
  return res.text();
33628
33630
  }
@@ -33698,6 +33700,54 @@ exports.getCompileIntentPrompt = getCompileIntentPrompt;
33698
33700
  exports.formatIntentMd = formatIntentMd;
33699
33701
  exports.formatCursorRules = formatCursorRules;
33700
33702
  exports.formatClaudeMdSection = formatClaudeMdSection;
33703
+ /** Extract text from a string or structured outcome. */
33704
+ function getOutcomeText(o) {
33705
+ return typeof o === 'string' ? o : o.text;
33706
+ }
33707
+ /** Get priority label prefix for an outcome. */
33708
+ function getPriorityLabel(o) {
33709
+ if (typeof o === 'string' || !o.priority)
33710
+ return '';
33711
+ return `[${o.priority.toUpperCase()}] `;
33712
+ }
33713
+ function getLiveQualityCheckPromptBlock() {
33714
+ return `LIVE QUALITY CHECKS:
33715
+ - After EVERY meaningful user answer, silently update your current draft and run a quality pass before asking the next question.
33716
+ - Do NOT dump the full rubric every turn. Surface only the single most important failing check right now.
33717
+ - State the issue plainly, then ask ONE pointed follow-up question that resolves that weakness.
33718
+
33719
+ QUALITY RUBRIC:
33720
+ 1. Objective quality
33721
+ - Reject vague words like "improve", "better", "enhance", "optimize", "streamline".
33722
+ - Reject objectives that are too broad, too short, or missing who is affected and why it matters.
33723
+ - If the same objective could describe five different projects, it is still vague.
33724
+
33725
+ 2. Outcome quality
33726
+ - Outcomes must be observable state changes, not implementation steps or task lists.
33727
+ - Push back on outcomes like "add a dashboard", "build retry logic", "create a modal", "improve UX".
33728
+ - Prefer outcomes like "Users see retry guidance within 5 seconds of failure".
33729
+
33730
+ 3. Testability
33731
+ - If an outcome cannot be checked by a test, metric, or concrete manual observation, it is not ready.
33732
+ - Push toward measurable language: percentages, timing thresholds, binary states, visible user actions, or explicit system behavior.
33733
+
33734
+ 4. Objective/outcome consistency
33735
+ - Check whether the proposed outcomes actually prove the objective is solved.
33736
+ - Call out mismatches directly: "The objective is about speed, but the outcomes only mention clarity."
33737
+
33738
+ 5. Edge-case coverage
33739
+ - Before the spec is ready, require at least one embarrassing failure mode, boundary condition, timeout, empty state, permission issue, or concurrency issue.
33740
+
33741
+ 6. Verification quality
33742
+ - As soon as an outcome becomes clear, ask what evidence would prove it worked.
33743
+ - Verification can be a test, a metric, or a manual check, but it must be concrete.
33744
+
33745
+ EXAMPLES OF HOW TO SURFACE A FAILING CHECK:
33746
+ - "Quality check: the objective is still vague. It says improve, but not what breaks today."
33747
+ - "Quality check: that outcome is an implementation step, not a user-visible result."
33748
+ - "Quality check: your outcomes don't yet prove the problem is solved."
33749
+ - "Quality check: we still have no failure mode, so this spec is not ready yet."`;
33750
+ }
33701
33751
  // ============================================================
33702
33752
  // Compile Intent Prompt
33703
33753
  // ============================================================
@@ -33706,47 +33756,44 @@ exports.formatClaudeMdSection = formatClaudeMdSection;
33706
33756
  * Adapted from intentDesignerMachine.ts conversationFirstPreamble for terminal use.
33707
33757
  */
33708
33758
  function getCompileIntentPrompt() {
33709
- return `You are a sharp product thinking partner. Your job is to help the user build a structured intent spec through conversation — challenging their thinking until the intent is so clear it's almost obvious what to build.
33759
+ return `You are a sharp product thinking partner. Your job is to help the user build a structured intent spec through conversation — challenging their thinking until the intent is so clear it's almost obvious what to build. Your overarching goal is to actively prevent a spec from feeling complete before it is operationally sharp.
33710
33760
 
33711
33761
  RULES:
33712
- - Push back on vague language. If the user says "improve the experience", ask: "What specific moment is broken? What would the user see differently?"
33713
33762
  - Ask ONE pointed question at a time. Never list 3 questions.
33714
- - When the user gives a clear answer, propose how you'd write that as a spec field. Explain WHY you worded it that way.
33715
- - Look for inconsistencies between what they say the problem is and what outcomes they propose.
33716
33763
  - Be direct and concise. No pleasantries. No "Great question!" or "That's a good point!"
33717
- - When the spec has existing content, critique it before adding more. Quality over quantity.
33764
+ - Push back on vague language. If the user says "improve the experience", ask: "What specific moment is broken? What would the user see differently?"
33765
+ - CONTRADICTION DETECTION: Actively hunt for inconsistencies. Examples: "Your objective says speed, but your outcomes only mention visibility" or "You want no extra steps, but your constraint adds mandatory confirmation." Call them out bluntly.
33766
+
33767
+ ${getLiveQualityCheckPromptBlock()}
33768
+
33769
+ EVIDENCE-FIRST GROUNDING:
33770
+ - Begin by asking for ONE concrete artifact: a direct user quote, a specific drop-off metric, a support ticket, or an observed failure. Reduce "cleanly written but weakly justified" specs by forcing reality early.
33718
33771
 
33719
- VOICE:
33720
- - Short sentences. Direct. Like a smart colleague, not a consultant.
33721
- - Use concrete examples when challenging: "When you say 'faster', do you mean 2 seconds or 20 seconds?"
33722
- - When you write spec fields, use precise language. No filler words.
33772
+ EARLIER VERIFICATION BACK-CHAINING:
33773
+ - Do not wait until the end to figure out verification.
33774
+ - The moment the user proposes an outcome, back-chain perfectly: "If we achieve that outcome, exactly how will we know it worked? What test or metric proves it?" Outcomes and verification must be paired immediately.
33775
+
33776
+ VISIBLE COMPLETENESS STATE:
33777
+ Once the conversation is underway, append a small checklist at the bottom of your messages to keep the state explicit. Do not mark an item complete until it genuinely meets a high quality bar.
33778
+
33779
+ STATUS:
33780
+ [ ] Objective clear enough (and backed by evidence)
33781
+ [ ] At least 2 testable outcomes
33782
+ [ ] At least 1 failure mode (edge case)
33783
+ [ ] Scope boundaries named (constraints / out of scope)
33784
+ [ ] Verification present or explicitly deferred
33723
33785
 
33724
33786
  CONVERSATION FLOW (guidance, not rigid steps):
33725
- 1. **Problem** — What's broken? What's the pain? What happens today that shouldn't?
33726
- 2. **Goal** — What specific user outcome would solve this? Make it concrete and singular.
33727
- 3. **Outcomes** — Observable, testable state changes. Not activities, not implementations.
33728
- 4. **Edge Cases** — What's the most embarrassing way this could fail in a demo?
33729
- 5. **Review** — Play devil's advocate. What's missing? What would you cut?
33730
-
33731
- You are NOT bound by this order. Follow the user's thinking wherever it goes. If they start with edge cases, work backwards to the objective.
33732
-
33733
- BUILDING THE SPEC:
33734
- As the conversation progresses, keep a mental model of the spec fields:
33735
- - **Title**: Short name for the intent (what is this?)
33736
- - **Objective**: Why this matters — the problem and who has it
33737
- - **Outcomes**: 2-5 observable, testable results (not activities)
33738
- - **Constraints**: Hard limits the implementation must respect
33739
- - **Edge Cases**: Scenario + expected behavior pairs
33740
- - **Health Metrics**: What to monitor after shipping (optional)
33741
- - **Verification**: How to confirm it actually works (optional)
33787
+ 1. **Evidence & Problem** — Ground the intent in a real artifact. What's broken?
33788
+ 2. **Objective** — What specific user outcome solves this pain? Make it concrete.
33789
+ 3. **Outcomes & Verification** — Observable state changes. Instantly back-chain to verification.
33790
+ 4. **Scope & Constraints** — What are the hard boundaries?
33791
+ 5. **Edge Cases** — What's the worst way this could fail?
33742
33792
 
33743
33793
  When you have enough clarity on ANY field, state it clearly:
33744
- > **Proposed Objective**: "Reduce failed deliveries in multi-unit buildings from 23% to under 5% by fixing address resolution at the driver app level."
33745
-
33746
- Then ask if that captures it or needs refinement.
33794
+ > **Proposed Objective**: "Reduce checkout drop-off by 15% by showing upfront shipping costs."
33747
33795
 
33748
- WHEN THE SPEC FEELS READY:
33749
- Once you have at minimum a title, objective, and 2+ outcomes:
33796
+ WHEN THE SPEC FEELS READY AND ALL STATUS ITEMS ARE [X]:
33750
33797
  1. Present the full spec as a summary for the user to review
33751
33798
  2. Ask if they want to save it
33752
33799
  3. When confirmed, call the \`intent_save\` tool with the complete spec
@@ -33754,6 +33801,8 @@ Once you have at minimum a title, objective, and 2+ outcomes:
33754
33801
  5. Mention: "For dependency tracking, team collaboration, and governance, connect this to Pathmode at pathmode.io"
33755
33802
 
33756
33803
  IMPORTANT:
33804
+ - Do not switch into passive note-taking. Use the quality checks continuously while the spec is still forming.
33805
+ - If a field fails a quality check, challenge it before moving on.
33757
33806
  - The spec fields in \`intent_save\` must use this exact structure:
33758
33807
  - title: string
33759
33808
  - objective: string
@@ -33763,7 +33812,7 @@ IMPORTANT:
33763
33812
  - healthMetrics: string[] (optional)
33764
33813
  - verification: { manualChecks?: string[], unitTests?: string[], e2eTests?: string[] } (optional)
33765
33814
 
33766
- Now, ask the user what they're working on. If they've already described something, dig into it.`;
33815
+ Now, start the conversation. If they haven't provided one yet, ask for the concrete evidence (quote, metric, or ticket) driving this work.`;
33767
33816
  }
33768
33817
  // ============================================================
33769
33818
  // Format: intent.md
@@ -33799,7 +33848,21 @@ function formatIntentMd(spec) {
33799
33848
  sections.push('');
33800
33849
  sections.push('## Outcomes');
33801
33850
  for (const outcome of spec.outcomes) {
33802
- sections.push(`- [ ] ${outcome}`);
33851
+ sections.push(`- [ ] ${getPriorityLabel(outcome)}${getOutcomeText(outcome)}`);
33852
+ }
33853
+ }
33854
+ if (spec.scope?.inScope?.length || spec.scope?.outOfScope?.length) {
33855
+ sections.push('');
33856
+ sections.push('## Scope');
33857
+ if (spec.scope.inScope?.length) {
33858
+ sections.push('**In scope:**');
33859
+ for (const s of spec.scope.inScope)
33860
+ sections.push(`- ${s}`);
33861
+ }
33862
+ if (spec.scope.outOfScope?.length) {
33863
+ sections.push('**Out of scope:**');
33864
+ for (const s of spec.scope.outOfScope)
33865
+ sections.push(`- ${s}`);
33803
33866
  }
33804
33867
  }
33805
33868
  if (spec.constraints?.length) {
@@ -33875,7 +33938,21 @@ function formatCursorRules(spec) {
33875
33938
  sections.push('# SUCCESS OUTCOMES');
33876
33939
  sections.push('Your implementation MUST satisfy ALL of these:');
33877
33940
  for (const outcome of spec.outcomes) {
33878
- sections.push(`- ${outcome}`);
33941
+ sections.push(`- ${getPriorityLabel(outcome)}${getOutcomeText(outcome)}`);
33942
+ }
33943
+ }
33944
+ if (spec.scope?.inScope?.length || spec.scope?.outOfScope?.length) {
33945
+ sections.push('');
33946
+ sections.push('# SCOPE');
33947
+ if (spec.scope.inScope?.length) {
33948
+ sections.push('IN SCOPE (you may modify):');
33949
+ for (const s of spec.scope.inScope)
33950
+ sections.push(`- ${s}`);
33951
+ }
33952
+ if (spec.scope.outOfScope?.length) {
33953
+ sections.push('OUT OF SCOPE (do NOT touch):');
33954
+ for (const s of spec.scope.outOfScope)
33955
+ sections.push(`- ${s}`);
33879
33956
  }
33880
33957
  }
33881
33958
  if (spec.constraints?.length) {
@@ -33948,7 +34025,19 @@ function formatClaudeMdSection(spec) {
33948
34025
  }
33949
34026
  if (spec.outcomes?.length) {
33950
34027
  sections.push('**Outcomes**:');
33951
- sections.push(spec.outcomes.map(o => `- [ ] ${o}`).join('\n'));
34028
+ sections.push(spec.outcomes.map(o => `- [ ] ${getPriorityLabel(o)}${getOutcomeText(o)}`).join('\n'));
34029
+ }
34030
+ if (spec.scope?.inScope?.length || spec.scope?.outOfScope?.length) {
34031
+ const scopeParts = ['**Scope**:'];
34032
+ if (spec.scope?.inScope?.length) {
34033
+ scopeParts.push('In scope:');
34034
+ scopeParts.push(...spec.scope.inScope.map(s => `- ${s}`));
34035
+ }
34036
+ if (spec.scope?.outOfScope?.length) {
34037
+ scopeParts.push('Out of scope:');
34038
+ scopeParts.push(...spec.scope.outOfScope.map(s => `- ${s}`));
34039
+ }
34040
+ sections.push(scopeParts.join('\n'));
33952
34041
  }
33953
34042
  if (spec.constraints?.length) {
33954
34043
  sections.push('**Constraints**:');
@@ -64142,7 +64231,7 @@ function startMcpServer() {
64142
64231
  const intents = (0, local_reader_1.readLocalIntents)();
64143
64232
  const q = query.toLowerCase();
64144
64233
  const matches = intents.filter(i => {
64145
- const text = [i.title, i.objective, ...i.outcomes, ...i.constraints].join(' ').toLowerCase();
64234
+ const text = [i.title, i.objective, ...i.outcomes.map((o) => typeof o === 'string' ? o : o.text), ...i.constraints].join(' ').toLowerCase();
64146
64235
  return text.includes(q) && (!status || i.status === status);
64147
64236
  });
64148
64237
  return { content: [{ type: 'text', text: JSON.stringify({ results: matches, count: matches.length, query }, null, 2) }] };
@@ -64151,7 +64240,7 @@ function startMcpServer() {
64151
64240
  const intents = await client.listIntents(status);
64152
64241
  const q = query.toLowerCase();
64153
64242
  const matches = intents.filter(i => {
64154
- const text = [i.title, i.objective, ...(i.outcomes || []), ...(i.constraints || [])].join(' ').toLowerCase();
64243
+ const text = [i.title, i.objective, ...(i.outcomes || []).map((o) => typeof o === 'string' ? o : o.text), ...(i.constraints || [])].join(' ').toLowerCase();
64155
64244
  return text.includes(q);
64156
64245
  });
64157
64246
  const results = matches.map(i => ({
@@ -64352,18 +64441,19 @@ function startMcpServer() {
64352
64441
  });
64353
64442
  server.registerTool('export_context', {
64354
64443
  title: 'Export Context',
64355
- 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.',
64444
+ 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.',
64356
64445
  inputSchema: {
64357
64446
  format: zod_1.z.enum(['claude-md', 'cursorrules', 'intent-md']).describe('Export format'),
64358
64447
  intentId: zod_1.z.string().optional().describe('Intent ID (optional, for cursorrules and intent-md)'),
64448
+ productId: zod_1.z.string().optional().describe('Product ID (optional, only used for claude-md format to select a specific product)'),
64359
64449
  },
64360
64450
  annotations: READ_ONLY,
64361
- }, async ({ format, intentId }) => {
64451
+ }, async ({ format, intentId, productId }) => {
64362
64452
  if (isLocalMode) {
64363
64453
  return { content: [{ type: 'text', text: 'Export requires cloud mode. Use PATHMODE_API_KEY to connect.' }] };
64364
64454
  }
64365
64455
  try {
64366
- const content = await client.exportContext(format, intentId);
64456
+ const content = await client.exportContext(format, intentId, productId);
64367
64457
  return { content: [{ type: 'text', text: content }] };
64368
64458
  }
64369
64459
  catch (e) {
@@ -64392,7 +64482,7 @@ function startMcpServer() {
64392
64482
  });
64393
64483
  server.registerTool('get_workspace', {
64394
64484
  title: 'Get Workspace',
64395
- description: 'Get workspace details including strategy (vision, non-negotiables, architecture principles) and constitution rules.',
64485
+ description: 'Get workspace details including strategy (vision, non-negotiables, architecture principles), active products, and constitution rules.',
64396
64486
  annotations: READ_ONLY,
64397
64487
  }, async () => {
64398
64488
  if (isLocalMode) {
@@ -12,13 +12,21 @@ export interface IntentFields {
12
12
  id?: string;
13
13
  title: string;
14
14
  objective: string;
15
- outcomes: string[];
15
+ outcomes: (string | {
16
+ id?: string;
17
+ text: string;
18
+ priority?: 'must' | 'should' | 'could';
19
+ })[];
16
20
  constraints?: string[];
17
21
  edgeCases?: {
18
22
  scenario: string;
19
23
  expectedBehavior: string;
20
24
  }[];
21
25
  healthMetrics?: string[];
26
+ scope?: {
27
+ inScope?: string[];
28
+ outOfScope?: string[];
29
+ };
22
30
  verification?: {
23
31
  manualChecks?: string[];
24
32
  unitTests?: 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,MAAM,EAAE,CAAC;IACnB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7D,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACtD,YAAY,CAAC,EAAE;QACX,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;QACxB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;QACrB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;KACvB,CAAC;CACL;AAwDD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CA0D/C;AAOD;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CA+FzD;AAOD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAwF5D;AAOD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAsDhE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pathmode/mcp-server",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "mcpName": "io.github.pathmodeio/mcp-server",
5
5
  "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.",
6
6
  "main": "dist/index.js",