@tacitai/mcp-server 0.6.31 → 0.6.32

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.
@@ -0,0 +1,105 @@
1
+ # Agent role templates — shipped with MCP server, versioned.
2
+ # Each template defines a default role for the workspace exec team.
3
+ # Instances are created lazily on first delegate/approve action.
4
+
5
+ roles:
6
+ - slug: general_manager
7
+ display_name: General Manager
8
+ description: Oversees content placement, artifact lifecycle, and cross-functional coordination.
9
+ icon: briefcase
10
+ default_capabilities:
11
+ - content_placement
12
+ - artifact_management
13
+ - cross_reference
14
+ workflow_types:
15
+ - gm_content_placement
16
+ - cos_coordination
17
+
18
+ - slug: chief_of_staff
19
+ display_name: Chief of Staff
20
+ description: Coordinates cross-functional workflows, manages approvals, and ensures operational alignment.
21
+ icon: clipboard
22
+ default_capabilities:
23
+ - coordination
24
+ - approval_management
25
+ - status_reporting
26
+ workflow_types:
27
+ - cos_coordination
28
+
29
+ - slug: pyramid_executor
30
+ display_name: Pyramid Executor
31
+ description: Manages portfolio, program, and value stream operations within the strategic pyramid.
32
+ icon: layers
33
+ default_capabilities:
34
+ - portfolio_management
35
+ - program_management
36
+ - value_stream_ops
37
+ workflow_types:
38
+ - pyr_exec
39
+
40
+ - slug: coo_operator
41
+ display_name: COO Operator
42
+ description: Handles day-to-day operational workflows, resource allocation, and process management.
43
+ icon: settings
44
+ default_capabilities:
45
+ - operations_management
46
+ - resource_allocation
47
+ - process_optimization
48
+ workflow_types:
49
+ - coo_operations
50
+
51
+ - slug: cmo_marketer
52
+ display_name: CMO Marketer
53
+ description: Manages marketing pipeline, content strategy, and campaign execution.
54
+ icon: megaphone
55
+ default_capabilities:
56
+ - marketing_pipeline
57
+ - content_strategy
58
+ - campaign_management
59
+ workflow_types:
60
+ - cmo_marketing_pipeline
61
+
62
+ - slug: sales_executor
63
+ display_name: Sales Executor
64
+ description: Manages the full sales pipeline from prospecting through close.
65
+ icon: trending_up
66
+ default_capabilities:
67
+ - pipeline_management
68
+ - prospect_engagement
69
+ - deal_management
70
+ workflow_types:
71
+ - sales_full_pipeline
72
+
73
+ - slug: wiki_editor
74
+ display_name: Wiki Editor
75
+ description: Authors and maintains wiki content with structured classification and validation workflows.
76
+ icon: book
77
+ default_capabilities:
78
+ - wiki_authoring
79
+ - content_classification
80
+ - content_validation
81
+ workflow_types:
82
+ - wiki_authoring
83
+
84
+ - slug: kb_curator
85
+ display_name: KB Curator
86
+ description: Curates knowledge base articles, collections, and source integrations.
87
+ icon: library
88
+ default_capabilities:
89
+ - kb_management
90
+ - article_curation
91
+ - source_administration
92
+ workflow_types:
93
+ - kb_management
94
+
95
+ - slug: lake_operator
96
+ display_name: Lake Operator
97
+ description: Manages data lake ingestion, classification, taxonomy, and structure proposals.
98
+ icon: database
99
+ default_capabilities:
100
+ - lake_ingestion
101
+ - classification
102
+ - taxonomy_management
103
+ - structure_proposals
104
+ workflow_types:
105
+ - lake_operations
package/dist/flags.js CHANGED
@@ -22,12 +22,17 @@ export function isWorkflowTypeActive(typeName) {
22
22
  if (!envVar)
23
23
  return true; // GM and unknown types are always active
24
24
  const val = process.env[envVar];
25
- return val === 'true' || val === '1';
25
+ // Unset = enabled (npm users have no env vars). Only explicit 'false'/'0' disables.
26
+ if (val === 'false' || val === '0')
27
+ return false;
28
+ return true;
26
29
  }
27
30
  export function getWorkflowTypeFlag(typeName) {
28
31
  return WORKFLOW_TYPE_FLAGS[typeName];
29
32
  }
30
33
  export function isUserWorkflowTypesActive() {
31
34
  const val = process.env['FEATURE_WORKFLOW_USER_TYPES'];
32
- return val === 'true' || val === '1';
35
+ if (val === 'false' || val === '0')
36
+ return false;
37
+ return true;
33
38
  }
