MCPcopy Create free account
hub / github.com/ByBrawe/opencode-loop / goalReportText

Function goalReportText

src/index.js:1002–1028  ·  view source on GitHub ↗
(job)

Source from the content-addressed store, hash-verified

1000 const entry = handledCommands.get(key);
1001 if (!entry || now() - entry.time >= COMMAND_DEDUPE_MS) {
1002 handledCommands.delete(key);
1003 return false;
1004 }
1005 if (entry.pending <= 1)
1006 handledCommands.delete(key);
1007 else
1008 handledCommands.set(key, { time: entry.time, pending: entry.pending - 1 });
1009 return true;
1010}
1011function hasHandledCommandEvent(sessionID, messageID) {
1012 return handledCommandEvents.has(commandEventKey(sessionID, messageID));
1013}
1014function markHandledCommandEvent(sessionID, messageID) {
1015 handledCommandEvents.set(commandEventKey(sessionID, messageID), now());
1016}
1017function forgetHandledCommandEvent(sessionID, messageID) {
1018 handledCommandEvents.delete(commandEventKey(sessionID, messageID));
1019}
1020function clearCommandLifecycle(sessionID) {
1021 const prefix = `${sessionID}:`;
1022 for (const key of handledCommands.keys())
1023 if (key.startsWith(prefix))
1024 handledCommands.delete(key);
1025 for (const key of handledCommandEvents.keys())
1026 if (key.startsWith(prefix))
1027 handledCommandEvents.delete(key);
1028}
1029function commandName(name) {
1030 return String(name || "");
1031}

Callers 1

writeGoalReportFunction · 0.85

Calls 1

goalStatusTextFunction · 0.85

Tested by

no test coverage detected