| 1 | import type { OrchestratorFixtureInput } from "../shared.ts"; |
| 2 | |
| 3 | export const MUSE_PERMISSION_APPROVED_FILE = "muse-approved.txt"; |
| 4 | export const MUSE_PERMISSION_DECLINED_FILE = "muse-declined.txt"; |
| 5 | |
| 6 | /** |
| 7 | * A Supervised Muse thread asks before each shell command. The first command |
| 8 | * is approved and runs; the second is declined through Muse's Reject choice, |
| 9 | * because Muse shell approvals offer no plain "deny". |
| 10 | */ |
| 11 | export function musePermissionInput(): OrchestratorFixtureInput { |
| 12 | return { |
| 13 | runtimeMode: "approval-required", |
| 14 | steps: [ |
| 15 | { |
| 16 | type: "message", |
| 17 | text: `Run the shell command \`touch ${MUSE_PERMISSION_APPROVED_FILE}\` with your shell tool, then reply DONE.`, |
| 18 | }, |
| 19 | { type: "approve_next_runtime_request" }, |
| 20 | { |
| 21 | type: "message", |
| 22 | text: `Run the shell command \`touch ${MUSE_PERMISSION_DECLINED_FILE}\` with your shell tool once. If it is rejected, do not retry; reply REJECTED.`, |
| 23 | }, |
| 24 | { type: "approve_next_runtime_request", decision: "decline" }, |
| 25 | ], |
| 26 | }; |
| 27 | } |