(value: HarnessId)
| 34 | * defensively). |
| 35 | */ |
| 36 | export function setHarness(value: HarnessId): void { |
| 37 | if (harnessLocked && currentHarness !== value) { |
| 38 | throw new Error( |
| 39 | `Magic Context: harness already locked to "${currentHarness}"; cannot change to "${value}"`, |
| 40 | ); |
| 41 | } |
| 42 | currentHarness = value; |
| 43 | harnessLocked = true; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Get the current harness identifier. Used by storage modules when |
no outgoing calls