MCPcopy
hub / github.com/openclaw/clawsweeper / markReconciledState

Function markReconciledState

src/clawsweeper.ts:18467–18486  ·  view source on GitHub ↗
(
  markdown: string,
  state: "open" | "closed",
  options: { closedAt?: string | null | undefined } = {},
)

Source from the content-addressed store, hash-verified

18465}
18466
18467function markReconciledState(
18468 markdown: string,
18469 state: "open" | "closed",
18470 options: { closedAt?: string | null | undefined } = {},
18471): string {
18472 let nextMarkdown = replaceFrontMatterValue(markdown, "current_state", state);
18473 nextMarkdown = replaceFrontMatterValue(nextMarkdown, "reconciled_at", new Date().toISOString());
18474 if (state === "closed" && options.closedAt) {
18475 nextMarkdown = replaceFrontMatterValue(
18476 nextMarkdown,
18477 "current_item_closed_at",
18478 options.closedAt,
18479 );
18480 }
18481 if (state === "open") {
18482 nextMarkdown = replaceFrontMatterValue(nextMarkdown, "review_status", "stale_reopened");
18483 nextMarkdown = replaceFrontMatterValue(nextMarkdown, "action_taken", "kept_open");
18484 }
18485 return nextMarkdown;
18486}
18487
18488function moveMarkdownFile(options: {
18489 sourcePath: string;

Callers 1

reconcileFoldersFunction · 0.85

Calls 1

replaceFrontMatterValueFunction · 0.85

Tested by

no test coverage detected