MCPcopy Create free account
hub / github.com/cursor/plugins / dispatcherInstruction

Function dispatcherInstruction

orchestrate/skills/orchestrate/scripts/cli/util.ts:349–363  ·  view source on GitHub ↗
(firstName: string | undefined)

Source from the content-addressed store, hash-verified

347}
348
349function dispatcherInstruction(firstName: string | undefined): string {
350 const raw = firstName?.trim();
351 if (!raw) return "";
352 // Slack first_name is operator-controlled but not vetted. Strip every
353 // interpolation hazard once so a `"`, backtick, backslash, or `{{...}}`
354 // can't malform the prompt, crash renderPromptTemplate's leftover-
355 // placeholder check, or break the JSON literal the planner copies into
356 // plan.json. JSON.stringify handles `"` and `\`; the regex covers
357 // newlines, backticks, and curly braces.
358 const safe = raw.replace(/[\r\n`{}]/g, " ");
359 const safeJson = JSON.stringify(safe);
360 // Leading newline slots this between the summary instruction and the
361 // bootstrapping paragraph in the rendered kickoff prompt.
362 return `\n\nOperator: ${safe}. Set \`plan.dispatcher = { firstName: ${safeJson} }\` so the kickoff bot reads ${JSON.stringify(`${safe}'s bot`)}.`;
363}
364
365function slackChannelInstruction(slackChannel: string | undefined): string {
366 if (!slackChannel) return "";

Callers 1

buildKickoffPromptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected