MCPcopy Create free account
hub / github.com/Gan-Xing/CodexBridge / enqueuePendingRestartNotification

Function enqueuePendingRestartNotification

src/cli.ts:902–920  ·  view source on GitHub ↗
({
  stateDir,
  externalScopeId,
  content,
}: {
  stateDir: string;
  externalScopeId: string;
  content: string;
})

Source from the content-addressed store, hash-verified

900}
901
902async function enqueuePendingRestartNotification({
903 stateDir,
904 externalScopeId,
905 content,
906}: {
907 stateDir: string;
908 externalScopeId: string;
909 content: string;
910}) {
911 const filePath = pendingRestartNotificationsFile(stateDir);
912 const current = readPendingRestartNotifications(filePath)
913 .filter((item) => item.externalScopeId !== externalScopeId);
914 current.push({
915 externalScopeId,
916 content,
917 queuedAt: new Date().toISOString(),
918 });
919 writePendingRestartNotifications(filePath, current);
920}
921
922function pendingRestartNotificationsFile(stateDir: string) {
923 return path.join(stateDir, 'runtime', 'weixin-restart-notifications.json');

Callers 2

cli.test.tsFile · 0.85
queueWeixinBridgeRestartFunction · 0.85

Tested by

no test coverage detected