( t: PlanTask, agentId: string | undefined, ctx: PromptRenderContext )
| 260 | } |
| 261 | |
| 262 | function buildSlackBlock( |
| 263 | t: PlanTask, |
| 264 | agentId: string | undefined, |
| 265 | ctx: PromptRenderContext |
| 266 | ): string { |
| 267 | const ref = ctx.plan.slackKickoffRef; |
| 268 | // `agentIdFlag` is rendered into CLI invocations directly. Omit the flag |
| 269 | // entirely when no agentId is known so a worker doesn't copy a malformed |
| 270 | // `--agent-id --workspace` into shell. |
| 271 | const agentIdFlag = agentId ? ` --agent-id ${agentId}` : ""; |
| 272 | const slackBlock = ref |
| 273 | ? renderPromptTemplate("slack-block", { |
| 274 | channel: ref.channel, |
| 275 | threadTs: ref.ts, |
| 276 | destination: `slack:${ref.channel}:${ref.ts}`, |
| 277 | taskName: t.name, |
| 278 | agentIdFlag, |
| 279 | }) |
| 280 | : ""; |
| 281 | const andonBlock = ref |
| 282 | ? renderPromptTemplate("andon-block", { agentIdFlag }) |
| 283 | : ""; |
| 284 | return `${slackBlock}${andonBlock}`; |
| 285 | } |
| 286 | |
| 287 | function buildPromptScopedGoal(t: PlanTask): string { |
| 288 | const inlineBrief = buildInlineBriefBlock(t); |
no test coverage detected