MCPcopy Create free account
hub / github.com/Noumena-Network/code / getPromptForCommand

Function getPromptForCommand

src/commands/commit.ts:96–123  ·  view source on GitHub ↗
(_args, context)

Source from the content-addressed store, hash-verified

94 progressMessage: 'creating commit',
95 source: 'builtin',
96 async getPromptForCommand(_args, context) {
97 const isGit = await getIsGit()
98 const isSl = !isGit && await getIsSl()
99 const repoType = isGit ? 'git' : isSl ? 'sl' : 'git'
100 const promptContent = getPromptContent(repoType)
101 const finalContent = await executeShellCommandsInPrompt(
102 promptContent,
103 {
104 ...context,
105 getAppState() {
106 const appState = context.getAppState()
107 return {
108 ...appState,
109 toolPermissionContext: {
110 ...appState.toolPermissionContext,
111 alwaysAllowRules: {
112 ...appState.toolPermissionContext.alwaysAllowRules,
113 command: ALLOWED_TOOLS,
114 },
115 },
116 }
117 },
118 },
119 '/commit',
120 )
121
122 return [{ type: 'text', text: finalContent }]
123 },
124} satisfies Command
125
126export default command

Callers

nothing calls this directly

Calls 2

getPromptContentFunction · 0.70

Tested by

no test coverage detected