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

Function getPromptForCommand

src/tools/WorkflowTool/createWorkflowCommand.ts:120–158  ·  view source on GitHub ↗
(args, toolUseContext)

Source from the content-addressed store, hash-verified

118 hooks,
119 skillRoot: baseDir,
120 async getPromptForCommand(args, toolUseContext) {
121 let finalContent = `Base directory for this workflow: ${baseDir}\n\n${markdownContent}`
122
123 finalContent = substituteArguments(
124 finalContent,
125 args,
126 true,
127 argumentNames,
128 )
129
130 finalContent = finalContent.replace(
131 /\$\{CLAUDE_SESSION_ID\}/g,
132 getSessionId(),
133 )
134
135 finalContent = await executeShellCommandsInPrompt(
136 finalContent,
137 {
138 ...toolUseContext,
139 getAppState() {
140 const appState = toolUseContext.getAppState()
141 return {
142 ...appState,
143 toolPermissionContext: {
144 ...appState.toolPermissionContext,
145 alwaysAllowRules: {
146 ...appState.toolPermissionContext.alwaysAllowRules,
147 command: allowedTools,
148 },
149 },
150 }
151 },
152 },
153 `/${workflowName}`,
154 shell,
155 )
156
157 return [{ type: 'text', text: finalContent }]
158 },
159 } satisfies Command
160}
161

Callers

nothing calls this directly

Calls 3

substituteArgumentsFunction · 0.85
getSessionIdFunction · 0.85

Tested by

no test coverage detected