@tacitai/mcp-server 0.6.50 → 0.6.53
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/config/exec-roles.yaml +22 -0
- package/dist/index.js +13 -0
- package/dist/prompts.d.ts +8 -7
- package/dist/prompts.js +37 -7
- package/dist/templates/role-loader.js +5 -0
- package/dist/tools/agents.d.ts +4 -4
- package/dist/tools/capture.d.ts +14 -0
- package/dist/tools/capture.js +212 -0
- package/dist/tools/exec-route.js +61 -13
- package/dist/tools/iam.d.ts +4 -0
- package/dist/tools/iam.js +194 -0
- package/dist/tools/onboarding.js +5 -0
- package/dist/tools/people.js +41 -0
- package/dist/tools/pyramid.d.ts +6 -6
- package/dist/tools/registry.d.ts +1 -1
- package/dist/tools/registry.js +29 -3
- package/dist/tools/search.d.ts +0 -10
- package/dist/tools/search.js +1 -6
- package/dist/tools/secretary.d.ts +33 -0
- package/dist/tools/secretary.js +205 -0
- package/dist/tools/synthesize.d.ts +101 -6
- package/dist/tools/synthesize.js +64 -17
- package/dist/tools/voice.js +0 -2
- package/dist/workflow-registry.d.ts +6 -0
- package/dist/workflow-registry.js +74 -0
- package/dist/workflow-type-schema.d.ts +2 -2
- package/dist/workflow-type-schema.js +2 -0
- package/package.json +1 -1
package/dist/tools/pyramid.d.ts
CHANGED
|
@@ -257,22 +257,22 @@ export declare const createDossierInputSchema: z.ZodObject<{
|
|
|
257
257
|
}, "strip", z.ZodTypeAny, {
|
|
258
258
|
name: string;
|
|
259
259
|
status?: string | undefined;
|
|
260
|
+
document_ids?: string[] | undefined;
|
|
260
261
|
portfolio_id?: string | undefined;
|
|
261
262
|
program_id?: string | undefined;
|
|
262
263
|
weight?: number | undefined;
|
|
263
264
|
target_starts_at?: string | undefined;
|
|
264
265
|
target_ends_at?: string | undefined;
|
|
265
|
-
document_ids?: string[] | undefined;
|
|
266
266
|
dossier_kind?: string | undefined;
|
|
267
267
|
}, {
|
|
268
268
|
name: string;
|
|
269
269
|
status?: string | undefined;
|
|
270
|
+
document_ids?: string[] | undefined;
|
|
270
271
|
portfolio_id?: string | undefined;
|
|
271
272
|
program_id?: string | undefined;
|
|
272
273
|
weight?: number | undefined;
|
|
273
274
|
target_starts_at?: string | undefined;
|
|
274
275
|
target_ends_at?: string | undefined;
|
|
275
|
-
document_ids?: string[] | undefined;
|
|
276
276
|
dossier_kind?: string | undefined;
|
|
277
277
|
}>;
|
|
278
278
|
export type CreateDossierInput = z.infer<typeof createDossierInputSchema>;
|
|
@@ -347,22 +347,22 @@ export declare const updateDossierInputSchema: z.ZodObject<{
|
|
|
347
347
|
dossier_id: string;
|
|
348
348
|
name?: string | undefined;
|
|
349
349
|
status?: string | undefined;
|
|
350
|
+
document_ids?: string[] | undefined;
|
|
350
351
|
portfolio_id?: string | undefined;
|
|
351
352
|
program_id?: string | undefined;
|
|
352
353
|
weight?: number | undefined;
|
|
353
354
|
target_starts_at?: string | null | undefined;
|
|
354
355
|
target_ends_at?: string | null | undefined;
|
|
355
|
-
document_ids?: string[] | undefined;
|
|
356
356
|
}, {
|
|
357
357
|
dossier_id: string;
|
|
358
358
|
name?: string | undefined;
|
|
359
359
|
status?: string | undefined;
|
|
360
|
+
document_ids?: string[] | undefined;
|
|
360
361
|
portfolio_id?: string | undefined;
|
|
361
362
|
program_id?: string | undefined;
|
|
362
363
|
weight?: number | undefined;
|
|
363
364
|
target_starts_at?: string | null | undefined;
|
|
364
365
|
target_ends_at?: string | null | undefined;
|
|
365
|
-
document_ids?: string[] | undefined;
|
|
366
366
|
}>;
|
|
367
367
|
export type UpdateDossierInput = z.infer<typeof updateDossierInputSchema>;
|
|
368
368
|
export declare const UPDATE_DOSSIER_TOOL_DEF: {
|
|
@@ -519,11 +519,11 @@ export declare const assignProgramToVSInputSchema: z.ZodObject<{
|
|
|
519
519
|
value_stream_id: z.ZodString;
|
|
520
520
|
program_id: z.ZodString;
|
|
521
521
|
}, "strip", z.ZodTypeAny, {
|
|
522
|
-
program_id: string;
|
|
523
522
|
value_stream_id: string;
|
|
524
|
-
}, {
|
|
525
523
|
program_id: string;
|
|
524
|
+
}, {
|
|
526
525
|
value_stream_id: string;
|
|
526
|
+
program_id: string;
|
|
527
527
|
}>;
|
|
528
528
|
export type AssignProgramToVSInput = z.infer<typeof assignProgramToVSInputSchema>;
|
|
529
529
|
export declare const ASSIGN_PROGRAM_TO_VS_TOOL_DEF: {
|
package/dist/tools/registry.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Compile-time tool classification. Governs which tools may be called over HTTPS.
|
|
3
|
-
* Partition: 6 stdio_only +
|
|
3
|
+
* Partition: 6 stdio_only + 26 admin_only + 2 gate_only + 158 https = 192.
|
|
4
4
|
*/
|
|
5
5
|
export type ToolTransport = 'https' | 'stdio_only' | 'admin_only' | 'gate_only';
|
|
6
6
|
export type ToolClass = 'read' | 'write' | 'admin' | 'dispatch';
|
package/dist/tools/registry.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Compile-time tool classification. Governs which tools may be called over HTTPS.
|
|
3
|
-
* Partition: 6 stdio_only +
|
|
3
|
+
* Partition: 6 stdio_only + 26 admin_only + 2 gate_only + 158 https = 192.
|
|
4
4
|
*/
|
|
5
5
|
const STDIO_ONLY = [
|
|
6
6
|
'tacit_ingest_file',
|
|
@@ -29,6 +29,14 @@ const ADMIN_ONLY = [
|
|
|
29
29
|
'tacit_github_reconnect_connection',
|
|
30
30
|
'tacit_compose',
|
|
31
31
|
'tacit_converse',
|
|
32
|
+
'tacit_iam_grant_membership',
|
|
33
|
+
'tacit_iam_revoke_membership',
|
|
34
|
+
'tacit_iam_change_role',
|
|
35
|
+
'tacit_iam_offboard_member',
|
|
36
|
+
'tacit_iam_transfer_ownership',
|
|
37
|
+
'tacit_iam_create_approval',
|
|
38
|
+
'tacit_iam_token_management',
|
|
39
|
+
'tacit_security_rotate_secret',
|
|
32
40
|
];
|
|
33
41
|
const GATE_ONLY = ['tacit_approve_gate', 'tacit_reject_gate'];
|
|
34
42
|
const READ_TOOLS = [
|
|
@@ -105,6 +113,15 @@ const READ_TOOLS = [
|
|
|
105
113
|
'tacit_web_url',
|
|
106
114
|
'tacit_wiki_classify',
|
|
107
115
|
'tacit_wiki_validate',
|
|
116
|
+
'tacit_secretary_recall',
|
|
117
|
+
'tacit_capture_find',
|
|
118
|
+
'tacit_capture_synthesize',
|
|
119
|
+
'tacit_iam_access_report',
|
|
120
|
+
'tacit_iam_identity_recovery',
|
|
121
|
+
'tacit_security_access_review',
|
|
122
|
+
'tacit_security_secret_inventory',
|
|
123
|
+
'tacit_security_incident_report',
|
|
124
|
+
'tacit_mcp_profile_health',
|
|
108
125
|
];
|
|
109
126
|
const DISPATCH_TOOLS = [
|
|
110
127
|
'tacit_agent_delegate',
|
|
@@ -119,6 +136,7 @@ const WRITE_TOOLS = [
|
|
|
119
136
|
'tacit_agent_decide',
|
|
120
137
|
'tacit_annotate',
|
|
121
138
|
'tacit_approve_gate',
|
|
139
|
+
'tacit_add_document_person',
|
|
122
140
|
'tacit_artifact_create',
|
|
123
141
|
'tacit_artifact_delete',
|
|
124
142
|
'tacit_artifact_publish',
|
|
@@ -171,6 +189,7 @@ const WRITE_TOOLS = [
|
|
|
171
189
|
'tacit_research_prepare',
|
|
172
190
|
'tacit_share_artifact',
|
|
173
191
|
'tacit_switch_workspace',
|
|
192
|
+
'tacit_update_person',
|
|
174
193
|
'tacit_voice_upload_sample',
|
|
175
194
|
'tacit_wiki_author',
|
|
176
195
|
'tacit_wiki_override',
|
|
@@ -184,6 +203,13 @@ const WRITE_TOOLS = [
|
|
|
184
203
|
'tacit_workflow_type_create',
|
|
185
204
|
'tacit_workflow_type_list',
|
|
186
205
|
'tacit_workflow_type_update',
|
|
206
|
+
'tacit_secretary_log',
|
|
207
|
+
'tacit_capture_save',
|
|
208
|
+
'tacit_capture_remove',
|
|
209
|
+
'tacit_capture_restore',
|
|
210
|
+
'tacit_capture_note',
|
|
211
|
+
'tacit_capture_place',
|
|
212
|
+
'tacit_iam_reactivate_identity',
|
|
187
213
|
];
|
|
188
214
|
function build() {
|
|
189
215
|
const map = new Map();
|
|
@@ -210,8 +236,8 @@ function build() {
|
|
|
210
236
|
if (!exclusive.has(n))
|
|
211
237
|
add(n, classOf(n), 'https', false);
|
|
212
238
|
}
|
|
213
|
-
if (map.size !==
|
|
214
|
-
throw new Error(`tool registry expected
|
|
239
|
+
if (map.size !== 192)
|
|
240
|
+
throw new Error(`tool registry expected 192 tools, got ${map.size}`);
|
|
215
241
|
return map;
|
|
216
242
|
}
|
|
217
243
|
export const TOOL_REGISTRY = build();
|
package/dist/tools/search.d.ts
CHANGED
|
@@ -10,19 +10,16 @@ export declare const searchInputSchema: z.ZodObject<{
|
|
|
10
10
|
query: z.ZodString;
|
|
11
11
|
limit: z.ZodOptional<z.ZodNumber>;
|
|
12
12
|
source_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
13
|
-
entity_types: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
14
13
|
origin: z.ZodOptional<z.ZodString>;
|
|
15
14
|
}, "strip", z.ZodTypeAny, {
|
|
16
15
|
query: string;
|
|
17
16
|
limit?: number | undefined;
|
|
18
17
|
source_types?: string[] | undefined;
|
|
19
|
-
entity_types?: string[] | undefined;
|
|
20
18
|
origin?: string | undefined;
|
|
21
19
|
}, {
|
|
22
20
|
query: string;
|
|
23
21
|
limit?: number | undefined;
|
|
24
22
|
source_types?: string[] | undefined;
|
|
25
|
-
entity_types?: string[] | undefined;
|
|
26
23
|
origin?: string | undefined;
|
|
27
24
|
}>;
|
|
28
25
|
export type SearchInput = z.infer<typeof searchInputSchema>;
|
|
@@ -47,13 +44,6 @@ export declare const SEARCH_TOOL_DEF: {
|
|
|
47
44
|
};
|
|
48
45
|
description: string;
|
|
49
46
|
};
|
|
50
|
-
entity_types: {
|
|
51
|
-
type: string;
|
|
52
|
-
items: {
|
|
53
|
-
type: string;
|
|
54
|
-
};
|
|
55
|
-
description: string;
|
|
56
|
-
};
|
|
57
47
|
origin: {
|
|
58
48
|
type: string;
|
|
59
49
|
description: string;
|
package/dist/tools/search.js
CHANGED
|
@@ -10,7 +10,6 @@ export const searchInputSchema = z.object({
|
|
|
10
10
|
query: z.string().min(1).describe('Search query string'),
|
|
11
11
|
limit: z.number().int().positive().optional().describe('Maximum results to return'),
|
|
12
12
|
source_types: z.array(z.string()).optional().describe('Filter by source types (e.g. ["artifact","chronicle"])'),
|
|
13
|
-
entity_types: z.array(z.string()).optional().describe('Filter by entity types'),
|
|
14
13
|
origin: z.string().optional().describe('Optional origin filter (e.g., PYRAMID, LAKE_SYNC, MANUAL) to scope results'),
|
|
15
14
|
});
|
|
16
15
|
export const SEARCH_TOOL_DEF = {
|
|
@@ -22,7 +21,6 @@ export const SEARCH_TOOL_DEF = {
|
|
|
22
21
|
query: { type: 'string', description: 'Search query string' },
|
|
23
22
|
limit: { type: 'number', description: 'Maximum results to return' },
|
|
24
23
|
source_types: { type: 'array', items: { type: 'string' }, description: 'Filter by source types' },
|
|
25
|
-
entity_types: { type: 'array', items: { type: 'string' }, description: 'Filter by entity types' },
|
|
26
24
|
origin: { type: 'string', description: 'Optional origin filter (e.g., PYRAMID, LAKE_SYNC, MANUAL) to scope results' },
|
|
27
25
|
},
|
|
28
26
|
required: ['query'],
|
|
@@ -35,15 +33,13 @@ export const SEARCH_TOOL_DEF = {
|
|
|
35
33
|
export function buildSearchRequest(client, input) {
|
|
36
34
|
return {
|
|
37
35
|
async execute() {
|
|
38
|
-
const { query, limit, source_types,
|
|
36
|
+
const { query, limit, source_types, origin } = input;
|
|
39
37
|
try {
|
|
40
38
|
const params = { q: query };
|
|
41
39
|
if (limit !== undefined)
|
|
42
40
|
params['limit'] = limit;
|
|
43
41
|
if (source_types && source_types.length > 0)
|
|
44
42
|
params['source_types'] = source_types.join(',');
|
|
45
|
-
if (entity_types && entity_types.length > 0)
|
|
46
|
-
params['entity_types'] = entity_types.join(',');
|
|
47
43
|
if (origin !== undefined)
|
|
48
44
|
params['origin'] = origin;
|
|
49
45
|
// GET /api/v1/search?q=<term>
|
|
@@ -73,7 +69,6 @@ export function registerSearchTools(server, getClientFn) {
|
|
|
73
69
|
query: z.string().min(1).describe('Search query string'),
|
|
74
70
|
limit: z.number().int().positive().optional().describe('Maximum results to return'),
|
|
75
71
|
source_types: z.array(z.string()).optional().describe('Filter by source types (e.g. ["artifact","chronicle"])'),
|
|
76
|
-
entity_types: z.array(z.string()).optional().describe('Filter by entity types'),
|
|
77
72
|
origin: z.string().optional().describe('Optional origin filter (e.g., PYRAMID, LAKE_SYNC, MANUAL) to scope results'),
|
|
78
73
|
}, async (args) => {
|
|
79
74
|
const client = await getClientFn();
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { TacitClient } from '../client.js';
|
|
3
|
+
/**
|
|
4
|
+
* NL→EventType keyword table (longest-match-first).
|
|
5
|
+
* Each entry: [keyword_phrase, chronicle_event_type].
|
|
6
|
+
* Sorted by phrase length descending so "status update" matches before "status".
|
|
7
|
+
*/
|
|
8
|
+
export declare const EVENT_TYPE_KEYWORDS: [string, string][];
|
|
9
|
+
export declare function classifyEventType(text: string, hint?: string): string;
|
|
10
|
+
export interface LogPayloadArgs {
|
|
11
|
+
description: string;
|
|
12
|
+
event_hint?: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
project_id?: string;
|
|
15
|
+
chapter_id?: string;
|
|
16
|
+
participants?: string;
|
|
17
|
+
supersedes_event_id?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function buildLogPayload(args: LogPayloadArgs): Record<string, unknown>;
|
|
20
|
+
export interface RecallRequestArgs {
|
|
21
|
+
query: string;
|
|
22
|
+
from?: string;
|
|
23
|
+
to?: string;
|
|
24
|
+
event_types?: string;
|
|
25
|
+
limit?: number;
|
|
26
|
+
project_id?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface RecallRequest {
|
|
29
|
+
method: 'GET';
|
|
30
|
+
path: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function buildRecallRequest(args: RecallRequestArgs): RecallRequest;
|
|
33
|
+
export declare function registerSecretaryTools(server: McpServer, getClient: () => Promise<TacitClient>): void;
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { TacitApiError } from '../client.js';
|
|
3
|
+
import { success, error, featureDisabledResult, apiErrorResult } from './errors.js';
|
|
4
|
+
/**
|
|
5
|
+
* NL→EventType keyword table (longest-match-first).
|
|
6
|
+
* Each entry: [keyword_phrase, chronicle_event_type].
|
|
7
|
+
* Sorted by phrase length descending so "status update" matches before "status".
|
|
8
|
+
*/
|
|
9
|
+
export const EVENT_TYPE_KEYWORDS = [
|
|
10
|
+
// Multi-word first (longest match)
|
|
11
|
+
['status update', 'status_update'],
|
|
12
|
+
['action item', 'action_item'],
|
|
13
|
+
['follow up', 'action_item'],
|
|
14
|
+
['next step', 'action_item'],
|
|
15
|
+
['kicked off', 'milestone'],
|
|
16
|
+
['signed off', 'decision'],
|
|
17
|
+
['agreed to', 'decision'],
|
|
18
|
+
['wrapped up', 'milestone'],
|
|
19
|
+
// Single-word
|
|
20
|
+
['decided', 'decision'],
|
|
21
|
+
['decision', 'decision'],
|
|
22
|
+
['approved', 'decision'],
|
|
23
|
+
['rejected', 'decision'],
|
|
24
|
+
['checked in', 'meeting_note'],
|
|
25
|
+
['caught up', 'meeting_note'],
|
|
26
|
+
['met', 'meeting_note'],
|
|
27
|
+
['meeting', 'meeting_note'],
|
|
28
|
+
['call', 'meeting_note'],
|
|
29
|
+
['sync', 'meeting_note'],
|
|
30
|
+
['standup', 'meeting_note'],
|
|
31
|
+
['milestone', 'milestone'],
|
|
32
|
+
['launched', 'milestone'],
|
|
33
|
+
['shipped', 'milestone'],
|
|
34
|
+
['completed', 'milestone'],
|
|
35
|
+
['released', 'milestone'],
|
|
36
|
+
['deployed', 'milestone'],
|
|
37
|
+
['blocker', 'blocker'],
|
|
38
|
+
['blocked', 'blocker'],
|
|
39
|
+
['stuck', 'blocker'],
|
|
40
|
+
['risk', 'risk'],
|
|
41
|
+
['concern', 'risk'],
|
|
42
|
+
['warning', 'risk'],
|
|
43
|
+
['note', 'note'],
|
|
44
|
+
['noticed', 'note'],
|
|
45
|
+
['observed', 'note'],
|
|
46
|
+
['fyi', 'note'],
|
|
47
|
+
['idea', 'insight'],
|
|
48
|
+
['insight', 'insight'],
|
|
49
|
+
['realized', 'insight'],
|
|
50
|
+
['learned', 'insight'],
|
|
51
|
+
['discovery', 'insight'],
|
|
52
|
+
['todo', 'action_item'],
|
|
53
|
+
['task', 'action_item'],
|
|
54
|
+
['assign', 'action_item'],
|
|
55
|
+
];
|
|
56
|
+
export function classifyEventType(text, hint) {
|
|
57
|
+
if (hint)
|
|
58
|
+
return hint;
|
|
59
|
+
const lower = text.toLowerCase();
|
|
60
|
+
for (const [phrase, eventType] of EVENT_TYPE_KEYWORDS) {
|
|
61
|
+
if (new RegExp(`\\b${phrase}(?:s|es|d|ed|ing)?\\b`).test(lower))
|
|
62
|
+
return eventType;
|
|
63
|
+
}
|
|
64
|
+
return 'note';
|
|
65
|
+
}
|
|
66
|
+
const SECRETARY_TO_BACKEND = {
|
|
67
|
+
decision: 'DECISION',
|
|
68
|
+
meeting_note: 'MEETING_MINUTES',
|
|
69
|
+
milestone: 'WORK_NOTE',
|
|
70
|
+
blocker: 'BLOCKER',
|
|
71
|
+
risk: 'RISK_ESCALATION',
|
|
72
|
+
note: 'WORK_NOTE',
|
|
73
|
+
insight: 'WORK_NOTE',
|
|
74
|
+
action_item: 'ACTION_ITEM',
|
|
75
|
+
status_update: 'STATUS_UPDATE',
|
|
76
|
+
};
|
|
77
|
+
export function buildLogPayload(args) {
|
|
78
|
+
const eventType = classifyEventType(args.description, args.event_hint);
|
|
79
|
+
const backendType = SECRETARY_TO_BACKEND[eventType] ?? 'WORK_NOTE';
|
|
80
|
+
const title = args.title ??
|
|
81
|
+
(args.description.length > 80
|
|
82
|
+
? args.description.slice(0, 77) + '...'
|
|
83
|
+
: args.description);
|
|
84
|
+
const payload = {
|
|
85
|
+
event_type: backendType,
|
|
86
|
+
title,
|
|
87
|
+
raw_payload: args.description,
|
|
88
|
+
metadata: { secretary_kind: eventType },
|
|
89
|
+
hint: `Logged as ${eventType} (backend: ${backendType}). Pass event_hint to override.`,
|
|
90
|
+
};
|
|
91
|
+
if (args.project_id)
|
|
92
|
+
payload['project_id'] = args.project_id;
|
|
93
|
+
if (args.chapter_id)
|
|
94
|
+
payload['chapter_id'] = args.chapter_id;
|
|
95
|
+
if (args.participants) {
|
|
96
|
+
payload['metadata']['participants'] = args.participants
|
|
97
|
+
.split(',')
|
|
98
|
+
.map((p) => p.trim());
|
|
99
|
+
}
|
|
100
|
+
if (args.supersedes_event_id) {
|
|
101
|
+
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
102
|
+
if (!UUID_RE.test(args.supersedes_event_id)) {
|
|
103
|
+
throw new Error('supersedes_event_id must be a valid UUID');
|
|
104
|
+
}
|
|
105
|
+
payload['supersedes_event_id'] = args.supersedes_event_id;
|
|
106
|
+
}
|
|
107
|
+
return payload;
|
|
108
|
+
}
|
|
109
|
+
export function buildRecallRequest(args) {
|
|
110
|
+
const query = args.query.trim();
|
|
111
|
+
if (query) {
|
|
112
|
+
if (args.project_id) {
|
|
113
|
+
throw new Error('project_id filtering is not supported with semantic search queries');
|
|
114
|
+
}
|
|
115
|
+
const params = new URLSearchParams();
|
|
116
|
+
params.set('q', query);
|
|
117
|
+
params.set('source_type', 'CHRONICLE_EVENT');
|
|
118
|
+
if (args.limit !== undefined)
|
|
119
|
+
params.set('limit', String(args.limit));
|
|
120
|
+
return { method: 'GET', path: `/api/v1/search?${params.toString()}` };
|
|
121
|
+
}
|
|
122
|
+
const params = new URLSearchParams();
|
|
123
|
+
if (args.from)
|
|
124
|
+
params.set('from', args.from);
|
|
125
|
+
if (args.to)
|
|
126
|
+
params.set('to', args.to);
|
|
127
|
+
if (args.event_types)
|
|
128
|
+
params.set('event_types', args.event_types);
|
|
129
|
+
if (args.limit !== undefined)
|
|
130
|
+
params.set('limit', String(args.limit));
|
|
131
|
+
if (args.project_id)
|
|
132
|
+
params.set('project_id', args.project_id);
|
|
133
|
+
const qs = params.toString();
|
|
134
|
+
return { method: 'GET', path: `/api/v1/chronicle/events/recent${qs ? `?${qs}` : ''}` };
|
|
135
|
+
}
|
|
136
|
+
export function registerSecretaryTools(server, getClient) {
|
|
137
|
+
server.tool('tacit_secretary_log', 'Log an event to Chronicle using natural language. Classifies the event type automatically from your description, or accepts an explicit event_hint override. Examples: "Decided to use Postgres for the queue", "Met with the design team about onboarding", "Blocker: CI pipeline broken".', {
|
|
138
|
+
description: z.string().describe('Natural language description of the event'),
|
|
139
|
+
event_hint: z
|
|
140
|
+
.enum([
|
|
141
|
+
'decision',
|
|
142
|
+
'meeting_note',
|
|
143
|
+
'milestone',
|
|
144
|
+
'blocker',
|
|
145
|
+
'risk',
|
|
146
|
+
'note',
|
|
147
|
+
'insight',
|
|
148
|
+
'action_item',
|
|
149
|
+
'status_update',
|
|
150
|
+
])
|
|
151
|
+
.optional()
|
|
152
|
+
.describe('Override automatic classification with an explicit event type'),
|
|
153
|
+
title: z
|
|
154
|
+
.string()
|
|
155
|
+
.optional()
|
|
156
|
+
.describe('Short title (auto-generated from first 80 chars if omitted)'),
|
|
157
|
+
project_id: z.string().uuid().optional().describe('Scope to a specific project'),
|
|
158
|
+
chapter_id: z.string().uuid().optional().describe('Scope to a specific chapter'),
|
|
159
|
+
participants: z
|
|
160
|
+
.string()
|
|
161
|
+
.optional()
|
|
162
|
+
.describe('Comma-separated participant names or emails'),
|
|
163
|
+
supersedes_event_id: z.string().uuid().optional().describe('UUID of a prior event this one supersedes'),
|
|
164
|
+
}, async (args) => {
|
|
165
|
+
try {
|
|
166
|
+
const client = await getClient();
|
|
167
|
+
const { hint, ...body } = buildLogPayload(args);
|
|
168
|
+
const data = await client.request('POST', '/api/v1/events', body);
|
|
169
|
+
return success({
|
|
170
|
+
logged: true,
|
|
171
|
+
classified_as: body.event_type,
|
|
172
|
+
hint,
|
|
173
|
+
event: data,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
catch (e) {
|
|
177
|
+
if (e instanceof TacitApiError)
|
|
178
|
+
return featureDisabledResult(e) ?? apiErrorResult(e, '/api/v1/events');
|
|
179
|
+
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
server.tool('tacit_secretary_recall', 'Search Chronicle history with natural language. Returns the most relevant events ranked by semantic similarity, with optional date-range listing when no query is given. Examples: "decisions about auth", "meetings last week", "blockers this sprint".', {
|
|
183
|
+
query: z.string().describe('Natural language search query'),
|
|
184
|
+
from: z.string().optional().describe('RFC 3339 lower bound (inclusive)'),
|
|
185
|
+
to: z.string().optional().describe('RFC 3339 upper bound (inclusive)'),
|
|
186
|
+
event_types: z
|
|
187
|
+
.string()
|
|
188
|
+
.optional()
|
|
189
|
+
.describe('Comma-separated event types to filter (e.g. "decision,milestone")'),
|
|
190
|
+
limit: z.number().int().optional().describe('Max results (default 20, cap 100)'),
|
|
191
|
+
project_id: z.string().uuid().optional().describe('Scope to a specific project'),
|
|
192
|
+
}, async (args) => {
|
|
193
|
+
try {
|
|
194
|
+
const req = buildRecallRequest(args);
|
|
195
|
+
const client = await getClient();
|
|
196
|
+
const data = await client.request(req.method, req.path);
|
|
197
|
+
return success(data);
|
|
198
|
+
}
|
|
199
|
+
catch (e) {
|
|
200
|
+
if (e instanceof TacitApiError)
|
|
201
|
+
return featureDisabledResult(e) ?? apiErrorResult(e, '/api/v1/search');
|
|
202
|
+
return error(`Unexpected error: ${e instanceof Error ? e.message : String(e)}`);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
@@ -12,11 +12,26 @@ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
|
12
12
|
import { TacitClient } from '../client.js';
|
|
13
13
|
export declare const synthesizeInputSchema: z.ZodObject<{
|
|
14
14
|
query: z.ZodString;
|
|
15
|
-
scope: z.ZodOptional<z.ZodString>;
|
|
16
15
|
stream: z.ZodOptional<z.ZodBoolean>;
|
|
17
16
|
workspace_id: z.ZodOptional<z.ZodString>;
|
|
17
|
+
document_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
+
saved_items: z.ZodOptional<z.ZodObject<{
|
|
19
|
+
by: z.ZodEnum<["me", "anyone"]>;
|
|
20
|
+
}, "strip", z.ZodTypeAny, {
|
|
21
|
+
by: "me" | "anyone";
|
|
22
|
+
}, {
|
|
23
|
+
by: "me" | "anyone";
|
|
24
|
+
}>>;
|
|
25
|
+
portfolio_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26
|
+
value_stream_id: z.ZodOptional<z.ZodString>;
|
|
27
|
+
value_stream_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
28
|
+
dossier_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
29
|
+
active_dossier_id: z.ZodOptional<z.ZodString>;
|
|
18
30
|
collection_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
19
31
|
program_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
32
|
+
placement_scope: z.ZodOptional<z.ZodEnum<["KB", "PYRAMID", "BOTH"]>>;
|
|
33
|
+
mentioned_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
34
|
+
scope_name: z.ZodOptional<z.ZodString>;
|
|
20
35
|
origin: z.ZodOptional<z.ZodString>;
|
|
21
36
|
synthesis_mode: z.ZodOptional<z.ZodEnum<["burst", "orbit", "crew_compose"]>>;
|
|
22
37
|
max_turns: z.ZodOptional<z.ZodNumber>;
|
|
@@ -25,11 +40,22 @@ export declare const synthesizeInputSchema: z.ZodObject<{
|
|
|
25
40
|
}, "strip", z.ZodTypeAny, {
|
|
26
41
|
query: string;
|
|
27
42
|
workspace_id?: string | undefined;
|
|
28
|
-
scope?: string | undefined;
|
|
29
43
|
stream?: boolean | undefined;
|
|
30
44
|
origin?: string | undefined;
|
|
45
|
+
document_ids?: string[] | undefined;
|
|
46
|
+
saved_items?: {
|
|
47
|
+
by: "me" | "anyone";
|
|
48
|
+
} | undefined;
|
|
49
|
+
portfolio_ids?: string[] | undefined;
|
|
50
|
+
value_stream_id?: string | undefined;
|
|
51
|
+
value_stream_ids?: string[] | undefined;
|
|
52
|
+
dossier_ids?: string[] | undefined;
|
|
53
|
+
active_dossier_id?: string | undefined;
|
|
31
54
|
collection_ids?: string[] | undefined;
|
|
32
55
|
program_ids?: string[] | undefined;
|
|
56
|
+
placement_scope?: "KB" | "PYRAMID" | "BOTH" | undefined;
|
|
57
|
+
mentioned_ids?: string[] | undefined;
|
|
58
|
+
scope_name?: string | undefined;
|
|
33
59
|
synthesis_mode?: "burst" | "orbit" | "crew_compose" | undefined;
|
|
34
60
|
max_turns?: number | undefined;
|
|
35
61
|
voice_mode?: "voice_on" | "voice_off" | "voice_only" | undefined;
|
|
@@ -37,11 +63,22 @@ export declare const synthesizeInputSchema: z.ZodObject<{
|
|
|
37
63
|
}, {
|
|
38
64
|
query: string;
|
|
39
65
|
workspace_id?: string | undefined;
|
|
40
|
-
scope?: string | undefined;
|
|
41
66
|
stream?: boolean | undefined;
|
|
42
67
|
origin?: string | undefined;
|
|
68
|
+
document_ids?: string[] | undefined;
|
|
69
|
+
saved_items?: {
|
|
70
|
+
by: "me" | "anyone";
|
|
71
|
+
} | undefined;
|
|
72
|
+
portfolio_ids?: string[] | undefined;
|
|
73
|
+
value_stream_id?: string | undefined;
|
|
74
|
+
value_stream_ids?: string[] | undefined;
|
|
75
|
+
dossier_ids?: string[] | undefined;
|
|
76
|
+
active_dossier_id?: string | undefined;
|
|
43
77
|
collection_ids?: string[] | undefined;
|
|
44
78
|
program_ids?: string[] | undefined;
|
|
79
|
+
placement_scope?: "KB" | "PYRAMID" | "BOTH" | undefined;
|
|
80
|
+
mentioned_ids?: string[] | undefined;
|
|
81
|
+
scope_name?: string | undefined;
|
|
45
82
|
synthesis_mode?: "burst" | "orbit" | "crew_compose" | undefined;
|
|
46
83
|
max_turns?: number | undefined;
|
|
47
84
|
voice_mode?: "voice_on" | "voice_off" | "voice_only" | undefined;
|
|
@@ -58,15 +95,57 @@ export declare const SYNTHESIZE_TOOL_DEF: {
|
|
|
58
95
|
type: string;
|
|
59
96
|
description: string;
|
|
60
97
|
};
|
|
61
|
-
|
|
98
|
+
stream: {
|
|
62
99
|
type: string;
|
|
63
100
|
description: string;
|
|
64
101
|
};
|
|
65
|
-
|
|
102
|
+
workspace_id: {
|
|
66
103
|
type: string;
|
|
67
104
|
description: string;
|
|
68
105
|
};
|
|
69
|
-
|
|
106
|
+
document_ids: {
|
|
107
|
+
type: string;
|
|
108
|
+
items: {
|
|
109
|
+
type: string;
|
|
110
|
+
};
|
|
111
|
+
description: string;
|
|
112
|
+
};
|
|
113
|
+
saved_items: {
|
|
114
|
+
type: string;
|
|
115
|
+
properties: {
|
|
116
|
+
by: {
|
|
117
|
+
type: string;
|
|
118
|
+
enum: string[];
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
description: string;
|
|
122
|
+
};
|
|
123
|
+
portfolio_ids: {
|
|
124
|
+
type: string;
|
|
125
|
+
items: {
|
|
126
|
+
type: string;
|
|
127
|
+
};
|
|
128
|
+
description: string;
|
|
129
|
+
};
|
|
130
|
+
value_stream_id: {
|
|
131
|
+
type: string;
|
|
132
|
+
description: string;
|
|
133
|
+
};
|
|
134
|
+
value_stream_ids: {
|
|
135
|
+
type: string;
|
|
136
|
+
items: {
|
|
137
|
+
type: string;
|
|
138
|
+
};
|
|
139
|
+
description: string;
|
|
140
|
+
};
|
|
141
|
+
dossier_ids: {
|
|
142
|
+
type: string;
|
|
143
|
+
items: {
|
|
144
|
+
type: string;
|
|
145
|
+
};
|
|
146
|
+
description: string;
|
|
147
|
+
};
|
|
148
|
+
active_dossier_id: {
|
|
70
149
|
type: string;
|
|
71
150
|
description: string;
|
|
72
151
|
};
|
|
@@ -84,6 +163,22 @@ export declare const SYNTHESIZE_TOOL_DEF: {
|
|
|
84
163
|
};
|
|
85
164
|
description: string;
|
|
86
165
|
};
|
|
166
|
+
placement_scope: {
|
|
167
|
+
type: string;
|
|
168
|
+
enum: string[];
|
|
169
|
+
description: string;
|
|
170
|
+
};
|
|
171
|
+
mentioned_ids: {
|
|
172
|
+
type: string;
|
|
173
|
+
items: {
|
|
174
|
+
type: string;
|
|
175
|
+
};
|
|
176
|
+
description: string;
|
|
177
|
+
};
|
|
178
|
+
scope_name: {
|
|
179
|
+
type: string;
|
|
180
|
+
description: string;
|
|
181
|
+
};
|
|
87
182
|
origin: {
|
|
88
183
|
type: string;
|
|
89
184
|
description: string;
|