@tacitai/mcp-server 0.6.21 → 0.6.23
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 +9 -9
- package/dist/prompts.js +10 -10
- package/dist/tools/gm.d.ts +2 -26
- package/dist/tools/gm.js +9 -42
- package/dist/tools/kb.d.ts +0 -14
- package/dist/tools/kb.js +4 -19
- package/dist/tools/lake.d.ts +2 -2
- package/package.json +1 -2
package/dist/prompts.d.ts
CHANGED
|
@@ -20,40 +20,40 @@ 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. The response includes a placement_proposal with suggested_surface (\"kb\" or \"pyramid\") and a confidence score
|
|
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 — use this as a starting hint for step 2, but let the user choose the final 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 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.";
|
|
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. IMPORTANT: When the user picks a surface (e.g. \"pyramid\", \"KB\", \"workspace structure\"), that is a SURFACE CHOICE — it tells you which direction to explore, NOT which specific location to place it. You MUST still proceed to step 3 (drill down) and step 4 (propose specific location and wait for approval). Surface choice ≠ location approval.";
|
|
31
31
|
readonly tools: readonly [];
|
|
32
|
-
readonly signal: "User chooses: workspace structure, knowledge base, both, lake-only, or \"you decide.\"";
|
|
32
|
+
readonly signal: "User chooses: workspace structure, knowledge base, both, lake-only, or \"you decide.\" This choice triggers drill-down and a specific location proposal — it is NOT placement approval.";
|
|
33
33
|
}, {
|
|
34
34
|
readonly id: "review_structure";
|
|
35
35
|
readonly name: "Review workspace structure (MANDATORY for pyramid placement)";
|
|
36
|
-
readonly action: "You MUST call ALL
|
|
37
|
-
readonly tools: readonly ["tacit_pyramid_list_portfolios", "tacit_pyramid_list_programs", "tacit_pyramid_list_dossiers"];
|
|
38
|
-
readonly signal: "You have identified a specific portfolio → program → dossier, or determined a new dossier name is needed.";
|
|
36
|
+
readonly action: "You MUST call ALL FOUR tools in sequence — do not skip any: (1) Call tacit_pyramid_list_portfolios to see all portfolios. Pick the best fit. (2) Call tacit_pyramid_list_value_streams — if value streams exist, identify which one aligns with the content. (3) Call tacit_pyramid_list_programs with the portfolio_id. Pick the best-fit program. (4) Call tacit_pyramid_list_dossiers with that program_id. Pick the best-fit dossier. If no dossier fits, note that you will propose creating a new one. You MUST drill down to the dossier level — placing at the program level without a dossier creates an orphan.";
|
|
37
|
+
readonly tools: readonly ["tacit_pyramid_list_portfolios", "tacit_pyramid_list_value_streams", "tacit_pyramid_list_programs", "tacit_pyramid_list_dossiers"];
|
|
38
|
+
readonly signal: "You have identified a specific portfolio → value stream (if any) → program → dossier, or determined a new dossier name is needed.";
|
|
39
39
|
readonly skip_when: "User chose KB-only or lake-only.";
|
|
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.
|
|
43
|
+
readonly action: "Present a specific proposal and STOP. Do not call tacit_gm_approve yet. For pyramid, say: \"I'd file this under [portfolio] → [value stream] → [program] → [dossier] — [one sentence reason]. Should I go ahead?\" (Omit value stream only if the workspace has none.) 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 ANY of these as approval of a specific location: \"place it\", \"add it to the workspace\", \"you decide\", \"pyramid\", \"KB\", \"knowledge base\", \"workspace structure\". Those are SURFACE choices — the user still needs to see and approve the SPECIFIC portfolio → value stream → program → dossier path (or specific collection for KB) that 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_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.
|
|
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.";
|
|
50
50
|
readonly tools: readonly ["tacit_gm_approve", "tacit_kb_promote_from_artifact", "tacit_pyramid_create_dossier"];
|
|
51
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.\" 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] → [value stream] → [program] → [dossier].\" (Omit value stream only if the workspace has none.) 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
|
@@ -57,7 +57,7 @@ function buildAssistantSystemPrompt(state) {
|
|
|
57
57
|
lines.push('- For all content ingestion (adding documents, text, URLs, or files to the workspace), follow the GM Workflow below. Do not call tacit_artifact_create, tacit_import_artifact, tacit_ingest_file, tacit_ingest_url, tacit_ingest_url_general, or tacit_kb_create_article directly for new content — those bypass the data lake classification pipeline.');
|
|
58
58
|
lines.push('');
|
|
59
59
|
lines.push('### GM Workflow — Content Ingestion & Placement');
|
|
60
|
-
lines.push('When the user asks to add, save, ingest, or file content, follow these steps in order. Lake ingestion alone is NEVER "done" — always complete through to the confirm step. RULES: (1) NEVER show UUIDs, catalog IDs, artifact IDs, or SHA hashes to the user — use human-readable names only. (2) NEVER place content without explicit user approval of the specific location. (3) ALWAYS drill down to dossier level for pyramid placement — program-level placement creates orphans.');
|
|
60
|
+
lines.push('When the user asks to add, save, ingest, or file content, follow these steps in order. Lake ingestion alone is NEVER "done" — always complete through to the confirm step. RULES: (1) NEVER show UUIDs, catalog IDs, artifact IDs, or SHA hashes to the user — use human-readable names only. (2) NEVER place content without explicit user approval of the SPECIFIC location (portfolio → program → dossier for pyramid, or specific collection for KB). Choosing a surface ("pyramid", "KB") is step one; the user must ALSO approve the exact location you propose. Two approvals required: surface, then location. (3) ALWAYS drill down to dossier level for pyramid placement — program-level placement creates orphans. (4) ALWAYS call list_portfolios → list_programs → list_dossiers before proposing pyramid placement — never guess or skip the drill-down.');
|
|
61
61
|
for (const step of GM_WORKFLOW.steps) {
|
|
62
62
|
let line = `${step.id.toUpperCase()}: ${step.action}`;
|
|
63
63
|
if ('skip_when' in step && step.skip_when) {
|
|
@@ -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. The response includes a placement_proposal with suggested_surface ("kb" or "pyramid") and a confidence score
|
|
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 — use this as a starting hint for step 2, but let the user choose the final 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,29 +135,29 @@ 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 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.',
|
|
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. IMPORTANT: When the user picks a surface (e.g. "pyramid", "KB", "workspace structure"), that is a SURFACE CHOICE — it tells you which direction to explore, NOT which specific location to place it. You MUST still proceed to step 3 (drill down) and step 4 (propose specific location and wait for approval). Surface choice ≠ location approval.',
|
|
139
139
|
tools: [],
|
|
140
|
-
signal: 'User chooses: workspace structure, knowledge base, both, lake-only, or "you decide."',
|
|
140
|
+
signal: 'User chooses: workspace structure, knowledge base, both, lake-only, or "you decide." This choice triggers drill-down and a specific location proposal — it is NOT placement approval.',
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
143
|
id: 'review_structure',
|
|
144
144
|
name: 'Review workspace structure (MANDATORY for pyramid placement)',
|
|
145
|
-
action: 'You MUST call ALL
|
|
146
|
-
tools: ['tacit_pyramid_list_portfolios', 'tacit_pyramid_list_programs', 'tacit_pyramid_list_dossiers'],
|
|
147
|
-
signal: 'You have identified a specific portfolio → program → dossier, or determined a new dossier name is needed.',
|
|
145
|
+
action: 'You MUST call ALL FOUR tools in sequence — do not skip any: (1) Call tacit_pyramid_list_portfolios to see all portfolios. Pick the best fit. (2) Call tacit_pyramid_list_value_streams — if value streams exist, identify which one aligns with the content. (3) Call tacit_pyramid_list_programs with the portfolio_id. Pick the best-fit program. (4) Call tacit_pyramid_list_dossiers with that program_id. Pick the best-fit dossier. If no dossier fits, note that you will propose creating a new one. You MUST drill down to the dossier level — placing at the program level without a dossier creates an orphan.',
|
|
146
|
+
tools: ['tacit_pyramid_list_portfolios', 'tacit_pyramid_list_value_streams', 'tacit_pyramid_list_programs', 'tacit_pyramid_list_dossiers'],
|
|
147
|
+
signal: 'You have identified a specific portfolio → value stream (if any) → program → dossier, or determined a new dossier name is needed.',
|
|
148
148
|
skip_when: 'User chose KB-only or lake-only.',
|
|
149
149
|
},
|
|
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.
|
|
153
|
+
action: 'Present a specific proposal and STOP. Do not call tacit_gm_approve yet. For pyramid, say: "I\'d file this under [portfolio] → [value stream] → [program] → [dossier] — [one sentence reason]. Should I go ahead?" (Omit value stream only if the workspace has none.) 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 ANY of these as approval of a specific location: "place it", "add it to the workspace", "you decide", "pyramid", "KB", "knowledge base", "workspace structure". Those are SURFACE choices — the user still needs to see and approve the SPECIFIC portfolio → value stream → program → dossier path (or specific collection for KB) that 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_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.
|
|
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.',
|
|
161
161
|
tools: ['tacit_gm_approve', 'tacit_kb_promote_from_artifact', 'tacit_pyramid_create_dossier'],
|
|
162
162
|
signal: 'tacit_gm_approve or tacit_kb_promote_from_artifact returns success.',
|
|
163
163
|
skip_when: 'User chose lake-only.',
|
|
@@ -165,7 +165,7 @@ export const GM_WORKFLOW = {
|
|
|
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." 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] → [value stream] → [program] → [dossier]." (Omit value stream only if the workspace has none.) 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
|
},
|
package/dist/tools/gm.d.ts
CHANGED
|
@@ -18,16 +18,6 @@ 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
21
|
export declare const GM_INGEST_NEXT_STEP: string;
|
|
32
22
|
/** Largest file `file_path` will read (10 MiB). */
|
|
33
23
|
export declare const GM_INGEST_MAX_FILE_BYTES: number;
|
|
@@ -63,9 +53,9 @@ export declare const gmIngestInputSchema: z.ZodObject<{
|
|
|
63
53
|
}, "strip", z.ZodTypeAny, {
|
|
64
54
|
title: string;
|
|
65
55
|
content?: string | undefined;
|
|
66
|
-
file_path?: string | undefined;
|
|
67
56
|
source_uri?: string | undefined;
|
|
68
57
|
content_type?: string | undefined;
|
|
58
|
+
file_path?: string | undefined;
|
|
69
59
|
classification_hints?: {
|
|
70
60
|
domain?: string | undefined;
|
|
71
61
|
content_type?: string | undefined;
|
|
@@ -73,9 +63,9 @@ export declare const gmIngestInputSchema: z.ZodObject<{
|
|
|
73
63
|
}, {
|
|
74
64
|
title: string;
|
|
75
65
|
content?: string | undefined;
|
|
76
|
-
file_path?: string | undefined;
|
|
77
66
|
source_uri?: string | undefined;
|
|
78
67
|
content_type?: string | undefined;
|
|
68
|
+
file_path?: string | undefined;
|
|
79
69
|
classification_hints?: {
|
|
80
70
|
domain?: string | undefined;
|
|
81
71
|
content_type?: string | undefined;
|
|
@@ -157,8 +147,6 @@ export declare const gmApproveInputSchema: z.ZodObject<{
|
|
|
157
147
|
surface: string;
|
|
158
148
|
reason?: string | undefined;
|
|
159
149
|
}>, "many">>>;
|
|
160
|
-
title: z.ZodOptional<z.ZodString>;
|
|
161
|
-
location_label: z.ZodOptional<z.ZodString>;
|
|
162
150
|
}, "strict", z.ZodTypeAny, {
|
|
163
151
|
catalog_id: string;
|
|
164
152
|
approved_targets: {
|
|
@@ -170,8 +158,6 @@ export declare const gmApproveInputSchema: z.ZodObject<{
|
|
|
170
158
|
surface: string;
|
|
171
159
|
reason?: string | undefined;
|
|
172
160
|
}[];
|
|
173
|
-
title?: string | undefined;
|
|
174
|
-
location_label?: string | undefined;
|
|
175
161
|
}, {
|
|
176
162
|
catalog_id: string;
|
|
177
163
|
approved_targets: {
|
|
@@ -179,12 +165,10 @@ export declare const gmApproveInputSchema: z.ZodObject<{
|
|
|
179
165
|
collection_or_program: string;
|
|
180
166
|
dossier_id?: string | undefined;
|
|
181
167
|
}[];
|
|
182
|
-
title?: string | undefined;
|
|
183
168
|
rejected_targets?: {
|
|
184
169
|
surface: string;
|
|
185
170
|
reason?: string | undefined;
|
|
186
171
|
}[] | undefined;
|
|
187
|
-
location_label?: string | undefined;
|
|
188
172
|
}>;
|
|
189
173
|
export type GmApproveInput = z.infer<typeof gmApproveInputSchema>;
|
|
190
174
|
export declare const GM_APPROVE_TOOL_DEF: {
|
|
@@ -243,14 +227,6 @@ export declare const GM_APPROVE_TOOL_DEF: {
|
|
|
243
227
|
};
|
|
244
228
|
description: string;
|
|
245
229
|
};
|
|
246
|
-
title: {
|
|
247
|
-
type: string;
|
|
248
|
-
description: string;
|
|
249
|
-
};
|
|
250
|
-
location_label: {
|
|
251
|
-
type: string;
|
|
252
|
-
description: string;
|
|
253
|
-
};
|
|
254
230
|
};
|
|
255
231
|
required: string[];
|
|
256
232
|
};
|
package/dist/tools/gm.js
CHANGED
|
@@ -27,37 +27,13 @@ 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
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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. If suggested_surface is "lake", say it is saved in the data lake and ask whether ' +
|
|
59
|
-
'to file it in the workspace structure or the knowledge base; do not pick one yourself. Then stop and wait for the user to approve that location in a new message. ' +
|
|
60
|
-
'The user asking to "add it to the workspace" or "you decide" is not approval of a location.';
|
|
30
|
+
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 offer surface options ' +
|
|
31
|
+
'(workspace structure, knowledge base, both, or data lake). Lead with the suggested_surface but let the user choose. ' +
|
|
32
|
+
'If suggested_surface is "lake", say it is saved in the data lake and ask whether to file it in the workspace structure or the knowledge base; do not pick one yourself. ' +
|
|
33
|
+
'When the user picks a surface (e.g. "pyramid", "KB"), that is a SURFACE CHOICE, not a location approval. You must THEN drill down ' +
|
|
34
|
+
'(list portfolios → programs → dossiers for pyramid, or list collections for KB), propose the SPECIFIC location ' +
|
|
35
|
+
'(e.g. "I\'d file this under Product → GoodOps Site → GoodOps Site v1. Approve?"), and wait for the user to approve THAT location in a new message. ' +
|
|
36
|
+
'The user saying "add it to the workspace", "pyramid", "KB", or "you decide" is NOT approval of a specific location.';
|
|
61
37
|
// ─── tacit_gm_ingest ────────────────────────────────────────────────────────
|
|
62
38
|
/** Largest file `file_path` will read (10 MiB). */
|
|
63
39
|
export const GM_INGEST_MAX_FILE_BYTES = 10 * 1024 * 1024;
|
|
@@ -301,13 +277,10 @@ export const gmApproveInputSchema = z.object({
|
|
|
301
277
|
surface: z.string(),
|
|
302
278
|
reason: z.string().optional(),
|
|
303
279
|
}).strict()).optional().default([]).describe('Targets to explicitly reject'),
|
|
304
|
-
title: z.string().optional().describe('Content title, shown to the user in the approval prompt'),
|
|
305
|
-
location_label: z.string().optional().describe('Plain-language location shown to the user, e.g. "GoodOps → GoodOps Site → Research"'),
|
|
306
280
|
}).strict();
|
|
307
281
|
export const GM_APPROVE_TOOL_DEF = {
|
|
308
282
|
name: 'tacit_gm_approve',
|
|
309
|
-
description: 'APPROVAL-TIER: call only after the user approved this specific location in their latest message
|
|
310
|
-
'when the client supports it, the server also asks the user to confirm before placing. ' +
|
|
283
|
+
description: 'APPROVAL-TIER: call only after the user approved this specific location in their latest message. ' +
|
|
311
284
|
'Place an artifact created by tacit_gm_ingest in the pyramid: sets its program (and portfolio) home and, ' +
|
|
312
285
|
'if dossier_id is given, adds it to that dossier, in one transaction. Exactly one pyramid target per call. ' +
|
|
313
286
|
'Does NOT place KB content; use tacit_kb_promote_from_artifact (SOP-03). ' +
|
|
@@ -348,8 +321,6 @@ export const GM_APPROVE_TOOL_DEF = {
|
|
|
348
321
|
},
|
|
349
322
|
description: 'Targets to explicitly reject',
|
|
350
323
|
},
|
|
351
|
-
title: { type: 'string', description: 'Content title, shown to the user in the approval prompt' },
|
|
352
|
-
location_label: { type: 'string', description: 'Plain-language location shown to the user, e.g. "GoodOps → GoodOps Site → Research"' },
|
|
353
324
|
},
|
|
354
325
|
required: ['catalog_id', 'approved_targets'],
|
|
355
326
|
},
|
|
@@ -388,11 +359,7 @@ export function registerGmTools(server, getClientFn) {
|
|
|
388
359
|
return buildGmIngestRequest(client, args).execute();
|
|
389
360
|
});
|
|
390
361
|
server.tool('tacit_gm_approve', GM_APPROVE_TOOL_DEF.description, gmApproveInputSchema.shape, async (args) => {
|
|
391
|
-
const input = args;
|
|
392
|
-
const ok = await confirmPlacement(server, placementMessage(input.title, input.location_label, 'the proposed workspace program and dossier'));
|
|
393
|
-
if (ok === 'declined')
|
|
394
|
-
return placementDeclinedResult(input.location_label);
|
|
395
362
|
const client = await getClientFn();
|
|
396
|
-
return buildGmApproveRequest(client,
|
|
363
|
+
return buildGmApproveRequest(client, args).execute();
|
|
397
364
|
});
|
|
398
365
|
}
|
package/dist/tools/kb.d.ts
CHANGED
|
@@ -396,18 +396,12 @@ 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>;
|
|
401
399
|
}, "strip", z.ZodTypeAny, {
|
|
402
400
|
artifact_id: string;
|
|
403
401
|
collection_id: string;
|
|
404
|
-
title?: string | undefined;
|
|
405
|
-
location_label?: string | undefined;
|
|
406
402
|
}, {
|
|
407
403
|
artifact_id: string;
|
|
408
404
|
collection_id: string;
|
|
409
|
-
title?: string | undefined;
|
|
410
|
-
location_label?: string | undefined;
|
|
411
405
|
}>;
|
|
412
406
|
export type PromoteFromArtifactInput = z.infer<typeof promoteFromArtifactInputSchema>;
|
|
413
407
|
export declare const PROMOTE_FROM_ARTIFACT_TOOL_DEF: {
|
|
@@ -424,14 +418,6 @@ export declare const PROMOTE_FROM_ARTIFACT_TOOL_DEF: {
|
|
|
424
418
|
type: string;
|
|
425
419
|
description: string;
|
|
426
420
|
};
|
|
427
|
-
title: {
|
|
428
|
-
type: string;
|
|
429
|
-
description: string;
|
|
430
|
-
};
|
|
431
|
-
location_label: {
|
|
432
|
-
type: string;
|
|
433
|
-
description: string;
|
|
434
|
-
};
|
|
435
421
|
};
|
|
436
422
|
required: string[];
|
|
437
423
|
};
|
package/dist/tools/kb.js
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
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';
|
|
18
17
|
function apiErrorResult(err, toolName) {
|
|
19
18
|
if (err instanceof TokenExpiredError) {
|
|
20
19
|
return {
|
|
@@ -283,7 +282,7 @@ export const createArticleInputSchema = z.object({
|
|
|
283
282
|
});
|
|
284
283
|
export const CREATE_ARTICLE_TOOL_DEF = {
|
|
285
284
|
name: 'tacit_kb_create_article',
|
|
286
|
-
description: 'APPROVAL-TIER: call only after the user approved this
|
|
285
|
+
description: 'APPROVAL-TIER: call only after the user approved this placement. 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.',
|
|
287
286
|
inputSchema: {
|
|
288
287
|
type: 'object',
|
|
289
288
|
properties: {
|
|
@@ -417,13 +416,10 @@ export async function handleBrowseTree(args) {
|
|
|
417
416
|
export const promoteFromArtifactInputSchema = z.object({
|
|
418
417
|
artifact_id: z.string().min(1).describe('UUID of the artifact to promote into the KB'),
|
|
419
418
|
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'),
|
|
422
419
|
});
|
|
423
420
|
export const PROMOTE_FROM_ARTIFACT_TOOL_DEF = {
|
|
424
421
|
name: 'tacit_kb_promote_from_artifact',
|
|
425
|
-
description: 'APPROVAL-TIER: call only after the user approved this specific collection
|
|
426
|
-
'when the client supports it, the server also asks the user to confirm before placing. ' +
|
|
422
|
+
description: 'APPROVAL-TIER: call only after the user approved this specific collection. ' +
|
|
427
423
|
'This is the KB placement step after tacit_gm_ingest (use the artifact_id it returned). ' +
|
|
428
424
|
'Promote an existing artifact into a published KB article, placing it in the given collection. ' +
|
|
429
425
|
'Idempotent — re-promoting an already-promoted artifact only applies the new placement.',
|
|
@@ -432,8 +428,6 @@ export const PROMOTE_FROM_ARTIFACT_TOOL_DEF = {
|
|
|
432
428
|
properties: {
|
|
433
429
|
artifact_id: { type: 'string', description: 'UUID of the artifact to promote' },
|
|
434
430
|
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' },
|
|
437
431
|
},
|
|
438
432
|
required: ['artifact_id', 'collection_id'],
|
|
439
433
|
},
|
|
@@ -621,13 +615,8 @@ export function registerKbTools(server, getClientFn) {
|
|
|
621
615
|
return buildGetArticleRequest(client, args).execute();
|
|
622
616
|
});
|
|
623
617
|
server.tool('tacit_kb_create_article', CREATE_ARTICLE_TOOL_DEF.description, createArticleInputSchema.shape, async (args) => {
|
|
624
|
-
const input = args;
|
|
625
|
-
const status = input.status === 'PUBLISHED' ? ' It will be published there.' : ' It will start as a draft.';
|
|
626
|
-
const ok = await confirmPlacement(server, placementMessage(input.title, undefined, 'the chosen knowledge base collection') + status);
|
|
627
|
-
if (ok === 'declined')
|
|
628
|
-
return placementDeclinedResult(undefined);
|
|
629
618
|
const client = await getClientFn();
|
|
630
|
-
return buildCreateArticleRequest(client,
|
|
619
|
+
return buildCreateArticleRequest(client, args).execute();
|
|
631
620
|
});
|
|
632
621
|
server.tool('tacit_kb_update_article', UPDATE_ARTICLE_TOOL_DEF.description, updateArticleInputSchema.shape, async (args) => {
|
|
633
622
|
const client = await getClientFn();
|
|
@@ -638,12 +627,8 @@ export function registerKbTools(server, getClientFn) {
|
|
|
638
627
|
return buildBrowseTreeRequest(client, args).execute();
|
|
639
628
|
});
|
|
640
629
|
server.tool('tacit_kb_promote_from_artifact', PROMOTE_FROM_ARTIFACT_TOOL_DEF.description, promoteFromArtifactInputSchema.shape, async (args) => {
|
|
641
|
-
const input = args;
|
|
642
|
-
const ok = await confirmPlacement(server, placementMessage(input.title, input.location_label, 'the proposed knowledge base collection') + ' It will be published there.');
|
|
643
|
-
if (ok === 'declined')
|
|
644
|
-
return placementDeclinedResult(input.location_label);
|
|
645
630
|
const client = await getClientFn();
|
|
646
|
-
return buildPromoteFromArtifactRequest(client,
|
|
631
|
+
return buildPromoteFromArtifactRequest(client, args).execute();
|
|
647
632
|
});
|
|
648
633
|
server.tool('tacit_kb_promote_from_catalog', PROMOTE_FROM_CATALOG_TOOL_DEF.description, promoteFromCatalogInputSchema.shape, async (args) => {
|
|
649
634
|
const client = await getClientFn();
|
package/dist/tools/lake.d.ts
CHANGED
|
@@ -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;
|
|
490
489
|
source_id?: string | undefined;
|
|
491
490
|
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;
|
|
501
500
|
source_id?: string | undefined;
|
|
502
501
|
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;
|