@tacitai/mcp-server 0.6.37 → 0.6.38

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/dist/prompts.d.ts CHANGED
@@ -141,23 +141,23 @@ export declare const EXPERIENCES: readonly [{
141
141
  readonly signal: "First grounded answer drawn from your workspace knowledge";
142
142
  readonly tip: "";
143
143
  }, {
144
- readonly id: "feed_it";
144
+ readonly id: "your_first_structure";
145
145
  readonly num: 4;
146
- readonly name: "Feed It";
146
+ readonly name: "Your First Structure";
147
147
  readonly tier: 1;
148
148
  readonly tierName: "Orient & Equip";
149
- readonly action: "Turn your first answer into a workspace document. Say: \"Take what you just told me and add it to the workspace.\" TACIT will use the synthesis from your last question as the document body and route it through your General Manager. The GM will classify it, then propose where it should live in your workspace. You approve before anything moves. If you already know where you want it, say so — otherwise say \"you decide\" and the GM will recommend a spot.";
150
- readonly signal: "First content ingested and placed via GM propose-then-approve";
151
- readonly tip: "Your General Manager handles content routing and placement. Everything goes through a propose-then-approve flow — the GM recommends where content belongs, and nothing moves without your say-so.";
149
+ readonly action: "Teach the alignment pyramid using the user's own onboarding as a live example. Walk through each level top-down:\n\n1. WORKSPACE — Point at it. This is the tenant boundary — the company itself.\n\n2. PORTFOLIO — Explain the three-pillar model: BUSINESS (company-wide strategic decisions — governance, brand, capital allocation), PRODUCT (product and service delivery — what external customers receive), INTERNAL (employee experience excellence — what employees receive to do their best work). Personal/career workspaces also have ATHLETIC (individual growth). Each portfolio passes the board-slide test: \"Would a board split investment across these?\" Call tacit_pyramid_list_portfolios to show existing portfolios. If an INTERNAL-pillar portfolio exists, use it. If none exists, propose creating one named \"Employee Experience\" (pillar: INTERNAL) — explain why: the onboarding structure needs a home, and employee experience is a real investment segment. Create via tacit_pyramid_create_portfolio after user confirms.\n\n3. STRATEGIC OKRs — Explain conceptually (no creation). These anchor portfolios to measurable outcomes — \"Which 2-3 numbers define success this year?\"\n\n4. VALUE STREAM — What an identifiable group receives end-to-end. Passes the customer-receipt test: \"Does a customer/employee group receive something through this?\" Internal VS use experience qualities, not function names (Operations → Operational Excellence, HR → People & Culture, IT → Digital Workplace). Call tacit_pyramid_list_value_streams to check for an existing \"Onboarding\" VS (case-insensitive name match). If found, show it and explain it is shared across all users. If not found, propose creating \"Onboarding\" under the INTERNAL portfolio via tacit_pyramid_create_value_stream. Create after user confirms.\n\n5. PROGRAM — A bounded push with an end state. Passes the end-date test: \"Does it have an end state?\" If it can never end, it is a stream, not a program. Call tacit_get_myself to get the user's name. Call tacit_pyramid_list_programs with the INTERNAL portfolio_id and filter results by value_stream_id matching the Onboarding VS. If a program matching \"{Name}'s Onboarding Journey\" exists, reuse it. Otherwise propose creating it via tacit_pyramid_create_program with value_stream_id linking it to the Onboarding VS. Create after user confirms.\n\n6. DOSSIER + ARTIFACT — Explain conceptually only. Dossiers hold the actual work products (artifacts). As the user progresses through the remaining onboarding experiences, each experience that produces saveable content will create a dossier within their program and save its output there. The pyramid fills with real content as they learn — no need to create anything now.\n\n7. Show the structural chain built so far: Workspace → Portfolio → Value Stream → Program. Explain that Dossiers and Artifacts accumulate naturally as they continue through the onboarding experiences.\n\nIMPORTANT: All create operations (steps 2, 4, 5) require a one-line proposal and user confirmation before executing. If the workspace autonomy level blocks a create call, fall back to conceptual-only explanation for that step. Each step checks for existing entities by name before creating (idempotent — handles retries and resumed sessions). The \"Onboarding\" VS is shared across users; each user gets their own program (\"{Name}'s Onboarding Journey\"). This teaches the shared-vs-personal scope distinction organically.";
150
+ readonly signal: "User understands the full pyramid chain (Workspace → Portfolio → VS → Program → Dossier → Artifact) with their own onboarding structure as the example";
151
+ readonly tip: "Each level has a naming test: Portfolios pass the board-slide test, Value Streams pass the customer-receipt test, Programs pass the end-date test. Functions (Engineering, Marketing, HR) are never portfolios or value streams.";
152
152
  }, {
153
153
  readonly id: "build_your_map";
154
154
  readonly num: 5;
155
155
  readonly name: "Build Your Map";
156
156
  readonly tier: 1;
157
157
  readonly tierName: "Orient & Equip";
158
- readonly action: "Show the user their current Pyramid structure by calling tacit_pyramid_list_portfolios, tacit_pyramid_list_value_streams, and tacit_pyramid_list_programs. Present a clear map. Then walk the user through building a SAMPLE pyramid chain to teach each tier. Explain: (1) PORTFOLIO = investment segment — \"where we play\" — passes the board-slide test (would a board split investment across these?). (2) VALUE STREAM = what customers or employees receive end-to-end — passes the customer-receipt test. Internal VS use experience qualities not function names (e.g. \"Operational Excellence\" not \"Operations\"). (3) PROGRAM = a bounded push with an end state — passes the end-date test. If it can never end, it belongs as a stream not a program. (4) DOSSIER = a folder for artifacts (the actual work products). Suggest building this sample chain together: Portfolio: \"Employee Experience\" (INTERNAL pillar — what employees receive). Value Stream: \"Operational Excellence\" (the experience quality of running things well). Program: \"AI Transformation\" or \"TACIT Implementation\" (bounded: getting the company onto TACIT). Dossier: \"Onboarding Artifacts\" (a place to collect onboarding materials for all employees). Walk through creating each one step by step using tacit_pyramid_create_portfolio, tacit_pyramid_create_value_stream, tacit_pyramid_assign_program_to_value_stream, tacit_pyramid_create_program, tacit_pyramid_create_dossier. IMPORTANT: Tell the user these are SAMPLE entities to learn the system — they can delete or keep them after onboarding. They will not pollute the workspace. After creating the chain, show the updated map. WAIT for the user to confirm they understand the four tiers before marking complete.";
159
- readonly signal: "User has built a sample pyramid chain (portfolio → value stream → program → dossier) and understands what each tier represents";
160
- readonly tip: "Portfolios = investment segments (board-level). Value Streams = what people receive. Programs = bounded initiatives with end dates. Dossiers = artifact folders. You can always reorganize later.";
158
+ readonly action: "This experience adapts to the workspace state. First, detect what exists:\n\n1. Call tacit_pyramid_list_portfolios to get all portfolios.\n2. For each portfolio, call tacit_pyramid_list_programs(portfolio_id) to aggregate programs.\n3. Call tacit_pyramid_list_value_streams to get all value streams.\n4. Exclude onboarding scaffolding when counting: ignore programs matching \"*Onboarding Journey\" and value streams named \"Onboarding\". Never exclude a portfolio — even if its only VS is \"Onboarding\", it represents a real investment segment.\n5. Count the remaining \"real\" programs and value streams.\n\nBRANCH A — EMPTY WORKSPACE (zero real programs AND zero real value streams after excluding onboarding scaffolding):\nRun the setup interview to build the user's actual pyramid. First, check existing portfolios by pillar — if Experience 4 or a prior session already created portfolios (e.g. an INTERNAL \"Employee Experience\"), adopt them per pillar. Do not duplicate. Ask whether each existing name fits or should be renamed. Then ask these questions one at a time:\n\n(1) \"What do customers pay you for today?\" → Distinct offerings become Value Streams inside a PRODUCT portfolio.\n(2) \"What company-wide strategic decisions govern how you invest across everything?\" → A BUSINESS portfolio covering governance, brand, capital allocation.\n(3) \"What experience qualities do your employees receive that enable them to deliver?\" → An INTERNAL portfolio covering employee experience excellence.\n(4) \"What must stay true no matter what you are currently working on?\" → The Knowledge Base: stream categories for offering truth, domain categories for cross-stream truth.\n(5) \"Which 2-3 numbers define success this year?\" → Strategic Objectives and Key Results at portfolio level, then VS Objectives that ladder up.\n(6) \"What are you driving to done in the next 12 months?\" → These become Programs.\n\nCreate real entities across all three pillars (BUSINESS, PRODUCT, INTERNAL). Validate every name against the four naming tests: board-slide (portfolio), customer-receipt (value stream), end-date (program), matrix/function-detection (should it be a domain category instead?). Functions like Engineering, Marketing, HR, Finance are NEVER portfolios or value streams — they describe how work gets done, not investment segments or offerings.\n\nBRANCH B — POPULATED WORKSPACE (any real programs OR real value streams exist after excluding onboarding scaffolding — i.e. NOT Branch A):\nShow what is already there — list all portfolios, value streams, programs, and dossiers. Explain each entity using the same definitions taught in Experience 4. Then run an audit/review against the setup interview questions, reframed as review questions:\n\n- \"Does your portfolio structure cover all three pillars (BUSINESS, PRODUCT, INTERNAL)?\"\n- \"Do your value streams pass the customer-receipt test? Are any named after functions instead of what people receive?\"\n- \"Do your programs pass the end-date test? Are any immortal (never-ending)?\"\n- \"Are there functions masquerading as portfolios or value streams?\" (the org-chart anti-pattern)\n- Identify gaps: missing pillars, orphan programs not linked to a value stream, function-named entities, flat pyramid (everything in one program).\n\nPresent findings as suggestions, not directives. Offer to help fix any issues found.";
159
+ readonly signal: "User has either built their real pyramid structure (Branch A) or reviewed and validated their existing structure (Branch B)";
160
+ readonly tip: "Three pillars: BUSINESS (where to invest), PRODUCT (what customers receive), INTERNAL (what employees receive). Every name has a test — if it fails, it belongs on a different tier.";
161
161
  }, {
162
162
  readonly id: "connect_your_tools";
163
163
  readonly num: 6;
@@ -213,4 +213,6 @@ export declare const EXPERIENCES: readonly [{
213
213
  readonly signal: "User has a clear picture of their operating rhythm and next steps";
214
214
  readonly tip: "By now you know the team: COS for daily ops, COO for business operations, GM for content. Address them directly anytime.";
215
215
  }];
216
+ export declare const LEGACY_ID_ALIASES: Record<string, string>;
217
+ export declare function normalizeCompleted(raw: string): string[];
216
218
  export declare function registerPrompts(server: McpServer, getClientFn?: () => Promise<TacitClient>): void;
package/dist/prompts.js CHANGED
@@ -75,6 +75,15 @@ function buildAssistantSystemPrompt(state) {
75
75
  lines.push('- Crew tasks require the user to approve before execution.');
76
76
  lines.push('- When unsure about a destructive action, ask first.');
77
77
  lines.push('');
78
+ lines.push('## Research (multi-lane)');
79
+ lines.push('');
80
+ lines.push('`tacit_research_prepare` now returns multi-lane results in `research_lanes[]`. Each lane has a `status` (success/partial/failed/skipped) and typed `results[]` with `source_lane` and `source_provider` attribution:');
81
+ lines.push('- **Workspace lane**: KB, pyramid, and lake context from the user\'s workspace (as before).');
82
+ lines.push('- **Academic lane**: arXiv, OpenAlex, and Semantic Scholar results fetched directly via their REST APIs. Individual providers may fail (rate limits, timeouts) — the lane still returns results from the providers that succeeded.');
83
+ lines.push('When presenting research results, group by lane and cite the source provider. Academic results are external references — do not present them as workspace knowledge.');
84
+ lines.push('');
85
+ lines.push('`tacit_research_launch` (Gemini) returns a structured response instead of an error when the API key is not configured. Check the `status` field — `skipped` means Gemini is unavailable but other lanes work fine.');
86
+ lines.push('');
78
87
  lines.push('## Technical routing');
79
88
  lines.push('');
80
89
  lines.push('Prefer a single read tool for direct lookups, synthesis for open questions, and ask before any write or dispatch.');
@@ -220,8 +229,8 @@ export const EXPERIENCES = [
220
229
  { id: 'explore_workspace', num: 1, name: 'Explore Your Workspace', tier: 1, tierName: 'Orient & Equip', action: 'Type: "What is in my workspace?" — see what knowledge, collections, and structure are already here.', signal: 'You can describe what is in your workspace', tip: '' },
221
230
  { id: 'see_capabilities', num: 2, name: 'See What\'s Possible', tier: 1, tierName: 'Orient & Equip', action: 'Type: "What can TACIT do for me?" — discover the full range of capabilities available to you.', signal: 'You know what TACIT can do and are ready to try it', tip: '' },
222
231
  { id: 'first_light', num: 3, name: 'First Light', tier: 1, tierName: 'Orient & Equip', action: 'Ask a question about your business — try "What do we know about [topic]?"', signal: 'First grounded answer drawn from your workspace knowledge', tip: '' },
223
- { id: 'feed_it', num: 4, name: 'Feed It', tier: 1, tierName: 'Orient & Equip', action: 'Turn your first answer into a workspace document. Say: "Take what you just told me and add it to the workspace." TACIT will use the synthesis from your last question as the document body and route it through your General Manager. The GM will classify it, then propose where it should live in your workspace. You approve before anything moves. If you already know where you want it, say so — otherwise say "you decide" and the GM will recommend a spot.', signal: 'First content ingested and placed via GM propose-then-approve', tip: 'Your General Manager handles content routing and placement. Everything goes through a propose-then-approve flow — the GM recommends where content belongs, and nothing moves without your say-so.' },
224
- { id: 'build_your_map', num: 5, name: 'Build Your Map', tier: 1, tierName: 'Orient & Equip', action: 'Show the user their current Pyramid structure by calling tacit_pyramid_list_portfolios, tacit_pyramid_list_value_streams, and tacit_pyramid_list_programs. Present a clear map. Then walk the user through building a SAMPLE pyramid chain to teach each tier. Explain: (1) PORTFOLIO = investment segment — "where we play" — passes the board-slide test (would a board split investment across these?). (2) VALUE STREAM = what customers or employees receive end-to-end — passes the customer-receipt test. Internal VS use experience qualities not function names (e.g. "Operational Excellence" not "Operations"). (3) PROGRAM = a bounded push with an end state — passes the end-date test. If it can never end, it belongs as a stream not a program. (4) DOSSIER = a folder for artifacts (the actual work products). Suggest building this sample chain together: Portfolio: "Employee Experience" (INTERNAL pillar — what employees receive). Value Stream: "Operational Excellence" (the experience quality of running things well). Program: "AI Transformation" or "TACIT Implementation" (bounded: getting the company onto TACIT). Dossier: "Onboarding Artifacts" (a place to collect onboarding materials for all employees). Walk through creating each one step by step using tacit_pyramid_create_portfolio, tacit_pyramid_create_value_stream, tacit_pyramid_assign_program_to_value_stream, tacit_pyramid_create_program, tacit_pyramid_create_dossier. IMPORTANT: Tell the user these are SAMPLE entities to learn the system — they can delete or keep them after onboarding. They will not pollute the workspace. After creating the chain, show the updated map. WAIT for the user to confirm they understand the four tiers before marking complete.', signal: 'User has built a sample pyramid chain (portfolio → value stream → program → dossier) and understands what each tier represents', tip: 'Portfolios = investment segments (board-level). Value Streams = what people receive. Programs = bounded initiatives with end dates. Dossiers = artifact folders. You can always reorganize later.' },
232
+ { id: 'your_first_structure', num: 4, name: 'Your First Structure', tier: 1, tierName: 'Orient & Equip', action: 'Teach the alignment pyramid using the user\'s own onboarding as a live example. Walk through each level top-down:\n\n1. WORKSPACE — Point at it. This is the tenant boundary — the company itself.\n\n2. PORTFOLIO — Explain the three-pillar model: BUSINESS (company-wide strategic decisions — governance, brand, capital allocation), PRODUCT (product and service delivery — what external customers receive), INTERNAL (employee experience excellence — what employees receive to do their best work). Personal/career workspaces also have ATHLETIC (individual growth). Each portfolio passes the board-slide test: "Would a board split investment across these?" Call tacit_pyramid_list_portfolios to show existing portfolios. If an INTERNAL-pillar portfolio exists, use it. If none exists, propose creating one named "Employee Experience" (pillar: INTERNAL) — explain why: the onboarding structure needs a home, and employee experience is a real investment segment. Create via tacit_pyramid_create_portfolio after user confirms.\n\n3. STRATEGIC OKRs — Explain conceptually (no creation). These anchor portfolios to measurable outcomes — "Which 2-3 numbers define success this year?"\n\n4. VALUE STREAM — What an identifiable group receives end-to-end. Passes the customer-receipt test: "Does a customer/employee group receive something through this?" Internal VS use experience qualities, not function names (Operations → Operational Excellence, HR → People & Culture, IT → Digital Workplace). Call tacit_pyramid_list_value_streams to check for an existing "Onboarding" VS (case-insensitive name match). If found, show it and explain it is shared across all users. If not found, propose creating "Onboarding" under the INTERNAL portfolio via tacit_pyramid_create_value_stream. Create after user confirms.\n\n5. PROGRAM — A bounded push with an end state. Passes the end-date test: "Does it have an end state?" If it can never end, it is a stream, not a program. Call tacit_get_myself to get the user\'s name. Call tacit_pyramid_list_programs with the INTERNAL portfolio_id and filter results by value_stream_id matching the Onboarding VS. If a program matching "{Name}\'s Onboarding Journey" exists, reuse it. Otherwise propose creating it via tacit_pyramid_create_program with value_stream_id linking it to the Onboarding VS. Create after user confirms.\n\n6. DOSSIER + ARTIFACT — Explain conceptually only. Dossiers hold the actual work products (artifacts). As the user progresses through the remaining onboarding experiences, each experience that produces saveable content will create a dossier within their program and save its output there. The pyramid fills with real content as they learn — no need to create anything now.\n\n7. Show the structural chain built so far: Workspace → Portfolio → Value Stream → Program. Explain that Dossiers and Artifacts accumulate naturally as they continue through the onboarding experiences.\n\nIMPORTANT: All create operations (steps 2, 4, 5) require a one-line proposal and user confirmation before executing. If the workspace autonomy level blocks a create call, fall back to conceptual-only explanation for that step. Each step checks for existing entities by name before creating (idempotent — handles retries and resumed sessions). The "Onboarding" VS is shared across users; each user gets their own program ("{Name}\'s Onboarding Journey"). This teaches the shared-vs-personal scope distinction organically.', signal: 'User understands the full pyramid chain (Workspace → Portfolio → VS → Program → Dossier → Artifact) with their own onboarding structure as the example', tip: 'Each level has a naming test: Portfolios pass the board-slide test, Value Streams pass the customer-receipt test, Programs pass the end-date test. Functions (Engineering, Marketing, HR) are never portfolios or value streams.' },
233
+ { id: 'build_your_map', num: 5, name: 'Build Your Map', tier: 1, tierName: 'Orient & Equip', action: 'This experience adapts to the workspace state. First, detect what exists:\n\n1. Call tacit_pyramid_list_portfolios to get all portfolios.\n2. For each portfolio, call tacit_pyramid_list_programs(portfolio_id) to aggregate programs.\n3. Call tacit_pyramid_list_value_streams to get all value streams.\n4. Exclude onboarding scaffolding when counting: ignore programs matching "*Onboarding Journey" and value streams named "Onboarding". Never exclude a portfolio — even if its only VS is "Onboarding", it represents a real investment segment.\n5. Count the remaining "real" programs and value streams.\n\nBRANCH A — EMPTY WORKSPACE (zero real programs AND zero real value streams after excluding onboarding scaffolding):\nRun the setup interview to build the user\'s actual pyramid. First, check existing portfolios by pillar — if Experience 4 or a prior session already created portfolios (e.g. an INTERNAL "Employee Experience"), adopt them per pillar. Do not duplicate. Ask whether each existing name fits or should be renamed. Then ask these questions one at a time:\n\n(1) "What do customers pay you for today?" → Distinct offerings become Value Streams inside a PRODUCT portfolio.\n(2) "What company-wide strategic decisions govern how you invest across everything?" → A BUSINESS portfolio covering governance, brand, capital allocation.\n(3) "What experience qualities do your employees receive that enable them to deliver?" → An INTERNAL portfolio covering employee experience excellence.\n(4) "What must stay true no matter what you are currently working on?" → The Knowledge Base: stream categories for offering truth, domain categories for cross-stream truth.\n(5) "Which 2-3 numbers define success this year?" → Strategic Objectives and Key Results at portfolio level, then VS Objectives that ladder up.\n(6) "What are you driving to done in the next 12 months?" → These become Programs.\n\nCreate real entities across all three pillars (BUSINESS, PRODUCT, INTERNAL). Validate every name against the four naming tests: board-slide (portfolio), customer-receipt (value stream), end-date (program), matrix/function-detection (should it be a domain category instead?). Functions like Engineering, Marketing, HR, Finance are NEVER portfolios or value streams — they describe how work gets done, not investment segments or offerings.\n\nBRANCH B — POPULATED WORKSPACE (any real programs OR real value streams exist after excluding onboarding scaffolding — i.e. NOT Branch A):\nShow what is already there — list all portfolios, value streams, programs, and dossiers. Explain each entity using the same definitions taught in Experience 4. Then run an audit/review against the setup interview questions, reframed as review questions:\n\n- "Does your portfolio structure cover all three pillars (BUSINESS, PRODUCT, INTERNAL)?"\n- "Do your value streams pass the customer-receipt test? Are any named after functions instead of what people receive?"\n- "Do your programs pass the end-date test? Are any immortal (never-ending)?"\n- "Are there functions masquerading as portfolios or value streams?" (the org-chart anti-pattern)\n- Identify gaps: missing pillars, orphan programs not linked to a value stream, function-named entities, flat pyramid (everything in one program).\n\nPresent findings as suggestions, not directives. Offer to help fix any issues found.', signal: 'User has either built their real pyramid structure (Branch A) or reviewed and validated their existing structure (Branch B)', tip: 'Three pillars: BUSINESS (where to invest), PRODUCT (what customers receive), INTERNAL (what employees receive). Every name has a test — if it fails, it belongs on a different tier.' },
225
234
  { id: 'connect_your_tools', num: 6, name: 'Connect Your Tools', tier: 1, tierName: 'Orient & Equip', action: 'First, CHECK what is already connected before telling the user anything: (1) Call tacit_github_list_connections to see GitHub repo connections. (2) Check your available MCP tool list — if you have Gmail tools (mcp__claude_ai_Gmail__*), Gmail IS connected. If you have Slack tools (mcp__plugin_*_slack__*), Slack IS connected. If you have Google Calendar tools, Calendar IS connected. If you have Google Drive tools, Drive IS connected. Present a CONNECTION STATUS showing what is already active and what is not. For anything already connected, say "Already connected — ready to use." For anything not connected, explain how to connect it via claude.ai Settings → Integrations. Also show GitHub workspace connections from step 1. Do NOT say a tool is disconnected if you can see its MCP tools in your available tool list. WAIT for the user to either connect something new or confirm they want to move on.', signal: 'User knows their connection status and has either connected new tools or confirmed they are ready to proceed', tip: 'GitHub connections sync your repos into the workspace. Gmail and Slack power the Morning Brief. Google Drive lets you pull in documents directly.' },
226
235
  { id: 'research_publish', num: 7, name: 'Research & Publish', tier: 2, tierName: 'The Operating System', action: 'Research a topic and publish a report. Ask the user what they want to research, or suggest a topic relevant to their business. Then: (1) Search workspace knowledge via tacit_search or tacit_synthesize. (2) Search the web for current information. (3) Combine findings into a STYLED HTML REPORT using /artifact-design — invoke the artifact-design skill to get the design system, then build a proper HTML artifact with title, date, executive summary, sections with findings, citations, and a professional layout. Publish it as a Claude artifact so the user sees it in their browser. Save the HTML file to disk. (4) After the artifact is saved, ingest the HTML FILE into TACIT via tacit_gm_ingest — pass the file path, not the content. The GM classifies and proposes placement. The user approves before anything moves. IMPORTANT: Do NOT copy-paste the report content into tacit_artifact_create. The correct flow is: create the HTML file → publish as Claude artifact → ingest the file via GM. This preserves provenance and goes through the lake-first pipeline.', signal: 'First research artifact published as a Claude artifact in the browser, then the HTML file ingested and placed via GM workflow', tip: 'After publishing, your General Manager will propose where to place the report in your knowledge structure — you approve the placement.' },
227
236
  { id: 'run_sales', num: 8, name: 'Run Sales', tier: 2, tierName: 'The Operating System', action: 'Part 1 — Discovery Brief: Say "Prepare a discovery brief for a potential client." TACIT uses workspace knowledge to build a discovery framework. The brief should be a STYLED HTML REPORT using /artifact-design — same flow as Experience 7: invoke artifact-design, build the HTML, publish as a Claude artifact, save the file to disk, then ingest the HTML file via tacit_gm_ingest for placement. Part 2 — Voice Composition: After the brief, draft an intro email using the TACIT Voice Resonance system. MANDATORY TWO-STEP FLOW: (1) GROUND FIRST — assemble the key facts from the discovery brief (prospect name, pain points, value proposition, relevant capabilities) into a structured plain-text brief. This is the content the voice system will work with. (2) COMPOSE IN VOICE — call tacit_voice_list_profiles to find the user\'s voice profile (it MUST exist — voice samples were pre-loaded). Then call tacit_compose_in_voice, passing the grounded-facts brief as the content to voice-ify. This ensures the voice system has concrete facts instead of re-retrieving from workspace docs. This uses TACIT\'s actual voice fingerprinting system, NOT LLM approximation. NEVER draft the email yourself and claim it matches the user\'s voice. NEVER offer to "paste a sample email" or "upload writing samples" — voice profiles are already loaded. If tacit_voice_list_profiles returns no profiles, say "I expected to find your voice profile but it is not set up yet — let me check with the team" and move on.', signal: 'First sales deliverable as HTML report, then first voice-matched composition using TACIT Voice Resonance (not LLM approximation)', tip: 'Voice Resonance is a real system — it analyzes your writing samples to capture your cadence, vocabulary, and patterns. Every "in my voice" request routes through this system.' },
@@ -229,6 +238,19 @@ export const EXPERIENCES = [
229
238
  { id: 'business_pulse', num: 10, name: 'Your Business Pulse', tier: 2, tierName: 'The Operating System', action: 'Show the user what TACIT can see about their business right now. Ask "Want to see your business pulse?" Then: (1) Gather workspace data — call tacit_pyramid_list_portfolios, tacit_pyramid_list_programs, tacit_pyramid_list_value_streams to assess structure completeness. Call tacit_kb_freshness to check knowledge currency. Call tacit_lake_browse_catalog to gauge content volume. Check connector status from the MCP tool list (Gmail, Slack, Calendar, Drive, GitHub). Call tacit_voice_list_profiles to check voice readiness. (2) Score each dimension (structure completeness, knowledge freshness, content depth, tool connectivity, voice readiness) and produce a STYLED HTML REPORT using /artifact-design — same flow as Experience 7: invoke artifact-design, build the HTML, publish as a Claude artifact, save the file to disk. The report should include dimension scores, a summary health grade, and concrete recommendations for what to build next. Frame it as a health snapshot, not a formal audit. (3) After the artifact is saved, ingest the HTML file via tacit_gm_ingest for placement. The user approves where it goes.', signal: 'First business pulse report published as a Claude artifact showing workspace health scores, then filed via GM workflow', tip: 'This is your quick health snapshot. When you want the deep version, say "Have COO audit our business" — COO runs the formal operational review with remediation tracking.' },
230
239
  { id: 'operating_rhythm', num: 11, name: 'Your Operating Rhythm', tier: 3, tierName: 'Agentic Mastery', action: 'Summarize what the user has accomplished across the onboarding and suggest their operating rhythm. CONNECTOR STATUS: Check your available MCP tool list — if you have Gmail/Slack/Calendar/Drive MCP tools, those ARE connected. Do NOT say they are disconnected. VOICE: Call tacit_voice_list_profiles — if profiles exist, voice is ready. Do NOT ask the user to upload samples if profiles already exist. Focus on: (1) Daily rhythm — morning brief via COS, email triage, meeting prep. (2) Weekly rhythm — COO business review, GM content organization. (3) Delegation — crew dispatch for complex deliverables. (4) What to explore next based on what they have connected and used.', signal: 'User has a clear picture of their operating rhythm and next steps', tip: 'By now you know the team: COS for daily ops, COO for business operations, GM for content. Address them directly anytime.' },
231
240
  ];
241
+ // Legacy ID aliases for renamed experiences — maps old id → new id
242
+ export const LEGACY_ID_ALIASES = Object.assign(Object.create(null), {
243
+ feed_it: 'your_first_structure',
244
+ });
245
+ // Normalize a comma-separated completed string: apply aliases, de-duplicate
246
+ export function normalizeCompleted(raw) {
247
+ const ids = raw
248
+ .split(',')
249
+ .map(s => s.trim().toLowerCase())
250
+ .filter(Boolean)
251
+ .map(id => LEGACY_ID_ALIASES[id] || id);
252
+ return [...new Set(ids)];
253
+ }
232
254
  export function registerPrompts(server, getClientFn) {
233
255
  server.prompt('assistant_system', 'System prompt for the TACIT workspace assistant — includes persona, progressive disclosure, and safety rules.', async () => {
234
256
  if (getClientFn) {
@@ -338,12 +360,9 @@ export function registerPrompts(server, getClientFn) {
338
360
  });
339
361
  // --- whats_next: progressive experience suggestion ---
340
362
  server.prompt('whats_next', 'Suggest the next onboarding experience based on what you have already completed.', {
341
- completed: z.string().optional().describe('Comma-separated experience IDs already completed (e.g. "first_light,feed_it")'),
363
+ completed: z.string().optional().describe('Comma-separated experience IDs already completed (e.g. "first_light,your_first_structure")'),
342
364
  }, async (args) => {
343
- const completedIds = (args.completed || '')
344
- .split(',')
345
- .map(s => s.trim().toLowerCase())
346
- .filter(Boolean);
365
+ const completedIds = normalizeCompleted(args.completed || '');
347
366
  const completedSet = new Set(completedIds);
348
367
  const tier1 = EXPERIENCES.filter(e => e.tier === 1);
349
368
  const tier2 = EXPERIENCES.filter(e => e.tier === 2);
@@ -1,7 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  import { TacitApiError } from '../client.js';
3
3
  import { success, error, featureDisabledResult } from './errors.js';
4
- import { EXPERIENCES, fetchWorkspaceState } from '../prompts.js';
4
+ import { EXPERIENCES, fetchWorkspaceState, normalizeCompleted } from '../prompts.js';
5
5
  export function registerOnboardingTools(server, getClient) {
6
6
  server.tool('tacit_onboarding', 'Guide the user through the TACIT onboarding journey — the Eleven Experiences. ' +
7
7
  'ONLY call this when the user explicitly asks for onboarding: "onboard me", "take me through onboarding", ' +
@@ -10,7 +10,7 @@ export function registerOnboardingTools(server, getClient) {
10
10
  completed: z
11
11
  .string()
12
12
  .optional()
13
- .describe('Comma-separated experience IDs the user has already completed (e.g. "first_light,feed_it"). ' +
13
+ .describe('Comma-separated experience IDs the user has already completed (e.g. "first_light,your_first_structure"). ' +
14
14
  'Omit if unknown — the tool will start from the beginning.'),
15
15
  skip_to: z
16
16
  .string()
@@ -23,10 +23,7 @@ export function registerOnboardingTools(server, getClient) {
23
23
  try {
24
24
  const client = await getClient();
25
25
  const state = await fetchWorkspaceState(client);
26
- const completedIds = (args.completed || '')
27
- .split(',')
28
- .map(s => s.trim().toLowerCase())
29
- .filter(Boolean);
26
+ const completedIds = normalizeCompleted(args.completed || '');
30
27
  const completedSet = new Set(completedIds);
31
28
  const tier1 = EXPERIENCES.filter(e => e.tier === 1);
32
29
  const tier2 = EXPERIENCES.filter(e => e.tier === 2);
@@ -13,6 +13,34 @@ export interface ContextSource {
13
13
  source_id: string;
14
14
  source_type: 'kb' | 'pyramid' | 'lake';
15
15
  }
16
+ export interface ResearchResult {
17
+ title: string;
18
+ summary: string;
19
+ url: string;
20
+ source_lane: 'workspace' | 'academic' | 'gemini';
21
+ source_provider: 'arxiv' | 'openalex' | 'semantic_scholar' | 'tacit_kb' | 'tacit_lake' | 'tacit_pyramid' | 'gemini';
22
+ published_date?: string;
23
+ authors?: string[];
24
+ relevance_score?: number;
25
+ }
26
+ export interface ProviderStatus {
27
+ provider: string;
28
+ status: 'success' | 'failed';
29
+ error?: string;
30
+ count: number;
31
+ }
32
+ export interface ResearchLaneResult {
33
+ lane: string;
34
+ status: 'success' | 'partial' | 'failed' | 'skipped';
35
+ error?: string;
36
+ providers?: ProviderStatus[];
37
+ results: ResearchResult[];
38
+ }
39
+ declare function reconstructAbstract(invertedIndex: unknown): string;
40
+ declare function fetchArxiv(query: string): Promise<ResearchResult[]>;
41
+ declare function fetchOpenAlex(query: string): Promise<ResearchResult[]>;
42
+ declare function fetchSemanticScholar(query: string): Promise<ResearchResult[]>;
43
+ declare function runAcademicLane(query: string): Promise<ResearchLaneResult>;
16
44
  type TaskStatus = {
17
45
  status: 'running';
18
46
  startedAt: number;
@@ -37,6 +65,11 @@ export declare const _testInternals: {
37
65
  readonly dailyLaunches: Map<string, DailyCounter>;
38
66
  evictExpired: typeof evictExpired;
39
67
  resetForTest(): void;
68
+ fetchArxiv: typeof fetchArxiv;
69
+ fetchOpenAlex: typeof fetchOpenAlex;
70
+ fetchSemanticScholar: typeof fetchSemanticScholar;
71
+ runAcademicLane: typeof runAcademicLane;
72
+ reconstructAbstract: typeof reconstructAbstract;
40
73
  };
41
74
  interface DailyCounter {
42
75
  count: number;
@@ -7,6 +7,7 @@
7
7
  */
8
8
  import { randomUUID } from 'node:crypto';
9
9
  import { z } from 'zod';
10
+ import { XMLParser } from 'fast-xml-parser';
10
11
  import { apiErrorResult } from './errors.js';
11
12
  function ok(data) {
12
13
  return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
@@ -58,6 +59,149 @@ function buildGroundedPrompt(topic, sources) {
58
59
  `## Research leads to verify\n${leads}`,
59
60
  ].join('\n\n');
60
61
  }
62
+ function reconstructAbstract(invertedIndex) {
63
+ if (!invertedIndex || typeof invertedIndex !== 'object')
64
+ return '';
65
+ const words = [];
66
+ for (const [word, positions] of Object.entries(invertedIndex)) {
67
+ if (Array.isArray(positions)) {
68
+ for (const pos of positions) {
69
+ if (typeof pos === 'number')
70
+ words.push([pos, word]);
71
+ }
72
+ }
73
+ }
74
+ words.sort((a, b) => a[0] - b[0]);
75
+ return words.map(([, w]) => w).join(' ');
76
+ }
77
+ const ACADEMIC_FETCH_TIMEOUT_MS = 10_000;
78
+ const ACADEMIC_MAX_RESULTS = 5;
79
+ const xmlParser = new XMLParser({
80
+ ignoreAttributes: false,
81
+ isArray: (name) => name === 'entry' || name === 'author',
82
+ });
83
+ async function fetchArxiv(query) {
84
+ const terms = query.split(/\s+/).filter((t) => t.length > 2);
85
+ const arxivQuery = terms.length > 1 ? terms.map((t) => `all:${encodeURIComponent(t)}`).join('+AND+') : `all:${encodeURIComponent(query)}`;
86
+ const url = `https://export.arxiv.org/api/query?search_query=${arxivQuery}&start=0&max_results=${ACADEMIC_MAX_RESULTS}`;
87
+ const res = await fetch(url, { signal: AbortSignal.timeout(ACADEMIC_FETCH_TIMEOUT_MS) });
88
+ if (!res.ok)
89
+ throw new Error(`arXiv HTTP ${res.status}`);
90
+ const xml = await res.text();
91
+ const parsed = xmlParser.parse(xml);
92
+ const entries = parsed?.feed?.entry ?? [];
93
+ return (Array.isArray(entries) ? entries : [entries]).filter(Boolean).filter((e) => {
94
+ const id = str(e.id);
95
+ return !id.includes('/api/errors');
96
+ }).map((e) => {
97
+ const authors = (Array.isArray(e.author) ? e.author : [e.author])
98
+ .filter(Boolean)
99
+ .map((a) => str(a?.name));
100
+ const id = str(e.id);
101
+ return {
102
+ title: str(e.title).replace(/\s+/g, ' ').trim(),
103
+ summary: str(e.summary).replace(/\s+/g, ' ').trim().slice(0, 500),
104
+ url: id.startsWith('http') ? id : `https://arxiv.org/abs/${id}`,
105
+ source_lane: 'academic',
106
+ source_provider: 'arxiv',
107
+ published_date: str(e.published).slice(0, 10) || undefined,
108
+ authors: authors.length ? authors : undefined,
109
+ };
110
+ });
111
+ }
112
+ async function fetchOpenAlex(query) {
113
+ const mailto = process.env['OPENALEX_MAILTO'] || 'support@quarterbackai.com';
114
+ const url = `https://api.openalex.org/works?search=${encodeURIComponent(query)}&per_page=${ACADEMIC_MAX_RESULTS}&mailto=${encodeURIComponent(mailto)}`;
115
+ const res = await fetch(url, { signal: AbortSignal.timeout(ACADEMIC_FETCH_TIMEOUT_MS) });
116
+ if (!res.ok)
117
+ throw new Error(`OpenAlex HTTP ${res.status}`);
118
+ const data = (await res.json());
119
+ return (data.results ?? []).map((w) => {
120
+ const authorships = Array.isArray(w.authorships) ? w.authorships : [];
121
+ const authors = authorships
122
+ .map((a) => {
123
+ const author = a?.author;
124
+ return str(author?.display_name);
125
+ })
126
+ .filter(Boolean);
127
+ return {
128
+ title: str(w.title),
129
+ summary: reconstructAbstract(w.abstract_inverted_index).slice(0, 500),
130
+ url: str(w.doi ? `https://doi.org/${w.doi.toString().replace(/^https?:\/\/doi\.org\//, '')}` : w.id),
131
+ source_lane: 'academic',
132
+ source_provider: 'openalex',
133
+ published_date: str(w.publication_date).slice(0, 10) || undefined,
134
+ authors: authors.length ? authors : undefined,
135
+ relevance_score: typeof w.relevance_score === 'number' ? w.relevance_score : undefined,
136
+ };
137
+ });
138
+ }
139
+ async function fetchSemanticScholar(query) {
140
+ const url = `https://api.semanticscholar.org/graph/v1/paper/search?query=${encodeURIComponent(query)}&limit=${ACADEMIC_MAX_RESULTS}&fields=title,abstract,url,year,authors`;
141
+ const headers = {};
142
+ const apiKey = process.env['SEMANTIC_SCHOLAR_API_KEY'];
143
+ if (apiKey)
144
+ headers['x-api-key'] = apiKey;
145
+ const res = await fetch(url, { headers, signal: AbortSignal.timeout(ACADEMIC_FETCH_TIMEOUT_MS) });
146
+ if (!res.ok)
147
+ throw new Error(`Semantic Scholar HTTP ${res.status}`);
148
+ const data = (await res.json());
149
+ return (data.data ?? []).map((p) => {
150
+ const authors = Array.isArray(p.authors)
151
+ ? p.authors.map((a) => str(a.name)).filter(Boolean)
152
+ : undefined;
153
+ return {
154
+ title: str(p.title),
155
+ summary: str(p.abstract ?? '').slice(0, 500),
156
+ url: str(p.url || (p.paperId ? `https://www.semanticscholar.org/paper/${p.paperId}` : '')),
157
+ source_lane: 'academic',
158
+ source_provider: 'semantic_scholar',
159
+ published_date: p.year ? `${p.year}` : undefined,
160
+ authors: authors?.length ? authors : undefined,
161
+ };
162
+ });
163
+ }
164
+ async function runAcademicLane(query) {
165
+ const [arxivRes, oaRes, ssRes] = await Promise.allSettled([
166
+ fetchArxiv(query),
167
+ fetchOpenAlex(query),
168
+ fetchSemanticScholar(query),
169
+ ]);
170
+ const results = [];
171
+ const errors = [];
172
+ const providers = [];
173
+ if (arxivRes.status === 'fulfilled') {
174
+ results.push(...arxivRes.value);
175
+ providers.push({ provider: 'arxiv', status: 'success', count: arxivRes.value.length });
176
+ }
177
+ else {
178
+ errors.push(`arXiv: ${arxivRes.reason}`);
179
+ providers.push({ provider: 'arxiv', status: 'failed', error: String(arxivRes.reason), count: 0 });
180
+ }
181
+ if (oaRes.status === 'fulfilled') {
182
+ results.push(...oaRes.value);
183
+ providers.push({ provider: 'openalex', status: 'success', count: oaRes.value.length });
184
+ }
185
+ else {
186
+ errors.push(`OpenAlex: ${oaRes.reason}`);
187
+ providers.push({ provider: 'openalex', status: 'failed', error: String(oaRes.reason), count: 0 });
188
+ }
189
+ if (ssRes.status === 'fulfilled') {
190
+ results.push(...ssRes.value);
191
+ providers.push({ provider: 'semantic_scholar', status: 'success', count: ssRes.value.length });
192
+ }
193
+ else {
194
+ errors.push(`Semantic Scholar: ${ssRes.reason}`);
195
+ providers.push({ provider: 'semantic_scholar', status: 'failed', error: String(ssRes.reason), count: 0 });
196
+ }
197
+ if (results.length === 0 && errors.length > 0) {
198
+ return { lane: 'academic', status: 'failed', error: errors.join('; '), providers, results: [] };
199
+ }
200
+ if (errors.length > 0) {
201
+ return { lane: 'academic', status: 'partial', error: errors.join('; '), providers, results };
202
+ }
203
+ return { lane: 'academic', status: 'success', providers, results };
204
+ }
61
205
  function envInt(key, fallback) {
62
206
  const v = Number.parseInt(process.env[key] ?? '', 10);
63
207
  return Number.isFinite(v) && v > 0 ? v : fallback;
@@ -75,6 +219,11 @@ export const _testInternals = {
75
219
  tasks.clear();
76
220
  dailyLaunches.clear();
77
221
  },
222
+ fetchArxiv,
223
+ fetchOpenAlex,
224
+ fetchSemanticScholar,
225
+ runAcademicLane,
226
+ reconstructAbstract,
78
227
  };
79
228
  const tasks = new Map();
80
229
  const dailyLaunches = new Map();
@@ -356,11 +505,15 @@ export function registerResearchTools(server, getClientFn, getPrincipalFn) {
356
505
  try {
357
506
  const client = await getClientFn();
358
507
  if (!hasScope) {
359
- const [colRes, portRes, progRes] = await Promise.allSettled([
508
+ const [colRes, portRes, progRes, academicLane] = await Promise.allSettled([
360
509
  client.get('/api/v1/kb/collections'),
361
510
  client.get('/api/v1/portfolios'),
362
511
  client.get('/api/v1/programs'),
512
+ runAcademicLane(topic),
363
513
  ]);
514
+ const academic = academicLane.status === 'fulfilled'
515
+ ? academicLane.value
516
+ : { lane: 'academic', status: 'failed', error: String(academicLane.reason), results: [] };
364
517
  return ok({
365
518
  requires_scope: true,
366
519
  available_scopes: {
@@ -368,8 +521,13 @@ export function registerResearchTools(server, getClientFn, getPrincipalFn) {
368
521
  portfolios: portRes.status === 'fulfilled' ? asRecords(portRes.value, 'portfolios', 'items') : [],
369
522
  programs: progRes.status === 'fulfilled' ? asRecords(progRes.value, 'programs', 'items') : [],
370
523
  },
524
+ research_lanes: [academic],
371
525
  });
372
526
  }
527
+ // Start academic lane immediately — runs in parallel with workspace gathering
528
+ const academicPromise = runAcademicLane(topic).catch((err) => ({
529
+ lane: 'academic', status: 'failed', error: String(err), results: [],
530
+ }));
373
531
  const sources = [];
374
532
  try {
375
533
  const searchRes = await client.post('/api/v1/search', { query: topic });
@@ -402,9 +560,22 @@ export function registerResearchTools(server, getClientFn, getPrincipalFn) {
402
560
  sources.push(...lakeSources.slice(0, 25));
403
561
  }
404
562
  catch { /* lake endpoint unavailable */ }
563
+ const academicLane = await academicPromise;
564
+ const workspaceLane = {
565
+ lane: 'workspace',
566
+ status: 'success',
567
+ results: sources.map((s) => ({
568
+ title: s.title,
569
+ summary: s.excerpt,
570
+ url: '',
571
+ source_lane: 'workspace',
572
+ source_provider: (s.source_type === 'pyramid' ? 'tacit_pyramid' : s.source_type === 'kb' ? 'tacit_kb' : 'tacit_lake'),
573
+ })),
574
+ };
405
575
  return ok({
406
576
  prompt: buildGroundedPrompt(topic, sources),
407
577
  context_sources: sources,
578
+ research_lanes: [workspaceLane, academicLane],
408
579
  metadata: { topic, scope_used: { collection_ids, program_ids, portfolio_ids } },
409
580
  });
410
581
  }
@@ -552,7 +723,12 @@ export function registerResearchTools(server, getClientFn, getPrincipalFn) {
552
723
  return fail('Provide prompt to start a research run, or task_id to check status.');
553
724
  const apiKey = process.env['GEMINI_API_KEY'];
554
725
  if (!apiKey) {
555
- return fail('GEMINI_API_KEY is not set in the MCP server environment. Set it and restart the server to use tacit_research_launch.');
726
+ return ok({
727
+ status: 'skipped',
728
+ reason: 'gemini_api_key_not_configured',
729
+ message: 'Gemini API key not configured. Results from other research lanes (workspace context, academic sources) are available via tacit_research_prepare.',
730
+ results: [],
731
+ });
556
732
  }
557
733
  // Per-principal concurrent limit
558
734
  if (countRunning(principal) >= MAX_CONCURRENT) {
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
+ "private": false,
2
3
  "name": "@tacitai/mcp-server",
3
- "version": "0.6.37",
4
+ "version": "0.6.38",
4
5
  "description": "stdio MCP server wrapping Tacit /api/v1 REST/SSE API",
5
6
  "license": "UNLICENSED",
6
7
  "repository": {
@@ -31,6 +32,7 @@
31
32
  },
32
33
  "dependencies": {
33
34
  "@modelcontextprotocol/sdk": "^1.12.0",
35
+ "fast-xml-parser": "^4.4.1",
34
36
  "semver": "^7.6.0",
35
37
  "zod": "^3.22.0"
36
38
  },