@tacitai/mcp-server 0.6.18 → 0.6.20

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 CHANGED
@@ -20,14 +20,14 @@ export declare const GM_WORKFLOW: {
20
20
  readonly steps: readonly [{
21
21
  readonly id: "ingest";
22
22
  readonly name: "Ingest";
23
- readonly action: "Call tacit_gm_ingest with a title and the content (inline text via \"content\", or a local file via \"file_path\" — never both). Do NOT set domain_id. IMPORTANT: The response will include a placement_proposal with suggested_surface — IGNORE this field, it is a backend stub that always says \"lake.\" You will determine placement yourself in the next steps.";
23
+ readonly action: "Call tacit_gm_ingest with a title and the content (inline text via \"content\", or a local file via \"file_path\" — never both). Do NOT set domain_id. The response includes a placement_proposal with suggested_surface (\"kb\" or \"pyramid\") and a confidence score. The suggested_surface is the GM's decision about WHICH surface: keep it. Step 3 picks the specific location within that surface. Never switch surfaces (for example to a KB collection whose name looks relevant) unless the user asks for that surface.";
24
24
  readonly tools: readonly ["tacit_gm_ingest"];
25
25
  readonly signal: "You receive a catalog_id, artifact_id, content_type, and is_duplicate flag. Save the catalog_id — you will need it for placement.";
26
26
  readonly on_duplicate: "If is_duplicate is true, tell the user this content already exists and ask how to proceed: update, skip, or ingest as a new version.";
27
27
  }, {
28
28
  readonly id: "classify_present";
29
29
  readonly name: "Present classification and offer options";
30
- readonly action: "Tell the user what the GM classified their content as. Then ALWAYS offer placement options — do not default to lake. Say something like: \"Your [title] is cataloged. Where should it live? I can file it in your workspace structure, add it to your knowledge base, both, or keep it in the data lake for now. Or say 'you decide' and I'll recommend a spot.\" STOP here and wait for the user to respond. Do not proceed until they choose.";
30
+ readonly action: "Tell the user what the GM classified their content as and which surface it suggested (workspace structure or knowledge base). Then ALWAYS offer placement options — do not default to lake, and lead with the GM's suggested surface. Say something like: \"Your [title] is cataloged. Where should it live? I can file it in your workspace structure, add it to your knowledge base, both, or keep it in the data lake for now. Or say 'you decide' and I'll recommend a spot.\" STOP here and wait for the user to respond. Do not proceed until they choose.";
31
31
  readonly tools: readonly [];
32
32
  readonly signal: "User chooses: workspace structure, knowledge base, both, lake-only, or \"you decide.\"";
33
33
  }, {
@@ -40,20 +40,20 @@ export declare const GM_WORKFLOW: {
40
40
  }, {
41
41
  readonly id: "propose";
42
42
  readonly name: "Propose and WAIT for approval";
43
- readonly action: "Present a specific proposal and STOP. Do not call tacit_gm_approve yet. Say: \"I'd file this under [portfolio] → [program] → [dossier] — [one sentence reason]. Should I go ahead?\" If proposing a new dossier: \"There's no dossier that fits under [program], so I'd create one called [name]. Good?\" For KB: \"I'd add this to your [collection] knowledge base. It will start as a draft. Approve?\" CRITICAL: You MUST wait for the user to say yes, approve, or confirm BEFORE proceeding to the next step. Do NOT interpret the user's earlier request to \"place it\" as approval — they need to approve the SPECIFIC location you are proposing.";
43
+ readonly action: "Present a specific proposal and STOP. Do not call tacit_gm_approve yet. Say: \"I'd file this under [portfolio] → [program] → [dossier] — [one sentence reason]. Should I go ahead?\" If proposing a new dossier: \"There's no dossier that fits under [program], so I'd create one called [name]. Good?\" For KB: \"I'd add this to your [collection] knowledge base, where it will be published. Approve?\" CRITICAL: You MUST wait for the user to say yes, approve, or confirm BEFORE proceeding to the next step. Do NOT interpret the user's earlier request to \"place it\", \"add it to the workspace\" or \"you decide\" as approval — they need to approve the SPECIFIC location you are proposing. If the classifier's suggestion does not fit, propose a better location; never place it yourself instead of asking.";
44
44
  readonly tools: readonly [];
45
45
  readonly signal: "User explicitly approves (\"yes\", \"approve\", \"do it\", \"go ahead\"), redirects to a different location, or declines.";
46
46
  }, {
47
47
  readonly id: "place";
48
48
  readonly name: "Execute approved placement";
49
- readonly action: "ONLY after the user explicitly approved the proposal in step 4: For pyramid — if a new dossier is needed, call tacit_pyramid_create_dossier first to get the dossier_id. Then call tacit_gm_approve with the catalog_id from step 1, surface=\"pyramid\", collection_or_program set to the program UUID, and dossier_id set to the dossier UUID. NEVER call tacit_gm_approve without a dossier_id for pyramid placement. For KB: call tacit_gm_approve with surface=\"kb\" and the collection UUID. For both: pyramid first, then KB (two separate calls). For lake-only: no call needed.";
50
- readonly tools: readonly ["tacit_gm_approve", "tacit_pyramid_create_dossier"];
51
- readonly signal: "tacit_gm_approve returns success.";
49
+ readonly action: "ONLY after the user explicitly approved the proposal in step 4: For pyramid — if a new dossier is needed, call tacit_pyramid_create_dossier first to get the dossier_id. Then call tacit_gm_approve with the catalog_id from step 1, surface=\"pyramid\", collection_or_program set to the program UUID, and dossier_id set to the dossier UUID. NEVER call tacit_gm_approve without a dossier_id for pyramid placement. For KB: call tacit_kb_promote_from_artifact with the artifact_id from step 1 and the collection UUID (tacit_gm_approve does not place KB content). For both: pyramid first, then KB (two separate calls). For lake-only: no call needed. Pass title and location_label (the plain-language location you proposed) on each placement call; clients that support it show the user a confirmation, and if the user declines, nothing is placed and you return to step 4.";
50
+ readonly tools: readonly ["tacit_gm_approve", "tacit_kb_promote_from_artifact", "tacit_pyramid_create_dossier"];
51
+ readonly signal: "tacit_gm_approve or tacit_kb_promote_from_artifact returns success.";
52
52
  readonly skip_when: "User chose lake-only.";
53
53
  }, {
54
54
  readonly id: "confirm";
55
55
  readonly name: "Confirm in plain language";
56
- readonly action: "Tell the user where their content landed: \"Done — your [title] is filed under [portfolio] → [program] → [dossier].\" For KB: \"Added to your [collection] knowledge base as a draft — it won't appear in search results until published.\" For lake-only: \"Saved to your data lake — you can file it somewhere anytime by asking me.\" NEVER show catalog IDs, artifact IDs, UUIDs, or SHA hashes in your response.";
56
+ readonly action: "Tell the user where their content landed: \"Done — your [title] is filed under [portfolio] → [program] → [dossier].\" For KB: \"Added to your [collection] knowledge base.\" For lake-only: \"Saved to your data lake — you can file it somewhere anytime by asking me.\" NEVER show catalog IDs, artifact IDs, UUIDs, or SHA hashes in your response.";
57
57
  readonly tools: readonly [];
58
58
  readonly signal: "User sees a clear, plain-language confirmation.";
59
59
  }];
package/dist/prompts.js CHANGED
@@ -127,7 +127,7 @@ export const GM_WORKFLOW = {
127
127
  {
128
128
  id: 'ingest',
129
129
  name: 'Ingest',
130
- action: 'Call tacit_gm_ingest with a title and the content (inline text via "content", or a local file via "file_path" — never both). Do NOT set domain_id. IMPORTANT: The response will include a placement_proposal with suggested_surface — IGNORE this field, it is a backend stub that always says "lake." You will determine placement yourself in the next steps.',
130
+ action: 'Call tacit_gm_ingest with a title and the content (inline text via "content", or a local file via "file_path" — never both). Do NOT set domain_id. The response includes a placement_proposal with suggested_surface ("kb" or "pyramid") and a confidence score. The suggested_surface is the GM\'s decision about WHICH surface: keep it. Step 3 picks the specific location within that surface. Never switch surfaces (for example to a KB collection whose name looks relevant) unless the user asks for that surface.',
131
131
  tools: ['tacit_gm_ingest'],
132
132
  signal: 'You receive a catalog_id, artifact_id, content_type, and is_duplicate flag. Save the catalog_id — you will need it for placement.',
133
133
  on_duplicate: 'If is_duplicate is true, tell the user this content already exists and ask how to proceed: update, skip, or ingest as a new version.',
@@ -135,7 +135,7 @@ export const GM_WORKFLOW = {
135
135
  {
136
136
  id: 'classify_present',
137
137
  name: 'Present classification and offer options',
138
- action: 'Tell the user what the GM classified their content as. Then ALWAYS offer placement options — do not default to lake. Say something like: "Your [title] is cataloged. Where should it live? I can file it in your workspace structure, add it to your knowledge base, both, or keep it in the data lake for now. Or say \'you decide\' and I\'ll recommend a spot." STOP here and wait for the user to respond. Do not proceed until they choose.',
138
+ action: 'Tell the user what the GM classified their content as and which surface it suggested (workspace structure or knowledge base). Then ALWAYS offer placement options — do not default to lake, and lead with the GM\'s suggested surface. Say something like: "Your [title] is cataloged. Where should it live? I can file it in your workspace structure, add it to your knowledge base, both, or keep it in the data lake for now. Or say \'you decide\' and I\'ll recommend a spot." STOP here and wait for the user to respond. Do not proceed until they choose.',
139
139
  tools: [],
140
140
  signal: 'User chooses: workspace structure, knowledge base, both, lake-only, or "you decide."',
141
141
  },
@@ -150,22 +150,22 @@ export const GM_WORKFLOW = {
150
150
  {
151
151
  id: 'propose',
152
152
  name: 'Propose and WAIT for approval',
153
- action: 'Present a specific proposal and STOP. Do not call tacit_gm_approve yet. Say: "I\'d file this under [portfolio] → [program] → [dossier] — [one sentence reason]. Should I go ahead?" If proposing a new dossier: "There\'s no dossier that fits under [program], so I\'d create one called [name]. Good?" For KB: "I\'d add this to your [collection] knowledge base. It will start as a draft. Approve?" CRITICAL: You MUST wait for the user to say yes, approve, or confirm BEFORE proceeding to the next step. Do NOT interpret the user\'s earlier request to "place it" as approval — they need to approve the SPECIFIC location you are proposing.',
153
+ action: 'Present a specific proposal and STOP. Do not call tacit_gm_approve yet. Say: "I\'d file this under [portfolio] → [program] → [dossier] — [one sentence reason]. Should I go ahead?" If proposing a new dossier: "There\'s no dossier that fits under [program], so I\'d create one called [name]. Good?" For KB: "I\'d add this to your [collection] knowledge base, where it will be published. Approve?" CRITICAL: You MUST wait for the user to say yes, approve, or confirm BEFORE proceeding to the next step. Do NOT interpret the user\'s earlier request to "place it", "add it to the workspace" or "you decide" as approval — they need to approve the SPECIFIC location you are proposing. If the classifier\'s suggestion does not fit, propose a better location; never place it yourself instead of asking.',
154
154
  tools: [],
155
155
  signal: 'User explicitly approves ("yes", "approve", "do it", "go ahead"), redirects to a different location, or declines.',
156
156
  },
157
157
  {
158
158
  id: 'place',
159
159
  name: 'Execute approved placement',
160
- action: 'ONLY after the user explicitly approved the proposal in step 4: For pyramid — if a new dossier is needed, call tacit_pyramid_create_dossier first to get the dossier_id. Then call tacit_gm_approve with the catalog_id from step 1, surface="pyramid", collection_or_program set to the program UUID, and dossier_id set to the dossier UUID. NEVER call tacit_gm_approve without a dossier_id for pyramid placement. For KB: call tacit_gm_approve with surface="kb" and the collection UUID. For both: pyramid first, then KB (two separate calls). For lake-only: no call needed.',
161
- tools: ['tacit_gm_approve', 'tacit_pyramid_create_dossier'],
162
- signal: 'tacit_gm_approve returns success.',
160
+ action: 'ONLY after the user explicitly approved the proposal in step 4: For pyramid — if a new dossier is needed, call tacit_pyramid_create_dossier first to get the dossier_id. Then call tacit_gm_approve with the catalog_id from step 1, surface="pyramid", collection_or_program set to the program UUID, and dossier_id set to the dossier UUID. NEVER call tacit_gm_approve without a dossier_id for pyramid placement. For KB: call tacit_kb_promote_from_artifact with the artifact_id from step 1 and the collection UUID (tacit_gm_approve does not place KB content). For both: pyramid first, then KB (two separate calls). For lake-only: no call needed. Pass title and location_label (the plain-language location you proposed) on each placement call; clients that support it show the user a confirmation, and if the user declines, nothing is placed and you return to step 4.',
161
+ tools: ['tacit_gm_approve', 'tacit_kb_promote_from_artifact', 'tacit_pyramid_create_dossier'],
162
+ signal: 'tacit_gm_approve or tacit_kb_promote_from_artifact returns success.',
163
163
  skip_when: 'User chose lake-only.',
164
164
  },
165
165
  {
166
166
  id: 'confirm',
167
167
  name: 'Confirm in plain language',
168
- action: 'Tell the user where their content landed: "Done — your [title] is filed under [portfolio] → [program] → [dossier]." For KB: "Added to your [collection] knowledge base as a draft — it won\'t appear in search results until published." For lake-only: "Saved to your data lake — you can file it somewhere anytime by asking me." NEVER show catalog IDs, artifact IDs, UUIDs, or SHA hashes in your response.',
168
+ action: 'Tell the user where their content landed: "Done — your [title] is filed under [portfolio] → [program] → [dossier]." For KB: "Added to your [collection] knowledge base." For lake-only: "Saved to your data lake — you can file it somewhere anytime by asking me." NEVER show catalog IDs, artifact IDs, UUIDs, or SHA hashes in your response.',
169
169
  tools: [],
170
170
  signal: 'User sees a clear, plain-language confirmation.',
171
171
  },
@@ -18,6 +18,17 @@ export interface ToolRequest {
18
18
  isError?: boolean;
19
19
  }>;
20
20
  }
21
+ export type PlacementConfirmation = 'approved' | 'declined' | 'unsupported';
22
+ export declare function confirmPlacement(server: McpServer, message: string): Promise<PlacementConfirmation>;
23
+ export declare function placementMessage(title: string | undefined, locationLabel: string | undefined, fallback: string): string;
24
+ export declare function placementDeclinedResult(locationLabel: string | undefined): {
25
+ content: Array<{
26
+ type: 'text';
27
+ text: string;
28
+ }>;
29
+ isError: boolean;
30
+ };
31
+ export declare const GM_INGEST_NEXT_STEP: string;
21
32
  /** Largest file `file_path` will read (10 MiB). */
22
33
  export declare const GM_INGEST_MAX_FILE_BYTES: number;
23
34
  type FileReadResult = {
@@ -52,9 +63,9 @@ export declare const gmIngestInputSchema: z.ZodObject<{
52
63
  }, "strip", z.ZodTypeAny, {
53
64
  title: string;
54
65
  content?: string | undefined;
66
+ file_path?: string | undefined;
55
67
  source_uri?: string | undefined;
56
68
  content_type?: string | undefined;
57
- file_path?: string | undefined;
58
69
  classification_hints?: {
59
70
  domain?: string | undefined;
60
71
  content_type?: string | undefined;
@@ -62,9 +73,9 @@ export declare const gmIngestInputSchema: z.ZodObject<{
62
73
  }, {
63
74
  title: string;
64
75
  content?: string | undefined;
76
+ file_path?: string | undefined;
65
77
  source_uri?: string | undefined;
66
78
  content_type?: string | undefined;
67
- file_path?: string | undefined;
68
79
  classification_hints?: {
69
80
  domain?: string | undefined;
70
81
  content_type?: string | undefined;
@@ -146,6 +157,8 @@ export declare const gmApproveInputSchema: z.ZodObject<{
146
157
  surface: string;
147
158
  reason?: string | undefined;
148
159
  }>, "many">>>;
160
+ title: z.ZodOptional<z.ZodString>;
161
+ location_label: z.ZodOptional<z.ZodString>;
149
162
  }, "strict", z.ZodTypeAny, {
150
163
  catalog_id: string;
151
164
  approved_targets: {
@@ -157,6 +170,8 @@ export declare const gmApproveInputSchema: z.ZodObject<{
157
170
  surface: string;
158
171
  reason?: string | undefined;
159
172
  }[];
173
+ title?: string | undefined;
174
+ location_label?: string | undefined;
160
175
  }, {
161
176
  catalog_id: string;
162
177
  approved_targets: {
@@ -164,10 +179,12 @@ export declare const gmApproveInputSchema: z.ZodObject<{
164
179
  collection_or_program: string;
165
180
  dossier_id?: string | undefined;
166
181
  }[];
182
+ title?: string | undefined;
167
183
  rejected_targets?: {
168
184
  surface: string;
169
185
  reason?: string | undefined;
170
186
  }[] | undefined;
187
+ location_label?: string | undefined;
171
188
  }>;
172
189
  export type GmApproveInput = z.infer<typeof gmApproveInputSchema>;
173
190
  export declare const GM_APPROVE_TOOL_DEF: {
@@ -226,6 +243,14 @@ export declare const GM_APPROVE_TOOL_DEF: {
226
243
  };
227
244
  description: string;
228
245
  };
246
+ title: {
247
+ type: string;
248
+ description: string;
249
+ };
250
+ location_label: {
251
+ type: string;
252
+ description: string;
253
+ };
229
254
  };
230
255
  required: string[];
231
256
  };
package/dist/tools/gm.js CHANGED
@@ -27,6 +27,36 @@ function apiErrorResult(err, toolName) {
27
27
  const msg = err instanceof Error ? err.message : String(err);
28
28
  return { content: [{ type: 'text', text: `Error: ${msg}` }], isError: true };
29
29
  }
30
+ export async function confirmPlacement(server, message) {
31
+ const inner = server.server;
32
+ if (!inner?.getClientCapabilities?.()?.elicitation)
33
+ return 'unsupported';
34
+ try {
35
+ const res = await inner.elicitInput({ message, requestedSchema: { type: 'object', properties: {} } });
36
+ return res.action === 'accept' ? 'approved' : 'declined';
37
+ }
38
+ catch {
39
+ // Fail closed: a client that advertised elicitation but could not ask is not an approval.
40
+ return 'declined';
41
+ }
42
+ }
43
+ export function placementMessage(title, locationLabel, fallback) {
44
+ const what = title ? `"${title}"` : 'this content';
45
+ return `Place ${what} in ${locationLabel || fallback}?`;
46
+ }
47
+ export function placementDeclinedResult(locationLabel) {
48
+ return {
49
+ content: [{
50
+ type: 'text',
51
+ text: `The user did not approve placing this${locationLabel ? ` in ${locationLabel}` : ''}. Nothing was placed; the content stays in the data lake. Ask the user where it should go instead.`,
52
+ }],
53
+ isError: true,
54
+ };
55
+ }
56
+ export const GM_INGEST_NEXT_STEP = 'NEXT STEP: nothing has been placed yet. Tell the user in plain language what this was classified as and propose ONE specific ' +
57
+ 'location on the surface in placement_proposal.suggested_surface (pyramid: portfolio → program → dossier; kb: a collection). ' +
58
+ 'Do not switch surfaces unless the user asks. Then stop and wait for the user to approve that location in a new message. ' +
59
+ 'The user asking to "add it to the workspace" or "you decide" is not approval of a location.';
30
60
  // ─── tacit_gm_ingest ────────────────────────────────────────────────────────
31
61
  /** Largest file `file_path` will read (10 MiB). */
32
62
  export const GM_INGEST_MAX_FILE_BYTES = 10 * 1024 * 1024;
@@ -238,7 +268,12 @@ export function buildGmIngestRequest(client, input) {
238
268
  if (input.classification_hints !== undefined)
239
269
  body['classification_hints'] = input.classification_hints;
240
270
  const result = await client.post('/api/v1/gm/ingest', body);
241
- return { content: [{ type: 'text', text: JSON.stringify(result) }] };
271
+ return {
272
+ content: [
273
+ { type: 'text', text: JSON.stringify(result) },
274
+ { type: 'text', text: GM_INGEST_NEXT_STEP },
275
+ ],
276
+ };
242
277
  }
243
278
  catch (err) {
244
279
  return apiErrorResult(err, 'tacit_gm_ingest');
@@ -265,10 +300,14 @@ export const gmApproveInputSchema = z.object({
265
300
  surface: z.string(),
266
301
  reason: z.string().optional(),
267
302
  }).strict()).optional().default([]).describe('Targets to explicitly reject'),
303
+ title: z.string().optional().describe('Content title, shown to the user in the approval prompt'),
304
+ location_label: z.string().optional().describe('Plain-language location shown to the user, e.g. "GoodOps → GoodOps Site → Research"'),
268
305
  }).strict();
269
306
  export const GM_APPROVE_TOOL_DEF = {
270
307
  name: 'tacit_gm_approve',
271
- description: 'Place an artifact created by tacit_gm_ingest in the pyramid: sets its program (and portfolio) home and, ' +
308
+ description: 'APPROVAL-TIER: call only after the user approved this specific location in their latest message; ' +
309
+ 'when the client supports it, the server also asks the user to confirm before placing. ' +
310
+ 'Place an artifact created by tacit_gm_ingest in the pyramid: sets its program (and portfolio) home and, ' +
272
311
  'if dossier_id is given, adds it to that dossier, in one transaction. Exactly one pyramid target per call. ' +
273
312
  'Does NOT place KB content; use tacit_kb_promote_from_artifact (SOP-03). ' +
274
313
  'Refuses catalog entries that are not ACTIVE and deleted artifacts. ' +
@@ -308,6 +347,8 @@ export const GM_APPROVE_TOOL_DEF = {
308
347
  },
309
348
  description: 'Targets to explicitly reject',
310
349
  },
350
+ title: { type: 'string', description: 'Content title, shown to the user in the approval prompt' },
351
+ location_label: { type: 'string', description: 'Plain-language location shown to the user, e.g. "GoodOps → GoodOps Site → Research"' },
311
352
  },
312
353
  required: ['catalog_id', 'approved_targets'],
313
354
  },
@@ -346,7 +387,11 @@ export function registerGmTools(server, getClientFn) {
346
387
  return buildGmIngestRequest(client, args).execute();
347
388
  });
348
389
  server.tool('tacit_gm_approve', GM_APPROVE_TOOL_DEF.description, gmApproveInputSchema.shape, async (args) => {
390
+ const input = args;
391
+ const ok = await confirmPlacement(server, placementMessage(input.title, input.location_label, 'the proposed workspace program and dossier'));
392
+ if (ok === 'declined')
393
+ return placementDeclinedResult(input.location_label);
349
394
  const client = await getClientFn();
350
- return buildGmApproveRequest(client, args).execute();
395
+ return buildGmApproveRequest(client, input).execute();
351
396
  });
352
397
  }
@@ -396,12 +396,18 @@ export declare function handleBrowseTree(args: unknown): Promise<{
396
396
  export declare const promoteFromArtifactInputSchema: z.ZodObject<{
397
397
  artifact_id: z.ZodString;
398
398
  collection_id: z.ZodString;
399
+ title: z.ZodOptional<z.ZodString>;
400
+ location_label: z.ZodOptional<z.ZodString>;
399
401
  }, "strip", z.ZodTypeAny, {
400
402
  artifact_id: string;
401
403
  collection_id: string;
404
+ title?: string | undefined;
405
+ location_label?: string | undefined;
402
406
  }, {
403
407
  artifact_id: string;
404
408
  collection_id: string;
409
+ title?: string | undefined;
410
+ location_label?: string | undefined;
405
411
  }>;
406
412
  export type PromoteFromArtifactInput = z.infer<typeof promoteFromArtifactInputSchema>;
407
413
  export declare const PROMOTE_FROM_ARTIFACT_TOOL_DEF: {
@@ -418,6 +424,14 @@ export declare const PROMOTE_FROM_ARTIFACT_TOOL_DEF: {
418
424
  type: string;
419
425
  description: string;
420
426
  };
427
+ title: {
428
+ type: string;
429
+ description: string;
430
+ };
431
+ location_label: {
432
+ type: string;
433
+ description: string;
434
+ };
421
435
  };
422
436
  required: string[];
423
437
  };
package/dist/tools/kb.js CHANGED
@@ -14,6 +14,7 @@
14
14
  import { z } from 'zod';
15
15
  import { getClient, TacitApiError, TokenExpiredError } from '../client.js';
16
16
  import { apiErrorResult as sharedApiErrorResult, featureDisabledResult } from './errors.js';
17
+ import { confirmPlacement, placementDeclinedResult, placementMessage } from './gm.js';
17
18
  function apiErrorResult(err, toolName) {
18
19
  if (err instanceof TokenExpiredError) {
19
20
  return {
@@ -282,7 +283,7 @@ export const createArticleInputSchema = z.object({
282
283
  });
283
284
  export const CREATE_ARTICLE_TOOL_DEF = {
284
285
  name: 'tacit_kb_create_article',
285
- description: 'For new content, prefer tacit_gm_ingest (lake-first). This tool creates a KB article directly without a data lake catalog entry. Create a new KB article within a collection. Status defaults to DRAFT.',
286
+ description: 'APPROVAL-TIER: call only after the user approved this collection in their latest message. For new content, prefer tacit_gm_ingest (lake-first). This tool creates a KB article directly without a data lake catalog entry. Create a new KB article within a collection. Status defaults to DRAFT.',
286
287
  inputSchema: {
287
288
  type: 'object',
288
289
  properties: {
@@ -416,16 +417,23 @@ export async function handleBrowseTree(args) {
416
417
  export const promoteFromArtifactInputSchema = z.object({
417
418
  artifact_id: z.string().min(1).describe('UUID of the artifact to promote into the KB'),
418
419
  collection_id: z.string().min(1).describe('UUID of an existing collection to place the promoted article in'),
420
+ title: z.string().optional().describe('Content title, shown to the user in the approval prompt'),
421
+ location_label: z.string().optional().describe('Plain-language collection name shown to the user'),
419
422
  });
420
423
  export const PROMOTE_FROM_ARTIFACT_TOOL_DEF = {
421
424
  name: 'tacit_kb_promote_from_artifact',
422
- description: 'Promote an existing artifact into a published KB article, placing it in the given collection. ' +
425
+ description: 'APPROVAL-TIER: call only after the user approved this specific collection in their latest message; ' +
426
+ 'when the client supports it, the server also asks the user to confirm before placing. ' +
427
+ 'This is the KB placement step after tacit_gm_ingest (use the artifact_id it returned). ' +
428
+ 'Promote an existing artifact into a published KB article, placing it in the given collection. ' +
423
429
  'Idempotent — re-promoting an already-promoted artifact only applies the new placement.',
424
430
  inputSchema: {
425
431
  type: 'object',
426
432
  properties: {
427
433
  artifact_id: { type: 'string', description: 'UUID of the artifact to promote' },
428
434
  collection_id: { type: 'string', description: 'UUID of an existing collection' },
435
+ title: { type: 'string', description: 'Content title, shown to the user in the approval prompt' },
436
+ location_label: { type: 'string', description: 'Plain-language collection name shown to the user' },
429
437
  },
430
438
  required: ['artifact_id', 'collection_id'],
431
439
  },
@@ -625,8 +633,12 @@ export function registerKbTools(server, getClientFn) {
625
633
  return buildBrowseTreeRequest(client, args).execute();
626
634
  });
627
635
  server.tool('tacit_kb_promote_from_artifact', PROMOTE_FROM_ARTIFACT_TOOL_DEF.description, promoteFromArtifactInputSchema.shape, async (args) => {
636
+ const input = args;
637
+ const ok = await confirmPlacement(server, placementMessage(input.title, input.location_label, 'the proposed knowledge base collection') + ' It will be published there.');
638
+ if (ok === 'declined')
639
+ return placementDeclinedResult(input.location_label);
628
640
  const client = await getClientFn();
629
- return buildPromoteFromArtifactRequest(client, args).execute();
641
+ return buildPromoteFromArtifactRequest(client, input).execute();
630
642
  });
631
643
  server.tool('tacit_kb_promote_from_catalog', PROMOTE_FROM_CATALOG_TOOL_DEF.description, promoteFromCatalogInputSchema.shape, async (args) => {
632
644
  const client = await getClientFn();
@@ -486,9 +486,9 @@ export declare const browseCatalogInputSchema: z.ZodObject<{
486
486
  origin?: string | undefined;
487
487
  q?: string | undefined;
488
488
  offset?: number | undefined;
489
+ content_type?: string | undefined;
489
490
  source_id?: string | undefined;
490
491
  catalog_status?: string | undefined;
491
- content_type?: string | undefined;
492
492
  subject_id?: string | undefined;
493
493
  subject_needs_review?: boolean | undefined;
494
494
  subject_layer?: string | undefined;
@@ -497,9 +497,9 @@ export declare const browseCatalogInputSchema: z.ZodObject<{
497
497
  origin?: string | undefined;
498
498
  q?: string | undefined;
499
499
  offset?: number | undefined;
500
+ content_type?: string | undefined;
500
501
  source_id?: string | undefined;
501
502
  catalog_status?: string | undefined;
502
- content_type?: string | undefined;
503
503
  subject_id?: string | undefined;
504
504
  subject_needs_review?: boolean | undefined;
505
505
  subject_layer?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tacitai/mcp-server",
3
- "version": "0.6.18",
3
+ "version": "0.6.20",
4
4
  "private": false,
5
5
  "description": "stdio MCP server wrapping Tacit /api/v1 REST/SSE API",
6
6
  "license": "UNLICENSED",