MCPcopy Index your code
hub / github.com/ByBrawe/opencode-loop / maybeCompact

Function maybeCompact

src/index.js:700–709  ·  view source on GitHub ↗
(client, sessionID, job)

Source from the content-addressed store, hash-verified

698}
699
700async function notifyJob(directory, job, reason) {
701 if (!job.notifyCommand) return
702 const command = String(job.notifyCommand).replace(/\{reason\}/g, String(reason || "")).replace(/\{job\}/g, String(job.name || job.id || ""))
703 await runShellCommand(command, directory, 60_000)
704}
705
706function dangerousShell(command) {
707 const text = String(command || "").toLowerCase()
708 return [/\brm\s+-rf\b/, /\bgit\s+reset\b/, /\bgit\s+clean\b/, /\bgit\s+push\b/, /\bdel\s+\/s\b/, /\brmdir\s+\/s\b/, /\bformat\b/, /\bterraform\s+destroy\b/, /\bkubectl\s+delete\b/, /\bdeploy\b.*\bproduction\b/].some((pattern) => pattern.test(text))
709}
710
711function actionKind(action, job = {}) {
712 const text = String(action || "").trim()

Callers 1

maybeRunDueJobsFunction · 0.85

Calls 2

nowFunction · 0.85
compactSessionFunction · 0.85

Tested by

no test coverage detected