@tacitai/mcp-server 0.6.10 → 0.6.12
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 +37 -19
- package/dist/prompts.js +21 -11
- package/dist/tools/agents.js +4 -0
- package/dist/tools/artifacts.js +8 -2
- package/dist/tools/chronicle.js +7 -7
- package/dist/tools/crews.js +8 -8
- package/dist/tools/errors.d.ts +3 -0
- package/dist/tools/errors.js +19 -0
- package/dist/tools/github.js +4 -0
- package/dist/tools/gm.d.ts +44 -16
- package/dist/tools/gm.js +194 -39
- package/dist/tools/kb.js +4 -1
- package/dist/tools/lake-structure.js +8 -8
- package/dist/tools/lake.d.ts +44 -0
- package/dist/tools/lake.js +66 -2
- package/dist/tools/onboarding.js +8 -8
- package/dist/tools/people.js +5 -5
- package/dist/tools/pyramid.js +4 -1
- package/dist/tools/registry.d.ts +1 -1
- package/dist/tools/registry.js +7 -3
- package/dist/tools/research.js +14 -8
- package/dist/tools/wiki.js +4 -0
- package/dist/tools/workspaces.js +3 -3
- package/package.json +1 -2
package/dist/prompts.d.ts
CHANGED
|
@@ -15,8 +15,26 @@ export declare const CAPABILITY_DOMAINS: Array<{
|
|
|
15
15
|
description: string;
|
|
16
16
|
}>;
|
|
17
17
|
export declare const EXPERIENCES: readonly [{
|
|
18
|
-
readonly id: "
|
|
18
|
+
readonly id: "explore_workspace";
|
|
19
19
|
readonly num: 1;
|
|
20
|
+
readonly name: "Explore Your Workspace";
|
|
21
|
+
readonly tier: 1;
|
|
22
|
+
readonly tierName: "Orient & Equip";
|
|
23
|
+
readonly action: "Type: \"What is in my workspace?\" — see what knowledge, collections, and structure are already here.";
|
|
24
|
+
readonly signal: "You can describe what is in your workspace";
|
|
25
|
+
readonly tip: "";
|
|
26
|
+
}, {
|
|
27
|
+
readonly id: "see_capabilities";
|
|
28
|
+
readonly num: 2;
|
|
29
|
+
readonly name: "See What's Possible";
|
|
30
|
+
readonly tier: 1;
|
|
31
|
+
readonly tierName: "Orient & Equip";
|
|
32
|
+
readonly action: "Type: \"What can TACIT do for me?\" — discover the full range of capabilities available to you.";
|
|
33
|
+
readonly signal: "You know what TACIT can do and are ready to try it";
|
|
34
|
+
readonly tip: "";
|
|
35
|
+
}, {
|
|
36
|
+
readonly id: "first_light";
|
|
37
|
+
readonly num: 3;
|
|
20
38
|
readonly name: "First Light";
|
|
21
39
|
readonly tier: 1;
|
|
22
40
|
readonly tierName: "Orient & Equip";
|
|
@@ -25,25 +43,25 @@ export declare const EXPERIENCES: readonly [{
|
|
|
25
43
|
readonly tip: "";
|
|
26
44
|
}, {
|
|
27
45
|
readonly id: "feed_it";
|
|
28
|
-
readonly num:
|
|
46
|
+
readonly num: 4;
|
|
29
47
|
readonly name: "Feed It";
|
|
30
48
|
readonly tier: 1;
|
|
31
49
|
readonly tierName: "Orient & Equip";
|
|
32
|
-
readonly action: "
|
|
33
|
-
readonly signal: "First successful content ingestion";
|
|
34
|
-
readonly tip: "You can
|
|
50
|
+
readonly action: "Create your first piece of content — try \"Write a short summary of what our business does and add it to the workspace.\" TACIT will draft, ingest, and classify it automatically. You now have something you made in the system.";
|
|
51
|
+
readonly signal: "First successful content creation and ingestion";
|
|
52
|
+
readonly tip: "You can bring in content from anywhere — URLs, documents, files. Say \"Add this to the workspace\" and your General Manager handles the rest.";
|
|
35
53
|
}, {
|
|
36
54
|
readonly id: "build_your_map";
|
|
37
|
-
readonly num:
|
|
55
|
+
readonly num: 5;
|
|
38
56
|
readonly name: "Build Your Map";
|
|
39
57
|
readonly tier: 1;
|
|
40
58
|
readonly tierName: "Orient & Equip";
|
|
41
|
-
readonly action: "Organize your
|
|
59
|
+
readonly action: "Organize your workspace — ask to create a collection for a topic, build a portfolio for a project, or structure your business knowledge. This is how content finds its home. You can also ask to remove the item you created in Experience 4 if it was just for practice — say \"Remove the summary I just added.\"";
|
|
42
60
|
readonly signal: "First organizational write operation";
|
|
43
|
-
readonly tip: "
|
|
61
|
+
readonly tip: "Your General Manager handles content placement and classification. Say \"Organize our knowledge on [topic]\" and it will propose where things belong — you approve before anything moves.";
|
|
44
62
|
}, {
|
|
45
63
|
readonly id: "connect_your_tools";
|
|
46
|
-
readonly num:
|
|
64
|
+
readonly num: 6;
|
|
47
65
|
readonly name: "Connect Your Tools";
|
|
48
66
|
readonly tier: 1;
|
|
49
67
|
readonly tierName: "Orient & Equip";
|
|
@@ -52,25 +70,25 @@ export declare const EXPERIENCES: readonly [{
|
|
|
52
70
|
readonly tip: "";
|
|
53
71
|
}, {
|
|
54
72
|
readonly id: "research_publish";
|
|
55
|
-
readonly num:
|
|
73
|
+
readonly num: 7;
|
|
56
74
|
readonly name: "Research & Publish";
|
|
57
75
|
readonly tier: 2;
|
|
58
76
|
readonly tierName: "The Operating System";
|
|
59
|
-
readonly action: "Research a topic
|
|
60
|
-
readonly signal: "First research artifact published
|
|
61
|
-
readonly tip: "After publishing,
|
|
77
|
+
readonly action: "Research a topic and publish a report — try \"Research [topic] using the web, academic sources, and our workspace knowledge, then publish it as a report.\" This takes a few minutes. TACIT searches the web, academic databases, and your workspace knowledge all at once, then produces a styled report with citations and proposes where to file it. Add a Gemini API key to unlock Google Deep Research for deeper web and academic sources.";
|
|
78
|
+
readonly signal: "First research artifact published — combining workspace knowledge with web and academic sources into a single deliverable";
|
|
79
|
+
readonly tip: "After publishing, your General Manager will propose where to place the report in your knowledge structure — you approve the placement.";
|
|
62
80
|
}, {
|
|
63
81
|
readonly id: "run_sales";
|
|
64
|
-
readonly num:
|
|
82
|
+
readonly num: 8;
|
|
65
83
|
readonly name: "Run Sales";
|
|
66
84
|
readonly tier: 2;
|
|
67
85
|
readonly tierName: "The Operating System";
|
|
68
|
-
readonly action: "Ask to prepare a proposal, run discovery on a prospect, or build a quote
|
|
86
|
+
readonly action: "Ask to prepare a proposal, run discovery on a prospect, or build a quote — try \"Prepare a discovery brief for [prospect name] in [industry].\" Then compose the follow-up email in your voice — \"Draft an intro email to them about this proposal, in my voice.\" The proposal is structured and formal; your email sounds like you.";
|
|
69
87
|
readonly signal: "First compound business deliverable, then first voice-matched composition";
|
|
70
|
-
readonly tip: "Voice works anywhere you write. Say \"in my voice\" with any request — proposals, emails, status updates, Slack messages. Upload more writing samples to sharpen the match.
|
|
88
|
+
readonly tip: "Voice works anywhere you write. Say \"in my voice\" with any request — proposals, emails, status updates, Slack messages. Upload more writing samples to sharpen the match. Your Chief Operating Officer handles business operations and sales — say \"Have COO plan a proposal for [client].\"";
|
|
71
89
|
}, {
|
|
72
90
|
readonly id: "morning_brief";
|
|
73
|
-
readonly num:
|
|
91
|
+
readonly num: 9;
|
|
74
92
|
readonly name: "Morning Brief";
|
|
75
93
|
readonly tier: 2;
|
|
76
94
|
readonly tierName: "The Operating System";
|
|
@@ -79,7 +97,7 @@ export declare const EXPERIENCES: readonly [{
|
|
|
79
97
|
readonly tip: "Meet your executive team. Addressing an exec by name routes your request through a specialized workflow that organizes the response. Available execs: COS (Chief of Staff — daily ops, email, meetings), COO (Chief Operating Officer — business ops, sales, audits), GM (General Manager — content ingestion, classification, pyramid placement).";
|
|
80
98
|
}, {
|
|
81
99
|
readonly id: "audit_business";
|
|
82
|
-
readonly num:
|
|
100
|
+
readonly num: 10;
|
|
83
101
|
readonly name: "Audit Your Business";
|
|
84
102
|
readonly tier: 2;
|
|
85
103
|
readonly tierName: "The Operating System";
|
|
@@ -88,7 +106,7 @@ export declare const EXPERIENCES: readonly [{
|
|
|
88
106
|
readonly tip: "You can also say \"Have COO review our operational health\" — COO coordinates cross-team status and health checks.";
|
|
89
107
|
}, {
|
|
90
108
|
readonly id: "operating_rhythm";
|
|
91
|
-
readonly num:
|
|
109
|
+
readonly num: 11;
|
|
92
110
|
readonly name: "Your Operating Rhythm";
|
|
93
111
|
readonly tier: 3;
|
|
94
112
|
readonly tierName: "Agentic Mastery";
|
package/dist/prompts.js
CHANGED
|
@@ -13,8 +13,9 @@ function buildAssistantSystemPrompt(state) {
|
|
|
13
13
|
lines.push('');
|
|
14
14
|
lines.push(`- Warm but direct. You know ${name} well and you are here to help.`);
|
|
15
15
|
lines.push('- Refer to the workspace by name. When citing answers, name the collection or source they came from.');
|
|
16
|
-
lines.push('-
|
|
17
|
-
lines.push('-
|
|
16
|
+
lines.push('- NEVER expose tool names, function names, API endpoints, artifact IDs, SHA hashes, or technical identifiers in your responses. Translate everything into plain language the user would understand. Instead of "tacit_gm_approve" say "approve the placement." Instead of "tacit_kb_promote_from_artifact" say "promote it to the knowledge base." Instead of "crew_compose" say "draft." Instead of "kb_create_collection" say "create a new collection." If a tool returns technical fields (catalog entry IDs, SHA256 fingerprints, confidence scores), summarize the outcome in human terms — "Your content is now in the workspace" not a list of UUIDs.');
|
|
17
|
+
lines.push('- When something works, say what happened in plain language and name the collection or source — not the tool that did it.');
|
|
18
|
+
lines.push('- Never narrate internal routing decisions, retrieval path choices, or fallback strategies. If one approach does not return results, silently try another. The user should see the answer, not the search process.');
|
|
18
19
|
lines.push('');
|
|
19
20
|
lines.push('## How you work');
|
|
20
21
|
lines.push('');
|
|
@@ -34,6 +35,12 @@ function buildAssistantSystemPrompt(state) {
|
|
|
34
35
|
lines.push('- After ingesting content: "Good — that is in your workspace now. Want to organize it into a collection?"');
|
|
35
36
|
lines.push('- After connecting tools: "Your Slack and email are flowing in. Try asking for a morning brief."');
|
|
36
37
|
lines.push('');
|
|
38
|
+
lines.push('When the user is in an onboarding flow, keep them moving forward — suggest ONE next step, not multiple branches or "I can also..." offers. Outside of onboarding, just answer the question without steering toward onboarding steps. Never launch the onboarding journey unless the user explicitly asks for it.');
|
|
39
|
+
lines.push('');
|
|
40
|
+
lines.push('## Onboarding');
|
|
41
|
+
lines.push('');
|
|
42
|
+
lines.push('When the user says "onboard me" or asks for the onboarding journey, ALWAYS call the `tacit_onboarding` tool. Do not attempt a generic onboarding by reading files or describing the environment — the tool handles the full flow. Present the tool\'s response exactly as returned — do not add, summarize, or list experiences beyond what the tool output contains.');
|
|
43
|
+
lines.push('');
|
|
37
44
|
lines.push('## Safety');
|
|
38
45
|
lines.push('');
|
|
39
46
|
lines.push('- Never modify or delete content without explicit approval.');
|
|
@@ -43,6 +50,7 @@ function buildAssistantSystemPrompt(state) {
|
|
|
43
50
|
lines.push('## Technical routing');
|
|
44
51
|
lines.push('');
|
|
45
52
|
lines.push('Prefer a single read tool for direct lookups, synthesis for open questions, and ask before any write or dispatch.');
|
|
53
|
+
lines.push('- For all synthesis and research requests, use burst mode. Do not use crew_compose or orbit modes — they are under review and not reliable for the MCP experience. If a task seems to need multi-step agentic work, break it into sequential burst calls instead.');
|
|
46
54
|
return lines.join('\n');
|
|
47
55
|
}
|
|
48
56
|
export async function fetchWorkspaceState(client) {
|
|
@@ -92,15 +100,17 @@ export const CAPABILITY_DOMAINS = [
|
|
|
92
100
|
{ domain: 'Code & GitHub', triggers: ['Show my repo connections…', 'Sync from GitHub…'], description: 'Repository connections and code sync' },
|
|
93
101
|
];
|
|
94
102
|
export const EXPERIENCES = [
|
|
95
|
-
{ id: '
|
|
96
|
-
{ id: '
|
|
97
|
-
{ id: '
|
|
98
|
-
{ id: '
|
|
99
|
-
{ id: '
|
|
100
|
-
{ id: '
|
|
101
|
-
{ id: '
|
|
102
|
-
{ id: '
|
|
103
|
-
{ id: '
|
|
103
|
+
{ 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: '' },
|
|
104
|
+
{ 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: '' },
|
|
105
|
+
{ 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: '' },
|
|
106
|
+
{ id: 'feed_it', num: 4, name: 'Feed It', tier: 1, tierName: 'Orient & Equip', action: 'Create your first piece of content — try "Write a short summary of what our business does and add it to the workspace." TACIT will draft, ingest, and classify it automatically. You now have something you made in the system.', signal: 'First successful content creation and ingestion', tip: 'You can bring in content from anywhere — URLs, documents, files. Say "Add this to the workspace" and your General Manager handles the rest.' },
|
|
107
|
+
{ id: 'build_your_map', num: 5, name: 'Build Your Map', tier: 1, tierName: 'Orient & Equip', action: 'Organize your workspace — ask to create a collection for a topic, build a portfolio for a project, or structure your business knowledge. This is how content finds its home. You can also ask to remove the item you created in Experience 4 if it was just for practice — say "Remove the summary I just added."', signal: 'First organizational write operation', tip: 'Your General Manager handles content placement and classification. Say "Organize our knowledge on [topic]" and it will propose where things belong — you approve before anything moves.' },
|
|
108
|
+
{ id: 'connect_your_tools', num: 6, name: 'Connect Your Tools', tier: 1, tierName: 'Orient & Equip', action: 'Connect Slack and Gmail through claude.ai Integrations — type "How do I connect my tools?" for a walkthrough.', signal: 'Connectors active — email and Slack flowing into your workspace', tip: '' },
|
|
109
|
+
{ id: 'research_publish', num: 7, name: 'Research & Publish', tier: 2, tierName: 'The Operating System', action: 'Research a topic and publish a report — try "Research [topic] using the web, academic sources, and our workspace knowledge, then publish it as a report." This takes a few minutes. TACIT searches the web, academic databases, and your workspace knowledge all at once, then produces a styled report with citations and proposes where to file it. Add a Gemini API key to unlock Google Deep Research for deeper web and academic sources.', signal: 'First research artifact published — combining workspace knowledge with web and academic sources into a single deliverable', tip: 'After publishing, your General Manager will propose where to place the report in your knowledge structure — you approve the placement.' },
|
|
110
|
+
{ id: 'run_sales', num: 8, name: 'Run Sales', tier: 2, tierName: 'The Operating System', action: 'Ask to prepare a proposal, run discovery on a prospect, or build a quote — try "Prepare a discovery brief for [prospect name] in [industry]." Then compose the follow-up email in your voice — "Draft an intro email to them about this proposal, in my voice." The proposal is structured and formal; your email sounds like you.', signal: 'First compound business deliverable, then first voice-matched composition', tip: 'Voice works anywhere you write. Say "in my voice" with any request — proposals, emails, status updates, Slack messages. Upload more writing samples to sharpen the match. Your Chief Operating Officer handles business operations and sales — say "Have COO plan a proposal for [client]."' },
|
|
111
|
+
{ id: 'morning_brief', num: 9, name: 'Morning Brief', tier: 2, tierName: 'The Operating System', action: 'Try "Have COS brief me on today" — COS is your Chief of Staff. Includes email triage, Slack synthesis, and calendar prep. You can also say "COS, triage my email" or "COS, prep me for my next meeting." After the brief, try "Draft a message to the team about today in my voice" — it writes as you, not an LLM.', signal: 'First daily operating picture with email triage, Slack synthesis, and calendar prep', tip: 'Meet your executive team. Addressing an exec by name routes your request through a specialized workflow that organizes the response. Available execs: COS (Chief of Staff — daily ops, email, meetings), COO (Chief Operating Officer — business ops, sales, audits), GM (General Manager — content ingestion, classification, pyramid placement).' },
|
|
112
|
+
{ id: 'audit_business', num: 10, name: 'Audit Your Business', tier: 2, tierName: 'The Operating System', action: 'Ask "How healthy is our business?" or request a pulse audit.', signal: 'First scored business health audit', tip: 'You can also say "Have COO review our operational health" — COO coordinates cross-team status and health checks.' },
|
|
113
|
+
{ id: 'operating_rhythm', num: 11, name: 'Your Operating Rhythm', tier: 3, tierName: 'Agentic Mastery', action: 'Set up weekly reviews, delegate recurring work to crews, and refine your voice. Upload writing samples from emails, memos, or documents you wrote yourself — the more samples, the sharper the match.', signal: 'Return for second session with intent; establish a routine', tip: 'By now you know the team: COS for daily ops, COO for business operations, GM for content. Address them directly anytime.' },
|
|
104
114
|
];
|
|
105
115
|
export function registerPrompts(server, getClientFn) {
|
|
106
116
|
server.prompt('assistant_system', 'System prompt for the TACIT workspace assistant — includes persona, progressive disclosure, and safety rules.', async () => {
|
package/dist/tools/agents.js
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { z } from 'zod';
|
|
13
13
|
import { getClient, TacitApiError, TokenExpiredError } from '../client.js';
|
|
14
|
+
import { featureDisabledResult } from './errors.js';
|
|
14
15
|
function apiErrorResult(err, toolName) {
|
|
15
16
|
if (err instanceof TokenExpiredError) {
|
|
16
17
|
return {
|
|
@@ -19,6 +20,9 @@ function apiErrorResult(err, toolName) {
|
|
|
19
20
|
};
|
|
20
21
|
}
|
|
21
22
|
if (err instanceof TacitApiError) {
|
|
23
|
+
const disabled = featureDisabledResult(err);
|
|
24
|
+
if (disabled)
|
|
25
|
+
return disabled;
|
|
22
26
|
return { content: [{ type: 'text', text: `API error ${err.statusCode} on ${toolName}: ${err.body}` }], isError: true };
|
|
23
27
|
}
|
|
24
28
|
const msg = err instanceof Error ? err.message : String(err);
|
package/dist/tools/artifacts.js
CHANGED
|
@@ -367,7 +367,11 @@ export const artifactDeleteInputSchema = z.object({
|
|
|
367
367
|
});
|
|
368
368
|
export const ARTIFACT_DELETE_TOOL_DEF = {
|
|
369
369
|
name: 'tacit_artifact_delete',
|
|
370
|
-
description: 'Soft-delete an artifact by id (sets deleted_at
|
|
370
|
+
description: 'Soft-delete an artifact by id (sets deleted_at). Removes the artifact\'s search_projections ' +
|
|
371
|
+
'rows and, for content ingested through /gm (tacit_gm_ingest), the search rows of its data ' +
|
|
372
|
+
'object, so that content leaves search (unless another active catalog entry still uses that ' +
|
|
373
|
+
'data object). Lake-sync bridge content (catalog origin SOURCE) is ' +
|
|
374
|
+
'NOT removed from search by this tool; use the DOC-8 lake content removal path. ' +
|
|
371
375
|
'DRAFT / UNDER_REVIEW artifacts delete normally. PUBLISHED artifacts require force=true ' +
|
|
372
376
|
'and MENTAT or TWIN autonomy. confirm must be true. Route: DELETE /api/v1/artifacts/editor/:id.',
|
|
373
377
|
inputSchema: {
|
|
@@ -464,7 +468,9 @@ export function registerArtifactTools(server, getClientFn) {
|
|
|
464
468
|
const client = await getClientFn();
|
|
465
469
|
return buildArtifactVersionsRequest(client, args).execute();
|
|
466
470
|
});
|
|
467
|
-
|
|
471
|
+
// Literal name kept for registry.test.ts's source scan; artifacts.test.ts asserts it equals
|
|
472
|
+
// ARTIFACT_DELETE_TOOL_DEF.name. The description comes only from the def (BUG-340).
|
|
473
|
+
server.tool('tacit_artifact_delete', ARTIFACT_DELETE_TOOL_DEF.description, {
|
|
468
474
|
id: z.string().uuid().describe('Artifact UUID to delete'),
|
|
469
475
|
confirm: z.boolean().describe('Must be true to execute — safety guard'),
|
|
470
476
|
force: z.boolean().optional().describe('Set true to delete a PUBLISHED artifact (requires MENTAT/TWIN autonomy)'),
|
package/dist/tools/chronicle.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { TacitApiError } from '../client.js';
|
|
3
|
-
import { success, error } from './errors.js';
|
|
3
|
+
import { success, error, featureDisabledResult } from './errors.js';
|
|
4
4
|
export function registerChronicleTools(server, getClient) {
|
|
5
5
|
server.tool('tacit_chronicle_timeline', 'Query the Chronicle timeline with date range, scope, and text filters.', {
|
|
6
6
|
from: z.string().optional().describe('RFC 3339 lower bound (inclusive)'),
|
|
@@ -40,7 +40,7 @@ export function registerChronicleTools(server, getClient) {
|
|
|
40
40
|
}
|
|
41
41
|
catch (e) {
|
|
42
42
|
if (e instanceof TacitApiError)
|
|
43
|
-
return error(e.message);
|
|
43
|
+
return featureDisabledResult(e) ?? error(e.message);
|
|
44
44
|
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
45
45
|
}
|
|
46
46
|
});
|
|
@@ -73,7 +73,7 @@ export function registerChronicleTools(server, getClient) {
|
|
|
73
73
|
}
|
|
74
74
|
catch (e) {
|
|
75
75
|
if (e instanceof TacitApiError)
|
|
76
|
-
return error(e.message);
|
|
76
|
+
return featureDisabledResult(e) ?? error(e.message);
|
|
77
77
|
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
78
78
|
}
|
|
79
79
|
});
|
|
@@ -99,7 +99,7 @@ export function registerChronicleTools(server, getClient) {
|
|
|
99
99
|
}
|
|
100
100
|
catch (e) {
|
|
101
101
|
if (e instanceof TacitApiError)
|
|
102
|
-
return error(e.message);
|
|
102
|
+
return featureDisabledResult(e) ?? error(e.message);
|
|
103
103
|
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
104
104
|
}
|
|
105
105
|
});
|
|
@@ -121,7 +121,7 @@ export function registerChronicleTools(server, getClient) {
|
|
|
121
121
|
}
|
|
122
122
|
catch (e) {
|
|
123
123
|
if (e instanceof TacitApiError)
|
|
124
|
-
return error(e.message);
|
|
124
|
+
return featureDisabledResult(e) ?? error(e.message);
|
|
125
125
|
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
126
126
|
}
|
|
127
127
|
});
|
|
@@ -144,7 +144,7 @@ export function registerChronicleTools(server, getClient) {
|
|
|
144
144
|
}
|
|
145
145
|
catch (e) {
|
|
146
146
|
if (e instanceof TacitApiError)
|
|
147
|
-
return error(e.message);
|
|
147
|
+
return featureDisabledResult(e) ?? error(e.message);
|
|
148
148
|
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
149
149
|
}
|
|
150
150
|
});
|
|
@@ -158,7 +158,7 @@ export function registerChronicleTools(server, getClient) {
|
|
|
158
158
|
}
|
|
159
159
|
catch (e) {
|
|
160
160
|
if (e instanceof TacitApiError)
|
|
161
|
-
return error(e.message);
|
|
161
|
+
return featureDisabledResult(e) ?? error(e.message);
|
|
162
162
|
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
163
163
|
}
|
|
164
164
|
});
|
package/dist/tools/crews.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { TacitApiError } from '../client.js';
|
|
3
|
-
import { success, error } from './errors.js';
|
|
3
|
+
import { success, error, featureDisabledResult } from './errors.js';
|
|
4
4
|
export function registerCrewTools(server, getClient) {
|
|
5
5
|
server.tool('tacit_dispatch_crew', 'Dispatch a crew for autonomous task execution.', {
|
|
6
6
|
composition_type: z.string().describe('Crew composition type to dispatch'),
|
|
@@ -12,7 +12,7 @@ export function registerCrewTools(server, getClient) {
|
|
|
12
12
|
}
|
|
13
13
|
catch (e) {
|
|
14
14
|
if (e instanceof TacitApiError)
|
|
15
|
-
return error(e.message);
|
|
15
|
+
return featureDisabledResult(e) ?? error(e.message);
|
|
16
16
|
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -26,7 +26,7 @@ export function registerCrewTools(server, getClient) {
|
|
|
26
26
|
}
|
|
27
27
|
catch (e) {
|
|
28
28
|
if (e instanceof TacitApiError)
|
|
29
|
-
return error(e.message);
|
|
29
|
+
return featureDisabledResult(e) ?? error(e.message);
|
|
30
30
|
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
31
31
|
}
|
|
32
32
|
});
|
|
@@ -41,7 +41,7 @@ export function registerCrewTools(server, getClient) {
|
|
|
41
41
|
}
|
|
42
42
|
catch (e) {
|
|
43
43
|
if (e instanceof TacitApiError)
|
|
44
|
-
return error(e.message);
|
|
44
|
+
return featureDisabledResult(e) ?? error(e.message);
|
|
45
45
|
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
46
46
|
}
|
|
47
47
|
});
|
|
@@ -59,7 +59,7 @@ export function registerCrewTools(server, getClient) {
|
|
|
59
59
|
}
|
|
60
60
|
catch (e) {
|
|
61
61
|
if (e instanceof TacitApiError)
|
|
62
|
-
return error(e.message);
|
|
62
|
+
return featureDisabledResult(e) ?? error(e.message);
|
|
63
63
|
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
64
64
|
}
|
|
65
65
|
});
|
|
@@ -77,7 +77,7 @@ export function registerCrewTools(server, getClient) {
|
|
|
77
77
|
}
|
|
78
78
|
catch (e) {
|
|
79
79
|
if (e instanceof TacitApiError)
|
|
80
|
-
return error(e.message);
|
|
80
|
+
return featureDisabledResult(e) ?? error(e.message);
|
|
81
81
|
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
82
82
|
}
|
|
83
83
|
});
|
|
@@ -91,7 +91,7 @@ export function registerCrewTools(server, getClient) {
|
|
|
91
91
|
}
|
|
92
92
|
catch (e) {
|
|
93
93
|
if (e instanceof TacitApiError)
|
|
94
|
-
return error(e.message);
|
|
94
|
+
return featureDisabledResult(e) ?? error(e.message);
|
|
95
95
|
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
96
96
|
}
|
|
97
97
|
});
|
|
@@ -108,7 +108,7 @@ export function registerCrewTools(server, getClient) {
|
|
|
108
108
|
}
|
|
109
109
|
catch (e) {
|
|
110
110
|
if (e instanceof TacitApiError)
|
|
111
|
-
return error(e.message);
|
|
111
|
+
return featureDisabledResult(e) ?? error(e.message);
|
|
112
112
|
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
113
113
|
}
|
|
114
114
|
});
|
package/dist/tools/errors.d.ts
CHANGED
|
@@ -9,6 +9,9 @@ export declare function success(data: unknown): ToolResult;
|
|
|
9
9
|
export declare function error(message: string): ToolResult & {
|
|
10
10
|
isError: true;
|
|
11
11
|
};
|
|
12
|
+
export declare function featureDisabledResult(err: unknown): (ToolResult & {
|
|
13
|
+
isError: true;
|
|
14
|
+
}) | null;
|
|
12
15
|
export declare function apiErrorResult(err: unknown, endpoint: string): ToolResult & {
|
|
13
16
|
isError: boolean;
|
|
14
17
|
};
|
package/dist/tools/errors.js
CHANGED
|
@@ -5,6 +5,22 @@ export function success(data) {
|
|
|
5
5
|
export function error(message) {
|
|
6
6
|
return { isError: true, content: [{ type: 'text', text: message }] };
|
|
7
7
|
}
|
|
8
|
+
export function featureDisabledResult(err) {
|
|
9
|
+
if (!(err instanceof TacitApiError))
|
|
10
|
+
return null;
|
|
11
|
+
let parsed;
|
|
12
|
+
try {
|
|
13
|
+
parsed = JSON.parse(err.body);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
if (parsed?.error?.code !== 'FEATURE_DISABLED')
|
|
19
|
+
return null;
|
|
20
|
+
const flagMatch = parsed.error.message?.match(/feature flag ([A-Z][A-Z0-9_]*) is off/);
|
|
21
|
+
const flag = flagMatch ? flagMatch[1] : 'unknown';
|
|
22
|
+
return error(`Feature flag ${flag} is disabled on this cell. Enable it in the flag registry and restart.`);
|
|
23
|
+
}
|
|
8
24
|
export function apiErrorResult(err, endpoint) {
|
|
9
25
|
if (err instanceof TokenExpiredError) {
|
|
10
26
|
return {
|
|
@@ -13,6 +29,9 @@ export function apiErrorResult(err, endpoint) {
|
|
|
13
29
|
};
|
|
14
30
|
}
|
|
15
31
|
if (err instanceof TacitApiError) {
|
|
32
|
+
const disabled = featureDisabledResult(err);
|
|
33
|
+
if (disabled)
|
|
34
|
+
return disabled;
|
|
16
35
|
return { content: [{ type: 'text', text: `API error ${err.statusCode} on ${endpoint}: ${err.body}` }], isError: true };
|
|
17
36
|
}
|
|
18
37
|
const msg = err instanceof Error ? err.message : String(err);
|
package/dist/tools/github.js
CHANGED
|
@@ -9,11 +9,15 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
import { TacitApiError, TokenExpiredError } from '../client.js';
|
|
12
|
+
import { featureDisabledResult } from './errors.js';
|
|
12
13
|
function apiErrorResult(err, toolName) {
|
|
13
14
|
if (err instanceof TokenExpiredError) {
|
|
14
15
|
return { content: [{ type: 'text', text: err.message }], isError: true };
|
|
15
16
|
}
|
|
16
17
|
if (err instanceof TacitApiError) {
|
|
18
|
+
const disabled = featureDisabledResult(err);
|
|
19
|
+
if (disabled)
|
|
20
|
+
return disabled;
|
|
17
21
|
return { content: [{ type: 'text', text: `API error ${err.statusCode} on ${toolName}: ${err.body}` }], isError: true };
|
|
18
22
|
}
|
|
19
23
|
const msg = err instanceof Error ? err.message : String(err);
|
package/dist/tools/gm.d.ts
CHANGED
|
@@ -18,8 +18,24 @@ export interface ToolRequest {
|
|
|
18
18
|
isError?: boolean;
|
|
19
19
|
}>;
|
|
20
20
|
}
|
|
21
|
+
/** Largest file `file_path` will read (10 MiB). */
|
|
22
|
+
export declare const GM_INGEST_MAX_FILE_BYTES: number;
|
|
23
|
+
type FileReadResult = {
|
|
24
|
+
ok: true;
|
|
25
|
+
content: string;
|
|
26
|
+
} | {
|
|
27
|
+
ok: false;
|
|
28
|
+
reason: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Read a local file for tacit_gm_ingest (BUG-333). Only on the stdio transport, only
|
|
32
|
+
* inside the allowed roots (after resolving symlinks), only text formats, size-capped.
|
|
33
|
+
* A missing file is an error — never ingest the path string itself.
|
|
34
|
+
*/
|
|
35
|
+
export declare function readGmIngestFile(filePath: string): FileReadResult;
|
|
21
36
|
export declare const gmIngestInputSchema: z.ZodObject<{
|
|
22
|
-
content: z.ZodString
|
|
37
|
+
content: z.ZodOptional<z.ZodString>;
|
|
38
|
+
file_path: z.ZodOptional<z.ZodString>;
|
|
23
39
|
title: z.ZodString;
|
|
24
40
|
source_uri: z.ZodOptional<z.ZodString>;
|
|
25
41
|
content_type: z.ZodOptional<z.ZodString>;
|
|
@@ -34,19 +50,21 @@ export declare const gmIngestInputSchema: z.ZodObject<{
|
|
|
34
50
|
content_type?: string | undefined;
|
|
35
51
|
}>>;
|
|
36
52
|
}, "strip", z.ZodTypeAny, {
|
|
37
|
-
content: string;
|
|
38
53
|
title: string;
|
|
54
|
+
content?: string | undefined;
|
|
39
55
|
source_uri?: string | undefined;
|
|
40
56
|
content_type?: string | undefined;
|
|
57
|
+
file_path?: string | undefined;
|
|
41
58
|
classification_hints?: {
|
|
42
59
|
domain?: string | undefined;
|
|
43
60
|
content_type?: string | undefined;
|
|
44
61
|
} | undefined;
|
|
45
62
|
}, {
|
|
46
|
-
content: string;
|
|
47
63
|
title: string;
|
|
64
|
+
content?: string | undefined;
|
|
48
65
|
source_uri?: string | undefined;
|
|
49
66
|
content_type?: string | undefined;
|
|
67
|
+
file_path?: string | undefined;
|
|
50
68
|
classification_hints?: {
|
|
51
69
|
domain?: string | undefined;
|
|
52
70
|
content_type?: string | undefined;
|
|
@@ -63,6 +81,10 @@ export declare const GM_INGEST_TOOL_DEF: {
|
|
|
63
81
|
type: string;
|
|
64
82
|
description: string;
|
|
65
83
|
};
|
|
84
|
+
file_path: {
|
|
85
|
+
type: string;
|
|
86
|
+
description: string;
|
|
87
|
+
};
|
|
66
88
|
title: {
|
|
67
89
|
type: string;
|
|
68
90
|
description: string;
|
|
@@ -102,34 +124,34 @@ export declare function handleGmIngest(args: unknown): Promise<{
|
|
|
102
124
|
export declare const gmApproveInputSchema: z.ZodObject<{
|
|
103
125
|
catalog_id: z.ZodString;
|
|
104
126
|
approved_targets: z.ZodArray<z.ZodObject<{
|
|
105
|
-
surface: z.
|
|
106
|
-
collection_or_program: z.
|
|
127
|
+
surface: z.ZodLiteral<"pyramid">;
|
|
128
|
+
collection_or_program: z.ZodString;
|
|
107
129
|
dossier_id: z.ZodOptional<z.ZodString>;
|
|
108
|
-
}, "
|
|
109
|
-
surface: "
|
|
130
|
+
}, "strict", z.ZodTypeAny, {
|
|
131
|
+
surface: "pyramid";
|
|
132
|
+
collection_or_program: string;
|
|
110
133
|
dossier_id?: string | undefined;
|
|
111
|
-
collection_or_program?: string | undefined;
|
|
112
134
|
}, {
|
|
113
|
-
surface: "
|
|
135
|
+
surface: "pyramid";
|
|
136
|
+
collection_or_program: string;
|
|
114
137
|
dossier_id?: string | undefined;
|
|
115
|
-
collection_or_program?: string | undefined;
|
|
116
138
|
}>, "many">;
|
|
117
139
|
rejected_targets: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
118
140
|
surface: z.ZodString;
|
|
119
141
|
reason: z.ZodOptional<z.ZodString>;
|
|
120
|
-
}, "
|
|
142
|
+
}, "strict", z.ZodTypeAny, {
|
|
121
143
|
surface: string;
|
|
122
144
|
reason?: string | undefined;
|
|
123
145
|
}, {
|
|
124
146
|
surface: string;
|
|
125
147
|
reason?: string | undefined;
|
|
126
148
|
}>, "many">>>;
|
|
127
|
-
}, "
|
|
149
|
+
}, "strict", z.ZodTypeAny, {
|
|
128
150
|
catalog_id: string;
|
|
129
151
|
approved_targets: {
|
|
130
|
-
surface: "
|
|
152
|
+
surface: "pyramid";
|
|
153
|
+
collection_or_program: string;
|
|
131
154
|
dossier_id?: string | undefined;
|
|
132
|
-
collection_or_program?: string | undefined;
|
|
133
155
|
}[];
|
|
134
156
|
rejected_targets: {
|
|
135
157
|
surface: string;
|
|
@@ -138,9 +160,9 @@ export declare const gmApproveInputSchema: z.ZodObject<{
|
|
|
138
160
|
}, {
|
|
139
161
|
catalog_id: string;
|
|
140
162
|
approved_targets: {
|
|
141
|
-
surface: "
|
|
163
|
+
surface: "pyramid";
|
|
164
|
+
collection_or_program: string;
|
|
142
165
|
dossier_id?: string | undefined;
|
|
143
|
-
collection_or_program?: string | undefined;
|
|
144
166
|
}[];
|
|
145
167
|
rejected_targets?: {
|
|
146
168
|
surface: string;
|
|
@@ -153,6 +175,7 @@ export declare const GM_APPROVE_TOOL_DEF: {
|
|
|
153
175
|
description: string;
|
|
154
176
|
inputSchema: {
|
|
155
177
|
type: "object";
|
|
178
|
+
additionalProperties: boolean;
|
|
156
179
|
properties: {
|
|
157
180
|
catalog_id: {
|
|
158
181
|
type: string;
|
|
@@ -160,8 +183,11 @@ export declare const GM_APPROVE_TOOL_DEF: {
|
|
|
160
183
|
};
|
|
161
184
|
approved_targets: {
|
|
162
185
|
type: string;
|
|
186
|
+
minItems: number;
|
|
187
|
+
maxItems: number;
|
|
163
188
|
items: {
|
|
164
189
|
type: string;
|
|
190
|
+
additionalProperties: boolean;
|
|
165
191
|
properties: {
|
|
166
192
|
surface: {
|
|
167
193
|
type: string;
|
|
@@ -185,6 +211,7 @@ export declare const GM_APPROVE_TOOL_DEF: {
|
|
|
185
211
|
type: string;
|
|
186
212
|
items: {
|
|
187
213
|
type: string;
|
|
214
|
+
additionalProperties: boolean;
|
|
188
215
|
properties: {
|
|
189
216
|
surface: {
|
|
190
217
|
type: string;
|
|
@@ -212,3 +239,4 @@ export declare function handleGmApprove(args: unknown): Promise<{
|
|
|
212
239
|
isError?: boolean;
|
|
213
240
|
}>;
|
|
214
241
|
export declare function registerGmTools(server: McpServer, getClientFn: () => Promise<TacitClient>): void;
|
|
242
|
+
export {};
|