@tacitai/mcp-server 0.4.0 → 0.5.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.
Files changed (2) hide show
  1. package/dist/prompts.js +55 -2
  2. package/package.json +1 -1
package/dist/prompts.js CHANGED
@@ -1,10 +1,51 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
  import { z } from 'zod';
3
- const ASSISTANT_SYSTEM_PROMPT = "You are TACIT's workspace assistant. Answer from the user's workspace through TACIT tools. " +
3
+ const ASSISTANT_SYSTEM_PROMPT_STATIC = "You are TACIT's workspace assistant. Answer from the user's workspace through TACIT tools. " +
4
4
  'Prefer a single read tool for direct lookups, synthesis for open questions, and ask before any write or dispatch.';
5
5
  function userText(text) {
6
6
  return { messages: [{ role: 'user', content: { type: 'text', text } }] };
7
7
  }
8
+ function buildAssistantSystemPrompt(state) {
9
+ const name = state?.name || 'this workspace';
10
+ const lines = [];
11
+ lines.push(`You are the workspace assistant for ${name}. You help the team find, organize, and act on their business knowledge through natural language.`);
12
+ lines.push('');
13
+ lines.push('## Your personality');
14
+ lines.push('');
15
+ lines.push(`- Warm but direct. You know ${name} well and you are here to help.`);
16
+ lines.push('- Refer to the workspace by name. When citing answers, name the collection or source they came from.');
17
+ lines.push('- Never list tool names, API endpoints, or technical identifiers. Translate everything into plain language.');
18
+ lines.push('- Celebrate when something works — say which collection or source an answer came from rather than returning a silent result.');
19
+ lines.push('');
20
+ lines.push('## How you work');
21
+ lines.push('');
22
+ lines.push('- Questions about the business → search and synthesize from workspace knowledge, always citing sources.');
23
+ lines.push('- Requests to add content → ingest URLs, files, or text into the workspace.');
24
+ lines.push('- Organizing work → create collections, portfolios, programs, dossiers — whatever structure the user describes.');
25
+ lines.push('- Daily operations → morning briefs (with email triage and Slack synthesis when connected), meeting prep, draft replies.');
26
+ lines.push('- Business workflows → sales proposals, research and publishing, audits, weekly reviews.');
27
+ lines.push('- Delegation → dispatch crews for complex deliverables; nothing executes without the user\'s approval.');
28
+ lines.push('');
29
+ lines.push('## Progressive disclosure');
30
+ lines.push('');
31
+ lines.push('Introduce capabilities as they become relevant, not all at once. A user asking their first question does not need to hear about crew delegation. A user building their third report is ready to learn about voice profiles.');
32
+ lines.push('');
33
+ lines.push('When suggesting what to try next, frame it around what they just accomplished:');
34
+ lines.push('- After their first search: "Now that you have seen what is here — want to add something new?"');
35
+ lines.push('- After ingesting content: "Good — that is in your workspace now. Want to organize it into a collection?"');
36
+ lines.push('- After connecting tools: "Your Slack and email are flowing in. Try asking for a morning brief."');
37
+ lines.push('');
38
+ lines.push('## Safety');
39
+ lines.push('');
40
+ lines.push('- Never modify or delete content without explicit approval.');
41
+ lines.push('- Crew tasks require the user to approve before execution.');
42
+ lines.push('- When unsure about a destructive action, ask first.');
43
+ lines.push('');
44
+ lines.push('## Technical routing');
45
+ lines.push('');
46
+ lines.push('Prefer a single read tool for direct lookups, synthesis for open questions, and ask before any write or dispatch.');
47
+ return lines.join('\n');
48
+ }
8
49
  async function fetchWorkspaceState(client) {
9
50
  await client.initialize();
10
51
  const wsName = client.workspaceName || 'your workspace';
@@ -63,7 +104,19 @@ const EXPERIENCES = [
63
104
  { id: 'operating_rhythm', num: 9, name: 'Your Operating Rhythm', tier: 3, tierName: 'Agentic Mastery', action: 'Set up weekly reviews, delegate recurring work to crews, and build your voice profile.', signal: 'Return for second session with intent; establish a routine' },
64
105
  ];
65
106
  export function registerPrompts(server, getClientFn) {
66
- server.prompt('assistant_system', 'System prompt for the TACIT workspace assistant.', () => userText(ASSISTANT_SYSTEM_PROMPT));
107
+ server.prompt('assistant_system', 'System prompt for the TACIT workspace assistant — includes persona, progressive disclosure, and safety rules.', async () => {
108
+ if (getClientFn) {
109
+ try {
110
+ const client = await getClientFn();
111
+ const state = await fetchWorkspaceState(client);
112
+ return userText(buildAssistantSystemPrompt(state));
113
+ }
114
+ catch {
115
+ // fall through to static prompt
116
+ }
117
+ }
118
+ return userText(ASSISTANT_SYSTEM_PROMPT_STATIC);
119
+ });
67
120
  server.prompt('lookup', 'Fetch a specific item or list using a single TACIT read tool.', { request: z.string().describe('What to look up, e.g. "list programs"') }, ({ request }) => userText(`Use exactly one TACIT read tool to answer, without synthesis. Request: ${request}`));
68
121
  server.prompt('synthesis', 'Answer a question with grounded synthesis and citations.', { question: z.string().describe('The question to answer') }, ({ question }) => userText(`Call tacit_synthesize for this question and cite the sources it returns. Question: ${question}`));
69
122
  if (!getClientFn)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tacitai/mcp-server",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "stdio MCP server wrapping Tacit /api/v1 REST/SSE API",
5
5
  "license": "MIT",
6
6
  "repository": {