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

Function loadAndonTargetOrBail

orchestrate/skills/orchestrate/scripts/cli/util.ts:551–572  ·  view source on GitHub ↗
(opts: { workspace?: string })

Source from the content-addressed store, hash-verified

549}
550
551export function loadAndonTargetOrBail(opts: { workspace?: string }): {
552 slack: SlackAdapter;
553 ref: { channel: string; ts: string };
554} {
555 if (!opts.workspace) {
556 throw new PlanValidationError("pass --workspace");
557 }
558 const planPath = join(resolve(opts.workspace), "plan.json");
559 const plan = parsePlanJson(readFileSync(planPath, "utf8"), planPath);
560 if (!plan.slackKickoffRef) {
561 throw new PlanValidationError(
562 `${planPath} has no slackKickoffRef; run the workspace once so Slack visibility is initialized`
563 );
564 }
565 const slack = createSlackAdapter(plan.slackKickoffRef.channel);
566 if (!slack) {
567 throw new PlanValidationError(
568 "set SLACK_BOT_TOKEN before running andon commands"
569 );
570 }
571 return { slack, ref: plan.slackKickoffRef };
572}
573
574export async function loadOrBail(
575 workspace: string,

Callers 1

registerAndonCommandsFunction · 0.90

Calls 2

parsePlanJsonFunction · 0.90
createSlackAdapterFunction · 0.90

Tested by

no test coverage detected