MCPcopy
hub / github.com/di-sukharev/opencommit / getMainCommitPrompt

Function getMainCommitPrompt

out/cli.cjs:85368–85395  ·  view source on GitHub ↗
(fullGitMojiSpec, context)

Source from the content-addressed store, hash-verified

85366 const feat = config4.OCO_ONE_LINE_COMMIT ? "" : generateCommitString("feat", featMessage);
85367 const description = config4.OCO_DESCRIPTION ? translation4.commitDescription : "";
85368 return [fix, feat, description].filter(Boolean).join("\n");
85369};
85370var INIT_CONSISTENCY_PROMPT = (translation4) => ({
85371 role: "assistant",
85372 content: getConsistencyContent(translation4)
85373});
85374var getMainCommitPrompt = async (fullGitMojiSpec, context) => {
85375 switch (config4.OCO_PROMPT_MODULE) {
85376 case "@commitlint":
85377 if (!await commitlintLLMConfigExists()) {
85378 ie(
85379 `OCO_PROMPT_MODULE is @commitlint but you haven't generated consistency for this project yet.`
85380 );
85381 await configureCommitlintIntegration();
85382 }
85383 const commitLintConfig = await getCommitlintLLMConfig();
85384 return [
85385 commitlintPrompts.INIT_MAIN_PROMPT(
85386 translation3.localLanguage,
85387 commitLintConfig.prompts
85388 ),
85389 INIT_DIFF_PROMPT,
85390 INIT_CONSISTENCY_PROMPT(
85391 commitLintConfig.consistency[translation3.localLanguage]
85392 )
85393 ];
85394 default:
85395 return [
85396 INIT_MAIN_PROMPT2(translation3.localLanguage, fullGitMojiSpec, context),
85397 INIT_DIFF_PROMPT,
85398 INIT_CONSISTENCY_PROMPT(translation3)

Calls 5

INIT_MAIN_PROMPT2Function · 0.85
getCommitlintLLMConfigFunction · 0.70
INIT_CONSISTENCY_PROMPTFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…