@tacitai/mcp-server 0.6.34 → 0.6.36
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/index.js +4 -3
- package/dist/setup.js +17 -0
- package/dist/tools/agents.d.ts +1 -0
- package/dist/tools/agents.js +33 -13
- package/dist/tools/artifacts.d.ts +8 -1
- package/dist/tools/artifacts.js +14 -6
- package/dist/tools/exec-route.js +20 -3
- package/dist/tools/gm.js +9 -1
- package/dist/tools/research.js +5 -3
- package/dist/tools/search.js +22 -1
- package/dist/workflow-registry.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -279,17 +279,18 @@ async function run() {
|
|
|
279
279
|
'- "portfolio", "program", "value stream", "dossier" → pyramid_executor',
|
|
280
280
|
'- "marketing campaign", "brand", "content strategy" → cmo_marketer',
|
|
281
281
|
'- "sales pipeline", "proposal", "discovery", "prospect" → sales_executor',
|
|
282
|
-
'- "research", "competitors", "SOTA", "survey" → use tacit_research_prepare directly',
|
|
282
|
+
'- "research", "competitors", "SOTA", "survey" → researcher (or use tacit_research_prepare directly)',
|
|
283
283
|
'- "wiki article", "publish to wiki" → wiki_editor',
|
|
284
284
|
'- "knowledge base", "KB article", "organize knowledge" → kb_curator',
|
|
285
285
|
'- "data sources", "data lake", "classify", "taxonomy" → lake_operator',
|
|
286
286
|
'',
|
|
287
287
|
'HOW TO START:',
|
|
288
288
|
'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.',
|
|
289
|
-
'2. Follow the returned script step by step
|
|
289
|
+
'2. Follow the returned script step by step.',
|
|
290
290
|
'3. Use tacit_agent_list to see the team and their status.',
|
|
291
|
-
'4. Use tacit_agent_delegate to hand work to a specific role
|
|
291
|
+
'4. Use tacit_agent_delegate to hand work to a specific role. Set wait=true to get results inline, or leave default (wait=false) for async dispatch.',
|
|
292
292
|
'5. Use tacit_workflow_prereqs to check what steps a gated tool requires.',
|
|
293
|
+
'6. After async delegation, use tacit_agent_status with agent_id and run_id to check progress and retrieve results.',
|
|
293
294
|
'',
|
|
294
295
|
'RULES:',
|
|
295
296
|
'- Workflows enforce ordered phases. Complete prerequisites before write operations.',
|
package/dist/setup.js
CHANGED
|
@@ -129,6 +129,22 @@ function readExistingConfig() {
|
|
|
129
129
|
return {};
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
|
+
/**
|
|
133
|
+
* Web app URL for shareable links: api.* → app.*, localhost API → localhost:5174.
|
|
134
|
+
*/
|
|
135
|
+
function deriveAppUrl(apiUrl) {
|
|
136
|
+
const url = new URL(apiUrl);
|
|
137
|
+
url.username = '';
|
|
138
|
+
url.password = '';
|
|
139
|
+
if (url.hostname === 'localhost' || url.hostname === '127.0.0.1') {
|
|
140
|
+
url.port = '5174';
|
|
141
|
+
url.pathname = '/';
|
|
142
|
+
return url.toString().replace(/\/$/, '');
|
|
143
|
+
}
|
|
144
|
+
url.hostname = url.hostname.replace(/^api[-.]/, (m) => m === 'api.' ? 'app.' : '');
|
|
145
|
+
url.pathname = '/';
|
|
146
|
+
return url.toString().replace(/\/$/, '');
|
|
147
|
+
}
|
|
132
148
|
/**
|
|
133
149
|
* Build the MCP server entry for a given profile.
|
|
134
150
|
*
|
|
@@ -145,6 +161,7 @@ function buildProfileEntry(apiUrl, envVarName, token) {
|
|
|
145
161
|
env: {
|
|
146
162
|
TACIT_TOKEN: token ?? `\${${envVarName}}`,
|
|
147
163
|
TACIT_API_URL: apiUrl,
|
|
164
|
+
TACIT_APP_URL: deriveAppUrl(apiUrl),
|
|
148
165
|
},
|
|
149
166
|
};
|
|
150
167
|
}
|
package/dist/tools/agents.d.ts
CHANGED
package/dist/tools/agents.js
CHANGED
|
@@ -111,17 +111,16 @@ export const agentDelegateInputSchema = z.object({
|
|
|
111
111
|
}).refine((d) => d.agent_id || d.role_slug, { message: 'Either agent_id or role_slug is required' });
|
|
112
112
|
export const AGENT_DELEGATE_TOOL_DEF = {
|
|
113
113
|
name: 'tacit_agent_delegate',
|
|
114
|
-
description: 'Delegate a task to a business agent
|
|
114
|
+
description: 'Delegate a task to a business agent. Accepts agent_id (UUID) or role_slug (template name). ' +
|
|
115
115
|
'When role_slug is used and no instance exists, the agent is created on first delegation. ' +
|
|
116
|
-
'
|
|
117
|
-
'Set wait=false to return immediately with just the assignment_id and run_id.',
|
|
116
|
+
'Returns run_id immediately by default; set wait=true to get results inline.',
|
|
118
117
|
inputSchema: {
|
|
119
118
|
type: 'object',
|
|
120
119
|
properties: {
|
|
121
120
|
agent_id: { type: 'string', description: 'UUID of the agent to delegate to (provide this OR role_slug)' },
|
|
122
121
|
role_slug: { type: 'string', description: 'Role template slug (e.g. "wiki_editor"). Creates instance on first use' },
|
|
123
122
|
task: { type: 'string', description: 'Task description to delegate' },
|
|
124
|
-
kind: { type: 'string', description: 'Task kind (default: "task")' },
|
|
123
|
+
kind: { type: 'string', enum: ['task', 'goal', 'schedule'], description: 'Task kind (default: "task")' },
|
|
125
124
|
target_ids: { type: 'array', items: { type: 'string' }, description: 'Target entity UUIDs' },
|
|
126
125
|
program_ids: { type: 'array', items: { type: 'string' }, description: 'Program UUIDs to scope the task' },
|
|
127
126
|
dossier_ids: { type: 'array', items: { type: 'string' }, description: 'Dossier UUIDs to scope the task' },
|
|
@@ -229,9 +228,13 @@ async function pollForCompletion(client, agentId, runId, timeoutSec) {
|
|
|
229
228
|
}
|
|
230
229
|
}
|
|
231
230
|
}
|
|
232
|
-
catch {
|
|
233
|
-
|
|
231
|
+
catch (err) {
|
|
232
|
+
if (timeoutSec <= 1) {
|
|
233
|
+
return { completed: false, failed: true, events: [{ error: err instanceof Error ? err.message : String(err) }] };
|
|
234
|
+
}
|
|
234
235
|
}
|
|
236
|
+
if (Date.now() + POLL_INTERVAL_MS > deadline)
|
|
237
|
+
break;
|
|
235
238
|
await sleep(POLL_INTERVAL_MS);
|
|
236
239
|
}
|
|
237
240
|
return { completed: false, failed: false, events: [] };
|
|
@@ -271,7 +274,14 @@ export function buildAgentDelegateRequest(client, input) {
|
|
|
271
274
|
const runId = result['run_id'];
|
|
272
275
|
const status = result['status'] ?? '';
|
|
273
276
|
if (!shouldWait || !runId || status === 'duplicate') {
|
|
274
|
-
|
|
277
|
+
const asyncResult = { ...result, agent_id: resolved.agent_id };
|
|
278
|
+
if (!shouldWait && runId) {
|
|
279
|
+
asyncResult['_next_steps'] = [
|
|
280
|
+
'Delegation dispatched asynchronously. Use tacit_agent_status with agent_id and run_id to check progress.',
|
|
281
|
+
'When complete, the status response includes the agent\'s output messages.',
|
|
282
|
+
];
|
|
283
|
+
}
|
|
284
|
+
return { content: [{ type: 'text', text: JSON.stringify(asyncResult) }] };
|
|
275
285
|
}
|
|
276
286
|
// Poll for completion, then fetch output messages
|
|
277
287
|
const timeoutSec = input.wait_timeout ?? 120;
|
|
@@ -488,7 +498,7 @@ export function registerAgentTools(server, getClientFn) {
|
|
|
488
498
|
agent_id: z.string().min(1).optional().describe('UUID of the agent to delegate to (provide this OR role_slug)'),
|
|
489
499
|
role_slug: z.string().min(1).optional().describe('Role template slug (e.g. "wiki_editor"). Creates instance on first use'),
|
|
490
500
|
task: z.string().min(1).describe('Task description to delegate'),
|
|
491
|
-
kind: z.
|
|
501
|
+
kind: z.enum(['task', 'goal', 'schedule']).optional().default('task').describe('Task kind (default: "task")'),
|
|
492
502
|
target_ids: z.array(z.string()).optional().describe('Target entity UUIDs'),
|
|
493
503
|
program_ids: z.array(z.string()).optional().describe('Program UUIDs'),
|
|
494
504
|
dossier_ids: z.array(z.string()).optional().describe('Dossier UUIDs'),
|
|
@@ -527,17 +537,27 @@ export function registerAgentTools(server, getClientFn) {
|
|
|
527
537
|
return buildAgentTimelineRequest(client, args).execute();
|
|
528
538
|
});
|
|
529
539
|
// A4: tacit_agent_status — check status of a delegation run
|
|
530
|
-
server.tool('tacit_agent_status', 'Check status of an agent delegation run. Returns run status
|
|
540
|
+
server.tool('tacit_agent_status', 'Check status of an agent delegation run. Returns run status and output messages if complete.', {
|
|
541
|
+
agent_id: z.string().min(1).describe('Agent ID returned by tacit_agent_delegate'),
|
|
531
542
|
run_id: z.string().min(1).describe('Run ID from a prior tacit_agent_delegate call'),
|
|
532
543
|
}, async (args) => {
|
|
533
544
|
const client = await getClientFn();
|
|
534
545
|
try {
|
|
535
|
-
const
|
|
536
|
-
|
|
546
|
+
const poll = await pollForCompletion(client, args.agent_id, args.run_id, 1);
|
|
547
|
+
const status = poll.completed ? 'completed' : poll.failed ? 'failed' : 'running';
|
|
548
|
+
const out = {
|
|
549
|
+
agent_id: args.agent_id,
|
|
550
|
+
run_id: args.run_id,
|
|
551
|
+
status,
|
|
552
|
+
events: poll.events,
|
|
553
|
+
};
|
|
554
|
+
if (poll.completed) {
|
|
555
|
+
out['messages'] = await fetchRunMessages(client, args.agent_id);
|
|
556
|
+
}
|
|
557
|
+
return { content: [{ type: 'text', text: JSON.stringify(out, null, 2) }] };
|
|
537
558
|
}
|
|
538
559
|
catch (err) {
|
|
539
|
-
|
|
540
|
-
return { content: [{ type: 'text', text: JSON.stringify({ error: msg }) }], isError: true };
|
|
560
|
+
return apiErrorResult(err, 'tacit_agent_status');
|
|
541
561
|
}
|
|
542
562
|
});
|
|
543
563
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* portfolio_id, structured_metadata. portfolio_id is REQUIRED (403 without it).
|
|
14
14
|
* - artifact_kind is hardcoded server-side (GENERIC) — the client must NOT send it.
|
|
15
15
|
* - The artifact body is populated server-side from structured_metadata
|
|
16
|
-
* (e.g. full_posting_text); the
|
|
16
|
+
* (e.g. full_posting_text); the optional `content` input is mapped onto that field.
|
|
17
17
|
* - domain defaults to GENERAL if omitted; caller may pass any valid domain.
|
|
18
18
|
*/
|
|
19
19
|
import { z } from 'zod';
|
|
@@ -97,14 +97,17 @@ export declare const artifactCreateInputSchema: z.ZodObject<{
|
|
|
97
97
|
domain: z.ZodOptional<z.ZodString>;
|
|
98
98
|
portfolio_id: z.ZodString;
|
|
99
99
|
structured_metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
100
|
+
content: z.ZodOptional<z.ZodString>;
|
|
100
101
|
}, "strip", z.ZodTypeAny, {
|
|
101
102
|
title: string;
|
|
102
103
|
portfolio_id: string;
|
|
104
|
+
content?: string | undefined;
|
|
103
105
|
domain?: string | undefined;
|
|
104
106
|
structured_metadata?: Record<string, unknown> | undefined;
|
|
105
107
|
}, {
|
|
106
108
|
title: string;
|
|
107
109
|
portfolio_id: string;
|
|
110
|
+
content?: string | undefined;
|
|
108
111
|
domain?: string | undefined;
|
|
109
112
|
structured_metadata?: Record<string, unknown> | undefined;
|
|
110
113
|
}>;
|
|
@@ -131,6 +134,10 @@ export declare const ARTIFACT_CREATE_TOOL_DEF: {
|
|
|
131
134
|
type: string;
|
|
132
135
|
description: string;
|
|
133
136
|
};
|
|
137
|
+
content: {
|
|
138
|
+
type: string;
|
|
139
|
+
description: string;
|
|
140
|
+
};
|
|
134
141
|
};
|
|
135
142
|
required: string[];
|
|
136
143
|
};
|
package/dist/tools/artifacts.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* portfolio_id, structured_metadata. portfolio_id is REQUIRED (403 without it).
|
|
14
14
|
* - artifact_kind is hardcoded server-side (GENERIC) — the client must NOT send it.
|
|
15
15
|
* - The artifact body is populated server-side from structured_metadata
|
|
16
|
-
* (e.g. full_posting_text); the
|
|
16
|
+
* (e.g. full_posting_text); the optional `content` input is mapped onto that field.
|
|
17
17
|
* - domain defaults to GENERAL if omitted; caller may pass any valid domain.
|
|
18
18
|
*/
|
|
19
19
|
import { z } from 'zod';
|
|
@@ -95,6 +95,7 @@ export const artifactCreateInputSchema = z.object({
|
|
|
95
95
|
.record(z.unknown())
|
|
96
96
|
.optional()
|
|
97
97
|
.describe('Structured metadata; the artifact body is populated server-side from this (e.g. full_posting_text)'),
|
|
98
|
+
content: z.string().optional().describe('Body text or HTML content for the artifact'),
|
|
98
99
|
});
|
|
99
100
|
export const ARTIFACT_CREATE_TOOL_DEF = {
|
|
100
101
|
name: 'tacit_artifact_create',
|
|
@@ -103,7 +104,7 @@ export const ARTIFACT_CREATE_TOOL_DEF = {
|
|
|
103
104
|
'Accepts a title, optional domain (CAREER, GENERAL, ENGINEERING, PRODUCT — defaults to GENERAL), ' +
|
|
104
105
|
'and an optional structured_metadata object; portfolio_id is required. ' +
|
|
105
106
|
'The artifact body is populated server-side from structured_metadata (e.g. full_posting_text), ' +
|
|
106
|
-
'and artifact_kind is hardcoded server-side — neither is sent by this tool. ' +
|
|
107
|
+
'and artifact_kind is hardcoded server-side — neither is sent by this tool. Pass content for the artifact body. ' +
|
|
107
108
|
'Route: POST /api/v1/artifacts.',
|
|
108
109
|
inputSchema: {
|
|
109
110
|
type: 'object',
|
|
@@ -115,6 +116,7 @@ export const ARTIFACT_CREATE_TOOL_DEF = {
|
|
|
115
116
|
type: 'object',
|
|
116
117
|
description: 'Structured metadata; artifact body is populated server-side from this (e.g. full_posting_text)',
|
|
117
118
|
},
|
|
119
|
+
content: { type: 'string', description: 'Body text or HTML content for the artifact' },
|
|
118
120
|
},
|
|
119
121
|
required: ['title', 'portfolio_id'],
|
|
120
122
|
},
|
|
@@ -122,15 +124,20 @@ export const ARTIFACT_CREATE_TOOL_DEF = {
|
|
|
122
124
|
export function buildArtifactCreateRequest(client, input) {
|
|
123
125
|
return {
|
|
124
126
|
async execute() {
|
|
125
|
-
const { title, domain, portfolio_id, structured_metadata } = input;
|
|
127
|
+
const { title, domain, portfolio_id, structured_metadata, content } = input;
|
|
126
128
|
try {
|
|
127
129
|
const body = {
|
|
128
130
|
title,
|
|
129
131
|
domain: (domain ?? 'general').toLowerCase(),
|
|
130
132
|
portfolio_id,
|
|
131
133
|
};
|
|
132
|
-
if (
|
|
133
|
-
body['
|
|
134
|
+
if (content !== undefined)
|
|
135
|
+
body['content'] = content;
|
|
136
|
+
const metadata = content !== undefined
|
|
137
|
+
? { ...(structured_metadata ?? {}), full_posting_text: content }
|
|
138
|
+
: structured_metadata;
|
|
139
|
+
if (metadata !== undefined)
|
|
140
|
+
body['structured_metadata'] = metadata;
|
|
134
141
|
// POST /api/v1/artifacts
|
|
135
142
|
const result = await client.post('/api/v1/artifacts', body);
|
|
136
143
|
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
@@ -425,11 +432,12 @@ export function registerArtifactTools(server, getClientFn) {
|
|
|
425
432
|
const client = await getClientFn();
|
|
426
433
|
return buildArtifactListRequest(client, args).execute();
|
|
427
434
|
});
|
|
428
|
-
server.tool('tacit_artifact_create', 'For new content, prefer tacit_gm_ingest (lake-first). This tool creates an artifact directly without a data lake catalog entry or classification. Create an artifact. Route: POST /api/v1/artifacts.', {
|
|
435
|
+
server.tool('tacit_artifact_create', 'For new content, prefer tacit_gm_ingest (lake-first). This tool creates an artifact directly without a data lake catalog entry or classification. Create an artifact. Pass content for the artifact body. Route: POST /api/v1/artifacts.', {
|
|
429
436
|
title: z.string().min(1).describe('Artifact title'),
|
|
430
437
|
domain: z.string().optional().describe('Domain tag (e.g. CAREER, GENERAL, ENGINEERING, PRODUCT). Defaults to GENERAL.'),
|
|
431
438
|
portfolio_id: z.string().min(1).describe('Portfolio UUID (REQUIRED)'),
|
|
432
439
|
structured_metadata: z.record(z.unknown()).optional().describe('Structured metadata'),
|
|
440
|
+
content: z.string().optional().describe('Body text or HTML content for the artifact'),
|
|
433
441
|
}, async (args) => {
|
|
434
442
|
const client = await getClientFn();
|
|
435
443
|
return buildArtifactCreateRequest(client, args).execute();
|
package/dist/tools/exec-route.js
CHANGED
|
@@ -50,6 +50,13 @@ const ROLE_ROUTES = [
|
|
|
50
50
|
keywords: ['sales', 'pipeline', 'proposal', 'discovery', 'prospect', 'lead', 'deal', 'quote', 'revenue'],
|
|
51
51
|
description: 'Sales pipeline, proposals, discovery calls, prospecting, deal management.',
|
|
52
52
|
},
|
|
53
|
+
{
|
|
54
|
+
slug: 'researcher',
|
|
55
|
+
present_as: 'Research Analyst',
|
|
56
|
+
workflow_type: 'cos_coordination',
|
|
57
|
+
keywords: ['research', 'competitors', 'competitive analysis', 'market research', 'industry analysis', 'state of the art', 'benchmark'],
|
|
58
|
+
description: 'Prepares research briefs using tacit_research_prepare. For deep research topics, competitor analysis, and industry surveys.',
|
|
59
|
+
},
|
|
53
60
|
{
|
|
54
61
|
slug: 'wiki_editor',
|
|
55
62
|
present_as: 'Wiki Editor',
|
|
@@ -90,7 +97,7 @@ function matchRole(request) {
|
|
|
90
97
|
if (scores.length === 0) {
|
|
91
98
|
// Default to GM — it can triage
|
|
92
99
|
return {
|
|
93
|
-
primary: ROLE_ROUTES
|
|
100
|
+
primary: ROLE_ROUTES.find((r) => r.slug === 'general_manager'),
|
|
94
101
|
alternatives: [],
|
|
95
102
|
};
|
|
96
103
|
}
|
|
@@ -103,8 +110,14 @@ function matchRole(request) {
|
|
|
103
110
|
}
|
|
104
111
|
function buildScript(role) {
|
|
105
112
|
const steps = [];
|
|
113
|
+
if (role.workflow_type === 'cos_coordination' && role.slug === 'researcher') {
|
|
114
|
+
steps.push('Call tacit_research_prepare with the research topic instead of tacit_agent_delegate.');
|
|
115
|
+
steps.push('Review the prepared context, then call tacit_research_launch to execute the research.');
|
|
116
|
+
steps.push('Check tacit_workflow_prereqs if a tool returns a workflow block — it shows required prior steps.');
|
|
117
|
+
return steps;
|
|
118
|
+
}
|
|
106
119
|
steps.push(`Call tacit_agent_delegate with role_slug="${role.slug}" and your task description.`);
|
|
107
|
-
steps.push('The delegation returns
|
|
120
|
+
steps.push('The delegation returns agent_id and run_id. Use tacit_agent_status with both to check progress and retrieve results.');
|
|
108
121
|
if (role.workflow_type === 'gm_operations') {
|
|
109
122
|
steps.push('For content placement: call tacit_gm_ingest first, then tacit_gm_approve to confirm placement.');
|
|
110
123
|
}
|
|
@@ -114,6 +127,10 @@ function buildScript(role) {
|
|
|
114
127
|
else if (role.workflow_type === 'pyramid_operations') {
|
|
115
128
|
steps.push('Use tacit_pyramid_list_portfolios to see the current structure before making changes.');
|
|
116
129
|
}
|
|
130
|
+
if (role.workflow_type === 'cos_operations' || role.workflow_type === 'sales_operations') {
|
|
131
|
+
steps.push('While synthesizing, emit brief terminal progress updates so the user knows the system is working.');
|
|
132
|
+
steps.push('Present the final report as a designed HTML artifact — invoke /artifact-design for the appropriate treatment, publish with the Artifact tool, and open it in the browser automatically.');
|
|
133
|
+
}
|
|
117
134
|
steps.push('Check tacit_workflow_prereqs if a tool returns a workflow block — it shows required prior steps.');
|
|
118
135
|
return steps;
|
|
119
136
|
}
|
|
@@ -146,7 +163,7 @@ export function registerExecRouteTool(server) {
|
|
|
146
163
|
present_as: primary.present_as,
|
|
147
164
|
workflow_type: primary.workflow_type,
|
|
148
165
|
description: primary.description,
|
|
149
|
-
first_tool: 'tacit_agent_delegate',
|
|
166
|
+
first_tool: primary.slug === 'researcher' ? 'tacit_research_prepare' : 'tacit_agent_delegate',
|
|
150
167
|
script: buildScript(primary),
|
|
151
168
|
...(alternatives.length > 0 ? { alternatives } : {}),
|
|
152
169
|
};
|
package/dist/tools/gm.js
CHANGED
|
@@ -252,7 +252,15 @@ export function buildGmIngestRequest(client, input) {
|
|
|
252
252
|
body['classification_hints'] = input.classification_hints;
|
|
253
253
|
// cross_reference is deliberately NOT sent: it is an MCP-layer workflow flag
|
|
254
254
|
// (FEAT-249) consumed by the WorkflowGate in registerGmTools, not a backend field.
|
|
255
|
-
const result = await client.post('/api/v1/gm/ingest', body);
|
|
255
|
+
const result = (await client.post('/api/v1/gm/ingest', body));
|
|
256
|
+
if (result['artifact_id'] !== undefined) {
|
|
257
|
+
result['placement_state'] = 'artifact_created';
|
|
258
|
+
}
|
|
259
|
+
else if (result['catalog_id'] !== undefined && result['program_id'] === undefined) {
|
|
260
|
+
result['placement_state'] = 'lake_only';
|
|
261
|
+
result['placement_message'] =
|
|
262
|
+
'Content is in the data lake. Call tacit_gm_approve with catalog_id and approved_targets (program UUID array) to place it in the pyramid.';
|
|
263
|
+
}
|
|
256
264
|
return {
|
|
257
265
|
content: [
|
|
258
266
|
{ type: 'text', text: JSON.stringify(result) },
|
package/dist/tools/research.js
CHANGED
|
@@ -395,9 +395,11 @@ export function registerResearchTools(server, getClientFn, getPrincipalFn) {
|
|
|
395
395
|
catch { /* portfolio unavailable */ }
|
|
396
396
|
}
|
|
397
397
|
try {
|
|
398
|
-
const lake = await client.get('/api/v1/org/lake/catalog');
|
|
399
|
-
|
|
400
|
-
|
|
398
|
+
const lake = await client.get('/api/v1/org/lake/catalog', { limit: 50 });
|
|
399
|
+
const lakeSources = asRecords(lake, 'items', 'catalog', 'entries')
|
|
400
|
+
.map((r) => toSource(r, 'lake'))
|
|
401
|
+
.filter((s) => !(s.title === '(untitled)' && !s.excerpt.trim()));
|
|
402
|
+
sources.push(...lakeSources.slice(0, 25));
|
|
401
403
|
}
|
|
402
404
|
catch { /* lake endpoint unavailable */ }
|
|
403
405
|
return ok({
|
package/dist/tools/search.js
CHANGED
|
@@ -108,13 +108,34 @@ export function registerSearchTools(server, getClientFn) {
|
|
|
108
108
|
return apiErrorResult(err, '/api/v1/search');
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
|
-
server.tool('tacit_entity_search', 'Search for entities by tag.', {
|
|
111
|
+
server.tool('tacit_entity_search', 'Search for entities by exact tag match (people, events, artifacts, etc.). Tags must match exactly; if nothing matches, use tacit_search for full-text search, tacit_list_people to browse people, or tacit_search_events to search events.', {
|
|
112
112
|
tag: z.string().describe('Entity tag to search for'),
|
|
113
113
|
limit: z.number().int().optional().describe('Max results (default 20, cap 100)'),
|
|
114
114
|
}, async (args) => {
|
|
115
115
|
try {
|
|
116
116
|
const client = await getClientFn();
|
|
117
117
|
const data = await client.get('/api/v1/search/entity', { tag: args.tag, limit: args.limit });
|
|
118
|
+
const items = Array.isArray(data)
|
|
119
|
+
? data
|
|
120
|
+
: data && typeof data === 'object'
|
|
121
|
+
? (data['results'] ?? data['entities'] ?? data['items'])
|
|
122
|
+
: undefined;
|
|
123
|
+
if (Array.isArray(items) && items.length === 0) {
|
|
124
|
+
return {
|
|
125
|
+
content: [{
|
|
126
|
+
type: 'text',
|
|
127
|
+
text: JSON.stringify({
|
|
128
|
+
results: [],
|
|
129
|
+
total: 0,
|
|
130
|
+
_hints: {
|
|
131
|
+
message: `No entities matched tag "${args.tag}" (exact match). Try broader terms or browse people/events directly.`,
|
|
132
|
+
available_tools: ['tacit_list_people', 'tacit_search_events', 'tacit_search'],
|
|
133
|
+
tip: 'Use tacit_search for full-text search across all entity types.',
|
|
134
|
+
},
|
|
135
|
+
}, null, 2),
|
|
136
|
+
}],
|
|
137
|
+
};
|
|
138
|
+
}
|
|
118
139
|
return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
|
|
119
140
|
}
|
|
120
141
|
catch (err) {
|
|
@@ -331,7 +331,7 @@ export const KB_TYPE_DEF = {
|
|
|
331
331
|
kind: 'phased',
|
|
332
332
|
phases: [
|
|
333
333
|
{ name: 'browse', requiredTools: ['tacit_kb_browse_tree', 'tacit_kb_list_collections', 'tacit_kb_list_categories'], gatedTools: [], approvalGate: false, guidance: 'Browse the knowledge base structure before making changes.' },
|
|
334
|
-
{ name: 'curate', requiredTools: [], gatedTools: ['tacit_kb_create_article', 'tacit_kb_update_article', 'tacit_kb_create_category', 'tacit_kb_create_collection', 'tacit_kb_update_collection', 'tacit_kb_delete_collection', 'tacit_kb_promote_from_artifact', 'tacit_kb_promote_from_catalog'
|
|
334
|
+
{ name: 'curate', requiredTools: [], gatedTools: ['tacit_kb_create_article', 'tacit_kb_update_article', 'tacit_kb_create_category', 'tacit_kb_create_collection', 'tacit_kb_update_collection', 'tacit_kb_delete_collection', 'tacit_kb_promote_from_artifact', 'tacit_kb_promote_from_catalog'], approvalGate: false, guidance: 'Create, update, or promote KB content. Browse phase must complete first.' },
|
|
335
335
|
{ name: 'source_admin', requiredTools: [], gatedTools: ['tacit_kb_pull_source'], approvalGate: true, guidance: 'Source administration requires approval. Note: tacit_kb_register_source is ADMIN_ONLY transport and bypasses this gate.' },
|
|
336
336
|
],
|
|
337
337
|
},
|
|
@@ -347,7 +347,7 @@ export const LAKE_TYPE_DEF = {
|
|
|
347
347
|
kind: 'phased',
|
|
348
348
|
phases: [
|
|
349
349
|
{ name: 'explore', requiredTools: ['tacit_lake_browse_catalog', 'tacit_lake_folder_list', 'tacit_lake_taxonomy_browse'], gatedTools: [], approvalGate: false, guidance: 'Explore the data lake catalog and taxonomy before operations.' },
|
|
350
|
-
{ name: 'ingest', requiredTools: [], gatedTools: ['tacit_lake_ingest', 'tacit_lake_classify', 'tacit_lake_classify_subject', 'tacit_lake_reclassify', 'tacit_lake_reclassify_subjects', 'tacit_lake_folder_add', 'tacit_lake_folder_rename'
|
|
350
|
+
{ name: 'ingest', requiredTools: [], gatedTools: ['tacit_lake_ingest', 'tacit_lake_classify', 'tacit_lake_classify_subject', 'tacit_lake_reclassify', 'tacit_lake_reclassify_subjects', 'tacit_lake_folder_add', 'tacit_lake_folder_rename'], approvalGate: false, guidance: 'Ingest and classify content. Explore phase must complete first.' },
|
|
351
351
|
{ name: 'structure', requiredTools: [], gatedTools: ['tacit_lake_propose_structure', 'tacit_lake_confirm_proposal'], approvalGate: true, guidance: 'Structure proposals require approval before confirmation.' },
|
|
352
352
|
],
|
|
353
353
|
},
|