@tacitai/mcp-server 0.6.22 → 0.6.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +8 -3
- package/dist/prompts.d.ts +10 -10
- package/dist/prompts.js +11 -11
- package/dist/tools/gm.d.ts +26 -1
- package/dist/tools/gm.js +193 -9
- package/dist/tools/kb.d.ts +10 -1
- package/dist/tools/kb.js +94 -8
- package/dist/tools/pyramid.d.ts +2 -1
- package/dist/tools/pyramid.js +27 -6
- package/dist/tools/registry.d.ts +1 -1
- package/dist/tools/registry.js +5 -3
- package/dist/workflow-gate.d.ts +119 -0
- package/dist/workflow-gate.js +250 -0
- package/package.json +5 -3
package/dist/index.js
CHANGED
|
@@ -64,6 +64,11 @@ import { registerPrompts } from './prompts.js';
|
|
|
64
64
|
import { getRequestPrincipal } from './client.js';
|
|
65
65
|
// Setup wizard (MV-1057h / W5)
|
|
66
66
|
import { setup, profileToEnvVar } from './setup.js';
|
|
67
|
+
import { WorkflowGate } from './workflow-gate.js';
|
|
68
|
+
// FEAT-249: one WorkflowGate per server process — GM placement workflow state keyed
|
|
69
|
+
// by request principal (stdio shares the single '__stdio__' slot). Never store gate
|
|
70
|
+
// state inside the per-request AsyncLocalStorage context; see workflow-gate.ts.
|
|
71
|
+
const gate = new WorkflowGate();
|
|
67
72
|
// ─── ESM __dirname replacement ───────────────────────────────────────────────
|
|
68
73
|
const __filename = fileURLToPath(import.meta.url);
|
|
69
74
|
const __dirname = path.dirname(__filename);
|
|
@@ -168,9 +173,9 @@ async function run() {
|
|
|
168
173
|
registerExportTools(server, getClient);
|
|
169
174
|
registerMoveTools(server, getClient);
|
|
170
175
|
registerAgentTools(server, getClient);
|
|
171
|
-
registerPyramidTools(server, getClient);
|
|
176
|
+
registerPyramidTools(server, getClient, gate);
|
|
172
177
|
registerSharingTools(server, getClient);
|
|
173
|
-
registerKbTools(server, getClient);
|
|
178
|
+
registerKbTools(server, getClient, gate);
|
|
174
179
|
registerLakeTools(server, getClient);
|
|
175
180
|
registerGithubTools(server, getClient);
|
|
176
181
|
registerWebUrlTools(server);
|
|
@@ -179,7 +184,7 @@ async function run() {
|
|
|
179
184
|
registerCrewTools(server, getClient);
|
|
180
185
|
registerPeopleTools(server, getClient);
|
|
181
186
|
registerLakeStructureTools(server, getClient);
|
|
182
|
-
registerGmTools(server, getClient);
|
|
187
|
+
registerGmTools(server, getClient, gate);
|
|
183
188
|
registerResearchTools(server, getClient, getRequestPrincipal);
|
|
184
189
|
registerSkillTools(server, getClient);
|
|
185
190
|
registerWikiTools(server, getClient);
|
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 — use this as a starting hint for step 2, but let the user choose the final surface.";
|
|
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. When the user wants the content placed on two surfaces (pyramid AND KB), set cross_reference: true on tacit_gm_ingest — the first placement cycle then chains into a second automatically. 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. If the user changes their mind about the surface mid-flow, call tacit_gm_reset and offer the surfaces again.";
|
|
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.";
|
|
39
|
-
readonly skip_when: "User chose
|
|
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. For a KB surface: call tacit_kb_list_collections and pick the best-fit collection.";
|
|
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
|
+
readonly skip_when: "User chose 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 as a draft article you can publish anytime. 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
|
|
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, the collection UUID, and status \"DRAFT\" — the article lands as a draft the user can publish anytime (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 — use this as a starting hint for step 2, but let the user choose the final surface.',
|
|
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. When the user wants the content placed on two surfaces (pyramid AND KB), set cross_reference: true on tacit_gm_ingest — the first placement cycle then chains into a second automatically. 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. If the user changes their mind about the surface mid-flow, call tacit_gm_reset and offer the surfaces again.',
|
|
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.',
|
|
148
|
-
skip_when: 'User chose
|
|
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. For a KB surface: call tacit_kb_list_collections and pick the best-fit collection.',
|
|
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
|
+
skip_when: 'User chose 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 as a draft article you can publish anytime. 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
|
|
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, the collection UUID, and status "DRAFT" — the article lands as a draft the user can publish anytime (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
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import { z } from 'zod';
|
|
10
10
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
11
11
|
import { TacitClient } from '../client.js';
|
|
12
|
+
import { WorkflowGate } from '../workflow-gate.js';
|
|
12
13
|
export interface ToolRequest {
|
|
13
14
|
execute(): Promise<{
|
|
14
15
|
content: Array<{
|
|
@@ -50,6 +51,7 @@ export declare const gmIngestInputSchema: z.ZodObject<{
|
|
|
50
51
|
domain?: string | undefined;
|
|
51
52
|
content_type?: string | undefined;
|
|
52
53
|
}>>;
|
|
54
|
+
cross_reference: z.ZodOptional<z.ZodBoolean>;
|
|
53
55
|
}, "strip", z.ZodTypeAny, {
|
|
54
56
|
title: string;
|
|
55
57
|
content?: string | undefined;
|
|
@@ -60,6 +62,7 @@ export declare const gmIngestInputSchema: z.ZodObject<{
|
|
|
60
62
|
domain?: string | undefined;
|
|
61
63
|
content_type?: string | undefined;
|
|
62
64
|
} | undefined;
|
|
65
|
+
cross_reference?: boolean | undefined;
|
|
63
66
|
}, {
|
|
64
67
|
title: string;
|
|
65
68
|
content?: string | undefined;
|
|
@@ -70,6 +73,7 @@ export declare const gmIngestInputSchema: z.ZodObject<{
|
|
|
70
73
|
domain?: string | undefined;
|
|
71
74
|
content_type?: string | undefined;
|
|
72
75
|
} | undefined;
|
|
76
|
+
cross_reference?: boolean | undefined;
|
|
73
77
|
}>;
|
|
74
78
|
export type GmIngestInput = z.infer<typeof gmIngestInputSchema>;
|
|
75
79
|
export declare const GM_INGEST_TOOL_DEF: {
|
|
@@ -110,6 +114,10 @@ export declare const GM_INGEST_TOOL_DEF: {
|
|
|
110
114
|
};
|
|
111
115
|
description: string;
|
|
112
116
|
};
|
|
117
|
+
cross_reference: {
|
|
118
|
+
type: string;
|
|
119
|
+
description: string;
|
|
120
|
+
};
|
|
113
121
|
};
|
|
114
122
|
required: string[];
|
|
115
123
|
};
|
|
@@ -147,6 +155,7 @@ export declare const gmApproveInputSchema: z.ZodObject<{
|
|
|
147
155
|
surface: string;
|
|
148
156
|
reason?: string | undefined;
|
|
149
157
|
}>, "many">>>;
|
|
158
|
+
target_path: z.ZodOptional<z.ZodString>;
|
|
150
159
|
}, "strict", z.ZodTypeAny, {
|
|
151
160
|
catalog_id: string;
|
|
152
161
|
approved_targets: {
|
|
@@ -158,6 +167,7 @@ export declare const gmApproveInputSchema: z.ZodObject<{
|
|
|
158
167
|
surface: string;
|
|
159
168
|
reason?: string | undefined;
|
|
160
169
|
}[];
|
|
170
|
+
target_path?: string | undefined;
|
|
161
171
|
}, {
|
|
162
172
|
catalog_id: string;
|
|
163
173
|
approved_targets: {
|
|
@@ -169,6 +179,7 @@ export declare const gmApproveInputSchema: z.ZodObject<{
|
|
|
169
179
|
surface: string;
|
|
170
180
|
reason?: string | undefined;
|
|
171
181
|
}[] | undefined;
|
|
182
|
+
target_path?: string | undefined;
|
|
172
183
|
}>;
|
|
173
184
|
export type GmApproveInput = z.infer<typeof gmApproveInputSchema>;
|
|
174
185
|
export declare const GM_APPROVE_TOOL_DEF: {
|
|
@@ -227,6 +238,10 @@ export declare const GM_APPROVE_TOOL_DEF: {
|
|
|
227
238
|
};
|
|
228
239
|
description: string;
|
|
229
240
|
};
|
|
241
|
+
target_path: {
|
|
242
|
+
type: string;
|
|
243
|
+
description: string;
|
|
244
|
+
};
|
|
230
245
|
};
|
|
231
246
|
required: string[];
|
|
232
247
|
};
|
|
@@ -239,5 +254,15 @@ export declare function handleGmApprove(args: unknown): Promise<{
|
|
|
239
254
|
}>;
|
|
240
255
|
isError?: boolean;
|
|
241
256
|
}>;
|
|
242
|
-
export declare
|
|
257
|
+
export declare const gmResetInputSchema: z.ZodObject<{}, "strict", z.ZodTypeAny, {}, {}>;
|
|
258
|
+
export declare const GM_RESET_TOOL_DEF: {
|
|
259
|
+
name: "tacit_gm_reset";
|
|
260
|
+
description: string;
|
|
261
|
+
inputSchema: {
|
|
262
|
+
type: "object";
|
|
263
|
+
properties: {};
|
|
264
|
+
required: string[];
|
|
265
|
+
};
|
|
266
|
+
};
|
|
267
|
+
export declare function registerGmTools(server: McpServer, getClientFn: () => Promise<TacitClient>, gate: WorkflowGate): void;
|
|
243
268
|
export {};
|
package/dist/tools/gm.js
CHANGED
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
import * as fs from 'fs';
|
|
10
10
|
import * as path from 'path';
|
|
11
11
|
import { z } from 'zod';
|
|
12
|
-
import { TacitClient, TacitApiError, TokenExpiredError } from '../client.js';
|
|
12
|
+
import { TacitClient, TacitApiError, TokenExpiredError, getRequestPrincipal } from '../client.js';
|
|
13
13
|
import { featureDisabledResult } from './errors.js';
|
|
14
|
+
import { GM_APPROVE_NEXT_STEP } from '../workflow-gate.js';
|
|
14
15
|
function apiErrorResult(err, toolName) {
|
|
15
16
|
if (err instanceof TokenExpiredError) {
|
|
16
17
|
return {
|
|
@@ -27,11 +28,13 @@ function apiErrorResult(err, toolName) {
|
|
|
27
28
|
const msg = err instanceof Error ? err.message : String(err);
|
|
28
29
|
return { content: [{ type: 'text', text: `Error: ${msg}` }], isError: true };
|
|
29
30
|
}
|
|
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
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
34
|
-
'
|
|
31
|
+
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 ' +
|
|
32
|
+
'(workspace structure, knowledge base, both, or data lake). Lead with the suggested_surface but let the user choose. ' +
|
|
33
|
+
'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. ' +
|
|
34
|
+
'When the user picks a surface (e.g. "pyramid", "KB"), that is a SURFACE CHOICE, not a location approval. You must THEN drill down ' +
|
|
35
|
+
'(list portfolios → programs → dossiers for pyramid, or list collections for KB), propose the SPECIFIC location ' +
|
|
36
|
+
'(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. ' +
|
|
37
|
+
'The user saying "add it to the workspace", "pyramid", "KB", or "you decide" is NOT approval of a specific location.';
|
|
35
38
|
// ─── tacit_gm_ingest ────────────────────────────────────────────────────────
|
|
36
39
|
/** Largest file `file_path` will read (10 MiB). */
|
|
37
40
|
export const GM_INGEST_MAX_FILE_BYTES = 10 * 1024 * 1024;
|
|
@@ -179,6 +182,7 @@ export const gmIngestInputSchema = z.object({
|
|
|
179
182
|
domain: z.string().optional(),
|
|
180
183
|
content_type: z.string().optional(),
|
|
181
184
|
}).optional().describe('Optional hints for the classifier'),
|
|
185
|
+
cross_reference: z.boolean().optional().describe('Set true when the user wants the content placed on two surfaces (pyramid AND KB) — chains a second placement cycle after the first completes'),
|
|
182
186
|
});
|
|
183
187
|
export const GM_INGEST_TOOL_DEF = {
|
|
184
188
|
name: 'tacit_gm_ingest',
|
|
@@ -205,6 +209,10 @@ export const GM_INGEST_TOOL_DEF = {
|
|
|
205
209
|
},
|
|
206
210
|
description: 'Optional hints for the classifier',
|
|
207
211
|
},
|
|
212
|
+
cross_reference: {
|
|
213
|
+
type: 'boolean',
|
|
214
|
+
description: 'Set true when the user wants the content placed on two surfaces (pyramid AND KB) — chains a second placement cycle after the first completes',
|
|
215
|
+
},
|
|
208
216
|
},
|
|
209
217
|
required: ['title'],
|
|
210
218
|
},
|
|
@@ -242,6 +250,8 @@ export function buildGmIngestRequest(client, input) {
|
|
|
242
250
|
body['content_type'] = input.content_type;
|
|
243
251
|
if (input.classification_hints !== undefined)
|
|
244
252
|
body['classification_hints'] = input.classification_hints;
|
|
253
|
+
// cross_reference is deliberately NOT sent: it is an MCP-layer workflow flag
|
|
254
|
+
// (FEAT-249) consumed by the WorkflowGate in registerGmTools, not a backend field.
|
|
245
255
|
const result = await client.post('/api/v1/gm/ingest', body);
|
|
246
256
|
return {
|
|
247
257
|
content: [
|
|
@@ -275,6 +285,7 @@ export const gmApproveInputSchema = z.object({
|
|
|
275
285
|
surface: z.string(),
|
|
276
286
|
reason: z.string().optional(),
|
|
277
287
|
}).strict()).optional().default([]).describe('Targets to explicitly reject'),
|
|
288
|
+
target_path: z.string().min(1).optional().describe('Fast-track: named portfolio/value-stream/program/dossier (name or UUID) whose existence the server validates in place of the drill-down'),
|
|
278
289
|
}).strict();
|
|
279
290
|
export const GM_APPROVE_TOOL_DEF = {
|
|
280
291
|
name: 'tacit_gm_approve',
|
|
@@ -282,6 +293,8 @@ export const GM_APPROVE_TOOL_DEF = {
|
|
|
282
293
|
'Place an artifact created by tacit_gm_ingest in the pyramid: sets its program (and portfolio) home and, ' +
|
|
283
294
|
'if dossier_id is given, adds it to that dossier, in one transaction. Exactly one pyramid target per call. ' +
|
|
284
295
|
'Does NOT place KB content; use tacit_kb_promote_from_artifact (SOP-03). ' +
|
|
296
|
+
'Optionally pass target_path (a named portfolio/value-stream/program/dossier) to fast-track: the server validates ' +
|
|
297
|
+
'it in place of the four pyramid list-tool drill-down calls. ' +
|
|
285
298
|
'Refuses catalog entries that are not ACTIVE and deleted artifacts. ' +
|
|
286
299
|
'Repeat calls are idempotent for placement and record one PlacementApproved event each. ' +
|
|
287
300
|
'Route: POST /api/v1/gm/approve.',
|
|
@@ -319,6 +332,10 @@ export const GM_APPROVE_TOOL_DEF = {
|
|
|
319
332
|
},
|
|
320
333
|
description: 'Targets to explicitly reject',
|
|
321
334
|
},
|
|
335
|
+
target_path: {
|
|
336
|
+
type: 'string',
|
|
337
|
+
description: 'Fast-track: named portfolio/value-stream/program/dossier (name or UUID) whose existence the server validates in place of the drill-down',
|
|
338
|
+
},
|
|
322
339
|
},
|
|
323
340
|
required: ['catalog_id', 'approved_targets'],
|
|
324
341
|
},
|
|
@@ -350,14 +367,181 @@ export async function handleGmApprove(args) {
|
|
|
350
367
|
}
|
|
351
368
|
return buildGmApproveRequest(new TacitClient(), parsed.data).execute();
|
|
352
369
|
}
|
|
370
|
+
/** List endpoints return either a bare array or a wrapped object; accept both. */
|
|
371
|
+
function asRowArray(res) {
|
|
372
|
+
if (Array.isArray(res))
|
|
373
|
+
return res;
|
|
374
|
+
if (res && typeof res === 'object') {
|
|
375
|
+
for (const key of ['items', 'data', 'portfolios', 'programs', 'dossiers', 'value_streams']) {
|
|
376
|
+
const v = res[key];
|
|
377
|
+
if (Array.isArray(v))
|
|
378
|
+
return v;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
return [];
|
|
382
|
+
}
|
|
383
|
+
function collectTargetKeys(res, keys) {
|
|
384
|
+
for (const row of asRowArray(res)) {
|
|
385
|
+
for (const field of ['id', 'portfolio_id', 'program_id', 'value_stream_id', 'dossier_id', 'collection_id', 'name', 'display_name']) {
|
|
386
|
+
const v = row[field];
|
|
387
|
+
if (typeof v === 'string' && v)
|
|
388
|
+
keys.add(v.toLowerCase());
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Variation C fast-track: validate a named target against the SAME endpoints the four
|
|
394
|
+
* pyramid list tools wrap (GET /portfolios, /alignment/value-streams, /dossiers, and
|
|
395
|
+
* /portfolios/:id/programs — no new backend endpoint). Every path segment (split on
|
|
396
|
+
* →, ->, >, or /) must match an existing portfolio, value stream, program, or dossier —
|
|
397
|
+
* UUID exact or name case-insensitive, at any level.
|
|
398
|
+
*/
|
|
399
|
+
async function validateFastTrackTarget(client, targetPath) {
|
|
400
|
+
const segments = targetPath.split(/\s*(?:→|->|>|\/)\s*/).map((s) => s.trim()).filter(Boolean);
|
|
401
|
+
if (segments.length === 0)
|
|
402
|
+
return { ok: false, reason: 'it contains no target segments' };
|
|
403
|
+
const portfolios = await client.get('/api/v1/portfolios');
|
|
404
|
+
const [valueStreams, dossiers] = await Promise.all([
|
|
405
|
+
client.get('/api/v1/alignment/value-streams'),
|
|
406
|
+
client.get('/api/v1/dossiers'),
|
|
407
|
+
]);
|
|
408
|
+
const known = new Set();
|
|
409
|
+
collectTargetKeys(portfolios, known);
|
|
410
|
+
collectTargetKeys(valueStreams, known);
|
|
411
|
+
collectTargetKeys(dossiers, known);
|
|
412
|
+
// Programs are scoped per portfolio — enumerate under each portfolio like the list tool does.
|
|
413
|
+
for (const p of asRowArray(portfolios)) {
|
|
414
|
+
// Real API returns portfolio_id (E2E catch: p['id'] alone left pid undefined and
|
|
415
|
+
// the programs enumeration never ran — program fast-tracks always failed).
|
|
416
|
+
const pid = p['id'] ?? p['portfolio_id'];
|
|
417
|
+
if (typeof pid === 'string') {
|
|
418
|
+
collectTargetKeys(await client.get(`/api/v1/portfolios/${pid}/programs`), known);
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
for (const seg of segments) {
|
|
422
|
+
if (!known.has(seg.toLowerCase())) {
|
|
423
|
+
return { ok: false, reason: `no portfolio, value stream, program, or dossier matching "${sanitizeEcho(seg)}" exists` };
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return { ok: true };
|
|
427
|
+
}
|
|
428
|
+
/**
|
|
429
|
+
* Caller-controlled text echoed into tool results: truncate and strip control
|
|
430
|
+
* characters so a crafted target_path cannot smuggle newlines/escapes into the
|
|
431
|
+
* consuming LLM's context (sec audit LOW — prompt-injection echo surface).
|
|
432
|
+
*/
|
|
433
|
+
function sanitizeEcho(value, max = 200) {
|
|
434
|
+
const cleaned = value.replace(/[\u0000-\u001f\u007f]+/g, ' ').trim();
|
|
435
|
+
return cleaned.length > max ? cleaned.slice(0, max) + '\u2026' : cleaned;
|
|
436
|
+
}
|
|
353
437
|
// ─── Registration ───────────────────────────────────────────────────────────
|
|
354
|
-
export
|
|
438
|
+
export const gmResetInputSchema = z.object({}).strict();
|
|
439
|
+
export const GM_RESET_TOOL_DEF = {
|
|
440
|
+
name: 'tacit_gm_reset',
|
|
441
|
+
description: 'Reset the GM placement workflow: clears the recorded drill-down calls and returns the workflow to the surface-choice step ' +
|
|
442
|
+
'with the same catalog entry and artifact. Use when the user changes their mind about the surface mid-flow — ' +
|
|
443
|
+
"after a reset, offer the surfaces again and run the new surface's drill-down from scratch.",
|
|
444
|
+
inputSchema: {
|
|
445
|
+
type: 'object',
|
|
446
|
+
properties: {},
|
|
447
|
+
required: [],
|
|
448
|
+
},
|
|
449
|
+
};
|
|
450
|
+
export function registerGmTools(server, getClientFn, gate) {
|
|
355
451
|
server.tool('tacit_gm_ingest', GM_INGEST_TOOL_DEF.description, gmIngestInputSchema.shape, async (args) => {
|
|
356
452
|
const client = await getClientFn();
|
|
357
|
-
|
|
453
|
+
const input = args;
|
|
454
|
+
const res = await buildGmIngestRequest(client, input).execute();
|
|
455
|
+
if (!res.isError) {
|
|
456
|
+
// FEAT-249: arm (or supersede) the GM workflow from the ingest response.
|
|
457
|
+
// cross_reference is an MCP-layer flag — it never reaches the backend POST.
|
|
458
|
+
const principal = getRequestPrincipal();
|
|
459
|
+
try {
|
|
460
|
+
const payload = JSON.parse(res.content[0].text);
|
|
461
|
+
const artifactId = payload['artifact_id'];
|
|
462
|
+
const catalogId = payload['catalog_id'];
|
|
463
|
+
if (typeof artifactId === 'string' && typeof catalogId === 'string') {
|
|
464
|
+
gate.startWorkflow(principal, { artifactId, catalogId, crossReference: input.cross_reference === true });
|
|
465
|
+
}
|
|
466
|
+
else {
|
|
467
|
+
process.stderr.write('[tacit_gm_ingest] GM workflow not armed: ingest response is missing artifact_id/catalog_id\n');
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
catch {
|
|
471
|
+
process.stderr.write('[tacit_gm_ingest] GM workflow not armed: could not parse ingest response\n');
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
return res;
|
|
358
475
|
});
|
|
359
476
|
server.tool('tacit_gm_approve', GM_APPROVE_TOOL_DEF.description, gmApproveInputSchema.shape, async (args) => {
|
|
477
|
+
const parsed = gmApproveInputSchema.safeParse(args);
|
|
478
|
+
if (!parsed.success) {
|
|
479
|
+
return { content: [{ type: 'text', text: `Invalid input: ${parsed.error.message}` }], isError: true };
|
|
480
|
+
}
|
|
481
|
+
const input = parsed.data;
|
|
482
|
+
const principal = getRequestPrincipal();
|
|
483
|
+
// Fast-track (Variation C): a server-validated target_path stands in for the
|
|
484
|
+
// drill-down — only consulted when the call log does not already satisfy it.
|
|
485
|
+
if (input.target_path !== undefined && !gate.checkPyramidApprove(principal).allowed) {
|
|
486
|
+
const client = await getClientFn();
|
|
487
|
+
let validation;
|
|
488
|
+
try {
|
|
489
|
+
validation = await validateFastTrackTarget(client, input.target_path);
|
|
490
|
+
}
|
|
491
|
+
catch {
|
|
492
|
+
// Infra failure during validation surfaces as the structured drill-down
|
|
493
|
+
// rejection, not an uncaught SDK-level protocol error.
|
|
494
|
+
validation = { ok: false, reason: 'fast-track validation could not reach the pyramid endpoints — run the drill-down instead' };
|
|
495
|
+
}
|
|
496
|
+
if (!validation.ok) {
|
|
497
|
+
return {
|
|
498
|
+
content: [{
|
|
499
|
+
type: 'text',
|
|
500
|
+
text: `tacit_gm_approve rejected: target_path "${sanitizeEcho(input.target_path)}" is not validated — ${validation.reason}. ` +
|
|
501
|
+
'No placement was attempted. Run the pyramid drill-down (tacit_pyramid_list_portfolios, ' +
|
|
502
|
+
'tacit_pyramid_list_value_streams, tacit_pyramid_list_programs, tacit_pyramid_list_dossiers) ' +
|
|
503
|
+
'or correct the target name.',
|
|
504
|
+
}],
|
|
505
|
+
isError: true,
|
|
506
|
+
};
|
|
507
|
+
}
|
|
508
|
+
gate.markFastTrackValidated(principal);
|
|
509
|
+
}
|
|
510
|
+
const verdict = gate.checkPyramidApprove(principal);
|
|
511
|
+
if (!verdict.allowed) {
|
|
512
|
+
return {
|
|
513
|
+
content: [{ type: 'text', text: verdict.message ?? 'tacit_gm_approve rejected: drill-down prerequisite not met.' }],
|
|
514
|
+
isError: true,
|
|
515
|
+
};
|
|
516
|
+
}
|
|
360
517
|
const client = await getClientFn();
|
|
361
|
-
|
|
518
|
+
const res = await buildGmApproveRequest(client, input).execute();
|
|
519
|
+
if (!res.isError) {
|
|
520
|
+
// Snapshot BEFORE completing: the cross-reference banner depends on the
|
|
521
|
+
// pre-completion placementsRemaining.
|
|
522
|
+
const before = gate.getWorkflow(principal);
|
|
523
|
+
// Idempotency key: an identical retry of an already-counted approve must not
|
|
524
|
+
// consume a second placement slot (the backend approve is idempotent).
|
|
525
|
+
gate.completePlacement(principal, `py:${input.catalog_id}:${JSON.stringify(input.approved_targets)}`);
|
|
526
|
+
if (before?.active && before.crossReference && before.placementsRemaining > 1) {
|
|
527
|
+
res.content.push({ type: 'text', text: GM_APPROVE_NEXT_STEP });
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
return res;
|
|
531
|
+
});
|
|
532
|
+
server.tool('tacit_gm_reset', GM_RESET_TOOL_DEF.description, gmResetInputSchema.shape, async () => {
|
|
533
|
+
const principal = getRequestPrincipal();
|
|
534
|
+
const snapshot = gate.resetWorkflow(principal);
|
|
535
|
+
const rearm = snapshot.active
|
|
536
|
+
? 'The workflow is rearmed with the same catalog entry and artifact.'
|
|
537
|
+
: 'No GM workflow exists to rearm — start with tacit_gm_ingest.';
|
|
538
|
+
return {
|
|
539
|
+
content: [{
|
|
540
|
+
type: 'text',
|
|
541
|
+
text: `GM workflow reset: the recorded drill-down is cleared. ${rearm} Surface choice starts over — offer the surfaces ` +
|
|
542
|
+
'(workspace structure, knowledge base, both, or data lake) again and run the chosen surface\'s drill-down ' +
|
|
543
|
+
'from scratch before proposing a location.',
|
|
544
|
+
}],
|
|
545
|
+
};
|
|
362
546
|
});
|
|
363
547
|
}
|
package/dist/tools/kb.d.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
import { z } from 'zod';
|
|
15
15
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
16
16
|
import { TacitClient } from '../client.js';
|
|
17
|
+
import { WorkflowGate } from '../workflow-gate.js';
|
|
17
18
|
export interface ToolRequest {
|
|
18
19
|
execute(): Promise<{
|
|
19
20
|
content: Array<{
|
|
@@ -396,12 +397,15 @@ export declare function handleBrowseTree(args: unknown): Promise<{
|
|
|
396
397
|
export declare const promoteFromArtifactInputSchema: z.ZodObject<{
|
|
397
398
|
artifact_id: z.ZodString;
|
|
398
399
|
collection_id: z.ZodString;
|
|
400
|
+
status: z.ZodOptional<z.ZodEnum<["DRAFT", "PUBLISHED"]>>;
|
|
399
401
|
}, "strip", z.ZodTypeAny, {
|
|
400
402
|
artifact_id: string;
|
|
401
403
|
collection_id: string;
|
|
404
|
+
status?: "DRAFT" | "PUBLISHED" | undefined;
|
|
402
405
|
}, {
|
|
403
406
|
artifact_id: string;
|
|
404
407
|
collection_id: string;
|
|
408
|
+
status?: "DRAFT" | "PUBLISHED" | undefined;
|
|
405
409
|
}>;
|
|
406
410
|
export type PromoteFromArtifactInput = z.infer<typeof promoteFromArtifactInputSchema>;
|
|
407
411
|
export declare const PROMOTE_FROM_ARTIFACT_TOOL_DEF: {
|
|
@@ -418,6 +422,11 @@ export declare const PROMOTE_FROM_ARTIFACT_TOOL_DEF: {
|
|
|
418
422
|
type: string;
|
|
419
423
|
description: string;
|
|
420
424
|
};
|
|
425
|
+
status: {
|
|
426
|
+
type: string;
|
|
427
|
+
enum: string[];
|
|
428
|
+
description: string;
|
|
429
|
+
};
|
|
421
430
|
};
|
|
422
431
|
required: string[];
|
|
423
432
|
};
|
|
@@ -541,4 +550,4 @@ export declare function handleCreateCategory(args: unknown): Promise<{
|
|
|
541
550
|
}>;
|
|
542
551
|
isError?: boolean;
|
|
543
552
|
}>;
|
|
544
|
-
export declare function registerKbTools(server: McpServer, getClientFn: () => Promise<TacitClient
|
|
553
|
+
export declare function registerKbTools(server: McpServer, getClientFn: () => Promise<TacitClient>, gate: WorkflowGate): void;
|
package/dist/tools/kb.js
CHANGED
|
@@ -12,8 +12,9 @@
|
|
|
12
12
|
* GET/POST /knowledge/categories
|
|
13
13
|
*/
|
|
14
14
|
import { z } from 'zod';
|
|
15
|
-
import { getClient, TacitApiError, TokenExpiredError } from '../client.js';
|
|
15
|
+
import { getClient, getRequestPrincipal, TacitApiError, TokenExpiredError } from '../client.js';
|
|
16
16
|
import { apiErrorResult as sharedApiErrorResult, featureDisabledResult } from './errors.js';
|
|
17
|
+
import { GM_LIST_TOOL_NEXT_STEP } from '../workflow-gate.js';
|
|
17
18
|
function apiErrorResult(err, toolName) {
|
|
18
19
|
if (err instanceof TokenExpiredError) {
|
|
19
20
|
return {
|
|
@@ -416,18 +417,22 @@ 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
|
+
status: z.enum(['DRAFT', 'PUBLISHED']).optional().describe('GM-workflow placement passes DRAFT (the article lands as a draft); standalone promotion defaults to PUBLISHED and is itself the publish action'),
|
|
419
421
|
});
|
|
420
422
|
export const PROMOTE_FROM_ARTIFACT_TOOL_DEF = {
|
|
421
423
|
name: 'tacit_kb_promote_from_artifact',
|
|
422
424
|
description: 'APPROVAL-TIER: call only after the user approved this specific collection. ' +
|
|
423
425
|
'This is the KB placement step after tacit_gm_ingest (use the artifact_id it returned). ' +
|
|
424
|
-
'Promote an existing artifact into a
|
|
426
|
+
'Promote an existing artifact into a KB article, placing it in the given collection. ' +
|
|
427
|
+
'Through a GM workflow pass status "DRAFT" (the article lands as a draft the user can publish anytime); ' +
|
|
428
|
+
'standalone promotion defaults to PUBLISHED and is itself the publish action. ' +
|
|
425
429
|
'Idempotent — re-promoting an already-promoted artifact only applies the new placement.',
|
|
426
430
|
inputSchema: {
|
|
427
431
|
type: 'object',
|
|
428
432
|
properties: {
|
|
429
433
|
artifact_id: { type: 'string', description: 'UUID of the artifact to promote' },
|
|
430
434
|
collection_id: { type: 'string', description: 'UUID of an existing collection' },
|
|
435
|
+
status: { type: 'string', enum: ['DRAFT', 'PUBLISHED'], description: 'DRAFT for GM-workflow placement; standalone defaults to PUBLISHED' },
|
|
431
436
|
},
|
|
432
437
|
required: ['artifact_id', 'collection_id'],
|
|
433
438
|
},
|
|
@@ -441,6 +446,10 @@ export function buildPromoteFromArtifactRequest(client, input) {
|
|
|
441
446
|
kb: { collections: [input.collection_id] },
|
|
442
447
|
},
|
|
443
448
|
};
|
|
449
|
+
// Top-level status, included only when set: absent means the backend's own
|
|
450
|
+
// default (published) — standalone promotion IS the publish action.
|
|
451
|
+
if (input.status !== undefined)
|
|
452
|
+
body['status'] = input.status;
|
|
444
453
|
const result = await client.post(`/api/v1/knowledge/articles/from-artifact/${input.artifact_id}`, body);
|
|
445
454
|
return { content: [{ type: 'text', text: JSON.stringify(result) }] };
|
|
446
455
|
}
|
|
@@ -464,9 +473,12 @@ export const promoteFromCatalogInputSchema = z.object({
|
|
|
464
473
|
});
|
|
465
474
|
export const PROMOTE_FROM_CATALOG_TOOL_DEF = {
|
|
466
475
|
name: 'tacit_kb_promote_from_catalog',
|
|
467
|
-
description: 'Promote a data lake catalog item into a
|
|
476
|
+
description: 'Promote a data lake catalog item into a KB article. ' +
|
|
468
477
|
'Resolves the catalog item\'s artifact_id and delegates to the promote-from-artifact endpoint. ' +
|
|
469
|
-
'The catalog item must have an artifact_id (created via LAKE-17 artifact bridge).'
|
|
478
|
+
'The catalog item must have an artifact_id (created via LAKE-17 artifact bridge). ' +
|
|
479
|
+
'Through a GM workflow on the workflow\'s own artifact this is gated exactly like ' +
|
|
480
|
+
'tacit_kb_promote_from_artifact (requires tacit_kb_list_collections first; lands DRAFT); ' +
|
|
481
|
+
'standalone promotes with no active workflow publish immediately.',
|
|
470
482
|
inputSchema: {
|
|
471
483
|
type: 'object',
|
|
472
484
|
properties: {
|
|
@@ -589,10 +601,19 @@ export async function handleCreateCategory(args) {
|
|
|
589
601
|
}
|
|
590
602
|
return buildCreateCategoryRequest(getClient(), parsed.data).execute();
|
|
591
603
|
}
|
|
592
|
-
export function registerKbTools(server, getClientFn) {
|
|
604
|
+
export function registerKbTools(server, getClientFn, gate) {
|
|
593
605
|
server.tool('tacit_kb_list_collections', LIST_COLLECTIONS_TOOL_DEF.description, listCollectionsInputSchema.shape, async (args) => {
|
|
606
|
+
const principal = getRequestPrincipal();
|
|
594
607
|
const client = await getClientFn();
|
|
595
|
-
|
|
608
|
+
const res = await buildListCollectionsRequest(client, args).execute();
|
|
609
|
+
if (!res.isError) {
|
|
610
|
+
// FEAT-249: the KB drill-down prerequisite — only successful calls count.
|
|
611
|
+
gate.recordCall(principal, 'tacit_kb_list_collections');
|
|
612
|
+
if (gate.isGuidanceActive(principal)) {
|
|
613
|
+
res.content.push({ type: 'text', text: GM_LIST_TOOL_NEXT_STEP['tacit_kb_list_collections'] });
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return res;
|
|
596
617
|
});
|
|
597
618
|
server.tool('tacit_kb_create_collection', CREATE_COLLECTION_TOOL_DEF.description, createCollectionInputSchema.shape, async (args) => {
|
|
598
619
|
const client = await getClientFn();
|
|
@@ -627,12 +648,77 @@ export function registerKbTools(server, getClientFn) {
|
|
|
627
648
|
return buildBrowseTreeRequest(client, args).execute();
|
|
628
649
|
});
|
|
629
650
|
server.tool('tacit_kb_promote_from_artifact', PROMOTE_FROM_ARTIFACT_TOOL_DEF.description, promoteFromArtifactInputSchema.shape, async (args) => {
|
|
651
|
+
const parsed = promoteFromArtifactInputSchema.safeParse(args);
|
|
652
|
+
if (!parsed.success) {
|
|
653
|
+
return { content: [{ type: 'text', text: `Invalid input: ${parsed.error.message}` }], isError: true };
|
|
654
|
+
}
|
|
655
|
+
const input = parsed.data;
|
|
656
|
+
const principal = getRequestPrincipal();
|
|
657
|
+
// FEAT-249: gated only while a GM workflow is active AND this is the workflow's
|
|
658
|
+
// own artifact; standalone promotion (SOP-03) passes through ungated.
|
|
659
|
+
const verdict = gate.checkKbPromote(principal, input.artifact_id);
|
|
660
|
+
if (!verdict.allowed) {
|
|
661
|
+
return {
|
|
662
|
+
content: [{ type: 'text', text: verdict.message ?? 'tacit_kb_promote_from_artifact rejected: prerequisite not met.' }],
|
|
663
|
+
isError: true,
|
|
664
|
+
};
|
|
665
|
+
}
|
|
630
666
|
const client = await getClientFn();
|
|
631
|
-
|
|
667
|
+
const res = await buildPromoteFromArtifactRequest(client, input).execute();
|
|
668
|
+
if (!res.isError) {
|
|
669
|
+
// Complete the workflow only when it was the workflow's own artifact — a promote
|
|
670
|
+
// of a different artifact is placement-unrelated and neither gated nor completing.
|
|
671
|
+
const snap = gate.getWorkflow(principal);
|
|
672
|
+
if (snap?.active && snap.artifactId === input.artifact_id) {
|
|
673
|
+
gate.completePlacement(principal, `kb:${input.artifact_id}:${input.collection_id}`);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
return res;
|
|
632
677
|
});
|
|
633
678
|
server.tool('tacit_kb_promote_from_catalog', PROMOTE_FROM_CATALOG_TOOL_DEF.description, promoteFromCatalogInputSchema.shape, async (args) => {
|
|
679
|
+
const parsed = promoteFromCatalogInputSchema.safeParse(args);
|
|
680
|
+
if (!parsed.success) {
|
|
681
|
+
return { content: [{ type: 'text', text: `Invalid input: ${parsed.error.message}` }], isError: true };
|
|
682
|
+
}
|
|
683
|
+
const input = parsed.data;
|
|
684
|
+
const principal = getRequestPrincipal();
|
|
634
685
|
const client = await getClientFn();
|
|
635
|
-
|
|
686
|
+
// FEAT-249: the catalog variant resolves the artifact internally — and the ingest
|
|
687
|
+
// response hands the caller the workflow's catalog_id. Without applying the same
|
|
688
|
+
// gate as promote_from_artifact here, promoting the workflow's own catalog entry
|
|
689
|
+
// would bypass the KB chain (drill-down + DRAFT + completion).
|
|
690
|
+
const snap = gate.getWorkflow(principal);
|
|
691
|
+
let detail;
|
|
692
|
+
try {
|
|
693
|
+
detail = (await client.get(`/api/v1/org/lake/catalog/${input.catalog_item_id}`));
|
|
694
|
+
}
|
|
695
|
+
catch (err) {
|
|
696
|
+
return apiErrorResult(err, 'tacit_kb_promote_from_catalog');
|
|
697
|
+
}
|
|
698
|
+
const artifactId = detail?.artifact_id;
|
|
699
|
+
if (typeof artifactId !== 'string') {
|
|
700
|
+
return {
|
|
701
|
+
content: [{ type: 'text', text: `Catalog item ${input.catalog_item_id} has no artifact_id — run a sync first (LAKE-17 artifact bridge creates artifacts on ingest).` }],
|
|
702
|
+
isError: true,
|
|
703
|
+
};
|
|
704
|
+
}
|
|
705
|
+
const verdict = gate.checkKbPromote(principal, artifactId);
|
|
706
|
+
if (!verdict.allowed) {
|
|
707
|
+
return {
|
|
708
|
+
content: [{ type: 'text', text: verdict.message ?? 'tacit_kb_promote_from_catalog rejected: prerequisite not met.' }],
|
|
709
|
+
isError: true,
|
|
710
|
+
};
|
|
711
|
+
}
|
|
712
|
+
const gated = snap?.active === true && snap.artifactId === artifactId;
|
|
713
|
+
const res = await buildPromoteFromArtifactRequest(client, {
|
|
714
|
+
artifact_id: artifactId,
|
|
715
|
+
collection_id: input.collection_id,
|
|
716
|
+
status: gated ? 'DRAFT' : undefined,
|
|
717
|
+
}).execute();
|
|
718
|
+
if (!res.isError && gated) {
|
|
719
|
+
gate.completePlacement(principal, `kb:${artifactId}:${input.collection_id}`);
|
|
720
|
+
}
|
|
721
|
+
return res;
|
|
636
722
|
});
|
|
637
723
|
server.tool('tacit_kb_list_categories', LIST_CATEGORIES_TOOL_DEF.description, listCategoriesInputSchema.shape, async (args) => {
|
|
638
724
|
const client = await getClientFn();
|
package/dist/tools/pyramid.d.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import { z } from 'zod';
|
|
13
13
|
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
14
14
|
import { TacitClient } from '../client.js';
|
|
15
|
+
import { WorkflowGate } from '../workflow-gate.js';
|
|
15
16
|
export interface ToolRequest {
|
|
16
17
|
execute(): Promise<{
|
|
17
18
|
content: Array<{
|
|
@@ -551,4 +552,4 @@ export declare function handleAssignProgramToVS(args: unknown): Promise<{
|
|
|
551
552
|
}>;
|
|
552
553
|
isError?: boolean;
|
|
553
554
|
}>;
|
|
554
|
-
export declare function registerPyramidTools(server: McpServer, getClientFn: () => Promise<TacitClient
|
|
555
|
+
export declare function registerPyramidTools(server: McpServer, getClientFn: () => Promise<TacitClient>, gate: WorkflowGate): void;
|
package/dist/tools/pyramid.js
CHANGED
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
* GET/POST /alignment/value-streams
|
|
11
11
|
*/
|
|
12
12
|
import { z } from 'zod';
|
|
13
|
-
import { getClient, TacitApiError, TokenExpiredError } from '../client.js';
|
|
13
|
+
import { getClient, getRequestPrincipal, TacitApiError, TokenExpiredError } from '../client.js';
|
|
14
14
|
import { apiErrorResult as sharedApiErrorResult, featureDisabledResult } from './errors.js';
|
|
15
|
+
import { GM_LIST_TOOL_NEXT_STEP } from '../workflow-gate.js';
|
|
15
16
|
function apiErrorResult(err, toolName) {
|
|
16
17
|
if (err instanceof TokenExpiredError) {
|
|
17
18
|
return {
|
|
@@ -551,10 +552,27 @@ export async function handleAssignProgramToVS(args) {
|
|
|
551
552
|
}
|
|
552
553
|
return buildAssignProgramToVSRequest(getClient(), parsed.data).execute();
|
|
553
554
|
}
|
|
554
|
-
|
|
555
|
+
/**
|
|
556
|
+
* FEAT-249 Layer 2: record a shared list call and, while a GM placement workflow is
|
|
557
|
+
* active, append the workflow's drill-down guidance to the result. Successful calls
|
|
558
|
+
* only — a failed request must not satisfy the drill-down prerequisite. With no
|
|
559
|
+
* active workflow nothing is recorded or attached (audits and read-only browses stay clean).
|
|
560
|
+
*/
|
|
561
|
+
function attachGmGuidance(gate, principal, toolName, res) {
|
|
562
|
+
if (res.isError)
|
|
563
|
+
return res;
|
|
564
|
+
gate.recordCall(principal, toolName);
|
|
565
|
+
const guidance = GM_LIST_TOOL_NEXT_STEP[toolName];
|
|
566
|
+
if (gate.isGuidanceActive(principal) && guidance) {
|
|
567
|
+
res.content.push({ type: 'text', text: guidance });
|
|
568
|
+
}
|
|
569
|
+
return res;
|
|
570
|
+
}
|
|
571
|
+
export function registerPyramidTools(server, getClientFn, gate) {
|
|
555
572
|
server.tool('tacit_pyramid_list_portfolios', 'List all portfolios in the workspace.', {}, async () => {
|
|
573
|
+
const principal = getRequestPrincipal();
|
|
556
574
|
const client = await getClientFn();
|
|
557
|
-
return buildListPortfoliosRequest(client, {}).execute();
|
|
575
|
+
return attachGmGuidance(gate, principal, 'tacit_pyramid_list_portfolios', await buildListPortfoliosRequest(client, {}).execute());
|
|
558
576
|
});
|
|
559
577
|
server.tool('tacit_pyramid_create_portfolio', 'Create a new portfolio.', {
|
|
560
578
|
name: z.string().min(1).describe('Portfolio name'),
|
|
@@ -567,8 +585,9 @@ export function registerPyramidTools(server, getClientFn) {
|
|
|
567
585
|
server.tool('tacit_pyramid_list_programs', 'List programs within a portfolio.', {
|
|
568
586
|
portfolio_id: z.string().min(1).describe('Portfolio UUID'),
|
|
569
587
|
}, async (args) => {
|
|
588
|
+
const principal = getRequestPrincipal();
|
|
570
589
|
const client = await getClientFn();
|
|
571
|
-
return buildListProgramsRequest(client, args).execute();
|
|
590
|
+
return attachGmGuidance(gate, principal, 'tacit_pyramid_list_programs', await buildListProgramsRequest(client, args).execute());
|
|
572
591
|
});
|
|
573
592
|
server.tool('tacit_pyramid_create_program', 'Create a new program within a portfolio.', {
|
|
574
593
|
portfolio_id: z.string().min(1).describe('Parent portfolio UUID'),
|
|
@@ -584,8 +603,9 @@ export function registerPyramidTools(server, getClientFn) {
|
|
|
584
603
|
return buildCreateProgramRequest(client, args).execute();
|
|
585
604
|
});
|
|
586
605
|
server.tool('tacit_pyramid_list_dossiers', 'List dossiers in the workspace.', {}, async () => {
|
|
606
|
+
const principal = getRequestPrincipal();
|
|
587
607
|
const client = await getClientFn();
|
|
588
|
-
return buildListDossiersRequest(client, {}).execute();
|
|
608
|
+
return attachGmGuidance(gate, principal, 'tacit_pyramid_list_dossiers', await buildListDossiersRequest(client, {}).execute());
|
|
589
609
|
});
|
|
590
610
|
server.tool('tacit_pyramid_get_dossier', 'Get a single dossier by ID.', {
|
|
591
611
|
dossier_id: z.string().min(1).describe('Dossier UUID'),
|
|
@@ -628,8 +648,9 @@ export function registerPyramidTools(server, getClientFn) {
|
|
|
628
648
|
return buildDeleteDossierRequest(client, args).execute();
|
|
629
649
|
});
|
|
630
650
|
server.tool('tacit_pyramid_list_value_streams', 'List all value streams in the workspace.', {}, async () => {
|
|
651
|
+
const principal = getRequestPrincipal();
|
|
631
652
|
const client = await getClientFn();
|
|
632
|
-
return buildListValueStreamsRequest(client, {}).execute();
|
|
653
|
+
return attachGmGuidance(gate, principal, 'tacit_pyramid_list_value_streams', await buildListValueStreamsRequest(client, {}).execute());
|
|
633
654
|
});
|
|
634
655
|
server.tool('tacit_pyramid_create_value_stream', 'Create a new value stream under a portfolio.', {
|
|
635
656
|
portfolio_id: z.string().min(1).describe('Parent portfolio UUID'),
|
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 + 18 admin_only + 2 gate_only + 126 https = 152.
|
|
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 + 18 admin_only + 2 gate_only + 126 https = 152.
|
|
4
4
|
*/
|
|
5
5
|
const STDIO_ONLY = [
|
|
6
6
|
'tacit_ingest_file',
|
|
@@ -24,6 +24,7 @@ const ADMIN_ONLY = [
|
|
|
24
24
|
'tacit_lake_folder_merge',
|
|
25
25
|
'tacit_lake_folder_remove',
|
|
26
26
|
'tacit_lake_delete_catalog_item',
|
|
27
|
+
'tacit_lake_restore_catalog_item',
|
|
27
28
|
'tacit_github_disconnect_connection',
|
|
28
29
|
'tacit_github_reconnect_connection',
|
|
29
30
|
'tacit_compose',
|
|
@@ -125,6 +126,7 @@ const WRITE_TOOLS = [
|
|
|
125
126
|
'tacit_export_to_git',
|
|
126
127
|
'tacit_gm_approve',
|
|
127
128
|
'tacit_gm_ingest',
|
|
129
|
+
'tacit_gm_reset',
|
|
128
130
|
'tacit_import_artifact',
|
|
129
131
|
'tacit_ingest_file',
|
|
130
132
|
'tacit_ingest_url',
|
|
@@ -194,8 +196,8 @@ function build() {
|
|
|
194
196
|
if (!exclusive.has(n))
|
|
195
197
|
add(n, classOf(n), 'https', false);
|
|
196
198
|
}
|
|
197
|
-
if (map.size !==
|
|
198
|
-
throw new Error(`tool registry expected
|
|
199
|
+
if (map.size !== 152)
|
|
200
|
+
throw new Error(`tool registry expected 152 tools, got ${map.size}`);
|
|
199
201
|
return map;
|
|
200
202
|
}
|
|
201
203
|
export const TOOL_REGISTRY = build();
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkflowGate — Layer 1 server-side workflow enforcement (FEAT-249).
|
|
3
|
+
*
|
|
4
|
+
* Structural, model-agnostic drill-down prerequisites for the GM content-placement
|
|
5
|
+
* workflow: `tacit_gm_approve` (pyramid) requires the four pyramid list tools to have
|
|
6
|
+
* been called since the last `tacit_gm_ingest` (or a validated fast-track target_path);
|
|
7
|
+
* `tacit_kb_promote_from_artifact` requires `tacit_kb_list_collections` — but only
|
|
8
|
+
* while a GM workflow is active AND the artifact_id matches the workflow's artifact.
|
|
9
|
+
* Standalone KB promotion (SOP-03, no active workflow) stays ungated.
|
|
10
|
+
*
|
|
11
|
+
* Scoping (AC-isolation): one instance per server process. State is keyed by caller
|
|
12
|
+
* principal — on the HTTP transport `getRequestPrincipal()` returns the bearer-token
|
|
13
|
+
* principal (AsyncLocalStorage); on stdio it returns null and every call shares the
|
|
14
|
+
* single '__stdio__' slot, which is correct because a stdio server is one connection.
|
|
15
|
+
* NEVER store gate state inside the per-request AsyncLocalStorage context: it would
|
|
16
|
+
* evaporate between HTTP requests and silently no-op the gate.
|
|
17
|
+
*
|
|
18
|
+
* Lifecycle: active from `tacit_gm_ingest` (which supersedes any prior workflow) until
|
|
19
|
+
* the FINAL placement completes — approve for pyramid, promote of the workflow's own
|
|
20
|
+
* artifact for KB (a promote of a DIFFERENT artifact is placement-unrelated and neither
|
|
21
|
+
* gated nor completing). `cross_reference` keeps the workflow active for a second
|
|
22
|
+
* placement cycle. `tacit_gm_reset` clears the call log and rearms ACTIVE whether or
|
|
23
|
+
* not a placement had completed. Nothing persists across process restarts.
|
|
24
|
+
*/
|
|
25
|
+
export interface GateVerdict {
|
|
26
|
+
allowed: boolean;
|
|
27
|
+
missing: string[];
|
|
28
|
+
message?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface WorkflowSnapshot {
|
|
31
|
+
active: boolean;
|
|
32
|
+
artifactId: string | null;
|
|
33
|
+
catalogId: string | null;
|
|
34
|
+
crossReference: boolean;
|
|
35
|
+
placementsRemaining: number;
|
|
36
|
+
}
|
|
37
|
+
/** Drill-down tools required before `tacit_gm_approve` (pyramid surface). */
|
|
38
|
+
export declare const PYRAMID_PREREQ_TOOLS: readonly ["tacit_pyramid_list_portfolios", "tacit_pyramid_list_value_streams", "tacit_pyramid_list_programs", "tacit_pyramid_list_dossiers"];
|
|
39
|
+
/** Drill-down tool required before a GM-workflow KB promotion. */
|
|
40
|
+
export declare const KB_PREREQ_TOOL = "tacit_kb_list_collections";
|
|
41
|
+
export declare class WorkflowGate {
|
|
42
|
+
private readonly maxPrincipals;
|
|
43
|
+
/**
|
|
44
|
+
* Safety valve (sec audit): cap distinct principals so the states Map cannot grow
|
|
45
|
+
* unboundedly. A slot requires a valid credential to create, but unbounded is still
|
|
46
|
+
* a leak. FIFO-evicts (Map insertion order) past the cap; constructor-injectable
|
|
47
|
+
* for tests. Process restart clears everything regardless.
|
|
48
|
+
*/
|
|
49
|
+
constructor(maxPrincipals?: number);
|
|
50
|
+
private readonly states;
|
|
51
|
+
private keyOf;
|
|
52
|
+
private stateOf;
|
|
53
|
+
/** Record a shared list-tool call. Counting is per tool; startWorkflow clears the log. */
|
|
54
|
+
recordCall(principal: string | null, toolName: string): void;
|
|
55
|
+
/** `tacit_gm_ingest` succeeded — arm the workflow, superseding any prior one. */
|
|
56
|
+
startWorkflow(principal: string | null, opts: {
|
|
57
|
+
artifactId: string;
|
|
58
|
+
catalogId: string;
|
|
59
|
+
crossReference: boolean;
|
|
60
|
+
}): void;
|
|
61
|
+
/** Guidance-attach predicate (Layer 2): true from ingest until the final placement completes. */
|
|
62
|
+
isGuidanceActive(principal: string | null): boolean;
|
|
63
|
+
/** Read-only copy of the workflow state, or null when none exists. */
|
|
64
|
+
getWorkflow(principal: string | null): WorkflowSnapshot | null;
|
|
65
|
+
/**
|
|
66
|
+
* Pyramid gate for `tacit_gm_approve`. Applied whenever an approve is attempted:
|
|
67
|
+
* the drill-down must have happened (call log since last ingest, or a validated
|
|
68
|
+
* fast-track). Re-approving after a completed placement is allowed while the log
|
|
69
|
+
* still satisfies the prerequisites (idempotent retries), but `tacit_gm_reset`
|
|
70
|
+
* or a new ingest re-arms the requirement.
|
|
71
|
+
*/
|
|
72
|
+
checkPyramidApprove(principal: string | null): GateVerdict;
|
|
73
|
+
/**
|
|
74
|
+
* KB gate for `tacit_kb_promote_from_artifact` (and the catalog variant, which
|
|
75
|
+
* resolves to the same artifact). Gated ONLY while a GM workflow is active AND
|
|
76
|
+
* artifactId matches the workflow's artifact; a different artifact or a standalone
|
|
77
|
+
* promotion (SOP-03) passes through ungated and does NOT complete the workflow.
|
|
78
|
+
*
|
|
79
|
+
* Restart asymmetry (ADR-202): a process restart mid-KB-workflow silently downgrades
|
|
80
|
+
* to this ungated path (fail-open), while checkPyramidApprove re-requires the
|
|
81
|
+
* drill-down (fail-closed). The gate is workflow hygiene, not a security boundary —
|
|
82
|
+
* backend authorization (workspace scoping, capabilities) is unaffected either way.
|
|
83
|
+
*/
|
|
84
|
+
checkKbPromote(principal: string | null, artifactId: string): GateVerdict;
|
|
85
|
+
/**
|
|
86
|
+
* Variation C fast-track: the handler validated target_path server-side against the
|
|
87
|
+
* same endpoints the list tools wrap. Satisfies the drill-down prerequisite for this
|
|
88
|
+
* cycle only; cleared by ingest supersession and by reset.
|
|
89
|
+
*/
|
|
90
|
+
markFastTrackValidated(principal: string | null): void;
|
|
91
|
+
/**
|
|
92
|
+
* A final placement succeeded — `tacit_gm_approve` (pyramid) or a promote of the
|
|
93
|
+
* workflow's own artifact (KB). With cross_reference set the workflow stays active
|
|
94
|
+
* for the second cycle; otherwise it deactivates and shared-list guidance stops.
|
|
95
|
+
*
|
|
96
|
+
* `placementKey` makes completion idempotent: the backend is idempotent, so an
|
|
97
|
+
* identical retry of an already-counted placement (same catalog+targets, or same
|
|
98
|
+
* artifact+collection) must not consume a second budget slot — in a cross_reference
|
|
99
|
+
* workflow a double-decrement would deactivate mid-flow and leave the second
|
|
100
|
+
* surface ungated (and able to land PUBLISHED). A DIFFERENT placement still counts.
|
|
101
|
+
*/
|
|
102
|
+
completePlacement(principal: string | null, placementKey: string): void;
|
|
103
|
+
/**
|
|
104
|
+
* Variation D reset: clear the call log, rearm ACTIVE whether or not a placement had
|
|
105
|
+
* completed, keep the workflow's artifact/catalog. The next surface starts its own
|
|
106
|
+
* drill-down from scratch (call log is empty; fast-track is invalidated).
|
|
107
|
+
*/
|
|
108
|
+
resetWorkflow(principal: string | null): WorkflowSnapshot;
|
|
109
|
+
/** Full teardown for the principal (tests; production teardown is process exit). */
|
|
110
|
+
clear(principal: string | null): void;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Guidance appended to shared list-tool results while a GM workflow is active.
|
|
114
|
+
* Never attached when no workflow is active (Gap G2: COO audits and read-only
|
|
115
|
+
* browses must not see GM placement instructions).
|
|
116
|
+
*/
|
|
117
|
+
export declare const GM_LIST_TOOL_NEXT_STEP: Record<string, string>;
|
|
118
|
+
/** Appended to approve results when cross_reference is set and a second cycle remains. */
|
|
119
|
+
export declare const GM_APPROVE_NEXT_STEP: string;
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WorkflowGate — Layer 1 server-side workflow enforcement (FEAT-249).
|
|
3
|
+
*
|
|
4
|
+
* Structural, model-agnostic drill-down prerequisites for the GM content-placement
|
|
5
|
+
* workflow: `tacit_gm_approve` (pyramid) requires the four pyramid list tools to have
|
|
6
|
+
* been called since the last `tacit_gm_ingest` (or a validated fast-track target_path);
|
|
7
|
+
* `tacit_kb_promote_from_artifact` requires `tacit_kb_list_collections` — but only
|
|
8
|
+
* while a GM workflow is active AND the artifact_id matches the workflow's artifact.
|
|
9
|
+
* Standalone KB promotion (SOP-03, no active workflow) stays ungated.
|
|
10
|
+
*
|
|
11
|
+
* Scoping (AC-isolation): one instance per server process. State is keyed by caller
|
|
12
|
+
* principal — on the HTTP transport `getRequestPrincipal()` returns the bearer-token
|
|
13
|
+
* principal (AsyncLocalStorage); on stdio it returns null and every call shares the
|
|
14
|
+
* single '__stdio__' slot, which is correct because a stdio server is one connection.
|
|
15
|
+
* NEVER store gate state inside the per-request AsyncLocalStorage context: it would
|
|
16
|
+
* evaporate between HTTP requests and silently no-op the gate.
|
|
17
|
+
*
|
|
18
|
+
* Lifecycle: active from `tacit_gm_ingest` (which supersedes any prior workflow) until
|
|
19
|
+
* the FINAL placement completes — approve for pyramid, promote of the workflow's own
|
|
20
|
+
* artifact for KB (a promote of a DIFFERENT artifact is placement-unrelated and neither
|
|
21
|
+
* gated nor completing). `cross_reference` keeps the workflow active for a second
|
|
22
|
+
* placement cycle. `tacit_gm_reset` clears the call log and rearms ACTIVE whether or
|
|
23
|
+
* not a placement had completed. Nothing persists across process restarts.
|
|
24
|
+
*/
|
|
25
|
+
/** Drill-down tools required before `tacit_gm_approve` (pyramid surface). */
|
|
26
|
+
export const PYRAMID_PREREQ_TOOLS = [
|
|
27
|
+
'tacit_pyramid_list_portfolios',
|
|
28
|
+
'tacit_pyramid_list_value_streams',
|
|
29
|
+
'tacit_pyramid_list_programs',
|
|
30
|
+
'tacit_pyramid_list_dossiers',
|
|
31
|
+
];
|
|
32
|
+
/** Drill-down tool required before a GM-workflow KB promotion. */
|
|
33
|
+
export const KB_PREREQ_TOOL = 'tacit_kb_list_collections';
|
|
34
|
+
function staleSurfaceHint(surface) {
|
|
35
|
+
return `A ${surface} drill-down is already recorded for this workflow; to switch surface, call tacit_gm_reset first.`;
|
|
36
|
+
}
|
|
37
|
+
export class WorkflowGate {
|
|
38
|
+
maxPrincipals;
|
|
39
|
+
/**
|
|
40
|
+
* Safety valve (sec audit): cap distinct principals so the states Map cannot grow
|
|
41
|
+
* unboundedly. A slot requires a valid credential to create, but unbounded is still
|
|
42
|
+
* a leak. FIFO-evicts (Map insertion order) past the cap; constructor-injectable
|
|
43
|
+
* for tests. Process restart clears everything regardless.
|
|
44
|
+
*/
|
|
45
|
+
constructor(maxPrincipals = 10_000) {
|
|
46
|
+
this.maxPrincipals = maxPrincipals;
|
|
47
|
+
}
|
|
48
|
+
states = new Map();
|
|
49
|
+
keyOf(principal) {
|
|
50
|
+
return principal ?? '__stdio__';
|
|
51
|
+
}
|
|
52
|
+
stateOf(principal) {
|
|
53
|
+
const key = this.keyOf(principal);
|
|
54
|
+
let state = this.states.get(key);
|
|
55
|
+
if (!state) {
|
|
56
|
+
while (this.states.size >= this.maxPrincipals) {
|
|
57
|
+
const oldest = this.states.keys().next().value;
|
|
58
|
+
if (oldest === undefined)
|
|
59
|
+
break;
|
|
60
|
+
this.states.delete(oldest);
|
|
61
|
+
}
|
|
62
|
+
state = {
|
|
63
|
+
active: false,
|
|
64
|
+
artifactId: null,
|
|
65
|
+
catalogId: null,
|
|
66
|
+
crossReference: false,
|
|
67
|
+
placementsRemaining: 0,
|
|
68
|
+
callLog: new Map(),
|
|
69
|
+
fastTrackValidated: false,
|
|
70
|
+
lastPlacementKey: null,
|
|
71
|
+
};
|
|
72
|
+
this.states.set(key, state);
|
|
73
|
+
}
|
|
74
|
+
return state;
|
|
75
|
+
}
|
|
76
|
+
/** Record a shared list-tool call. Counting is per tool; startWorkflow clears the log. */
|
|
77
|
+
recordCall(principal, toolName) {
|
|
78
|
+
const state = this.stateOf(principal);
|
|
79
|
+
state.callLog.set(toolName, (state.callLog.get(toolName) ?? 0) + 1);
|
|
80
|
+
}
|
|
81
|
+
/** `tacit_gm_ingest` succeeded — arm the workflow, superseding any prior one. */
|
|
82
|
+
startWorkflow(principal, opts) {
|
|
83
|
+
const state = this.stateOf(principal);
|
|
84
|
+
state.active = true;
|
|
85
|
+
state.artifactId = opts.artifactId;
|
|
86
|
+
state.catalogId = opts.catalogId;
|
|
87
|
+
state.crossReference = opts.crossReference;
|
|
88
|
+
state.placementsRemaining = opts.crossReference ? 2 : 1;
|
|
89
|
+
state.callLog = new Map();
|
|
90
|
+
state.fastTrackValidated = false;
|
|
91
|
+
state.lastPlacementKey = null;
|
|
92
|
+
}
|
|
93
|
+
/** Guidance-attach predicate (Layer 2): true from ingest until the final placement completes. */
|
|
94
|
+
isGuidanceActive(principal) {
|
|
95
|
+
const state = this.states.get(this.keyOf(principal));
|
|
96
|
+
return state?.active === true;
|
|
97
|
+
}
|
|
98
|
+
/** Read-only copy of the workflow state, or null when none exists. */
|
|
99
|
+
getWorkflow(principal) {
|
|
100
|
+
const state = this.states.get(this.keyOf(principal));
|
|
101
|
+
if (!state)
|
|
102
|
+
return null;
|
|
103
|
+
return {
|
|
104
|
+
active: state.active,
|
|
105
|
+
artifactId: state.artifactId,
|
|
106
|
+
catalogId: state.catalogId,
|
|
107
|
+
crossReference: state.crossReference,
|
|
108
|
+
placementsRemaining: state.placementsRemaining,
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Pyramid gate for `tacit_gm_approve`. Applied whenever an approve is attempted:
|
|
113
|
+
* the drill-down must have happened (call log since last ingest, or a validated
|
|
114
|
+
* fast-track). Re-approving after a completed placement is allowed while the log
|
|
115
|
+
* still satisfies the prerequisites (idempotent retries), but `tacit_gm_reset`
|
|
116
|
+
* or a new ingest re-arms the requirement.
|
|
117
|
+
*/
|
|
118
|
+
checkPyramidApprove(principal) {
|
|
119
|
+
const state = this.stateOf(principal);
|
|
120
|
+
if (state.fastTrackValidated)
|
|
121
|
+
return { allowed: true, missing: [] };
|
|
122
|
+
const missing = PYRAMID_PREREQ_TOOLS.filter((t) => !state.callLog.has(t));
|
|
123
|
+
if (missing.length === 0)
|
|
124
|
+
return { allowed: true, missing: [] };
|
|
125
|
+
const parts = [
|
|
126
|
+
'tacit_gm_approve rejected: the pyramid drill-down is incomplete.',
|
|
127
|
+
`Missing: ${missing.join(', ')}.`,
|
|
128
|
+
'Call every list tool, propose the specific location, and wait for the user to approve it before placing.',
|
|
129
|
+
];
|
|
130
|
+
if (state.callLog.has(KB_PREREQ_TOOL)) {
|
|
131
|
+
parts.push(staleSurfaceHint('KB'));
|
|
132
|
+
}
|
|
133
|
+
if (!state.active && state.artifactId === null) {
|
|
134
|
+
parts.push('No GM workflow is active — start with tacit_gm_ingest (lake-first).');
|
|
135
|
+
}
|
|
136
|
+
return { allowed: false, missing: [...missing], message: parts.join(' ') };
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* KB gate for `tacit_kb_promote_from_artifact` (and the catalog variant, which
|
|
140
|
+
* resolves to the same artifact). Gated ONLY while a GM workflow is active AND
|
|
141
|
+
* artifactId matches the workflow's artifact; a different artifact or a standalone
|
|
142
|
+
* promotion (SOP-03) passes through ungated and does NOT complete the workflow.
|
|
143
|
+
*
|
|
144
|
+
* Restart asymmetry (ADR-202): a process restart mid-KB-workflow silently downgrades
|
|
145
|
+
* to this ungated path (fail-open), while checkPyramidApprove re-requires the
|
|
146
|
+
* drill-down (fail-closed). The gate is workflow hygiene, not a security boundary —
|
|
147
|
+
* backend authorization (workspace scoping, capabilities) is unaffected either way.
|
|
148
|
+
*/
|
|
149
|
+
checkKbPromote(principal, artifactId) {
|
|
150
|
+
const state = this.states.get(this.keyOf(principal));
|
|
151
|
+
if (!state?.active || state.artifactId !== artifactId) {
|
|
152
|
+
return { allowed: true, missing: [] };
|
|
153
|
+
}
|
|
154
|
+
if (state.callLog.has(KB_PREREQ_TOOL))
|
|
155
|
+
return { allowed: true, missing: [] };
|
|
156
|
+
const parts = [
|
|
157
|
+
'tacit_kb_promote_from_artifact rejected: this GM workflow has not listed KB collections.',
|
|
158
|
+
`Missing: ${KB_PREREQ_TOOL}.`,
|
|
159
|
+
'List the collections, propose the specific one, and wait for the user to approve it before promoting.',
|
|
160
|
+
];
|
|
161
|
+
if (PYRAMID_PREREQ_TOOLS.some((t) => state.callLog.has(t))) {
|
|
162
|
+
parts.push(staleSurfaceHint('pyramid'));
|
|
163
|
+
}
|
|
164
|
+
return { allowed: false, missing: [KB_PREREQ_TOOL], message: parts.join(' ') };
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Variation C fast-track: the handler validated target_path server-side against the
|
|
168
|
+
* same endpoints the list tools wrap. Satisfies the drill-down prerequisite for this
|
|
169
|
+
* cycle only; cleared by ingest supersession and by reset.
|
|
170
|
+
*/
|
|
171
|
+
markFastTrackValidated(principal) {
|
|
172
|
+
this.stateOf(principal).fastTrackValidated = true;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* A final placement succeeded — `tacit_gm_approve` (pyramid) or a promote of the
|
|
176
|
+
* workflow's own artifact (KB). With cross_reference set the workflow stays active
|
|
177
|
+
* for the second cycle; otherwise it deactivates and shared-list guidance stops.
|
|
178
|
+
*
|
|
179
|
+
* `placementKey` makes completion idempotent: the backend is idempotent, so an
|
|
180
|
+
* identical retry of an already-counted placement (same catalog+targets, or same
|
|
181
|
+
* artifact+collection) must not consume a second budget slot — in a cross_reference
|
|
182
|
+
* workflow a double-decrement would deactivate mid-flow and leave the second
|
|
183
|
+
* surface ungated (and able to land PUBLISHED). A DIFFERENT placement still counts.
|
|
184
|
+
*/
|
|
185
|
+
completePlacement(principal, placementKey) {
|
|
186
|
+
const state = this.states.get(this.keyOf(principal));
|
|
187
|
+
if (!state?.active)
|
|
188
|
+
return;
|
|
189
|
+
if (state.lastPlacementKey === placementKey)
|
|
190
|
+
return; // idempotent retry — already counted
|
|
191
|
+
state.lastPlacementKey = placementKey;
|
|
192
|
+
state.placementsRemaining = Math.max(0, state.placementsRemaining - 1);
|
|
193
|
+
// The fast-track satisfies the drill-down for THIS cycle only (Variation C).
|
|
194
|
+
state.fastTrackValidated = false;
|
|
195
|
+
if (state.placementsRemaining === 0) {
|
|
196
|
+
state.active = false;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Variation D reset: clear the call log, rearm ACTIVE whether or not a placement had
|
|
201
|
+
* completed, keep the workflow's artifact/catalog. The next surface starts its own
|
|
202
|
+
* drill-down from scratch (call log is empty; fast-track is invalidated).
|
|
203
|
+
*/
|
|
204
|
+
resetWorkflow(principal) {
|
|
205
|
+
const state = this.stateOf(principal);
|
|
206
|
+
state.active = state.artifactId !== null;
|
|
207
|
+
state.placementsRemaining = state.active ? (state.crossReference ? 2 : 1) : 0;
|
|
208
|
+
state.callLog = new Map();
|
|
209
|
+
state.fastTrackValidated = false;
|
|
210
|
+
state.lastPlacementKey = null;
|
|
211
|
+
return {
|
|
212
|
+
active: state.active,
|
|
213
|
+
artifactId: state.artifactId,
|
|
214
|
+
catalogId: state.catalogId,
|
|
215
|
+
crossReference: state.crossReference,
|
|
216
|
+
placementsRemaining: state.placementsRemaining,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
/** Full teardown for the principal (tests; production teardown is process exit). */
|
|
220
|
+
clear(principal) {
|
|
221
|
+
this.states.delete(this.keyOf(principal));
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
// ─── Layer 2: workflow-scoped NEXT_STEP guidance (attached ONLY while active) ──
|
|
225
|
+
/**
|
|
226
|
+
* Guidance appended to shared list-tool results while a GM workflow is active.
|
|
227
|
+
* Never attached when no workflow is active (Gap G2: COO audits and read-only
|
|
228
|
+
* browses must not see GM placement instructions).
|
|
229
|
+
*/
|
|
230
|
+
export const GM_LIST_TOOL_NEXT_STEP = {
|
|
231
|
+
tacit_pyramid_list_portfolios: 'NEXT STEP (GM workflow): portfolios loaded. Continue the mandatory drill-down — ' +
|
|
232
|
+
'list value streams next, then the programs of the chosen portfolio, then its dossiers. ' +
|
|
233
|
+
'Do not propose placement before you reach a specific dossier.',
|
|
234
|
+
tacit_pyramid_list_value_streams: 'NEXT STEP (GM workflow): value streams loaded. Identify the best-fit value stream, ' +
|
|
235
|
+
'then list the programs of the chosen portfolio.',
|
|
236
|
+
tacit_pyramid_list_programs: 'NEXT STEP (GM workflow): programs loaded. Pick the best-fit program, then list its ' +
|
|
237
|
+
'dossiers — pyramid placement needs a specific dossier.',
|
|
238
|
+
tacit_pyramid_list_dossiers: 'NEXT STEP (GM workflow): dossiers loaded. Propose the specific ' +
|
|
239
|
+
'portfolio → value stream → program → dossier location to the user and WAIT for their ' +
|
|
240
|
+
'approval before calling tacit_gm_approve.',
|
|
241
|
+
tacit_kb_list_collections: 'NEXT STEP (GM workflow): collections loaded. Propose the specific collection to the ' +
|
|
242
|
+
'user and WAIT for their approval. After approval, call tacit_kb_promote_from_artifact ' +
|
|
243
|
+
'with the workflow artifact_id, the collection UUID, and status "DRAFT" — the article ' +
|
|
244
|
+
'lands as a draft the user can publish anytime.',
|
|
245
|
+
};
|
|
246
|
+
/** Appended to approve results when cross_reference is set and a second cycle remains. */
|
|
247
|
+
export const GM_APPROVE_NEXT_STEP = 'NEXT STEP (GM workflow): first surface placed. cross_reference is set — run the second ' +
|
|
248
|
+
'placement cycle for the other surface: drill down (tacit_kb_list_collections for KB, or the ' +
|
|
249
|
+
'four pyramid list tools for pyramid), propose the specific location, and wait for approval ' +
|
|
250
|
+
'before placing. No tacit_gm_reset is needed between cycles.';
|
package/package.json
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tacitai/mcp-server",
|
|
3
|
-
"version": "0.6.
|
|
4
|
-
"private": false,
|
|
3
|
+
"version": "0.6.24",
|
|
5
4
|
"description": "stdio MCP server wrapping Tacit /api/v1 REST/SSE API",
|
|
6
|
-
"license": "
|
|
5
|
+
"license": "SEE LICENSE IN ../LICENSE",
|
|
7
6
|
"repository": {
|
|
8
7
|
"type": "git",
|
|
9
8
|
"url": "git+https://github.com/scottkmcmillan/tacit.git",
|
|
@@ -39,5 +38,8 @@
|
|
|
39
38
|
"@types/semver": "^7.5.0",
|
|
40
39
|
"typescript": "^5.4.0",
|
|
41
40
|
"vitest": "^4.1.7"
|
|
41
|
+
},
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public"
|
|
42
44
|
}
|
|
43
45
|
}
|