(directory, client, sessionID, args)
| 1497 | const command = action.replace(/^[!$]\s*/, "").trim() |
| 1498 | if (job.safe && dangerousShell(command)) { |
| 1499 | await toast(client, `Blocked dangerous shell command in safe mode: ${command}`, "error") |
| 1500 | await appendLoopLog(directory, "blocked", { sessionID, job: job.name || job.id, command }) |
| 1501 | return { startsAssistantTurn: false } |
| 1502 | } |
| 1503 | guardLoopOwnedUserMessage(sessionID) |
| 1504 | fireSdk( |
| 1505 | client, |
| 1506 | "session.shell", |
| 1507 | client.session.shell.bind(client.session), |
| 1508 | { path: { id: sessionID }, body: { command } }, |
| 1509 | { path: { sessionID }, body: { command } }, |
| 1510 | { sessionID, command }, |
| 1511 | ) |
| 1512 | return { startsAssistantTurn: true } |
| 1513 | } |
no test coverage detected