@kylewadegrove/cutline-mcp-cli 0.4.2 → 0.5.0
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/Dockerfile +11 -0
- package/README.md +177 -107
- package/dist/auth/callback.js +30 -32
- package/dist/auth/keychain.js +7 -15
- package/dist/commands/init.d.ts +4 -0
- package/dist/commands/init.js +246 -0
- package/dist/commands/login.js +39 -45
- package/dist/commands/logout.js +13 -19
- package/dist/commands/serve.d.ts +1 -0
- package/dist/commands/serve.js +38 -0
- package/dist/commands/setup.d.ts +5 -0
- package/dist/commands/setup.js +255 -0
- package/dist/commands/status.js +29 -35
- package/dist/commands/upgrade.js +44 -38
- package/dist/index.js +38 -14
- package/dist/servers/chunk-7FHM2GD3.js +5836 -0
- package/dist/servers/chunk-IVWF7VYZ.js +10086 -0
- package/dist/servers/chunk-JBJYSV4P.js +139 -0
- package/dist/servers/chunk-KMUSQOTJ.js +47 -0
- package/dist/servers/chunk-PD2HN2R5.js +908 -0
- package/dist/servers/chunk-PU7TL6S3.js +91 -0
- package/dist/servers/chunk-TGSEURMN.js +46 -0
- package/dist/servers/chunk-UBBAYTW3.js +946 -0
- package/dist/servers/cutline-server.js +11512 -0
- package/dist/servers/exploration-server.js +1030 -0
- package/dist/servers/graph-metrics-DCNR7JZN.js +12 -0
- package/dist/servers/integrations-server.js +121 -0
- package/dist/servers/output-server.js +120 -0
- package/dist/servers/pipeline-O5GJPNR4.js +20 -0
- package/dist/servers/premortem-handoff-XT4K3YDJ.js +10 -0
- package/dist/servers/premortem-server.js +958 -0
- package/dist/servers/score-history-HO5KRVGC.js +6 -0
- package/dist/servers/tools-server.js +291 -0
- package/dist/utils/config-store.js +13 -21
- package/dist/utils/config.js +2 -6
- package/mcpb/manifest.json +77 -0
- package/package.json +55 -9
- package/server.json +42 -0
- package/smithery.yaml +10 -0
- package/src/auth/callback.ts +0 -102
- package/src/auth/keychain.ts +0 -16
- package/src/commands/login.ts +0 -202
- package/src/commands/logout.ts +0 -30
- package/src/commands/status.ts +0 -153
- package/src/commands/upgrade.ts +0 -121
- package/src/index.ts +0 -40
- package/src/utils/config-store.ts +0 -46
- package/src/utils/config.ts +0 -65
- package/tsconfig.json +0 -22
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
// ../lib/agent/premortem-handoff.js
|
|
2
|
+
function buildBrief(ctx) {
|
|
3
|
+
if (!ctx)
|
|
4
|
+
return "";
|
|
5
|
+
const parts = [];
|
|
6
|
+
if (ctx.brief) {
|
|
7
|
+
parts.push(ctx.brief);
|
|
8
|
+
}
|
|
9
|
+
if (ctx.problemSolved && !ctx.brief?.toLowerCase().includes(ctx.problemSolved.toLowerCase().slice(0, 20))) {
|
|
10
|
+
parts.push(`Problem: ${ctx.problemSolved}`);
|
|
11
|
+
}
|
|
12
|
+
if (ctx.uniqueValue && !ctx.brief?.toLowerCase().includes(ctx.uniqueValue.toLowerCase().slice(0, 20))) {
|
|
13
|
+
parts.push(`Unique value: ${ctx.uniqueValue}`);
|
|
14
|
+
}
|
|
15
|
+
if (ctx.targetUser && !ctx.brief?.toLowerCase().includes(ctx.targetUser.toLowerCase().slice(0, 15))) {
|
|
16
|
+
parts.push(`Target users: ${ctx.targetUser}`);
|
|
17
|
+
}
|
|
18
|
+
if (ctx.businessModel && !ctx.brief?.toLowerCase().includes(ctx.businessModel.toLowerCase().slice(0, 15))) {
|
|
19
|
+
parts.push(`Business model: ${ctx.businessModel}`);
|
|
20
|
+
}
|
|
21
|
+
return parts.join(". ").trim() || "No description provided.";
|
|
22
|
+
}
|
|
23
|
+
function buildReferenceClasses(competitors) {
|
|
24
|
+
if (competitors && competitors.length > 0) {
|
|
25
|
+
return competitors.filter((c) => c.name && c.name.length > 0).map((c) => c.name).slice(0, 5);
|
|
26
|
+
}
|
|
27
|
+
return ["General market alternatives"];
|
|
28
|
+
}
|
|
29
|
+
function buildSeedPersonas(ctx) {
|
|
30
|
+
if (!ctx.productContext?.targetUser) {
|
|
31
|
+
return void 0;
|
|
32
|
+
}
|
|
33
|
+
return {
|
|
34
|
+
user_personas: [{
|
|
35
|
+
name: "Primary User",
|
|
36
|
+
description: ctx.productContext.targetUser
|
|
37
|
+
// Leave other fields for the personas agent to flesh out
|
|
38
|
+
}]
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function buildRunInput(request) {
|
|
42
|
+
const { projectName, conversationalContext: ctx, mode = "product", clientContext } = request;
|
|
43
|
+
let brief = buildBrief(ctx.productContext);
|
|
44
|
+
if (ctx.risks.length > 0) {
|
|
45
|
+
const topRisks = ctx.risks.filter((r) => r.severity === "critical" || r.severity === "high").slice(0, 2).map((r) => r.title);
|
|
46
|
+
if (topRisks.length > 0) {
|
|
47
|
+
brief += ` Key concerns to investigate: ${topRisks.join(", ")}.`;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
if (ctx.verdict?.summary) {
|
|
51
|
+
brief += ` Initial assessment: ${ctx.verdict.summary}`;
|
|
52
|
+
}
|
|
53
|
+
const runInput = {
|
|
54
|
+
mode,
|
|
55
|
+
project: {
|
|
56
|
+
name: projectName,
|
|
57
|
+
brief,
|
|
58
|
+
reference_classes: buildReferenceClasses(ctx.competitors)
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
if (mode === "consulting" && clientContext) {
|
|
62
|
+
runInput.client = {
|
|
63
|
+
name: clientContext.name,
|
|
64
|
+
industry: clientContext.industry,
|
|
65
|
+
size: clientContext.size,
|
|
66
|
+
stakeholders: clientContext.stakeholders
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const seedPersonas = buildSeedPersonas(ctx);
|
|
70
|
+
if (seedPersonas) {
|
|
71
|
+
runInput.seed_personas = seedPersonas;
|
|
72
|
+
}
|
|
73
|
+
if (ctx.risks.length > 0 || ctx.assumptions.length > 0 || ctx.competitors.length > 0) {
|
|
74
|
+
runInput.conversational_artifacts = {
|
|
75
|
+
risks: ctx.risks.length > 0 ? ctx.risks.map((r) => ({
|
|
76
|
+
title: r.title,
|
|
77
|
+
description: r.description,
|
|
78
|
+
category: r.category,
|
|
79
|
+
severity: r.severity,
|
|
80
|
+
likelihood: r.likelihood,
|
|
81
|
+
impact: r.impact
|
|
82
|
+
})) : void 0,
|
|
83
|
+
assumptions: ctx.assumptions.length > 0 ? ctx.assumptions.map((a) => ({
|
|
84
|
+
statement: a.statement,
|
|
85
|
+
category: a.category,
|
|
86
|
+
confidence: a.confidence,
|
|
87
|
+
importance: a.importance
|
|
88
|
+
})) : void 0,
|
|
89
|
+
competitors: ctx.competitors.length > 0 ? ctx.competitors.map((c) => ({
|
|
90
|
+
name: c.name,
|
|
91
|
+
description: c.description,
|
|
92
|
+
threat_level: c.threatLevel
|
|
93
|
+
})) : void 0,
|
|
94
|
+
conversation_summary: ctx.verdict?.summary
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
return runInput;
|
|
98
|
+
}
|
|
99
|
+
function validateForGraduation(ctx) {
|
|
100
|
+
const errors = [];
|
|
101
|
+
const warnings = [];
|
|
102
|
+
if (!ctx.productContext?.brief && !ctx.productContext?.problemSolved) {
|
|
103
|
+
errors.push("No product description found. Please describe what you're building first.");
|
|
104
|
+
}
|
|
105
|
+
if (ctx.assumptions.length === 0) {
|
|
106
|
+
warnings.push("No assumptions were surfaced. The full analysis will discover them.");
|
|
107
|
+
}
|
|
108
|
+
if (ctx.risks.length === 0) {
|
|
109
|
+
warnings.push("No risks were identified. The full analysis will analyze risks in depth.");
|
|
110
|
+
}
|
|
111
|
+
if (ctx.competitors.length === 0) {
|
|
112
|
+
warnings.push("No competitors were discussed. Provide reference companies for better analysis.");
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
valid: errors.length === 0,
|
|
116
|
+
errors,
|
|
117
|
+
warnings
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function buildGraduationMetadata(sessionId, ctx, currentAct) {
|
|
121
|
+
return {
|
|
122
|
+
sourceType: "conversational_premortem",
|
|
123
|
+
sourceSessionId: sessionId,
|
|
124
|
+
graduatedAt: Date.now(),
|
|
125
|
+
conversationSummary: {
|
|
126
|
+
actsCompleted: currentAct,
|
|
127
|
+
assumptionsCount: ctx.assumptions.length,
|
|
128
|
+
risksCount: ctx.risks.length,
|
|
129
|
+
competitorsCount: ctx.competitors.length,
|
|
130
|
+
hasVerdict: !!ctx.verdict
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export {
|
|
136
|
+
buildRunInput,
|
|
137
|
+
validateForGraduation,
|
|
138
|
+
buildGraduationMetadata
|
|
139
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// ../mcp/dist/mcp/src/shared/tool-permissions.js
|
|
2
|
+
var WRITE_TOOLS = /* @__PURE__ */ new Set([
|
|
3
|
+
// Pre-mortem (cutline-server + premortem-server)
|
|
4
|
+
"premortem_run",
|
|
5
|
+
"premortem_queue",
|
|
6
|
+
"premortem_kick",
|
|
7
|
+
"premortem_regen_assumptions",
|
|
8
|
+
"premortem_regen_experiments",
|
|
9
|
+
// Pre-mortem chat (premortem-server)
|
|
10
|
+
"premortem_graduate",
|
|
11
|
+
"premortem_chat_start",
|
|
12
|
+
"premortem_chat",
|
|
13
|
+
"premortem_chat_graduate",
|
|
14
|
+
// Wiki
|
|
15
|
+
"wiki_save",
|
|
16
|
+
"wiki_apply_edits",
|
|
17
|
+
// Integrations
|
|
18
|
+
"integrations_create_issues",
|
|
19
|
+
// Constraint graph mutations
|
|
20
|
+
"constraints_ingest",
|
|
21
|
+
"constraints_ingest_persona",
|
|
22
|
+
"constraints_ingest_wiki",
|
|
23
|
+
"constraints_ingest_doc",
|
|
24
|
+
"constraints_embed",
|
|
25
|
+
"constraints_learn",
|
|
26
|
+
// Templates
|
|
27
|
+
"template_create",
|
|
28
|
+
"template_discover",
|
|
29
|
+
// Graph ingestion / binding / healing
|
|
30
|
+
"graph_ingest_requirements",
|
|
31
|
+
"graph_bind_codebase",
|
|
32
|
+
"graph_bind_confirm",
|
|
33
|
+
"constraints_heal",
|
|
34
|
+
// Cutline MD generation (writes to filesystem)
|
|
35
|
+
"generate_cutline_md",
|
|
36
|
+
// Tools server
|
|
37
|
+
"trial_generate",
|
|
38
|
+
// Readiness badge (writes to readiness_reports collection)
|
|
39
|
+
"export_readiness_badge"
|
|
40
|
+
]);
|
|
41
|
+
function isWriteTool(name) {
|
|
42
|
+
return WRITE_TOOLS.has(name);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export {
|
|
46
|
+
isWriteTool
|
|
47
|
+
};
|