package/dist/index.js CHANGED
@@ -121,9 +121,15 @@ function installPreCallHook(server) {
121
121
  return { content: [{ type: 'text', text: JSON.stringify(block) }], isError: true };
122
122
  }
123
123
  if (!gate.routeToolCall(principal, toolName)) {
124
- const coldBlock = gate.checkColdToolBlock(toolName);
125
- if (coldBlock) {
126
- return { content: [{ type: 'text', text: JSON.stringify(coldBlock) }], isError: true };
124
+ const autoStarted = gate.autoStartForTool(principal, toolName);
125
+ if (autoStarted) {
126
+ gate.recordCallForAll(principal, toolName);
127
+ }
128
+ else {
129
+ const coldBlock = gate.checkColdToolBlock(toolName);
130
+ if (coldBlock) {
131
+ return { content: [{ type: 'text', text: JSON.stringify(coldBlock) }], isError: true };
132
+ }
127
133
  }
128
134
  }
129
135
  return originalHandler(...callArgs);
@@ -209,7 +215,33 @@ async function run() {
209
215
  checkCompatibility();
210
216
  const server = new McpServer({ name: '@tacitai/mcp-server', version: '0.3.0' }, {
211
217
  capabilities: { tools: {}, prompts: {} },
212
- instructions: 'This MCP server manages a workspace executive team with workflow-enforced operations. Use tacit_agent_list to see the team. Use tacit_workflow_prereqs to discover prerequisite chains before calling gated tools. Workflows enforce ordered phases — complete prerequisites before attempting write operations.',
218
+ instructions: [
219
+ 'You have an executive team powered by TACIT. Each role handles a domain — route requests to the right role using tacit_exec_route.',
220
+ '',
221
+ 'ROLE ROUTING TABLE:',
222
+ '- "morning brief", "daily brief", "triage email", "meeting prep" → chief_of_staff',
223
+ '- "operational status", "team coordination", "process review" → coo_operator',
224
+ '- "file this", "save this", "ingest", "place this" → general_manager',
225
+ '- "portfolio", "program", "value stream", "dossier" → pyramid_executor',
226
+ '- "marketing campaign", "brand", "content strategy" → cmo_marketer',
227
+ '- "sales pipeline", "proposal", "discovery", "prospect" → sales_executor',
228
+ '- "research", "competitors", "SOTA", "survey" → use tacit_research_prepare directly',
229
+ '- "wiki article", "publish to wiki" → wiki_editor',
230
+ '- "knowledge base", "KB article", "organize knowledge" → kb_curator',
231
+ '- "data sources", "data lake", "classify", "taxonomy" → lake_operator',
232
+ '',
233
+ 'HOW TO START:',
234
+ '1. For any business request, call tacit_exec_route with the user\'s intent. It returns the role, workflow type, and a script of tools to call.',
235
+ '2. Follow the returned script step by step — each tool result includes next-step guidance.',
236
+ '3. Use tacit_agent_list to see the team and their status.',
237
+ '4. Use tacit_agent_delegate to hand work to a specific role (async by default).',
238
+ '5. Use tacit_workflow_prereqs to check what steps a gated tool requires.',
239
+ '',
240
+ 'RULES:',
241
+ '- Workflows enforce ordered phases. Complete prerequisites before write operations.',
242
+ '- Wiki writes require approval. KB and lake reads are ungated.',
243
+ '- Follow tool result scripts deterministically — they encode the workflow.',
244
+ ].join('\n'),
213
245
  });
214
246
  const isHttpMode = process.env['MCP_TRANSPORT'] === 'http';
215
247
  let clientInstance = null;
@@ -55,7 +55,7 @@ export declare const agentDelegateInputSchema: z.ZodEffects<z.ZodObject<{
55
55
  agent_id: z.ZodOptional<z.ZodString>;
56
56
  role_slug: z.ZodOptional<z.ZodString>;
57
57
  task: z.ZodString;
58
- kind: z.ZodOptional<z.ZodString>;
58
+ kind: z.ZodDefault<z.ZodOptional<z.ZodEnum<["task", "goal", "schedule"]>>>;
59
59
  target_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
60
60
  program_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
61
61
  dossier_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
@@ -63,12 +63,12 @@ export declare const agentDelegateInputSchema: z.ZodEffects<z.ZodObject<{
63
63
  wait_timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
64
64
  }, "strip", z.ZodTypeAny, {
65
65
  task: string;
66
+ kind: "task" | "goal" | "schedule";
66
67
  wait: boolean;
67
68
  wait_timeout: number;
68
69
  program_ids?: string[] | undefined;
69
70
  role_slug?: string | undefined;
70
71
  agent_id?: string | undefined;
71
- kind?: string | undefined;
72
72
  target_ids?: string[] | undefined;
73
73
  dossier_ids?: string[] | undefined;
74
74
  }, {
@@ -76,19 +76,19 @@ export declare const agentDelegateInputSchema: z.ZodEffects<z.ZodObject<{
76
76
  program_ids?: string[] | undefined;
77
77
  role_slug?: string | undefined;
78
78
  agent_id?: string | undefined;
79
- kind?: string | undefined;
79
+ kind?: "task" | "goal" | "schedule" | undefined;
80
80
  target_ids?: string[] | undefined;
81
81
  dossier_ids?: string[] | undefined;
82
82
  wait?: boolean | undefined;
83
83
  wait_timeout?: number | undefined;
84
84
  }>, {
85
85
  task: string;
86
+ kind: "task" | "goal" | "schedule";
86
87
  wait: boolean;
87
88
  wait_timeout: number;
88
89
  program_ids?: string[] | undefined;
89
90
  role_slug?: string | undefined;
90
91
  agent_id?: string | undefined;
91
- kind?: string | undefined;
92
92
  target_ids?: string[] | undefined;
93
93
  dossier_ids?: string[] | undefined;
94
94
  }, {
@@ -96,7 +96,7 @@ export declare const agentDelegateInputSchema: z.ZodEffects<z.ZodObject<{
96
96
  program_ids?: string[] | undefined;
97
97
  role_slug?: string | undefined;
98
98
  agent_id?: string | undefined;
99
- kind?: string | undefined;
99
+ kind?: "task" | "goal" | "schedule" | undefined;
100
100
  target_ids?: string[] | undefined;
101
101
  dossier_ids?: string[] | undefined;
102
102
  wait?: boolean | undefined;
@@ -59,7 +59,9 @@ export function buildAgentListRequest(client, input) {
59
59
  try {
60
60
  const result = await callAgentTool(client, 'tacit.agents.list', args);
61
61
  const r = result;
62
- const list = Array.isArray(r) ? r : r?.agents;
62
+ const list = Array.isArray(r)
63
+ ? r
64
+ : r?.items ?? r?.agents;
63
65
  if (Array.isArray(list))
64
66
  instances = list;
65
67
  }
@@ -100,7 +102,7 @@ export const agentDelegateInputSchema = z.object({
100
102
  agent_id: z.string().min(1).optional().describe('UUID of the agent to delegate to (provide this OR role_slug)'),
101
103
  role_slug: z.string().min(1).optional().describe('Role template slug (e.g. "wiki_editor"). Resolves to agent_id; creates instance on first use'),
102
104
  task: z.string().min(1).describe('Task description to delegate'),
103
- kind: z.string().optional().describe('Task kind (default: "task")'),
105
+ kind: z.enum(['task', 'goal', 'schedule']).optional().default('task').describe('Task kind (default: "task")'),
104
106
  target_ids: z.array(z.string()).optional().describe('Target entity UUIDs for the task'),
105
107
  program_ids: z.array(z.string()).optional().describe('Program UUIDs to scope the task'),
106
108
  dossier_ids: z.array(z.string()).optional().describe('Dossier UUIDs to scope the task'),
@@ -35,7 +35,7 @@ function excerptOf(r) {
35
35
  }
36
36
  function toSource(r, type) {
37
37
  return {
38
- title: str(r['title'] ?? r['name'] ?? r['file_name'] ?? r['path']) || '(untitled)',
38
+ title: str(r['title'] ?? r['name'] ?? r['file_name'] ?? r['path'] ?? r['source_uri']) || '(untitled)',
39
39
  excerpt: excerptOf(r),
40
40
  source_id: str(r['id'] ?? r['source_id'] ?? r['article_id'] ?? r['entity_id']),
41
41
  source_type: type,
@@ -190,6 +190,13 @@ export declare class WorkflowGate {
190
190
  * the caller has no active instance (first-contact rejection).
191
191
  */
192
192
  checkColdToolBlock(toolName: string): GateVerdict | null;
193
+ /**
194
+ * Auto-start a workflow when a tool is the phase-0 requiredTool of exactly one
195
+ * phased type whose flag is active. Returns the new instance, or null if no
196
+ * unambiguous match (0 or 2+ candidates). Called from the pre-call hook between
197
+ * routeToolCall miss and checkColdToolBlock.
198
+ */
199
+ autoStartForTool(principal: string | null, toolName: string): WorkflowInstance | null;
193
200
  /**
194
201
  * Record a tool call for ALL active instances that include this tool in their
195
202
  * type definition. For legacy GM callers, the 2-arg recordCall below also works.
@@ -14,6 +14,7 @@
14
14
  */
15
15
  import { createDefaultRegistry, PYRAMID_PREREQ_TOOLS as _PYRAMID_PREREQ_TOOLS, KB_PREREQ_TOOL as _KB_PREREQ_TOOL, } from './workflow-registry.js';
16
16
  import { getCachedAutonomy as _getCachedAutonomyFromClient, autonomyAtLeast, } from './client.js';
17
+ import { isWorkflowTypeActive } from './flags.js';
17
18
  /** Re-export from workflow-registry.ts (canonical source) for backwards compatibility. */
18
19
  export const PYRAMID_PREREQ_TOOLS = _PYRAMID_PREREQ_TOOLS;
19
20
  export const KB_PREREQ_TOOL = _KB_PREREQ_TOOL;
@@ -658,6 +659,31 @@ export class WorkflowGate {
658
659
  }
659
660
  return null;
660
661
  }
662
+ /**
663
+ * Auto-start a workflow when a tool is the phase-0 requiredTool of exactly one
664
+ * phased type whose flag is active. Returns the new instance, or null if no
665
+ * unambiguous match (0 or 2+ candidates). Called from the pre-call hook between
666
+ * routeToolCall miss and checkColdToolBlock.
667
+ */
668
+ autoStartForTool(principal, toolName) {
669
+ const candidates = [];
670
+ for (const typeDef of this.registry.list()) {
671
+ if (typeDef.prereqs.kind !== 'phased')
672
+ continue;
673
+ if (!isWorkflowTypeActive(typeDef.name))
674
+ continue;
675
+ const phase0 = typeDef.prereqs.phases[0];
676
+ if (!phase0)
677
+ continue;
678
+ if (phase0.requiredTools.includes(toolName)) {
679
+ candidates.push(typeDef);
680
+ }
681
+ }
682
+ if (candidates.length !== 1)
683
+ return null;
684
+ const typeDef = candidates[0];
685
+ return this.startWorkflowTyped(principal, typeDef.name);
686
+ }
661
687
  /**
662
688
  * Record a tool call for ALL active instances that include this tool in their
663
689
  * type definition. For legacy GM callers, the 2-arg recordCall below also works.
@@ -298,7 +298,7 @@ export const RESEARCH_TYPE_DEF = {
298
298
  { name: 'plan_approval', requiredTools: [], gatedTools: ['tacit_research_launch'], approvalGate: true, guidance: 'RESEARCH_PLAN_APPROVAL' },
299
299
  { name: 'dispatch', requiredTools: ['tacit_research_launch'], gatedTools: [], approvalGate: false, guidance: 'RESEARCH_DISPATCH' },
300
300
  { name: 'synthesis', requiredTools: [], gatedTools: [], approvalGate: false, guidance: 'RESEARCH_SYNTHESIS' },
301
- { name: 'placement', requiredTools: ['tacit_research_place'], gatedTools: ['tacit_gm_ingest'], approvalGate: true, guidance: 'RESEARCH_PLACEMENT' },
301
+ { name: 'placement', requiredTools: ['tacit_research_place'], gatedTools: [], approvalGate: true, guidance: 'RESEARCH_PLACEMENT' },
302
302
  ],
303
303
  },
304
304
  persistent: true,
@@ -316,7 +316,7 @@ export const WIKI_TYPE_DEF = {
316
316
  phases: [
317
317
  { name: 'classify', requiredTools: ['tacit_wiki_classify'], gatedTools: [], approvalGate: false, guidance: 'Classify the content type and target wiki section before authoring.' },
318
318
  { name: 'validate', requiredTools: ['tacit_wiki_validate'], gatedTools: [], approvalGate: false, guidance: 'Validate content structure and references before writing.' },
319
- { name: 'author', requiredTools: ['tacit_wiki_author'], gatedTools: ['tacit_wiki_write', 'tacit_wiki_override'], approvalGate: false, guidance: 'Author the content. Write and override tools unlock after this phase.' },
319
+ { name: 'author', requiredTools: ['tacit_wiki_author'], gatedTools: ['tacit_wiki_write', 'tacit_wiki_override'], approvalGate: true, guidance: 'Author the content. Approval required before write and override tools unlock.' },
320
320
  ],
321
321
  },
322
322
  failDirection: 'open',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tacitai/mcp-server",
3
- "version": "0.6.31",
3
+ "version": "0.6.32",
4
4
  "description": "stdio MCP server wrapping Tacit /api/v1 REST/SSE API",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
@@ -15,7 +15,8 @@
15
15
  },
16
16
  "files": [
17
17
  "dist",
18
- "!dist/**/*.map"
18
+ "!dist/**/*.map",
19
+ "config"
19
20
  ],
20
21
  "engines": {
21
22
  "node": ">=18.0.0"